hashicorp / terraform-cdk

Define infrastructure resources using programming constructs and provision them using HashiCorp Terraform
https://www.terraform.io/cdktf
Mozilla Public License 2.0
4.88k stars 455 forks source link

cdktf: integrate cdktf-tf-module-stack natively #3728

Open shinebayar-g opened 2 months ago

shinebayar-g commented 2 months ago

Description

I think https://github.com/cdktf/cdktf-tf-module-stack should be a native option for cdktf projects. Package is fairly small, but functionality is the most important.

Documentation at https://developer.hashicorp.com/terraform/cdktf/concepts/hcl-interoperability#cdktf-to-hcl claims cdktf synth generated output can be used as a terraform module.

To use this as a Terraform module, run cdktf synth and copy the resulting cdktf.out/stacks/random-pet-module/cdk.tf.json file out to the module directory in your HCL project. By default, cdktf synth generates Terraform JSON, but starting from version 0.20, CDKTF can also generate Terraform HCL output by passing the --hcl flag to cdktf synth.

But it can't! It's quite misleading that it can be a used as a terraform module. Cdktf generated code contains provider and backend configuration, so it cannot be reused.

References

No response

Help Wanted

Community Note