In order to be able to properly diff and read your CloudFormation templates you want them to be in a harmonised shape:

  1. Validity check and indentation
  2. Apply some regex search/replace transformations to improve human readability

This can be done on the shell: < template.json > beautified.json

Or in vim using a keybinding:

This is the Python script used to apply the transformations to the template: