Map API stages to a custom domain name for WebSocket APIs
You use API mappings to connect API stages to a custom domain name. After you create a domain name and configure DNS records, you use API mappings to send traffic to your APIs through your custom domain name.
An API mapping specifies an API, a stage, and optionally a path to use for the mapping. For example, you
can map the production
stage of an API to wss://api.example.com/orders
.
Before you create an API mapping, you must have an API, a stage, and a custom domain name. To learn more about creating a custom domain name, see Set up a Regional custom domain name in API Gateway.
Restrictions
-
In an API mapping, the custom domain name and mapped APIs must be in the same AWS account.
-
API mappings must contain only letters, numbers, and the following characters:
$-_.+!*'()
. -
The maximum length for the path in an API mapping is 300 characters.
-
You can't map WebSocket APIs to the same custom domain name as an HTTP API or REST API.
Create an API mapping
To create an API mapping, you must first create a custom domain name, API, and stage. For information about creating a custom domain name, see Set up a Regional custom domain name in API Gateway.