When thinking about distributing L2 or L3 constructs, we'll need provider packages. Without, it's quite hard to define the dependency on used providers (e.g. Null Provider).

Current State
In order to do this at the moment by the example of aws-ecr-asset:
- Create / Publish
aws-ecr-asset package
- Add a note in the Readme / post install to add the
null provider to cdktf.json
- When there's a breaking change in one of the upstream packages, it'll break and the user will have dig through weird error messages
Desired State
We have prebuilt provider packages, with potentially a few predefined L2 / L3 constructs for each of these providers, which allows leaving the dependency management to proper tooling (npm et al). This would also get us closer to a workflow where there's essentially no need for a local Terrafor CLI (if the Terraform Cloud workflow is chosen).
The version of distributed packages shouldn't be tied to the original provider, but always track latest. The version would be mandated by changes to cdktf the <provider>-constructs and possibly breaking changes by the actual underlying Terraform Provider / Engine.
- The provider package gets auto-generated via
cdktf get
- It tracks
latest of the provider
- Users which require a specific provider version for some reason, will have to fallback to generate it manually by
cdktf get
Proposed Repo Structure
To allow individiual versioning of providers, I think it makes sense to use something like the following repo structure
hashicorp/terraform-cdk
- packages/cdktf
- packages/cdktf-cli
hashicorp/terraform-cdk-aws
- packages/@cdktf/aws # metapackage to pull in cdktf / aws provider / aws constructs
- packages/@cdktf/aws-provider
- packages/@cdktf/aws-constructs
hashicorp/terraform-cdk-azure
- packages/@cdktf/azure # metapackage to pull in cdktf / azure provider / azure constructs
- packages/@cdktf/azure-provider
- packages/@cdktf/azure-constructs
Conclusion
Personally, I think that L2 / L3 constructs will be the main selling point for the Terraform CDK. Therefore I'd consider this quite important.
Thoughts on this one?
When thinking about distributing L2 or L3 constructs, we'll need provider packages. Without, it's quite hard to define the dependency on used providers (e.g. Null Provider).
Current State
In order to do this at the moment by the example of
aws-ecr-asset:aws-ecr-assetpackagenullprovider tocdktf.jsonDesired State
We have prebuilt provider packages, with potentially a few predefined L2 / L3 constructs for each of these providers, which allows leaving the dependency management to proper tooling (npm et al). This would also get us closer to a workflow where there's essentially no need for a local Terrafor CLI (if the Terraform Cloud workflow is chosen).
The version of distributed packages shouldn't be tied to the original provider, but always track latest. The version would be mandated by changes to
cdktfthe<provider>-constructsand possibly breaking changes by the actual underlying Terraform Provider / Engine.cdktf getlatestof the providercdktf getProposed Repo Structure
To allow individiual versioning of providers, I think it makes sense to use something like the following repo structure
hashicorp/terraform-cdk
hashicorp/terraform-cdk-aws
hashicorp/terraform-cdk-azure
Conclusion
Personally, I think that L2 / L3 constructs will be the main selling point for the Terraform CDK. Therefore I'd consider this quite important.
Thoughts on this one?