• No results found

[NORMAL] Elastic Load Balancing. API Reference API Version

N/A
N/A
Protected

Academic year: 2021

Share "Elastic Load Balancing. API Reference API Version"

Copied!
106
0
0

Loading.... (view fulltext now)

Full text

(1)

API Reference

(2)

Elastic Load Balancing: API Reference

Copyright

©

2014 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.

The following are trademarks of Amazon Web Services, Inc.: Amazon, Amazon Web Services Design, AWS, Amazon CloudFront, Cloudfront, Amazon DevPay, DynamoDB, ElastiCache, Amazon EC2, Amazon Elastic Compute Cloud, Amazon Glacier, Kindle, Kindle Fire, AWS Marketplace Design, Mechanical Turk, Amazon Redshift, Amazon Route 53, Amazon S3, Amazon VPC. In addition, Amazon.com graphics, logos, page headers, button icons, scripts, and service names are trademarks, or trade dress of Amazon in the U.S. and/or other countries. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon.

All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon.

(3)

Table of Contents

Welcome ... 1 Actions ... 2 AddTags ... 3 Description ... 3 Request Parameters ... 3 Errors ... 3 Examples ... 4 ApplySecurityGroupsToLoadBalancer ... 5 Description ... 5 Request Parameters ... 5 Response Elements ... 5 Errors ... 5 Examples ... 6 AttachLoadBalancerToSubnets ... 7 Description ... 7 Request Parameters ... 7 Response Elements ... 7 Errors ... 7 Examples ... 8 ConfigureHealthCheck ... 9 Description ... 9 Request Parameters ... 9 Response Elements ... 9 Errors ... 9 Examples ... 9 CreateAppCookieStickinessPolicy ... 11 Description ... 11 Request Parameters ... 11 Errors ... 11 Examples ... 12 CreateLBCookieStickinessPolicy ... 13 Description ... 13 Request Parameters ... 13 Errors ... 13 Examples ... 14 CreateLoadBalancer ... 15 Description ... 15 Request Parameters ... 15 Response Elements ... 16 Errors ... 17 Examples ... 18 CreateLoadBalancerListeners ... 22 Description ... 22 Request Parameters ... 22 Errors ... 22 Examples ... 23 CreateLoadBalancerPolicy ... 24 Description ... 24 Request Parameters ... 24 Errors ... 24 Examples ... 25 DeleteLoadBalancer ... 26 Description ... 26 Request Parameters ... 26 DeleteLoadBalancerListeners ... 27

(4)

Description ... 27 Request Parameters ... 27 Errors ... 27 DeleteLoadBalancerPolicy ... 28 Description ... 28 Request Parameters ... 28 Errors ... 28 DeregisterInstancesFromLoadBalancer ... 29 Description ... 29 Request Parameters ... 29 Response Elements ... 29 Errors ... 29 Examples ... 30 DescribeInstanceHealth ... 31 Description ... 31 Request Parameters ... 31 Response Elements ... 31 Errors ... 31 Examples ... 32 DescribeLoadBalancerAttributes ... 35 Description ... 35 Request Parameters ... 35 Response Elements ... 35 Errors ... 35 Examples ... 35 DescribeLoadBalancerPolicies ... 37 Description ... 37 Request Parameters ... 37 Response Elements ... 37 Errors ... 37 Examples ... 38 DescribeLoadBalancerPolicyTypes ... 40 Description ... 40 Request Parameters ... 40 Response Elements ... 40 Errors ... 40 Examples ... 40 DescribeLoadBalancers ... 43 Description ... 43 Request Parameters ... 43 Response Elements ... 43 Errors ... 43 Examples ... 44 DescribeTags ... 46 Description ... 46 Request Parameters ... 46 Response Elements ... 46 Errors ... 46 Examples ... 46 DetachLoadBalancerFromSubnets ... 48 Description ... 48 Request Parameters ... 48 Response Elements ... 48 Errors ... 48 Examples ... 49 DisableAvailabilityZonesForLoadBalancer ... 50 Description ... 50 Request Parameters ... 50

(5)

Response Elements ... 50 Errors ... 50 Examples ... 51 EnableAvailabilityZonesForLoadBalancer ... 52 Description ... 52 Request Parameters ... 52 Response Elements ... 52 Errors ... 52 Examples ... 53 ModifyLoadBalancerAttributes ... 54 Description ... 54 Request Parameters ... 54 Response Elements ... 54 Errors ... 54 Examples ... 55 RegisterInstancesWithLoadBalancer ... 58 Description ... 58 Request Parameters ... 58 Response Elements ... 58 Errors ... 59 Examples ... 59 RemoveTags ... 60 Description ... 60 Request Parameters ... 60 Errors ... 60 Examples ... 60 SetLoadBalancerListenerSSLCertificate ... 62 Description ... 62 Request Parameters ... 62 Errors ... 62 Examples ... 63 SetLoadBalancerPoliciesForBackendServer ... 64 Description ... 64 Request Parameters ... 64 Errors ... 64 Examples ... 65 SetLoadBalancerPoliciesOfListener ... 66 Description ... 66 Request Parameters ... 66 Errors ... 66 Examples ... 67 Data Types ... 68 AccessLog ... 69 Description ... 69 Contents ... 69 AddTagsResult ... 70 Description ... 70 Contents ... 70 AppCookieStickinessPolicy ... 70 Description ... 70 Contents ... 70 ApplySecurityGroupsToLoadBalancerResult ... 71 Description ... 71 Contents ... 71 AttachLoadBalancerToSubnetsResult ... 71 Description ... 71 Contents ... 71

(6)

Description ... 71 Contents ... 71 ConfigureHealthCheckResult ... 72 Description ... 72 Contents ... 72 ConnectionDraining ... 72 Description ... 72 Contents ... 72 ConnectionSettings ... 72 Description ... 72 Contents ... 73 CreateAppCookieStickinessPolicyResult ... 73 Description ... 73 Contents ... 73 CreateLBCookieStickinessPolicyResult ... 73 Description ... 73 Contents ... 73 CreateLoadBalancerListenersResult ... 73 Description ... 73 Contents ... 73 CreateLoadBalancerPolicyResult ... 73 Description ... 73 Contents ... 74 CreateLoadBalancerResult ... 74 Description ... 74 Contents ... 74 CrossZoneLoadBalancing ... 74 Description ... 74 Contents ... 74 DeleteLoadBalancerListenersResult ... 74 Description ... 74 Contents ... 75 DeleteLoadBalancerPolicyResult ... 75 Description ... 75 Contents ... 75 DeleteLoadBalancerResult ... 75 Description ... 75 Contents ... 75 DeregisterInstancesFromLoadBalancerResult ... 75 Description ... 75 Contents ... 75 DescribeInstanceHealthResult ... 75 Description ... 75 Contents ... 75 DescribeLoadBalancerAttributesResult ... 76 Description ... 76 Contents ... 76 DescribeLoadBalancerPoliciesResult ... 76 Description ... 76 Contents ... 76 DescribeLoadBalancerPolicyTypesResult ... 76 Description ... 76 Contents ... 76 DescribeLoadBalancersResult ... 77 Description ... 77 Contents ... 77 DescribeTagsResult ... 77 Description ... 77

(7)

Contents ... 77 DetachLoadBalancerFromSubnetsResult ... 77 Description ... 77 Contents ... 77 DisableAvailabilityZonesForLoadBalancerResult ... 78 Description ... 78 Contents ... 78 EnableAvailabilityZonesForLoadBalancerResult ... 78 Description ... 78 Contents ... 78 HealthCheck ... 78 Description ... 78 Contents ... 78 Instance ... 79 Description ... 79 Contents ... 80 InstanceState ... 80 Description ... 80 Contents ... 80 LBCookieStickinessPolicy ... 80 Description ... 80 Contents ... 81 Listener ... 81 Description ... 81 Contents ... 81 ListenerDescription ... 82 Description ... 82 Contents ... 82 LoadBalancerAttributes ... 82 Description ... 82 Contents ... 82 LoadBalancerDescription ... 83 Description ... 83 Contents ... 83 ModifyLoadBalancerAttributesResult ... 85 Description ... 85 Contents ... 85 Policies ... 86 Description ... 86 Contents ... 86 PolicyAttribute ... 86 Description ... 86 Contents ... 86 PolicyAttributeDescription ... 87 Description ... 87 Contents ... 87 PolicyAttributeTypeDescription ... 87 Description ... 87 Contents ... 87 PolicyDescription ... 88 Description ... 88 Contents ... 88 PolicyTypeDescription ... 89 Description ... 89 Contents ... 89 RegisterInstancesWithLoadBalancerResult ... 89 Description ... 89

(8)

RemoveTagsResult ... 89 Description ... 89 Contents ... 90 SetLoadBalancerListenerSSLCertificateResult ... 90 Description ... 90 Contents ... 90 SetLoadBalancerPoliciesForBackendServerResult ... 90 Description ... 90 Contents ... 90 SetLoadBalancerPoliciesOfListenerResult ... 90 Description ... 90 Contents ... 90 SourceSecurityGroup ... 90 Description ... 90 Contents ... 90 Tag ... 91 Description ... 91 Contents ... 91 TagDescription ... 91 Description ... 91 Contents ... 91 TagKeyOnly ... 92 Description ... 92 Contents ... 92 Common Parameters ... 93 ... 93

Common Parameters for Signature V4 Signing ... 95

... 95

Common Errors ... 97

... 97

(9)

Welcome

Elastic Load Balancing is a way to automatically distribute incoming web traffic across applications that run on multiple Amazon Elastic Compute Cloud (Amazon EC2) instances.

You can create, access, and manage Elastic Load Balancing using the AWS Management Console, the AWS Command Line Interface (AWS CLI), the Query API, or the AWS SDKs. For more information about Elastic Load Balancing interfaces, see Accessing Elastic Load Balancing.

This reference guide contains documentation for the Query API and the AWS CLI commands, to manage Elastic Load Balancing.

For detailed information about Elastic Load Balancing features and their associated actions or commands, go to Managing Load Balancers in the Elastic Load Balancing Developer Guide.

This reference guide is based on the current WSDL, which is available at: http://ec2-downloads.s3.amazon-aws.com/ElasticLoadBalancing.wsdl.

Endpoints

The examples in this guide assume that your load balancers are created in the US East (Northern Virginia) region and use us-east-1 as the endpoint.

You can create your load balancers in other AWS regions. For information about regions and endpoints supported by Elastic Load Balancing, see Regions and Endpoints in the Amazon Web Services General Reference.

(10)

Actions

The following actions are supported: • AddTags (p. 3) • ApplySecurityGroupsToLoadBalancer (p. 5) • AttachLoadBalancerToSubnets (p. 7) • ConfigureHealthCheck (p. 9) • CreateAppCookieStickinessPolicy (p. 11) • CreateLBCookieStickinessPolicy (p. 13) • CreateLoadBalancer (p. 15) • CreateLoadBalancerListeners (p. 22) • CreateLoadBalancerPolicy (p. 24) • DeleteLoadBalancer (p. 26) • DeleteLoadBalancerListeners (p. 27) • DeleteLoadBalancerPolicy (p. 28) • DeregisterInstancesFromLoadBalancer (p. 29) • DescribeInstanceHealth (p. 31) • DescribeLoadBalancerAttributes (p. 35) • DescribeLoadBalancerPolicies (p. 37) • DescribeLoadBalancerPolicyTypes (p. 40) • DescribeLoadBalancers (p. 43) • DescribeTags (p. 46) • DetachLoadBalancerFromSubnets (p. 48) • DisableAvailabilityZonesForLoadBalancer (p. 50) • EnableAvailabilityZonesForLoadBalancer (p. 52) • ModifyLoadBalancerAttributes (p. 54) • RegisterInstancesWithLoadBalancer (p. 58) • RemoveTags (p. 60) • SetLoadBalancerListenerSSLCertificate (p. 62) • SetLoadBalancerPoliciesForBackendServer (p. 64) • SetLoadBalancerPoliciesOfListener (p. 66)

(11)

AddTags

Description

Adds one or more tags for the specified load balancer. Each load balancer can have a maximum of 10 tags. Each tag consists of a key and an optional value.

Tag keys must be unique for each load balancer. If a tag with the same key is already associated with the load balancer, this action will update the value of the key.

For more information, see Tagging in the Elastic Load Balancing Developer Guide.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerNames.member.N

The name of the load balancer to tag. You can specify a maximum of one load balancer name. Type: String list

Required: Yes

Tags.member.N

A list of tags for each load balancer. Type:Tag (p. 91) list

Length constraints: Minimum of 1 item(s) in the list. Required: Yes

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

DuplicateTagKeys

The same tag key specified multiple times. HTTP Status Code: 400

TooManyTags

The quota for the number of tags that can be assigned to a load balancer has been reached. HTTP Status Code: 400

(12)

Examples

Sample Request

https://elasticloadbalancing.amazonaws.com/?LoadBalancerNames.member.1=my-test-loadbalancer &Action=AddTags &Tags.member.1.Key=project &Tags.member.1.Value=lima &Version=2012-06-01 &AUTHPARAMS

Sample Response

<AddTagsResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/"> <AddTagsResult/> <ResponseMetadata> <RequestId>360e81f7-1100-11e4-b6ed-0f30EXAMPLE</RequestId> </ResponseMetadata> </AddTagsResponse>

Elastic Load Balancing API Reference Examples

(13)

ApplySecurityGroupsToLoadBalancer

Description

Associates one or more security groups with your load balancer in Amazon Virtual Private Cloud (Amazon VPC). The provided security group IDs will override any currently applied security groups.

For more information, see Manage Security Groups in Amazon VPC in the Elastic Load Balancing

De-veloper Guide.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerName

The name associated with the load balancer. The name must be unique within the set of load balancers associated with your AWS account.

Type: String Required: Yes

SecurityGroups.member.N

A list of security group IDs to associate with your load balancer in VPC. The security group IDs must be provided as the ID and not the security group name (For example, sg-1234).

Type: String list Required: Yes

Response Elements

The following element is returned in a structure named ApplySecurityGroupsToLoadBalancerResult.

SecurityGroups

A list of security group IDs associated with your load balancer. Type: String list

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

InvalidConfigurationRequest

Requested configuration change is invalid. HTTP Status Code: 409

InvalidSecurityGroup

(14)

HTTP Status Code: 400

Examples

Sample Request

https://elasticloadbalancing.amazonaws.com/?SecurityGroups.member.1=sg-123456789 &LoadBalancerName=my-test-vpc-loadbalancer &Version=2012-06-01 &Action=ApplySecurityGroupsToLoadBalancer &AUTHPARAMS

Sample Response

<ApplySecurityGroupsToLoadBalancerResponse xmlns="http://elasticloadbalan cing.amazonaws.com/doc/2012-06-01/"> <ApplySecurityGroupsToLoadBalancerResult> <SecurityGroups> <member>sg-123456789</member> </SecurityGroups> </ApplySecurityGroupsToLoadBalancerResult> <ResponseMetadata> <RequestId>06b5decc-102a-11e3-9ad6-bf3e4EXAMPLE</RequestId> </ResponseMetadata> </ApplySecurityGroupsToLoadBalancerResponse>

Elastic Load Balancing API Reference Examples

(15)

AttachLoadBalancerToSubnets

Description

Adds one or more subnets to the set of configured subnets in the Amazon Virtual Private Cloud (Amazon VPC) for the load balancer.

The load balancers evenly distribute requests across all of the registered subnets. For more information, see Deploy Elastic Load Balancing in Amazon VPC in the Elastic Load Balancing Developer Guide.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerName

The name associated with the load balancer. The name must be unique within the set of load balancers associated with your AWS account.

Type: String Required: Yes

Subnets.member.N

A list of subnet IDs to add for the load balancer. You can add only one subnet per Availability Zone. Type: String list

Required: Yes

Response Elements

The following element is returned in a structure named AttachLoadBalancerToSubnetsResult.

Subnets

A list of subnet IDs attached to the load balancer. Type: String list

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

InvalidConfigurationRequest

Requested configuration change is invalid. HTTP Status Code: 409

InvalidSubnet

The VPC has no Internet gateway. HTTP Status Code: 400

(16)

SubnetNotFound

One or more subnets were not found. HTTP Status Code: 400

Examples

Sample Request

https://elasticloadbalancing.amazonaws.com/?Subnets.member.1=subnet-3561b05e &LoadBalancerName=my-test-vpc-loadbalancer &Version=2012-06-01 &Action=AttachLoadBalancerToSubnets &AUTHPARAMS

Sample Response

<AttachLoadBalancerToSubnetsResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <AttachLoadBalancerToSubnetsResult> <Subnets> <member>subnet-119f0078</member> <member>subnet-3561b05e</member> </Subnets> </AttachLoadBalancerToSubnetsResult> <ResponseMetadata> <RequestId>07b1ecbc-1100-11e3-acaf-dd7edEXAMPLE</RequestId> </ResponseMetadata> </AttachLoadBalancerToSubnetsResponse>

Elastic Load Balancing API Reference Examples

(17)

ConfigureHealthCheck

Description

Specifies the health check settings to use for evaluating the health state of your back-end instances. For more information, see Health Check in the Elastic Load Balancing Developer Guide.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

HealthCheck

A structure containing the configuration information for the new healthcheck. Type:HealthCheck (p. 78)

Required: Yes

LoadBalancerName

The mnemonic name associated with the load balancer. The name must be unique within the set of load balancers associated with your AWS account.

Type: String Required: Yes

Response Elements

The following element is returned in a structure named ConfigureHealthCheckResult.

HealthCheck

The updated healthcheck for the instances. Type:HealthCheck (p. 78)

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

Examples

Sample Request

https://elasticloadbalancing.amazonaws.com/?HealthCheck.HealthyThreshold=2 &HealthCheck.UnhealthyThreshold=2

(18)

&LoadBalancerName=MyLoadBalancer &HealthCheck.Target=HTTP:80/ping &HealthCheck.Interval=30 &HealthCheck.Timeout=3 &Version=2012-06-01 &Action=ConfigureHealthCheck &AUTHPARAMS

Sample Response

<ConfigureHealthCheckResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <ConfigureHealthCheckResult> <HealthCheck> <Interval>30</Interval> <Target>HTTP:80/ping</Target> <HealthyThreshold>2</HealthyThreshold> <Timeout>3</Timeout> <UnhealthyThreshold>2</UnhealthyThreshold> </HealthCheck> </ConfigureHealthCheckResult> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </ConfigureHealthCheckResponse>

Elastic Load Balancing API Reference Examples

(19)

CreateAppCookieStickinessPolicy

Description

Generates a stickiness policy with sticky session lifetimes that follow that of an application-generated cookie. This policy can be associated only with HTTP/HTTPS listeners.

This policy is similar to the policy created by CreateLBCookieStickinessPolicy (p. 13), except that the lifetime of the special Elastic Load Balancing cookie follows the lifetime of the application-generated cookie specified in the policy configuration. The load balancer only inserts a new stickiness cookie when the application response includes a new application cookie.

If the application cookie is explicitly removed or expires, the session stops being sticky until a new applic-ation cookie is issued.

Note

An application client must receive and send two cookies: the application-generated cookie and the special Elastic Load Balancing cookie named AWSELB. This is the default behavior for many common web browsers.

For more information, see Enabling Application-Controlled Session Stickiness in the Elastic Load Balancing

Developer Guide.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

CookieName

Name of the application cookie used for stickiness. Type: String

Required: Yes

LoadBalancerName

The name of the load balancer. Type: String

Required: Yes

PolicyName

The name of the policy being created. The name must be unique within the set of policies for this load balancer.

Type: String Required: Yes

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

(20)

DuplicatePolicyName

Policy with the same name exists for this load balancer. Please choose another name. HTTP Status Code: 400

InvalidConfigurationRequest

Requested configuration change is invalid. HTTP Status Code: 409

TooManyPolicies

Quota for number of policies for this load balancer has already been reached. HTTP Status Code: 400

Examples

Sample Request

https://elasticloadbalancing.amazonaws.com/?CookieName=MyAppCookie &LoadBalancerName=MyLoadBalancer &PolicyName=MyAppStickyPolicy &Version=2012-06-01 &Action=CreateAppCookieStickinessPolicy &AUTHPARAMS

Sample Response

<CreateAppCookieStickinessPolicyResponse xmlns="http://elasticloadbalan cing.amazonaws.com/doc/2012-06-01/"> <CreateAppCookieStickinessPolicyResult/> <ResponseMetadata> <RequestId>99a693e9-12b8-11e3-9ad6-bf3e4EXAMPLE</RequestId> </ResponseMetadata> </CreateAppCookieStickinessPolicyResponse>

Elastic Load Balancing API Reference Examples

(21)

CreateLBCookieStickinessPolicy

Description

Generates a stickiness policy with sticky session lifetimes controlled by the lifetime of the browser (user-agent) or a specified expiration period. This policy can be associated only with HTTP/HTTPS listeners. When a load balancer implements this policy, the load balancer uses a special cookie to track the backend server instance for each request. When the load balancer receives a request, it first checks to see if this cookie is present in the request. If so, the load balancer sends the request to the application server specified in the cookie. If not, the load balancer sends the request to a server that is chosen based on the existing load balancing algorithm.

A cookie is inserted into the response for binding subsequent requests from the same user to that server. The validity of the cookie is based on the cookie expiration time, which is specified in the policy configur-ation.

For more information, see Enabling Duration-Based Session Stickiness in the Elastic Load Balancing

Developer Guide.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

CookieExpirationPeriod

The time period in seconds after which the cookie should be considered stale. Not specifying this parameter indicates that the sticky session will last for the duration of the browser session. Type: Long

Required: No

LoadBalancerName

The name associated with the load balancer. Type: String

Required: Yes

PolicyName

The name of the policy being created. The name must be unique within the set of policies for this load balancer.

Type: String Required: Yes

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

(22)

HTTP Status Code: 400

InvalidConfigurationRequest

Requested configuration change is invalid. HTTP Status Code: 409

TooManyPolicies

Quota for number of policies for this load balancer has already been reached. HTTP Status Code: 400

Examples

Sample Request

https://elasticloadbalancing.amazonaws.com/?CookieExpirationPeriod=60 &LoadBalancerName=MyLoadBalancer&PolicyName=MyDurationStickyPolicy &Version=2012-06-01 &Action=CreateLBCookieStickinessPolicy &AUTHPARAMS

Sample Response

<CreateLBCookieStickinessPolicyResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <CreateLBCookieStickinessPolicyResult/> <ResponseMetadata> <RequestId>99a693e9-12b8-11e3-9ad6-bf3e4EXAMPLE</RequestId> </ResponseMetadata> </CreateLBCookieStickinessPolicyResponse>

Elastic Load Balancing API Reference Examples

(23)

CreateLoadBalancer

Description

Creates a new load balancer.

After the call has completed successfully, a new load balancer is created with a unique Domain Name Service (DNS) name. The DNS name includes the name of the AWS region in which the load balance was created. For example, if your load balancer was created in the United States, the DNS name might end with either of the following:

• us-east-1.elb.amazonaws.com (for the Northern Virginia region) • us-west-1.elb.amazonaws.com (for the Northern California region)

For information about the AWS regions supported by Elastic Load Balancing, see Regions and Endpoints. You can create up to 20 load balancers per region per account.

Elastic Load Balancing supports load balancing your Amazon EC2 instances launched within any one of the following platforms:

• EC2-Classic

For information on creating and managing your load balancers in EC2-Classic, see Deploy Elastic Load Balancing in Amazon EC2-Classic.

• EC2-VPC

For information on creating and managing your load balancers in EC2-VPC, see Deploy Elastic Load Balancing in Amazon VPC.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

AvailabilityZones.member.N

A list of Availability Zones.

At least one Availability Zone must be specified. Specified Availability Zones must be in the same EC2 Region as the load balancer. Traffic will be equally distributed across all zones.

You can later add more Availability Zones after the creation of the load balancer by calling EnableAvail-abilityZonesForLoadBalancer (p. 52) action.

Type: String list Required: No

Listeners.member.N

A list of the following tuples: Protocol, LoadBalancerPort, InstanceProtocol, InstancePort, and SSLCertificateId.

Type:Listener (p. 81) list Required: Yes

(24)

LoadBalancerName

The name associated with the load balancer. The name must be unique within your set of load bal-ancers, must have a maximum of 32 characters, and must only contain alphanumeric characters or hyphens.

Type: String Required: Yes

Scheme

The type of a load balancer.

By default, Elastic Load Balancing creates an Internet-facing load balancer with a publicly resolvable DNS name, which resolves to public IP addresses. For more information about Internet-facing and Internal load balancers, see Internet-facing and Internal Load Balancers.

Specify the value internal for this option to create an internal load balancer with a DNS name that resolves to private IP addresses.

Note

This option is only available for load balancers created within EC2-VPC. Type: String

Required: No

SecurityGroups.member.N

The security groups to assign to your load balancer within your VPC. Type: String list

Required: No

Subnets.member.N

A list of subnet IDs in your VPC to attach to your load balancer. Specify one subnet per Availability Zone.

Type: String list Required: No

Tags.member.N

A list of tags to assign to the load balancer.

For more information about setting tags for your load balancer, see Tagging. Type:Tag (p. 91) list

Length constraints: Minimum of 1 item(s) in the list. Required: No

Response Elements

The following element is returned in a structure named CreateLoadBalancerResult.

DNSName

The DNS name for the load balancer. Type: String

Elastic Load Balancing API Reference Response Elements

(25)

Errors

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

CertificateNotFound

The specified SSL ID does not refer to a valid SSL certificate in the AWS Identity and Access Man-agement Service.

HTTP Status Code: 400

DuplicateAccessPointName

The load balancer name already exists for this account. Please choose another name. HTTP Status Code: 400

DuplicateTagKeys

The same tag key specified multiple times. HTTP Status Code: 400

InvalidConfigurationRequest

Requested configuration change is invalid. HTTP Status Code: 409

InvalidScheme

Invalid value for scheme. Scheme can only be specified for load balancers in VPC. HTTP Status Code: 400

InvalidSecurityGroup

One or more specified security groups do not exist. HTTP Status Code: 400

InvalidSubnet

The VPC has no Internet gateway. HTTP Status Code: 400

SubnetNotFound

One or more subnets were not found. HTTP Status Code: 400

TooManyAccessPoints

The quota for the number of load balancers has already been reached. HTTP Status Code: 400

TooManyTags

The quota for the number of tags that can be assigned to a load balancer has been reached. HTTP Status Code: 400

(26)

Examples

Create a TCP Load Balancer in EC2-Classic

Sample Request

https://elasticloadbalancing.amazonaws.com/?LoadBalancerName=my-test-loadbalancer &AvailabilityZones.member.1=us-east-1c &Listeners.member.1.LoadBalancerPort=80 &Listeners.member.1.InstancePort=80 &Listeners.member.1.Protocol=http &Listeners.member.1.InstanceProtocol=http &Version=2012-06-01 &Action=CreateLoadBalancer &AUTHPARAMS

Sample Response

<CreateLoadBalancerResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <CreateLoadBalancerResult> <DNSName>my-test-loadbalancer-1234567890.us-east-1.elb.amazonaws.com</DNS Name> </CreateLoadBalancerResult> <ResponseMetadata> <RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata> </CreateLoadBalancerResponse>

Create an HTTPS Load Balancer in EC2-Classic

Sample Request

https://elasticloadbalancing.amazonaws.com/?LoadBalancerName=MyHTTPSLoadBalancer &AvailabilityZones.member.1=us-east-1c &Listeners.member.1.LoadBalancerPort=443 &Listeners.member.1.InstancePort=443 &Listeners.member.1.Protocol=https &Listeners.member.1.InstanceProtocol=https &Listeners.member.1.SSLCertificateId=arn:aws:iam::123456789012:server-certific ate/servercert &Version=2012-06-01 &Action=CreateLoadBalancer &AUTHPARAMS

Sample Response

<CreateLoadBalancerResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <CreateLoadBalancerResult> <DNSName>MyHTTPSLoadBalancer-1234567890.us-east-1.elb.amazonaws.com</DNSName>

Elastic Load Balancing API Reference Examples

(27)

</CreateLoadBalancerResult> <ResponseMetadata>

<RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata>

</CreateLoadBalancerResponse>

Create a TCP Load Balancer in EC2-VPC

Sample Request

https://elasticloadbalancing.amazonaws.com/?SecurityGroups.member.1=sg-6801da07 &LoadBalancerName=MyVPCLoadBalancer &Listeners.member.1.LoadBalancerPort=80 &Listeners.member.1.InstancePort=80 &Listeners.member.1.Protocol=http &Listeners.member.1.InstanceProtocol=http &Subnets.member.1=subnet-6dec9f03 &Version=2012-06-01 &Action=CreateLoadBalancer &AUTHPARAMS

Sample Response

<CreateLoadBalancerResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <CreateLoadBalancerResult> <DNSName>MyVPCLoadBalancer-1234567890.us-east-1.elb.amazonaws.com</DNSName> </CreateLoadBalancerResult> <ResponseMetadata> <RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata> </CreateLoadBalancerResponse>

Create an Internal TCP Load Balancer in EC2-VPC

Sample Request

https://elasticloadbalancing.amazonaws.com/?Scheme=internal &SecurityGroups.member.1=sg-706cb61f &LoadBalancerName=MyInternalLoadBalancer &Listeners.member.1.LoadBalancerPort=80 &Listeners.member.1.InstancePort=80 &Listeners.member.1.Protocol=http &Listeners.member.1.InstanceProtocol=http &Subnets.member.1=subnet-9edc97f0 &Version=2012-06-01 &Action=CreateLoadBalancer &AUTHPARAMS

(28)

Sample Response

<CreateLoadBalancerResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <CreateLoadBalancerResult> <DNSName>internal-MyInternalLoadBalancer-1234567890.us-east-1.elb.amazon aws.com</DNSName> </CreateLoadBalancerResult> <ResponseMetadata> <RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata> </CreateLoadBalancerResponse>

Create a TCP Load Balancer in a Default VPC

Sample Request

https://elasticloadbalancing.amazonaws.com/?LoadBalancerName=MyDefaultVPCLoad Balancer &AvailabilityZones.member.1=sa-east-1b &Listeners.member.1.LoadBalancerPort=80 &Listeners.member.1.InstancePort=80 &Listeners.member.1.Protocol=http &Listeners.member.1.InstanceProtocol=http &Version=2012-06-01 &Action=CreateLoadBalancer &AUTHPARAMS

Sample Response

<CreateLoadBalancerResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <CreateLoadBalancerResult> <DNSName>MyDefaultVPCLoadBalancer-1234567890.sa.east-1.elb.amazonaws.com</DNS Name> </CreateLoadBalancerResult> <ResponseMetadata> <RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata> </CreateLoadBalancerResponse>

Create a TCP Load Balancer in EC2-Classic and Assign a

Tag

Sample Request

https://elasticloadbalancing.amazonaws.com/?LoadBalancerName=my-test-loadbalancer &AvailabilityZones.member.1=us-east-1c; &Listeners.member.1.LoadBalancerPort=80 &Listeners.member.1.InstancePort=80

Elastic Load Balancing API Reference Examples

(29)

&Listeners.member.1.Protocol=http &Listeners.member.1.InstanceProtocol=http &Tags.member.1.Value=digital-media &Tags.member.1.Key=department &Version=2012-06-01 &Action=CreateLoadBalancer &AUTHPARAMS

Sample Response

<CreateLoadBalancerResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <CreateLoadBalancerResult> <DNSName>my-test-loadbalancer-1234567890.us-east-1.elb.amazonaws.com</DNS Name> </CreateLoadBalancerResult> <ResponseMetadata> <RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata> </CreateLoadBalancerResponse>

(30)

CreateLoadBalancerListeners

Description

Creates one or more listeners on a load balancer for the specified port. If a listener with the given port does not already exist, it will be created; otherwise, the properties of the new listener must match the properties of the existing listener.

For more information, see Add a Listener to Your Load Balancer in the Elastic Load Balancing Developer

Guide.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

Listeners.member.N

A list of LoadBalancerPort, InstancePort, Protocol, InstanceProtocol, and SSLCerti-ficateId items.

Type:Listener (p. 81) list Required: Yes

LoadBalancerName

The name of the load balancer. Type: String

Required: Yes

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

CertificateNotFound

The specified SSL ID does not refer to a valid SSL certificate in the AWS Identity and Access Man-agement Service.

HTTP Status Code: 400

DuplicateListener

A Listener already exists for the given LoadBalancerName and LoadBalancerPort, but with a different InstancePort, Protocol, or SSLCertificateId.

HTTP Status Code: 400

InvalidConfigurationRequest

Requested configuration change is invalid. HTTP Status Code: 409

Elastic Load Balancing API Reference CreateLoadBalancerListeners

(31)

Examples

Sample Request

https://elasticloadbalancing.amazonaws.com/?Listeners.member.1.Protocol=https &Listeners.member.1.LoadBalancerPort=443 &Listeners.member.1.InstancePort=443 &Listeners.member.1.InstanceProtocol=https &Listeners.member.1.SSLCertificateId=arn:aws:iam::123456789012:server-certific ate/servercert &LoadBalancerName=MyHTTPSLoadBalancer &Version=2012-06-01 &Action=CreateLoadBalancerListeners &AUTHPARAMS

Sample Response

<CreateLoadBalancerListenersResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <CreateLoadBalancerListenersResult/> <ResponseMetadata> <RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata> </CreateLoadBalancerListenersResponse>

(32)

CreateLoadBalancerPolicy

Description

Creates a new policy that contains the necessary attributes depending on the policy type. Policies are settings that are saved for your load balancer and that can be applied to the front-end listener, or the back-end application server, depending on your policy type.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerName

The name associated with the LoadBalancer for which the policy is being created. Type: String

Required: Yes

PolicyAttributes.member.N

A list of attributes associated with the policy being created. Type:PolicyAttribute (p. 86) list

Required: No

PolicyName

The name of the load balancer policy being created. The name must be unique within the set of policies for this load balancer.

Type: String Required: Yes

PolicyTypeName

The name of the base policy type being used to create this policy. To get the list of policy types, use the DescribeLoadBalancerPolicyTypes (p. 40) action.

Type: String Required: Yes

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

DuplicatePolicyName

Policy with the same name exists for this load balancer. Please choose another name. HTTP Status Code: 400

InvalidConfigurationRequest

Requested configuration change is invalid.

Elastic Load Balancing API Reference CreateLoadBalancerPolicy

(33)

HTTP Status Code: 409

PolicyTypeNotFound

One or more of the specified policy types do not exist. HTTP Status Code: 400

TooManyPolicies

Quota for number of policies for this load balancer has already been reached. HTTP Status Code: 400

Examples

Sample Request

https://elasticloadbalancing.amazonaws.com/?PolicyAttributes.member.1.Attribute Name=ProxyProtocol &PolicyAttributes.member.1.AttributeValue=true &PolicyTypeName=ProxyProtocolPolicyType &LoadBalancerName=my-test-loadbalancer &PolicyName=EnableProxyProtocol &Version=2012-06-01 &Action=CreateLoadBalancerPolicy &AUTHPARAMS

Sample Response

<CreateLoadBalancerPolicyResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <CreateLoadBalancerPolicyResult/> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </CreateLoadBalancerPolicyResponse>

(34)

DeleteLoadBalancer

Description

Deletes the specified load balancer.

If attempting to recreate the load balancer, you must reconfigure all the settings. The DNS name associated with a deleted load balancer will no longer be usable. Once deleted, the name and associated DNS record of the load balancer no longer exist and traffic sent to any of its IP addresses will no longer be delivered to back-end instances.

To successfully call this API, you must provide the same account credentials as were used to create the load balancer.

Note

By design, if the load balancer does not exist or has already been deleted, a call to DeleteLoad-Balancer action still succeeds.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerName

The name associated with the load balancer. Type: String

Required: Yes

Elastic Load Balancing API Reference DeleteLoadBalancer

(35)

DeleteLoadBalancerListeners

Description

Deletes listeners from the load balancer for the specified port.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerName

The mnemonic name associated with the load balancer. Type: String

Required: Yes

LoadBalancerPorts.member.N

The client port number(s) of the load balancer listener(s) to be removed. Type: Integer list

Required: Yes

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

(36)

DeleteLoadBalancerPolicy

Description

Deletes a policy from the load balancer. The specified policy must not be enabled for any listeners.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerName

The mnemonic name associated with the load balancer. Type: String

Required: Yes

PolicyName

The mnemonic name for the policy being deleted. Type: String

Required: Yes

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

InvalidConfigurationRequest

Requested configuration change is invalid. HTTP Status Code: 409

Elastic Load Balancing API Reference DeleteLoadBalancerPolicy

(37)

DeregisterInstancesFromLoadBalancer

Description

Deregisters instances from the load balancer. Once the instance is deregistered, it will stop receiving traffic from the load balancer.

In order to successfully call this API, the same account credentials as those used to create the load bal-ancer must be provided.

For more information, see De-register and Register Amazon EC2 Instances in the Elastic Load Balancing

Developer Guide.

You can use DescribeLoadBalancers (p. 43) to verify if the instance is deregistered from the load balancer.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

Instances.member.N

A list of EC2 instance IDs consisting of all instances to be deregistered. Type:Instance (p. 79) list

Required: Yes

LoadBalancerName

The name associated with the load balancer. Type: String

Required: Yes

Response Elements

The following element is returned in a structure named DeregisterInstancesFromLoadBalancer-Result.

Instances

An updated list of remaining instances registered with the load balancer. Type:Instance (p. 79) list

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

InvalidEndPoint

(38)

Examples

Deregister instance i-e3677ad7 from MyHTTPSLoadBalancer

load balancer.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Instances.member.1.InstanceId=i-e3677ad7 &LoadBalancerName=MyHTTPSLoadBalancer &Version=2012-06-01 &Action=DeregisterInstancesFromLoadBalancer &AUTHPARAMS

Sample Response

<DeregisterInstancesFromLoadBalancerResponse xmlns="http://elasticloadbalan cing.amazonaws.com/doc/2012-06-01/"> <DeregisterInstancesFromLoadBalancerResult> <Instances> <member> <InstanceId>i-6ec63d59</InstanceId> </member> </Instances> </DeregisterInstancesFromLoadBalancerResult> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </DeregisterInstancesFromLoadBalancerResponse>

Elastic Load Balancing API Reference Examples

(39)

DescribeInstanceHealth

Description

Returns the current state of the specified instances registered with the specified load balancer. If no in-stances are specified, the state of all the inin-stances registered with the load balancer is returned.

Note

You must provide the same account credentials as those that were used to create the load bal-ancer.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

Instances.member.N

A list of instance IDs whose states are being queried. Type:Instance (p. 79) list

Required: No

LoadBalancerName

The name of the load balancer. Type: String

Required: Yes

Response Elements

The following element is returned in a structure named DescribeInstanceHealthResult.

InstanceStates

A list containing health information for the specified instances. Type:InstanceState (p. 80) list

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

InvalidEndPoint

The specified EndPoint is not valid. HTTP Status Code: 400

(40)

Examples

Description of a healthy (InService) instance

Sample Request

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

Sample Response

<DescribeInstanceHealthResponse xmlns="http://elasticloadbalancing.amazon aws.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>

Description of an instance with registration in progress

Sample Request

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

Sample Response

<DescribeInstanceHealthResponse xmlns="http://elasticloadbalancing.amazon aws.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>

Elastic Load Balancing API Reference Examples

(41)

</member> </InstanceStates> </DescribeInstanceHealthResult> <ResponseMetadata> <RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata> </DescribeInstanceHealthResponse>

Description of an unhealthy (OutOfService) instance

Sample Request

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

Sample Response

<DescribeInstanceHealthResponse xmlns="http://elasticloadbalancing.amazon aws.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>

Description of an instance in an unknown state

Sample Request

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

Sample Response

<DescribeInstanceHealthResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/">

(42)

<DescribeInstanceHealthResult> <InstanceStates>

<member>

<Description>A transient error occurred. Please try again later.</De scription> <InstanceId>i-7f12e649</InstanceId> <State>Unknown</State> <ReasonCode>ELB</ReasonCode> </member> </InstanceStates> </DescribeInstanceHealthResult> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </DescribeInstanceHealthResponse>

Elastic Load Balancing API Reference Examples

(43)

DescribeLoadBalancerAttributes

Description

Returns detailed information about all of the attributes associated with the specified load balancer.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerName

The name of the load balancer. Type: String

Required: Yes

Response Elements

The following element is returned in a structure named DescribeLoadBalancerAttributesResult.

