Courseiva

SOA-C02 Deployment, Provisioning, and Automation Practice Question

A company uses AWS CloudFormation to deploy a multi-tier application. The template includes an AWS::RDS::DBInstance resource. The administrator wants to ensure that the database is not deleted when the stack is deleted. Which CloudFormation resource property should be set?

⚠ Common exam trap

A common mix-up: candidates confuse the RDS-specific 'DeletionProtection' property with CloudFormation's 'DeletionPolicy' attribute, assuming that enabling deletion protection on the database will prevent CloudFormation from deleting it, but CloudFormation's stack deletion bypasses that protection unless the DeletionPolicy is set to 'Retain'.

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

✓

Set the 'DeletionPolicy' attribute to 'Retain' on the DBInstance resource.

The 'DeletionPolicy' attribute in AWS CloudFormation controls what happens to a resource when its stack is deleted. Setting 'DeletionPolicy' to 'Retain' on the AWS::RDS::DBInstance resource ensures the database is preserved and not deleted when the stack is deleted. This is the standard mechanism for preventing accidental deletion of critical resources during stack teardown.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Set the 'DeletionPolicy' attribute to 'Retain' on the DBInstance resource.

    Why this is correct

    Setting the DeletionPolicy attribute to Retain on the AWS::RDS::DBInstance resource is the correct way to prevent CloudFormation from deleting the database when the stack is removed. With this attribute, CloudFormation simply abandons the resource, leaving the DB instance intact and running, though it no longer manages it. This is the intended mechanism for preserving RDS instances during stack teardown.

  • ✗

    Set the 'DeletionPolicy' attribute to 'Snapshot' on the DBInstance.

    Why it's wrong here

    The DeletionPolicy attribute set to Snapshot instructs CloudFormation to take a final DB snapshot before deleting the instance, but it does not keep the instance alive. The database is still terminated; only a restore point is preserved. Since the goal is to avoid deleting the database entirely, this option fails because the original DB instance no longer exists.

  • ✗

    Set the 'RetainOnDeletion' property to 'true' on the DBInstance.

    Why it's wrong here

    There is no such property as RetainOnDeletion in the AWS::RDS::DBInstance resource type or in CloudFormation's resource attributes. DeletionPolicy is the only CloudFormation-level attribute that controls what happens to a resource on stack deletion. Attempting to use a non-existent property would cause a template validation error, so this option is invalid.

  • ✗

    Set the 'DeletionProtection' property to 'true' on the DBInstance.

    Why it's wrong here

    DeletionProtection is a property of the RDS database instance itself, not a CloudFormation deletion policy. While it may prevent the RDS DeleteDBInstance API call from succeeding, it does not tell CloudFormation how to handle the resource during stack deletion; instead, the stack deletion will likely fail and enter a DELETE_FAILED state. The correct and clean approach is to use DeletionPolicy: Retain, which explicitly instructs CloudFormation to keep the resource when deleting the stack.

About these practice questions

Courseiva writes every SOA-C02 question from scratch — 1,169 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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SOA-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 SOA-C02 exam.