There are a variety of configuration management tools such as Puppet (https://puppet.com), Chef (https://www.chef.io), and Ansible (https://www.ansible.com), which are the most popular in configuration management.
AWS OpsWorks (https://aws.amazon.com/opsworks/) provides a managed Chef platform. The following screenshot is a Chef recipe (configuration) of installation of Amazon CloudWatch Log agent using AWS OpsWorks. It automates to install CloudWatch Log agent when launching an EC2 instance:
AWS CloudFormation (https://aws.amazon.com/cloudformation/) helps to achieve infrastructure as code. It supports the automation for AWS operation, for example, to perform the following functions:
- Creating a VPC.
- Creating a subnet on VPC.
- Creating an internet gateway on VPC.
- Creating a routing table to associate a subnet to the internet gateway.
- Creating a security group.
- Creating a VM instance.
- Associating a security group to a VM instance.
The configuration of CloudFormation is written by JSON as shown in the following screenshot:
It supports parameterize, so it is easy to create an additional environment with different parameters (for example, VPC and CIDR) using a JSON file with the same configuration. In addition, it supports the update operation. So, if there is a need to change a part of the infrastructure, there's no need to recreate. CloudFormation can identify a delta of configuration and perform only the necessary infrastructure operations on behalf of you.
AWS CodeDeploy (https://aws.amazon.com/codedeploy/) is also a useful automation tool. But focus on software deployment. It allows the user to define. The following are some actions onto the YAML file:
- Where to download and install.
- How to stop the application.
- How to install the application.
- After installation, how to start and configure an application.
The following screenshot is an example of AWS CodeDeploy configuration file appspec.yml: