Heard about AWS CloudFormation but not sure if it’s for you? Here’s everything you need to know about AWS CloudFormation, from how to use AWS CloudFormation templates, to the CloudFormation concepts and CloudFormation custom resources that you’ll need to get your head around if you want to start automating best practices with infrastructure as code. (This is part of an extensive series of guides about Iaas.)
What is AWS CloudFormation?
CloudFormation will help you to provision and configure your resources so that you can simplify infrastructure management, replicate infrastructure quickly without needing to individually create and configure resources on AWS, and track the changes that are happening in your AWS environment.
Anyone who works on AWS knows that often a single task will take a few different resources to manage. Let’s take a scalable web app with a database at the back-end. This will use load balancing, a database instance, and an auto-scaling group. With AWS CloudFormation, you don’t need to create each resource and then configure them to work as a whole. These are created together and work as a stack, and then you can use or delete this whole stack as a single entity.
What About AWS CloudFormation Templates?
AWS CloudFormation templates is the way that you save the relevant resources and their properties. These templates are what you use to create a stack. For example, every time an application needs additional availability in a new region, you may want to replicate it. Rather than doing it from scratch each time, you can create a template that establishes the resources you need, and simply replicate to the relevant regions, as many times as necessary.
Making Changes to CloudFormation Resources
Using AWS CloudFormation, you can also make small changes to existing templates, to save time when creating new infrastructure. Let’s say that your instances are foundationally set up the way that you want, but you’d like to switch to higher performance when you auto scale. Not only does AWS CloudFormation allow you to make this change quickly and easily from an existing template, if you create any issues as a result of whatever change you’ve made, you can easily roll back to a previous version. All AWS CloudFormation templates are kept as text files. Even non-technical stakeholders can quickly and simply track the differences between changes you’ve made to your environment, and easily compare two or more versions, including the who, what, when, where and why.
The CloudFormation Concepts You Should Know About
In order to fully understand how to get the most out of AWS CloudFormation, there are four new concepts that Amazon has introduced.
Template: This is a JSON or a YAML declarative code file. It will have all the information in text that explains the resources that will be used to deploy any given application.
Stack: This is the group of resources that you have described inside the template. When used in a stack, all of the resources can be managed and looked at as a single unit, for example their state and their dependencies.
Change Set: Imagine this like a preview, to show you the changes that will be put into place by any stack operations. For example, creating, updating, or removing and deleting any resources.
Stack Set: Just like a single stack is a group of resources established by a template, a stack set is a group of these stacks. These can be managed together as one, and can replicate a group in AWS.
If you’re looking to start seeing the benefits of infrastructure as code, such as automating best practices for ease of use, scaling your infrastructure more widely to new regions, integrating with other AWS services, or modeling, managing and provisioning resources with more control, check out more information on AWS.
If you’d like more advice about setting up your AWS environment with best-practices and insight in mind, get in touch directly to speak to one of our AWS visibility experts.
Learn More About AWS CloudFormation
Creating a Custom Resource in AWS CloudFormation
AWS CloudFormation is a powerful tool. Here’s How to create a custom resource and add it to your template.