AWS Certified Developer – Associate (DVA-C02) — Question 406

A developer needs to use a code template to create an automated deployment of an application onto Amazon EC2 instances. The template must be configured to repeat deployment, installation, and updates of resources for the application. The template must be able to create identical environments and roll back to previous versions.

Which solution will meet these requirements?

Answer options

Correct answer: C

Explanation

AWS CloudFormation is the ideal service for provisioning infrastructure as code, allowing developers to create repeatable environments, manage updates, and roll back automatically if deployment failures occur. CloudFormation helper scripts (such as cfn-init) are specifically designed to install software packages and start services on EC2 instances during stack creation. The other services listed—AWS Amplify (for web/mobile apps), AWS CodeBuild (for compiling code, not orchestrating EC2 deployments), and AWS AppSync (a managed GraphQL service)—are not designed for EC2 infrastructure provisioning and configuration management.