Skip to content

AWS::ElasticLoadBalancingV2::TargetGroup

Resource Type definition for AWS::ElasticLoadBalancingV2::TargetGroup

Generated by cfn-typegen --out cfn_types AWS::ElasticLoadBalancingV2::TargetGroup 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::TargetGroup":["LoadBalancerArns","TargetGroupArn","TargetGroupFullName","TargetGroupName"]}


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

These are defined above the properties in the generated module.

class TargetGroupMatcher(TypedDict, closed=True):
    GrpcCode: NotRequired[Expr[str]]
    'You can specify values between 0 and 99.'
    HttpCode: NotRequired[Expr[str]]
    'For Application Load Balancers, you can specify values between 200 and 499, and the default value is 200.'


class TargetGroupTargetDescription(TypedDict, closed=True):
    AvailabilityZone: NotRequired[Expr[str]]
    'An Availability Zone or all.'
    Id: Expr[str]
    'The ID of the target.'
    Port: NotRequired[Expr[int]]
    'The port on which the target is listening.'
    QuicServerId: NotRequired[Expr[str]]
    'The Server ID used by targets when using QUIC or TCP_QUIC protocols.'


class TargetGroupTargetGroupAttribute(TypedDict, closed=True):
    Value: NotRequired[Expr[str]]
    'The name of the attribute.'
    Key: NotRequired[Expr[str]]
    'The value of the attribute.'


class TargetGroupProps(TypedDict, closed=True):
    'Resource Type definition for AWS::ElasticLoadBalancingV2::TargetGroup'
    IpAddressType: NotRequired[Expr[str]]
    'The type of IP address used for this target group.'
    HealthCheckIntervalSeconds: NotRequired[Expr[int]]
    'The approximate amount of time, in seconds, between health checks of an individual target.'
    Matcher: NotRequired[Expr[TargetGroupMatcher]]
    '[HTTP/HTTPS health checks] The HTTP or gRPC codes to use when checking for a successful response from a target.'
    HealthCheckPath: NotRequired[Expr[str]]
    '[HTTP/HTTPS health checks] The destination for health checks on the targets.'
    Port: NotRequired[Expr[int]]
    'The port on which the targets receive traffic.'
    Targets: NotRequired[Expr[Sequence[Expr[TargetGroupTargetDescription]]]]
    'The targets.'
    HealthCheckEnabled: NotRequired[Expr[bool]]
    'Indicates whether health checks are enabled.'
    ProtocolVersion: NotRequired[Expr[str]]
    '[HTTP/HTTPS protocol] The protocol version.'
    UnhealthyThresholdCount: NotRequired[Expr[int]]
    'The number of consecutive health check failures required before considering a target unhealthy.'
    HealthCheckTimeoutSeconds: NotRequired[Expr[int]]
    'The amount of time, in seconds, during which no response from a target means a failed health check.'
    Name: NotRequired[Expr[str]]
    'The name of the target group.'
    VpcId: NotRequired[Expr[str]]
    'The identifier of the virtual private cloud (VPC).'
    HealthyThresholdCount: NotRequired[Expr[int]]
    'The number of consecutive health checks successes required before considering an unhealthy target healthy.'
    HealthCheckProtocol: NotRequired[Expr[str]]
    'The protocol the load balancer uses when performing health checks on targets.'
    TargetGroupAttributes: NotRequired[Expr[Sequence[Expr[TargetGroupTargetGroupAttribute]]]]
    'The attributes.'
    TargetType: NotRequired[Expr[str]]
    'The type of target that you must specify when registering targets with this target group.'
    HealthCheckPort: NotRequired[Expr[str]]
    'The port the load balancer uses when performing health checks on targets.'
    Protocol: NotRequired[Expr[str]]
    'The protocol to use for routing traffic to the targets.'
    Tags: NotRequired[Expr[Sequence[Expr[Tag]]]]
    'The tags.'
    TargetControlPort: NotRequired[Expr[int]]
    'The port that the target control agent uses to communicate the available capacity of targets to the load balancer.'


class TargetGroup(ResourceAttrs):
    'Resource Type definition for AWS::ElasticLoadBalancingV2::TargetGroup'
    Type: Literal['AWS::ElasticLoadBalancingV2::TargetGroup']
    Properties: NotRequired[TargetGroupProps]


def target_group(
    *,
    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[TargetGroupProps],
) -> TargetGroup:
    return build('AWS::ElasticLoadBalancingV2::TargetGroup', 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.

  • LoadBalancerArns
  • TargetGroupArn
  • TargetGroupFullName
  • TargetGroupName