Getting Information About the Health of a Back-end Instance

You can get information about the health of any instance that is registered with a load balancer and that is not terminated. If an instance is considered as unhealthy, you also get the reason of this state.

If you exceed the number of identical requests allowed for a configured time period, the Throttling error message is returned.

To get information about the health of one or more back-end instances of a load balancer, use the describe-instance-health command following this syntax:

Request sample
$ aws elb describe-instance-health \
    --profile YOUR_PROFILE \
    --load-balancer-name my-load-balancer \
    --instances i-01234567 \
    --endpoint https://lbu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • load-balancer-name: The name of the load balancer.

  • (optional) instances: One or more instance IDs

    • If you do not specify any instance ID, the request returns a description of all the back-end instances of the specified load balancer.

    • If you specify the ID of an instance that is no longer registered with the specified load balancer, the request still returns a description of this instance.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The describe-instance-health command returns the following elements:

  • InstanceStates: Information about the state of one or more instances. This element contains the following information for each instance:

    • InstanceId: The ID of the instance.

    • ReasonCode: Whether the instance is OutOfService because of the load balancer or the instance itself, if so.

    • State: The state of the instance.

    • Description: The description of the instance state.

Result sample
{
  "InstanceStates": [
      {
          "InstanceId": "i-01234567",
          "ReasonCode": "N/A",
          "State": "InService",
          "Description": "N/A"
      }
  ]
}

Related Pages

Corresponding API Method

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.