Reputation: 2166
I know how to refer to "services" from within the same task. But how can I refer to an essential task from within another task definition? For example:
Upvotes: 6
Views: 2746
Reputation: 669
ECS has service discovery built in This makes it possible for an ECS service to automatically register itself with a predictable and friendly DNS name in Amazon Route 53.
Upvotes: 2
Reputation: 4532
There's a distinction between marking a container as essential and routing between containers.
Assuming you're looking for a routing solution (a.k.a. service discovery); there's nothing anything build into ECS. You can go for the AWS solution which is to use Application Load Balancers (ALBs) that are nicely integrated with dynamic port binding in your ECS cluster. The basic idea is simple: a request from service A to service B goes first to a loadbalancer (ALB) that routes the request to a target group that contains all ports of running/healthy instances of service B.
Downside of the AWS solution is that it's fairly expensive for small setups, because you need at least one ALB per 10 (internal) services.
Alternatively you can setup a 3rd party solution for service discovery, e.g. Consul is one that also plays nicely with AWS.
Upvotes: 1