What is the best way to centralize microservices URL on aws?

47 views Asked by At

Lets suppose I have 3 backend microservices that my frontend team consumes: Pokemons microservice, auth microservice, graphs microservice.

these 3 microservices are deployed using Zappa that is a serverless python to send microservices to lambda. When I deploy my microservices to zappa I receive a url to access then like: urlrandomjdbcaur.amazon-aws.com/production

Each microservice has one different url, and if I want to change from zappa to an ec2 for example I will need to change the urls and the frontend team will need to replace the old URL to the new url used to access the service. What I would like to do is have an url to acess all microservices, and each time i want to change a service from zappa to ec2, or ec2 to zappa or ecs to zappa the frontend team will not need to care about it.

so imagine that my pokemon microservice have the url urlrandomjdbcaur.amazon-aws.com/production, I would like to have something like backendapi.aws.com/pokemon and the frontend will consume all about pokemons from this urls, and my auth microservice will be consumed from the url backendapi.aws.com/auth and etc. This way frontend team will never care about change urls again.

This is a good practice? If yes, what is the best way to do it using AWS?

1

There are 1 answers

0
Mark B On

Yes is it always good practice to use a custom domain so that your consumers don't have to worry about your DNS name changing.

Here is the documentation for doing this using Zappa. If you follow the "Option 1" in that guide, which uses Route53 and ACM, then you could switch later to an EC2 instance behind a load balancer, or one or more services behind CloudFront, without the client ever being aware of the change.