Private API Gateway custom domains

Custom domain names for Private API Gateway endpoints.

This repository implements a workaround solution as described in the related blog post. Multiregional implementation of this solution are available in resources links.
A user or application makes an API request to the fully qualified domain name (FQDN) of the custom domain name, in this example private.internal.example.com. We use a private hosted zone in association with the VPC. The CNAME resolves to the FQDN of the private load balancer, in this example internal-0123-abcd.elb.us-east-1.amazonaws.com. The load balancer terminates TLS with the ACM certificate for private.internal.example.com. For more details, refer to the documentation on private hosted zones.
The load balancer then re-initiates the TLS connection with a listener for TLS:443 for NLB or alternatively HTTPS:443 for ALB. The listener redirects to the IP addresses of the VPC endpoint for API Gateway, in this example at 10.0.110.74 and 10.0.120.81. The listener also has a TCP:443 health check for NLB and an HTTPS:443 health check for ALB. Note that ALB also requires matcher against HTTP 200 and 403. The load balancers then establishes a TLS connection to the VPC endpoint using the FQDN of the custom domain, allowing it to resolve to the regional custom domain name that we configured.

< Back to all repos

GitHub icon View this repo on GitHub


Clone this repo

git clone https://github.com/aws-samples/serverless-samplescd apigw-private-custom-domain-name


Created by:

Heeki Park

Heeki Park

Heeki Park is a Principal Solutions Architect at AWS and has been helping customers build serverless and cloud-native applications since joining AWS in 2016.

Follow on LinkedIn