Skip to content

ElasticLoadBalancingv2Client#

Index > ElasticLoadBalancingv2 > ElasticLoadBalancingv2Client

Auto-generated documentation for ElasticLoadBalancingv2 type annotations stubs module mypy-boto3-elbv2.

ElasticLoadBalancingv2Client#

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

# ElasticLoadBalancingv2Client usage example

from boto3.session import Session
from mypy_boto3_elbv2.client import ElasticLoadBalancingv2Client

def get_elbv2_client() -> ElasticLoadBalancingv2Client:
    return Session().client("elbv2")

Exceptions#

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

# Exceptions.exceptions usage example

client = boto3.client("elbv2")

try:
    do_something(client)
except (
    client.exceptions.ALPNPolicyNotSupportedException,
    client.exceptions.AllocationIdNotFoundException,
    client.exceptions.AvailabilityZoneNotSupportedException,
    client.exceptions.CaCertificatesBundleNotFoundException,
    client.exceptions.CertificateNotFoundException,
    client.exceptions.ClientError,
    client.exceptions.DuplicateListenerException,
    client.exceptions.DuplicateLoadBalancerNameException,
    client.exceptions.DuplicateTagKeysException,
    client.exceptions.DuplicateTargetGroupNameException,
    client.exceptions.DuplicateTrustStoreNameException,
    client.exceptions.HealthUnavailableException,
    client.exceptions.IncompatibleProtocolsException,
    client.exceptions.InvalidCaCertificatesBundleException,
    client.exceptions.InvalidConfigurationRequestException,
    client.exceptions.InvalidLoadBalancerActionException,
    client.exceptions.InvalidRevocationContentException,
    client.exceptions.InvalidSchemeException,
    client.exceptions.InvalidSecurityGroupException,
    client.exceptions.InvalidSubnetException,
    client.exceptions.InvalidTargetException,
    client.exceptions.ListenerNotFoundException,
    client.exceptions.LoadBalancerNotFoundException,
    client.exceptions.OperationNotPermittedException,
    client.exceptions.PriorityInUseException,
    client.exceptions.ResourceInUseException,
    client.exceptions.RevocationContentNotFoundException,
    client.exceptions.RevocationIdNotFoundException,
    client.exceptions.RuleNotFoundException,
    client.exceptions.SSLPolicyNotFoundException,
    client.exceptions.SubnetNotFoundException,
    client.exceptions.TargetGroupAssociationLimitException,
    client.exceptions.TargetGroupNotFoundException,
    client.exceptions.TooManyActionsException,
    client.exceptions.TooManyCertificatesException,
    client.exceptions.TooManyListenersException,
    client.exceptions.TooManyLoadBalancersException,
    client.exceptions.TooManyRegistrationsForTargetIdException,
    client.exceptions.TooManyRulesException,
    client.exceptions.TooManyTagsException,
    client.exceptions.TooManyTargetGroupsException,
    client.exceptions.TooManyTargetsException,
    client.exceptions.TooManyTrustStoreRevocationEntriesException,
    client.exceptions.TooManyTrustStoresException,
    client.exceptions.TooManyUniqueTargetGroupsPerLoadBalancerException,
    client.exceptions.TrustStoreInUseException,
    client.exceptions.TrustStoreNotFoundException,
    client.exceptions.TrustStoreNotReadyException,
    client.exceptions.UnsupportedProtocolException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_elbv2.client import Exceptions

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

Methods#

add_listener_certificates#

Adds the specified SSL server certificate to the certificate list for the specified HTTPS or TLS listener.

Type annotations and code completion for boto3.client("elbv2").add_listener_certificates method. boto3 documentation

# add_listener_certificates method definition

def add_listener_certificates(
    self,
    *,
    ListenerArn: str,
    Certificates: Sequence[CertificateTypeDef],  # (1)
) -> AddListenerCertificatesOutputTypeDef:  # (2)
    ...
  1. See CertificateTypeDef
  2. See AddListenerCertificatesOutputTypeDef
# add_listener_certificates method usage example with argument unpacking

kwargs: AddListenerCertificatesInputRequestTypeDef = {  # (1)
    "ListenerArn": ...,
    "Certificates": ...,
}

parent.add_listener_certificates(**kwargs)
  1. See AddListenerCertificatesInputRequestTypeDef

add_tags#

Adds the specified tags to the specified Elastic Load Balancing resource.

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

# add_tags method definition

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

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

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

add_trust_store_revocations#

Adds the specified revocation file to the specified trust store.

Type annotations and code completion for boto3.client("elbv2").add_trust_store_revocations method. boto3 documentation

# add_trust_store_revocations method definition

def add_trust_store_revocations(
    self,
    *,
    TrustStoreArn: str,
    RevocationContents: Sequence[RevocationContentTypeDef] = ...,  # (1)
) -> AddTrustStoreRevocationsOutputTypeDef:  # (2)
    ...
  1. See RevocationContentTypeDef
  2. See AddTrustStoreRevocationsOutputTypeDef
# add_trust_store_revocations method usage example with argument unpacking

kwargs: AddTrustStoreRevocationsInputRequestTypeDef = {  # (1)
    "TrustStoreArn": ...,
}

parent.add_trust_store_revocations(**kwargs)
  1. See AddTrustStoreRevocationsInputRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("elbv2").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("elbv2").close method. boto3 documentation

# close method definition

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

create_listener#

Creates a listener for the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.

Type annotations and code completion for boto3.client("elbv2").create_listener method. boto3 documentation

# create_listener method definition

def create_listener(
    self,
    *,
    LoadBalancerArn: str,
    DefaultActions: Sequence[ActionTypeDef],  # (1)
    Protocol: ProtocolEnumType = ...,  # (2)
    Port: int = ...,
    SslPolicy: str = ...,
    Certificates: Sequence[CertificateTypeDef] = ...,  # (3)
    AlpnPolicy: Sequence[str] = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (4)
    MutualAuthentication: MutualAuthenticationAttributesTypeDef = ...,  # (5)
) -> CreateListenerOutputTypeDef:  # (6)
    ...
  1. See ActionTypeDef
  2. See ProtocolEnumType
  3. See CertificateTypeDef
  4. See TagTypeDef
  5. See MutualAuthenticationAttributesTypeDef
  6. See CreateListenerOutputTypeDef
# create_listener method usage example with argument unpacking

kwargs: CreateListenerInputRequestTypeDef = {  # (1)
    "LoadBalancerArn": ...,
    "DefaultActions": ...,
}

parent.create_listener(**kwargs)
  1. See CreateListenerInputRequestTypeDef

create_load_balancer#

Creates an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.

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

# create_load_balancer method definition

def create_load_balancer(
    self,
    *,
    Name: str,
    Subnets: Sequence[str] = ...,
    SubnetMappings: Sequence[SubnetMappingTypeDef] = ...,  # (1)
    SecurityGroups: Sequence[str] = ...,
    Scheme: LoadBalancerSchemeEnumType = ...,  # (2)
    Tags: Sequence[TagTypeDef] = ...,  # (3)
    Type: LoadBalancerTypeEnumType = ...,  # (4)
    IpAddressType: IpAddressTypeType = ...,  # (5)
    CustomerOwnedIpv4Pool: str = ...,
) -> CreateLoadBalancerOutputTypeDef:  # (6)
    ...
  1. See SubnetMappingTypeDef
  2. See LoadBalancerSchemeEnumType
  3. See TagTypeDef
  4. See LoadBalancerTypeEnumType
  5. See IpAddressTypeType
  6. See CreateLoadBalancerOutputTypeDef
# create_load_balancer method usage example with argument unpacking

kwargs: CreateLoadBalancerInputRequestTypeDef = {  # (1)
    "Name": ...,
}

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

create_rule#

Creates a rule for the specified listener.

Type annotations and code completion for boto3.client("elbv2").create_rule method. boto3 documentation

# create_rule method definition

def create_rule(
    self,
    *,
    ListenerArn: str,
    Conditions: Sequence[RuleConditionTypeDef],  # (1)
    Priority: int,
    Actions: Sequence[ActionTypeDef],  # (2)
    Tags: Sequence[TagTypeDef] = ...,  # (3)
) -> CreateRuleOutputTypeDef:  # (4)
    ...
  1. See RuleConditionTypeDef
  2. See ActionTypeDef
  3. See TagTypeDef
  4. See CreateRuleOutputTypeDef
# create_rule method usage example with argument unpacking

kwargs: CreateRuleInputRequestTypeDef = {  # (1)
    "ListenerArn": ...,
    "Conditions": ...,
    "Priority": ...,
    "Actions": ...,
}

parent.create_rule(**kwargs)
  1. See CreateRuleInputRequestTypeDef

create_target_group#

Creates a target group.

Type annotations and code completion for boto3.client("elbv2").create_target_group method. boto3 documentation

# create_target_group method definition

def create_target_group(
    self,
    *,
    Name: str,
    Protocol: ProtocolEnumType = ...,  # (1)
    ProtocolVersion: str = ...,
    Port: int = ...,
    VpcId: str = ...,
    HealthCheckProtocol: ProtocolEnumType = ...,  # (1)
    HealthCheckPort: str = ...,
    HealthCheckEnabled: bool = ...,
    HealthCheckPath: str = ...,
    HealthCheckIntervalSeconds: int = ...,
    HealthCheckTimeoutSeconds: int = ...,
    HealthyThresholdCount: int = ...,
    UnhealthyThresholdCount: int = ...,
    Matcher: MatcherTypeDef = ...,  # (3)
    TargetType: TargetTypeEnumType = ...,  # (4)
    Tags: Sequence[TagTypeDef] = ...,  # (5)
    IpAddressType: TargetGroupIpAddressTypeEnumType = ...,  # (6)
) -> CreateTargetGroupOutputTypeDef:  # (7)
    ...
  1. See ProtocolEnumType
  2. See ProtocolEnumType
  3. See MatcherTypeDef
  4. See TargetTypeEnumType
  5. See TagTypeDef
  6. See TargetGroupIpAddressTypeEnumType
  7. See CreateTargetGroupOutputTypeDef
# create_target_group method usage example with argument unpacking

kwargs: CreateTargetGroupInputRequestTypeDef = {  # (1)
    "Name": ...,
}

parent.create_target_group(**kwargs)
  1. See CreateTargetGroupInputRequestTypeDef

create_trust_store#

Creates a trust store.

Type annotations and code completion for boto3.client("elbv2").create_trust_store method. boto3 documentation

# create_trust_store method definition

def create_trust_store(
    self,
    *,
    Name: str,
    CaCertificatesBundleS3Bucket: str,
    CaCertificatesBundleS3Key: str,
    CaCertificatesBundleS3ObjectVersion: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> CreateTrustStoreOutputTypeDef:  # (2)
    ...
  1. See TagTypeDef
  2. See CreateTrustStoreOutputTypeDef
# create_trust_store method usage example with argument unpacking

kwargs: CreateTrustStoreInputRequestTypeDef = {  # (1)
    "Name": ...,
    "CaCertificatesBundleS3Bucket": ...,
    "CaCertificatesBundleS3Key": ...,
}

parent.create_trust_store(**kwargs)
  1. See CreateTrustStoreInputRequestTypeDef

delete_listener#

Deletes the specified listener.

Type annotations and code completion for boto3.client("elbv2").delete_listener method. boto3 documentation

# delete_listener method definition

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

kwargs: DeleteListenerInputRequestTypeDef = {  # (1)
    "ListenerArn": ...,
}

parent.delete_listener(**kwargs)
  1. See DeleteListenerInputRequestTypeDef

delete_load_balancer#

Deletes the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.

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

# delete_load_balancer method definition

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

kwargs: DeleteLoadBalancerInputRequestTypeDef = {  # (1)
    "LoadBalancerArn": ...,
}

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

delete_rule#

Deletes the specified rule.

Type annotations and code completion for boto3.client("elbv2").delete_rule method. boto3 documentation

# delete_rule method definition

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

kwargs: DeleteRuleInputRequestTypeDef = {  # (1)
    "RuleArn": ...,
}

parent.delete_rule(**kwargs)
  1. See DeleteRuleInputRequestTypeDef

delete_target_group#

Deletes the specified target group.

Type annotations and code completion for boto3.client("elbv2").delete_target_group method.