How to Configure AWS Route 53

Serguey Arellano Martínez
TribalScale
Published in
3 min readNov 27, 2020

by Serguey Martinez, Staff Engineer

Photo by Procreator UX Design Studio

If your architecture is based on microservices it’s a really good idea to buy a domain in Route 53 and make the connections with API gateway so that you can enjoy URL’s like:

dev.mydomain.com/docs dev.mydomain.com/microservice-basePath dev.mydomain.com/another-microservice-basePath prod.mydomain.com/docs prod.mydomain.com/microservice-basePath prod.mydomain.com/another-microservice-basePath

In this quick tutorial, I’m going to show you how to configure AWS Route 53. The first step is to buy a domain:

Next, go to AWS certificate manager and request certificates for the subdomains that you will need. Heads up that AWS requires you to have TLS encryption.

So, choose the email owner to verify the certs:

Then, wait for them to get issued…

Once you have the certificates issued let’s go to API gateway -> custom domains -> create.

The domain name here should be something like dev.mydomain.com or api.example.com depending on the certificates you requested.

Choose the appropriate certificate and create the custom domain:

You can map now which API rest will handle which basePath.

In the example below if we try to access the URL https://dev.mydomain.com/docs it will delegate the request to swagger-dev API:

In this case, swagger-dev has the following structure. Remember that if you are mapping X basepath in this case docs, then you don't need to create another X basepath in the API where the requests are being delegated.

The last step consists of creating a record in Route 53 hosted zones. Whenever you buy a domain a hosted zone is created for you automatically. You can see your name servers (NS) and start of authority (SOA). On very rare occasions you have to touch those configurations — be careful not to do it now.

Go to Route53 -> hosted zones -> your domain -> create record -> simple routing. As the record name you should put the name of the subdomain: api, dev, etc.

In route traffic to, choose the API gateway alias you created in custom domains for a specific service:

Summary

We just created the recommended flow that will support a microservices development with Route 53 and API gateway. Due to the limit of cloud formation resources set to 200 we can split our services into microservices with dedicated business logic.

Have any questions about our development capabilities? Click here to chat with one of our experts.

Serguey is a Javascript developer with experience in cloud architectures and a TDD advocate.

TribalScale is a global innovation firm that helps enterprises adapt and thrive in the digital era. We transform teams and processes, build best-in-class digital products, and create disruptive startups. Learn more about us on our website. Connect with us on Twitter, LinkedIn & Facebook!

--

--