LoadBalancerAttributes

The load balancer attributes structure. Type:LoadBalancerAttributes (p. 82)

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

LoadBalancerAttributeNotFound

The specified load balancer attribute could not be found. HTTP Status Code: 400

Examples

Sample Request

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

(44)

Sample Response

<DescribeLoadBalancerAttributesResponse xmlns="http://elasticloadbalan cing.amazonaws.com/doc/2012-06-01/"> <DescribeLoadBalancerAttributesResult> <LoadBalancerAttributes> <AccessLog> <Enabled>true</Enabled> <S3BucketName>my-loadbalancer-logs</S3BucketName> <S3BucketPrefix>testprefix</S3BucketPrefix> <EmitInterval>5</EmitInterval> </AccessLog> <ConnectionSettings> <IdleTimeout>30</IdleTimeout> </ConnectionSettings> <CrossZoneLoadBalancing> <Enabled>true</Enabled> </CrossZoneLoadBalancing> <ConnectionDraining> <Enabled>true</Enabled> <Timeout>60</Timeout> </ConnectionDraining> </LoadBalancerAttributes> </DescribeLoadBalancerAttributesResult> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </DescribeLoadBalancerAttributesResponse>

Elastic Load Balancing API Reference Examples

(45)

DescribeLoadBalancerPolicies

Description

Returns detailed descriptions of the policies. If you specify a load balancer name, the action returns the descriptions of all the policies created for the load balancer. If you specify a policy name associated with your load balancer, the action returns the description of that policy. If you don't specify a load balancer name, the action returns descriptions of the specified sample policies, or descriptions of all the sample policies. The names of the sample policies have the ELBSample- prefix.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerName

The mnemonic name associated with the load balancer. If no name is specified, the operation returns the attributes of either all the sample policies pre-defined by Elastic Load Balancing or the specified sample polices.

Type: String Required: No

PolicyNames.member.N

The names of load balancer policies you've created or Elastic Load Balancing sample policy names. Type: String list

Required: No

Response Elements

The following element is returned in a structure named DescribeLoadBalancerPoliciesResult.

PolicyDescriptions

A list of policy description structures. Type:PolicyDescription (p. 88) list

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

PolicyNotFound

One or more specified policies were not found. HTTP Status Code: 400

(46)

Examples

Description of all the policies associated with a load balancer

Sample Request

https://elasticloadbalancing.amazonaws.com/?LoadBalancerName=MyLoadBalancer &Version=2012-06-01 &Action=DescribeLoadBalancerPolicies &AUTHPARAMS

Sample Response

<DescribeLoadBalancerPoliciesResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <DescribeLoadBalancerPoliciesResult> <PolicyDescriptions> <member> <PolicyName>MyDurationStickyPolicy</PolicyName> <PolicyTypeName>LBCookieStickinessPolicyType</PolicyTypeName> <PolicyAttributeDescriptions> <member> <AttributeName>CookieExpirationPeriod</AttributeName> <AttributeValue>60</AttributeValue> </member> </PolicyAttributeDescriptions> </member> <member> <PolicyName>MyAppStickyPolicy</PolicyName> <PolicyTypeName>AppCookieStickinessPolicyType</PolicyTypeName> <PolicyAttributeDescriptions> <member> <AttributeName>CookieName</AttributeName> <AttributeValue>MyAppCookie</AttributeValue> </member> </PolicyAttributeDescriptions> </member> </PolicyDescriptions> </DescribeLoadBalancerPoliciesResult> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </DescribeLoadBalancerPoliciesResponse>

Description of a specified policy associated with the load

balancer

Sample Request

https://elasticloadbalancing.amazonaws.com/?PolicyNames.member.1=EnableProxyPro tocol

Elastic Load Balancing API Reference Examples

(47)

&LoadBalancerName=my-test-loadbalancer &Version=2012-06-01 &Action=DescribeLoadBalancerPolicies &AUTHPARAMS

Sample Response

<DescribeLoadBalancerPoliciesResponse xmlns="http://elasticloadbalancing.amazon aws.com/doc/2012-06-01/"> <DescribeLoadBalancerPoliciesResult> <PolicyDescriptions> <member> <PolicyName>EnableProxyProtocol</PolicyName> <PolicyTypeName>ProxyProtocolPolicyType</PolicyTypeName> <PolicyAttributeDescriptions> <member> <AttributeName>ProxyProtocol</AttributeName> <AttributeValue>true</AttributeValue> </member> </PolicyAttributeDescriptions> </member> </PolicyDescriptions> </DescribeLoadBalancerPoliciesResult> <ResponseMetadata> <RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata> </DescribeLoadBalancerPoliciesResponse>

(48)

DescribeLoadBalancerPolicyTypes

Description

Returns meta-information on the specified load balancer policies defined by the Elastic Load Balancing service. The policy types that are returned from this action can be used in a CreateLoadBalancer-Policy (p. 24) action to instantiate specific policy configurations that will be applied to a load balancer.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

PolicyTypeNames.member.N

Specifies the name of the policy types. If no names are specified, returns the description of all the policy types defined by Elastic Load Balancing service.

Type: String list Required: No

Response Elements

The following element is returned in a structure named DescribeLoadBalancerPolicyTypesResult.

PolicyTypeDescriptions

List of policy type description structures of the specified policy type. If no policy type names are specified, returns the description of all the policy types defined by Elastic Load Balancing service. Type:PolicyTypeDescription (p. 89) list

Errors

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

PolicyTypeNotFound

One or more of the specified policy types do not exist. HTTP Status Code: 400

Examples

Partial description of all the policy types defined by Elastic

Load Balancing for your account

Sample Request

https://elasticloadbalancing.amazonaws.com/?Version=2012-06-01 &Action=DescribeLoadBalancerPolicyTypes

&AUTHPARAMS

Elastic Load Balancing API Reference DescribeLoadBalancerPolicyTypes

(49)

Sample Response

<DescribeLoadBalancerPolicyTypesResponse xmlns="http://elasticloadbalan cing.amazonaws.com/doc/2012-06-01/"> <DescribeLoadBalancerPolicyTypesResult> <PolicyTypeName>SSLNegotiationPolicyType</PolicyTypeName> < . . . .> <PolicyTypeName>BackendServerAuthenticationPolicyType</PolicyTypeName> < . . . .> <PolicyTypeName>PublicKeyPolicyType</PolicyTypeName> < . . . .> <PolicyTypeName>AppCookieStickinessPolicyType</PolicyTypeName> < . . . .> <PolicyTypeName>LBCookieStickinessPolicyType</PolicyTypeName> < . . . .> <PolicyTypeName>ProxyProtocolPolicyType</PolicyTypeName> < . . . .> </DescribeLoadBalancerPolicyTypesResult> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </ DescribeLoadBalancerPolicyTypesResponse >

Description of ProxyProtocolPolicyType

Sample Request

