Serverless

Regional Endpoints for API Gateway and Active Active Serverless

Jared Short Trek10
Jared Short | Nov 02 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.

This time is over. With the new launch of 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
    • ex: regional.example.com
    • You'll need an Amazon Certificate Manager cert in both regions for *.example.com
  2. Grab the regional api gateway endpoint targets
    • ex: d-tt654494hgf.execute-api.us-east-1.amazonaws.com
    • ex: d-k39fj3lfkkf.execute-api.us-west-2.amazonaws.com
  3. In Route53 create an ALIAS "A" record with weighted, latency, failover or geolocation based routing for each of your endpoints
    • latency or geolocation are probably the best
    • weighted is the easiest especially if you just want round robin style
  4. 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.

Author