DOP-C02 SDLC Automation Practice Question
A DevOps engineer needs to automate the creation of a CI/CD pipeline using infrastructure as code. Which AWS service is BEST suited to define and provision the pipeline resources?
⚠ Common exam trap
Candidates often confuse the CI/CD service itself (CodePipeline) with the IaC service used to provision it (CloudFormation), leading them to select the tool that runs the pipeline rather than the tool that defines the pipeline's infrastructure.
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 choice because it is an infrastructure-as-code (IaC) service that allows you to define and provision AWS resources, including CI/CD pipeline components like CodePipeline, CodeBuild, and CodeDeploy, using declarative templates. This enables fully automated, repeatable, and version-controlled pipeline creation without manual intervention.
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
AWS Elastic Beanstalk is a platform-as-a-service (PaaS) offering that automates the deployment and scaling of web applications and environments, such as EC2 instances, load balancers, and auto scaling groups. It does not provide a way to define CI/CD pipeline resources as code; instead, it consumes an application bundle and manages the underlying infrastructure on your behalf. While Elastic Beanstalk has built-in deployment features or can integrate with CodePipeline, it is not an infrastructure-as-code tool for declaring pipeline components like build stages or approval actions.
- ✗
AWS CodePipeline
Why it's wrong here
AWS CodePipeline is the CI/CD orchestration service itself; it is the resource that you would create and manage, not the tool used to define infrastructure as code. CodePipeline allows you to model release processes by configuring stages, actions, and transitions, but it lacks the declarative template language and resource provisioning capabilities needed to codify all supporting resources (e.g., IAM roles, S3 buckets, CodeBuild projects) in a single reusable template. Thus, selecting CodePipeline confuses the service being automated with the mechanism for automation, which is the infrastructure-as-code layer.
- ✓
AWS CloudFormation
Why this is correct
AWS CloudFormation is the correct choice because it is a core infrastructure-as-code service that lets you define AWS resources, including CodePipeline pipelines, IAM roles, S3 buckets, and CodeBuild projects, in a declarative YAML or JSON template. A DevOps engineer can use CloudFormation to automate the creation of the entire CI/CD stack, ensuring version control, repeatability, and consistent environments across accounts or regions. CloudFormation also supports change sets and drift detection, making it a robust mechanism for provisioning and updating pipeline resources in a controlled, auditable way.
- ✗
AWS Service Catalog
Why it's wrong here
AWS Service Catalog is designed to create and manage curated catalogs of approved IT services and products, typically for end users to launch pre-approved resources (like EC2, RDS, or even CloudFormation stacks). It is a governance and distribution layer, not a mechanism for defining CI/CD pipelines directly; while Service Catalog can provision CloudFormation templates, those templates are the actual infrastructure definitions, and Service Catalog itself does not author or execute pipeline creation. Therefore, using Service Catalog would be an indirect and inappropriate path for automating the creation of a CI/CD pipeline.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,298-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 →
Same concept, more angles
1 more way this is tested on DOP-C02
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A team wants to automate the creation of a CI/CD pipeline using a JSON/YAML file that defines source, build, and deploy stages. Which AWS service should they use?
easy- ✓ A.AWS CloudFormation
- B.AWS Elastic Beanstalk
- C.AWS CodePipeline
- D.AWS CodeDeploy
Why A: AWS CloudFormation is the correct service because it allows you to define infrastructure as code (IaC) using JSON or YAML templates, which can include the creation of a CI/CD pipeline by defining resources like AWS CodePipeline, CodeBuild, and CodeDeploy. This enables full automation of the pipeline's source, build, and deploy stages through a declarative template, rather than manually configuring each service. The question specifically asks for automating the creation of the pipeline itself using a JSON/YAML file, which is exactly what CloudFormation does.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-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 DOP-C02 exam.