Skip to content

How do I deploy and manage an API Gateway API in multiple Regions?

3 minute read
0

I want to deploy my Amazon API Gateway API to run in multiple AWS Regions. Also, I want to manage and monitor my API Gateway API deployments.

Resolution

Create and deploy APIs in multiple Regions

To deploy an API Gateway API in multiple Regions, you must create an identical API in each Region that you want to deploy the API in.

Note: To automate your API deployments across multiple Regions, it's a best practice to use Infrastructure as Code (IaC) tools, such as AWS CloudFormation or the AWS Cloud Development Kit (AWS CDK).

For REST APIs, see Create a REST API. Then, deploy your REST API. For more information, see Develop REST APIs in API Gateway and Deploy REST APIs in API Gateway.

For HTTP APIs, see Create an HTTP API. Then, publish your HTTP API.

For WebSocket APIs, see Create a WebSocket API using the API Gateway console. Then, deploy your WebSocket API.

For private REST APIs, see Create a private API. Then, deploy your private API.

Create Regional custom domain names

For each Region that you deployed your API in, create a custom domain name. Then, use the AWS Certificate Manager (ACM) console to request a public TLS/SSL certificate for each of your domains.

Create Route 53 alias records

To route traffic, you must have a public hosted zone. If you don't have one, then see Creating a public hosted zone.

Configure Route 53 to route traffic to the Regional custom domain names. Make sure that you choose Failover routing for the routing policy.

For more information, see Routing traffic to an Amazon API Gateway API by using your domain name.

Create Route 53 health checks

In Route 53, create health checks for each Regional API Gateway endpoint. Associate the health checks with the Route 53 alias records that you created. If a health check for the primary Region fails, then Route 53 automatically routes incoming traffic to the secondary Region.

Deploy backend services

Deploy your backend services in the same Regions as the API Gateway deployments. Make sure that your backend services return consistent and identical responses across all Regions.

Note: For API Gateway HTTP integrations, configure your integration endpoints to use Route 53 DNS names, such as backend.example.com, instead of hardcoded Regional URLs. To automatically route requests to the correct Regional backend, make sure that you configure Route 53 with latency-based or geolocation routing. You can then use identical API configurations across all Regions, and traffic stays within the same Region when possible.

Manage and monitor your deployments

To manage and monitor your API Gateway deployments in multiple Regions, take the following actions:

Related information

Implementing multi-Region failover for Amazon API Gateway

How Amazon Route 53 determines whether a health check is healthy

Disaster recovery options in the cloud