- Newest
- Most votes
- Most comments
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:
-
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.
-
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.
-
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.
-
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:
-
Double-check that each subdomain (app1.example.com and app2.example.com) has its own CNAME record pointing to the correct Amplify app URL.
-
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.
-
Wait for DNS propagation, which can take up to 48 hours, although it's often much quicker.
-
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.
-
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
Relevant content
asked a year ago
asked a year ago
- AWS OFFICIALUpdated 5 years ago
