TargetGroupArgs

data class TargetGroupArgs constructor(val connectionTermination: Output<Boolean>? = null, val deregistrationDelay: Output<Int>? = null, val healthCheck: Output<TargetGroupHealthCheckArgs>? = null, val ipAddressType: Output<String>? = null, val lambdaMultiValueHeadersEnabled: Output<Boolean>? = null, val loadBalancingAlgorithmType: Output<String>? = null, val loadBalancingCrossZoneEnabled: Output<String>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val port: Output<Int>? = null, val preserveClientIp: Output<String>? = null, val protocol: Output<String>? = null, val protocolVersion: Output<String>? = null, val proxyProtocolV2: Output<Boolean>? = null, val slowStart: Output<Int>? = null, val stickiness: Output<TargetGroupStickinessArgs>? = null, val tags: Output<Map<String, String>>? = null, val targetFailovers: Output<List<TargetGroupTargetFailoverArgs>>? = null, val targetType: Output<String>? = null, val vpcId: Output<String>? = null) : ConvertibleToJava<TargetGroupArgs>

Provides a Target Group resource for use with Load Balancer resources.

Note: aws.alb.TargetGroup is known as aws.lb.TargetGroup. The functionality is identical.

Example Usage

Instance Target Group

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
import com.pulumi.aws.lb.TargetGroup;
import com.pulumi.aws.lb.TargetGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var main = new Vpc("main", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var test = new TargetGroup("test", TargetGroupArgs.builder()
.port(80)
.protocol("HTTP")
.vpcId(main.id())
.build());
}
}

IP Target Group

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
import com.pulumi.aws.lb.TargetGroup;
import com.pulumi.aws.lb.TargetGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var main = new Vpc("main", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var ip_example = new TargetGroup("ip-example", TargetGroupArgs.builder()
.port(80)
.protocol("HTTP")
.targetType("ip")
.vpcId(main.id())
.build());
}
}

Lambda Target Group

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lb.TargetGroup;
import com.pulumi.aws.lb.TargetGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var lambda_example = new TargetGroup("lambda-example", TargetGroupArgs.builder()
.targetType("lambda")
.build());
}
}

ALB Target Group

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lb.TargetGroup;
import com.pulumi.aws.lb.TargetGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var alb_example = new TargetGroup("alb-example", TargetGroupArgs.builder()
.targetType("alb")
.port(80)
.protocol("TCP")
.vpcId(aws_vpc.main().id())
.build());
}
}

Import

Target Groups can be imported using their ARN, e.g.,

$ pulumi import aws:elasticloadbalancingv2/targetGroup:TargetGroup app_front_end arn:aws:elasticloadbalancing:us-west-2:187416307283:targetgroup/app-front-end/20cfe21448b66314

Constructors

Link copied to clipboard
constructor(connectionTermination: Output<Boolean>? = null, deregistrationDelay: Output<Int>? = null, healthCheck: Output<TargetGroupHealthCheckArgs>? = null, ipAddressType: Output<String>? = null, lambdaMultiValueHeadersEnabled: Output<Boolean>? = null, loadBalancingAlgorithmType: Output<String>? = null, loadBalancingCrossZoneEnabled: Output<String>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, port: Output<Int>? = null, preserveClientIp: Output<String>? = null, protocol: Output<String>? = null, protocolVersion: Output<String>? = null, proxyProtocolV2: Output<Boolean>? = null, slowStart: Output<Int>? = null, stickiness: Output<TargetGroupStickinessArgs>? = null, tags: Output<Map<String, String>>? = null, targetFailovers: Output<List<TargetGroupTargetFailoverArgs>>? = null, targetType: Output<String>? = null, vpcId: Output<String>? = null)

Properties

Link copied to clipboard
val connectionTermination: Output<Boolean>? = null

Whether to terminate connections at the end of the deregistration timeout on Network Load Balancers. See doc for more information. Default is false.

Link copied to clipboard
val deregistrationDelay: Output<Int>? = null

Amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.

Link copied to clipboard

Health Check configuration block. Detailed below.

Link copied to clipboard
val ipAddressType: Output<String>? = null

The type of IP addresses used by the target group, only supported when target type is set to ip. Possible values are ipv4 or ipv6.

Link copied to clipboard

Whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when target_type is lambda. Default is false.

Link copied to clipboard
val loadBalancingAlgorithmType: Output<String>? = null

Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is round_robin or least_outstanding_requests. The default is round_robin.

Link copied to clipboard

Indicates whether cross zone load balancing is enabled. The value is "true", "false" or "use_load_balancer_configuration". The default is "use_load_balancer_configuration".

Link copied to clipboard
val name: Output<String>? = null

Name of the target group. If omitted, this provider will assign a random, unique name. This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.

Link copied to clipboard
val namePrefix: Output<String>? = null

Creates a unique name beginning with the specified prefix. Conflicts with name. Cannot be longer than 6 characters.

Link copied to clipboard
val port: Output<Int>? = null

Port on which targets receive traffic, unless overridden when registering a specific target. Required when target_type is instance, ip or alb. Does not apply when target_type is lambda.

Link copied to clipboard
val preserveClientIp: Output<String>? = null

Whether client IP preservation is enabled. See doc for more information.

Link copied to clipboard
val protocol: Output<String>? = null

Protocol to use for routing traffic to the targets. Should be one of GENEVE, HTTP, HTTPS, TCP, TCP_UDP, TLS, or UDP. Required when target_type is instance, ip or alb. Does not apply when target_type is lambda.

Link copied to clipboard
val protocolVersion: Output<String>? = null

Only applicable when protocol is HTTP or HTTPS. The protocol version. Specify GRPC to send requests to targets using gRPC. Specify HTTP2 to send requests to targets using HTTP/2. The default is HTTP1, which sends requests to targets using HTTP/1.1

Link copied to clipboard
val proxyProtocolV2: Output<Boolean>? = null

Whether to enable support for proxy protocol v2 on Network Load Balancers. See doc for more information. Default is false.

Link copied to clipboard
val slowStart: Output<Int>? = null

Amount time for targets to warm up before the load balancer sends them a full share of requests. The range is 30-900 seconds or 0 to disable. The default value is 0 seconds.

Link copied to clipboard

Stickiness configuration block. Detailed below.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard

Target failover block. Only applicable for Gateway Load Balancer target groups. See target_failover for more information.

Link copied to clipboard
val targetType: Output<String>? = null

Type of target that you must specify when registering targets with this target group. See doc for supported values. The default is instance. Note that you can't specify targets for a target group using both instance IDs and IP addresses. If the target type is ip, specify IP addresses from the subnets of the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses. Network Load Balancers do not support the lambda target type. Application Load Balancers do not support the alb target type.

Link copied to clipboard
val vpcId: Output<String>? = null

Identifier of the VPC in which to create the target group. Required when target_type is instance, ip or alb. Does not apply when target_type is lambda.

Functions

Link copied to clipboard
open override fun toJava(): TargetGroupArgs