How can I allow the tasks in my Amazon ECS services to communicate with each other?
Last updated: 2020-04-06
I want to allow the tasks in my Amazon Elastic Container Service (Amazon ECS) services to communicate with each other.
You can allow your tasks to communicate with each other using service discovery. Service discovery helps manage HTTP and DNS namespaces for your Amazon ECS services.
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.
Important: You can't update an existing service to use service discovery, or modify the service discovery configuration once your service is created. You can only configure service discovery when you create a new service.
Before you get started with service discovery, see Service Discovery and review Service Discovery Considerations.
Important: After you have configured service discovery, use the YourServiceDiscoveryServiceName.YourServiceDiscoveryNamespace format to query DNS records for a service discovery service within your Amazon Virtual Private Cloud (Amazon VPC).