Open jsteinich opened 3 years ago
For the use case of writing a cdktf script that generates Terraform code, it looks like the CLI is not needed. I haven't used feature flags so far, so the output from cdktf-cli and running scripts directly has been the same for me.
I'm processing the generated JSON with Terraform afterwards. cdktf still requires Terraform to do the grunt work too, so the added benefit is somewhat limited.
It's understandable that more advanced features, such as Terraform Cloud integration, wouldn't work, but I think it would make sense to support the basic use case described above as well.
Comparison with other IaC toolkits:
- Feature flags aren't applied when running app directly. This impacts the naming of resources. I don't have a good reason for the discrepancy.
This just bit me hard and essentially destroyed an entire stack with lots of stuff requiring manual fixes now. That's really something we'll have to address.
- Feature flags aren't applied when running app directly. This impacts the naming of resources. I don't have a good reason for the discrepancy.
This just bit me hard and essentially destroyed an entire stack with lots of stuff requiring manual fixes now. That's really something we'll have to address.
Is there any workaround for this? I was developing my app using 'cdktf synth' and wrote quite a large infrasctructure with it, now i'm trying to run the app and I think i'm hitting the situation youre describing.
the modules names changed from:
module.quero2pay-dataplatform-eks-eks-cluster.module.node_groups.aws_launch_template.workers["main"]
to module.baseinfrastructurestack_quero2paydataplatformeksekscluster_F8C7987B.module.node_groups.aws_launch_template.workers["main"]
Not sure it's the same situation but it looks like it.
thank you!
Is there any workaround for this? I was developing my app using 'cdktf synth' and wrote quite a large infrasctructure with it, now i'm trying to run the app and I think i'm hitting the situation youre describing.
You could try setting the CDKTF_CONTEXT_JSON
environment variable to a json string of your cdktf.json
file.
hi, I'm hit by https://github.com/hashicorp/terraform-cdk/issues/2550 issue which looks like related to this one. Any news about this issue?
I saw a great work around for naming inconsistencies in another issue: https://github.com/hashicorp/terraform-cdk/issues/2341#issuecomment-1326760534
Hi. What are the actual differences of running the cdktf code directly vs using the cdktf cli? (Apart from the CLI flags ofc)
I just did a quick comparison and I can't tell the difference.
Both yarn run cdktf synth --app 'yarn run tsx main.ts'
and yarn run tsx main.ts
still generated the cdktf json files.
Community Note
Description
We should document the differences between
cdktf synth
vs running application directly and then eliminate differences where it makes sense. Starting list of differences:682 proposes adding hooks which would be cli only
References