Elastic Load Balancing
Developer Guide (API Version 2011-11-15)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Creating a Load Balancer With SSL Cipher Settings and Back-end Server Authentication

This example walks you through the process of creating your own load balancer with custom settings. The following task list describes the process of creating a load balancer.

Before you get started, be sure you've met the following preconditions:

  • Sign up for Amazon Web Services (AWS). If you haven't signed up for AWS yet, go to http://aws.amazon.com and click the Sign Up Now button.

  • Sign in to the AWS Management Console and open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

    Alternatively, you can create load balancer using the command line interface or the Query API. Install the tools you'll need to perform Elastic Load Balancing tasks. For information on installing the command line interface and the Query API, see Accessing Elastic Load Balancing.

  • Download and install the AWS Identity and Access Management command line interface. For more information, go to Get the Tools in the AWS Identity and Access Management Getting Started Guide.

  • In Availability Zone us-east-1a, launch the instances you intend to register with your load balancer.

  • Elastic Load Balancer maintains a 60 second timeout setting for idle connections to back-end application servers. Update these settings on your back-end server to a timeout of at least 60 seconds for the communication to work properly.

  • The instances to be registered with your load balancer must respond to the target of the health check with an HTTP status code 200.

  • Create a signed certificate. For information on how to create a signed certificate, go to Creating and Uploading Server Certificates in Using AWS Identity and Access Management.

Tasks for Creating a Load Balancer with SSL Cipher Settings and Back-end Server Authentication

1

Configure the listeners for your load balancer by specifying the ports and protocols to use for front-end connection (client to load balancer) and back-end connection (load balancer to back-end instance).

2

Configure SSL ciphers for SSL negotiation when a connection is established between the client and your load balancer.

3

[Optional] Enable the back-end server authentication.

4

Configure an application health check for your back-end instances.

5

Add Amazon EC2 instances to your load balancer.

6

Launch your load balancer.


The following sections include instructions for creating a load balancer using the AWS Management Console, command line interface, or the Query API.

Using AWS Management Console

Configuring Listeners

Configure the listeners for your load balancer by specifying the ports and protocols to use for front-end connection (client to load balancer) and back-end connection (load balancer to back-end instance). The first listener accepts HTTP requests on port 80 and sends the request to the back-end application instances on port 8080 using HTTP. The second listener accepts HTTPS requests on port 443 and sends the request to back-end application instances using HTTPS on port 443.

To configure listeners for your load balancer

  1. Start the Create Load Balancer wizard:

    1. On the Amazon EC2 Console Dashboard page, click Load Balancers in the Navigation pane.

      EC2 Console

    2. On the Load Balancers page, click Create Load Balancers.

    3. The DEFINE LOAD BALANCER page of the Create a New Load Balancer wizard opens.

  2. On the DEFINE LOAD BALANCER page, enter a name for your load balancer (e.g., MyLoadBalancer).

  3. Leave the Listener Configuration set to the default value for the first listener.

  4. Select HTTPS (Secure HTTP) from the drop-down box in the Load Balancer Protocol box. This populates the Load Balancer Port box. Select HTTPS (Secure HTTP) from the drop-down box in the Instance Protocol box, then enter port number 443 for the instance port in the Instance port box.

    Name your load balancer

  5. Click Save, then Click Continue to upload your SSL certificate.

  6. Select Choose from your existing SSL Certificates to use the previously uploaded SSL certificate and select the certificate from the drop-down box.

  7. Or, select Upload a new SSL Certificate to define a new SSL certificate.

    1. Enter the name of the certificate to upload.

    2. Copy and paste the contents of the private key file (pem encoded) in the Private Key box.

    3. Copy and paste the contents of the public key certificate file (pem encoded) in the Public Key Certificate box.

    4. [Optional] Copy and paste the contents of the public key certificate chain file (pem encoded) in the Certificate Chain box.

      [Note]Note

      The certificate chain must be ordered such that the root certificate is the last certificate in the chain. If you use a certificate chain in a different order, you will receive an error.

    Upload SSL Certificate

  8. Click Continue to configure SSL ciphers for the HTTPS/SSL listeners.

