Problem:
Recently we encountered a problem with respect to maximum number of resources that you can declare in a single CloudFormation template. A template can support a maximum of 200 resources and we are very close to reach that limit.
To specify more resources, we need to separate our template into multiple templates by using Nested Stacks, We are evaluating a best approach to breakdown the template.
Our approach:
We have created a nested stack from our main stack and removed some of the resources from main stack and added them into new nested stack.
Error:
We encountered an error in nested stack e.g.
Resource already exists in Root stack
1. Is it possible to break our main template into nested stacks with existing resources? i.e move our existing resources under nested stack? or we just need to add new resources into nested stack and keep our main stack as it is with existing resources ?
2. We already reached 200 resource limit so it's difficult to add more nested stacks as well.
Resources in template,
We roughly have 100 CloudWatch alarms, DynamoDB tables, Lambda's, ES, KMS, S3 and other resources, we wan't to separate them into nested stacks specific to resource types.