-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python] cdktf synh --hcl
produces unnecessary quotes and bad syntax
#3531
Comments
Hi there, |
It is still allowed for now, but it is not advised by mainstream conventions. Notably, quoted references are officially considered deprecated by Hashicorp a few years ago. And as a result, it wouldn't be ideal to continue to use such a syntax: https://discuss.hashicorp.com/t/terraform-0-12-14-released/3898 This also runs the risk of generated TF to be flagged by TF style checkers without additional intervention, which happens in my case. Here's a similar ticket cut in another project: |
Expected Behavior
locals {
x = "x"
y = local.x
}
Actual Behavior
locals {
x = "x"
y = "${local.x}"
}
Steps to Reproduce
Run
cdktf synth --hcl
Check
cdktf.out
Versions
cdktf debug
language: python
cdktf-cli: 0.20.4
node: v21.5.0
cdktf: 0.20.4
constructs: 10.3.0
jsii: 1.94.0
terraform: 1.7.2
arch: x64
os: linux 5.10.102.1-microsoft-standard-WSL2
python: Python 3.8.10
pip: pip 24.0 from /home/andylai/.local/lib/python3.8/site-packages/pip (python 3.8)
pipenv: pipenv, version 2023.11.17
providers
aws@~> 4.63 (LOCAL)
terraform provider version: 4.67.0
cdktf-cdktf-provider-aws (PREBUILT)
terraform provider version: 5.39.0
prebuilt provider version: 19.8.0
cdktf version: ^0.20.0
Providers
│ Provider Name │ Provider Version │ CDKTF │ Constraint │ Package Name │ Package Version │
├───────────────┼──────────────────┼─────────┼────────────┼──────────────────────────┼─────────────────┤
│ aws │ 4.67.0 │ │ ~> 4.63 │ │ │
├───────────────┼──────────────────┼─────────┼────────────┼──────────────────────────┼─────────────────┤
│ aws │ 5.39.0 │ ^0.20.0 │ │ cdktf-cdktf-provider-aws │ 19.8.0 │
Gist
No response
Possible Solutions
No response
Workarounds
Hardcode the values
Anything Else?
This behaviour causes issues with the terraform linters which are blocking PRs.
References
No response
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: