Skip to content

ElasticLoadBalancingClient#

Index > ElasticLoadBalancing > ElasticLoadBalancingClient

Auto-generated documentation for ElasticLoadBalancing type annotations stubs module mypy-boto3-elb.

ElasticLoadBalancingClient#

Type annotations and code completion for boto3.client("elb"). boto3 documentation

# ElasticLoadBalancingClient usage example

from boto3.session import Session
from mypy_boto3_elb.client import ElasticLoadBalancingClient

def get_elb_client() -> ElasticLoadBalancingClient:
    return Session().client("elb")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("elb").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("elb")

try:
    do_something(client)
except (
    client.exceptions.AccessPointNotFoundException,
    client.exceptions.CertificateNotFoundException,
    client.exceptions.ClientError,
    client.exceptions.DependencyThrottleException,
    client.exceptions.DuplicateAccessPointNameException,
    client.exceptions.DuplicateListenerException,
    client.exceptions.DuplicatePolicyNameException,
    client.exceptions.DuplicateTagKeysException,
    client.exceptions.InvalidConfigurationRequestException,
    client.exceptions.InvalidEndPointException,
    client.exceptions.InvalidSchemeException,
    client.exceptions.InvalidSecurityGroupException,
    client.exceptions.InvalidSubnetException,
    client.exceptions.ListenerNotFoundException,
    client.exceptions.LoadBalancerAttributeNotFoundException,
    client.exceptions.OperationNotPermittedException,
    client.exceptions.PolicyNotFoundException,
    client.exceptions.PolicyTypeNotFoundException,
    client.exceptions.SubnetNotFoundException,
    client.exceptions.TooManyAccessPointsException,
    client.exceptions.TooManyPoliciesException,
    client.exceptions.TooManyTagsException,
    client.exceptions.UnsupportedProtocolException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_elb.client import Exceptions

def handle_error(exc: Exceptions.AccessPointNotFoundException) -> None:
    ...

Methods#

add_tags#

Adds the specified tags to the specified load balancer.

Type annotations and code completion for boto3.client("elb").add_tags method. boto3 documentation

# add_tags method definition

def add_tags(
    self,
    *,
    LoadBalancerNames: Sequence[str],
    Tags: Sequence[TagTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See TagTypeDef
# add_tags method usage example with argument unpacking

kwargs: AddTagsInputRequestTypeDef = {  # (1)
    "LoadBalancerNames": ...,
    "Tags": ...,
}

parent.add_tags(**kwargs)
  1. See AddTagsInputRequestTypeDef

apply_security_groups_to_load_balancer#

Associates one or more security groups with your load balancer in a virtual private cloud (VPC).

Type annotations and code completion for boto3.client("elb").apply_security_groups_to_load_balancer method. boto3 documentation

# apply_security_groups_to_load_balancer method definition

def apply_security_groups_to_load_balancer(
    self,
    *,
    LoadBalancerName: str,
    SecurityGroups: Sequence[str],
) -> ApplySecurityGroupsToLoadBalancerOutputTypeDef:  # (1)
    ...
  1. See ApplySecurityGroupsToLoadBalancerOutputTypeDef
# apply_security_groups_to_load_balancer method usage example with argument unpacking

kwargs: ApplySecurityGroupsToLoadBalancerInputRequestTypeDef = {  # (1)
    "LoadBalancerName": ...,
    "SecurityGroups": ...,
}

parent.apply_security_groups_to_load_balancer(**kwargs)
  1. See ApplySecurityGroupsToLoadBalancerInputRequestTypeDef

attach_load_balancer_to_subnets#

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

Type annotations and code completion for boto3.client("elb").attach_load_balancer_to_subnets method. boto3 documentation

# attach_load_balancer_to_subnets method definition

def attach_load_balancer_to_subnets(
    self,
    *,
    LoadBalancerName: str,
    Subnets: Sequence[str],
) -> AttachLoadBalancerToSubnetsOutputTypeDef:  # (1)
    ...
  1. See AttachLoadBalancerToSubnetsOutputTypeDef
# attach_load_balancer_to_subnets method usage example with argument unpacking

kwargs: AttachLoadBalancerToSubnetsInputRequestTypeDef = {  # (1)
    "LoadBalancerName": ...,
    "Subnets": ...,
}

parent.attach_load_balancer_to_subnets(**kwargs)
  1. See AttachLoadBalancerToSubnetsInputRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("elb").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("elb").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

configure_health_check#

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

Type annotations and code completion for boto3.client("elb").configure_health_check method. boto3 documentation

# configure_health_check method definition

def configure_health_check(
    self,
    *,
    LoadBalancerName: str,
    HealthCheck: HealthCheckTypeDef,  # (1)
) -> ConfigureHealthCheckOutputTypeDef:  # (2)
    ...
  1. See HealthCheckTypeDef
  2. See ConfigureHealthCheckOutputTypeDef
# configure_health_check method usage example with argument unpacking

kwargs: ConfigureHealthCheckInputRequestTypeDef = {  # (1)
    "LoadBalancerName": ...,
    "HealthCheck": ...,
}

parent.configure_health_check(**kwargs)
  1. See ConfigureHealthCheckInputRequestTypeDef

Generates a stickiness policy with sticky session lifetimes that follow that of an application-generated cookie.

Type annotations and code completion for boto3.client("elb").create_app_cookie_stickiness_policy method. boto3 documentation

# create_app_cookie_stickiness_policy method definition

def create_app_cookie_stickiness_policy(
    self,
    *,
    LoadBalancerName: str,
    PolicyName: str,
    CookieName: str,
) -> Dict[str, Any]:
    ...
# create_app_cookie_stickiness_policy method usage example with argument unpacking

kwargs: CreateAppCookieStickinessPolicyInputRequestTypeDef = {  # (1)
    "LoadBalancerName": ...,
    "PolicyName": ...,
    "CookieName": ...,
}

parent.create_app_cookie_stickiness_policy(**kwargs)
  1. See CreateAppCookieStickinessPolicyInputRequestTypeDef

Generates a stickiness policy with sticky session lifetimes controlled by the lifetime of the browser (user-agent) or a specified expiration period.

Type annotations and code completion for boto3.client("elb").create_lb_cookie_stickiness_policy method. boto3 documentation

# create_lb_cookie_stickiness_policy method definition

def create_lb_cookie_stickiness_policy(
    self,
    *,
    LoadBalancerName: str,
    PolicyName: str,
    CookieExpirationPeriod: int = ...,
) -> Dict[str, Any]:
    ...
# create_lb_cookie_stickiness_policy method usage example with argument unpacking

kwargs: CreateLBCookieStickinessPolicyInputRequestTypeDef = {  # (1)
    "LoadBalancerName": ...,
    "PolicyName": ...,
}

parent.create_lb_cookie_stickiness_policy(**kwargs)
  1. See CreateLBCookieStickinessPolicyInputRequestTypeDef

create_load_balancer#

Creates a Classic Load Balancer.

Type annotations and code completion for boto3.client("elb").create_load_balancer method. boto3 documentation

# create_load_balancer method definition

def create_load_balancer(
    self,
    *,
    LoadBalancerName: str,
    Listeners: Sequence[ListenerTypeDef],  # (1)
    AvailabilityZones: Sequence[str] = ...,
    Subnets: Sequence[str] = ...,
    SecurityGroups: Sequence[str] = ...,
    Scheme: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (2)
) -> CreateAccessPointOutputTypeDef:  # (3)
    ...
  1. See ListenerTypeDef
  2. See TagTypeDef
  3. See CreateAccessPointOutputTypeDef
# create_load_balancer method usage example with argument unpacking

kwargs: CreateAccessPointInputRequestTypeDef = {  # (1)
    "LoadBalancerName": ...,
    "Listeners": ...,
}

parent.create_load_balancer(**kwargs)
  1. See CreateAccessPointInputRequestTypeDef

create_load_balancer_listeners#

Creates one or more listeners for the specified load balancer.

Type annotations and code completion for boto3.client("elb").create_load_balancer_listeners method. boto3 documentation

# create_load_balancer_listeners method definition

def create_load_balancer_listeners(
    self,
    *,
    LoadBalancerName: str,
    Listeners: Sequence[ListenerTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See ListenerTypeDef
# create_load_balancer_listeners method usage example with argument unpacking

kwargs: CreateLoadBalancerListenerInputRequestTypeDef = {  # (1)
    "LoadBalancerName": ...,
    "Listeners": ...,
}

parent.create_load_balancer_listeners(**kwargs)
  1. See CreateLoadBalancerListenerInputRequestTypeDef

create_load_balancer_policy#

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

Type annotations and code completion for boto3.client("elb").create_load_balancer_policy method. boto3 documentation

# create_load_balancer_policy method definition

def create_load_balancer_policy(
    self,
    *,
    LoadBalancerName: str,
    PolicyName: str,
    PolicyTypeName: str,
    PolicyAttributes: Sequence[PolicyAttributeTypeDef] = ...,  # (1)
) -> Dict[str, Any]:
    ...
  1. See PolicyAttributeTypeDef
# create_load_balancer_policy method usage example with argument unpacking

kwargs: CreateLoadBalancerPolicyInputRequestTypeDef = {  # (1)
    "LoadBalancerName": ...,
    "PolicyName": ...,
    "PolicyTypeName": ...,
}

parent.create_load_balancer_policy(**kwargs)
  1. See CreateLoadBalancerPolicyInputRequestTypeDef

delete_load_balancer#

Deletes the specified load balancer.

Type annotations and code completion for boto3.client("elb").delete_load_balancer method. boto3 documentation

# delete_load_balancer method definition

def delete_load_balancer(
    self,
    *,
    LoadBalancerName: str,
) -> Dict[str, Any]:
    ...
# delete_load_balancer method usage example with argument unpacking

kwargs: DeleteAccessPointInputRequestTypeDef = {  # (1)
    "LoadBalancerName": ...,
}

parent.delete_load_balancer(**kwargs)
  1. See DeleteAccessPointInputRequestTypeDef

delete_load_balancer_listeners#

Deletes the specified listeners from the specified load balancer.

Type annotations and code completion for boto3.client("elb").delete_load_balancer_listeners method.