Menu
Elastic Load Balancing
API Reference (API Version 2012-06-01)

DescribeInstanceHealth

Describes the state of the specified instances with respect to the specified load balancer. If no instances are specified, the call describes the state of all instances that are currently registered with the load balancer. If instances are specified, their state is returned even if they are no longer registered with the load balancer. The state of terminated instances is not returned.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

Instances.member.N

The IDs of the instances.

Type: array of Instance objects

Required: No

LoadBalancerName

The name of the load balancer.

Type: String

Required: Yes

Response Elements

The following element is returned by the service.

InstanceStates.member.N

Information about the health of the instances.

Type: array of InstanceState objects

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidInstance

The specified endpoint is not valid.

HTTP Status Code: 400

LoadBalancerNotFound

The specified load balancer does not exist.

HTTP Status Code: 400

Examples

Describe Instance Health

This example describes the health of the instances for the specified load balancer.

Sample Request

Copy
https://elasticloadbalancing.amazonaws.com/?Action=DescribeInstanceHealth &LoadBalancerName=my-loadbalancer &Version=2012-06-01 &AUTHPARAMS

Response for a Healthy Instance

This following example response describes a healthy instance.

Sample Response

Copy
<DescribeInstanceHealthResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/"> <DescribeInstanceHealthResult> <InstanceStates> <member> <Description>N/A</Description> <InstanceId>i-90d8c2a5</InstanceId> <State>InService</State> <ReasonCode>N/A</ReasonCode> </member> </InstanceStates> </DescribeInstanceHealthResult> <ResponseMetadata> <RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata> </DescribeInstanceHealthResponse>

Response for an Instance Not Yet Registered

The following example response describes an instance that is still being registered.

Sample Response

Copy
<DescribeInstanceHealthResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/"> <DescribeInstanceHealthResult> <InstanceStates> <member> <Description>Instance registration is still in progress.</Description> <InstanceId>i-315b7e51</InstanceId> <State>OutOfService</State> <ReasonCode>ELB</ReasonCode> </member> </InstanceStates> </DescribeInstanceHealthResult> <ResponseMetadata> <RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata> </DescribeInstanceHealthResponse>

Response for Unhealthy Instance

This following example response describes an unhealthy instance.

Sample Response

Copy
<DescribeInstanceHealthResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/"> <DescribeInstanceHealthResult> <InstanceStates> <member> <Description>Instance has failed at least the UnhealthyThreshold number of health checks consecutively.</Description> <InstanceId>i-fda142c9</InstanceId> <State>OutOfService</State> <ReasonCode>Instance</ReasonCode> </member> </InstanceStates> </DescribeInstanceHealthResult> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </DescribeInstanceHealthResponse>

Response for an Instance in an Unknown State

This following example response describes an instance in an unknown state.

Sample Response

Copy
<DescribeInstanceHealthResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/"> <DescribeInstanceHealthResult> <InstanceStates> <member> <Description>A transient error occurred. Please try again later.</Description> <InstanceId>i-7f12e649</InstanceId> <State>Unknown</State> <ReasonCode>ELB</ReasonCode> </member> </InstanceStates> </DescribeInstanceHealthResult> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </DescribeInstanceHealthResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: