Example Usage:

$ ( umask 066 && touch my.creds )
$ cat > my.creds <<EOF 
AWSAccessKeyId=1234567890ABCDEFGHIJ
AWSSecretKey=123456789+8abcdefghijklmjo/tuvwxyzABCDEF
EOF
$ export AWS_CREDENTIAL_FILE=$PWD/my.creds

Example 1: Simple HTTP load balancer with no policies

# Create an elb named "test"

$ elb-create-lb test --headers --listener \
    "lb-port=80,instance-port=80,protocol=HTTP" \
    --availability-zones us-east-1b
DNS_NAME  DNS_NAME
DNS_NAME  test-1998343233.us-east-1.elb.amazonaws.com

# Add two instances to the elb

$ elb-register-instances-with-lb  test  --headers \
    --instances i-d00fdaab, i-feebdaed
INSTANCE_ID  INSTANCE_ID
INSTANCE_ID  i-d00fdaab
INSTANCE_ID  i-feebdaed

# Health will be "InService" if health checks succeed.

$ elb-describe-instance-health test
INSTANCE_ID  i-d00fdaab  InService  N/A  N/A
INSTANCE_ID  i-feebdaed  InService  N/A  N/A

# Remove one of the instances, output contains remaining instances

$ elb-deregister-instances-from-lb test --instances i-d00fdaab
INSTANCE_ID  i-feebdaed

$ elb-describe-lbs
LOAD_BALANCER  test             test-1998343233.us-east-1.elb.amazonaws.com            2011-12-26T02:44:32.320Z

Example 2: HTTP/HTTPs load balancer with a cookie stickiness policy and
    an SSL certificate (see IAM tools for uploading an SSL certificate
    to AWS.)

# Create an elb named "test" that listens on port 80

$ elb-create-lb test --headers --listener \
    "lb-port=80,instance-port=80,protocol=HTTP" \
    --availability-zones us-east-1b
DNS_NAME  DNS_NAME
DNS_NAME  test-1998343233.us-east-1.elb.amazonaws.com

# Add a listener on port 443 for HTTPS and assign an SSL certificate.  See
# the IAM documentation regarding the format of the certificate name

$ elb-create-lb-listeners test --listener "lb-port=443,listener-port=443,protocol=https,cert-id=arn:aws:iam::555555555555:server-certificate/test.example.com.cert"
OK-Creating LoadBalancer Listener

# Define a custom health check that requests /serverCheck.php on port 80

$ elb-configure-healthcheck  test  --headers \
    --target "HTTP:80/serverCheck.php" --interval 30 --timeout 3 \
    --unhealthy-threshold 2 --healthy-threshold 2
HEALTH_CHECK  TARGET                   INTERVAL  TIMEOUT  HEALTHY_THRESHOLD  UNHEALTHY_THRESHOLD
HEALTH_CHECK  HTTP:80/serverCheck.php  30        3        2                  2

# Create a load balancing policy of pining each client to a particular
# back-end server based on the application cookie SESSIONID.  Other
# policy types are available, see elb-describe-lb-policy-types below.

$ elb-create-app-cookie-stickiness-policy test -p test-lb-policy \
  -c SESSIONID
OK-Creating App Stickiness Policy

$ elb-describe-lb-policies test
POLICY  test-lb-policy  AppCookieStickinessPolicyType

# Apply the application-cookie policy to each front-end port.  NOTE: you
# can remove a policy by specifying --policy-names with no argument.

$ elb-set-lb-policies-of-listener test --lb-port 80 \
  --policy-names test-lb-policy
OK-Setting Policies

$ elb-set-lb-policies-of-listener test --lb-port 443 \
  --policy-names test-lb-policy
OK-Setting Policies

# Show the long description of the elb state; all of the configured
# options in one view

$ elb-describe-lbs --show-long
LOAD_BALANCER,test,test-1998343233.us-east-1.elb.amazonaws.com,test-1998343233.us-east-1.elb.amazonaws.com,Z3DZXE0Q79N41H,"{interval=30,target=HTTP:80/serverCheck.php,timeout=3,healthy-threshold=2,unhealthy-threshold=2}",us-east-1b,(nil),(nil),i-feebdaed,"{protocol=HTTP,lb-port=80,instance-protocol=HTTP,instance-port=80,policies=test-lb-policy},{protocol=HTTPS,lb-port=443,instance-protocol=HTTP,instance-port=443,cert-id=arn:aws:iam::555555555555:server-certificate/test.example.com.cert,policies=test-lb-policy}",(nil),"{policy-name=test-lb-policy,cookie-name=SESSIONID}",,"{owner-alias=amazon-elb,group-name=amazon-elb-sg}",(nil),2011-12-26T02:44:32.320Z

