-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-cdk): (Unable to create nested stack with > 500 resources) #28186
Comments
We probably should fix the logic here Before that, I guess you can unblock it by setting the context variable described here: |
Hi @benliger1987, in my mind, there is a difference between a nested stack and a child stack. The nested stack is the entire structure, which is made up of parent and child stacks, similar to a tree vs nodes. It does not seem plausible that just because a single stack is a child stack, that its resource limit jumps from 500 to 2500. I believe the 2500 limit is the sum of all the child stack's resources in the entire nested structure. (Otherwise this somewhat unbounds the resource limit.) Was this your understanding too? If so this may well be a bug. If not, your solution could be to split the stack that is approaching the individual stack limit into smaller stacks. In any case, the documentation is ambiguous and should be clarified. |
Im not sure what you're referring to by child stacks? There are only regular stacks and nested stacks no? |
My mental model does not have quite the same terminology as the documentation, apologies. Going off this page (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html), I see that what I was calling "child stacks" are "nested stacks". You are correct. After re-reading both documentation pages, I saw that the So I think the error message you are getting is correct. A nested stack could create up to 2500 resources per operation, but they will not be in a single template. |
I kind of see where you're getting at but not sure I fully follow your rationale. Would someone from AWS perhaps be able to weigh in here? |
I am at AWS! But I can see if someone with cloudformation specific domain knowledge has any context. However, I see the 500 resource limit per template as clear cut. |
Following the unblock advice from #28186 (comment) to set However I am seeing the following error. What is the actual maximum number of resources?
|
@scanlonp's assessment is correct here. Each stack, nested or otherwise, can only have up to 500 resources each. If you are performing some operation on the entire set of nested stacks within your stack hierarchy, you can perform that operation on up to 2500 resources at a time. So, you could have five stacks with 500 resources each in your stack hierarchy, or any other combination that is within that limit. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html for more details. |
|
Describe the bug
I am using a nested stack inside of a regular stack to get past the resource limit of 500 in a stack. After moving 413 resources to a nested stack I receive the following error on deployment:
[Info at /dev/Frontend/LambdasApi-dev] Number of resources: 413 is approaching allowed maximum of 500
Please note that
/dev/Frontend/LambdasApi-dev
refers to my nested stack.As per the resource limits stated in this table here:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html
Nested stacks should have a max resource limit of 2500, not 500 hence the bug.
The part of the repository that gives this warning is here, the nested stack class simply extends the stack with some modifications, resource limit is not one of those modifications:
aws-cdk/packages/aws-cdk-lib/core/lib/stack.ts
Line 1086 in 8e42fe6
Expected Behavior
I would expect to be able to create 2500 resources in a nested stack as per the documentation here:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html
Current Behavior
I receive a warning message if I am close to going over 500 resources in a nested stack and presumably an error if I do go over 500
Reproduction Steps
Possible Solution
Implement custom resource limits for Nested Stacks
Additional Information/Context
No response
CDK CLI Version
2.111.0
Framework Version
No response
Node.js Version
18.16.0
OS
Ubuntu
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: