AWS Serverless Application Model (AWS SAM) now supports custom domain names for private REST APIs feature of Amazon API Gateway . Developers building serverless applications using SAM can now seamlessly incorporate custom domain names for private APIs directly in their SAM templates, eliminating the need to configure custom domain names separately using other tools.
API Gateway allows you to create a custom domain name, like private.example.com, for your private REST APIs, enabling you to provide API callers with a simpler and intuitive URL. With a private custom domain name, you can reduce complexity, configure security measures with TLS encryption, and manage the lifecycle of the TLS certificate associated with your domain name. AWS SAM is a collection of open-source tools (e.g. SAM, SAM CLI) that make it easy for you to build and manage serverless applications through the authoring, building, deploying, testing, and monitoring phases of your development lifecycle. This launch enables you to easily configure custom domain names for your private REST APIs using SAM and SAM CLI .
To get started, update SAM CLI to the latest version and modify your SAM template to set the EndpointConfiguration to PRIVATE and specify a policy document in the Policy field in the Domain property of the AWS::Serverless::Api resource. SAM will then automatically generate DomainNameV2 and BasePathMappingV2 resources under AWS::Serverless::Api. To learn more, visit the AWS SAM documentation
. You can learn more about custom domain name for private REST APIs in API Gateway blog post
.