Courseiva

SAP-C02 Practice Question: Accelerate Workload Migration and Modernization

A company is migrating a multi-tier web application to AWS and wants to use Infrastructure as Code (IaC) to automate provisioning. Which AWS services can the company use to define and manage infrastructure declaratively? (Choose TWO.)

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

AWS CloudFormation

AWS CloudFormation (B) is correct because it lets you define infrastructure declaratively in JSON or YAML templates, and CloudFormation provisions and manages those resources as stacks. AWS Cloud Development Kit (CDK) (D) is also correct because it allows infrastructure to be defined declaratively using familiar programming languages, which then synthesizes into CloudFormation templates for deployment. AWS Elastic Beanstalk (A) is not the best fit because it is a PaaS that deploys applications from code or configuration but does not itself provide a general declarative IaC language for defining arbitrary infrastructure. AWS OpsWorks (C) uses Chef/Puppet for configuration management and is more procedural/imperative in practice, not a declarative IaC service in the CloudFormation/CDK sense. AWS CodeDeploy (E) is a deployment orchestration service for applications, not an infrastructure definition or provisioning service.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    AWS Elastic Beanstalk

    Why it's wrong here

    Elastic Beanstalk is a PaaS that provisions and manages application environments, not a declarative IaC tool for defining arbitrary infrastructure. It tempts because it automates provisioning, but that automation is opinionated and imperative from the user's view. CloudFormation and AWS CDK define infrastructure declaratively.

  • ✓

    AWS CloudFormation

    Why this is correct

    AWS CloudFormation defines infrastructure declaratively through JSON or YAML templates, letting the company version, review and provision the multi-tier stack repeatably. It satisfies the IaC requirement by managing resource creation and dependencies as code rather than manual console actions.

  • ✗

    AWS OpsWorks

    Why it's wrong here

    AWS OpsWorks is a configuration management service using Chef and Puppet stacks; it manages instances and applications but does not provide declarative template-based infrastructure definition. It is tempting as an automation tool, yet CloudFormation and CDK are the services that declare and provision AWS resources from templates.

  • ✓

    AWS Cloud Development Kit (CDK)

    Why this is correct

    AWS CDK lets you define infrastructure declaratively in TypeScript, Python or Java, then synthesises CloudFormation templates for deployment. This satisfies the IaC automation requirement by expressing the multi-tier application's resources as code, with constructs providing reusable, higher-level abstractions over raw CloudFormation.

  • ✗

    AWS CodeDeploy

    Why it's wrong here

    CodeDeploy automates application deployments to EC2, Lambda, or ECS; it does not define infrastructure declaratively. It is tempting because it is an infrastructure-adjacent developer tool, but CloudFormation and CDK are the services that declare and provision resources from templates.

About these practice questions

This SAP-C02 question is part of Courseiva's 984-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SAP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAP-C02 exam.