How to configure Custom Domain with AWS API Gateway

To configure custom domain for the deployed API on API gateway we need the certificate either public certificate created using AWS Certificate Manager or certificate provided by other certificate authority

Check this article to create a certificate using ACM

Assuming you have certificate or public certificate created using AWS ACM follow steps below to configure custom domain with API gateway

API Gateway Create Custom Domain Name

The Create the Custom domain with domain name and certificate selected. Where, certificate can be either uploaded or created using ACM

API Gateway Create Custom Domain

You need to choose the certificate that can be either certificate generated with ACM or certificate issued by CA uploaded to ACM. Check here about article to create a certificate using ACM

After successful creation of custom domain you will see the screen with information such as API gateway domain name, API mappings etc

To map the custom domain to the APIs on API gateway, go to the sections “API mappings” and then click on “Configure API mappings”

You need to select the corresponding API and the stage to which given custom domain must be mapped

Note that when you use URL generated by API gateway, it would contain the stage as path prefix, but when you configure custom domain path prefix is not required that need to kept in mind when you deploy serverless application on lambda

Configure DNS

As it is shown in the above picture, highlighted with green, given API gateway domain name must be used to configure CNAM by updating zone of domain with corresponding domain registry ex: goDaddy

Default image
neotam
Naveen T aka neotam. Programming language agnostic, Software architect, Python expert, Networking & DevOps engineer & consultant with 7+ years of experience in creating serious web applications, real time event-driven non blocking applications and database driven applications ranging from small scale to enterprise grade. website
Leave a Reply