(core): Nested Stacks have a crazy logical ID
See original GitHub issueWhat is the problem?
Recently, we found out the construct id of the nested stack occurred twice in its logical id.
For example:
##### Parent infra stack #####
this.fdLifecycleCommonLambdas = new MyNestedStackConstruct(this, "MyNestedStackConstruct", {
...
});
#### Nested stack #####
export class MyNestedStackConstruct extends NestedStack {
...
constructor(parent: Construct, name: string, props: FdLifecycleCommonLambdasProps) {
super(parent, name);
}
...
}
#### Generated template ####
...
"Resources": {
"MyNestedStackConstructNestedStackMyNestedStackConstructNestedStackResource3E193B32": {
^^^^^^^^^^^ oh no ^^^^^^^^^^^^^^^^^^^^^^^
"Type": "AWS::CloudFormation::Stack",
"Properties": {}
...
}
Caused by the code here:
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Working with nested stacks - AWS CloudFormation
Nested stacks are stacks created as part of other stacks. You create a nested stack within another stack by using the AWS::CloudFormation::Stack resource....
Read more >A better way to structure AWS CDK projects around Nested ...
The idea is to use fewer stacks but without changing the logic (just the minimum necessary)!. Resources in the AWS CDK. Every time...
Read more >CloudFormation - Access Output of Parent Stack in Child ...
It seems you have two logical ID with the same name "LambdaTest", one in resource section and other in output section.
Read more >CDK tips, part 3 – how to unblock cross-stack references
Of course, this implies that the Stack with the export has to be deployed ... and the logical ID of the Output itself...
Read more >serverless-plugin-nested-stacks
Serverless AWS Nested Stacks. Yet another AWS nested stack plugin! ... (Required) The logical ID of the nested stack resource.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
re-posting my temporary solution for this here:
Place this inside your nested stacks to get a normal name like:
ParentStackName-NestedStackName-LWJUNJMGDHO7
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.