Configuring SSL Ciphers

Next the wizard takes you through the steps for configuring SSL ciphers for your HTTPS/SSL listeners. The Elastic Load Balancing service provides you with sample cipher policies, ELBSample-ELBDefaultCipherPolicy and ELBSample-OpenSSLDefaultCipherPolicy. You can select one of the sample policies or customize your own ciphers.

  1. To customize the SSL ciphers, select Custom on the DEFINE LOAD BALANCER page, then select the protocol version and the ciphers from the list box.

    [Note]Note

    You must enable at least one protocol version and one cipher for SSL negotiation to take place.

    Configure Ciphers
  2. Click Continue to configure back-end server authentication.

Configuring Back-end Server Authentication

Next the wizard gives you an option to enable authentication for your back-end server if you have selected HTTPS/SSL protocol between your load balancer and the back-end instance.

  1. Select Proceed without backend authentication if you do not want to enable authentication for your back-end server

  2. Or, select Enable backend authentication to enable back-end server authentication.

    1. Enter the name of the public key certificate in the Certificate Name box, and then copy and paste the contents of the certificate (pem encoded) in the Certificate body box.

      Configure Back-end Server Authentication
    2. Click Add another Backend Certificate to add multiple certificates.

  3. Click Continue to configure health check for your back-end server.

Configuring Health Check Settings

Next the wizard takes you through the steps for configuring a health check for your back-end instances.

To configure the health check

  1. Configure the health check settings that your application requires.

    Configure Health Check

  2. Click Continue to add your Amazon EC2 instances.

Adding Amazon EC2 Instances

Next the wizard takes through the steps for adding Amazon EC2 instances to your load balancer.

To add Amazon EC2 instances

  1. Check the boxes in the Select column to add instances to your load balancer.

    Add Amazon EC2 Instances

  2. Click Continue to review your configuration. On the Review page, click Create to create your load balancer.

[Important]Important

Elastic Load Balancing associates your load balancer with your EC2 instance using the IP addresses. When the instance is stopped and then restarted, the IP addresses associated with your instance changes. Your load balancer cannot recognize the new IP address, which prevents it from routing traffic to your instances. We recommend that you de-register your Amazon EC2 instances from your load balancer after you stop your instance, and then register the load balancer with your instance after you've restarted. For procedures associated with de-registering and then registering your instances with load balancer, see De-Registering and Registering Amazon EC2 Instances.

Using Query API

Configuring Listeners

In this example, you configure the listeners for your load balancer by specifying the ports and protocols to use for front-end connection (client to load balancer) and back-end connection (load balancer to back-end instance). The first listener accepts HTTP requests on port 80 and sends the request to the back-end application instances on port 8080 using HTTP. The second listener accepts HTTPS requests on port 443 and sends the request to back-end application instances using HTTPS on port 443. You also need to specify the Availability Zone that you want to enable for your load balancer.

For detailed descriptions of the Elastic Load Balancing API operations, see Elastic Load Balancing API Reference.

To configure listeners for your load balancer

  1. Call the AWS Identity and Access Management UploadServerCertificate API with the following parameters:

    • ServerCertificateName = testCert

    • CertificateBody = <encoded certificate body>

    • PrivateKey = <encoded private key>

    • CertificateChain = <concatenation of the encoded public key certificates>

      [Note]Note

      CertificateChain is optional. If you are using CertificateChain, then you must order the certificates such that the root certificate is the last certificate in the chain. If you use a certificate chain in a different order, you will receive an error.

    • Path = /

      [Note]Note

      Path is optional. If it is not included, the path defaults to /. For more information about paths, go to Identifiers for IAM Entities in Using AWS Identity and Access Management.

    The response includes the ARN of the server certificate. Use this value for the SSLCertificateId parameter in the following call to CreateLoadBalancer.

  2. Call CreateLoadBalancer with the following parameters:

    • AvailabilityZones = us-east-1a

    • Listener

      • Protocol = HTTP

      • InstanceProtocol = HTTP

      • InstancePort = 8080

      • LoadBalancerPort = 80

    • Listener

      • Protocol = HTTPS

      • InstanceProtocol = HTTPS

      • InstancePort = 443

      • LoadBalancerPort = 443

      • SSLCertificateID = arn:aws:iam::55555555555:server-certificate/production/myCert

    • LoadBalancerName = MyLoadBalancer

    The operation returns the DNS name of your load balancer. You can then map any other domain name (such as www.example.com) to your load balancer’s DNS name using CNAME or some other technique.

Configuring SSL Ciphers

In this example, you create an SSL cipher policy to configure SSL ciphers for SSL negotiation when a connection is established between the client and your load balancer. The Elastic Load Balancing service defines a policy called SSLNegotiationPolicyType. You create your own SSL cipher policy MySSLNegotiationPolicy of the type SSLNegotiationPolicyType. After creating the SSL cipher policy, you enable the cipher settings by associating MySSLNegotiationPolicy with a listener.

To configure SSL Ciphers

  1. List all the policies associated with your load balancer by calling DescribeLoadBalancerPolicies with the following parameter:

    • LoadBalancerName = MyLoadBalancer

    The response includes the policy names and the attributes of all the policies associated with your load balancer. The attributes associated with SSLNegotiationPolicyType list the default cipher settings for your load balancer. Use the attributes in the following call to CreateLoadBalancerPolicy to configure your own cipher settings.

    [Note]Note

    For more information on the available ciphers, go to http://www.openssl.org/docs/apps/ciphers.html.

  2. Call CreateLoadBalancerPolicy with the following parameters:

    • PolicyName = MySSLNegotiationPolicy

    • PolicyTypeName = SSLNegotiationPolicyType

    • PolicyAttributes

      • AttributeName = Protocol-TLSv1

      • AttributeValue = true

    • LoadBalancerName = MyLoadBalancer

  3. Call SetLoadBalancerPoliciesOfListener with the following parameters:

    • LoadBalancerPort = 443

    • PolicyNames = MySSLNegotiationPolicy

    • LoadBalancerName = MyLoadBalancer

  4. View the details of MySSLNegotiationPolicy by calling DescribeLoadBalancerPolicies with the following parameters:

    • LoadBalancerName = MyLoadBalancer

    • PolicyNames = MySSLNegotiationPolicy

Configuring Back-end Server Authentication

In this example, you enable back-end server authentication. First you create a public key policy that uses a public key for authentication. You then use the public key policy to create a back-end server authentication policy. Finally, you enable the backend server authentication by setting the back-end server authentication policy with the back-end server port. In this example, the back-end server is listening with SSL/HTTPS protocol set to instance port 443.

The value of the public key policy is the public key of the certificate that the back-end servers will present to the load balancer. You can retrieve the public key using OpenSSL.

[Note]Note

To extract the public key from a pem-encoded certificate, you can use the following command:

PROMPT> openssl x509 -inform pem -in <CERTIFICATE_FILE_NAME> -noout -pubkey)

Remove the BEGIN and END lines from the output so that the output is similar to that described below."

To configure back-end server authentication

  1. Call CreateLoadBalancerPolicy with the following parameters:

    • PolicyName = MyPublicKeyPolicy

    • PolicyTypeName = PublicKeyPolicyType

    • PolicyAttributes

      • AttributeName = PublicKey

      • AttributeValue = MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6 b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN MTIwNDI0MjA0NTIxWjEXAMPLE

    • LoadBalancerName = MyLoadBalancer

  2. Call CreateLoadBalancerPolicy with the following parameters:

    • PolicyName = MyBackendServerAuthenticationPolicy

    • PolicyTypeName = BackendServerAuthenticationPolicyType

    • PolicyAttributes

      • AttributeName = PublicKeyPolicyName

      • AttributeValue = MyPublicKeyPolicy

    • LoadBalancerName = MyLoadBalancer

  3. Call SetLoadBalancerPoliciesForBackendServer with the following parameters:

    • LoadBalancerName = MyLoadBalancer

    • InstancePort = 443

    • PolicyNames = MyBackendServerAuthenticationPolicy

  4. To list all the policies associated with your load balancer,

    call DescribeLoadBalancerPolicies with the following parameters:

    • LoadBalancerName = MyLoadBalancer

  5. To view the details of MyBackendServerAuthenticationPolicy,

    call DescribeLoadBalancerPolicies with the following parameters:

    • LoadBalancerName = MyLoadBalancer

    • PolicyNames = MyBackendServerAuthenticationPolicy

