nerdexam
Amazon

DVA-C02 · Question #410

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…

The correct answer is C. Use AWS CloudFormation to create an infrastructure template in JSON format to deploy the EC2. AWS CloudFormation is the purpose-built service for defining infrastructure as code using JSON or YAML templates, allowing you to provision EC2 instances and related resources in a repeatable, consistent manner - it natively supports stack updates, rollbacks to previous stack…

Submitted by packet_pusher· Mar 5, 2026Deployment

Question

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?

Options

  • AUse AWS Amplify for automatic deployment templates. Use a traffic-splitting deployment to copy
  • BUse AWS CodeBuild for automatic deployment. Upload the required AppSpec file template. Save
  • CUse AWS CloudFormation to create an infrastructure template in JSON format to deploy the EC2
  • DUse AWS AppSync to deploy the application. Upload the template as a GraphQL schema.

How the community answered

(51 responses)
  • A
    8% (4)
  • B
    4% (2)
  • C
    86% (44)
  • D
    2% (1)

Explanation

AWS CloudFormation is the purpose-built service for defining infrastructure as code using JSON or YAML templates, allowing you to provision EC2 instances and related resources in a repeatable, consistent manner - it natively supports stack updates, rollbacks to previous stack states, and creating identical environments across accounts or regions.

Why the distractors are wrong:

  • A (Amplify): Amplify is designed for frontend/web app deployments (React, Angular, etc.), not general EC2 infrastructure provisioning - traffic splitting is a deployment strategy, not an infrastructure templating solution.
  • B (CodeBuild): CodeBuild is a CI build service that compiles code and runs tests; AppSpec files belong to CodeDeploy, not CodeBuild, and neither replaces an infrastructure template.
  • D (AppSync): AppSync is a managed GraphQL API service - GraphQL schemas define API data shapes, not infrastructure deployment configurations for EC2.

Memory tip: Think of CloudFormation as the "blueprint architect" of AWS - just like a construction blueprint can be reused to build identical houses and you can revert to an older blueprint if the new design fails, CloudFormation templates create identical stacks and support rollback on failure. If the question mentions infrastructure templates, identical environments, or rollback, CloudFormation is almost always the answer.

Topics

#AWS CloudFormation#Infrastructure as Code#Automated Deployment#EC2 Deployment

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice