1 Answer
- Newest
- Most votes
- Most comments
0
Service Discovery is the correct route, it will allow you to manage the DNS and namespaces for your ECS Tasks. IP to IP will become a problem to keep track of as these will change if a Task, which can be done through application by querying for task's ip but that add more lift to application side.
Note: Service discovery supports the A and SRV DNS record types. DNS records are automatically added or removed as tasks start or stop in the Amazon ECS service. Tasks or applications that need to connect to your Amazon ECS service can locate an existing task from the DNS record. https://aws.amazon.com/blogs/aws/amazon-ecs-service-discovery/
answered 2 years ago
Relevant content
- asked 6 months ago
- asked 3 years ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated a year ago
Thanks for your answer. I have one more question from your answer. When will an IP address change of a task?
IP will change when tasks goes through lifecycle[1], this could be do to a voluntary change or involuntary change. Voluntary being change to task definition to deploy new version of task so tasks will be drained and re-deployed or stop/start of a standalone task, or involuntary a task become unhealthy and needs to be rescheduled. As well this may not be as obvious if you aren't using awsvpc networking mode, cause with bridge or host it will be using the worker node (container instance) IP. [2]
[1]https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-lifecycle.html [2]https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html