Need a good reason to switch to Cloudformation YAML now? Template size limits…
By: Morten Jensen
AWS CloudFormation size limits are well-documented in the User Guide. However, this does not make hitting any of the limits any less painful. I recently hit the template body size limit in request (–template-body) of 51200 bytes on one of my templates. This adds the extra complexity of having to first upload the template to an S3 bucket. When you’re quickly iterating changes this becomes rather onerous very quickly.
I have therefore found that one of the advantages of switching to YAML now is that it generally takes up less space – I converted two of my JSON templates to YAML and achieved an average 15% reduction in size – crucially bringing me back down below the 51200 bytes limit so that I can bypass the S3 bucket upload in each iteration.
Add to that the ability to add comments and a perhaps more human-readable format and YAML is clearly a winner over JSON in general.
There are free tools available to assist with the conversion, including json2yaml, which makes it a relatively easy proposition to convert.