Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
IP address types for custom domain names for HTTP APIs
When you create an API, you specify the type of IP addresses that can invoke your domain. You can choose IPv4 to
resolve IPv4 addresses to invoke your domain, or you can choose dualstack to allow both IPv4 and IPv6 addresses to
invoke your domain. We recommend that you set the IP address type to dualstack to alleviate IP space exhaustion or
for your security posture. For more information about the benefits of a dualstack IP address type, see IPv6 on
Amazon.
Considerations for IP address types
The following considerations might impact your use of IP address types.
-
The default IP address type for API Gateway custom domain names is IPv4.
-
Your custom domain name doesn't need to have the same IP address type for all APIs mapped to it. If you
disable your default API endpoint, this might affect how callers can invoke your API.
Change the IP address type of a custom domain name
You can change the IP address type by updating the domain’s endpoint configuration. You can update the domain's
endpoint configuration by using the Amazon Web Services Management Console, the Amazon CLI, Amazon CloudFormation, or an Amazon SDK.
- Amazon Web Services Management Console
To change the IP address type of a custom domain name
Sign in to the API Gateway console at https://console.amazonaws.cn/apigateway.
Choose a public custom domain name.
Choose Endpoint configuration.
For IP address type, select either IPv4 or Dualstack.
Choose Save.
- Amazon CLI
-
The following update-domain-name
command updates an API to have an IP address type of dualstack:
aws apigatewayv2 update-domain-name \
--domain-name dualstack.example.com \
--domain-name-configurations CertificateArn=arn:aws:acm:us-east-1:111122223333:certificate/abcd1234-5678-abc,IpAddressType=dualstack
The output will look like the following:
{
"ApiMappingSelectionExpression": "$request.basepath",
"DomainName": "dualstack.example.com",
"DomainNameConfigurations": [
{
"ApiGatewayDomainName": "d-abcd1234.execute-api.us-east-1.amazonaws.com",
"CertificateArn": "arn:aws:acm:us-east-1:111122223333:certificate/abcd1234-5678-abc",
"DomainNameStatus": "AVAILABLE",
"EndpointType": "REGIONAL",
"HostedZoneId": "Z3LQWSYCGH4ADY",
"SecurityPolicy": "TLS_1_2",
"IpAddressType": "dualstack"
}
],
"Tags": {}
}