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

com.pulumi.aws.vpclattice.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.vpclattice.kotlin

import com.pulumi.aws.vpclattice.TargetGroupArgs.builder
import com.pulumi.aws.vpclattice.kotlin.inputs.TargetGroupConfigArgs
import com.pulumi.aws.vpclattice.kotlin.inputs.TargetGroupConfigArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Resource for managing an AWS VPC Lattice Target Group.
 * ## Example Usage
 * ### Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.vpclattice.TargetGroup("example", {
 *     name: "example",
 *     type: "INSTANCE",
 *     config: {
 *         vpcIdentifier: exampleAwsVpc.id,
 *         port: 443,
 *         protocol: "HTTPS",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.vpclattice.TargetGroup("example",
 *     name="example",
 *     type="INSTANCE",
 *     config={
 *         "vpc_identifier": example_aws_vpc["id"],
 *         "port": 443,
 *         "protocol": "HTTPS",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.VpcLattice.TargetGroup("example", new()
 *     {
 *         Name = "example",
 *         Type = "INSTANCE",
 *         Config = new Aws.VpcLattice.Inputs.TargetGroupConfigArgs
 *         {
 *             VpcIdentifier = exampleAwsVpc.Id,
 *             Port = 443,
 *             Protocol = "HTTPS",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := vpclattice.NewTargetGroup(ctx, "example", &vpclattice.TargetGroupArgs{
 * 			Name: pulumi.String("example"),
 * 			Type: pulumi.String("INSTANCE"),
 * 			Config: &vpclattice.TargetGroupConfigArgs{
 * 				VpcIdentifier: pulumi.Any(exampleAwsVpc.Id),
 * 				Port:          pulumi.Int(443),
 * 				Protocol:      pulumi.String("HTTPS"),
 * 			},
 * 		})
 * 		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.vpclattice.TargetGroup;
 * import com.pulumi.aws.vpclattice.TargetGroupArgs;
 * import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigArgs;
 * 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 example = new TargetGroup("example", TargetGroupArgs.builder()
 *             .name("example")
 *             .type("INSTANCE")
 *             .config(TargetGroupConfigArgs.builder()
 *                 .vpcIdentifier(exampleAwsVpc.id())
 *                 .port(443)
 *                 .protocol("HTTPS")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:vpclattice:TargetGroup
 *     properties:
 *       name: example
 *       type: INSTANCE
 *       config:
 *         vpcIdentifier: ${exampleAwsVpc.id}
 *         port: 443
 *         protocol: HTTPS
 * ```
 * 
 * ### Basic usage with Health check
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.vpclattice.TargetGroup("example", {
 *     name: "example",
 *     type: "IP",
 *     config: {
 *         vpcIdentifier: exampleAwsVpc.id,
 *         ipAddressType: "IPV4",
 *         port: 443,
 *         protocol: "HTTPS",
 *         protocolVersion: "HTTP1",
 *         healthCheck: {
 *             enabled: true,
 *             healthCheckIntervalSeconds: 20,
 *             healthCheckTimeoutSeconds: 10,
 *             healthyThresholdCount: 7,
 *             unhealthyThresholdCount: 3,
 *             matcher: {
 *                 value: "200-299",
 *             },
 *             path: "/instance",
 *             port: 80,
 *             protocol: "HTTP",
 *             protocolVersion: "HTTP1",
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.vpclattice.TargetGroup("example",
 *     name="example",
 *     type="IP",
 *     config={
 *         "vpc_identifier": example_aws_vpc["id"],
 *         "ip_address_type": "IPV4",
 *         "port": 443,
 *         "protocol": "HTTPS",
 *         "protocol_version": "HTTP1",
 *         "health_check": {
 *             "enabled": True,
 *             "health_check_interval_seconds": 20,
 *             "health_check_timeout_seconds": 10,
 *             "healthy_threshold_count": 7,
 *             "unhealthy_threshold_count": 3,
 *             "matcher": {
 *                 "value": "200-299",
 *             },
 *             "path": "/instance",
 *             "port": 80,
 *             "protocol": "HTTP",
 *             "protocol_version": "HTTP1",
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.VpcLattice.TargetGroup("example", new()
 *     {
 *         Name = "example",
 *         Type = "IP",
 *         Config = new Aws.VpcLattice.Inputs.TargetGroupConfigArgs
 *         {
 *             VpcIdentifier = exampleAwsVpc.Id,
 *             IpAddressType = "IPV4",
 *             Port = 443,
 *             Protocol = "HTTPS",
 *             ProtocolVersion = "HTTP1",
 *             HealthCheck = new Aws.VpcLattice.Inputs.TargetGroupConfigHealthCheckArgs
 *             {
 *                 Enabled = true,
 *                 HealthCheckIntervalSeconds = 20,
 *                 HealthCheckTimeoutSeconds = 10,
 *                 HealthyThresholdCount = 7,
 *                 UnhealthyThresholdCount = 3,
 *                 Matcher = new Aws.VpcLattice.Inputs.TargetGroupConfigHealthCheckMatcherArgs
 *                 {
 *                     Value = "200-299",
 *                 },
 *                 Path = "/instance",
 *                 Port = 80,
 *                 Protocol = "HTTP",
 *                 ProtocolVersion = "HTTP1",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := vpclattice.NewTargetGroup(ctx, "example", &vpclattice.TargetGroupArgs{
 * 			Name: pulumi.String("example"),
 * 			Type: pulumi.String("IP"),
 * 			Config: &vpclattice.TargetGroupConfigArgs{
 * 				VpcIdentifier:   pulumi.Any(exampleAwsVpc.Id),
 * 				IpAddressType:   pulumi.String("IPV4"),
 * 				Port:            pulumi.Int(443),
 * 				Protocol:        pulumi.String("HTTPS"),
 * 				ProtocolVersion: pulumi.String("HTTP1"),
 * 				HealthCheck: &vpclattice.TargetGroupConfigHealthCheckArgs{
 * 					Enabled:                    pulumi.Bool(true),
 * 					HealthCheckIntervalSeconds: pulumi.Int(20),
 * 					HealthCheckTimeoutSeconds:  pulumi.Int(10),
 * 					HealthyThresholdCount:      pulumi.Int(7),
 * 					UnhealthyThresholdCount:    pulumi.Int(3),
 * 					Matcher: &vpclattice.TargetGroupConfigHealthCheckMatcherArgs{
 * 						Value: pulumi.String("200-299"),
 * 					},
 * 					Path:            pulumi.String("/instance"),
 * 					Port:            pulumi.Int(80),
 * 					Protocol:        pulumi.String("HTTP"),
 * 					ProtocolVersion: pulumi.String("HTTP1"),
 * 				},
 * 			},
 * 		})
 * 		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.vpclattice.TargetGroup;
 * import com.pulumi.aws.vpclattice.TargetGroupArgs;
 * import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigArgs;
 * import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigHealthCheckArgs;
 * import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigHealthCheckMatcherArgs;
 * 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 example = new TargetGroup("example", TargetGroupArgs.builder()
 *             .name("example")
 *             .type("IP")
 *             .config(TargetGroupConfigArgs.builder()
 *                 .vpcIdentifier(exampleAwsVpc.id())
 *                 .ipAddressType("IPV4")
 *                 .port(443)
 *                 .protocol("HTTPS")
 *                 .protocolVersion("HTTP1")
 *                 .healthCheck(TargetGroupConfigHealthCheckArgs.builder()
 *                     .enabled(true)
 *                     .healthCheckIntervalSeconds(20)
 *                     .healthCheckTimeoutSeconds(10)
 *                     .healthyThresholdCount(7)
 *                     .unhealthyThresholdCount(3)
 *                     .matcher(TargetGroupConfigHealthCheckMatcherArgs.builder()
 *                         .value("200-299")
 *                         .build())
 *                     .path("/instance")
 *                     .port(80)
 *                     .protocol("HTTP")
 *                     .protocolVersion("HTTP1")
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:vpclattice:TargetGroup
 *     properties:
 *       name: example
 *       type: IP
 *       config:
 *         vpcIdentifier: ${exampleAwsVpc.id}
 *         ipAddressType: IPV4
 *         port: 443
 *         protocol: HTTPS
 *         protocolVersion: HTTP1
 *         healthCheck:
 *           enabled: true
 *           healthCheckIntervalSeconds: 20
 *           healthCheckTimeoutSeconds: 10
 *           healthyThresholdCount: 7
 *           unhealthyThresholdCount: 3
 *           matcher:
 *             value: 200-299
 *           path: /instance
 *           port: 80
 *           protocol: HTTP
 *           protocolVersion: HTTP1
 * ```
 * 
 * ### ALB
 * If the type is ALB, `health_check` block is not supported.
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.vpclattice.TargetGroup("example", {
 *     name: "example",
 *     type: "ALB",
 *     config: {
 *         vpcIdentifier: exampleAwsVpc.id,
 *         port: 443,
 *         protocol: "HTTPS",
 *         protocolVersion: "HTTP1",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.vpclattice.TargetGroup("example",
 *     name="example",
 *     type="ALB",
 *     config={
 *         "vpc_identifier": example_aws_vpc["id"],
 *         "port": 443,
 *         "protocol": "HTTPS",
 *         "protocol_version": "HTTP1",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.VpcLattice.TargetGroup("example", new()
 *     {
 *         Name = "example",
 *         Type = "ALB",
 *         Config = new Aws.VpcLattice.Inputs.TargetGroupConfigArgs
 *         {
 *             VpcIdentifier = exampleAwsVpc.Id,
 *             Port = 443,
 *             Protocol = "HTTPS",
 *             ProtocolVersion = "HTTP1",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := vpclattice.NewTargetGroup(ctx, "example", &vpclattice.TargetGroupArgs{
 * 			Name: pulumi.String("example"),
 * 			Type: pulumi.String("ALB"),
 * 			Config: &vpclattice.TargetGroupConfigArgs{
 * 				VpcIdentifier:   pulumi.Any(exampleAwsVpc.Id),
 * 				Port:            pulumi.Int(443),
 * 				Protocol:        pulumi.String("HTTPS"),
 * 				ProtocolVersion: pulumi.String("HTTP1"),
 * 			},
 * 		})
 * 		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.vpclattice.TargetGroup;
 * import com.pulumi.aws.vpclattice.TargetGroupArgs;
 * import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigArgs;
 * 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 example = new TargetGroup("example", TargetGroupArgs.builder()
 *             .name("example")
 *             .type("ALB")
 *             .config(TargetGroupConfigArgs.builder()
 *                 .vpcIdentifier(exampleAwsVpc.id())
 *                 .port(443)
 *                 .protocol("HTTPS")
 *                 .protocolVersion("HTTP1")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:vpclattice:TargetGroup
 *     properties:
 *       name: example
 *       type: ALB
 *       config:
 *         vpcIdentifier: ${exampleAwsVpc.id}
 *         port: 443
 *         protocol: HTTPS
 *         protocolVersion: HTTP1
 * ```
 * 
 * ### Lambda
 * If the type is Lambda, `config` block is not supported.
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.vpclattice.TargetGroup("example", {
 *     name: "example",
 *     type: "LAMBDA",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.vpclattice.TargetGroup("example",
 *     name="example",
 *     type="LAMBDA")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.VpcLattice.TargetGroup("example", new()
 *     {
 *         Name = "example",
 *         Type = "LAMBDA",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := vpclattice.NewTargetGroup(ctx, "example", &vpclattice.TargetGroupArgs{
 * 			Name: pulumi.String("example"),
 * 			Type: 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.vpclattice.TargetGroup;
 * import com.pulumi.aws.vpclattice.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 example = new TargetGroup("example", TargetGroupArgs.builder()
 *             .name("example")
 *             .type("LAMBDA")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:vpclattice:TargetGroup
 *     properties:
 *       name: example
 *       type: LAMBDA
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import VPC Lattice Target Group using the `id`. For example:
 * ```sh
 * $ pulumi import aws:vpclattice/targetGroup:TargetGroup example tg-0c11d4dc16ed96bdb
 * ```
 * @property config The target group configuration.
 * @property name The name of the target group. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
 * @property tags Key-value mapping of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
 * @property type The type of target group. Valid Values are `IP` | `LAMBDA` | `INSTANCE` | `ALB`
 * The following arguments are optional:
 */
public data class TargetGroupArgs(
    public val config: Output? = null,
    public val name: Output? = null,
    public val tags: Output>? = null,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.vpclattice.TargetGroupArgs =
        com.pulumi.aws.vpclattice.TargetGroupArgs.builder()
            .config(config?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .type(type?.applyValue({ args0 -> args0 })).build()
}

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

    private var name: Output? = null

    private var tags: Output>? = null

    private var type: Output? = null

    /**
     * @param value The target group configuration.
     */
    @JvmName("satguiyvnhqocghi")
    public suspend fun config(`value`: Output) {
        this.config = value
    }

    /**
     * @param value The name of the target group. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
     */
    @JvmName("nthdxqygefdvddym")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Key-value mapping of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("hymtlntfgujedldh")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The type of target group. Valid Values are `IP` | `LAMBDA` | `INSTANCE` | `ALB`
     * The following arguments are optional:
     */
    @JvmName("besdmwvjgalahxpp")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value The target group configuration.
     */
    @JvmName("qfbbdunbjpogbtri")
    public suspend fun config(`value`: TargetGroupConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.config = mapped
    }

    /**
     * @param argument The target group configuration.
     */
    @JvmName("pqkcroddxampaqsm")
    public suspend fun config(argument: suspend TargetGroupConfigArgsBuilder.() -> Unit) {
        val toBeMapped = TargetGroupConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.config = mapped
    }

    /**
     * @param value The name of the target group. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
     */
    @JvmName("pkhxosjddslwxcwg")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Key-value mapping of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("snkregmttprqddeq")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Key-value mapping of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("hkfluxtvsuvbxoun")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The type of target group. Valid Values are `IP` | `LAMBDA` | `INSTANCE` | `ALB`
     * The following arguments are optional:
     */
    @JvmName("sfmhdtrmlcuthesp")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): TargetGroupArgs = TargetGroupArgs(
        config = config,
        name = name,
        tags = tags,
        type = type,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy