CloudFront CNAME Already Associated with Another Resource
A CloudOps engineer wants to use AWS CloudFormation stacks to deploy Amazon CloudFront resources in an account. The CloudOps engineer will use custom domain names, such as www.example.com and example.com. When the CloudOps engineer tries to deploy a CloudFormation stack, the CloudOps engineer receives the following error: "Resource handler returned message: Invalid request provided: AWS::CloudFront::Distribution: One or more of the CNAMEs you provided are already associated with a different resource." What should the CloudOps engineer do to deploy the stack successfully?
Community Insight
Tests CloudFront CNAME uniqueness and CloudFormation deployment troubleshooting; the trap is assuming a CNAME count limit or removing the template property fixes the conflict.
CloudFront alternate domain names must be globally unique, so a CloudFormation stack fails when its CNAMEs are already attached to another distribution. The fix is to remove the conflicting CNAMEs from the existing CloudFront resource and redeploy the stack.
Choosing to remove the CNAME property entirely (D) or reduce the count (B), which may deploy the stack but abandons the required custom domain names and does not resolve the existing association.
Community Discussion (1 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
CloudFront alternate domain names (CNAMEs) must be unique across all distributions in an AWS account. The error "One or more of the CNAMEs you provided are already associated with a different resource" means the stack is trying to claim a domain name that an existing CloudFront resource already owns. Option C addresses this directly by removing the conflicting CNAMEs from the existing CloudFront resource, freeing them for the new stack, and then redeploying. This preserves the engineer's goal of serving the custom domains such as www.example.com and example.com from the new distribution.Why the Other Options Are Wrong
Option A suggests checking and correcting the CNAME names, but the error is not about a malformed name — it is about ownership by another resource. If the names are already correct, there is nothing to correct without releasing the existing association. Option B focuses on reducing the number of CNAMEs to 10, but CloudFront allows up to 100 alternate domain names per distribution, and the error is about uniqueness, not quantity. Option D removes the CNAME property entirely, which would deploy the stack but would not configure the required custom domain names, so it fails the stated requirement.Community Comment Notes
One community member, Bad_Mat, argued for option A with the comment "The correct choice is A." However, that advice does not explain how to release a CNAME that is already owned by a different CloudFront distribution. The specific error calls for resolving the existing association, which option C does by removing the conflicting CNAMEs from the existing resource before redeploying.Official Reference
Exam Strategy
When a CloudFormation error says a CloudFront CNAME is already associated, focus on uniqueness across distributions rather than template syntax or service limits. Remove the conflicting CNAME from the existing distribution before redeploying the stack.
Frequently Asked Questions
Why can't the stack reuse www.example.com if it is already on another CloudFront distribution?
CloudFront requires each alternate domain name to be unique across distributions, so the existing association must be removed before the new stack can use it.
Does reducing CNAMEs to 10 fix the already-associated error?
No, CloudFront allows up to 100 CNAMEs per distribution; the limit is unrelated to the uniqueness conflict in the error.
Related Analysis
Practice All SOA-C03 Questions
Access 100 questions with complete answers and detailed explanations.
View Full SOA-C03 Practice Test →