You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
The text was updated successfully, but these errors were encountered:
That expectation is off, by using Fn.join you are invoking the terraform function join that you can see rendered in your output. If you want foobar you need to use the programming language join, so e.g. ["foo", "bar"].join("").
terraform apply ╷ │ Error: Missing key/value separator │ │ on cdk.tf.json line 26, in resource.local_file.ruwentest: │ 26: "content": "${jsonencode({\"join(\"\", [\"foo\", \"bar\"])\" = undefined})}", │ │ Expected an equals sign ("=") to mark the beginning of the attribute value. ╵
Let me add a bit of context:
I am using cdktf as a glorified terraform code generator. I just generate the code and then use the generated terraform json in my various environments.
As part of that I am generating IAM policies from various outputs of other resources.
In general the join works. If I use Fn.join to generate the value side of a json object, it works. Just not on the keyside.
Expected Behavior
Given the following short example:
I would expect to have a json file
since the Fn.join function should join foo and bar together.
The relevant line in the cdk json should look like this:
Actual Behavior
When I run cdktf synth, it is successful. But the generated json looks like this:
When I run it with --hcl, it is also broken, but slightly worse:
Steps to Reproduce
Versions
language: typescript
cdktf-cli: 0.20.4
node: v18.15.0
cdktf: 0.20.4
constructs: 10.3.0
jsii: null
terraform: 1.7.2
arch: x64
os: linux 6.1.0-17-amd64
providers
@cdktf/provider-aws (PREBUILT)
terraform provider version: 5.33.0
prebuilt provider version: 19.2.0
cdktf version: ^0.20.0
@cdktf/provider-kubernetes (PREBUILT)
terraform provider version: 2.25.2
prebuilt provider version: 11.0.0
cdktf version: ^0.20.0
@cdktf/provider-local (PREBUILT)
terraform provider version: 2.4.1
prebuilt provider version: 10.0.0
cdktf version: ^0.20.0
Providers
┌───────────────┬──────────────────┬─────────┬────────────┬────────────────────────────┬─────────────────┐
│ Provider Name │ Provider Version │ CDKTF │ Constraint │ Package Name │ Package Version │
├───────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤
│ aws │ 5.33.0 │ ^0.20.0 │ │ @cdktf/provider-aws │ 19.2.0 │
├───────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤
│ kubernetes │ 2.25.2 │ ^0.20.0 │ │ @cdktf/provider-kubernetes │ 11.0.0 │
├───────────────┼──────────────────┼─────────┼────────────┼────────────────────────────┼─────────────────┤
│ local │ 2.4.1 │ ^0.20.0 │ │ @cdktf/provider-local │ 10.0.0 │
└───────────────┴──────────────────┴─────────┴────────────┴────────────────────────────┴─────────────────┘
Gist
No response
Possible Solutions
No response
Workarounds
No response
Anything Else?
No response
References
No response
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: