Skip to content

AWS::ElasticLoadBalancingV2::LoadBalancer

Specifies an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer.

Generated by cfn-typegen --out cfn_types AWS::ElasticLoadBalancingV2::LoadBalancer into cfn_types/elasticloadbalancingv2.py:

# Generated by cfn-typegen from the CloudFormation registry schemas. Do not edit.
# fmt: off
# ruff: noqa
"""AWS::ElasticLoadBalancingV2 resources."""

from collections.abc import Sequence
from typing import Any, Literal, NotRequired, Unpack
from typing_extensions import TypedDict
from cfn_typed.base import DeletionPolicy, DependsOn, ResourceAttrs, Tag, UpdateReplacePolicy, build
from cfn_typed.intrinsics import Expr


CONSTRAINTS:dict[str,Any]={
}


ATTRIBUTES:dict[str,Any]={"AWS::ElasticLoadBalancingV2::LoadBalancer":["CanonicalHostedZoneID","DNSName","LoadBalancerArn","LoadBalancerFullName","LoadBalancerName"]}


RULES:dict[str,Any]={}
Nested types (6)

These are defined above the properties in the generated module.

class LoadBalancerLoadBalancerAttribute(TypedDict, closed=True):
    'Specifies an attribute for an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer.'
    Value: NotRequired[Expr[str]]
    'The value of the attribute.'
    Key: NotRequired[Expr[str]]
    'The name of the attribute.'


class LoadBalancerMinimumLoadBalancerCapacity(TypedDict, closed=True):
    'The minimum capacity for a load balancer.'
    CapacityUnits: Expr[int]
    'The number of capacity units.'


class LoadBalancerSubnetMapping(TypedDict, closed=True):
    'Specifies a subnet for a load balancer.'
    SubnetId: Expr[str]
    'The ID of the subnet.'
    AllocationId: NotRequired[Expr[str]]
    '[Network Load Balancers] The allocation ID of the Elastic IP address for an internet-facing load balancer.'
    PrivateIPv4Address: NotRequired[Expr[str]]
    '[Network Load Balancers] The private IPv4 address for an internal load balancer.'
    IPv6Address: NotRequired[Expr[str]]
    '[Network Load Balancers] The IPv6 address.'
    SourceNatIpv6Prefix: NotRequired[Expr[str]]
    '[Network Load Balancers with UDP listeners] The IPv6 prefix to use for source NAT.'


class LoadBalancerProps(TypedDict, closed=True):
    'Specifies an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer.'
    IpAddressType: NotRequired[Expr[str]]
    'The IP address type.'
    EnablePrefixForIpv6SourceNat: NotRequired[Expr[str]]
    '[Network Load Balancers with UDP listeners] Indicates whether to use an IPv6 prefix from each subnet for source NAT.'
    SecurityGroups: NotRequired[Expr[list[Expr[str]]]]
    '[Application Load Balancers and Network Load Balancers] The IDs of the security groups for the load balancer.'
    LoadBalancerAttributes: NotRequired[Expr[Sequence[Expr[LoadBalancerLoadBalancerAttribute]]]]
    'The load balancer attributes.'
    MinimumLoadBalancerCapacity: NotRequired[Expr[LoadBalancerMinimumLoadBalancerCapacity]]
    'The minimum capacity for a load balancer.'
    EnableCapacityReservationProvisionStabilize: NotRequired[Expr[bool]]
    'Indicates whether to enable stabilization when creating or updating an LCU reservation.'
    Scheme: NotRequired[Expr[str]]
    'The nodes of an Internet-facing load balancer have public IP addresses.'
    Name: NotRequired[Expr[str]]
    'The name of the load balancer.'
    Subnets: NotRequired[Expr[list[Expr[str]]]]
    'The IDs of the subnets.'
    Type: NotRequired[Expr[str]]
    'The type of load balancer.'
    Tags: NotRequired[Expr[Sequence[Expr[Tag]]]]
    'The tags to assign to the load balancer.'
    SubnetMappings: NotRequired[Expr[Sequence[Expr[LoadBalancerSubnetMapping]]]]
    'The IDs of the subnets.'
    EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic: NotRequired[Expr[str]]
    'Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through privatelink.'
    Ipv4IpamPoolId: NotRequired[Expr[str]]
    'The ID of the IPv4 IPAM pool.'


class LoadBalancer(ResourceAttrs):
    'Specifies an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer.'
    Type: Literal['AWS::ElasticLoadBalancingV2::LoadBalancer']
    Properties: NotRequired[LoadBalancerProps]


def load_balancer(
    *,
    depends_on: DependsOn | None = None,
    deletion_policy: DeletionPolicy | None = None,
    update_replace_policy: UpdateReplacePolicy | None = None,
    condition: str | None = None,
    metadata: dict[str, Any] | None = None,
    **props: Unpack[LoadBalancerProps],
) -> LoadBalancer:
    return build('AWS::ElasticLoadBalancingV2::LoadBalancer', props, depends_on, deletion_policy, update_replace_policy, condition, metadata)

Attributes

Read-only values for get_att(logical_id, attribute). They are not accepted as inputs.

  • CanonicalHostedZoneID
  • DNSName
  • LoadBalancerArn
  • LoadBalancerFullName
  • LoadBalancerName

AWS documentation