DVA-C02 Deployment Practice Question
A developer is designing a CI/CD pipeline for a serverless application using AWS CodePipeline. The pipeline must automatically build and deploy the application when changes are pushed to a CodeCommit repository. The application uses AWS CloudFormation for infrastructure provisioning. Which TWO actions should the developer include in the pipeline?
⚠ Common exam trap
Many candidates confuse AWS CodeDeploy with CloudFormation for serverless deployments, not realizing that CodeDeploy is for EC2/on-premises and CloudFormation is the correct service for provisioning serverless 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
✓
Use AWS CodeBuild to run unit tests and package the application.
AWS CodeBuild can compile source code, run unit tests, and produce deployment artifacts, which is a standard build phase in a CI/CD pipeline. Option E is correct because AWS CloudFormation is the native AWS service for provisioning and updating infrastructure as code, making it the appropriate deployment action for a serverless application defined in templates.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use AWS CodeDeploy to deploy the application to EC2 instances.
Why it's wrong here
AWS CodeDeploy is a deployment service primarily designed for automating application deployments to various compute services, including Amazon EC2 instances, AWS Fargate, and on-premises servers. However, a serverless application, by definition, abstracts away the underlying infrastructure and does not directly utilize or manage EC2 instances. Therefore, using CodeDeploy specifically for EC2 instances is an incorrect choice for deploying a serverless application, which typically relies on services like AWS Lambda, API Gateway, and DynamoDB.
- ✗
Use AWS CodeCommit as a deployment action.
Why it's wrong here
AWS CodeCommit is a fully managed source control service that hosts secure Git repositories. Its fundamental role within a CI/CD pipeline is to serve as the source stage, where developers store and manage their application's source code, configuration files, and infrastructure templates. CodeCommit is not designed to perform deployment actions; rather, it triggers subsequent pipeline stages like building, testing, or deploying, which are handled by other specialized AWS services.
- ✓
Use AWS CodeBuild to run unit tests and package the application.
Why this is correct
AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces deployable artifacts. For a serverless application, CodeBuild is an ideal choice for the build and test phase within a CI/CD pipeline. It can execute unit tests against the application code, compile any necessary language runtimes, and then package the application code along with its dependencies into a deployment-ready artifact, such as a .zip file, suitable for AWS Lambda.
- ✗
Use AWS Lambda to run integration tests.
Why it's wrong here
While AWS Lambda functions are capable of executing arbitrary code, including test scripts, directly using a raw Lambda function as a dedicated pipeline action for running integration tests within AWS CodePipeline is not the standard or most efficient architectural pattern. AWS CodeBuild is specifically designed and optimized for running various types of tests, including integration tests, within a CI/CD pipeline, offering better integration with CodePipeline, comprehensive logging, and artifact management capabilities.
- ✓
Use AWS CloudFormation to create or update the stack.
Why this is correct
AWS CloudFormation is an infrastructure as code (IaC) service that enables developers to define and provision AWS resources in a declarative template. For serverless applications, CloudFormation (often augmented by AWS Serverless Application Model - SAM) is the primary mechanism for deploying and managing the entire application stack, including Lambda functions, API Gateway endpoints, and other backend services. In a CI/CD pipeline, CloudFormation is used as a deployment action to reliably create new or update existing application stacks based on the defined templates.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
One of 1,135 original DVA-C02 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-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 DVA-C02 exam.