1 Answer
- Newest
- Most votes
- Most comments
1
If you want multiple containers to work together (e.g., web server container, app server container, DB container), you can simply put all the container definitions into a single task definition and set one of them (e.g., web server) as the essential container. The containers can resolve each other on localhost
interface.
https://docs.aws.amazon.com/AmazonECS/latest/userguide/fargate-task-networking.html
answered 7 months ago
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 2 months ago
Thank you, I did not know about this way. What are the benefits of using Service Connect over this simple method ?
Since I've never used Service Connect feature, I cannot provide a detailed scenario where Service Connect will be very beneficial.
However, I found one case that you need Service Connect is that you need communication between different ECS Services, as mentioned in the following documentation. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect-concepts.html
The reason you might prefer to separate tasks to different ECS services is that you might want to decompose your monolithic app to multiple general purposed microservices, and make them work together for some complex tasks as needed.