Skip to main content
Providers

TargetGroup

A resource of the AWS provider, version 0.3.0, in its Load Balancing group. Import it with:

import TargetGroup from "aws/loadbalancing"

Example

resource TargetGroup example {
    name                = "example-value"
    port                = 3.14
    protocol            = "HTTP"
    protocolVersion     = "HTTP1"
    vpcId               = "example-value"
    targetType          = "instance"
    ipAddressType       = "ipv4"
    healthCheck         = "..."
    deregistrationDelay = 300
    slowStart           = 0
    stickiness          = "..."
    targets             = "..."
    tags                = "..."
}

Properties

Set by your code in the resource block. A required one must be set; any other you leave out takes the value under Default, if it has one.

NameTypeDefaultRequiredDescription
namestring—NoThe name of the target group
portnumber—NoThe port on which targets receive traffic
protocolstring"HTTP"NoThe protocol for routing traffic Allowed: "HTTP", "HTTPS", "TCP", "TLS", "UDP", "TCP_UDP", "GENEVE"
protocolVersionstring"HTTP1"NoThe protocol version (ALB only) Allowed: "HTTP1", "HTTP2", "GRPC"
vpcIdstring—NoThe VPC ID for the target group
targetTypestring"instance"NoThe target type Allowed: "instance", "ip", "lambda", "alb"
ipAddressTypestring"ipv4"NoThe IP address type Allowed: "ipv4", "ipv6"
healthCheckany—NoHealth check configuration
deregistrationDelaynumber300NoDeregistration delay in seconds
slowStartnumber0NoSlow start duration in seconds (ALB only)
stickinessany—NoStickiness configuration
targetsany[]—NoTarget IDs to register (instance IDs or IP addresses)
tagsobject—NoTags to apply to the target group

Set by AWS after the resource is created: your code can read them but not set them. An importable one identifies an existing resource.

NameTypeImportableDescription
arnstringYesThe Amazon Resource Name (ARN) of the target group
loadBalancerArnsany[]NoThe load balancer ARNs attached to this target group

On this page