Convert AWS Cloudformation JSON templates into YAML

AWS have recently upgraded their Cloudformation engine to cope with YAML templates.  This is a major boon for us all! 🙂

Here is a small python script that will help convert your json templates over to yaml.

Your joins and user data will likely need a reformat after, however they should still be functional.

#!/usr/bin/env python
import sys
import json
import yaml
print yaml.dump(yaml.load(json.dumps(json.loads(open(sys.argv[1]).read()))), default_flow_style=False)

Alternatively you can use this great site:

http://www.json2yaml.com