A Simple Workflow for Building CloudFormation Templates

A Simple Workflow for Building CloudFormation Templates

https://start.jcolemorrison.com/a-simple-workflow-for-building-cloudformation-templates/


Related discussions:

I wish I had this available when I first began my path to cloudformation. I think what scares a lot of people is the thought “how on earth do I even begin writing this?”

The article is appreciated, and I agree with the general principles (build and understand the service first), but I think CDK is going to be the preferred method for handling CloudFormation in the very near future.

It’s admittedly a little rocky at the moment, but it’s ultimately far superior method to building a comprehensive and easy to understand (relatively speaking, anyway) and maintain set of definitions. It truly is the “infrastructure as code” we’ve been trying to achieve for some time.

This article is good advice for anyone getting started on their journey with cloudformation. It definitely pays off to spend time learning a service before trying to write cloudformation, especially when it comes to some more complex components like API Gateway - I’ve been writing CFN templates (using troposphere) for a number of years but will still follow these sort of steps when working with something new.

I can also recommend this useful browser plugin : https://github.com/iann0036/AWSConsoleRecorder

How does CDK differ from Pulumi?

This workflow looks great!

Where I work we are “all in” on CloudFormation. Now that CDK is out we are transitioning everything toward it.

We have zero interest in stuff like Troposphere, Terraform, or anything else that isn’t AWS native.

Troposphere makes cloudformation though. It can be immensely helpful when combined with boto3 to insert values into your templates that aren’t exposed by output exports or otherwise require probing of your current infrastructure. It is also good for making a loop of templates that work in multiple accounts which are not predictably identical. Don’t discount it yet.

A coworker and I also discovered that making a CloudFormation Template is easier when you first make the service in the console.

It gives a good guide when you have unknown dependencies that you need to declare and set.

Ugh JSON.. That’ll surely scare off everyone trying to learn CFn.

Just like any developer worth his salt. Google, copy/paste. Then try to make anything useful out of the mess, fail, cry, and eventually start from scratch with the knowledge built.