ale917k
ale917k

Reputation: 1758

AWS: Connect Amplify to custom domain on Route 53

As per title, for some reason I'm unable to connect the deployed app on Amplify to a custom domain provided on Route 53.

Here's the app deployed with Amplify: https://master.dwog1beoc1uv7.amplifyapp.com/

On Route 53, I created a hosted zone and added a CNAME record which should connect the custom domain to the domain where amplify hosts the app:

enter image description here

I then went to Amplify and added a new domain for the application:

enter image description here

If I now go back to Route 53, I can see the records have been automatically updated as followed:

enter image description here

Although everything seem setup properly, the custom domain (http://alessiopetrin.com/) doesn't work just yet.

If I test the record on Route 53, all seem fine:

enter image description here

I understand I should allow some time for the DNS propagation to take effect (up to 24h for what AWS states), but the time is almost up and I can't see it working, which make me think something is off.

As per second screenshot, I can see on Amplify that is waiting me to add the CNAME record in order to activate the domain, so I may think that could be the missing piece; Problem is the record has been assigned automatically already on Route 53, so not really sure if I should add the record somewhere else as well?

Apologise if I'm asking something obvious, and thank you in advance for the help!

Upvotes: 1

Views: 4040

Answers (3)

umshi
umshi

Reputation: 68

The records added by Amplify are correct. I executed dig command on your domain and observed "SERVFAIL" status. This error is due to the mismatch in the name servers.

The following name servers are used currently.

ns1.dynadot.com ns2.dynadot.com

Ref: https://www.whois.com/whois/alessiopetrin.com

Please set the name servers to the NS record of hosted zone (https://i.sstatic.net/U6Lj8.png). Refer below docs:

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-name-servers-glue-records.html#domain-name-servers-glue-records-adding-changing

Then, delete the domain from amplify and try re-adding it. It should work.

Upvotes: 5

kgiannakakis
kgiannakakis

Reputation: 104188

An obvious error in Route53 is that Value/Route traffic goes to https://master.dwog1beoc1uv7.amplifyapp.com/. When you add CNAMEs, you don't add the protocol, but only the domain name. It should be master.dwog1beoc1uv7.amplifyapp.com

EDIT There is a problem with the Cloudfront Distribution. I can't tell, if this is because something you did or it is an amplify problem. You need to somehow debug the distribution. Go to Cloudfront service in AWS console and locate your distribution. Some things to check:

General Settings

  • Alternate domain is correct (your custom domain)
  • SSL certificate is correct

Go to behaviors tab and click edit:

Behavior

  • An S3 bucket with your code should be used as an origin
  • There should be no caching on Headers

Upvotes: 0

David Cruchon
David Cruchon

Reputation: 26

Be careful that the require cname ask by aws to generate the SSL is mandatory and should has the following form : DNS entry

Upvotes: 0

Related Questions