Open eahrend opened 3 months ago
I am interested in working on this issue.
I am also experiencing this issue with Python, have tried providing just the resource variable and using .fqn as 3322 code changes suggest.
The workaround by @eahrend seems to work
lifecycle=TerraformResourceLifecycle(
replace_triggered_by=[
f"{self.__redshift_namespace.terraform_resource_type}.{self.__redshift_namespace.friendly_unique_id}",
]
)
"lifecycle": {
"replace_triggered_by": [
"aws_redshiftserverless_namespace.redshift__redshift_namespace"
]
},
I believe the underlying issue is that the fqn property includes the hcl templating syntax as shown below in the cdktf.json when I use fqn:
lifecycle=TerraformResourceLifecycle(
replace_triggered_by=[
f"{self.__redshift_namespace.fqn}",
]
)
"lifecycle": {
"replace_triggered_by": [
"${aws_redshiftserverless_namespace.redshift__redshift_namespace}"
]
},
I am not sure if fqn including the syntax is by design, but that seems to be the underlying issue.
any progress on this?
Expected Behavior
I should be able to create a replaceTriggeredBy lifecycle rule by specifying the FQN of the resource that I want to cause a replacement trigger for, like:
Actual Behavior
I get an invalid expression. The cdktf.json file shows:
Steps to Reproduce
Apply the stack with the relevant code.
Versions
Couldn't get the info from cdktf debug
npm list -g /Users/erik/.local/lib ├── cdktf-cli@0.20.1 └── cdktf@0.20.1 go version go version go1.21.6 darwin/arm64 terraform version Terraform v1.7.0 on darwin_arm64 Node.js v20.11.0
Running this command fails with this error:
Providers
Running this command fails with this error:
Gist
No response
Possible Solutions
No response
Workarounds
Workaround is to write it like this:
Anything Else?
No response
References
https://github.com/hashicorp/terraform-cdk/issues/3196 https://github.com/hashicorp/terraform-cdk/issues/1866#issuecomment-1155160808
Help Wanted
Community Note