Courseiva
Deployment →easyMultiple Choice

DVA-C02 Deployment Practice Question

A company is using AWS CloudFormation to deploy a stack that includes an Amazon EC2 instance with an attached Amazon EBS volume. The developer wants to ensure that the EBS volume is deleted when the EC2 instance is terminated. The developer has set the DeletionPolicy attribute on the EBS volume resource to Delete. However, after terminating the EC2 instance through the console, the EBS volume is still present. The stack still exists. What is the most likely reason the volume was not deleted?

⚠ Common exam trap

DVA-C02 often tests the misconception that CloudFormation DeletionPolicy controls resource deletion during any lifecycle event, when in fact it only applies to stack deletion or resource removal from the template.

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 DeletionPolicy attribute only takes effect when the CloudFormation stack is deleted, not when an individual resource is terminated.

The DeletionPolicy attribute in CloudFormation governs what happens to a resource when it is removed from the stack template or when the stack itself is deleted — not when the underlying resource (the EC2 instance) is terminated by other means. Terminating the EC2 instance through the console does not trigger CloudFormation to evaluate the DeletionPolicy on the EBS volume, so the volume persists. To have the volume deleted on instance termination, the volume must have DeleteOnTermination=true on the block device mapping, which is an EC2-level attribute, not a CloudFormation DeletionPolicy concern.

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 EBS volume has a DeleteOnTermination attribute set to false.

    Why it's wrong here

    If the volume is not a root device, DeleteOnTermination on the instance's BlockDeviceMapping controls deletion; but the DeletionPolicy on the volume resource is separate. However, the most likely reason is that DeletionPolicy only applies to stack deletion.

  • ✓

    The DeletionPolicy attribute only takes effect when the CloudFormation stack is deleted, not when an individual resource is terminated.

    Why this is correct

    The DeletionPolicy attribute in AWS CloudFormation is specifically designed to control the fate of resources when their containing CloudFormation stack is deleted. It dictates whether a resource should be retained, snapshotted, or deleted during a DELETE stack operation. Therefore, if an individual EC2 instance is terminated, either manually or through an update that replaces the instance, the DeletionPolicy defined on its associated EBS volume resource within the CloudFormation template will not be evaluated or applied.

  • ✗

    The EBS volume is the root device of the EC2 instance.

    Why it's wrong here

    Whether an EBS volume is the root device of an EC2 instance primarily influences its default DeleteOnTermination behavior, which is typically set to true for root volumes by AMIs. However, this attribute governs the volume's lifecycle when the instance itself is terminated, not when the CloudFormation stack containing the volume is deleted. The DeletionPolicy attribute is a CloudFormation-specific instruction for stack deletion, and its non-application during individual resource termination is independent of the volume's root device status.

  • ✗

    The EC2 instance was terminated manually, not through a stack update.

    Why it's wrong here

    The method by which an EC2 instance is terminated—whether manually through the AWS console/CLI or automatically as part of a CloudFormation stack update (e.g., replacing an instance due to a property change)—does not alter the scope of the DeletionPolicy attribute. DeletionPolicy is exclusively evaluated during a CloudFormation stack's DELETE operation. Instance termination, regardless of its trigger, is an action at the EC2 resource level and does not invoke the stack-level DeletionPolicy logic for associated resources.

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 →

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 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.