
CloudFormation Template does count whitespaces in Template Size...
Context We hit the limit for AWS CloudFormation Template Size of 1 MB which caused our deployments into alpha , staging , and production to fail. Ideally the suggestion is: Use Nested Stacks Create more CloudFormation Templates Remove unnecessary resources, or consider consolidating IAM Roles and Policies We were going to follow our next steps to move the monitoring resources (example: AWS CloudWatch Alarms) into the Nested Stack, but doing a quick analysis using Claude led me to an interesting yet questionable find. Analysis I found that 50% of the CloudFormation Template Size was just whitespaces, which seems innocent but considering the 1 MB limit, that's a lot. To experiment, I ended up running jq to remove all the whitespaces using jq -c '.' cloudformation-stack-update.json > minified.json Within the Infrastructure Composer , I copied both the CloudFormation Templates, and clicked on the Validate Template button. The Regular Template showed that the file has exceeded the 1 MB limi
Continue reading on Dev.to
Opens in a new tab

