Regional Endpoints for API Gateway and Active Active Serverless

Thu, 02 Nov 2017

My single largest complaint with the entire AWS Serverless ecosystem was that running a multi-region API Gateway was impossible to do. Well, impossible without servers. You could do it if you were willing to run a few nginx reverse proxies and some load balancers for a production quality setup.

My good friend
This made me, and my good friend Clint Eastwood, grumpy.

This time is over. With the new launch of [Regional API Endpoints](https://aws.amazon.com/about-aws/whats-new/2017/11/amazon-api-gateway-supports-regional-api-endpoints/) for API Gateway, the nightmare is over. You can now do Active/Active or Active/Passive failover with ease.

How Easy is Easy?

  1. Create your custom domain in two (or more) regions
  2. ex: regional.example.com
  3. You’ll need an Amazon Certificate Manager cert in both regions for *.example.com
  4. Grab the regional api gateway endpoint targets
  5. ex: d-tt654494hgf.execute-api.us-east-1.amazonaws.com
  6. ex: d-k39fj3lfkkf.execute-api.us-west-2.amazonaws.com
  7. In Route53 create an ALIAS “A” record with weighted, latency, failover or geolocation based routing for each of your endpoints
  8. latency or geolocation are probably the best
  9. weighted is the easiest especially if you just want round robin style
  10. Profit.

With this being the small potatoes stuff that gets announced now, re:Invent is gonna be a heck of show. We’ll see you there, reach out if you want to meet for a drink.

Loading...
Jared Short

Jared Short

Sr. Cloud Architect, Developer Acceleration

Jared is an accomplished software developer across multiple platforms, with over a decade of experience working with startups to fortune 100 companies.More Posts by Jared