Amplify Gen 2 - Custom domain failure

0

Wanting to create a custom domain of fizz.buzz.com so that our AWS Amplify Gen 2 application in which we we rely on a 3rd party provider for hosting (Planet Hoster) to host our corporate domain (i.e. buzz.com).

Following the guidelines here (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-requirements) we've generated a wildcard certificate with *.buzz.com and then imported it into AWS Certificate manager.

At this point, we proceed to create the custom domain in AWS Amplify Gen 2 application indicating that we are using a 3rd party provider & selected the aforementioned certificate from AWS Certificate Manager.

After a while it eventually produces an error stating that SSL setup failed: The certificate that is attached to your distribution doesn't cover the alternate domain name (CNAME) that you're trying to add. For more details, see: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-requirements

What I consider as confounding is that the documentation (see above) states that wildcard certificates are supported.

Here is a screen capture:

Enter image description here

P.S.

I find that AWS Amplify Gen 2 that custom domains aren't well documented for situations when using a 3rd party provider since it's unclear the steps that are to be followed. Do I need to create a subdomain and then associated to the provided CloudFront or to add CNAME entries to the primary domain of buzz.com.

Note this isn't something that I do often as my daily development thus good documentation, automation is key. Also when I do find documentation it's often out-of-date such as AWS Amplify Gen 1.

1 Answer
0

The issue you're experiencing with setting up a custom domain for your AWS Amplify Gen 2 application is not uncommon, especially when using a third-party DNS provider. Here are some steps and considerations to help resolve the problem:

  1. Certificate Coverage: Ensure that your wildcard certificate (*.buzz.com) is correctly imported into AWS Certificate Manager (ACM) and is in the 'Issued' state. The certificate should cover both buzz.com and *.buzz.com to avoid any potential issues.

  2. DNS Configuration: You need to add two CNAME records to your DNS configuration at your third-party provider (Planet Hoster):

    a. A CNAME record for domain validation: This is provided by AWS when you request the certificate and is used to prove domain ownership. b. A CNAME record for the custom domain (fizz.buzz.com): This should point to the Amplify app's domain (typically ending with amplifyapp.com).

  3. Waiting Period: After adding the DNS records, it can take up to 48 hours for the changes to propagate globally. Be patient and try again after this period.

  4. Amplify Console Steps:

    • In the Amplify console, go to "Domain management"
    • Choose "Add domain"
    • Enter your domain (fizz.buzz.com)
    • Select the certificate you imported to ACM
    • Follow the prompts to add the necessary CNAME records to your DNS
  5. Verification: Use the 'dig' command or online DNS lookup tools to verify that your CNAME records are correctly set and visible.

  6. CloudFront Distribution: Amplify manages the CloudFront distribution for you, so you don't need to manually create or configure it.

If the issue persists after following these steps, you may need to:

  1. Delete the custom domain from Amplify and try adding it again.
  2. Ensure there are no conflicting DNS records or redirects for the subdomain.
  3. Check if the domain is associated with any other AWS resources or accounts.

Regarding documentation, you're right that it can be challenging to find up-to-date information for specific scenarios. For the most current information, always refer to the official AWS Amplify documentation and consider reaching out to AWS support if you continue to face issues.
Sources
Amplify custom domain setup issue | AWS re:Post
Can't Activate AWS Amplify Custom Domain | AWS re:Post
Custom domain for Amplify not working | AWS re:Post

profile picture
answered a month 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.

Guidelines for Answering Questions