Open rix0rrr opened 2 years ago
Needs a feature flag to fix
Is there anything happening on this issue? The crazy long names is bad as it is, but when doing a cross stack parameter reference between 2 nested stacks, the resulting parameter name is even crazier. Its currently not breaking anything for me, but I can't imagine this naming behavior is intended.
I would be interested too.. names are crazy long and am using cdk@2.26,
We just noticed this too - it would be great to clean this up and fix it.
re-posting my temporary solution for this here:
getLogicalId(element: CfnElement): string {
if (element.node.id.includes('NestedStackResource')) {
return /([a-zA-Z0-9]+)\.NestedStackResource/.exec(element.node.id)![1] // will be the exact id of the stack
}
return super.getLogicalId(element)
}
Place this inside your nested stacks to get a normal name like: ParentStackName-NestedStackName-LWJUNJMGDHO7
re-posting my temporary solution for this here:
getLogicalId(element: CfnElement): string { if (element.node.id.includes('NestedStackResource')) { return /([a-zA-Z0-9]+)\.NestedStackResource/.exec(element.node.id)![1] // will be the exact id of the stack } return super.getLogicalId(element) }
Place this inside your nested stacks to get a normal name like:
ParentStackName-NestedStackName-LWJUNJMGDHO7
this should be the default behaviour
any update on this? it's driving me crazy that we can't provide a custom name for nested stacks.
Any updates on this?
Any updates?
Also interested in updates on this issue. We have had to implement the solution @konstantinj posted for every project on a client that is using nested stacks.
Any Updates on this ? We're trying to implement the workaround mentioned but would be great to have this as a feature
What is the problem?
Recently, we found out the construct id of the nested stack occurred twice in its logical id.
For example:
Caused by the code here:
https://github.com/aws/aws-cdk/blob/2b6c2dadc039f7c4255f6864386ba1dd28b6fc4f/packages/%40aws-cdk/core/lib/nested-stack.ts#L123-L133