Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to provide Alternate Domain Names (CNAMEs) to the CloudFront distribution using CloudFormation?

I have tried:

"Aliases": ["www.samplewebsite.com","samplewebsite.com"]

But I am getting this error:

Property validation failure: [Encountered unsupported properties in {/DistributionConfig/Origins/0}: [Aliases]]

like image 840
vamsi chunduru Avatar asked Oct 29 '25 01:10

vamsi chunduru


1 Answers

Ok, so the problem seems to be with the JSON object structure that you are using for creating the CloudFront distribution.

In oder to add the alternate CNAME to your Cloudfront distribution, you need to add the key "Aliases" under the "DistributionConfig" object and not under "DistributionConfig/Origins".

So basically the property "Aliases" is defined as child object of "DistributionConfig".

Hope this helps.

like image 53
Priyanka Makhija Avatar answered Oct 30 '25 16:10

Priyanka Makhija



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!