"The parameter CNAME contains one or more parameters that are not valid" error message while deploying a CloudFront distribution

Viewed 6589
2 Answers

For anyone else running into this issue, I ran into this issue today, and it turned out I had a misunderstanding about the HostedZone parameter in AWS's sample CloudFormation template - I had provided the Hosted Zone ID when the parameter was expecting the actual domain of the Hosted Zone. In this question's sample template, for example, the value of '${SubDomainNameWithDot}${HostedZoneName}' would need to be a valid domain name.

I investigated this issue by attempting to manually create the CloudFront distribution in the AWS console. When I pasted in the CNAME into "Settings / Alternate domain name (CNAME) - optional", it showed me the following warning:

Alternative domain name must contain one or more dots (.) and can only include lower case alphanumeric characters, dashes (-), and, optionally, a leading "*." to indicate all subdomains of the specified domain, for example, "*.example.com".

After I conformed my domain name to those requirements (i.e., converting to lowercase), the distribution deployed cleanly.


The parameter CNAME contains one or more parameters that are not valid is not a very helpful message — that should be improved!

Related