> [!IMPORTANT] > > [OCF](https://the-ocf.org/) - [github.com/open-constructs](https://github.com/open-constructs) has stepped up to fork under the new name of [CDK Terrain - cdktn.io](http://cdktn.io)
npm install @cdktn/provider-project> [!IMPORTANT]
>
> OCF - github.com/open-constructs has stepped up to fork under the new name of CDK Terrain - cdktn.io
---
A project template for projen to create repositories for prebuilt provider packages for Terraform CDK.
The provider repos are entirely auto generated from the configuration contained in this repo here. There's no manual interaction necessary, except for creating the initial repository - using this repo. The cdktf get command is executed as part of the build pipeline in Github Actions. These jobs are executed on a schedule. Hence, new provider changes will be picked up automatically.
> [!NOTE]
> Only Offical Terraform Providers or Hashicorp partner Terraform Poviders will be accepted for pre-built provider generation.
Add a new repository over here.
In the newly created repository, all we need is a .projenrc.js file like this:
``js
const { CdktnProviderProject } = require('@cdktn/provider-project');
const { Semver } = require('projen');
const project = new CdktnProviderProject({
terraformProvider: "aws@~> 2.0"
});
project.synth();
`
Adjust the terraformProvider attribute as required and run the following commands:
``
npm install @cdktn/provider-project@latest
npx projen
yarn install
This will generate an entire repository ready to be published, including Github Workflows for publishing NPM, Pypi and maven packages. The only thing which is needed to be set manually are the tokens for these registries:
- NPM_TOKENTWINE_PASSWORD
- TWINE_USERNAME
-
Commit and push the required changes to this repository here and wait for the auto-release to happen. Once released, you can run the following commands in the target provider repository:
```
npm install @cdktn/provider-project@latest
npx projen
yarn install
Commit, push and check for the auto-released version.
Whatever needs to be changed in the downstream provider repositories should be done via the code definitions here.
For local development, yarn link might be quite helpful for testing.
1. Maven publishing is disabled (TODO: re-enable when requested and infra available)
1. NuGet publishing is disabled (TODO: re-enable when requested and infra available)