Skip to content
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

fix: Map keys not being quoted when they are not valid identifiers #3464

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

mutahhir
Copy link
Member

Related issue

Fixes #3459

Description

Terraform expects keys of maps to be valid identifiers, and the HCL synth was not ensuring that before. This PR tries to detect areas where quoting is required to ensure valid HCL is output.

Copy link
Contributor

@DanielMSchmidt DanielMSchmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few nits :)

packages/cdktf/lib/hcl/render.ts Outdated Show resolved Hide resolved
packages/cdktf/lib/hcl/render.ts Show resolved Hide resolved
@mutahhir mutahhir force-pushed the fix/wrap-non-identifier-keys branch from 65a692c to c8b29bc Compare January 25, 2024 15:52
@mutahhir mutahhir enabled auto-merge January 25, 2024 16:31
@mutahhir mutahhir added this pull request to the merge queue Jan 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 25, 2024
@ansgarm ansgarm merged commit 95eb0ae into main Jan 26, 2024
432 checks passed
@ansgarm ansgarm deleted the fix/wrap-non-identifier-keys branch January 26, 2024 08:07
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tags do not properly translate when doing cdktf synth --hcl
3 participants