https://elasticloadbalancing.amazonaws.com/?PolicyTypeNames.member.1=ProxyPro tocolPolicyType &Version=2012-06-01 &Action=DescribeLoadBalancerPolicyTypes &AUTHPARAMS

Sample Response

<DescribeLoadBalancerPolicyTypesResponse xmlns="http://elasticloadbalan cing.amazonaws.com/doc/2012-06-01/"> <DescribeLoadBalancerPolicyTypesResult> <PolicyTypeDescriptions> <member> <PolicyAttributeTypeDescriptions> <member> <AttributeName>ProxyProtocol</AttributeName> <AttributeType>Boolean</AttributeType> <Cardinality>ONE</Cardinality> </member> </PolicyAttributeTypeDescriptions> <PolicyTypeName>ProxyProtocolPolicyType</PolicyTypeName>

<Description>Policy that controls whether to include the IP address and port of the originating request for TCP messages.

This policy operates on TCP/SSL listeners only</Description> </member>

</PolicyTypeDescriptions>

(50)

<ResponseMetadata>

<RequestId>1549581b-12b7-11e3-895e-1334aEXAMPLE</RequestId> </ResponseMetadata>

</DescribeLoadBalancerPolicyTypesResponse>

Elastic Load Balancing API Reference Examples

(51)

DescribeLoadBalancers

Description

Returns detailed configuration information for all the load balancers created for the account. If you specify load balancer names, the action returns configuration information of the specified load balancers.

Note

In order to retrieve this information, you must provide the same account credentials that was used to create the load balancer.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerNames.member.N

A list of load balancer names associated with the account. Type: String list

Required: No

Marker

An optional parameter used for pagination of results from this call. If specified, the response includes only records beyond the marker.

Type: String Required: No

PageSize

The number of results returned in each page. The default is 400. You cannot specify a page size greater than 400 or less than 1.

Type: Integer Required: No

Response Elements

The following elements are returned in a structure named DescribeLoadBalancersResult.

LoadBalancerDescriptions

A list of load balancer description structures. Type:LoadBalancerDescription (p. 83) list

NextMarker

Specifies the value of next marker if the request returned more than one page of results. Type: String

Errors

(52)

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

Examples

Description of a specified load balancer

Sample Request

https://elasticloadbalancing.amazonaws.com/?LoadBalancerNames.member.1=MyLoad Balancer &Version=2012-06-01 &Action=DescribeLoadBalancers &AUTHPARAMS

Sample Response

<DescribeLoadBalancersResult> <LoadBalancerDescriptions> <member> <SecurityGroups/> <LoadBalancerName>MyLoadBalancer</LoadBalancerName> <CreatedTime>2013-05-24T21:15:31.280Z</CreatedTime> <HealthCheck> <Interval>90</Interval> <Target>HTTP:80/</Target> <HealthyThreshold>2</HealthyThreshold> <Timeout>60</Timeout> <UnhealthyThreshold>10</UnhealthyThreshold> </HealthCheck> <ListenerDescriptions> <member> <PolicyNames/> <Listener> <Protocol>HTTP</Protocol> <LoadBalancerPort>80</LoadBalancerPort> <InstanceProtocol>HTTP</InstanceProtocol> <InstancePort>80</InstancePort> </Listener> </member> </ListenerDescriptions> <Instances> <member> <InstanceId>i-e4cbe38d</InstanceId> </member> </Instances> <Policies> <AppCookieStickinessPolicies/> <OtherPolicies/> <LBCookieStickinessPolicies/> </Policies> <AvailabilityZones>

Elastic Load Balancing API Reference Examples

(53)

<member>us-east-1a</member> </AvailabilityZones> <CanonicalHostedZoneNameID>ZZZZZZZZZZZ123X</CanonicalHostedZoneNameID> <CanonicalHostedZoneName>MyLoadBalancer-123456789.us-east-1.elb.amazonaws.com</CanonicalHostedZoneName> <Scheme>internet-facing</Scheme> <SourceSecurityGroup> <OwnerAlias>amazon-elb</OwnerAlias> <GroupName>amazon-elb-sg</GroupName> </SourceSecurityGroup> <DNSName>MyLoadBalancer-123456789.us-east-1.elb.amazonaws.com</DNSName> <BackendServerDescriptions/> <Subnets/> </member> </LoadBalancerDescriptions> </DescribeLoadBalancersResult> <ResponseMetadata> <RequestId>83c88b9d-12b7-11e3-8b82-87b12EXAMPLE</RequestId> </ResponseMetadata> </ DescribeLoadBalancerPolicyTypesResponse >

(54)

DescribeTags

Description

Describes the tags associated with one or more load balancers.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters (p. 93).

LoadBalancerNames.member.N

The names of the load balancers. Type: String list

Length constraints: Minimum of 1 item(s) in the list. Maximum of 20 item(s) in the list. Required: Yes

Response Elements

The following element is returned in a structure named DescribeTagsResult.

TagDescriptions

A list of tag description structures. Type:TagDescription (p. 91) list

Errors

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

AccessPointNotFound

The specified load balancer could not be found. HTTP Status Code: 400

Examples

Sample Request

https://elasticloadbalancing.amazonaws.com//?Action=DescribeTags &LoadBalancerNames.member.1=my-test-loadbalancer &Version=2012-06-01 &AUTHPARAMS

Elastic Load Balancing API Reference DescribeTags

(55)

Sample Response

<DescribeTagsResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/"> <DescribeTagsResult> <TagDescriptions> <member> <Tags> <Value>lima</Value> <Key>project</Key> </member> <member> <Value>digital-media</Value> <Key>department</Key> </member> </Tags> <LoadBalancerName>my-test-loadbalancer</LoadBalancerName> </member> </TagDescriptions> <ResponseMetadata> <RequestId>07b1ecbc-1100-11e3-acaf-dd7edEXAMPLE</RequestId> </ResponseMetadata> </DescribeTagsResponse>

References

Related documents

How long will the effects of klonopin last Does klonopin help with norco withdrawal Ativan strength compared to klonopin. Long term use of klonopin for bipolar disorder Is klonopin

[r]

As most of the satellite campus students are enrolled in the Faculty of Management, in June 2009 library administration charged the Management Liaison Librarian with the task

In the present study, 2,2-diphenyl-1-picrylhydrazyl radical scavenging, a-amylase and a- glucosidase inhibition activities, and total phenolic contents of n-hexane, ethyl acetate,

A Typical Microservice Architecture on AWS S3 CloudFront EC2 Elastic Load Balancing Static Content Content Delivery API Layer Application Layer Persistency Layer API Gateway

The results show that fatal road accidents have a negative long-run effect on economic growth while on the other hand labour productivity, unemployment, real

For the very first time in Belgium, this exhibition gives an overview of the multifaceted oeuvre of the Dutch artist Theo van Doesburg, key figure of the artistic movement De

If you have answered yes to any of a–c above, please give the notices to your solicitor or estate agent, including any notices which arrive at any time before the date of entry of