Configuring Health Check Settings

In this example, you configure the health check settings for your back-end servers.

To configure health check settings

  • Call ConfigureHealthCheck with the following parameters:

    • LoadBalancerName = MyLoadBalancer

    • Target = http:8080/ping

      [Note]Note

      Make sure your instances respond to/ping on port 8080 with an HTTP 200 status code.

    • Interval = 30

    • Timeout = 3

    • HealthyThreshold = 2

    • UnhealthyThreshold = 2

Adding Amazon EC2 Instances

In this example, you register your newly created load balancer with your Amazon EC2 instances.

[Important]Important

You should only register instances that are in the Pending or Running state and are not in a Virtual Private Cloud(VPC). If you are using Elastic Load Balancing in a VPC, see How Do I Use Elastic Load Balancing in Amazon VPC

To add Amazon EC2 instances

  • Call RegisterInstancesWithLoadBalancer with the following parameters:

    • LoadBalancerName = MyLoadBalancer

    • Instances = [ i-4f8cf126, i-0bb7ca62 ]

    [Note]Note

    To allow communication between Elastic Load Balancing and your back-end instances, create a security group ingress rule that applies to all of your back-end instances. The security group rule can either allow ingress traffic from all IP addresses (the 0.0.0.0/0 CIDR range) or allow ingress traffic only from Elastic Load Balancing. To ensure that your back-end EC2 instances can receive traffic only from Elastic Load Balancing, enable network ingress for the Elastic Load Balancing security group on all of your back-end EC2 instances. For more information, see Using Security Groups with Elastic Load Balancing.

[Important]Important

Elastic Load Balancing registers your load balancer with the instance using the IP adresses. When the instance is stopped and then restarted, the IP addresses associated with your instance changes. Your load balancer cannot recognize the new IP address, which prevents it from routing traffic to your instances. We recommend you de-register your Amazon EC2 instances from your load balancer after you stop your instance, and then register the new instance ID with the load balancer after you restart your instance. For procedures associated with de-registering and then registering your instances with load balancer, see De-Registering and Registering Amazon EC2 Instances.

Using the Command Line Interface

Configuring Listeners

In this example, you configure the listeners for your load balancer by specifying the ports and protocols to use for front-end connection (client to load balancer) and back-end connection (load balancer to back-end instance). The first listener accepts HTTP requests on port 80 and sends the request to the back-end application instances on port 8080 using HTTP. The second listener accepts HTTPS requests on port 443 and sends the request to back-end application instances using HTTPS on port 443. You also need to specify the Availability Zone that you want to enable for your load balancer.

For descriptions of all the Elastic Load Balancing commands, see Elastic Load Balancing Quick Reference Card.

To configure listeners for your load balancer

  1. Enter the command iam-servercertupload in verbose mode to upload your digitally signed certificate to the AWS IAM service.

    [Note]Note

    For information on how to create a signed certificate, go to Creating and Uploading Server Certificates in Using AWS Identity and Access Management.

    PROMPT> iam-servercertupload -b <encoded certificate body> -k <encoded private key> -s myCert [-c <concatenation of the encoded public key certificates>] -v
    [Note]Note

    -c is optional. If you are using -c, then you must order the certificates such that the root certificate is the last certificate in the chain. If you use a certificate chain in a different order, you will receive an error.

    The response includes the server certificate Amazon Resource Name (ARN) and GUID.

    arn:aws:iam::55555555555:server-certificate/production/myCert
    ASCACexampleKEZUQ4K	
  2. Copy the ARN for the next step.

  3. Enter the command elb-create-lb as in the following example.

    PROMPT> elb-create-lb  MyLoadBalancer --headers --listener "lb-port=80,instance-port=8080,protocol=http,instance-protocol=http" 
    		--listener "lb-port=443,instance-port=443,protocol=https,instance-protocol=https, cert-id=arn:aws:iam::55555555555:server-certificate/production/myCert" --availability-zones us-east-1a

    Elastic Load Balancing returns the following:

    DNS-NAME  DNS-NAME
    DNS-NAME  MyLoadBalancer-2111276808.us-east-1a.elb.amazonaws.com

