Closed RomainMuller closed 2 years ago
I encountered this myself in adding a work-around to implement EFS support for an ECS task - I could see this being a frequent issue if anybody needs to utilize the "Escape Hatch" for new features supported by Cloudformation.
I just encountered this when attempting to place a CloudWatch Synthetics Canary inside of an isolated VPC using an escape hatch:
const canaryCfn = canary.node.defaultChild as CfnCanary;
canaryCfn.addPropertyOverride("VPCConfig.VpcId", props.vpc.vpcId);
canaryCfn.addPropertyOverride("VPCConfig.SubnetIds", props.subnetIds);
canaryCfn.addPropertyOverride("VPCConfig.SecurityGroupIds", props.vpc.vpcDefaultSecurityGroup);
Where I'm passing a vpc
that was created in a different stack.
The previous code results in Error [ValidationError]: Template error: instance of Fn::GetAtt references undefined resource ...
during CDK deployment.
I'm using CDK v1.91.0
with Typescript.
Hi, same here, any workarounds?
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
This is still an issue, how can it be worked around?
Figured it out, you can use stack.exportValue()
to get resolved reference.
When making a cross-stack reference in a property override, the cross-stack references do not get processed into an export/import pair, and result in an invalid template.
This is effectively preventing usage of property overrides to work around the deficiencies of the
VPC
class if the VPC instance is in a separate stack.Reproduction Steps
I've created a simple (enough) repro of this issue here: RomainMuller/cdk-cross-stack-bug:test/cdk-cross-stack-bug.test.ts
Environment
This is :bug: Bug Report