When you create an API, you specify the type of IP addresses that can invoke your API. You can choose IPv4 to allow IPv4 addresses to invoke your API, or you can choose dualstack to allow both IPv4 and IPv6 addresses to invoke your API. You might want to 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 AWS.
Considerations for IP address types
The following considerations might impact your use of IP address types:
-
The default IP address type for HTTP APIs is IPv4.
-
If you change the IP address type for an existing API from IPv4 to dualstack, confirm that any policies controlling access to your APIs have been updated to account for IPv6 calls. When you change the IP address type, the change takes effect immediately.
-
Your API can be mapped to a custom domain name with a different IP address type than your API. If you disable your default API endpoint, this might affect how callers can invoke your API.
Change the IP address type of an HTTP API
You can change the IP address type by updating the API’s configuration. You can update the API's configuration by using the AWS Management Console, the AWS CLI, AWS CloudFormation, or an AWS SDK. If you change the API’s IP address type, you don't redeploy your API for the changes to take effect.
To change the IP address type of an HTTP API
Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway
. Choose an HTTP API.
For API settings, choose Edit.
For IP address type, select either IPv4 or Dualstack.
Choose Save.
The change to your API's configuration will take effect immediately.