DVA-C02 Deployment Practice Question
A developer is creating a deployment pipeline using AWS CodePipeline. The pipeline includes a source stage from Amazon S3, a build stage using AWS CodeBuild, and a deploy stage using AWS CloudFormation. The developer wants to ensure that the pipeline can automatically create the CloudFormation stack if it does not exist. Which action mode should the developer use in the CloudFormation deploy action?
⚠ Common exam trap
DVA-C02 often tests the confusion between CREATE_UPDATE and UPDATE_ONLY, so candidates must remember that CREATE_UPDATE is the only mode that handles both creation and updates seamlessly.
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
✓
CREATE_UPDATE
The CREATE_UPDATE action mode in AWS CodePipeline's CloudFormation deploy action creates the stack if it does not exist and updates it if it does. This is the default and most flexible mode, ensuring the pipeline can handle both initial deployment and subsequent updates 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.
- ✗
UPDATE_ONLY
Why it's wrong here
The UPDATE_ONLY action is strictly for modifying an already existing CloudFormation stack. If the specified stack name does not correspond to an active stack in the AWS account and region, the action will terminate with a failure. This behavior makes it unsuitable for the initial deployment of infrastructure, as it cannot create a new stack, thereby limiting its utility in a comprehensive continuous deployment pipeline that must handle both new and existing resources.
- ✓
CREATE_UPDATE
Why this is correct
The CREATE_UPDATE action in AWS CodePipeline's CloudFormation deploy stage is designed for idempotent infrastructure deployments. It intelligently determines whether a CloudFormation stack with the specified name already exists in the target account and region. If no stack is found, it initiates a new stack creation; otherwise, it performs an update operation on the existing stack. This dual functionality is crucial for continuous deployment pipelines, ensuring that the infrastructure is always brought to the desired state, whether it's the first deployment or a subsequent modification.
- ✗
REPLACE_ON_FAILURE
Why it's wrong here
The REPLACE_ON_FAILURE action is specifically designed for recovery scenarios where a CloudFormation stack has previously failed during creation or update. Its primary function is to delete the failed stack and then attempt to create a new one in its place. However, this action will not initiate a stack creation if no stack with the specified name exists at all, making it inappropriate for initial deployments or general update operations in a continuous delivery pipeline.
- ✗
CREATE_ONLY
Why it's wrong here
The CREATE_ONLY action is highly restrictive, as it will only attempt to create a new CloudFormation stack if one with the specified name does not already exist. If a stack with the same name is found, the action will fail immediately, as it lacks the capability to perform an update operation on existing resources. This makes it unsuitable for typical continuous deployment pipelines where subsequent executions are expected to update existing infrastructure rather than just create new ones.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
This DVA-C02 question is part of Courseiva's 1,135-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 →
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 Amazon Web Services exam blueprint
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.