Skip to content

custom domain SSL Verification fails in Amplify

0

Hello, i have 2+ apps in amplify configured. They all work fine when i access them over the amplifyapp.com autogenerated domain. I want to add custom domains to the different apps. But i want to share the same toplevel domain over two (or more) amplify apps.

App1 -> app1.example.com App2 -> app2.example.com

For the first App/domain ssl activation works fine. For the second it does not. The domain is not managed in Route53. At least not in the account where the app lives, so i needed to set up the configuration of the dns records myself. I have created CNAMES for both Subdomains, but only one for the "Verification record". Which is this long random string of my domain pointing to a acm-validationaws.aws domain. Looking at the certificate shows me its issued for *.example.com.

My problem/question is: Is it even possible to share a domain over multiple amplify apps like i did above? What else could be going wrong here? The error i am getting is

One or more aliases specified for the distribution includes an incorrectly configured DNS record that points to another CloudFront distribution. You must update the DNS record to correct the problem. For more information, see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-restrictions

All the best Manuel

asked 2 years ago899 views

1 Answer
0

Yes, it is possible to share a domain across multiple Amplify apps as you've described (app1.example.com and app2.example.com). However, the issue you're experiencing suggests there might be some configuration problems. Let's address the potential causes and solutions:

  1. SSL Certificate: It appears you have a wildcard certificate for *.example.com, which should cover both subdomains. This is correct and should work for both apps.

  2. DNS Configuration: You mentioned creating CNAME records for both subdomains, which is correct. However, you only created one verification record. Each Amplify app requires its own unique verification record for SSL certificate validation.

  3. Verification Records: For each app, Amplify will provide a unique CNAME record for domain verification. You need to add these separate verification records to your DNS configuration for each subdomain.

  4. CloudFront Distribution Conflict: The error message suggests that one of your DNS records is pointing to the wrong CloudFront distribution. Each Amplify app creates its own CloudFront distribution, so make sure each subdomain's CNAME record points to the correct Amplify app URL.

To resolve the issue:

  1. Double-check that each subdomain (app1.example.com and app2.example.com) has its own CNAME record pointing to the correct Amplify app URL.

  2. Add the unique verification CNAME record for each app as provided by Amplify. Don't reuse the verification record from the first app for the second one.

  3. Wait for DNS propagation, which can take up to 48 hours, although it's often much quicker.

  4. If the problem persists, try removing the custom domain from the Amplify app that's failing and then re-add it. This will trigger a new verification process and might resolve any lingering issues.

  5. Ensure there are no conflicting DNS records or redirects set up for these subdomains that might interfere with the Amplify configuration.

By following these steps, you should be able to successfully set up multiple Amplify apps using subdomains of the same top-level domain. If issues persist, you may need to contact AWS support for further assistance, as they can provide more specific guidance based on your account and app configurations.
Sources
Custom domain for Amplify not working | AWS re:Post
Deploy React and Server Side Rendered Apps and Static Sites - Amplify Hosting - AWS
Bring your own SSL certificate to AWS Amplify Hosting | Front-End Web & Mobile

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.