I want to deploy an Angular and spring boot application (Microservice architecture) in the AWS cloud. Can anyone tell me how can I deploy it using ecs and fargate means how to connect the angular application with microservices? Or anyone knows any article/reference over the internet for doing it?
2 Answers
Iam pretty new to this topic to. It depends on your system architecture. If it is a basic service. I would move the application to a container and move it to the cloud. I suggest to read articles about container files like docker or orchistration tools like kubernetes.
Edit:
Try this: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html
Based on the question, i assume that you have 'angular app', Service1, service 2 etc where each services running independent to each other.
- Create Elastic Load balancer (public).
- Independent Spring boot services (Dockerize), deploy in ECS and attach to the load balancer as a path (Path Based routing) where each services have the servlet paths ex: /service1*, /service2* etc.
Angular - Dockerize it (nginx as base image) configure the server(microservice) endpoint of ELB (created above) in the environment variable. - this is because usually javascript codes will be executing in the browser and need a public URL for it to fetch the data from the microservices.
Also add this angular docker to an ELB (path based routing /*). Ref: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html
Hope this helps.