Question 476 of 724
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?
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' indicates that the S3 bucket name is not unique. Adding a random suffix to the BucketName (e.g., using AWS::StackName or a random string) ensures uniqueness. Option B is incorrect because removing the queue does not address the bucket naming conflict. Option C is incorrect because disabling versioning does not affect the bucket name. Option D is incorrect because disabling SSE is unrelated to the bucket name conflict.
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 |
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 →
Last reviewed: Jun 20, 2026
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.
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.
Sign in to join the discussion.