Configuring SSL Ciphers

When you first create your ELB, it is created with a default set of SSL ciphers and protocols. You can create overrides to this default by specifying your own cipher policy.

In this example, you create an SSL cipher policy to configure SSL ciphers for SSL negotiation when a connection is established between the client and your load balancer. The Elastic Load Balancing service defines a policy called SSLNegotiationPolicyType. You create your own SSL cipher policy MySSLNegotiationPolicy of the type SSLNegotiationPolicyType. After creating the SSL cipher policy, you enable the cipher settings by associating MySSLNegotiationPolicy with a listener.

To configure SSL ciphers

  1. Enter the command elb-describe-lb-policies, as in the following example, to list all the policies associated with MyLoadBalancer.

    PROMPT>elb-describe-lb-policies MyLoadBalancer --headers

    Elastic Load Balancing returns the following:

    POLICY  NAME                     TYPE_NAME
    POLICY  MyAppStickinessPolicy    AppCookieStickinessPolicyType
    POLICY  MyLBStickinessPolicy     LBCookieStickinessPolicyType
    POLICY  MySSLNegotiationPolicy   SSLNegotiationPolicyType
    					

    The response includes the policy names of all the policies associated with your load balancer. We will be using SSLNegotiationPolicyType to create a new policy by changing the pre-defined cipher settings. For more information on all the available ciphers, go to http://www.openssl.org/docs/apps/ciphers.html.

  2. Enter the command elb-describe-lb-policy-types, as in the following example to retrieve a list of available ciphers and policies associated with SSLNegotiationPolicyType.

    PROMPT>elb-describe-lb-policy-types SSLNegotiationPolicyType --show-long

    We will be changing the cipher settings and the protocols associated with SSLNegotiationPolicyType to create MySSLNegotiationPolicy.

  3. Enter the command elb-create-lb-policy, as in the following example, to create a new policy for your load balancer that accepts TLSv1 protocol, does not accept SSLv2 protocol, and accepts the cipher DHE-RSA-AES256-SHA. Protocol SSLv3 is still enabled, because that is part of the default policy.

    PROMPT>elb-create-lb-policy MyLoadBalancer --policy-name MySSLNegotiationPolicy --policy-type SSLNegotiationPolicyType --attribute "name=Protocol-TLSv1,value=true" --attribute "name=Protocol-SSLv2,value=false  --attribute "name=DHE-RSA-AES256-SHA,value=true" 
  4. Enter the command elb-set-lb-policies-of-listener, as in the following example, to enable the cipher settings by setting the MySSLNegotiationPolicy with a listener.

    PROMPT>elb-set-lb-policies-of-listener MyLoadBalancer --lb-port 443 --policy-name MySSLNegotiationPolicy>
  5. Enter the command elb-describe-lb-policies , as in the following example, to view details of MySSLNegotiationPolicy.

    PROMPT>elb-describe-lb-policies MyLoadBalancer --policy-names MySSLNegotiationPolicy>

    Following is the partial listing of the example response:

    POLICY,NAME,TYPE_NAME,POLICY_ATTRIBUTE_DESCRIPTIONS
    POLICY,MySSLNegotiationPolicy,SSLNegotiationPolicyType,"{name=Protocol-SSLv2,value=true},{name=EDH-DSS-DES-CBC3-SHA,value=false},{name=DHE-RSA-CAMELLIA128-SHA,value=false},{name=DES-CBC-MD5,value=false},{name=KRB5-RC4-SHA,value=false},{name=ADH-CAMELLIA128-SHA,value=false},{name=EXP-KRB5-RC4-MD5,value=false}

Configuring Back-end Server Authentication

In this example, you enable the back-end server authentication by creating a public key policy that uses a public key for authentication. You then use the public key policy to create a back-end server authentication policy. Finally, you enable the backend server authentication by setting the back-end server authentication policy with the back-end server port. In this example, the back-end server is listening with SSL/HTTPS protocol set to instance port 443.

