RegisterInstancesWithLoadBalancer - Elastic Load Balancing
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Adds the specified instances to the specified load balancer.

The instance must be a running instance in the same network as the load balancer (EC2-Classic or the same VPC). If you have EC2-Classic instances and a load balancer in a VPC with ClassicLink enabled, you can link the EC2-Classic instances to that VPC and then register the linked EC2-Classic instances with the load balancer in the VPC.

Note that RegisterInstanceWithLoadBalancer completes when the request has been registered. Instance registration takes a little time to complete. To check the state of the registered instances, use DescribeLoadBalancers or DescribeInstanceHealth.

After the instance is registered, it starts receiving traffic and requests from the load balancer. Any instance that is not in one of the Availability Zones registered for the load balancer is moved to the OutOfService state. If an Availability Zone is added to the load balancer later, any instances registered with the load balancer move to the InService state.

To deregister instances from a load balancer, use DeregisterInstancesFromLoadBalancer.

For more information, see Register or deregister EC2 instances in the User Guide for Classic Load Balancers.

Request Parameters

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


The IDs of the instances.

Type: Array of Instance objects

Required: Yes


The name of the load balancer.

Type: String

Required: Yes

Response Elements

The following element is returned by the service.


The updated list of instances for the load balancer.

Type: Array of Instance objects


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


The specified endpoint is not valid.

HTTP Status Code: 400


The specified load balancer does not exist.

HTTP Status Code: 400


Register instances

This example registers the specified instance with the specified load balancer.

Sample Request &LoadBalancerName=my-loadbalancer &Instances.member.1.InstanceId=i-315b7e51 &Version=2012-06-01 &AUTHPARAMS

Sample Response

<RegisterInstancesWithLoadBalancerResponse xmlns=""> <RegisterInstancesWithLoadBalancerResult> <Instances> <member> <InstanceId>i-315b7e51</InstanceId> </member> </Instances> </RegisterInstancesWithLoadBalancerResult> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </RegisterInstancesWithLoadBalancerResponse>

See Also

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