Courseiva

SOA-C02 Deployment, Provisioning, and Automation Practice Question

A SysOps administrator is using AWS CloudFormation to deploy a stack that includes an Amazon EC2 instance and an Amazon RDS DB instance. The administrator needs to ensure that updates to the stack do not accidentally replace the RDS instance if the RDS configuration is changed in a way that would require replacement. Which CloudFormation attribute should be added to the RDS resource?

⚠ Common exam trap

Candidates often confuse `DeletionPolicy` (which only applies to stack deletion) with `UpdateReplacePolicy` (which applies during stack updates), leading them to choose Option B instead of A.

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

✓

UpdateReplacePolicy with Retain

The `UpdateReplacePolicy` attribute with `Retain` tells CloudFormation to preserve the existing RDS DB instance if a stack update would otherwise require its replacement. This prevents accidental deletion and recreation of the RDS instance when its configuration changes in a way that forces a new physical resource, such as modifying the DB engine version or storage type. The `UpdateReplacePolicy` is specifically designed for update scenarios, unlike `DeletionPolicy` which only applies during stack deletion.

Answer analysis

Option-by-option breakdown

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

  • ✓

    UpdateReplacePolicy with Retain

    Why this is correct

    During a stack update, if a property change requires CloudFormation to replace a resource, the default behavior is to create a new resource and then delete the old one. UpdateReplacePolicy with Retain overrides this by preserving the existing RDS instance and its data, even after the replacement occurs. This is essential for stateful resources like databases, where the old instance contains critical data that would otherwise be lost.

  • ✗

    DeletionPolicy with Retain

    Why it's wrong here

    DeletionPolicy is a CloudFormation attribute that determines what happens to a resource when its logical ID is removed from the stack template or when the entire stack is deleted. It has no effect during an update that replaces a resource, because replacement is an update operation, not a stack deletion operation. Therefore, setting DeletionPolicy: Retain on an RDS instance will not protect the old instance during an update that requires a new one; it only preserves the resource if the stack is deleted.

  • ✗

    StackPolicy

    Why it's wrong here

    A stack policy is a JSON document that specifies which update actions are allowed or denied for particular resources in a CloudFormation stack. While it can block an update that would replace an RDS instance, it cannot configure what happens to the old instance if the update is allowed to proceed. It acts as an access-control guardrail, not a data-retention mechanism, so it does not address the scenario of preserving the existing database during a replacement.

  • ✗

    CreationPolicy

    Why it's wrong here

    A CreationPolicy is used in CloudFormation to control when a resource's creation is considered complete by waiting for a specified number of success signals or a timeout period. This is relevant only during the initial creation of a resource, not during updates that replace an existing resource. As a result, a CreationPolicy cannot be used to retain the old RDS instance or its data when a stack update triggers a replacement.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

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.