Courseiva

DOP-C02 Configuration Management and IaC Practice Question

Exhibit

Refer to the exhibit.

{
    "Resources": {
        "MyBucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {
                "BucketName": "my-unique-bucket-name",
                "VersioningConfiguration": {
                    "Status": "Enabled"
                }
            }
        },
        "MyBucketPolicy": {
            "Type": "AWS::S3::BucketPolicy",
            "Properties": {
                "Bucket": {"Ref": "MyBucket"},
                "PolicyDocument": {
                    "Statement": [
                        {
                            "Effect": "Allow",
                            "Principal": "*",
                            "Action": "s3:GetObject",
                            "Resource": "arn:aws:s3:::my-unique-bucket-name/*"
                        }
                    ]
                }
            }
        }
    }
}

A CloudFormation template snippet is shown. An engineer attempts to create a stack with this template and receives an error: 'Bucket my-unique-bucket-name already exists'. What is the most likely cause?

⚠ Common exam trap

Watch out — candidates often assume the error refers to a bucket already existing in their own account, but AWS S3 enforces global uniqueness, so the error always means the name is taken by any account in the entire AWS ecosystem.

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 S3 bucket name 'my-unique-bucket-name' is already taken by another AWS account.

S3 bucket names must be globally unique across all AWS accounts and regions. The error 'Bucket my-unique-bucket-name already exists' indicates that the name is already taken by another AWS account, not that the bucket already exists in the current account. CloudFormation cannot create the bucket because the name is not available in the global S3 namespace.

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 bucket policy has a syntax error that prevents the bucket from being created.

    Why it's wrong here

    A syntactically invalid bucket policy would not prevent the S3 bucket from being created; CloudFormation provisions the bucket before attaching policy statements during the same stack operation. If the policy were malformed, the stack would fail during policy validation or roll back after the bucket was already created, yielding a policy-specific error message rather than a name collision error. The reported failure is a bucket creation error, which points to a global uniqueness problem instead of a local policy defect.

  • ✓

    The S3 bucket name 'my-unique-bucket-name' is already taken by another AWS account.

    Why this is correct

    S3 bucket names exist in a single global namespace shared by every AWS account and region. Once any account has registered 'my-unique-bucket-name', a CloudFormation CreateBucket call in your account fails with HTTP 409 BucketAlreadyExists, matching the symptom described. Because the error is explicitly tied to the bucket name, the most probable root cause is that another AWS account has already claimed that globally unique string, not a template configuration issue.

  • ✗

    The versioning configuration is incompatible with the bucket policy.

    Why it's wrong here

    Versioning and bucket policy are independent S3 features that operate on different layers: versioning controls object state retention through the BucketVersioningConfiguration, while bucket policy is a resource-based IAM document evaluated during request authorization. There is no interaction between them that could render them 'incompatible,' and CloudFormation applies both settings without ordering constraints. If one of these were misconfigured, the failure would reference that specific resource element, not claim a conflict between the two.

  • ✗

    The bucket policy references the bucket name incorrectly, causing a circular dependency.

    Why it's wrong here

    The bucket policy references the bucket name either directly or via the logical ID, and CloudFormation resolves that reference only after the bucket resource has been created. A circular dependency would only occur if the bucket's own configuration depended on an output from the policy, which is not the case here because the bucket uses a hard-coded name string. Since the error indicates the bucket name is already taken, the policy's reference is working as expected and the root cause is external to the template.

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

This DOP-C02 question is part of Courseiva's 1,298-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 by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.