The Twelve Days of AWS: CloudFormation

12 Days of AWS Day 1 written around snowflakes with a penguin wearing a winter hat

On the 7th day of AWS, I would like to mention something that almost stays hidden behind the scenes when using Serverless, but is critical to its use.

CloudFormation allows you to spin up a stack of resources from a config file. It deals with the order of operations, timing and error handling on your behalf and makes it pretty easy to keep on top of all the elements of the stack.

The templates are YAML files and a lot of it is pretty much the same as the Serverless YAML config files since that is how Serverless gets the Lambdas set up.

On deploying a Lambda in Serverless, it wraps the code in a CloudFormation stack and uses CloudFormation to provision Roles, Users, S3, CloudWatch, and other resources, and push the Lambda into S3 and deploy it from there, along with configuring CloudWatch and any other elements that are required.

CloudFormation might also be used to set up a Route53 DNS with EC2 running behind it, in a replicable manner with the greatest of ease.