CLF-C02 Practice Question 39: Infrastructure as Code
AWS Certified Cloud Practitioner (CLF-C02) · Test 4 · question 9 of 10
A team built its development environment (a VPC, a load balancer, Amazon EC2 instances and an Amazon RDS database) by clicking through the AWS Management Console. It now needs identical test and production environments in another Region. Each environment must be created the same way every time, and every change must be tracked in version control. Which AWS service should the team use?
Show answer and explanation
Answer:
AWS CloudFormation is infrastructure as code. You describe your resources in a *template*, and CloudFormation provisions and configures them together as a *stack*. The same template can be reused to create the same resources consistently and repeatably, in multiple Regions. Because templates are text files, they can be kept in a version control system to show exactly what changed, who changed it, and when.
Option B, AWS Elastic Beanstalk, deploys and manages web *applications* for you: you upload code, and it creates the environment to run that code. It is not a general way to define a VPC and a database in a template and copy them. Option C, AWS Systems Manager, helps you operate resources that already exist, for example by patching them and running commands on them. It does not describe and create whole environments. Option D, AWS Config, records how resources are configured and checks them against rules. It shows what the environment looks like, but it cannot build one.
Reference: What is CloudFormation?