CLF-C02 Cloud Technology and Services Practice Question
A company plans to deploy a multi-tier web application on AWS. The architecture includes Amazon EC2 instances for the web and application tiers, an Application Load Balancer for traffic distribution, and an Amazon RDS database for the data tier. The company wants to automate the provisioning and configuration of all these AWS resources in a repeatable and predictable manner. The solution should allow the infrastructure definition to be stored in a version control system and be used to create identical environments for development, testing, and production with minimal manual effort. Which AWS service should the company use to define and manage the infrastructure as code?
⚠ Common exam trap
A common mix-up: candidates confuse AWS Elastic Beanstalk's ease-of-use with infrastructure-as-code, but Elastic Beanstalk manages the environment as a black box and does not allow you to version-control the individual resource definitions in a reusable template like CloudFormation does.
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 is the correct service because it enables you to define your entire multi-tier infrastructure—EC2 instances, Application Load Balancer, and RDS database—as a declarative JSON or YAML template. This template can be stored in a version control system and used to provision identical environments across development, testing, and production with a single API call, ensuring repeatability and predictability.
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 CloudFormation
Why this is correct
AWS CloudFormation is the correct choice because it provides true infrastructure as code: you write a declarative JSON or YAML template that defines every resource in your multi-tier stack—EC2 instances, an Application Load Balancer, Auto Scaling groups, RDS databases, security groups, and IAM roles—along with their dependencies and configuration. This template can be version-controlled in Git, peer-reviewed, and reused across environments, enabling repeatable, predictable provisioning and updates. CloudFormation also manages the lifecycle and rollback of the entire stack, giving you full control over the exact resource definitions.
- ✗
AWS Elastic Beanstalk
Why it's wrong here
AWS Elastic Beanstalk is incorrect for this scenario because, while it automates deployment and provisioning of applications, it is a platform-as-a-service (PaaS) offering that abstracts away the underlying infrastructure. You upload your code and Elastic Beanstalk automatically provisions resources like EC2 instances, load balancers, and databases, but you do not define those resources directly as version-controlled, reusable infrastructure code. This abstraction limits your ability to customize the exact resource configuration and to maintain the same level of infrastructure-as-code flexibility, versioning, and repeatability that CloudFormation provides.
When this WOULD be correct
A company wants to quickly deploy a web application without managing the underlying infrastructure, and needs automatic scaling, load balancing, and health monitoring with minimal configuration. Elastic Beanstalk would be the correct choice for a platform-managed deployment.
- ✗
AWS OpsWorks
Why it's wrong here
AWS OpsWorks is incorrect because it is a configuration management service that uses Chef or Puppet to automate how software is configured and installed on existing servers. It focuses on server configuration, such as installing packages, managing files, and running recipes, rather than declaratively provisioning a complete set of AWS resources across multiple services like VPC, EC2, ALB, and RDS. OpsWorks also has a different operational model—often using stacks and layers that are more manual and less suited to version-controlled, full-stack infrastructure-as-code compared to CloudFormation.
When this WOULD be correct
A company uses Chef recipes or Puppet manifests to manage software configuration on existing EC2 instances and needs a managed service to run these configuration management tools. AWS OpsWorks would be the correct answer for automating configuration management and application deployment using Chef or Puppet.
- ✗
AWS CodeDeploy
Why it's wrong here
AWS CodeDeploy is incorrect because it is solely an application deployment service, not an infrastructure provisioning service. It automates the deployment of application revisions to existing compute resources such as EC2 instances, on-premises servers, or Lambda functions, but it cannot create or manage the underlying infrastructure resources needed for a multi-tier web application (e.g., EC2, RDS, or the network stack). The infrastructure must already exist and be provisioned separately, so CodeDeploy does not address the requirement of defining and deploying the full multi-tier architecture as code.
When this WOULD be correct
A company needs to automate the deployment of application code to EC2 instances across multiple environments, ensuring zero downtime and rollback capabilities. The infrastructure is already provisioned, and the focus is on updating the application code consistently.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The CLF-C02 exam frequently reuses these exact scenarios with slightly different constraints.
✓AWS CloudFormationCorrect answer▾
Why this is correct
AWS CloudFormation is the correct choice because it provides true infrastructure as code: you write a declarative JSON or YAML template that defines every resource in your multi-tier stack—EC2 instances, an Application Load Balancer, Auto Scaling groups, RDS databases, security groups, and IAM roles—along with their dependencies and configuration. This template can be version-controlled in Git, peer-reviewed, and reused across environments, enabling repeatable, predictable provisioning and updates. CloudFormation also manages the lifecycle and rollback of the entire stack, giving you full control over the exact resource definitions.
✗AWS Elastic BeanstalkWrong answer — click to see why▾
Why this is wrong here
AWS Elastic Beanstalk is a PaaS service that automates deployment and scaling, but it abstracts the underlying infrastructure and does not allow defining resources as code in a version-controlled template. The question requires infrastructure as code (IaC) for repeatable, predictable provisioning, which CloudFormation provides.
★ When this WOULD be the correct answer
A company wants to quickly deploy a web application without managing the underlying infrastructure, and needs automatic scaling, load balancing, and health monitoring with minimal configuration. Elastic Beanstalk would be the correct choice for a platform-managed deployment.
Why candidates choose this
Elastic Beanstalk also automates provisioning and deployment, so candidates may confuse its managed platform capabilities with the infrastructure-as-code definition required by CloudFormation, overlooking the need for version-controlled infrastructure templates.
✗AWS OpsWorksWrong answer — click to see why▾
Why this is wrong here
AWS OpsWorks is a configuration management service that uses Chef and Puppet, but it is not designed for defining and managing infrastructure as code in a declarative template format like CloudFormation. The question specifically requires a service that allows infrastructure definition to be stored in version control and create identical environments, which is the core function of CloudFormation, not OpsWorks.
★ When this WOULD be the correct answer
A company uses Chef recipes or Puppet manifests to manage software configuration on existing EC2 instances and needs a managed service to run these configuration management tools. AWS OpsWorks would be the correct answer for automating configuration management and application deployment using Chef or Puppet.
Why candidates choose this
Candidates may confuse OpsWorks with infrastructure as code because it automates server configuration, but it focuses on configuration management rather than provisioning the entire infrastructure stack declaratively.
✗AWS CodeDeployWrong answer — click to see why▾
Why this is wrong here
AWS CodeDeploy automates code deployments to running instances, not the provisioning of infrastructure resources like EC2, ALB, or RDS. It does not define or manage the entire infrastructure as code.
★ When this WOULD be the correct answer
A company needs to automate the deployment of application code to EC2 instances across multiple environments, ensuring zero downtime and rollback capabilities. The infrastructure is already provisioned, and the focus is on updating the application code consistently.
Why candidates choose this
Candidates may confuse CodeDeploy with infrastructure-as-code tools because both involve automation and deployment, but CodeDeploy targets application code, not infrastructure resources.
Analysis generated from the official CLF-C02blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
About these practice questions
Courseiva writes every CLF-C02 question from scratch — 988 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CLF-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 CLF-C02 exam.