DVA-C02 Troubleshooting and Optimization Practice Question
Exhibit
Refer to the exhibit.
Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub "${AWS::StackName}-bucket"
VersioningConfiguration:
Status: Enabled
MyQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: !Sub "${AWS::StackName}-queue"
SqsManagedSseEnabled: trueRefer to the exhibit. A developer created this CloudFormation template. After deployment, the stack creation fails with 'Bucket name already exists'. What should the developer do to fix the issue?
⚠ Common exam trap
DVA-C02 often tests the misconception that S3 bucket names are scoped to an account or region, when they are actually globally unique, leading candidates to overlook the need for a unique name.
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
✓
Change the BucketName to include a random suffix.
The error 'Bucket name already exists' occurs because S3 bucket names are globally unique across all AWS accounts. The CloudFormation template hardcodes a BucketName that someone else already owns. The fix is to make the name unique, typically by appending a random suffix or using CloudFormation's auto-generated name (by omitting BucketName). This ensures the stack can create a new bucket without collision.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Change the BucketName to include a random suffix.
Why this is correct
A hard-coded S3 BucketName such as MyBucket is not guaranteed to be globally unique; S3 bucket names are shared across all AWS accounts and regions, so the name may already be registered by another account. Changing the value to include a random suffix, for example by appending the AWS::AccountId or AWS::StackName pseudo parameter through Fn::Join or Fn::Sub, ensures a unique bucket name and allows the stack to create successfully.
- ✗
Remove the MyQueue resource.
Why it's wrong here
Removing the MyQueue resource is not the fix because SQS queue names are scoped to the account and region, whereas the failure in this CloudFormation stack comes from the S3 bucket name already being taken in the global S3 namespace. The queue is not involved in the S3 AlreadyExists error, and deleting it would only remove a valid resource without changing the bucket's name collision, so the stack would still fail.
- ✗
Remove the VersioningConfiguration from the bucket.
Why it's wrong here
The VersioningConfiguration on the bucket is just a configuration subresource that controls whether multiple versions of objects are kept; it has no bearing on the bucket's globally unique name. Removing it does not free the existing bucket name or change how S3 performs name resolution, so the stack will still fail with the same BucketAlreadyExists error and may also lose intended versioning behavior.
- ✗
Set SqsManagedSseEnabled to false.
Why it's wrong here
SqsManagedSseEnabled is an SQS-specific property that toggles server-side encryption using SQS-managed keys; it is entirely unrelated to S3 bucket name registration. Setting it to false would only disable encryption on the SQS queue, not alter the S3 bucket's name or make it globally unique, so the CloudFormation deployment will continue to fail on the S3 resource with the original naming conflict.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every DVA-C02 question from scratch — 1,135 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 →
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.