How can I allow the tasks in my Amazon ECS services to communicate with each other?

2 分的閱讀內容
0

I want to allow the tasks in my Amazon Elastic Container Service (Amazon ECS) services to communicate with each other.

Short description

You can use Amazon ECS Service Connect or service discovery to allow your tasks to communicate with each other. It's a best practice to use ECS Service Connect which provides Amazon ECS configuration for service discovery, connectivity, and traffic monitoring. Service discovery helps manage HTTP and DNS namespaces for your Amazon ECS services.

Note: Service Connect isn't compatible with Host network mode. 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.

Resolution

To determine the option that fits your architecture, see Interconnecting services.

Use Service Connect

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

Before you use Service connect, see Service Connect considerations. Use either the Amazon ECS console or the AWS CLI to configure Service Connect.

Important: After you have configured service connect, use the endpoint URL to connect with other service within the same namespace.

Use service discovery

Before you use service discovery, see Service discovery considerations. Use either the Amazon ECS console or the AWS CLI to configure service discovery.

Important: After you configure service discovery, use the YourServiceDiscoveryServiceName.YourServiceDiscoveryNamespace format to query DNS records for a discovery service within your Amazon Virtual Private Cloud (Amazon VPC).

AWS 官方
AWS 官方已更新 3 天前
2 評論

"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)." - this doesn't seem to work and gives connection refused error.

Adit
回答 3 個月前

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

profile pictureAWS
管理員
回答 3 個月前