This gist provides a sample terraform configuration to use service discovery for ecs service. It is useful when configuring a service that is only accessible internally without having to configure ELB and Route 53.
- Create service discovery namespace
- Create service discovery configuration
A
for serviceB
- Create ECS service
B
to resiger with discovery configurationA
- Access service
B
using dns name
This will automatically register new ECS tasks with Cloud Map when scaling in/out