Courseiva
Deployment →easyMultiple Choice

CV0-004 Deployment Practice Question

A company is deploying a new application on AWS and wants to automate the creation of infrastructure using infrastructure as code. The team needs to define resources such as Amazon VPC, subnets, and security groups in a template that can be version-controlled and reused across multiple environments. Which AWS service should they use?

⚠ Common exam trap

Test-takers frequently confuse infrastructure as code with application deployment services; Elastic Beanstalk and CodeDeploy automate deployments but do not define infrastructure resources like VPCs and subnets.

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 enables infrastructure as code, allowing the team to define and version AWS resources such as VPCs, subnets, and security groups in templates. It supports reuse across environments through parameters and mappings. Elastic Beanstalk, OpsWorks, and CodeDeploy serve different purposes and do not provide the same level of infrastructure definition and version control.

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 CodeDeploy

    Why it's wrong here

    AWS CodeDeploy is a deployment service that automates code deployments to EC2 instances, Lambda functions, or on-premises servers. It does not provision infrastructure or manage resources like VPCs and subnets. It is used for deploying application revisions, not for defining infrastructure as code.

  • ✓

    AWS CloudFormation

    Why this is correct

    AWS CloudFormation allows you to define infrastructure as code using JSON or YAML templates. It supports version control, parameterization, and reuse across environments. It can create and manage a wide range of AWS resources, including VPCs, subnets, and security groups, making it ideal for this scenario.

  • ✗

    AWS OpsWorks

    Why it's wrong here

    AWS OpsWorks is a configuration management service that uses Chef and Puppet. While it can manage infrastructure, it is not primarily an infrastructure as code service for defining AWS resources like VPCs and subnets. It focuses on application deployment and configuration management on existing instances.

  • ✗

    AWS Elastic Beanstalk

    Why it's wrong here

    AWS Elastic Beanstalk is a PaaS service that automates deployment of applications but does not provide granular infrastructure as code for networking components like VPCs and subnets. It abstracts away the underlying infrastructure, so it cannot be used to define and version those resources directly.

Visual reference

192.168.1.0 /24 256 addresses (254 usable) 192.168.1.0 /25 Subnet A 128 addr (126 usable) 192.168.1.128 /25 Subnet B 128 addr (126 usable) Borrowing 1 bit from host portion creates 2 subnets (/25)

About these practice questions

One of 834 original CV0-004 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

This CV0-004 practice question is part of Courseiva's free CompTIA 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 CV0-004 exam.