I have an application that is in the us-east-1
region with following
API gateway -> lambda -> dynamo DB
I wanted to have these resources in multiple regions (in `Mumbai and Europe) to decrease the latency.
What I did
Global tables
for my data in dynamoDbNow the question is
I created a custom domain in my API gateway like us-east-1-api.example.com, ap-south-1-api.example.com, eu-central-1-api.example.com
and mapped my APIs.
Now in the Route53
, I created an A record
for api.example.com
but I am not getting any API gateway resources to connect to. but when I try to have the same subdomain in route53 such as us-east-1-api.example.com
then it shows me the us-east-1
API gateway CloudFront resource.
but this would mean that I will have to create 3 different subdomains records which is not what I wanted.
I want to have a single subdomain that can route the traffic to the appropriate API gateway based on the user location.
I tried searching a lot but did not find what I was looking for. would appreciate any help.
Normally you would create api.example.com
as latency records.
In your case you would have three latency recordcs called api.example.com
. Each of them would point to other A alias record in your HZ (us-east-1-api.example.com
, ap-south-1-api.example.com
, eu-central-1-api.example.com
):
|-> us-east-1-api.example.com (ALIAS to API gateway in that region)
api.example.com (latency) -> |-> ap-south-1-api.example.com (ALIAS to API gateway in that region)
|-> eu-central-1-api.example.com (ALIAS to API gateway in that region)