DOP-C02 Configuration Management and IaC Practice Question
A DevOps engineer is managing the lifecycle of a CloudFormation stack. The engineer needs to update a stack that contains an Auto Scaling group. The update requires a replacement of the Auto Scaling group. What will happen to the existing instances during the update?
⚠ Common exam trap
Candidates often assume CloudFormation performs in-place updates (Option D) or that replacement always fails (Option B), but the service explicitly supports create-before-destroy replacement for Auto Scaling groups.
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
✓
The existing instances will be terminated after the new Auto Scaling group is created
When a CloudFormation stack update requires replacement of an Auto Scaling group (e.g., due to a change in the `LaunchConfigurationName` or `LaunchTemplate` property), CloudFormation creates the new Auto Scaling group first, then terminates the old instances after the new group is fully operational. This ensures minimal downtime because the new group begins serving traffic before the old one is torn down.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The existing instances will be terminated after the new Auto Scaling group is created
Why this is correct
During a CloudFormation stack update that forces replacement, the Auto Scaling group is recreated with a new physical resource ID. CloudFormation first creates the replacement group and only after it is successfully provisioned does it delete the original group, which terminates the old group's instances. This create-before-delete behavior preserves capacity during the update window.
- ✗
The stack update will fail because Auto Scaling groups cannot be replaced
Why it's wrong here
Auto Scaling groups are fully replaceable resources in CloudFormation. A stack update will not fail simply because an ASG property requires replacement; CloudFormation handles this by creating a new group and then removing the old one. Failure to update would only occur if the new resource fails to launch, not because replacement is disallowed for ASGs.
- ✗
The existing instances will remain running and be associated with the new Auto Scaling group
Why it's wrong here
Because CloudFormation replaces the entire Auto Scaling group, the new group is a distinct resource with its own launch configuration and scaling policies. Instances launched by the original group are not transferred or re-associated; they are owned by the old group, which is deleted after the replacement is created. Hence, the old instances are terminated rather than remaining attached.
- ✗
The instances will be updated in-place by terminating and recreating each instance one by one
Why it's wrong here
CloudFormation does not perform in-place, instance-by-instance updates for Auto Scaling groups. When a replacement is required, CloudFormation creates an entirely new Auto Scaling group, then deletes the old group—terminating all of its instances as part of the deletion. There is no per-instance lifecycle orchestration within the existing ASG during a stack update.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DOP-C02 question from scratch — 1,298 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 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.