Create a custom domain in API Gateway: a. Navigate to API Gateway in the AWS Management Console. b. Click "Custom domain names" in the left menu. c. Click "Create" and enter your custom domain name. d. Select the ACM certificate that you've obtained for your domain. e. Click "Create domain name".
Configure the custom domain's base path mappings: a. Under the "API mappings" tab in your custom domain settings, click "Configure API mappings". b. Click "Add new mapping". c. Select your API, stage, and (optionally) set a base path prefix. d. Click "Save".
Update the DNS record at your domain registrar: After you've created the custom domain, you should see a "Target Domain Name" or "API Gateway domain name" in the custom domain details page. This is the value you need to set as the CNAME target in your domain registrar's DNS settings. The value should look like <id>.cloudfront.net.
Configure your domain registrar to use the API Gateway custom domain: a. Log in to your domain registrar's control panel. b. Find the DNS settings for your domain. c. Add a new CNAME record pointing your custom domain to the API Gateway target domain name (<id>.cloudfront.net). Make sure to remove any existing CNAME records pointing to <id>.execute-api.<region>.amazonaws.com.
Wait for DNS propagation: DNS changes may take some time to propagate, usually around a few minutes to a few hours. You can use a tool like nslookup, dig, or an online service to verify that the CNAME record has propagated correctly.
if the error still exists check the ACM certificate covers the correct domain and is issued in the us-east-1 (N. Virginia) region
- Accepted Answerasked 6 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- How can I configure a custom domain endpoint for multiple API Gateway APIs behind a CloudFront web distribution?AWS OFFICIALUpdated a year ago
- EXPERTpublished 2 days ago