Search code examples
amazon-web-servicesaws-cloudformation

How can I quickly and effectively debug CloudFormation templates?


CloudFormation allows programmatic AWS resource stack creation with single API calls. It's considered good AWS practice, especially when combined with Chef, Puppet, or cloud-init. Debugging it drives me to vice.

Stock MongoDB cluster templates fail. Stacks take 20-30 minutes to fail, and then minutes to delete, assuming resources properly delete at all.

I use --disable-rollback like oxygen. I wrap exit messages with cfn-signal and throw them like ballast off a sinking ship. How can I debug templates faster?


Solution

  • Use the aws cloudformation validate-template command in the AWS CLI tool.