getInstancesHealthStatus

Gets the current health status (Healthy, Unhealthy, or Unknown) of one or more instances that are associated with a specified service.

There's a brief delay between when you register an instance and when the health status for the instance is available.

Samples


fun main() { 
   //sampleStart 
   // This example gets the current health status of one or more instances that are associate with a
// specified service.
val resp = serviceDiscoveryClient.getInstancesHealthStatus {
    serviceId = "srv-e4anhexample0004"
} 
   //sampleEnd
}

fun main() { 
   //sampleStart 
   // This example gets the current health status of instances using a service ARN instead of service ID.
// This is useful for checking health status of instances associated with shared namespaces.
val resp = serviceDiscoveryClient.getInstancesHealthStatus {
    serviceId = "arn:aws:servicediscovery:us-west-2:123456789012:service/srv-e4anhexample0004"
} 
   //sampleEnd
}