v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1426158150.9 KB

Discovers registered instances for a specified namespace and service. You can use <code>DiscoverInstances</code> to discover instances for any type of namespace. For public and private DNS namespaces, you can also use DNS queries to discover instances.

post/#X-Amz-Target=Route53AutoNaming_v20170314.DiscoverInstances

Headers

X-Amz-Target'Route53AutoNaming_v20170314.DiscoverInstances' required

Request body

NamespaceNamestring required

The <code>HttpName</code> name of the namespace. It's found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace.

ServiceNamestring required

The name of the service that you specified when you registered the instance.

MaxResultsinteger

The maximum number of instances that you want Cloud Map to return in the response to a <code>DiscoverInstances</code> request. If you don't specify a value for <code>MaxResults</code>, Cloud Map returns up to 100 instances.

QueryParametersobject

Filters to scope the results based on custom attributes for the instance (for example, <code>{version=v1, az=1a}</code>). Only instances that match all the specified key-value pairs are returned.

OptionalParametersobject

Opportunistic filters to scope the results based on custom attributes. If there are instances that match both the filters specified in both the <code>QueryParameters</code> parameter and this parameter, all of these instances are returned. Otherwise, the filters are ignored, and only instances that match the filters that are specified in the <code>QueryParameters</code> parameter are returned.

HealthStatus'HEALTHY' | 'UNHEALTHY' | 'ALL' | 'HEALTHY_OR_ELSE_ALL'
<p>The health status of the instances that you want to discover. This parameter is ignored for services that don't have a health check configured, and all instances are returned.</p> <dl> <dt>HEALTHY</dt> <dd> <p>Returns healthy instances.</p> </dd> <dt>UNHEALTHY</dt> <dd> <p>Returns unhealthy instances.</p> </dd> <dt>ALL</dt> <dd> <p>Returns all instances.</p> </dd> <dt>HEALTHY_OR_ELSE_ALL</dt> <dd> <p>Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is also called failing open.</p> </dd> </dl>

Response

Success

Example response

{
  "Instances": [
    {
      "Attributes": {
        "AWS_INSTANCE_IPV4": "172.2.1.3",
        "AWS_INSTANCE_PORT": "808"
      },
      "HealthStatus": "UNKNOWN",
      "InstanceId": "myservice-53",
      "NamespaceName": "example.com",
      "ServiceName": "myservice"
    }
  ]
}