Skip to main content

AWS DVA-C02 Drill: CloudFormation Rollback Behavior - Preserving Resources on Failure

Jeff Taakey
Author
Jeff Taakey
21+ Year Enterprise Architect | AWS SAA/SAP & Multi-Cloud Expert.

Jeff’s Note
#

Unlike generic exam dumps, ADH analyzes this scenario through the lens of a Real-World Lead Developer.

For AWS DVA-C02 candidates, the confusion often lies in understanding how CloudFormation handles resource rollbacks on stack failures and ensuring that some resources are preserved. In production, this is about knowing exactly which CLI flags to use to disable rollback and prevent resource deletion after errors during stack creation or updates. Let’s drill down.

The Certification Drill (Simulated Question)
#

Scenario
#

Nova Apps Inc., a SaaS startup, uses AWS CloudFormation to automate the provisioning of their entire infrastructure. A lead developer is tasked with scripting the stack deployment and update processes using the AWS CLI. The developer needs to ensure that if the stack creation or update fails due to an error in the template or resource provisioning, the stack does not roll back and delete already created resources, preserving them for further investigation and recovery.

The Requirement:
#

Which AWS CLI option or parameter should the developer use during the create-stack and update-stack commands to meet the requirement of preserving successfully provisioned resources when an error occurs?

The Options
#

  • A) Add an --enable-termination-protection option to the create-stack and update-stack commands.
  • B) Add a --disable-rollback option to the create-stack and update-stack commands.
  • C) Add a --parameters ParameterKey=PreserveResources,ParameterValue=True option to the create-stack and update-stack commands.
  • D) Add a --tags Key=PreserveResources,Value=True option to the create-stack and update-stack commands.

Google adsense
#

leave a comment:

Correct Answer
#

B

Quick Insight: The Developer Imperative
#

The --disable-rollback CLI flag instructs CloudFormation not to revert any successfully created resources during stack failures. This is critical in debugging and retaining partial deployments in production. Termination protection prevents stack deletion but does not disable rollback on creation/update failure. Parameter and tag options do not influence rollback behavior.

Content Locked: The Expert Analysis
#

You’ve identified the answer. But do you know the implementation details that separate a Junior from a Senior?


The Expert’s Analysis
#

Correct Answer
#

Option B

The Winning Logic
#

The --disable-rollback flag disables the automatic rollback of all successfully created or updated resources when an error happens during stack operations. This means the stack remains in its failed state but preserves any resources created up to the point of failure. This is invaluable for troubleshooting issues and preserving resources for manual fixes, backups, or recovery steps.

  • When this flag is not set, CloudFormation performs a rollback on failures by default, deleting all created resources to avoid partial states.
  • This flag is applicable to both create-stack and update-stack commands in the AWS CLI.
  • Termination protection, option A, prevents the stack from being deleted manually or via API but does NOT affect rollback behavior during creation/updating.
  • Option C and D involve custom parameters or tags that do not affect CloudFormation’s rollback logic.

The Trap (Distractor Analysis):
#

  • Why not A?) Termination protection safeguards against stack deletion but does not stop rollback on failed creation or update operations. So resources get deleted anyway if rollback is enabled.
  • Why not C?) Parameters with keys like PreserveResources are arbitrary and have no predefined effect on CloudFormation rollback behavior.
  • Why not D?) Tags similarly do not influence rollback or stack failure handling; they are metadata only.

The Technical Blueprint
#

# Correct AWS CLI commands to disable rollback on stack creation and update

aws cloudformation create-stack \
    --stack-name MyStack \
    --template-body file://template.yaml \
    --disable-rollback \
    --parameters ParameterKey=KeyName,ParameterValue=MyKeyPair

aws cloudformation update-stack \
    --stack-name MyStack \
    --template-body file://template.yaml \
    --disable-rollback

The Comparative Analysis
#

Option API Behavior Complexity Effect on Rollback Use Case
A Simple No effect Prevents deletion from manual stack delete calls only
B Simple Disables rollback Preserves resources on create/update failures
C None (custom) No effect No CloudFormation impact
D Metadata only No effect No CloudFormation impact

Real-World Application (Practitioner Insight)
#

Exam Rule
#

For the exam, always pick --disable-rollback when you see the requirement to preserve partially created resources after stack failures.

Real World
#

In production, teams might disable rollback during testing or debugging stack templates to analyze failed resources. However, disabling rollback in production stacks without strong automated cleanup can lead to orphaned resources causing cost and security issues. Use with caution.


(CTA) Stop Guessing, Start Mastering
#


Disclaimer

This is a study note based on simulated scenarios for the AWS DVA-C02 exam.

The DevPro Network: Mission and Founder

A 21-Year Tech Leadership Journey

Jeff Taakey has driven complex systems for over two decades, serving in pivotal roles as an Architect, Technical Director, and startup Co-founder/CTO.

He holds both an MBA degree and a Computer Science Master's degree from an English-speaking university in Hong Kong. His expertise is further backed by multiple international certifications including TOGAF, PMP, ITIL, and AWS SAA.

His experience spans diverse sectors and includes leading large, multidisciplinary teams (up to 86 people). He has also served as a Development Team Lead while cooperating with global teams spanning North America, Europe, and Asia-Pacific. He has spearheaded the design of an industry cloud platform. This work was often conducted within global Fortune 500 environments like IBM, Citi and Panasonic.

Following a recent Master’s degree from an English-speaking university in Hong Kong, he launched this platform to share advanced, practical technical knowledge with the global developer community.


About This Site: AWS.CertDevPro.com


AWS.CertDevPro.com focuses exclusively on mastering the Amazon Web Services ecosystem. We transform raw practice questions into strategic Decision Matrices. Led by Jeff Taakey (MBA & 21-year veteran of IBM/Citi), we provide the exclusive SAA and SAP Master Packs designed to move your cloud expertise from certification-ready to project-ready.