Other commands:

# Remove the front-end 443 (HTTPS) listener port from ELB "test"

$ elb-delete-lb-listeners test --lb-ports 443
    
    Warning: Deleting a LoadBalancer listener can lead to service disruption to
    any customers connected to the LoadBalancer listener. Are you sure you want
    to delete this LoadBalancer listener? [Ny]y
OK-Deleting LoadBalancer Listener

# Update/add/change the SSL certificate on an ELB listener port

$ elb-set-lb-listener-ssl-cert test --lb-port 443 \
    --cert-id arn:aws:iam::555555555555:server-certificate/test.example.com.cert
OK-Setting SSL Certificate

# Delete a user-created ELB policy.  Note: the policy must be unused
# before attempting deletion.  Use "elb-describe-lbs --show-long" to
# determine where the policy referenced and
# elb-set-lb-policies-of-listener with a --policy-names option with no
# argument to remove references to the policy.

$ elb-delete-lb-policy test --policy-name test-lb-policy
OK-Deleting Policy

# Add availability zone us-east-1a to an ELB currently in us-east-1b

$ elb-enable-zones-for-lb test --availability-zones us-east-1a
AVAILABILITY_ZONES  us-east-1b, us-east-1a

# Remove availability zone us-east-1a from an ELB currently in us-east-1a,1b

$ elb-disable-zones-for-lb test --availability-zones us-east-1a
AVAILABILITY_ZONES  us-east-1b

# Add "www" pointing at the "test" ELB to Route53 zone example.com.  See
# the Route53 documentation for more information regarding Route53 zone
# IDs and response codes.

$ elb-associate-route53-hosted-zone test --hosted-zone-id Z1JCQ7SC7ZVFL3 \
    --rr-name www.example.com --weight 1
ROUTE53_RECORD_STATUS  /change/CC1IS4MX1SHXEM  PENDING

# Remove the resource record "www" added above.

$ elb-disassociate-route53-hosted-zone test --hosted-zone-id Z1JCQ7SC7ZVFL3 \
     --rr-name www.example.com --weight 1
ROUTE53_RECORD_STATUS  /change/CH8DMZOM0TLRS  PENDING

# Delete the ELB "test"

$ elb-delete-lb test
    
    Warning: Deleting a LoadBalancer can lead to service disruption to any
    customers connected to the LoadBalancer. Are you sure you want to delete
    this LoadBalancer? [Ny]y
OK-Deleting LoadBalancer

$ elb-describe-lb-policy-types
POLICY_TYPE  PublicKeyPolicyType                    Policy containing a list of public keys to accept when authenticating the back-end server(s). This policy cannot be applied directly to back-end servers or listeners but must be part of a BackendServerAuthenticationPolicyType.
POLICY_TYPE  AppCookieStickinessPolicyType          Stickiness policy with session lifetimes controlled by the lifetime of the application-generated cookie. This policy can be associated only with HTTP/HTTPS listeners.
POLICY_TYPE  LBCookieStickinessPolicyType           Stickiness policy with session lifetimes controlled by the browser (user-agent) or a specified expiration period. This policy can be associated only with HTTP/HTTPS listeners.
POLICY_TYPE  SSLNegotiationPolicyType               Listener policy that defines the ciphers and protocols that will be accepted by the load balancer. This policy can be associated only with HTTPS/SSL listeners.
POLICY_TYPE  BackendServerAuthenticationPolicyType  Policy that controls authentication to back-end server(s) and contains one or more policies, such as an instance of a PublicKeyPolicyType. This policy can be associated only with back-end servers that are using HTTPS/SSL.

# Commands with no examples in this README

elb-apply-security-groups-to-lb          
elb-create-lb-policy                     
elb-set-lb-policies-for-backend-server
elb-detach-lb-from-subnets               
elb-attach-lb-to-subnets                 
elb-version
