Elastic Load Balancing

2014/10/16 - Elastic Load Balancing - 28 new api methods

DeleteLoadBalancerPolicy (new) Link ¶

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

Request Syntax

client.delete_load_balancer_policy(
    LoadBalancerName='string',
    PolicyName='string'
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The mnemonic name associated with the load balancer.

type PolicyName

string

param PolicyName

[REQUIRED]

The mnemonic name for the policy being deleted.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the DeleteLoadBalancerPolicy action.

DeleteLoadBalancer (new) Link ¶

Deletes the specified load balancer.

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

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

Request Syntax

client.delete_load_balancer(
    LoadBalancerName='string'
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name associated with the load balancer.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the DeleteLoadBalancer action.

CreateLoadBalancer (new) Link ¶

Creates a new load balancer.

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

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

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

For information about the AWS regions supported by Elastic Load Balancing, see Regions and Endpoints.

You can create up to 20 load balancers per region per account.

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

Request Syntax

client.create_load_balancer(
    LoadBalancerName='string',
    Listeners=[
        {
            'Protocol': 'string',
            'LoadBalancerPort': 123,
            'InstanceProtocol': 'string',
            'InstancePort': 123,
            'SSLCertificateId': 'string'
        },
    ],
    AvailabilityZones=[
        'string',
    ],
    Subnets=[
        'string',
    ],
    SecurityGroups=[
        'string',
    ],
    Scheme='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

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

type Listeners

list

param Listeners

[REQUIRED]

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

  • (dict) --

    The Listener data type.

    • Protocol (string) -- [REQUIRED]

      Specifies the load balancer transport protocol to use for routing - HTTP, HTTPS, TCP or SSL. This property cannot be modified for the life of the load balancer.

    • LoadBalancerPort (integer) -- [REQUIRED]

      Specifies the external load balancer port number. This property cannot be modified for the life of the load balancer.

    • InstanceProtocol (string) --

      Specifies the protocol to use for routing traffic to back-end instances - HTTP, HTTPS, TCP, or SSL. This property cannot be modified for the life of the load balancer.

    • InstancePort (integer) -- [REQUIRED]

      Specifies the TCP port on which the instance server is listening. This property cannot be modified for the life of the load balancer.

    • SSLCertificateId (string) --

      The ARN string of the server certificate. To get the ARN of the server certificate, call the AWS Identity and Access Management UploadServerCertificate API.

type AvailabilityZones

list

param AvailabilityZones

A list of Availability Zones.

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

You can later add more Availability Zones after the creation of the load balancer by calling EnableAvailabilityZonesForLoadBalancer action.

  • (string) --

type Subnets

list

param Subnets

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

  • (string) --

type SecurityGroups

list

param SecurityGroups

The security groups to assign to your load balancer within your VPC.

  • (string) --

type Scheme

string

param Scheme

The type of a load balancer.

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

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

type Tags

list

param Tags

A list of tags to assign to the load balancer.

For more information about setting tags for your load balancer, see Tagging.

  • (dict) --

    Metadata assigned to a load balancer consisting of key-value pair.

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

    • Key (string) -- [REQUIRED]

      The key of the tag.

    • Value (string) --

      The value of the tag.

rtype

dict

returns

Response Syntax

{
    'DNSName': 'string'
}

Response Structure

  • (dict) --

    The output for the CreateLoadBalancer action.

    • DNSName (string) --

      The DNS name for the load balancer.

DescribeTags (new) Link ¶

Describes the tags associated with one or more load balancers.

Request Syntax

client.describe_tags(
    LoadBalancerNames=[
        'string',
    ]
)
type LoadBalancerNames

list

param LoadBalancerNames

[REQUIRED]

The names of the load balancers.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'TagDescriptions': [
        {
            'LoadBalancerName': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    The output for the DescribeTags action.

    • TagDescriptions (list) --

      A list of tag description structures.

      • (dict) --

        The descriptions of all the tags associated with load balancer.

        • LoadBalancerName (string) --

          The name of the load balancer.

        • Tags (list) --

          List of tags associated with the load balancer.

          • (dict) --

            Metadata assigned to a load balancer consisting of key-value pair.

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

            • Key (string) --

              The key of the tag.

            • Value (string) --

              The value of the tag.

DisableAvailabilityZonesForLoadBalancer (new) Link ¶

Removes the specified EC2 Availability Zones from the set of configured Availability Zones for the load balancer.

There must be at least one Availability Zone registered with a load balancer at all times. Once an Availability Zone is removed, all the instances registered with the load balancer that are in the removed Availability Zone go into the OutOfService state. Upon Availability Zone removal, the load balancer attempts to equally balance the traffic among its remaining usable Availability Zones. Trying to remove an Availability Zone that was not associated with the load balancer does nothing.

For more information, see Disable an Availability Zone from a Load-Balanced Application in the Elastic Load Balancing Developer Guide .

Request Syntax

client.disable_availability_zones_for_load_balancer(
    LoadBalancerName='string',
    AvailabilityZones=[
        'string',
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name associated with the load balancer.

type AvailabilityZones

list

param AvailabilityZones

[REQUIRED]

A list of Availability Zones to be removed from the load balancer.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'AvailabilityZones': [
        'string',
    ]
}

Response Structure

  • (dict) --

    The output for the DisableAvailabilityZonesForLoadBalancer action.

    • AvailabilityZones (list) --

      A list of updated Availability Zones for the load balancer.

      • (string) --

RemoveTags (new) Link ¶

Removes one or more tags from the specified load balancer.

Request Syntax

client.remove_tags(
    LoadBalancerNames=[
        'string',
    ],
    Tags=[
        {
            'Key': 'string'
        },
    ]
)
type LoadBalancerNames

list

param LoadBalancerNames

[REQUIRED]

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

  • (string) --

type Tags

list

param Tags

[REQUIRED]

A list of tag keys to remove.

  • (dict) --

    The key of a tag to be removed.

    • Key (string) --

      The name of the key.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the RemoveTags action.

DescribeLoadBalancerPolicies (new) Link ¶

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

Request Syntax

client.describe_load_balancer_policies(
    LoadBalancerName='string',
    PolicyNames=[
        'string',
    ]
)
type LoadBalancerName

string

param LoadBalancerName

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

type PolicyNames

list

param PolicyNames

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

  • (string) --

rtype

dict

returns

Response Syntax

{
    'PolicyDescriptions': [
        {
            'PolicyName': 'string',
            'PolicyTypeName': 'string',
            'PolicyAttributeDescriptions': [
                {
                    'AttributeName': 'string',
                    'AttributeValue': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    The output for the DescribeLoadBalancerPolicies action.

    • PolicyDescriptions (list) --

      A list of policy description structures.

      • (dict) --

        The PolicyDescription data type.

        • PolicyName (string) --

          The name of the policy associated with the load balancer.

        • PolicyTypeName (string) --

          The name of the policy type associated with the load balancer.

        • PolicyAttributeDescriptions (list) --

          A list of policy attribute description structures.

          • (dict) --

            The PolicyAttributeDescription data type. This data type is used to describe the attributes and values associated with a policy.

            • AttributeName (string) --

              The name of the attribute associated with the policy.

            • AttributeValue (string) --

              The value of the attribute associated with the policy.

DetachLoadBalancerFromSubnets (new) Link ¶

Removes subnets from the set of configured subnets in the Amazon Virtual Private Cloud (Amazon VPC) for the load balancer.

After a subnet is removed all of the EC2 instances registered with the load balancer that are in the removed subnet will go into the OutOfService state. When a subnet is removed, the load balancer will balance the traffic among the remaining routable subnets for the load balancer.

Request Syntax

client.detach_load_balancer_from_subnets(
    LoadBalancerName='string',
    Subnets=[
        'string',
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name associated with the load balancer to be detached.

type Subnets

list

param Subnets

[REQUIRED]

A list of subnet IDs to remove from the set of configured subnets for the load balancer.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'Subnets': [
        'string',
    ]
}

Response Structure

  • (dict) --

    The output for the DetachLoadBalancerFromSubnets action.

    • Subnets (list) --

      A list of subnet IDs the load balancer is now attached to.

      • (string) --

CreateAppCookieStickinessPolicy (new) Link ¶

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 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 Enabling Application-Controlled Session Stickiness in the Elastic Load Balancing Developer Guide .

Request Syntax

client.create_app_cookie_stickiness_policy(
    LoadBalancerName='string',
    PolicyName='string',
    CookieName='string'
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name of the load balancer.

type PolicyName

string

param PolicyName

[REQUIRED]

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

type CookieName

string

param CookieName

[REQUIRED]

Name of the application cookie used for stickiness.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the CreateAppCookieStickinessPolicy action.

DescribeLoadBalancerPolicyTypes (new) Link ¶

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

Request Syntax

client.describe_load_balancer_policy_types(
    PolicyTypeNames=[
        'string',
    ]
)
type PolicyTypeNames

list

param PolicyTypeNames

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

  • (string) --

rtype

dict

returns

Response Syntax

{
    'PolicyTypeDescriptions': [
        {
            'PolicyTypeName': 'string',
            'Description': 'string',
            'PolicyAttributeTypeDescriptions': [
                {
                    'AttributeName': 'string',
                    'AttributeType': 'string',
                    'Description': 'string',
                    'DefaultValue': 'string',
                    'Cardinality': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    The output for the DescribeLoadBalancerPolicyTypes action.

    • PolicyTypeDescriptions (list) --

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

      • (dict) --

        The PolicyTypeDescription data type.

        • PolicyTypeName (string) --

          The name of the policy type.

        • Description (string) --

          A human-readable description of the policy type.

        • PolicyAttributeTypeDescriptions (list) --

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

          • (dict) --

            The PolicyAttributeTypeDescription data type. This data type is used to describe values that are acceptable for the policy attribute.

            • AttributeName (string) --

              The name of the attribute associated with the policy type.

            • AttributeType (string) --

              The type of attribute. For example, Boolean, Integer, etc.

            • Description (string) --

              A human-readable description of the attribute.

            • DefaultValue (string) --

              The default value of the attribute, if applicable.

            • Cardinality (string) --

              The cardinality of the attribute. Valid Values:

              • ONE(1) : Single value required

              • ZERO_OR_ONE(0..1) : Up to one value can be supplied

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

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

SetLoadBalancerPoliciesForBackendServer (new) Link ¶

Replaces the current set of policies associated with a port on which the back-end server is listening with a new set of policies. After the policies have been created using CreateLoadBalancerPolicy, they can be applied here as a list. At this time, only the back-end server authentication policy type can be applied to the back-end ports; this policy type is composed of multiple public key policies.

You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies action to verify that the policy has been associated with the back-end server.

Request Syntax

client.set_load_balancer_policies_for_backend_server(
    LoadBalancerName='string',
    InstancePort=123,
    PolicyNames=[
        'string',
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

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

type InstancePort

integer

param InstancePort

[REQUIRED]

The port number associated with the back-end server.

type PolicyNames

list

param PolicyNames

[REQUIRED]

List of policy names to be set. If the list is empty, then all current polices are removed from the back-end server.

  • (string) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the SetLoadBalancerPoliciesForBackendServer action.

CreateLoadBalancerPolicy (new) Link ¶

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

Request Syntax

client.create_load_balancer_policy(
    LoadBalancerName='string',
    PolicyName='string',
    PolicyTypeName='string',
    PolicyAttributes=[
        {
            'AttributeName': 'string',
            'AttributeValue': 'string'
        },
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

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

type PolicyName

string

param PolicyName

[REQUIRED]

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

type PolicyTypeName

string

param PolicyTypeName

[REQUIRED]

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

type PolicyAttributes

list

param PolicyAttributes

A list of attributes associated with the policy being created.

  • (dict) --

    The PolicyAttribute data type. This data type contains a key/value pair that defines properties of a specific policy.

    • AttributeName (string) --

      The name of the attribute associated with the policy.

    • AttributeValue (string) --

      The value of the attribute associated with the policy.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the CreateLoadBalancerPolicy action.

CreateLBCookieStickinessPolicy (new) Link ¶

Generates a stickiness policy with sticky session lifetimes controlled by the lifetime of the browser (user-agent) or a specified expiration period. This policy can be associated only with HTTP/HTTPS listeners.

When a load balancer implements this policy, the load balancer uses a special cookie to track the backend server instance for each request. When the load balancer receives a request, it first checks to see if this cookie is present in the request. If so, the load balancer sends the request to the application server specified in the cookie. If not, the load balancer sends the request to a server that is chosen based on the existing load balancing algorithm.

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

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

Request Syntax

client.create_lb_cookie_stickiness_policy(
    LoadBalancerName='string',
    PolicyName='string',
    CookieExpirationPeriod=123
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name associated with the load balancer.

type PolicyName

string

param PolicyName

[REQUIRED]

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

type CookieExpirationPeriod

integer

param CookieExpirationPeriod

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

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the CreateLBCookieStickinessPolicy action.

ConfigureHealthCheck (new) Link ¶

Specifies the health check settings to use for evaluating the health state of your back-end instances.

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

Request Syntax

client.configure_health_check(
    LoadBalancerName='string',
    HealthCheck={
        'Target': 'string',
        'Interval': 123,
        'Timeout': 123,
        'UnhealthyThreshold': 123,
        'HealthyThreshold': 123
    }
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

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

type HealthCheck

dict

param HealthCheck

[REQUIRED]

A structure containing the configuration information for the new healthcheck.

  • Target (string) -- [REQUIRED]

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

  • Interval (integer) -- [REQUIRED]

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

  • Timeout (integer) -- [REQUIRED]

    Specifies the amount of time, in seconds, during which no response means a failed health probe.

  • UnhealthyThreshold (integer) -- [REQUIRED]

    Specifies the number of consecutive health probe failures required before moving the instance to the Unhealthy state.

  • HealthyThreshold (integer) -- [REQUIRED]

    Specifies the number of consecutive health probe successes required before moving the instance to the Healthy state.

rtype

dict

returns

Response Syntax

{
    'HealthCheck': {
        'Target': 'string',
        'Interval': 123,
        'Timeout': 123,
        'UnhealthyThreshold': 123,
        'HealthyThreshold': 123
    }
}

Response Structure

  • (dict) --

    The output for the ConfigureHealthCheck action.

    • HealthCheck (dict) --

      The updated healthcheck for the instances.

      • Target (string) --

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

      • Interval (integer) --

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

      • Timeout (integer) --

        Specifies the amount of time, in seconds, during which no response means a failed health probe.

      • UnhealthyThreshold (integer) --

        Specifies the number of consecutive health probe failures required before moving the instance to the Unhealthy state.

      • HealthyThreshold (integer) --

        Specifies the number of consecutive health probe successes required before moving the instance to the Healthy state.

CreateLoadBalancerListeners (new) Link ¶

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

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

Request Syntax

client.create_load_balancer_listeners(
    LoadBalancerName='string',
    Listeners=[
        {
            'Protocol': 'string',
            'LoadBalancerPort': 123,
            'InstanceProtocol': 'string',
            'InstancePort': 123,
            'SSLCertificateId': 'string'
        },
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name of the load balancer.

type Listeners

list

param Listeners

[REQUIRED]

A list of LoadBalancerPort , InstancePort , Protocol , InstanceProtocol , and SSLCertificateId items.

  • (dict) --

    The Listener data type.

    • Protocol (string) -- [REQUIRED]

      Specifies the load balancer transport protocol to use for routing - HTTP, HTTPS, TCP or SSL. This property cannot be modified for the life of the load balancer.

    • LoadBalancerPort (integer) -- [REQUIRED]

      Specifies the external load balancer port number. This property cannot be modified for the life of the load balancer.

    • InstanceProtocol (string) --

      Specifies the protocol to use for routing traffic to back-end instances - HTTP, HTTPS, TCP, or SSL. This property cannot be modified for the life of the load balancer.

    • InstancePort (integer) -- [REQUIRED]

      Specifies the TCP port on which the instance server is listening. This property cannot be modified for the life of the load balancer.

    • SSLCertificateId (string) --

      The ARN string of the server certificate. To get the ARN of the server certificate, call the AWS Identity and Access Management UploadServerCertificate API.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the CreateLoadBalancerListeners action.

DeleteLoadBalancerListeners (new) Link ¶

Deletes listeners from the load balancer for the specified port.

Request Syntax

client.delete_load_balancer_listeners(
    LoadBalancerName='string',
    LoadBalancerPorts=[
        123,
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The mnemonic name associated with the load balancer.

type LoadBalancerPorts

list

param LoadBalancerPorts

[REQUIRED]

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

  • (integer) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the DeleteLoadBalancerListeners action.

DescribeInstanceHealth (new) Link ¶

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

Request Syntax

client.describe_instance_health(
    LoadBalancerName='string',
    Instances=[
        {
            'InstanceId': 'string'
        },
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name of the load balancer.

type Instances

list

param Instances

A list of instance IDs whose states are being queried.

  • (dict) --

    The Instance data type.

    • InstanceId (string) --

      Provides an EC2 instance ID.

rtype

dict

returns

Response Syntax

{
    'InstanceStates': [
        {
            'InstanceId': 'string',
            'State': 'string',
            'ReasonCode': 'string',
            'Description': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    The output for the DescribeInstanceHealth action.

    • InstanceStates (list) --

      A list containing health information for the specified instances.

      • (dict) --

        The InstanceState data type.

        • InstanceId (string) --

          Provides an EC2 instance ID.

        • State (string) --

          Specifies the current state of the instance.

          Valid value: InService | OutOfService | Unknown

        • ReasonCode (string) --

          Provides information about the cause of OutOfService instances. Specifically, it indicates whether the cause is Elastic Load Balancing or the instance behind the load balancer.

          Valid value: ELB | Instance | N/A

        • Description (string) --

          Provides a description of the instance state.

AddTags (new) Link ¶

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

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

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

Request Syntax

client.add_tags(
    LoadBalancerNames=[
        'string',
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type LoadBalancerNames

list

param LoadBalancerNames

[REQUIRED]

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

  • (string) --

type Tags

list

param Tags

[REQUIRED]

A list of tags for each load balancer.

  • (dict) --

    Metadata assigned to a load balancer consisting of key-value pair.

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

    • Key (string) -- [REQUIRED]

      The key of the tag.

    • Value (string) --

      The value of the tag.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) -- The output for the AddTags action.

DescribeLoadBalancers (new) Link ¶

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

Request Syntax

client.describe_load_balancers(
    LoadBalancerNames=[
        'string',
    ],
    Marker='string',
    PageSize=123
)
type LoadBalancerNames

list

param LoadBalancerNames

A list of load balancer names associated with the account.

  • (string) --

type Marker

string

param Marker

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

type PageSize

integer

param PageSize

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

rtype

dict

returns

Response Syntax

{
    'LoadBalancerDescriptions': [
        {
            'LoadBalancerName': 'string',
            'DNSName': 'string',
            'CanonicalHostedZoneName': 'string',
            'CanonicalHostedZoneNameID': 'string',
            'ListenerDescriptions': [
                {
                    'Listener': {
                        'Protocol': 'string',
                        'LoadBalancerPort': 123,
                        'InstanceProtocol': 'string',
                        'InstancePort': 123,
                        'SSLCertificateId': 'string'
                    },
                    'PolicyNames': [
                        'string',
                    ]
                },
            ],
            'Policies': {
                'AppCookieStickinessPolicies': [
                    {
                        'PolicyName': 'string',
                        'CookieName': 'string'
                    },
                ],
                'LBCookieStickinessPolicies': [
                    {
                        'PolicyName': 'string',
                        'CookieExpirationPeriod': 123
                    },
                ],
                'OtherPolicies': [
                    'string',
                ]
            },
            'BackendServerDescriptions': [
                {
                    'InstancePort': 123,
                    'PolicyNames': [
                        'string',
                    ]
                },
            ],
            'AvailabilityZones': [
                'string',
            ],
            'Subnets': [
                'string',
            ],
            'VPCId': 'string',
            'Instances': [
                {
                    'InstanceId': 'string'
                },
            ],
            'HealthCheck': {
                'Target': 'string',
                'Interval': 123,
                'Timeout': 123,
                'UnhealthyThreshold': 123,
                'HealthyThreshold': 123
            },
            'SourceSecurityGroup': {
                'OwnerAlias': 'string',
                'GroupName': 'string'
            },
            'SecurityGroups': [
                'string',
            ],
            'CreatedTime': datetime(2015, 1, 1),
            'Scheme': 'string'
        },
    ],
    'NextMarker': 'string'
}

Response Structure

  • (dict) --

    The output for the DescribeLoadBalancers action.

    • LoadBalancerDescriptions (list) --

      A list of load balancer description structures.

      • (dict) --

        Contains the result of a successful invocation of DescribeLoadBalancers.

        • LoadBalancerName (string) --

          Specifies the name associated with the load balancer.

        • DNSName (string) --

          Specifies the external DNS name associated with the load balancer.

        • CanonicalHostedZoneName (string) --

          Provides the name of the Amazon Route 53 hosted zone that is associated with the load balancer. For information on how to associate your load balancer with a hosted zone, go to Using Domain Names With Elastic Load Balancing in the Elastic Load Balancing Developer Guide .

        • CanonicalHostedZoneNameID (string) --

          Provides the ID of the Amazon Route 53 hosted zone name that is associated with the load balancer. For information on how to associate or disassociate your load balancer with a hosted zone, go to Using Domain Names With Elastic Load Balancing in the Elastic Load Balancing Developer Guide .

        • ListenerDescriptions (list) --

          LoadBalancerPort, InstancePort, Protocol, InstanceProtocol, and PolicyNames are returned in a list of tuples in the ListenerDescriptions element.

          • (dict) --

            The ListenerDescription data type.

            • Listener (dict) --

              The Listener data type.

              • Protocol (string) --

                Specifies the load balancer transport protocol to use for routing - HTTP, HTTPS, TCP or SSL. This property cannot be modified for the life of the load balancer.

              • LoadBalancerPort (integer) --

                Specifies the external load balancer port number. This property cannot be modified for the life of the load balancer.

              • InstanceProtocol (string) --

                Specifies the protocol to use for routing traffic to back-end instances - HTTP, HTTPS, TCP, or SSL. This property cannot be modified for the life of the load balancer.

              • InstancePort (integer) --

                Specifies the TCP port on which the instance server is listening. This property cannot be modified for the life of the load balancer.

              • SSLCertificateId (string) --

                The ARN string of the server certificate. To get the ARN of the server certificate, call the AWS Identity and Access Management UploadServerCertificate API.

            • PolicyNames (list) --

              A list of policies enabled for this listener. An empty list indicates that no policies are enabled.

              • (string) --

        • Policies (dict) --

          Provides a list of policies defined for the load balancer.

          • AppCookieStickinessPolicies (list) --

            A list of the AppCookieStickinessPolicy objects created with CreateAppCookieStickinessPolicy.

            • (dict) --

              The AppCookieStickinessPolicy data type.

              • PolicyName (string) --

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

              • CookieName (string) --

                The name of the application cookie used for stickiness.

          • LBCookieStickinessPolicies (list) --

            A list of LBCookieStickinessPolicy objects created with CreateAppCookieStickinessPolicy.

            • (dict) --

              The LBCookieStickinessPolicy data type.

              • PolicyName (string) --

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

              • CookieExpirationPeriod (integer) --

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

          • OtherPolicies (list) --

            A list of policy names other than the stickiness policies.

            • (string) --

        • BackendServerDescriptions (list) --

          Contains a list of back-end server descriptions.

          • (dict) --

            This data type is used as a response element in the DescribeLoadBalancers action to describe the configuration of the back-end server.

            • InstancePort (integer) --

              Provides the port on which the back-end server is listening.

            • PolicyNames (list) --

              Provides a list of policy names enabled for the back-end server.

              • (string) --

        • AvailabilityZones (list) --

          Specifies a list of Availability Zones.

          • (string) --

        • Subnets (list) --

          Provides a list of VPC subnet IDs for the load balancer.

          • (string) --

        • VPCId (string) --

          Provides the ID of the VPC attached to the load balancer.

        • Instances (list) --

          Provides a list of EC2 instance IDs for the load balancer.

          • (dict) --

            The Instance data type.

            • InstanceId (string) --

              Provides an EC2 instance ID.

        • HealthCheck (dict) --

          Specifies information regarding the various health probes conducted on the load balancer.

          • Target (string) --

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

          • Interval (integer) --

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

          • Timeout (integer) --

            Specifies the amount of time, in seconds, during which no response means a failed health probe.

          • UnhealthyThreshold (integer) --

            Specifies the number of consecutive health probe failures required before moving the instance to the Unhealthy state.

          • HealthyThreshold (integer) --

            Specifies the number of consecutive health probe successes required before moving the instance to the Healthy state.

        • SourceSecurityGroup (dict) --

          The security group that you can use as part of your inbound rules for your load balancer's back-end Amazon EC2 application instances. To only allow traffic from load balancers, add a security group rule to your back end instance that specifies this source security group as the inbound source.

          • OwnerAlias (string) --

            Owner of the source security group. Use this value for the --source-group-user parameter of the ec2-authorize command in the Amazon EC2 command line tool.

          • GroupName (string) --

            Name of the source security group. Use this value for the --source-group parameter of the ec2-authorize command in the Amazon EC2 command line tool.

        • SecurityGroups (list) --

          The security groups the load balancer is a member of (VPC only).

          • (string) --

        • CreatedTime (datetime) --

          Provides the date and time the load balancer was created.

        • Scheme (string) --

          Specifies the type of load balancer.

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

          If the Scheme is internal , the load balancer has a publicly resolvable DNS name that resolves to private IP addresses.

          This option is only available for load balancers attached to an Amazon VPC.

    • NextMarker (string) --

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

DescribeLoadBalancerAttributes (new) Link ¶

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

Request Syntax

client.describe_load_balancer_attributes(
    LoadBalancerName='string'
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name of the load balancer.

rtype

dict

returns

Response Syntax

{
    'LoadBalancerAttributes': {
        'CrossZoneLoadBalancing': {
            'Enabled': True|False
        },
        'AccessLog': {
            'Enabled': True|False,
            'S3BucketName': 'string',
            'EmitInterval': 123,
            'S3BucketPrefix': 'string'
        },
        'ConnectionDraining': {
            'Enabled': True|False,
            'Timeout': 123
        },
        'ConnectionSettings': {
            'IdleTimeout': 123
        }
    }
}

Response Structure

  • (dict) --

    The following element is returned in a structure named DescribeLoadBalancerAttributesResult .

    • LoadBalancerAttributes (dict) --

      The load balancer attributes structure.

      • CrossZoneLoadBalancing (dict) --

        The name of the load balancer attribute. If enabled, the load balancer routes the request traffic evenly across all back-end instances regardless of the Availability Zones.

        For more information, see Enable Cross-Zone Load Balancing.

        • Enabled (boolean) --

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

      • AccessLog (dict) --

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

        For more information, see Enable Access Logs.

        • Enabled (boolean) --

          Specifies whether access log is enabled for the load balancer.

        • S3BucketName (string) --

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

        • EmitInterval (integer) --

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

          Default: 60 minutes

        • S3BucketPrefix (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.

      • ConnectionDraining (dict) --

        The name of the load balancer attribute. If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy back-end instance.

        For more information, see Enable Connection Draining.

        • Enabled (boolean) --

          Specifies whether connection draining is enabled for the load balancer.

        • Timeout (integer) --

          Specifies the maximum time (in seconds) to keep the existing connections open before deregistering the instances.

      • ConnectionSettings (dict) --

        The name of the load balancer attribute.

        By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. If the ConnectionSettings attribute is set, Elastic Load Balancing will allow the connections to remain idle (no data is sent over the connection) for the specified duration.

        For more information, see Configure Idle Connection Timeout.

        • IdleTimeout (integer) --

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

SetLoadBalancerListenerSSLCertificate (new) Link ¶

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 on updating your SSL certificate, see Updating an SSL Certificate for a Load Balancer in the Elastic Load Balancing Developer Guide .

Request Syntax

client.set_load_balancer_listener_ssl_certificate(
    LoadBalancerName='string',
    LoadBalancerPort=123,
    SSLCertificateId='string'
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name of the load balancer.

type LoadBalancerPort

integer

param LoadBalancerPort

[REQUIRED]

The port that uses the specified SSL certificate.

type SSLCertificateId

string

param SSLCertificateId

[REQUIRED]

The Amazon Resource Number (ARN) of the SSL certificate chain to use. For more information on SSL certificates, see Managing Server Certificates in the AWS Identity and Access Management User Guide .

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the SetLoadBalancerListenerSSLCertificate action.

EnableAvailabilityZonesForLoadBalancer (new) Link ¶

Adds one or more EC2 Availability Zones to the load balancer.

The load balancer evenly distributes requests across all its registered Availability Zones that contain instances.

For more information, see Expand a Load Balanced Application to an Additional Availability Zone in the Elastic Load Balancing Developer Guide .

Request Syntax

client.enable_availability_zones_for_load_balancer(
    LoadBalancerName='string',
    AvailabilityZones=[
        'string',
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name associated with the load balancer.

type AvailabilityZones

list

param AvailabilityZones

[REQUIRED]

A list of new Availability Zones for the load balancer. Each Availability Zone must be in the same region as the load balancer.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'AvailabilityZones': [
        'string',
    ]
}

Response Structure

  • (dict) --

    The output for the EnableAvailabilityZonesForLoadBalancer action.

    • AvailabilityZones (list) --

      An updated list of Availability Zones for the load balancer.

      • (string) --

SetLoadBalancerPoliciesOfListener (new) Link ¶

Associates, updates, or disables a policy with a listener on the load balancer. You can associate multiple policies with a listener.

Request Syntax

client.set_load_balancer_policies_of_listener(
    LoadBalancerName='string',
    LoadBalancerPort=123,
    PolicyNames=[
        'string',
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name of the load balancer.

type LoadBalancerPort

integer

param LoadBalancerPort

[REQUIRED]

The external port of the load balancer to associate the policy.

type PolicyNames

list

param PolicyNames

[REQUIRED]

List of policies to be associated with the listener. If the list is empty, the current policy is removed from the listener.

  • (string) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the SetLoadBalancerPoliciesOfListener action.

AttachLoadBalancerToSubnets (new) Link ¶

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

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

Request Syntax

client.attach_load_balancer_to_subnets(
    LoadBalancerName='string',
    Subnets=[
        'string',
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

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

type Subnets

list

param Subnets

[REQUIRED]

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

  • (string) --

rtype

dict

returns

Response Syntax

{
    'Subnets': [
        'string',
    ]
}

Response Structure

  • (dict) --

    The output for the AttachLoadBalancerToSubnets action.

    • Subnets (list) --

      A list of subnet IDs attached to the load balancer.

      • (string) --

ModifyLoadBalancerAttributes (new) Link ¶

Modifies the attributes of a 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:

Request Syntax

client.modify_load_balancer_attributes(
    LoadBalancerName='string',
    LoadBalancerAttributes={
        'CrossZoneLoadBalancing': {
            'Enabled': True|False
        },
        'AccessLog': {
            'Enabled': True|False,
            'S3BucketName': 'string',
            'EmitInterval': 123,
            'S3BucketPrefix': 'string'
        },
        'ConnectionDraining': {
            'Enabled': True|False,
            'Timeout': 123
        },
        'ConnectionSettings': {
            'IdleTimeout': 123
        }
    }
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name of the load balancer.

type LoadBalancerAttributes

dict

param LoadBalancerAttributes

[REQUIRED]

Attributes of the load balancer.

  • CrossZoneLoadBalancing (dict) --

    The name of the load balancer attribute. If enabled, the load balancer routes the request traffic evenly across all back-end instances regardless of the Availability Zones.

    For more information, see Enable Cross-Zone Load Balancing.

    • Enabled (boolean) -- [REQUIRED]

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

  • AccessLog (dict) --

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

    For more information, see Enable Access Logs.

    • Enabled (boolean) -- [REQUIRED]

      Specifies whether access log is enabled for the load balancer.

    • S3BucketName (string) --

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

    • EmitInterval (integer) --

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

      Default: 60 minutes

    • S3BucketPrefix (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.

  • ConnectionDraining (dict) --

    The name of the load balancer attribute. If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy back-end instance.

    For more information, see Enable Connection Draining.

    • Enabled (boolean) -- [REQUIRED]

      Specifies whether connection draining is enabled for the load balancer.

    • Timeout (integer) --

      Specifies the maximum time (in seconds) to keep the existing connections open before deregistering the instances.

  • ConnectionSettings (dict) --

    The name of the load balancer attribute.

    By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. If the ConnectionSettings attribute is set, Elastic Load Balancing will allow the connections to remain idle (no data is sent over the connection) for the specified duration.

    For more information, see Configure Idle Connection Timeout.

    • IdleTimeout (integer) -- [REQUIRED]

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

rtype

dict

returns

Response Syntax

{
    'LoadBalancerName': 'string',
    'LoadBalancerAttributes': {
        'CrossZoneLoadBalancing': {
            'Enabled': True|False
        },
        'AccessLog': {
            'Enabled': True|False,
            'S3BucketName': 'string',
            'EmitInterval': 123,
            'S3BucketPrefix': 'string'
        },
        'ConnectionDraining': {
            'Enabled': True|False,
            'Timeout': 123
        },
        'ConnectionSettings': {
            'IdleTimeout': 123
        }
    }
}

Response Structure

  • (dict) --

    The output for the ModifyLoadBalancerAttributes action.

    • LoadBalancerName (string) --

      The name of the load balancer.

    • LoadBalancerAttributes (dict) --

      The LoadBalancerAttributes data type.

      • CrossZoneLoadBalancing (dict) --

        The name of the load balancer attribute. If enabled, the load balancer routes the request traffic evenly across all back-end instances regardless of the Availability Zones.

        For more information, see Enable Cross-Zone Load Balancing.

        • Enabled (boolean) --

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

      • AccessLog (dict) --

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

        For more information, see Enable Access Logs.

        • Enabled (boolean) --

          Specifies whether access log is enabled for the load balancer.

        • S3BucketName (string) --

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

        • EmitInterval (integer) --

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

          Default: 60 minutes

        • S3BucketPrefix (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.

      • ConnectionDraining (dict) --

        The name of the load balancer attribute. If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy back-end instance.

        For more information, see Enable Connection Draining.

        • Enabled (boolean) --

          Specifies whether connection draining is enabled for the load balancer.

        • Timeout (integer) --

          Specifies the maximum time (in seconds) to keep the existing connections open before deregistering the instances.

      • ConnectionSettings (dict) --

        The name of the load balancer attribute.

        By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. If the ConnectionSettings attribute is set, Elastic Load Balancing will allow the connections to remain idle (no data is sent over the connection) for the specified duration.

        For more information, see Configure Idle Connection Timeout.

        • IdleTimeout (integer) --

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

DeregisterInstancesFromLoadBalancer (new) Link ¶

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

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

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

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

Request Syntax

client.deregister_instances_from_load_balancer(
    LoadBalancerName='string',
    Instances=[
        {
            'InstanceId': 'string'
        },
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

The name associated with the load balancer.

type Instances

list

param Instances

[REQUIRED]

A list of EC2 instance IDs consisting of all instances to be deregistered.

  • (dict) --

    The Instance data type.

    • InstanceId (string) --

      Provides an EC2 instance ID.

rtype

dict

returns

Response Syntax

{
    'Instances': [
        {
            'InstanceId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    The output for the DeregisterInstancesFromLoadBalancer action.

    • Instances (list) --

      An updated list of remaining instances registered with the load balancer.

      • (dict) --

        The Instance data type.

        • InstanceId (string) --

          Provides an EC2 instance ID.

ApplySecurityGroupsToLoadBalancer (new) Link ¶

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

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

Request Syntax

client.apply_security_groups_to_load_balancer(
    LoadBalancerName='string',
    SecurityGroups=[
        'string',
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

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

type SecurityGroups

list

param SecurityGroups

[REQUIRED]

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

  • (string) --

rtype

dict

returns

Response Syntax

{
    'SecurityGroups': [
        'string',
    ]
}

Response Structure

  • (dict) --

    The out for the ApplySecurityGroupsToLoadBalancer action.

    • SecurityGroups (list) --

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

      • (string) --

RegisterInstancesWithLoadBalancer (new) Link ¶

Adds new instances to the load balancer.

Once the instance is registered, it starts receiving traffic and requests from the load balancer. Any instance that is not in any of the Availability Zones registered for the load balancer will be moved to the OutOfService state. It will move to the InService state when the Availability Zone is added to the load balancer.

When an instance registered with a load balancer is stopped and then restarted, the IP addresses associated with the instance changes. Elastic Load Balancing cannot recognize the new IP address, which prevents it from routing traffic to the instances. We recommend that you de-register your Amazon EC2 instances from your load balancer after you stop your instance, and then register the load balancer with your instance after you've restarted. To de-register your instances from load balancer, use DeregisterInstancesFromLoadBalancer action.

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

You can use DescribeLoadBalancers or DescribeInstanceHealth action to check the state of the newly registered instances.

Request Syntax

client.register_instances_with_load_balancer(
    LoadBalancerName='string',
    Instances=[
        {
            'InstanceId': 'string'
        },
    ]
)
type LoadBalancerName

string

param LoadBalancerName

[REQUIRED]

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

type Instances

list

param Instances

[REQUIRED]

A list of instance IDs that should be registered with the load balancer.

  • (dict) --

    The Instance data type.

    • InstanceId (string) --

      Provides an EC2 instance ID.

rtype

dict

returns

Response Syntax

{
    'Instances': [
        {
            'InstanceId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    The output for the RegisterInstancesWithLoadBalancer action.

    • Instances (list) --

      An updated list of instances for the load balancer.

      • (dict) --

        The Instance data type.

        • InstanceId (string) --

          Provides an EC2 instance ID.