Skip to content

Service Discovery

Jeff Bachtel edited this page Sep 15, 2018 · 5 revisions

Service Discovery

Service discovery is enabled via ECS Service Discovery. Each service is registered with a Route53 Service Discovery namespace.

Configuration

environments:
  - name: acceptance
    discovery:
      provider: route53              # Which provider to use for service discovery: `route53` is currently the only supported provider (default: route53)
      name: acceptance.mu.local      # What namespace to use for service discovery (default <environment>.<namespace>.local)

When a service named foo is deployed into the environment in the example configuration above, SRV and A records would be created named foo.acceptance.mu.local for each task that is created to run the service. Additionally, an environment variable is automatically added to the ECS task named _SERVICE_DISCOVERY_NAME that contains the acceptance.mu.local namespace name for use by the application when resolving other services in the same namespace.

The default TTL for the resource records is 60 seconds, but can be changed by setting discoveryTTL under the service: in mu.yml.