The value of the public key policy is the public key of the certificate that the back-end servers will present to the load balancer. You can retrieve the public key using OpenSSL.

To configure back-end server authentication

  1. Enter the command openssl x509 to retrieve the public key.

    openssl x509 -in PublicKey -pubkey -noout
  2. Enter the command elb-create-lb-policy, as in the following example, to create a public key policy.

    PROMPT>elb-create-lb-policy MyLoadBalancer --policy-name MyPublicKeyPolicy --policy-type-name PublicKeyPolicyType --attribute "name=PublicKey,value=MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6EXAMPLE"
    [Note]Note

    To specify a public key value for the attribute argument, remove the first and last lines of the public key (the line containing "-----BEGIN PUBLIC KEY-----" and the line containing "-----END PUBLIC KEY-----"). The CLI does not accept white space characters inside the value for the attribute argument.

  3. Enter the command elb-create-lb-policy, as in the following example, to create a back-end server authentication policy by referring to MyPublicKeyPolicy. You can refer to multiple public key policies. When multiple public key policies are used, the load balancer will try all the keys one by one for authentication. If one of the public keys matches the server certificate, authentication passes.

    PROMPT>elb-create-lb-policy MyLoadBalancer --policy-name MyBackendServerAuthenticationPolicy --policy-type-name BackendServerAuthenticationPolicyType --attribute "name=PublicKeyPolicyName,value=MyPublicKeyPolicy" 
  4. Enter the command elb-set-lb-policies-for-backend, as in the following example, to set MyBackendServerAuthenticationPolicy to the back-end server port.

    PROMPT>elb-set-lb-policies-for-backend MyLoadBalancer --instance-port 443 --policy-names MyBackendAuthenticationPolicy
  5. Enter the command elb-describe-lb-policies, as in the following example, to list all the policies created for MyLoadBalancer.

    PROMPT>elb-describe-lb-policies MyLoadBalancer
  6. Enter the command elb-describe-lb-policies, as in the following example, to view details of MyBackendServerAuthenticationPolicy.

    PROMPT>elb-describe-lb-policies MyLoadBalancer --policy-names MyBackendServerAuthenticationPolicy

Configuring Health Check Settings

In this example, you configure the health check settings for your back-end servers.

  • To configure health check settings for your back-end server

    Enter the command elb-configure-healthcheck as in the following example.

    PROMPT> elb-configure-healthcheck  MyLoadBalancer  --headers --target "HTTP:8080/ping" --interval 30 --timeout 3 --unhealthy-threshold 2 --healthy-threshold 2

    Elastic Load Balancing returns the following:

    HEALTH-CHECK TARGET INTERVAL TIMEOUT HEALTHY-THRESHOLD UNHEALTHY-THRESHOLD
    HEALTH-CHECK  HTTP:8080/ping  30     3      2       2			

Adding Amazon EC2 Instances

In this example, you register your newly created load balancer with your Amazon EC2 instances.

[Important]Important

You should only register instances that are in the Pending or Running state and are not in a Virtual Private Cloud (VPC). If you are using Elastic Load Balancing in a VPC, see How Do I Use Elastic Load Balancing in Amazon VPC.

  • To add Amazon EC2 instances

    Use the elb-register-instances-with-lb command as in the following example.

    PROMPT> elb-register-instances-with-lb  MyLoadBalancer  --headers --instances i-4f8cf126,i-0bb7ca62

    Elastic Load Balancing returns the following:

    INSTANCE  INSTANCE-ID
    INSTANCE  i-4f8cf126
    INSTANCE  i-0bb7ca62		
[Important]Important

Elastic Load Balancing registers your load balancer with the instance using the IP addresses. When the instance is stopped and then restarted, the IP addresses associated with your instance changes. Your load balancer cannot recognize the new IP address, which prevents it from routing traffic to your instances. We recommend you de-register your Amazon EC2 instances from your load balancer after you stop your instance, and then register the new instance ID with the load balancer after you restart your instance. For procedures associated with de-registering and then registering your instances with load balancer, see De-Registering and Registering Amazon EC2 Instances.