Courseiva
Question 1,341 of 1,511
SDLC AutomationmediumMultiple ChoiceObjective-mapped

CloudFormation Resource Already Exists Error: Diagnosis and Fix

A team uses AWS CloudFormation to manage infrastructure. They have a stack that creates an Amazon RDS instance. During an update, the stack fails with 'CREATE_FAILED' for the DB instance resource, and the error message indicates 'The DB instance already exists.' What is the most likely cause?

Quick Answer

The correct answer is that an RDS instance with the same identifier already exists in the account and region. This error occurs because CloudFormation, during a stack update or creation, attempts to provision a resource with a logical ID and physical name, but finds a pre-existing RDS instance using that exact DB instance identifier. The core technical concept here is that CloudFormation does not automatically manage resources left behind from a previously deleted stack; if the stack was deleted without retaining the resource, the orphaned RDS instance remains, causing a naming conflict when a new stack tries to create one with the same identifier. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this scenario tests your understanding of resource lifecycle management and the importance of checking for orphaned resources before redeploying. A common trap is confusing this with deletion protection, which prevents deletion but does not cause a CREATE_FAILED error for a new stack. Memory tip: "Orphaned ID, stack won't hide" — always verify that no resource with the same identifier exists in the account and region before attempting a new CloudFormation deployment.

⚠ Common exam trap

Many candidates confuse 'DeletionPolicy' or 'deletion protection' with the root cause, but the error is specifically about a duplicate identifier during creation, not about deletion or retention policies.

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

An RDS instance with the same identifier already exists in the account and region.

The error 'The DB instance already exists' indicates that CloudFormation is attempting to create a new RDS instance with a DB instance identifier that is already in use within the same AWS account and region. Since DB instance identifiers must be unique per account and region, the creation fails. This typically occurs when a stack update triggers a resource replacement (e.g., due to a property change that requires recreation) and the old instance was not deleted or its identifier is still reserved.

Answer analysis

Option-by-option breakdown

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

  • An RDS instance with the same identifier already exists in the account and region.

    Why this is correct

    DB instance identifiers must be unique per region; if one exists, creation fails.

  • The stack update is trying to replace the DB instance without a proper UpdateReplace policy.

    Why it's wrong here

    UpdateReplace policy affects replacement behavior, but the error is about creation.

  • The stack has a DeletionPolicy of Retain on the RDS instance.

    Why it's wrong here

    Retain would keep the instance after stack deletion, but the error occurs during creation, not after deletion.

  • The RDS instance has deletion protection enabled.

    Why it's wrong here

    Deletion protection prevents deletion, not creation.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on DOP-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A startup is using AWS CloudFormation to manage their infrastructure. They have a stack that creates an Amazon S3 bucket and an Amazon DynamoDB table. The stack was created successfully, but when they try to update the stack to add a new S3 bucket, the update fails with the error 'CREATE_FAILED - S3 bucket already exists'. The new bucket name is unique and does not exist. The template uses the same AWS::S3::Bucket resource type. What is the most likely cause?

easy
  • A.The IAM user does not have permission to create S3 buckets.
  • B.The S3 bucket name was previously used and is still in the process of being deleted (bucket name not yet released).
  • C.The stack is in a different region than where the bucket is being created.
  • D.The CloudFormation template uses the wrong resource type for the bucket.

Why B: The error 'CREATE_FAILED - S3 bucket already exists' despite using a unique bucket name indicates that the bucket name was previously used and is still in a deletion state. S3 bucket names are globally unique and cannot be reused immediately after deletion; there is a waiting period for the name to be released. Option B is correct because the bucket name is not yet available. Option A is incorrect because the IAM user likely has sufficient permissions if the bucket creation fails only during update. Option C is incorrect because the region would not cause this specific error. Option D is incorrect because the resource type is appropriate.

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.