2
votes

I have 3 regional API Gateways deployed as service API. I want to map all three API Gateways to single custom domain name.

I tried to do it with terraform but could not figure out what resource to use.

Also I already have Custom hosted zone on route 53 for. eg. foo.bar.com. I am confused should I add all three API ARN to single CNAME (service.foo.bar.com) under hosted zone OR to add some terraform resource to add service.foo.bar.com/service to each API gateway under custom domain names for API GW.

B ) do I need to do both? I want to configure CNAME to be latency based so that it calls the best latency API gateway out of 3. Any guidance or links would be great to start.

C ) Or should I set up 3 CNAME records with same name and different regions specific to api gateway regions all having latency based routing setup?

1

1 Answers

0
votes

Other detailed SO question helped me explore and find resources associated and required to help solve the problem along with AWS console reference.

  1. Associated Resources required

  2. Yes. Configuration of both is required. First configure custom domain name for API Gateway. (On AWS Console > API Gateway > Custom Domain Name). Associate valid cert of the domain name. Once done AWS deployed domain ARN is generated. Use this execute ARN to map it to CNAME on route 53.

  3. Steps 1 and 2 should make it easier. Repeat step 2 for each API with same CNAME w.r.t region.