SDK for PHP 3.x

Client: Aws\ElasticLoadBalancing\ElasticLoadBalancingClient
Service ID: elasticloadbalancing
Version: 2012-06-01

This page describes the parameters and results for the operations of the Elastic Load Balancing (2012-06-01), and shows how to use the Aws\ElasticLoadBalancing\ElasticLoadBalancingClient object to call the described operations. This documentation is specific to the 2012-06-01 API version of the service.

Operation Summary

Each of the following operations can be created from a client using $client->getCommand('CommandName'), where "CommandName" is the name of one of the following operations. Note: a command is a value that encapsulates an operation and the parameters used to create an HTTP request.

You can also create and send a command immediately using the magic methods available on a client object: $client->commandName(/* parameters */). You can send the command asynchronously (returning a promise) by appending the word "Async" to the operation name: $client->commandNameAsync(/* parameters */).

AddTags ( array $params = [] )
Adds the specified tags to the specified load balancer.
ApplySecurityGroupsToLoadBalancer ( array $params = [] )
Associates one or more security groups with your load balancer in a virtual private cloud (VPC).
AttachLoadBalancerToSubnets ( array $params = [] )
Adds one or more subnets to the set of configured subnets for the specified load balancer.
ConfigureHealthCheck ( array $params = [] )
Specifies the health check settings to use when evaluating the health state of your EC2 instances.
CreateAppCookieStickinessPolicy ( array $params = [] )
Generates a stickiness policy with sticky session lifetimes that follow that of an application-generated cookie.
CreateLBCookieStickinessPolicy ( array $params = [] )
Generates a stickiness policy with sticky session lifetimes controlled by the lifetime of the browser (user-agent) or a specified expiration period.
CreateLoadBalancer ( array $params = [] )
Creates a Classic Load Balancer.
CreateLoadBalancerListeners ( array $params = [] )
Creates one or more listeners for the specified load balancer.
CreateLoadBalancerPolicy ( array $params = [] )
Creates a policy with the specified attributes for the specified load balancer.
DeleteLoadBalancer ( array $params = [] )
Deletes the specified load balancer.
DeleteLoadBalancerListeners ( array $params = [] )
Deletes the specified listeners from the specified load balancer.
DeleteLoadBalancerPolicy ( array $params = [] )
Deletes the specified policy from the specified load balancer.
DeregisterInstancesFromLoadBalancer ( array $params = [] )
Deregisters the specified instances from the specified load balancer.
DescribeAccountLimits ( array $params = [] )
Describes the current Elastic Load Balancing resource limits for your AWS account.
DescribeInstanceHealth ( array $params = [] )
Describes the state of the specified instances with respect to the specified load balancer.
DescribeLoadBalancerAttributes ( array $params = [] )
Describes the attributes for the specified load balancer.
DescribeLoadBalancerPolicies ( array $params = [] )
Describes the specified policies.
DescribeLoadBalancerPolicyTypes ( array $params = [] )
Describes the specified load balancer policy types or all load balancer policy types.
DescribeLoadBalancers ( array $params = [] )
Describes the specified the load balancers.
DescribeTags ( array $params = [] )
Describes the tags associated with the specified load balancers.
DetachLoadBalancerFromSubnets ( array $params = [] )
Removes the specified subnets from the set of configured subnets for the load balancer.
DisableAvailabilityZonesForLoadBalancer ( array $params = [] )
Removes the specified Availability Zones from the set of Availability Zones for the specified load balancer in EC2-Classic or a default VPC.
EnableAvailabilityZonesForLoadBalancer ( array $params = [] )
Adds the specified Availability Zones to the set of Availability Zones for the specified load balancer in EC2-Classic or a default VPC.
ModifyLoadBalancerAttributes ( array $params = [] )
Modifies the attributes of the specified load balancer.
RegisterInstancesWithLoadBalancer ( array $params = [] )
Adds the specified instances to the specified load balancer.
RemoveTags ( array $params = [] )
Removes one or more tags from the specified load balancer.
SetLoadBalancerListenerSSLCertificate ( array $params = [] )
Sets the certificate that terminates the specified listener's SSL connections.
SetLoadBalancerPoliciesForBackendServer ( array $params = [] )
Replaces the set of policies associated with the specified port on which the EC2 instance is listening with a new set of policies.
SetLoadBalancerPoliciesOfListener ( array $params = [] )
Replaces the current set of policies for the specified load balancer port with the specified set of policies.

Paginators

Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:

DescribeInstanceHealth
DescribeLoadBalancerPolicies
DescribeLoadBalancerPolicyTypes
DescribeLoadBalancers

Waiters

Waiters allow you to poll a resource until it enters into a desired state. A waiter has a name used to describe what it does, and is associated with an API operation. When creating a waiter, you can provide the API operation parameters associated with the corresponding operation. Waiters can be accessed using the getWaiter($waiterName, $operationParameters) method of a client object. This client supports the following waiters:

Waiter name API Operation Delay Max Attempts
InstanceDeregistered DescribeInstanceHealth 15 40
AnyInstanceInService DescribeInstanceHealth 15 40
InstanceInService DescribeInstanceHealth 15 40

Operations

AddTags

$result = $client->addTags([/* ... */]);
$promise = $client->addTagsAsync([/* ... */]);

Adds the specified tags to the specified load balancer. Each load balancer can have a maximum of 10 tags.

Each tag consists of a key and an optional value. If a tag with the same key is already associated with the load balancer, AddTags updates its value.

For more information, see Tag Your Classic Load Balancer in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->addTags([
    'LoadBalancerNames' => ['<string>', ...], // REQUIRED
    'Tags' => [ // REQUIRED
        [
            'Key' => '<string>', // REQUIRED
            'Value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
LoadBalancerNames
Required: Yes
Type: Array of strings

The name of the load balancer. You can specify one load balancer only.

Tags
Required: Yes
Type: Array of Tag structures

The tags.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

TooManyTagsException:

The quota for the number of tags that can be assigned to a load balancer has been reached.

DuplicateTagKeysException:

A tag key was specified more than once.

Examples

Example 1: To add tags to a load balancer

This example adds two tags to the specified load balancer.

$result = $client->addTags([
    'LoadBalancerNames' => [
        'my-load-balancer',
    ],
    'Tags' => [
        [
            'Key' => 'project',
            'Value' => 'lima',
        ],
        [
            'Key' => 'department',
            'Value' => 'digital-media',
        ],
    ],
]);

ApplySecurityGroupsToLoadBalancer

$result = $client->applySecurityGroupsToLoadBalancer([/* ... */]);
$promise = $client->applySecurityGroupsToLoadBalancerAsync([/* ... */]);

Associates one or more security groups with your load balancer in a virtual private cloud (VPC). The specified security groups override the previously associated security groups.

For more information, see Security Groups for Load Balancers in a VPC in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->applySecurityGroupsToLoadBalancer([
    'LoadBalancerName' => '<string>', // REQUIRED
    'SecurityGroups' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

SecurityGroups
Required: Yes
Type: Array of strings

The IDs of the security groups to associate with the load balancer. Note that you cannot specify the name of the security group.

Result Syntax

[
    'SecurityGroups' => ['<string>', ...],
]

Result Details

Members
SecurityGroups
Type: Array of strings

The IDs of the security groups associated with the load balancer.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

InvalidSecurityGroupException:

One or more of the specified security groups do not exist.

Examples

Example 1: To associate a security group with a load balancer in a VPC

This example associates a security group with the specified load balancer in a VPC.

$result = $client->applySecurityGroupsToLoadBalancer([
    'LoadBalancerName' => 'my-load-balancer',
    'SecurityGroups' => [
        'sg-fc448899',
    ],
]);

Result syntax:

[
    'SecurityGroups' => [
        'sg-fc448899',
    ],
]

AttachLoadBalancerToSubnets

$result = $client->attachLoadBalancerToSubnets([/* ... */]);
$promise = $client->attachLoadBalancerToSubnetsAsync([/* ... */]);

Adds one or more subnets to the set of configured subnets for the specified load balancer.

The load balancer evenly distributes requests across all registered subnets. For more information, see Add or Remove Subnets for Your Load Balancer in a VPC in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->attachLoadBalancerToSubnets([
    'LoadBalancerName' => '<string>', // REQUIRED
    'Subnets' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Subnets
Required: Yes
Type: Array of strings

The IDs of the subnets to add. You can add only one subnet per Availability Zone.

Result Syntax

[
    'Subnets' => ['<string>', ...],
]

Result Details

Members
Subnets
Type: Array of strings

The IDs of the subnets attached to the load balancer.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

SubnetNotFoundException:

One or more of the specified subnets do not exist.

InvalidSubnetException:

The specified VPC has no associated Internet gateway.

Examples

Example 1: To attach subnets to a load balancer

This example adds the specified subnet to the set of configured subnets for the specified load balancer.

$result = $client->attachLoadBalancerToSubnets([
    'LoadBalancerName' => 'my-load-balancer',
    'Subnets' => [
        'subnet-0ecac448',
    ],
]);

Result syntax:

[
    'Subnets' => [
        'subnet-15aaab61',
        'subnet-0ecac448',
    ],
]

ConfigureHealthCheck

$result = $client->configureHealthCheck([/* ... */]);
$promise = $client->configureHealthCheckAsync([/* ... */]);

Specifies the health check settings to use when evaluating the health state of your EC2 instances.

For more information, see Configure Health Checks for Your Load Balancer in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->configureHealthCheck([
    'HealthCheck' => [ // REQUIRED
        'HealthyThreshold' => <integer>, // REQUIRED
        'Interval' => <integer>, // REQUIRED
        'Target' => '<string>', // REQUIRED
        'Timeout' => <integer>, // REQUIRED
        'UnhealthyThreshold' => <integer>, // REQUIRED
    ],
    'LoadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
HealthCheck
Required: Yes
Type: HealthCheck structure

The configuration information.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[
    'HealthCheck' => [
        'HealthyThreshold' => <integer>,
        'Interval' => <integer>,
        'Target' => '<string>',
        'Timeout' => <integer>,
        'UnhealthyThreshold' => <integer>,
    ],
]

Result Details

Members
HealthCheck
Type: HealthCheck structure

The updated health check.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

Examples

Example 1: To specify the health check settings for your backend EC2 instances

This example specifies the health check settings used to evaluate the health of your backend EC2 instances.

$result = $client->configureHealthCheck([
    'HealthCheck' => [
        'HealthyThreshold' => 2,
        'Interval' => 30,
        'Target' => 'HTTP:80/png',
        'Timeout' => 3,
        'UnhealthyThreshold' => 2,
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'HealthCheck' => [
        'HealthyThreshold' => 2,
        'Interval' => 30,
        'Target' => 'HTTP:80/png',
        'Timeout' => 3,
        'UnhealthyThreshold' => 2,
    ],
]

CreateAppCookieStickinessPolicy

$result = $client->createAppCookieStickinessPolicy([/* ... */]);
$promise = $client->createAppCookieStickinessPolicyAsync([/* ... */]);

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, except that the lifetime of the special Elastic Load Balancing cookie, AWSELB, 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 application cookie is issued.

For more information, see Application-Controlled Session Stickiness in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->createAppCookieStickinessPolicy([
    'CookieName' => '<string>', // REQUIRED
    'LoadBalancerName' => '<string>', // REQUIRED
    'PolicyName' => '<string>', // REQUIRED
]);

Parameter Details

Members
CookieName
Required: Yes
Type: string

The name of the application cookie used for stickiness.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

PolicyName
Required: Yes
Type: string

The name of the policy being created. Policy names must consist of alphanumeric characters and dashes (-). This name must be unique within the set of policies for this load balancer.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

DuplicatePolicyNameException:

A policy with the specified name already exists for this load balancer.

TooManyPoliciesException:

The quota for the number of policies for this load balancer has been reached.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

Examples

Example 1: To generate a stickiness policy for your load balancer

This example generates a stickiness policy that follows the sticky session lifetimes of the application-generated cookie.

$result = $client->createAppCookieStickinessPolicy([
    'CookieName' => 'my-app-cookie',
    'LoadBalancerName' => 'my-load-balancer',
    'PolicyName' => 'my-app-cookie-policy',
]);

CreateLBCookieStickinessPolicy

$result = $client->createLBCookieStickinessPolicy([/* ... */]);
$promise = $client->createLBCookieStickinessPolicyAsync([/* ... */]);

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 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 configuration.

For more information, see Duration-Based Session Stickiness in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->createLBCookieStickinessPolicy([
    'CookieExpirationPeriod' => <integer>,
    'LoadBalancerName' => '<string>', // REQUIRED
    'PolicyName' => '<string>', // REQUIRED
]);

Parameter Details

Members
CookieExpirationPeriod
Type: long (int|float)

The time period, in seconds, after which the cookie should be considered stale. If you do not specify this parameter, the default value is 0, which indicates that the sticky session should last for the duration of the browser session.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

PolicyName
Required: Yes
Type: string

The name of the policy being created. Policy names must consist of alphanumeric characters and dashes (-). This name must be unique within the set of policies for this load balancer.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

DuplicatePolicyNameException:

A policy with the specified name already exists for this load balancer.

TooManyPoliciesException:

The quota for the number of policies for this load balancer has been reached.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

Examples

Example 1: To generate a duration-based stickiness policy for your load balancer

This example generates a stickiness policy with sticky session lifetimes controlled by the specified expiration period.

$result = $client->createLBCookieStickinessPolicy([
    'CookieExpirationPeriod' => 60,
    'LoadBalancerName' => 'my-load-balancer',
    'PolicyName' => 'my-duration-cookie-policy',
]);

CreateLoadBalancer

$result = $client->createLoadBalancer([/* ... */]);
$promise = $client->createLoadBalancerAsync([/* ... */]);

Creates a Classic Load Balancer.

You can add listeners, security groups, subnets, and tags when you create your load balancer, or you can add them later using CreateLoadBalancerListeners, ApplySecurityGroupsToLoadBalancer, AttachLoadBalancerToSubnets, and AddTags.

To describe your current load balancers, see DescribeLoadBalancers. When you are finished with a load balancer, you can delete it using DeleteLoadBalancer.

You can create up to 20 load balancers per region per account. You can request an increase for the number of load balancers for your account. For more information, see Limits for Your Classic Load Balancer in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->createLoadBalancer([
    'AvailabilityZones' => ['<string>', ...],
    'Listeners' => [ // REQUIRED
        [
            'InstancePort' => <integer>, // REQUIRED
            'InstanceProtocol' => '<string>',
            'LoadBalancerPort' => <integer>, // REQUIRED
            'Protocol' => '<string>', // REQUIRED
            'SSLCertificateId' => '<string>',
        ],
        // ...
    ],
    'LoadBalancerName' => '<string>', // REQUIRED
    'Scheme' => '<string>',
    'SecurityGroups' => ['<string>', ...],
    'Subnets' => ['<string>', ...],
    'Tags' => [
        [
            'Key' => '<string>', // REQUIRED
            'Value' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
AvailabilityZones
Type: Array of strings

One or more Availability Zones from the same region as the load balancer.

You must specify at least one Availability Zone.

You can add more Availability Zones after you create the load balancer using EnableAvailabilityZonesForLoadBalancer.

Listeners
Required: Yes
Type: Array of Listener structures

The listeners.

For more information, see Listeners for Your Classic Load Balancer in the Classic Load Balancers Guide.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

This name must be unique within your set of load balancers for the region, must have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and cannot begin or end with a hyphen.

Scheme
Type: string

The type of a load balancer. Valid only for load balancers in a VPC.

By default, Elastic Load Balancing creates an Internet-facing load balancer with a DNS name that resolves to public IP addresses. For more information about Internet-facing and Internal load balancers, see Load Balancer Scheme in the Elastic Load Balancing User Guide.

Specify internal to create a load balancer with a DNS name that resolves to private IP addresses.

SecurityGroups
Type: Array of strings

The IDs of the security groups to assign to the load balancer.

Subnets
Type: Array of strings

The IDs of the subnets in your VPC to attach to the load balancer. Specify one subnet per Availability Zone specified in AvailabilityZones.

Tags
Type: Array of Tag structures

A list of tags to assign to the load balancer.

For more information about tagging your load balancer, see Tag Your Classic Load Balancer in the Classic Load Balancers Guide.

Result Syntax

[
    'DNSName' => '<string>',
]

Result Details

Members
DNSName
Type: string

The DNS name of the load balancer.

Errors

DuplicateAccessPointNameException:

The specified load balancer name already exists for this account.

TooManyAccessPointsException:

The quota for the number of load balancers has been reached.

CertificateNotFoundException:

The specified ARN does not refer to a valid SSL certificate in AWS Identity and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if you recently uploaded the certificate to IAM, this error might indicate that the certificate is not fully available yet.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

SubnetNotFoundException:

One or more of the specified subnets do not exist.

InvalidSubnetException:

The specified VPC has no associated Internet gateway.

InvalidSecurityGroupException:

One or more of the specified security groups do not exist.

InvalidSchemeException:

The specified value for the schema is not valid. You can only specify a scheme for load balancers in a VPC.

TooManyTagsException:

The quota for the number of tags that can be assigned to a load balancer has been reached.

DuplicateTagKeysException:

A tag key was specified more than once.

UnsupportedProtocolException:

The specified protocol or signature version is not supported.

OperationNotPermittedException:

This operation is not allowed.

Examples

Example 1: To create an HTTP load balancer in a VPC

This example creates a load balancer with an HTTP listener in a VPC.

$result = $client->createLoadBalancer([
    'Listeners' => [
        [
            'InstancePort' => 80,
            'InstanceProtocol' => 'HTTP',
            'LoadBalancerPort' => 80,
            'Protocol' => 'HTTP',
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
    'SecurityGroups' => [
        'sg-a61988c3',
    ],
    'Subnets' => [
        'subnet-15aaab61',
    ],
]);

Result syntax:

[
    'DNSName' => 'my-load-balancer-1234567890.us-west-2.elb.amazonaws.com',
]
Example 2: To create an HTTP load balancer in EC2-Classic

This example creates a load balancer with an HTTP listener in EC2-Classic.

$result = $client->createLoadBalancer([
    'AvailabilityZones' => [
        'us-west-2a',
    ],
    'Listeners' => [
        [
            'InstancePort' => 80,
            'InstanceProtocol' => 'HTTP',
            'LoadBalancerPort' => 80,
            'Protocol' => 'HTTP',
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'DNSName' => 'my-load-balancer-123456789.us-west-2.elb.amazonaws.com',
]
Example 3: To create an HTTPS load balancer in a VPC

This example creates a load balancer with an HTTPS listener in a VPC.

$result = $client->createLoadBalancer([
    'Listeners' => [
        [
            'InstancePort' => 80,
            'InstanceProtocol' => 'HTTP',
            'LoadBalancerPort' => 80,
            'Protocol' => 'HTTP',
        ],
        [
            'InstancePort' => 80,
            'InstanceProtocol' => 'HTTP',
            'LoadBalancerPort' => 443,
            'Protocol' => 'HTTPS',
            'SSLCertificateId' => 'arn:aws:iam::123456789012:server-certificate/my-server-cert',
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
    'SecurityGroups' => [
        'sg-a61988c3',
    ],
    'Subnets' => [
        'subnet-15aaab61',
    ],
]);

Result syntax:

[
    'DNSName' => 'my-load-balancer-1234567890.us-west-2.elb.amazonaws.com',
]
Example 4: To create an HTTPS load balancer in EC2-Classic

This example creates a load balancer with an HTTPS listener in EC2-Classic.

$result = $client->createLoadBalancer([
    'AvailabilityZones' => [
        'us-west-2a',
    ],
    'Listeners' => [
        [
            'InstancePort' => 80,
            'InstanceProtocol' => 'HTTP',
            'LoadBalancerPort' => 80,
            'Protocol' => 'HTTP',
        ],
        [
            'InstancePort' => 80,
            'InstanceProtocol' => 'HTTP',
            'LoadBalancerPort' => 443,
            'Protocol' => 'HTTPS',
            'SSLCertificateId' => 'arn:aws:iam::123456789012:server-certificate/my-server-cert',
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'DNSName' => 'my-load-balancer-123456789.us-west-2.elb.amazonaws.com',
]
Example 5: To create an internal load balancer

This example creates an internal load balancer with an HTTP listener in a VPC.

$result = $client->createLoadBalancer([
    'Listeners' => [
        [
            'InstancePort' => 80,
            'InstanceProtocol' => 'HTTP',
            'LoadBalancerPort' => 80,
            'Protocol' => 'HTTP',
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
    'Scheme' => 'internal',
    'SecurityGroups' => [
        'sg-a61988c3',
    ],
    'Subnets' => [
        'subnet-15aaab61',
    ],
]);

Result syntax:

[
    'DNSName' => 'internal-my-load-balancer-123456789.us-west-2.elb.amazonaws.com',
]

CreateLoadBalancerListeners

$result = $client->createLoadBalancerListeners([/* ... */]);
$promise = $client->createLoadBalancerListenersAsync([/* ... */]);

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

For more information, see Listeners for Your Classic Load Balancer in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->createLoadBalancerListeners([
    'Listeners' => [ // REQUIRED
        [
            'InstancePort' => <integer>, // REQUIRED
            'InstanceProtocol' => '<string>',
            'LoadBalancerPort' => <integer>, // REQUIRED
            'Protocol' => '<string>', // REQUIRED
            'SSLCertificateId' => '<string>',
        ],
        // ...
    ],
    'LoadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
Listeners
Required: Yes
Type: Array of Listener structures

The listeners.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

DuplicateListenerException:

A listener already exists for the specified load balancer name and port, but with a different instance port, protocol, or SSL certificate.

CertificateNotFoundException:

The specified ARN does not refer to a valid SSL certificate in AWS Identity and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if you recently uploaded the certificate to IAM, this error might indicate that the certificate is not fully available yet.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

UnsupportedProtocolException:

The specified protocol or signature version is not supported.

Examples

Example 1: To create an HTTP listener for a load balancer

This example creates a listener for your load balancer at port 80 using the HTTP protocol.

$result = $client->createLoadBalancerListeners([
    'Listeners' => [
        [
            'InstancePort' => 80,
            'InstanceProtocol' => 'HTTP',
            'LoadBalancerPort' => 80,
            'Protocol' => 'HTTP',
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);
Example 2: To create an HTTPS listener for a load balancer

This example creates a listener for your load balancer at port 443 using the HTTPS protocol.

$result = $client->createLoadBalancerListeners([
    'Listeners' => [
        [
            'InstancePort' => 80,
            'InstanceProtocol' => 'HTTP',
            'LoadBalancerPort' => 443,
            'Protocol' => 'HTTPS',
            'SSLCertificateId' => 'arn:aws:iam::123456789012:server-certificate/my-server-cert',
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);

CreateLoadBalancerPolicy

$result = $client->createLoadBalancerPolicy([/* ... */]);
$promise = $client->createLoadBalancerPolicyAsync([/* ... */]);

Creates a policy with the specified attributes for the specified load balancer.

Policies are settings that are saved for your load balancer and that can be applied to the listener or the application server, depending on the policy type.

Parameter Syntax

$result = $client->createLoadBalancerPolicy([
    'LoadBalancerName' => '<string>', // REQUIRED
    'PolicyAttributes' => [
        [
            'AttributeName' => '<string>',
            'AttributeValue' => '<string>',
        ],
        // ...
    ],
    'PolicyName' => '<string>', // REQUIRED
    'PolicyTypeName' => '<string>', // REQUIRED
]);

Parameter Details

Members
LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

PolicyAttributes
Type: Array of PolicyAttribute structures

The policy attributes.

PolicyName
Required: Yes
Type: string

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

PolicyTypeName
Required: Yes
Type: string

The name of the base policy type. To get the list of policy types, use DescribeLoadBalancerPolicyTypes.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

PolicyTypeNotFoundException:

One or more of the specified policy types do not exist.

DuplicatePolicyNameException:

A policy with the specified name already exists for this load balancer.

TooManyPoliciesException:

The quota for the number of policies for this load balancer has been reached.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

Examples

Example 1: To create a policy that enables Proxy Protocol on a load balancer

This example creates a policy that enables Proxy Protocol on the specified load balancer.

$result = $client->createLoadBalancerPolicy([
    'LoadBalancerName' => 'my-load-balancer',
    'PolicyAttributes' => [
        [
            'AttributeName' => 'ProxyProtocol',
            'AttributeValue' => 'true',
        ],
    ],
    'PolicyName' => 'my-ProxyProtocol-policy',
    'PolicyTypeName' => 'ProxyProtocolPolicyType',
]);
Example 2: To create a public key policy

This example creates a public key policy.

$result = $client->createLoadBalancerPolicy([
    'LoadBalancerName' => 'my-load-balancer',
    'PolicyAttributes' => [
        [
            'AttributeName' => 'PublicKey',
            'AttributeValue' => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwAYUjnfyEyXr1pxjhFWBpMlggUcqoi3kl+dS74kj//c6x7ROtusUaeQCTgIUkayttRDWchuqo1pHC1u+n5xxXnBBe2ejbb2WRsKIQ5rXEeixsjFpFsojpSQKkzhVGI6mJVZBJDVKSHmswnwLBdofLhzvllpovBPTHe+o4haAWvDBALJU0pkSI1FecPHcs2hwxf14zHoXy1e2k36A64nXW43wtfx5qcVSIxtCEOjnYRg7RPvybaGfQ+v6Iaxb/+7J5kEvZhTFQId+bSiJImF1FSUT1W1xwzBZPUbcUkkXDj45vC2s3Z8E+Lk7a3uZhvsQHLZnrfuWjBWGWvZ/MhZYgEXAMPLE',
        ],
    ],
    'PolicyName' => 'my-PublicKey-policy',
    'PolicyTypeName' => 'PublicKeyPolicyType',
]);
Example 3: To create a backend server authentication policy

This example creates a backend server authentication policy that enables authentication on your backend instance using a public key policy.

$result = $client->createLoadBalancerPolicy([
    'LoadBalancerName' => 'my-load-balancer',
    'PolicyAttributes' => [
        [
            'AttributeName' => 'PublicKeyPolicyName',
            'AttributeValue' => 'my-PublicKey-policy',
        ],
    ],
    'PolicyName' => 'my-authentication-policy',
    'PolicyTypeName' => 'BackendServerAuthenticationPolicyType',
]);

DeleteLoadBalancer

$result = $client->deleteLoadBalancer([/* ... */]);
$promise = $client->deleteLoadBalancerAsync([/* ... */]);

Deletes the specified load balancer.

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

If the load balancer does not exist or has already been deleted, the call to DeleteLoadBalancer still succeeds.

Parameter Syntax

$result = $client->deleteLoadBalancer([
    'LoadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

There are no errors described for this operation.

Examples

Example 1: To delete a load balancer

This example deletes the specified load balancer.

$result = $client->deleteLoadBalancer([
    'LoadBalancerName' => 'my-load-balancer',
]);

DeleteLoadBalancerListeners

$result = $client->deleteLoadBalancerListeners([/* ... */]);
$promise = $client->deleteLoadBalancerListenersAsync([/* ... */]);

Deletes the specified listeners from the specified load balancer.

Parameter Syntax

$result = $client->deleteLoadBalancerListeners([
    'LoadBalancerName' => '<string>', // REQUIRED
    'LoadBalancerPorts' => [<integer>, ...], // REQUIRED
]);

Parameter Details

Members
LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

LoadBalancerPorts
Required: Yes
Type: Array of ints

The client port numbers of the listeners.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

Examples

Example 1: To delete a listener from your load balancer

This example deletes the listener for the specified port from the specified load balancer.

$result = $client->deleteLoadBalancerListeners([
    'LoadBalancerName' => 'my-load-balancer',
    'LoadBalancerPorts' => [
        80,
    ],
]);

DeleteLoadBalancerPolicy

$result = $client->deleteLoadBalancerPolicy([/* ... */]);
$promise = $client->deleteLoadBalancerPolicyAsync([/* ... */]);

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

Parameter Syntax

$result = $client->deleteLoadBalancerPolicy([
    'LoadBalancerName' => '<string>', // REQUIRED
    'PolicyName' => '<string>', // REQUIRED
]);

Parameter Details

Members
LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

PolicyName
Required: Yes
Type: string

The name of the policy.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

Examples

Example 1: To delete a policy from your load balancer

This example deletes the specified policy from the specified load balancer. The policy must not be enabled on any listener.

$result = $client->deleteLoadBalancerPolicy([
    'LoadBalancerName' => 'my-load-balancer',
    'PolicyName' => 'my-duration-cookie-policy',
]);

DeregisterInstancesFromLoadBalancer

$result = $client->deregisterInstancesFromLoadBalancer([/* ... */]);
$promise = $client->deregisterInstancesFromLoadBalancerAsync([/* ... */]);

Deregisters the specified instances from the specified load balancer. After the instance is deregistered, it no longer receives traffic from the load balancer.

You can use DescribeLoadBalancers to verify that the instance is deregistered from the load balancer.

For more information, see Register or De-Register EC2 Instances in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->deregisterInstancesFromLoadBalancer([
    'Instances' => [ // REQUIRED
        [
            'InstanceId' => '<string>',
        ],
        // ...
    ],
    'LoadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
Instances
Required: Yes
Type: Array of Instance structures

The IDs of the instances.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[
    'Instances' => [
        [
            'InstanceId' => '<string>',
        ],
        // ...
    ],
]

Result Details

Members
Instances
Type: Array of Instance structures

The remaining instances registered with the load balancer.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

InvalidEndPointException:

The specified endpoint is not valid.

Examples

Example 1: To deregister instances from a load balancer

This example deregisters the specified instance from the specified load balancer.

$result = $client->deregisterInstancesFromLoadBalancer([
    'Instances' => [
        [
            'InstanceId' => 'i-d6f6fae3',
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'Instances' => [
        [
            'InstanceId' => 'i-207d9717',
        ],
        [
            'InstanceId' => 'i-afefb49b',
        ],
    ],
]

DescribeAccountLimits

$result = $client->describeAccountLimits([/* ... */]);
$promise = $client->describeAccountLimitsAsync([/* ... */]);

Describes the current Elastic Load Balancing resource limits for your AWS account.

For more information, see Limits for Your Classic Load Balancer in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->describeAccountLimits([
    'Marker' => '<string>',
    'PageSize' => <integer>,
]);

Parameter Details

Members
Marker
Type: string

The marker for the next set of results. (You received this marker from a previous call.)

PageSize
Type: int

The maximum number of results to return with this call.

Result Syntax

[
    'Limits' => [
        [
            'Max' => '<string>',
            'Name' => '<string>',
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
Limits
Type: Array of Limit structures

Information about the limits.

NextMarker
Type: string

The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

Errors

There are no errors described for this operation.

DescribeInstanceHealth

$result = $client->describeInstanceHealth([/* ... */]);
$promise = $client->describeInstanceHealthAsync([/* ... */]);

Describes the state of the specified instances with respect to the specified load balancer. If no instances are specified, the call describes the state of all instances that are currently registered with the load balancer. If instances are specified, their state is returned even if they are no longer registered with the load balancer. The state of terminated instances is not returned.

Parameter Syntax

$result = $client->describeInstanceHealth([
    'Instances' => [
        [
            'InstanceId' => '<string>',
        ],
        // ...
    ],
    'LoadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
Instances
Type: Array of Instance structures

The IDs of the instances.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[
    'InstanceStates' => [
        [
            'Description' => '<string>',
            'InstanceId' => '<string>',
            'ReasonCode' => '<string>',
            'State' => '<string>',
        ],
        // ...
    ],
]

Result Details

Members
InstanceStates
Type: Array of InstanceState structures

Information about the health of the instances.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

InvalidEndPointException:

The specified endpoint is not valid.

Examples

Example 1: To describe the health of the instances for a load balancer

This example describes the health of the instances for the specified load balancer.

$result = $client->describeInstanceHealth([
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'InstanceStates' => [
        [
            'Description' => 'N/A',
            'InstanceId' => 'i-207d9717',
            'ReasonCode' => 'N/A',
            'State' => 'InService',
        ],
        [
            'Description' => 'N/A',
            'InstanceId' => 'i-afefb49b',
            'ReasonCode' => 'N/A',
            'State' => 'InService',
        ],
    ],
]

DescribeLoadBalancerAttributes

$result = $client->describeLoadBalancerAttributes([/* ... */]);
$promise = $client->describeLoadBalancerAttributesAsync([/* ... */]);

Describes the attributes for the specified load balancer.

Parameter Syntax

$result = $client->describeLoadBalancerAttributes([
    'LoadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[
    'LoadBalancerAttributes' => [
        'AccessLog' => [
            'EmitInterval' => <integer>,
            'Enabled' => true || false,
            'S3BucketName' => '<string>',
            'S3BucketPrefix' => '<string>',
        ],
        'AdditionalAttributes' => [
            [
                'Key' => '<string>',
                'Value' => '<string>',
            ],
            // ...
        ],
        'ConnectionDraining' => [
            'Enabled' => true || false,
            'Timeout' => <integer>,
        ],
        'ConnectionSettings' => [
            'IdleTimeout' => <integer>,
        ],
        'CrossZoneLoadBalancing' => [
            'Enabled' => true || false,
        ],
    ],
]

Result Details

Members
LoadBalancerAttributes
Type: LoadBalancerAttributes structure

Information about the load balancer attributes.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

LoadBalancerAttributeNotFoundException:

The specified load balancer attribute does not exist.

Examples

Example 1: To describe the attributes of a load balancer

This example describes the attributes of the specified load balancer.

$result = $client->describeLoadBalancerAttributes([
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'LoadBalancerAttributes' => [
        'AccessLog' => [
            'Enabled' => ,
        ],
        'ConnectionDraining' => [
            'Enabled' => ,
            'Timeout' => 300,
        ],
        'ConnectionSettings' => [
            'IdleTimeout' => 60,
        ],
        'CrossZoneLoadBalancing' => [
            'Enabled' => ,
        ],
    ],
]

DescribeLoadBalancerPolicies

$result = $client->describeLoadBalancerPolicies([/* ... */]);
$promise = $client->describeLoadBalancerPoliciesAsync([/* ... */]);

Describes the specified policies.

If you specify a load balancer name, the action returns the descriptions of all 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 sample policies. The names of the sample policies have the ELBSample- prefix.

Parameter Syntax

$result = $client->describeLoadBalancerPolicies([
    'LoadBalancerName' => '<string>',
    'PolicyNames' => ['<string>', ...],
]);

Parameter Details

Members
LoadBalancerName
Type: string

The name of the load balancer.

PolicyNames
Type: Array of strings

The names of the policies.

Result Syntax

[
    'PolicyDescriptions' => [
        [
            'PolicyAttributeDescriptions' => [
                [
                    'AttributeName' => '<string>',
                    'AttributeValue' => '<string>',
                ],
                // ...
            ],
            'PolicyName' => '<string>',
            'PolicyTypeName' => '<string>',
        ],
        // ...
    ],
]

Result Details

Members
PolicyDescriptions
Type: Array of PolicyDescription structures

Information about the policies.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

PolicyNotFoundException:

One or more of the specified policies do not exist.

Examples

Example 1: To describe a policy associated with a load balancer

This example describes the specified policy associated with the specified load balancer.

$result = $client->describeLoadBalancerPolicies([
    'LoadBalancerName' => 'my-load-balancer',
    'PolicyNames' => [
        'my-authentication-policy',
    ],
]);

Result syntax:

[
    'PolicyDescriptions' => [
        [
            'PolicyAttributeDescriptions' => [
                [
                    'AttributeName' => 'PublicKeyPolicyName',
                    'AttributeValue' => 'my-PublicKey-policy',
                ],
            ],
            'PolicyName' => 'my-authentication-policy',
            'PolicyTypeName' => 'BackendServerAuthenticationPolicyType',
        ],
    ],
]

DescribeLoadBalancerPolicyTypes

$result = $client->describeLoadBalancerPolicyTypes([/* ... */]);
$promise = $client->describeLoadBalancerPolicyTypesAsync([/* ... */]);

Describes the specified load balancer policy types or all load balancer policy types.

The description of each type indicates how it can be used. For example, some policies can be used only with layer 7 listeners, some policies can be used only with layer 4 listeners, and some policies can be used only with your EC2 instances.

You can use CreateLoadBalancerPolicy to create a policy configuration for any of these policy types. Then, depending on the policy type, use either SetLoadBalancerPoliciesOfListener or SetLoadBalancerPoliciesForBackendServer to set the policy.

Parameter Syntax

$result = $client->describeLoadBalancerPolicyTypes([
    'PolicyTypeNames' => ['<string>', ...],
]);

Parameter Details

Members
PolicyTypeNames
Type: Array of strings

The names of the policy types. If no names are specified, describes all policy types defined by Elastic Load Balancing.

Result Syntax

[
    'PolicyTypeDescriptions' => [
        [
            'Description' => '<string>',
            'PolicyAttributeTypeDescriptions' => [
                [
                    'AttributeName' => '<string>',
                    'AttributeType' => '<string>',
                    'Cardinality' => '<string>',
                    'DefaultValue' => '<string>',
                    'Description' => '<string>',
                ],
                // ...
            ],
            'PolicyTypeName' => '<string>',
        ],
        // ...
    ],
]

Result Details

Members
PolicyTypeDescriptions
Type: Array of PolicyTypeDescription structures

Information about the policy types.

Errors

PolicyTypeNotFoundException:

One or more of the specified policy types do not exist.

Examples

Example 1: To describe a load balancer policy type defined by Elastic Load Balancing

This example describes the specified load balancer policy type.

$result = $client->describeLoadBalancerPolicyTypes([
    'PolicyTypeNames' => [
        'ProxyProtocolPolicyType',
    ],
]);

Result syntax:

[
    'PolicyTypeDescriptions' => [
        [
            'Description' => 'Policy that controls whether to include the IP address and port of the originating request for TCP messages. This policy operates on TCP listeners only.',
            'PolicyAttributeTypeDescriptions' => [
                [
                    'AttributeName' => 'ProxyProtocol',
                    'AttributeType' => 'Boolean',
                    'Cardinality' => 'ONE',
                ],
            ],
            'PolicyTypeName' => 'ProxyProtocolPolicyType',
        ],
    ],
]

DescribeLoadBalancers

$result = $client->describeLoadBalancers([/* ... */]);
$promise = $client->describeLoadBalancersAsync([/* ... */]);

Describes the specified the load balancers. If no load balancers are specified, the call describes all of your load balancers.

Parameter Syntax

$result = $client->describeLoadBalancers([
    'LoadBalancerNames' => ['<string>', ...],
    'Marker' => '<string>',
    'PageSize' => <integer>,
]);

Parameter Details

Members
LoadBalancerNames
Type: Array of strings

The names of the load balancers.

Marker
Type: string

The marker for the next set of results. (You received this marker from a previous call.)

PageSize
Type: int

The maximum number of results to return with this call (a number from 1 to 400). The default is 400.

Result Syntax

[
    'LoadBalancerDescriptions' => [
        [
            'AvailabilityZones' => ['<string>', ...],
            'BackendServerDescriptions' => [
                [
                    'InstancePort' => <integer>,
                    'PolicyNames' => ['<string>', ...],
                ],
                // ...
            ],
            'CanonicalHostedZoneName' => '<string>',
            'CanonicalHostedZoneNameID' => '<string>',
            'CreatedTime' => <DateTime>,
            'DNSName' => '<string>',
            'HealthCheck' => [
                'HealthyThreshold' => <integer>,
                'Interval' => <integer>,
                'Target' => '<string>',
                'Timeout' => <integer>,
                'UnhealthyThreshold' => <integer>,
            ],
            'Instances' => [
                [
                    'InstanceId' => '<string>',
                ],
                // ...
            ],
            'ListenerDescriptions' => [
                [
                    'Listener' => [
                        'InstancePort' => <integer>,
                        'InstanceProtocol' => '<string>',
                        'LoadBalancerPort' => <integer>,
                        'Protocol' => '<string>',
                        'SSLCertificateId' => '<string>',
                    ],
                    'PolicyNames' => ['<string>', ...],
                ],
                // ...
            ],
            'LoadBalancerName' => '<string>',
            'Policies' => [
                'AppCookieStickinessPolicies' => [
                    [
                        'CookieName' => '<string>',
                        'PolicyName' => '<string>',
                    ],
                    // ...
                ],
                'LBCookieStickinessPolicies' => [
                    [
                        'CookieExpirationPeriod' => <integer>,
                        'PolicyName' => '<string>',
                    ],
                    // ...
                ],
                'OtherPolicies' => ['<string>', ...],
            ],
            'Scheme' => '<string>',
            'SecurityGroups' => ['<string>', ...],
            'SourceSecurityGroup' => [
                'GroupName' => '<string>',
                'OwnerAlias' => '<string>',
            ],
            'Subnets' => ['<string>', ...],
            'VPCId' => '<string>',
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
LoadBalancerDescriptions
Type: Array of LoadBalancerDescription structures

Information about the load balancers.

NextMarker
Type: string

The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

DependencyThrottleException:

A request made by Elastic Load Balancing to another service exceeds the maximum request rate permitted for your account.

Examples

Example 1: To describe one of your load balancers

This example describes the specified load balancer.

$result = $client->describeLoadBalancers([
    'LoadBalancerNames' => [
        'my-load-balancer',
    ],
]);

Result syntax:

[
    'LoadBalancerDescriptions' => [
        [
            'AvailabilityZones' => [
                'us-west-2a',
            ],
            'BackendServerDescriptions' => [
                [
                    'InstancePort' => 80,
                    'PolicyNames' => [
                        'my-ProxyProtocol-policy',
                    ],
                ],
            ],
            'CanonicalHostedZoneName' => 'my-load-balancer-1234567890.us-west-2.elb.amazonaws.com',
            'CanonicalHostedZoneNameID' => 'Z3DZXE0EXAMPLE',
            'CreatedTime' => ,
            'DNSName' => 'my-load-balancer-1234567890.us-west-2.elb.amazonaws.com',
            'HealthCheck' => [
                'HealthyThreshold' => 2,
                'Interval' => 30,
                'Target' => 'HTTP:80/png',
                'Timeout' => 3,
                'UnhealthyThreshold' => 2,
            ],
            'Instances' => [
                [
                    'InstanceId' => 'i-207d9717',
                ],
                [
                    'InstanceId' => 'i-afefb49b',
                ],
            ],
            'ListenerDescriptions' => [
                [
                    'Listener' => [
                        'InstancePort' => 80,
                        'InstanceProtocol' => 'HTTP',
                        'LoadBalancerPort' => 80,
                        'Protocol' => 'HTTP',
                    ],
                    'PolicyNames' => [
                    ],
                ],
                [
                    'Listener' => [
                        'InstancePort' => 443,
                        'InstanceProtocol' => 'HTTPS',
                        'LoadBalancerPort' => 443,
                        'Protocol' => 'HTTPS',
                        'SSLCertificateId' => 'arn:aws:iam::123456789012:server-certificate/my-server-cert',
                    ],
                    'PolicyNames' => [
                        'ELBSecurityPolicy-2015-03',
                    ],
                ],
            ],
            'LoadBalancerName' => 'my-load-balancer',
            'Policies' => [
                'AppCookieStickinessPolicies' => [
                ],
                'LBCookieStickinessPolicies' => [
                    [
                        'CookieExpirationPeriod' => 60,
                        'PolicyName' => 'my-duration-cookie-policy',
                    ],
                ],
                'OtherPolicies' => [
                    'my-PublicKey-policy',
                    'my-authentication-policy',
                    'my-SSLNegotiation-policy',
                    'my-ProxyProtocol-policy',
                    'ELBSecurityPolicy-2015-03',
                ],
            ],
            'Scheme' => 'internet-facing',
            'SecurityGroups' => [
                'sg-a61988c3',
            ],
            'SourceSecurityGroup' => [
                'GroupName' => 'my-elb-sg',
                'OwnerAlias' => '123456789012',
            ],
            'Subnets' => [
                'subnet-15aaab61',
            ],
            'VPCId' => 'vpc-a01106c2',
        ],
    ],
]

DescribeTags

$result = $client->describeTags([/* ... */]);
$promise = $client->describeTagsAsync([/* ... */]);

Describes the tags associated with the specified load balancers.

Parameter Syntax

$result = $client->describeTags([
    'LoadBalancerNames' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
LoadBalancerNames
Required: Yes
Type: Array of strings

The names of the load balancers.

Result Syntax

[
    'TagDescriptions' => [
        [
            'LoadBalancerName' => '<string>',
            'Tags' => [
                [
                    'Key' => '<string>',
                    'Value' => '<string>',
                ],
                // ...
            ],
        ],
        // ...
    ],
]

Result Details

Members
TagDescriptions
Type: Array of TagDescription structures

Information about the tags.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

Examples

Example 1: To describe the tags for a load balancer

This example describes the tags for the specified load balancer.

$result = $client->describeTags([
    'LoadBalancerNames' => [
        'my-load-balancer',
    ],
]);

Result syntax:

[
    'TagDescriptions' => [
        [
            'LoadBalancerName' => 'my-load-balancer',
            'Tags' => [
                [
                    'Key' => 'project',
                    'Value' => 'lima',
                ],
                [
                    'Key' => 'department',
                    'Value' => 'digital-media',
                ],
            ],
        ],
    ],
]

DetachLoadBalancerFromSubnets

$result = $client->detachLoadBalancerFromSubnets([/* ... */]);
$promise = $client->detachLoadBalancerFromSubnetsAsync([/* ... */]);

Removes the specified subnets from the set of configured subnets for the load balancer.

After a subnet is removed, all EC2 instances registered with the load balancer in the removed subnet go into the OutOfService state. Then, the load balancer balances the traffic among the remaining routable subnets.

Parameter Syntax

$result = $client->detachLoadBalancerFromSubnets([
    'LoadBalancerName' => '<string>', // REQUIRED
    'Subnets' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Subnets
Required: Yes
Type: Array of strings

The IDs of the subnets.

Result Syntax

[
    'Subnets' => ['<string>', ...],
]

Result Details

Members
Subnets
Type: Array of strings

The IDs of the remaining subnets for the load balancer.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

Examples

Example 1: To detach a load balancer from a subnet

This example detaches the specified load balancer from the specified subnet.

$result = $client->detachLoadBalancerFromSubnets([
    'LoadBalancerName' => 'my-load-balancer',
    'Subnets' => [
        'subnet-0ecac448',
    ],
]);

Result syntax:

[
    'Subnets' => [
        'subnet-15aaab61',
    ],
]

DisableAvailabilityZonesForLoadBalancer

$result = $client->disableAvailabilityZonesForLoadBalancer([/* ... */]);
$promise = $client->disableAvailabilityZonesForLoadBalancerAsync([/* ... */]);

Removes the specified Availability Zones from the set of Availability Zones for the specified load balancer in EC2-Classic or a default VPC.

For load balancers in a non-default VPC, use DetachLoadBalancerFromSubnets.

There must be at least one Availability Zone registered with a load balancer at all times. After an Availability Zone is removed, all instances registered with the load balancer that are in the removed Availability Zone go into the OutOfService state. Then, the load balancer attempts to equally balance the traffic among its remaining Availability Zones.

For more information, see Add or Remove Availability Zones in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->disableAvailabilityZonesForLoadBalancer([
    'AvailabilityZones' => ['<string>', ...], // REQUIRED
    'LoadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
AvailabilityZones
Required: Yes
Type: Array of strings

The Availability Zones.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[
    'AvailabilityZones' => ['<string>', ...],
]

Result Details

Members
AvailabilityZones
Type: Array of strings

The remaining Availability Zones for the load balancer.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

Examples

Example 1: To disable an Availability Zone for a load balancer

This example removes the specified Availability Zone from the set of Availability Zones for the specified load balancer.

$result = $client->disableAvailabilityZonesForLoadBalancer([
    'AvailabilityZones' => [
        'us-west-2a',
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'AvailabilityZones' => [
        'us-west-2b',
    ],
]

EnableAvailabilityZonesForLoadBalancer

$result = $client->enableAvailabilityZonesForLoadBalancer([/* ... */]);
$promise = $client->enableAvailabilityZonesForLoadBalancerAsync([/* ... */]);

Adds the specified Availability Zones to the set of Availability Zones for the specified load balancer in EC2-Classic or a default VPC.

For load balancers in a non-default VPC, use AttachLoadBalancerToSubnets.

The load balancer evenly distributes requests across all its registered Availability Zones that contain instances. For more information, see Add or Remove Availability Zones in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->enableAvailabilityZonesForLoadBalancer([
    'AvailabilityZones' => ['<string>', ...], // REQUIRED
    'LoadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
AvailabilityZones
Required: Yes
Type: Array of strings

The Availability Zones. These must be in the same region as the load balancer.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[
    'AvailabilityZones' => ['<string>', ...],
]

Result Details

Members
AvailabilityZones
Type: Array of strings

The updated list of Availability Zones for the load balancer.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

Examples

Example 1: To enable an Availability Zone for a load balancer

This example adds the specified Availability Zone to the specified load balancer.

$result = $client->enableAvailabilityZonesForLoadBalancer([
    'AvailabilityZones' => [
        'us-west-2b',
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'AvailabilityZones' => [
        'us-west-2a',
        'us-west-2b',
    ],
]

ModifyLoadBalancerAttributes

$result = $client->modifyLoadBalancerAttributes([/* ... */]);
$promise = $client->modifyLoadBalancerAttributesAsync([/* ... */]);

Modifies the attributes of the specified load balancer.

You can modify the load balancer attributes, such as AccessLogs, ConnectionDraining, and CrossZoneLoadBalancing by either enabling or disabling them. Or, you can modify the load balancer attribute ConnectionSettings by specifying an idle connection timeout value for your load balancer.

For more information, see the following in the Classic Load Balancers Guide:

Parameter Syntax

$result = $client->modifyLoadBalancerAttributes([
    'LoadBalancerAttributes' => [ // REQUIRED
        'AccessLog' => [
            'EmitInterval' => <integer>,
            'Enabled' => true || false, // REQUIRED
            'S3BucketName' => '<string>',
            'S3BucketPrefix' => '<string>',
        ],
        'AdditionalAttributes' => [
            [
                'Key' => '<string>',
                'Value' => '<string>',
            ],
            // ...
        ],
        'ConnectionDraining' => [
            'Enabled' => true || false, // REQUIRED
            'Timeout' => <integer>,
        ],
        'ConnectionSettings' => [
            'IdleTimeout' => <integer>, // REQUIRED
        ],
        'CrossZoneLoadBalancing' => [
            'Enabled' => true || false, // REQUIRED
        ],
    ],
    'LoadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
LoadBalancerAttributes
Required: Yes
Type: LoadBalancerAttributes structure

The attributes for the load balancer.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[
    'LoadBalancerAttributes' => [
        'AccessLog' => [
            'EmitInterval' => <integer>,
            'Enabled' => true || false,
            'S3BucketName' => '<string>',
            'S3BucketPrefix' => '<string>',
        ],
        'AdditionalAttributes' => [
            [
                'Key' => '<string>',
                'Value' => '<string>',
            ],
            // ...
        ],
        'ConnectionDraining' => [
            'Enabled' => true || false,
            'Timeout' => <integer>,
        ],
        'ConnectionSettings' => [
            'IdleTimeout' => <integer>,
        ],
        'CrossZoneLoadBalancing' => [
            'Enabled' => true || false,
        ],
    ],
    'LoadBalancerName' => '<string>',
]

Result Details

Members
LoadBalancerAttributes
Type: LoadBalancerAttributes structure

Information about the load balancer attributes.

LoadBalancerName
Type: string

The name of the load balancer.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

LoadBalancerAttributeNotFoundException:

The specified load balancer attribute does not exist.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

Examples

Example 1: To enable cross-zone load balancing

This example enables cross-zone load balancing for the specified load balancer.

$result = $client->modifyLoadBalancerAttributes([
    'LoadBalancerAttributes' => [
        'CrossZoneLoadBalancing' => [
            'Enabled' => 1,
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'LoadBalancerAttributes' => [
        'CrossZoneLoadBalancing' => [
            'Enabled' => 1,
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
]
Example 2: To enable connection draining

This example enables connection draining for the specified load balancer.

$result = $client->modifyLoadBalancerAttributes([
    'LoadBalancerAttributes' => [
        'ConnectionDraining' => [
            'Enabled' => 1,
            'Timeout' => 300,
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'LoadBalancerAttributes' => [
        'ConnectionDraining' => [
            'Enabled' => 1,
            'Timeout' => 300,
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
]

RegisterInstancesWithLoadBalancer

$result = $client->registerInstancesWithLoadBalancer([/* ... */]);
$promise = $client->registerInstancesWithLoadBalancerAsync([/* ... */]);

Adds the specified instances to the specified load balancer.

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

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

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

To deregister instances from a load balancer, use DeregisterInstancesFromLoadBalancer.

For more information, see Register or De-Register EC2 Instances in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->registerInstancesWithLoadBalancer([
    'Instances' => [ // REQUIRED
        [
            'InstanceId' => '<string>',
        ],
        // ...
    ],
    'LoadBalancerName' => '<string>', // REQUIRED
]);

Parameter Details

Members
Instances
Required: Yes
Type: Array of Instance structures

The IDs of the instances.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

Result Syntax

[
    'Instances' => [
        [
            'InstanceId' => '<string>',
        ],
        // ...
    ],
]

Result Details

Members
Instances
Type: Array of Instance structures

The updated list of instances for the load balancer.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

InvalidEndPointException:

The specified endpoint is not valid.

Examples

Example 1: To register instances with a load balancer

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

$result = $client->registerInstancesWithLoadBalancer([
    'Instances' => [
        [
            'InstanceId' => 'i-d6f6fae3',
        ],
    ],
    'LoadBalancerName' => 'my-load-balancer',
]);

Result syntax:

[
    'Instances' => [
        [
            'InstanceId' => 'i-d6f6fae3',
        ],
        [
            'InstanceId' => 'i-207d9717',
        ],
        [
            'InstanceId' => 'i-afefb49b',
        ],
    ],
]

RemoveTags

$result = $client->removeTags([/* ... */]);
$promise = $client->removeTagsAsync([/* ... */]);

Removes one or more tags from the specified load balancer.

Parameter Syntax

$result = $client->removeTags([
    'LoadBalancerNames' => ['<string>', ...], // REQUIRED
    'Tags' => [ // REQUIRED
        [
            'Key' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
LoadBalancerNames
Required: Yes
Type: Array of strings

The name of the load balancer. You can specify a maximum of one load balancer name.

Tags
Required: Yes
Type: Array of TagKeyOnly structures

The list of tag keys to remove.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

Examples

Example 1: To remove tags from a load balancer

This example removes the specified tag from the specified load balancer.

$result = $client->removeTags([
    'LoadBalancerNames' => [
        'my-load-balancer',
    ],
    'Tags' => [
        [
            'Key' => 'project',
        ],
    ],
]);

SetLoadBalancerListenerSSLCertificate

$result = $client->setLoadBalancerListenerSSLCertificate([/* ... */]);
$promise = $client->setLoadBalancerListenerSSLCertificateAsync([/* ... */]);

Sets the certificate that terminates the specified listener's SSL connections. The specified certificate replaces any prior certificate that was used on the same load balancer and port.

For more information about updating your SSL certificate, see Replace the SSL Certificate for Your Load Balancer in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->setLoadBalancerListenerSSLCertificate([
    'LoadBalancerName' => '<string>', // REQUIRED
    'LoadBalancerPort' => <integer>, // REQUIRED
    'SSLCertificateId' => '<string>', // REQUIRED
]);

Parameter Details

Members
LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

LoadBalancerPort
Required: Yes
Type: int

The port that uses the specified SSL certificate.

SSLCertificateId
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the SSL certificate.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

CertificateNotFoundException:

The specified ARN does not refer to a valid SSL certificate in AWS Identity and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if you recently uploaded the certificate to IAM, this error might indicate that the certificate is not fully available yet.

AccessPointNotFoundException:

The specified load balancer does not exist.

ListenerNotFoundException:

The load balancer does not have a listener configured at the specified port.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

UnsupportedProtocolException:

The specified protocol or signature version is not supported.

Examples

Example 1: To update the SSL certificate for an HTTPS listener

This example replaces the existing SSL certificate for the specified HTTPS listener.

$result = $client->setLoadBalancerListenerSSLCertificate([
    'LoadBalancerName' => 'my-load-balancer',
    'LoadBalancerPort' => 443,
    'SSLCertificateId' => 'arn:aws:iam::123456789012:server-certificate/new-server-cert',
]);

SetLoadBalancerPoliciesForBackendServer

$result = $client->setLoadBalancerPoliciesForBackendServer([/* ... */]);
$promise = $client->setLoadBalancerPoliciesForBackendServerAsync([/* ... */]);

Replaces the set of policies associated with the specified port on which the EC2 instance is listening with a new set of policies. At this time, only the back-end server authentication policy type can be applied to the instance ports; this policy type is composed of multiple public key policies.

Each time you use SetLoadBalancerPoliciesForBackendServer to enable the policies, use the PolicyNames parameter to list the policies that you want to enable.

You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies to verify that the policy is associated with the EC2 instance.

For more information about enabling back-end instance authentication, see Configure Back-end Instance Authentication in the Classic Load Balancers Guide. For more information about Proxy Protocol, see Configure Proxy Protocol Support in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->setLoadBalancerPoliciesForBackendServer([
    'InstancePort' => <integer>, // REQUIRED
    'LoadBalancerName' => '<string>', // REQUIRED
    'PolicyNames' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
InstancePort
Required: Yes
Type: int

The port number associated with the EC2 instance.

LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

PolicyNames
Required: Yes
Type: Array of strings

The names of the policies. If the list is empty, then all current polices are removed from the EC2 instance.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

PolicyNotFoundException:

One or more of the specified policies do not exist.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

Examples

Example 1: To replace the policies associated with a port for a backend instance

This example replaces the policies that are currently associated with the specified port.

$result = $client->setLoadBalancerPoliciesForBackendServer([
    'InstancePort' => 80,
    'LoadBalancerName' => 'my-load-balancer',
    'PolicyNames' => [
        'my-ProxyProtocol-policy',
    ],
]);

SetLoadBalancerPoliciesOfListener

$result = $client->setLoadBalancerPoliciesOfListener([/* ... */]);
$promise = $client->setLoadBalancerPoliciesOfListenerAsync([/* ... */]);

Replaces the current set of policies for the specified load balancer port with the specified set of policies.

To enable back-end server authentication, use SetLoadBalancerPoliciesForBackendServer.

For more information about setting policies, see Update the SSL Negotiation Configuration, Duration-Based Session Stickiness, and Application-Controlled Session Stickiness in the Classic Load Balancers Guide.

Parameter Syntax

$result = $client->setLoadBalancerPoliciesOfListener([
    'LoadBalancerName' => '<string>', // REQUIRED
    'LoadBalancerPort' => <integer>, // REQUIRED
    'PolicyNames' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
LoadBalancerName
Required: Yes
Type: string

The name of the load balancer.

LoadBalancerPort
Required: Yes
Type: int

The external port of the load balancer.

PolicyNames
Required: Yes
Type: Array of strings

The names of the policies. This list must include all policies to be enabled. If you omit a policy that is currently enabled, it is disabled. If the list is empty, all current policies are disabled.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

AccessPointNotFoundException:

The specified load balancer does not exist.

PolicyNotFoundException:

One or more of the specified policies do not exist.

ListenerNotFoundException:

The load balancer does not have a listener configured at the specified port.

InvalidConfigurationRequestException:

The requested configuration change is not valid.

Examples

Example 1: To replace the policies associated with a listener

This example replaces the policies that are currently associated with the specified listener.

$result = $client->setLoadBalancerPoliciesOfListener([
    'LoadBalancerName' => 'my-load-balancer',
    'LoadBalancerPort' => 80,
    'PolicyNames' => [
        'my-SSLNegotiation-policy',
    ],
]);

Shapes

AccessLog

Description

Information about the AccessLog attribute.

Members
EmitInterval
Type: int

The interval for publishing the access logs. You can specify an interval of either 5 minutes or 60 minutes.

Default: 60 minutes

Enabled
Required: Yes
Type: boolean

Specifies whether access logs are enabled for the load balancer.

S3BucketName
Type: string

The name of the Amazon S3 bucket where the access logs are stored.

S3BucketPrefix
Type: string

The logical hierarchy you created for your Amazon S3 bucket, for example my-bucket-prefix/prod. If the prefix is not provided, the log is placed at the root level of the bucket.

AccessPointNotFoundException

Description

The specified load balancer does not exist.

Members

AddAvailabilityZonesOutput

Description

Contains the output of EnableAvailabilityZonesForLoadBalancer.

Members
AvailabilityZones
Type: Array of strings

The updated list of Availability Zones for the load balancer.

AddTagsOutput

Description

Contains the output of AddTags.

Members

AdditionalAttribute

Description

Information about additional load balancer attributes.

Members
Key
Type: string

The name of the attribute.

The following attribute is supported.

  • elb.http.desyncmitigationmode - Determines how the load balancer handles requests that might pose a security risk to your application. The possible values are monitor, defensive, and strictest. The default is defensive.

Value
Type: string

This value of the attribute.

AppCookieStickinessPolicy

Description

Information about a policy for application-controlled session stickiness.

Members
CookieName
Type: string

The name of the application cookie used for stickiness.

PolicyName
Type: string

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

ApplySecurityGroupsToLoadBalancerOutput

Description

Contains the output of ApplySecurityGroupsToLoadBalancer.

Members
SecurityGroups
Type: Array of strings

The IDs of the security groups associated with the load balancer.

AttachLoadBalancerToSubnetsOutput

Description

Contains the output of AttachLoadBalancerToSubnets.

Members
Subnets
Type: Array of strings

The IDs of the subnets attached to the load balancer.

BackendServerDescription

Description

Information about the configuration of an EC2 instance.

Members
InstancePort
Type: int

The port on which the EC2 instance is listening.

PolicyNames
Type: Array of strings

The names of the policies enabled for the EC2 instance.

CertificateNotFoundException

Description

The specified ARN does not refer to a valid SSL certificate in AWS Identity and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if you recently uploaded the certificate to IAM, this error might indicate that the certificate is not fully available yet.

Members

ConfigureHealthCheckOutput

Description

Contains the output of ConfigureHealthCheck.

Members
HealthCheck
Type: HealthCheck structure

The updated health check.

ConnectionDraining

Description

Information about the ConnectionDraining attribute.

Members
Enabled
Required: Yes
Type: boolean

Specifies whether connection draining is enabled for the load balancer.

Timeout
Type: int

The maximum time, in seconds, to keep the existing connections open before deregistering the instances.

ConnectionSettings

Description

Information about the ConnectionSettings attribute.

Members
IdleTimeout
Required: Yes
Type: int

The time, in seconds, that the connection is allowed to be idle (no data has been sent over the connection) before it is closed by the load balancer.

CreateAccessPointOutput

Description

Contains the output for CreateLoadBalancer.

Members
DNSName
Type: string

The DNS name of the load balancer.

CreateAppCookieStickinessPolicyOutput

Description

Contains the output for CreateAppCookieStickinessPolicy.

Members

CreateLBCookieStickinessPolicyOutput

Description

Contains the output for CreateLBCookieStickinessPolicy.

Members

CreateLoadBalancerListenerOutput

Description

Contains the parameters for CreateLoadBalancerListener.

Members

CreateLoadBalancerPolicyOutput

Description

Contains the output of CreateLoadBalancerPolicy.

Members

CrossZoneLoadBalancing

Description

Information about the CrossZoneLoadBalancing attribute.

Members
Enabled
Required: Yes
Type: boolean

Specifies whether cross-zone load balancing is enabled for the load balancer.

DeleteAccessPointOutput

Description

Contains the output of DeleteLoadBalancer.

Members

DeleteLoadBalancerListenerOutput

Description

Contains the output of DeleteLoadBalancerListeners.

Members

DeleteLoadBalancerPolicyOutput

Description

Contains the output of DeleteLoadBalancerPolicy.

Members

DependencyThrottleException

Description

A request made by Elastic Load Balancing to another service exceeds the maximum request rate permitted for your account.

Members

DeregisterEndPointsOutput

Description

Contains the output of DeregisterInstancesFromLoadBalancer.

Members
Instances
Type: Array of Instance structures

The remaining instances registered with the load balancer.

DescribeAccessPointsOutput

Description

Contains the parameters for DescribeLoadBalancers.

Members
LoadBalancerDescriptions
Type: Array of LoadBalancerDescription structures

Information about the load balancers.

NextMarker
Type: string

The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

DescribeAccountLimitsOutput

Members
Limits
Type: Array of Limit structures

Information about the limits.

NextMarker
Type: string

The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

DescribeEndPointStateOutput

Description

Contains the output for DescribeInstanceHealth.

Members
InstanceStates
Type: Array of InstanceState structures

Information about the health of the instances.

DescribeLoadBalancerAttributesOutput

Description

Contains the output of DescribeLoadBalancerAttributes.

Members
LoadBalancerAttributes
Type: LoadBalancerAttributes structure

Information about the load balancer attributes.

DescribeLoadBalancerPoliciesOutput

Description

Contains the output of DescribeLoadBalancerPolicies.

Members
PolicyDescriptions
Type: Array of PolicyDescription structures

Information about the policies.

DescribeLoadBalancerPolicyTypesOutput

Description

Contains the output of DescribeLoadBalancerPolicyTypes.

Members
PolicyTypeDescriptions
Type: Array of PolicyTypeDescription structures

Information about the policy types.

DescribeTagsOutput

Description

Contains the output for DescribeTags.

Members
TagDescriptions
Type: Array of TagDescription structures

Information about the tags.

DetachLoadBalancerFromSubnetsOutput

Description

Contains the output of DetachLoadBalancerFromSubnets.

Members
Subnets
Type: Array of strings

The IDs of the remaining subnets for the load balancer.

DuplicateAccessPointNameException

Description

The specified load balancer name already exists for this account.

Members

DuplicateListenerException

Description

A listener already exists for the specified load balancer name and port, but with a different instance port, protocol, or SSL certificate.

Members

DuplicatePolicyNameException

Description

A policy with the specified name already exists for this load balancer.

Members

DuplicateTagKeysException

Description

A tag key was specified more than once.

Members

HealthCheck

Description

Information about a health check.

Members
HealthyThreshold
Required: Yes
Type: int

The number of consecutive health checks successes required before moving the instance to the Healthy state.

Interval
Required: Yes
Type: int

The approximate interval, in seconds, between health checks of an individual instance.

Target
Required: Yes
Type: string

The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. The range of valid ports is one (1) through 65535.

TCP is the default, specified as a TCP: port pair, for example "TCP:5000". In this case, a health check simply attempts to open a TCP connection to the instance on the specified port. Failure to connect within the configured timeout is considered unhealthy.

SSL is also specified as SSL: port pair, for example, SSL:5000.

For HTTP/HTTPS, you must include a ping path in the string. HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to the instance on the given port and path. Any answer other than "200 OK" within the timeout period is considered unhealthy.

The total length of the HTTP ping target must be 1024 16-bit Unicode characters or less.

Timeout
Required: Yes
Type: int

The amount of time, in seconds, during which no response means a failed health check.

This value must be less than the Interval value.

UnhealthyThreshold
Required: Yes
Type: int

The number of consecutive health check failures required before moving the instance to the Unhealthy state.

Instance

Description

The ID of an EC2 instance.

Members
InstanceId
Type: string

The instance ID.

InstanceState

Description

Information about the state of an EC2 instance.

Members
Description
Type: string

A description of the instance state. This string can contain one or more of the following messages.

  • N/A

  • A transient error occurred. Please try again later.

  • Instance has failed at least the UnhealthyThreshold number of health checks consecutively.

  • Instance has not passed the configured HealthyThreshold number of health checks consecutively.

  • Instance registration is still in progress.

  • Instance is in the EC2 Availability Zone for which LoadBalancer is not configured to route traffic to.

  • Instance is not currently registered with the LoadBalancer.

  • Instance deregistration currently in progress.

  • Disable Availability Zone is currently in progress.

  • Instance is in pending state.

  • Instance is in stopped state.

  • Instance is in terminated state.

InstanceId
Type: string

The ID of the instance.

ReasonCode
Type: string

Information about the cause of OutOfService instances. Specifically, whether the cause is Elastic Load Balancing or the instance.

Valid values: ELB | Instance | N/A

State
Type: string

The current state of the instance.

Valid values: InService | OutOfService | Unknown

InvalidConfigurationRequestException

Description

The requested configuration change is not valid.

Members

InvalidEndPointException

Description

The specified endpoint is not valid.

Members

InvalidSchemeException

Description

The specified value for the schema is not valid. You can only specify a scheme for load balancers in a VPC.

Members

InvalidSecurityGroupException

Description

One or more of the specified security groups do not exist.

Members

InvalidSubnetException

Description

The specified VPC has no associated Internet gateway.

Members

LBCookieStickinessPolicy

Description

Information about a policy for duration-based session stickiness.

Members
CookieExpirationPeriod
Type: long (int|float)

The time period, in seconds, after which the cookie should be considered stale. If this parameter is not specified, the stickiness session lasts for the duration of the browser session.

PolicyName
Type: string

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

Limit

Description

Information about an Elastic Load Balancing resource limit for your AWS account.

Members
Max
Type: string

The maximum value of the limit.

Name
Type: string

The name of the limit. The possible values are:

  • classic-listeners

  • classic-load-balancers

  • classic-registered-instances

Listener

Description

Information about a listener.

For information about the protocols and the ports supported by Elastic Load Balancing, see Listeners for Your Classic Load Balancer in the Classic Load Balancers Guide.

Members
InstancePort
Required: Yes
Type: int

The port on which the instance is listening.

InstanceProtocol
Type: string

The protocol to use for routing traffic to instances: HTTP, HTTPS, TCP, or SSL.

If the front-end protocol is TCP or SSL, the back-end protocol must be TCP or SSL. If the front-end protocol is HTTP or HTTPS, the back-end protocol must be HTTP or HTTPS.

If there is another listener with the same InstancePort whose InstanceProtocol is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure.

If there is another listener with the same InstancePort whose InstanceProtocol is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP.

LoadBalancerPort
Required: Yes
Type: int

The port on which the load balancer is listening. On EC2-VPC, you can specify any port from the range 1-65535. On EC2-Classic, you can specify any port from the following list: 25, 80, 443, 465, 587, 1024-65535.

Protocol
Required: Yes
Type: string

The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL.

SSLCertificateId
Type: string

The Amazon Resource Name (ARN) of the server certificate.

ListenerDescription

Description

The policies enabled for a listener.

Members
Listener
Type: Listener structure

The listener.

PolicyNames
Type: Array of strings

The policies. If there are no policies enabled, the list is empty.

ListenerNotFoundException

Description

The load balancer does not have a listener configured at the specified port.

Members

LoadBalancerAttributeNotFoundException

Description

The specified load balancer attribute does not exist.

Members

LoadBalancerAttributes

Description

The attributes for a load balancer.

Members
AccessLog
Type: AccessLog structure

If enabled, the load balancer captures detailed information of all requests and delivers the information to the Amazon S3 bucket that you specify.

For more information, see Enable Access Logs in the Classic Load Balancers Guide.

AdditionalAttributes
Type: Array of AdditionalAttribute structures

Any additional attributes.

ConnectionDraining
Type: ConnectionDraining structure

If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.

For more information, see Configure Connection Draining in the Classic Load Balancers Guide.

ConnectionSettings
Type: ConnectionSettings structure

If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.

By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. For more information, see Configure Idle Connection Timeout in the Classic Load Balancers Guide.

CrossZoneLoadBalancing
Type: CrossZoneLoadBalancing structure

If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.

For more information, see Configure Cross-Zone Load Balancing in the Classic Load Balancers Guide.

LoadBalancerDescription

Description

Information about a load balancer.

Members
AvailabilityZones
Type: Array of strings

The Availability Zones for the load balancer.

BackendServerDescriptions
Type: Array of BackendServerDescription structures

Information about your EC2 instances.

CanonicalHostedZoneName
Type: string

The DNS name of the load balancer.

For more information, see Configure a Custom Domain Name in the Classic Load Balancers Guide.

CanonicalHostedZoneNameID
Type: string

The ID of the Amazon Route 53 hosted zone for the load balancer.

CreatedTime
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time the load balancer was created.

DNSName
Type: string

The DNS name of the load balancer.

HealthCheck
Type: HealthCheck structure

Information about the health checks conducted on the load balancer.

Instances
Type: Array of Instance structures

The IDs of the instances for the load balancer.

ListenerDescriptions
Type: Array of ListenerDescription structures

The listeners for the load balancer.

LoadBalancerName
Type: string

The name of the load balancer.

Policies
Type: Policies structure

The policies defined for the load balancer.

Scheme
Type: string

The type of load balancer. Valid only for load balancers in a VPC.

If Scheme is internet-facing, the load balancer has a public DNS name that resolves to a public IP address.

If Scheme is internal, the load balancer has a public DNS name that resolves to a private IP address.

SecurityGroups
Type: Array of strings

The security groups for the load balancer. Valid only for load balancers in a VPC.

SourceSecurityGroup
Type: SourceSecurityGroup structure

The security group for the load balancer, which you can use as part of your inbound rules for your registered instances. To only allow traffic from load balancers, add a security group rule that specifies this source security group as the inbound source.

Subnets
Type: Array of strings

The IDs of the subnets for the load balancer.

VPCId
Type: string

The ID of the VPC for the load balancer.

ModifyLoadBalancerAttributesOutput

Description

Contains the output of ModifyLoadBalancerAttributes.

Members
LoadBalancerAttributes
Type: LoadBalancerAttributes structure

Information about the load balancer attributes.

LoadBalancerName
Type: string

The name of the load balancer.

OperationNotPermittedException

Description

This operation is not allowed.

Members

PolicyAttribute

Description

Information about a policy attribute.

Members
AttributeName
Type: string

The name of the attribute.

AttributeValue
Type: string

The value of the attribute.

PolicyAttributeDescription

Description

Information about a policy attribute.

Members
AttributeName
Type: string

The name of the attribute.

AttributeValue
Type: string

The value of the attribute.

PolicyAttributeTypeDescription

Description

Information about a policy attribute type.

Members
AttributeName
Type: string

The name of the attribute.

AttributeType
Type: string

The type of the attribute. For example, Boolean or Integer.

Cardinality
Type: string

The cardinality of the attribute.

Valid values:

  • ONE(1) : Single value required

  • ZERO_OR_ONE(0..1) : Up to one value is allowed

  • ZERO_OR_MORE(0..*) : Optional. Multiple values are allowed

  • ONE_OR_MORE(1..*0) : Required. Multiple values are allowed

DefaultValue
Type: string

The default value of the attribute, if applicable.

Description
Type: string

A description of the attribute.

PolicyDescription

Description

Information about a policy.

Members
PolicyAttributeDescriptions
Type: Array of PolicyAttributeDescription structures

The policy attributes.

PolicyName
Type: string

The name of the policy.

PolicyTypeName
Type: string

The name of the policy type.

PolicyNotFoundException

Description

One or more of the specified policies do not exist.

Members

PolicyTypeDescription

Description

Information about a policy type.

Members
Description
Type: string

A description of the policy type.

PolicyAttributeTypeDescriptions
Type: Array of PolicyAttributeTypeDescription structures

The description of the policy attributes associated with the policies defined by Elastic Load Balancing.

PolicyTypeName
Type: string

The name of the policy type.

PolicyTypeNotFoundException

Description

One or more of the specified policy types do not exist.

Members

RegisterEndPointsOutput

Description

Contains the output of RegisterInstancesWithLoadBalancer.

Members
Instances
Type: Array of Instance structures

The updated list of instances for the load balancer.

RemoveAvailabilityZonesOutput

Description

Contains the output for DisableAvailabilityZonesForLoadBalancer.

Members
AvailabilityZones
Type: Array of strings

The remaining Availability Zones for the load balancer.

RemoveTagsOutput

Description

Contains the output of RemoveTags.

Members

SetLoadBalancerListenerSSLCertificateOutput

Description

Contains the output of SetLoadBalancerListenerSSLCertificate.

Members

SetLoadBalancerPoliciesForBackendServerOutput

Description

Contains the output of SetLoadBalancerPoliciesForBackendServer.

Members

SetLoadBalancerPoliciesOfListenerOutput

Description

Contains the output of SetLoadBalancePoliciesOfListener.

Members

SourceSecurityGroup

Description

Information about a source security group.

Members
GroupName
Type: string

The name of the security group.

OwnerAlias
Type: string

The owner of the security group.

SubnetNotFoundException

Description

One or more of the specified subnets do not exist.

Members

Tag

Description

Information about a tag.

Members
Key
Required: Yes
Type: string

The key of the tag.

Value
Type: string

The value of the tag.

TagDescription

Description

The tags associated with a load balancer.

Members
LoadBalancerName
Type: string

The name of the load balancer.

Tags
Type: Array of Tag structures

The tags.

TagKeyOnly

Description

The key of a tag.

Members
Key
Type: string

The name of the key.

TooManyAccessPointsException

Description

The quota for the number of load balancers has been reached.

Members

TooManyPoliciesException

Description

The quota for the number of policies for this load balancer has been reached.

Members

TooManyTagsException

Description

The quota for the number of tags that can be assigned to a load balancer has been reached.

Members

UnsupportedProtocolException

Description

The specified protocol or signature version is not supported.

Members