Open wayneslabs opened 4 months ago
replaceTriggeredBy
should behave the same way like dependsOn
:
https://github.com/hashicorp/terraform-cdk/blob/4fd0a65ae698e999d3ba2590257fd770793dcf36/packages/cdktf/lib/terraform-resource.ts#L160-L164
So would changing from return x.fqdn;
to return dependable(x);
fix the issue?
As a workaround, I'm doing it like this in my code:
import { TerraformResource, dependable } from 'cdktf';
const monitoredResources: TerraformResource = [];
// Add relevant resources to array
new ApiGatewayDeployment(this, 'service_api_deployment', {
restApiId: apiGateway.id,
lifecycle: {
replaceTriggeredBy: monitoredResources.map(dependable),
},
});
Expected Behavior
When a value is provided for lifecycle.replaceTriggeredBy, it should not use string interpolation in the final terraform code.
For example:
Actual Behavior
Currently, it creates a string interpolation
For example:
This throws an error:
Steps to Reproduce
Create a resource with replaceTriggeredBy
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
Anything Else?
No response
References
3196
2082
Help Wanted
Community Note