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

lifecycle: replaceTriggeredBy should not be a string interpolation #3532

Open
1 task
wayneslabs opened this issue Mar 3, 2024 · 0 comments
Open
1 task
Labels
bug/has-workaround A bug with a workaround (may not be elegant) bug Something isn't working cdktf priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters.

Comments

@wayneslabs
Copy link

Expected Behavior

When a value is provided for lifecycle.replaceTriggeredBy, it should not use string interpolation in the final terraform code.

For example:

"lifecycle": {
    "replace_triggered_by": [
      "google_firebaserules_ruleset.MainRuleSet"
    ]
  }

Actual Behavior

Currently, it creates a string interpolation

For example:

"lifecycle": {
    "replace_triggered_by": [
      "${google_firebaserules_ruleset.MainRuleSet}"
    ]
  }

This throws an error:

╷
│ Error: Invalid character
│
│   on  line 33:
│   (source code not available)
│
│ This character is not used within the language.
╵

╷
│ Error: Invalid expression
│
│   on  line 33:
│   (source code not available)
│
│ Expected the start of an expression, but found an invalid expression token.

Steps to Reproduce

Create a resource with replaceTriggeredBy

lifecycle: { replaceTriggeredBy: [mainRuleSet] }

I got the error while following the steps for creating firebase rules, which requires replaceTriggeredBy: docs

Versions

language: typescript
cdktf-cli: 0.20.4
node: v20.10.0
cdktf: 0.20.4
constructs: 10.3.0
jsii: null
terraform: 1.7.4
arch: x64
os: MacOS Monterey

Providers

No response

Gist

No response

Possible Solutions

No response

Workarounds

Currently, it can be solved by manually constructing it, as noted at: issue comment

release.addOverride("lifecycle.replace_triggered_by", [
  mainRuleSet.terraformResourceType +
    "." +
    mainRuleSet.friendlyUniqueId,
]);

Anything Else?

No response

References

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • 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
@wayneslabs wayneslabs added bug Something isn't working new Un-triaged issue labels Mar 3, 2024
@ansgarm ansgarm added bug/has-workaround A bug with a workaround (may not be elegant) cdktf priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. and removed new Un-triaged issue labels Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/has-workaround A bug with a workaround (may not be elegant) bug Something isn't working cdktf priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters.
Projects
None yet
Development

No branches or pull requests

2 participants