All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.lb.kotlin.TargetGroupArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.lb.kotlin

import com.pulumi.aws.lb.TargetGroupArgs.builder
import com.pulumi.aws.lb.kotlin.inputs.TargetGroupHealthCheckArgs
import com.pulumi.aws.lb.kotlin.inputs.TargetGroupHealthCheckArgsBuilder
import com.pulumi.aws.lb.kotlin.inputs.TargetGroupStickinessArgs
import com.pulumi.aws.lb.kotlin.inputs.TargetGroupStickinessArgsBuilder
import com.pulumi.aws.lb.kotlin.inputs.TargetGroupTargetFailoverArgs
import com.pulumi.aws.lb.kotlin.inputs.TargetGroupTargetFailoverArgsBuilder
import com.pulumi.aws.lb.kotlin.inputs.TargetGroupTargetGroupHealthArgs
import com.pulumi.aws.lb.kotlin.inputs.TargetGroupTargetGroupHealthArgsBuilder
import com.pulumi.aws.lb.kotlin.inputs.TargetGroupTargetHealthStateArgs
import com.pulumi.aws.lb.kotlin.inputs.TargetGroupTargetHealthStateArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * 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
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const main = new aws.ec2.Vpc("main", {cidrBlock: "10.0.0.0/16"});
 * const test = new aws.lb.TargetGroup("test", {
 *     name: "tf-example-lb-tg",
 *     port: 80,
 *     protocol: "HTTP",
 *     vpcId: main.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")
 * test = aws.lb.TargetGroup("test",
 *     name="tf-example-lb-tg",
 *     port=80,
 *     protocol="HTTP",
 *     vpc_id=main.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var main = new Aws.Ec2.Vpc("main", new()
 *     {
 *         CidrBlock = "10.0.0.0/16",
 *     });
 *     var test = new Aws.LB.TargetGroup("test", new()
 *     {
 *         Name = "tf-example-lb-tg",
 *         Port = 80,
 *         Protocol = "HTTP",
 *         VpcId = main.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		main, err := ec2.NewVpc(ctx, "main", &ec2.VpcArgs{
 * 			CidrBlock: pulumi.String("10.0.0.0/16"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = lb.NewTargetGroup(ctx, "test", &lb.TargetGroupArgs{
 * 			Name:     pulumi.String("tf-example-lb-tg"),
 * 			Port:     pulumi.Int(80),
 * 			Protocol: pulumi.String("HTTP"),
 * 			VpcId:    main.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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()
 *             .name("tf-example-lb-tg")
 *             .port(80)
 *             .protocol("HTTP")
 *             .vpcId(main.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: aws:lb:TargetGroup
 *     properties:
 *       name: tf-example-lb-tg
 *       port: 80
 *       protocol: HTTP
 *       vpcId: ${main.id}
 *   main:
 *     type: aws:ec2:Vpc
 *     properties:
 *       cidrBlock: 10.0.0.0/16
 * ```
 * 
 * ### IP Target Group
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const main = new aws.ec2.Vpc("main", {cidrBlock: "10.0.0.0/16"});
 * const ip_example = new aws.lb.TargetGroup("ip-example", {
 *     name: "tf-example-lb-tg",
 *     port: 80,
 *     protocol: "HTTP",
 *     targetType: "ip",
 *     vpcId: main.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")
 * ip_example = aws.lb.TargetGroup("ip-example",
 *     name="tf-example-lb-tg",
 *     port=80,
 *     protocol="HTTP",
 *     target_type="ip",
 *     vpc_id=main.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var main = new Aws.Ec2.Vpc("main", new()
 *     {
 *         CidrBlock = "10.0.0.0/16",
 *     });
 *     var ip_example = new Aws.LB.TargetGroup("ip-example", new()
 *     {
 *         Name = "tf-example-lb-tg",
 *         Port = 80,
 *         Protocol = "HTTP",
 *         TargetType = "ip",
 *         VpcId = main.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		main, err := ec2.NewVpc(ctx, "main", &ec2.VpcArgs{
 * 			CidrBlock: pulumi.String("10.0.0.0/16"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = lb.NewTargetGroup(ctx, "ip-example", &lb.TargetGroupArgs{
 * 			Name:       pulumi.String("tf-example-lb-tg"),
 * 			Port:       pulumi.Int(80),
 * 			Protocol:   pulumi.String("HTTP"),
 * 			TargetType: pulumi.String("ip"),
 * 			VpcId:      main.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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()
 *             .name("tf-example-lb-tg")
 *             .port(80)
 *             .protocol("HTTP")
 *             .targetType("ip")
 *             .vpcId(main.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   ip-example:
 *     type: aws:lb:TargetGroup
 *     properties:
 *       name: tf-example-lb-tg
 *       port: 80
 *       protocol: HTTP
 *       targetType: ip
 *       vpcId: ${main.id}
 *   main:
 *     type: aws:ec2:Vpc
 *     properties:
 *       cidrBlock: 10.0.0.0/16
 * ```
 * 
 * ### Lambda Target Group
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const lambda_example = new aws.lb.TargetGroup("lambda-example", {
 *     name: "tf-example-lb-tg",
 *     targetType: "lambda",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * lambda_example = aws.lb.TargetGroup("lambda-example",
 *     name="tf-example-lb-tg",
 *     target_type="lambda")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var lambda_example = new Aws.LB.TargetGroup("lambda-example", new()
 *     {
 *         Name = "tf-example-lb-tg",
 *         TargetType = "lambda",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := lb.NewTargetGroup(ctx, "lambda-example", &lb.TargetGroupArgs{
 * 			Name:       pulumi.String("tf-example-lb-tg"),
 * 			TargetType: pulumi.String("lambda"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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()
 *             .name("tf-example-lb-tg")
 *             .targetType("lambda")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   lambda-example:
 *     type: aws:lb:TargetGroup
 *     properties:
 *       name: tf-example-lb-tg
 *       targetType: lambda
 * ```
 * 
 * ### ALB Target Group
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const alb_example = new aws.lb.TargetGroup("alb-example", {
 *     name: "tf-example-lb-alb-tg",
 *     targetType: "alb",
 *     port: 80,
 *     protocol: "TCP",
 *     vpcId: main.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * alb_example = aws.lb.TargetGroup("alb-example",
 *     name="tf-example-lb-alb-tg",
 *     target_type="alb",
 *     port=80,
 *     protocol="TCP",
 *     vpc_id=main["id"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var alb_example = new Aws.LB.TargetGroup("alb-example", new()
 *     {
 *         Name = "tf-example-lb-alb-tg",
 *         TargetType = "alb",
 *         Port = 80,
 *         Protocol = "TCP",
 *         VpcId = main.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := lb.NewTargetGroup(ctx, "alb-example", &lb.TargetGroupArgs{
 * 			Name:       pulumi.String("tf-example-lb-alb-tg"),
 * 			TargetType: pulumi.String("alb"),
 * 			Port:       pulumi.Int(80),
 * 			Protocol:   pulumi.String("TCP"),
 * 			VpcId:      pulumi.Any(main.Id),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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()
 *             .name("tf-example-lb-alb-tg")
 *             .targetType("alb")
 *             .port(80)
 *             .protocol("TCP")
 *             .vpcId(main.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   alb-example:
 *     type: aws:lb:TargetGroup
 *     properties:
 *       name: tf-example-lb-alb-tg
 *       targetType: alb
 *       port: 80
 *       protocol: TCP
 *       vpcId: ${main.id}
 * ```
 * 
 * ### Target group with unhealthy connection termination disabled
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const tcp_example = new aws.lb.TargetGroup("tcp-example", {
 *     name: "tf-example-lb-nlb-tg",
 *     port: 25,
 *     protocol: "TCP",
 *     vpcId: main.id,
 *     targetHealthStates: [{
 *         enableUnhealthyConnectionTermination: false,
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * tcp_example = aws.lb.TargetGroup("tcp-example",
 *     name="tf-example-lb-nlb-tg",
 *     port=25,
 *     protocol="TCP",
 *     vpc_id=main["id"],
 *     target_health_states=[{
 *         "enable_unhealthy_connection_termination": False,
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var tcp_example = new Aws.LB.TargetGroup("tcp-example", new()
 *     {
 *         Name = "tf-example-lb-nlb-tg",
 *         Port = 25,
 *         Protocol = "TCP",
 *         VpcId = main.Id,
 *         TargetHealthStates = new[]
 *         {
 *             new Aws.LB.Inputs.TargetGroupTargetHealthStateArgs
 *             {
 *                 EnableUnhealthyConnectionTermination = false,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := lb.NewTargetGroup(ctx, "tcp-example", &lb.TargetGroupArgs{
 * 			Name:     pulumi.String("tf-example-lb-nlb-tg"),
 * 			Port:     pulumi.Int(25),
 * 			Protocol: pulumi.String("TCP"),
 * 			VpcId:    pulumi.Any(main.Id),
 * 			TargetHealthStates: lb.TargetGroupTargetHealthStateArray{
 * 				&lb.TargetGroupTargetHealthStateArgs{
 * 					EnableUnhealthyConnectionTermination: pulumi.Bool(false),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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 com.pulumi.aws.lb.inputs.TargetGroupTargetHealthStateArgs;
 * 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 tcp_example = new TargetGroup("tcp-example", TargetGroupArgs.builder()
 *             .name("tf-example-lb-nlb-tg")
 *             .port(25)
 *             .protocol("TCP")
 *             .vpcId(main.id())
 *             .targetHealthStates(TargetGroupTargetHealthStateArgs.builder()
 *                 .enableUnhealthyConnectionTermination(false)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   tcp-example:
 *     type: aws:lb:TargetGroup
 *     properties:
 *       name: tf-example-lb-nlb-tg
 *       port: 25
 *       protocol: TCP
 *       vpcId: ${main.id}
 *       targetHealthStates:
 *         - enableUnhealthyConnectionTermination: false
 * ```
 * 
 * ### Target group with health requirements
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const tcp_example = new aws.lb.TargetGroup("tcp-example", {
 *     name: "tf-example-lb-nlb-tg",
 *     port: 80,
 *     protocol: "TCP",
 *     vpcId: main.id,
 *     targetGroupHealth: {
 *         dnsFailover: {
 *             minimumHealthyTargetsCount: "1",
 *             minimumHealthyTargetsPercentage: "off",
 *         },
 *         unhealthyStateRouting: {
 *             minimumHealthyTargetsCount: 1,
 *             minimumHealthyTargetsPercentage: "off",
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * tcp_example = aws.lb.TargetGroup("tcp-example",
 *     name="tf-example-lb-nlb-tg",
 *     port=80,
 *     protocol="TCP",
 *     vpc_id=main["id"],
 *     target_group_health={
 *         "dns_failover": {
 *             "minimum_healthy_targets_count": "1",
 *             "minimum_healthy_targets_percentage": "off",
 *         },
 *         "unhealthy_state_routing": {
 *             "minimum_healthy_targets_count": 1,
 *             "minimum_healthy_targets_percentage": "off",
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var tcp_example = new Aws.LB.TargetGroup("tcp-example", new()
 *     {
 *         Name = "tf-example-lb-nlb-tg",
 *         Port = 80,
 *         Protocol = "TCP",
 *         VpcId = main.Id,
 *         TargetGroupHealth = new Aws.LB.Inputs.TargetGroupTargetGroupHealthArgs
 *         {
 *             DnsFailover = new Aws.LB.Inputs.TargetGroupTargetGroupHealthDnsFailoverArgs
 *             {
 *                 MinimumHealthyTargetsCount = "1",
 *                 MinimumHealthyTargetsPercentage = "off",
 *             },
 *             UnhealthyStateRouting = new Aws.LB.Inputs.TargetGroupTargetGroupHealthUnhealthyStateRoutingArgs
 *             {
 *                 MinimumHealthyTargetsCount = 1,
 *                 MinimumHealthyTargetsPercentage = "off",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := lb.NewTargetGroup(ctx, "tcp-example", &lb.TargetGroupArgs{
 * 			Name:     pulumi.String("tf-example-lb-nlb-tg"),
 * 			Port:     pulumi.Int(80),
 * 			Protocol: pulumi.String("TCP"),
 * 			VpcId:    pulumi.Any(main.Id),
 * 			TargetGroupHealth: &lb.TargetGroupTargetGroupHealthArgs{
 * 				DnsFailover: &lb.TargetGroupTargetGroupHealthDnsFailoverArgs{
 * 					MinimumHealthyTargetsCount:      pulumi.String("1"),
 * 					MinimumHealthyTargetsPercentage: pulumi.String("off"),
 * 				},
 * 				UnhealthyStateRouting: &lb.TargetGroupTargetGroupHealthUnhealthyStateRoutingArgs{
 * 					MinimumHealthyTargetsCount:      pulumi.Int(1),
 * 					MinimumHealthyTargetsPercentage: pulumi.String("off"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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 com.pulumi.aws.lb.inputs.TargetGroupTargetGroupHealthArgs;
 * import com.pulumi.aws.lb.inputs.TargetGroupTargetGroupHealthDnsFailoverArgs;
 * import com.pulumi.aws.lb.inputs.TargetGroupTargetGroupHealthUnhealthyStateRoutingArgs;
 * 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 tcp_example = new TargetGroup("tcp-example", TargetGroupArgs.builder()
 *             .name("tf-example-lb-nlb-tg")
 *             .port(80)
 *             .protocol("TCP")
 *             .vpcId(main.id())
 *             .targetGroupHealth(TargetGroupTargetGroupHealthArgs.builder()
 *                 .dnsFailover(TargetGroupTargetGroupHealthDnsFailoverArgs.builder()
 *                     .minimumHealthyTargetsCount("1")
 *                     .minimumHealthyTargetsPercentage("off")
 *                     .build())
 *                 .unhealthyStateRouting(TargetGroupTargetGroupHealthUnhealthyStateRoutingArgs.builder()
 *                     .minimumHealthyTargetsCount("1")
 *                     .minimumHealthyTargetsPercentage("off")
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   tcp-example:
 *     type: aws:lb:TargetGroup
 *     properties:
 *       name: tf-example-lb-nlb-tg
 *       port: 80
 *       protocol: TCP
 *       vpcId: ${main.id}
 *       targetGroupHealth:
 *         dnsFailover:
 *           minimumHealthyTargetsCount: '1'
 *           minimumHealthyTargetsPercentage: off
 *         unhealthyStateRouting:
 *           minimumHealthyTargetsCount: '1'
 *           minimumHealthyTargetsPercentage: off
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Target Groups using their ARN. For example:
 * ```sh
 * $ pulumi import aws:lb/targetGroup:TargetGroup app_front_end arn:aws:elasticloadbalancing:us-west-2:187416307283:targetgroup/app-front-end/20cfe21448b66314
 * ```
 * @property connectionTermination Whether to terminate connections at the end of the deregistration timeout on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#deregistration-delay) for more information. Default is `false`.
 * @property deregistrationDelay 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.
 * @property healthCheck Health Check configuration block. Detailed below.
 * @property ipAddressType 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`.
 * @property lambdaMultiValueHeadersEnabled 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`.
 * @property loadBalancingAlgorithmType Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is `round_robin`, `least_outstanding_requests`, or `weighted_random`. The default is `round_robin`.
 * @property loadBalancingAnomalyMitigation Determines whether to enable target anomaly mitigation.  Target anomaly mitigation is only supported by the `weighted_random` load balancing algorithm type.  See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#automatic-target-weights) for more information.  The value is `"on"` or `"off"`. The default is `"off"`.
 * @property loadBalancingCrossZoneEnabled 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"`.
 * @property name 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.
 * @property namePrefix Creates a unique name beginning with the specified prefix. Conflicts with `name`. Cannot be longer than 6 characters.
 * @property port 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`.
 * @property preserveClientIp Whether client IP preservation is enabled. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation) for more information.
 * @property protocol 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`.
 * @property protocolVersion 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
 * @property proxyProtocolV2 Whether to enable support for proxy protocol v2 on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#proxy-protocol) for more information. Default is `false`.
 * @property slowStart 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.
 * @property stickiness Stickiness configuration block. Detailed below.
 * @property tags 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.
 * @property targetFailovers Target failover block. Only applicable for Gateway Load Balancer target groups. See target_failover for more information.
 * @property targetGroupHealth Target health requirements block. See target_group_health for more information.
 * @property targetHealthStates Target health state block. Only applicable for Network Load Balancer target groups when `protocol` is `TCP` or `TLS`. See target_health_state for more information.
 * @property targetType Type of target that you must specify when registering targets with this target group.
 * See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html) 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.
 * @property vpcId 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`.
 */
public data class TargetGroupArgs(
    public val connectionTermination: Output? = null,
    public val deregistrationDelay: Output? = null,
    public val healthCheck: Output? = null,
    public val ipAddressType: Output? = null,
    public val lambdaMultiValueHeadersEnabled: Output? = null,
    public val loadBalancingAlgorithmType: Output? = null,
    public val loadBalancingAnomalyMitigation: Output? = null,
    public val loadBalancingCrossZoneEnabled: Output? = null,
    public val name: Output? = null,
    public val namePrefix: Output? = null,
    public val port: Output? = null,
    public val preserveClientIp: Output? = null,
    public val protocol: Output? = null,
    public val protocolVersion: Output? = null,
    public val proxyProtocolV2: Output? = null,
    public val slowStart: Output? = null,
    public val stickiness: Output? = null,
    public val tags: Output>? = null,
    public val targetFailovers: Output>? = null,
    public val targetGroupHealth: Output? = null,
    public val targetHealthStates: Output>? = null,
    public val targetType: Output? = null,
    public val vpcId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.lb.TargetGroupArgs =
        com.pulumi.aws.lb.TargetGroupArgs.builder()
            .connectionTermination(connectionTermination?.applyValue({ args0 -> args0 }))
            .deregistrationDelay(deregistrationDelay?.applyValue({ args0 -> args0 }))
            .healthCheck(healthCheck?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .ipAddressType(ipAddressType?.applyValue({ args0 -> args0 }))
            .lambdaMultiValueHeadersEnabled(lambdaMultiValueHeadersEnabled?.applyValue({ args0 -> args0 }))
            .loadBalancingAlgorithmType(loadBalancingAlgorithmType?.applyValue({ args0 -> args0 }))
            .loadBalancingAnomalyMitigation(loadBalancingAnomalyMitigation?.applyValue({ args0 -> args0 }))
            .loadBalancingCrossZoneEnabled(loadBalancingCrossZoneEnabled?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .namePrefix(namePrefix?.applyValue({ args0 -> args0 }))
            .port(port?.applyValue({ args0 -> args0 }))
            .preserveClientIp(preserveClientIp?.applyValue({ args0 -> args0 }))
            .protocol(protocol?.applyValue({ args0 -> args0 }))
            .protocolVersion(protocolVersion?.applyValue({ args0 -> args0 }))
            .proxyProtocolV2(proxyProtocolV2?.applyValue({ args0 -> args0 }))
            .slowStart(slowStart?.applyValue({ args0 -> args0 }))
            .stickiness(stickiness?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .targetFailovers(
                targetFailovers?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .targetGroupHealth(targetGroupHealth?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .targetHealthStates(
                targetHealthStates?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .targetType(targetType?.applyValue({ args0 -> args0 }))
            .vpcId(vpcId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [TargetGroupArgs].
 */
@PulumiTagMarker
public class TargetGroupArgsBuilder internal constructor() {
    private var connectionTermination: Output? = null

    private var deregistrationDelay: Output? = null

    private var healthCheck: Output? = null

    private var ipAddressType: Output? = null

    private var lambdaMultiValueHeadersEnabled: Output? = null

    private var loadBalancingAlgorithmType: Output? = null

    private var loadBalancingAnomalyMitigation: Output? = null

    private var loadBalancingCrossZoneEnabled: Output? = null

    private var name: Output? = null

    private var namePrefix: Output? = null

    private var port: Output? = null

    private var preserveClientIp: Output? = null

    private var protocol: Output? = null

    private var protocolVersion: Output? = null

    private var proxyProtocolV2: Output? = null

    private var slowStart: Output? = null

    private var stickiness: Output? = null

    private var tags: Output>? = null

    private var targetFailovers: Output>? = null

    private var targetGroupHealth: Output? = null

    private var targetHealthStates: Output>? = null

    private var targetType: Output? = null

    private var vpcId: Output? = null

    /**
     * @param value Whether to terminate connections at the end of the deregistration timeout on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#deregistration-delay) for more information. Default is `false`.
     */
    @JvmName("hegwiuccfdqhsyee")
    public suspend fun connectionTermination(`value`: Output) {
        this.connectionTermination = value
    }

    /**
     * @param value 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.
     */
    @JvmName("glpmuifssrevcdnt")
    public suspend fun deregistrationDelay(`value`: Output) {
        this.deregistrationDelay = value
    }

    /**
     * @param value Health Check configuration block. Detailed below.
     */
    @JvmName("dflnxdodymuhjsag")
    public suspend fun healthCheck(`value`: Output) {
        this.healthCheck = value
    }

    /**
     * @param value 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`.
     */
    @JvmName("kkrhjqdlcvvcwlmi")
    public suspend fun ipAddressType(`value`: Output) {
        this.ipAddressType = value
    }

    /**
     * @param value 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`.
     */
    @JvmName("raidfydqqfqrttdd")
    public suspend fun lambdaMultiValueHeadersEnabled(`value`: Output) {
        this.lambdaMultiValueHeadersEnabled = value
    }

    /**
     * @param value Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is `round_robin`, `least_outstanding_requests`, or `weighted_random`. The default is `round_robin`.
     */
    @JvmName("njeifsdefkhrgwar")
    public suspend fun loadBalancingAlgorithmType(`value`: Output) {
        this.loadBalancingAlgorithmType = value
    }

    /**
     * @param value Determines whether to enable target anomaly mitigation.  Target anomaly mitigation is only supported by the `weighted_random` load balancing algorithm type.  See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#automatic-target-weights) for more information.  The value is `"on"` or `"off"`. The default is `"off"`.
     */
    @JvmName("txafrxnwhacsprfu")
    public suspend fun loadBalancingAnomalyMitigation(`value`: Output) {
        this.loadBalancingAnomalyMitigation = value
    }

    /**
     * @param value 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"`.
     */
    @JvmName("ltifymwsdlahpkib")
    public suspend fun loadBalancingCrossZoneEnabled(`value`: Output) {
        this.loadBalancingCrossZoneEnabled = value
    }

    /**
     * @param value 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.
     */
    @JvmName("jkpgscnkcfggrinl")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Creates a unique name beginning with the specified prefix. Conflicts with `name`. Cannot be longer than 6 characters.
     */
    @JvmName("taaniikuweaqmnmb")
    public suspend fun namePrefix(`value`: Output) {
        this.namePrefix = value
    }

    /**
     * @param value 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`.
     */
    @JvmName("tihhuqdadxxfjyuj")
    public suspend fun port(`value`: Output) {
        this.port = value
    }

    /**
     * @param value Whether client IP preservation is enabled. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation) for more information.
     */
    @JvmName("qtsbulpsdaluuaxh")
    public suspend fun preserveClientIp(`value`: Output) {
        this.preserveClientIp = value
    }

    /**
     * @param value 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`.
     */
    @JvmName("dhbkaftbcprohjtk")
    public suspend fun protocol(`value`: Output) {
        this.protocol = value
    }

    /**
     * @param value 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
     */
    @JvmName("mudsssciagfubwul")
    public suspend fun protocolVersion(`value`: Output) {
        this.protocolVersion = value
    }

    /**
     * @param value Whether to enable support for proxy protocol v2 on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#proxy-protocol) for more information. Default is `false`.
     */
    @JvmName("tcowobqewwwrbxfd")
    public suspend fun proxyProtocolV2(`value`: Output) {
        this.proxyProtocolV2 = value
    }

    /**
     * @param value 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.
     */
    @JvmName("jdtieffefjxpxlld")
    public suspend fun slowStart(`value`: Output) {
        this.slowStart = value
    }

    /**
     * @param value Stickiness configuration block. Detailed below.
     */
    @JvmName("emrcqlopfvwrxbqn")
    public suspend fun stickiness(`value`: Output) {
        this.stickiness = value
    }

    /**
     * @param value 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.
     */
    @JvmName("hmhyfinegwraeyxh")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Target failover block. Only applicable for Gateway Load Balancer target groups. See target_failover for more information.
     */
    @JvmName("llheewwohsibcbtv")
    public suspend fun targetFailovers(`value`: Output>) {
        this.targetFailovers = value
    }

    @JvmName("xtiqodiyktqbnbrg")
    public suspend fun targetFailovers(vararg values: Output) {
        this.targetFailovers = Output.all(values.asList())
    }

    /**
     * @param values Target failover block. Only applicable for Gateway Load Balancer target groups. See target_failover for more information.
     */
    @JvmName("rjfccwlfotbcxaed")
    public suspend fun targetFailovers(values: List>) {
        this.targetFailovers = Output.all(values)
    }

    /**
     * @param value Target health requirements block. See target_group_health for more information.
     */
    @JvmName("eiploumodyvijcrm")
    public suspend fun targetGroupHealth(`value`: Output) {
        this.targetGroupHealth = value
    }

    /**
     * @param value Target health state block. Only applicable for Network Load Balancer target groups when `protocol` is `TCP` or `TLS`. See target_health_state for more information.
     */
    @JvmName("nmdkyesxraevudvv")
    public suspend fun targetHealthStates(`value`: Output>) {
        this.targetHealthStates = value
    }

    @JvmName("katmbnfaeromltgg")
    public suspend fun targetHealthStates(vararg values: Output) {
        this.targetHealthStates = Output.all(values.asList())
    }

    /**
     * @param values Target health state block. Only applicable for Network Load Balancer target groups when `protocol` is `TCP` or `TLS`. See target_health_state for more information.
     */
    @JvmName("hhrqpjcexdstrggn")
    public suspend fun targetHealthStates(values: List>) {
        this.targetHealthStates = Output.all(values)
    }

    /**
     * @param value Type of target that you must specify when registering targets with this target group.
     * See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html) 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.
     */
    @JvmName("vgydenlvkufclsxj")
    public suspend fun targetType(`value`: Output) {
        this.targetType = value
    }

    /**
     * @param value 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`.
     */
    @JvmName("quteelfxwqpfiduu")
    public suspend fun vpcId(`value`: Output) {
        this.vpcId = value
    }

    /**
     * @param value Whether to terminate connections at the end of the deregistration timeout on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#deregistration-delay) for more information. Default is `false`.
     */
    @JvmName("vvhneexluwdkmbrf")
    public suspend fun connectionTermination(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.connectionTermination = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("nqjtfpgbxynkcmxw")
    public suspend fun deregistrationDelay(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deregistrationDelay = mapped
    }

    /**
     * @param value Health Check configuration block. Detailed below.
     */
    @JvmName("ciytibnoxnisewsx")
    public suspend fun healthCheck(`value`: TargetGroupHealthCheckArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.healthCheck = mapped
    }

    /**
     * @param argument Health Check configuration block. Detailed below.
     */
    @JvmName("xyiykqdgsvmiaryd")
    public suspend fun healthCheck(argument: suspend TargetGroupHealthCheckArgsBuilder.() -> Unit) {
        val toBeMapped = TargetGroupHealthCheckArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.healthCheck = mapped
    }

    /**
     * @param value 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`.
     */
    @JvmName("uibnxbviusbpigyq")
    public suspend fun ipAddressType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ipAddressType = mapped
    }

    /**
     * @param value 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`.
     */
    @JvmName("wxsqdvpxxbldvujl")
    public suspend fun lambdaMultiValueHeadersEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.lambdaMultiValueHeadersEnabled = mapped
    }

    /**
     * @param value Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is `round_robin`, `least_outstanding_requests`, or `weighted_random`. The default is `round_robin`.
     */
    @JvmName("lgfybxcxxsmlyxof")
    public suspend fun loadBalancingAlgorithmType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.loadBalancingAlgorithmType = mapped
    }

    /**
     * @param value Determines whether to enable target anomaly mitigation.  Target anomaly mitigation is only supported by the `weighted_random` load balancing algorithm type.  See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#automatic-target-weights) for more information.  The value is `"on"` or `"off"`. The default is `"off"`.
     */
    @JvmName("ygeguviwmcrvqyyw")
    public suspend fun loadBalancingAnomalyMitigation(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.loadBalancingAnomalyMitigation = mapped
    }

    /**
     * @param value 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"`.
     */
    @JvmName("tmgdurufidqdgfap")
    public suspend fun loadBalancingCrossZoneEnabled(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.loadBalancingCrossZoneEnabled = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("goncpbbgasnictrj")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Creates a unique name beginning with the specified prefix. Conflicts with `name`. Cannot be longer than 6 characters.
     */
    @JvmName("qypnkmdbumggmaup")
    public suspend fun namePrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namePrefix = mapped
    }

    /**
     * @param value 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`.
     */
    @JvmName("owyrunmbxqsgcems")
    public suspend fun port(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.port = mapped
    }

    /**
     * @param value Whether client IP preservation is enabled. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation) for more information.
     */
    @JvmName("vmeiyjdaosithldd")
    public suspend fun preserveClientIp(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.preserveClientIp = mapped
    }

    /**
     * @param value 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`.
     */
    @JvmName("kacoetqfbuokukod")
    public suspend fun protocol(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value 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
     */
    @JvmName("ypskfqprlalcjnbr")
    public suspend fun protocolVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protocolVersion = mapped
    }

    /**
     * @param value Whether to enable support for proxy protocol v2 on Network Load Balancers. See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#proxy-protocol) for more information. Default is `false`.
     */
    @JvmName("fyeahxjpyucljjkk")
    public suspend fun proxyProtocolV2(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.proxyProtocolV2 = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("sufvdolmfhebpemp")
    public suspend fun slowStart(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.slowStart = mapped
    }

    /**
     * @param value Stickiness configuration block. Detailed below.
     */
    @JvmName("wwtwhhpusrhxxefx")
    public suspend fun stickiness(`value`: TargetGroupStickinessArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.stickiness = mapped
    }

    /**
     * @param argument Stickiness configuration block. Detailed below.
     */
    @JvmName("jopqcbwgkmhefhjb")
    public suspend fun stickiness(argument: suspend TargetGroupStickinessArgsBuilder.() -> Unit) {
        val toBeMapped = TargetGroupStickinessArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.stickiness = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("cyidmdjxljjeporm")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values 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.
     */
    @JvmName("phxwyktwybywlwfp")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Target failover block. Only applicable for Gateway Load Balancer target groups. See target_failover for more information.
     */
    @JvmName("ggsuittppcijyqvi")
    public suspend fun targetFailovers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetFailovers = mapped
    }

    /**
     * @param argument Target failover block. Only applicable for Gateway Load Balancer target groups. See target_failover for more information.
     */
    @JvmName("wycxrwdpetlglcfn")
    public suspend fun targetFailovers(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            TargetGroupTargetFailoverArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.targetFailovers = mapped
    }

    /**
     * @param argument Target failover block. Only applicable for Gateway Load Balancer target groups. See target_failover for more information.
     */
    @JvmName("hvcbjmlmvtcnbqpo")
    public suspend fun targetFailovers(vararg argument: suspend TargetGroupTargetFailoverArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            TargetGroupTargetFailoverArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.targetFailovers = mapped
    }

    /**
     * @param argument Target failover block. Only applicable for Gateway Load Balancer target groups. See target_failover for more information.
     */
    @JvmName("pfrqanqbejcbmesa")
    public suspend fun targetFailovers(argument: suspend TargetGroupTargetFailoverArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            TargetGroupTargetFailoverArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.targetFailovers = mapped
    }

    /**
     * @param values Target failover block. Only applicable for Gateway Load Balancer target groups. See target_failover for more information.
     */
    @JvmName("utmieqhknyniwoie")
    public suspend fun targetFailovers(vararg values: TargetGroupTargetFailoverArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.targetFailovers = mapped
    }

    /**
     * @param value Target health requirements block. See target_group_health for more information.
     */
    @JvmName("oojxkldcsowvymrc")
    public suspend fun targetGroupHealth(`value`: TargetGroupTargetGroupHealthArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetGroupHealth = mapped
    }

    /**
     * @param argument Target health requirements block. See target_group_health for more information.
     */
    @JvmName("eqhvjcxgxjjbeewa")
    public suspend fun targetGroupHealth(argument: suspend TargetGroupTargetGroupHealthArgsBuilder.() -> Unit) {
        val toBeMapped = TargetGroupTargetGroupHealthArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.targetGroupHealth = mapped
    }

    /**
     * @param value Target health state block. Only applicable for Network Load Balancer target groups when `protocol` is `TCP` or `TLS`. See target_health_state for more information.
     */
    @JvmName("gfqixeonhrixbseh")
    public suspend fun targetHealthStates(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetHealthStates = mapped
    }

    /**
     * @param argument Target health state block. Only applicable for Network Load Balancer target groups when `protocol` is `TCP` or `TLS`. See target_health_state for more information.
     */
    @JvmName("tjypiitrtdqryjpt")
    public suspend fun targetHealthStates(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            TargetGroupTargetHealthStateArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.targetHealthStates = mapped
    }

    /**
     * @param argument Target health state block. Only applicable for Network Load Balancer target groups when `protocol` is `TCP` or `TLS`. See target_health_state for more information.
     */
    @JvmName("dbplijospkcujfvq")
    public suspend fun targetHealthStates(vararg argument: suspend TargetGroupTargetHealthStateArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            TargetGroupTargetHealthStateArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.targetHealthStates = mapped
    }

    /**
     * @param argument Target health state block. Only applicable for Network Load Balancer target groups when `protocol` is `TCP` or `TLS`. See target_health_state for more information.
     */
    @JvmName("dhslnoxaejhfxgou")
    public suspend fun targetHealthStates(argument: suspend TargetGroupTargetHealthStateArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            TargetGroupTargetHealthStateArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.targetHealthStates = mapped
    }

    /**
     * @param values Target health state block. Only applicable for Network Load Balancer target groups when `protocol` is `TCP` or `TLS`. See target_health_state for more information.
     */
    @JvmName("tbhrfcxvgmwurmqy")
    public suspend fun targetHealthStates(vararg values: TargetGroupTargetHealthStateArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.targetHealthStates = mapped
    }

    /**
     * @param value Type of target that you must specify when registering targets with this target group.
     * See [doc](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html) 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.
     */
    @JvmName("pndklqenlqakkibm")
    public suspend fun targetType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetType = mapped
    }

    /**
     * @param value 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`.
     */
    @JvmName("vhkyyblgkekqbuks")
    public suspend fun vpcId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vpcId = mapped
    }

    internal fun build(): TargetGroupArgs = TargetGroupArgs(
        connectionTermination = connectionTermination,
        deregistrationDelay = deregistrationDelay,
        healthCheck = healthCheck,
        ipAddressType = ipAddressType,
        lambdaMultiValueHeadersEnabled = lambdaMultiValueHeadersEnabled,
        loadBalancingAlgorithmType = loadBalancingAlgorithmType,
        loadBalancingAnomalyMitigation = loadBalancingAnomalyMitigation,
        loadBalancingCrossZoneEnabled = loadBalancingCrossZoneEnabled,
        name = name,
        namePrefix = namePrefix,
        port = port,
        preserveClientIp = preserveClientIp,
        protocol = protocol,
        protocolVersion = protocolVersion,
        proxyProtocolV2 = proxyProtocolV2,
        slowStart = slowStart,
        stickiness = stickiness,
        tags = tags,
        targetFailovers = targetFailovers,
        targetGroupHealth = targetGroupHealth,
        targetHealthStates = targetHealthStates,
        targetType = targetType,
        vpcId = vpcId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy