On AWS, I created two S3 buckets.
example.com and one for
I selected the option "Use this bucket to host a website" for
example.com and selected "Redirect requests" on
www.example.com pointing the target domain to the
Then I created a CloudFront distribution having the S3 bucket as the origin.
Then I requested and selected the certificate for
example.com. I also requested a certificate for
Then on my Route53, I created an alias
A which has my CloudFront distribution as the alias target.
I also created another alias
A with name
www.example.com and alias target is
However, having done all of these things,
example.com is now working on browsers but when I entered
www.example.com, it says
www.example.com is using an invalid certificate.
I tried to create two CloudFront distributions and each one uses the certificate
*.example.com, but it says CNAME already exist, so I was not able to add the other one.
What could be wrong here?