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

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

import com.pulumi.aws.ec2.TrafficMirrorTargetArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides a Traffic mirror target.
 * Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-considerations.html) for traffic mirroring
 * ## Example Usage
 * To create a basic traffic mirror session
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const nlb = new aws.ec2.TrafficMirrorTarget("nlb", {
 *     description: "NLB target",
 *     networkLoadBalancerArn: lb.arn,
 * });
 * const eni = new aws.ec2.TrafficMirrorTarget("eni", {
 *     description: "ENI target",
 *     networkInterfaceId: test.primaryNetworkInterfaceId,
 * });
 * const gwlb = new aws.ec2.TrafficMirrorTarget("gwlb", {
 *     description: "GWLB target",
 *     gatewayLoadBalancerEndpointId: example.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * nlb = aws.ec2.TrafficMirrorTarget("nlb",
 *     description="NLB target",
 *     network_load_balancer_arn=lb["arn"])
 * eni = aws.ec2.TrafficMirrorTarget("eni",
 *     description="ENI target",
 *     network_interface_id=test["primaryNetworkInterfaceId"])
 * gwlb = aws.ec2.TrafficMirrorTarget("gwlb",
 *     description="GWLB target",
 *     gateway_load_balancer_endpoint_id=example["id"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var nlb = new Aws.Ec2.TrafficMirrorTarget("nlb", new()
 *     {
 *         Description = "NLB target",
 *         NetworkLoadBalancerArn = lb.Arn,
 *     });
 *     var eni = new Aws.Ec2.TrafficMirrorTarget("eni", new()
 *     {
 *         Description = "ENI target",
 *         NetworkInterfaceId = test.PrimaryNetworkInterfaceId,
 *     });
 *     var gwlb = new Aws.Ec2.TrafficMirrorTarget("gwlb", new()
 *     {
 *         Description = "GWLB target",
 *         GatewayLoadBalancerEndpointId = example.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := ec2.NewTrafficMirrorTarget(ctx, "nlb", &ec2.TrafficMirrorTargetArgs{
 * 			Description:            pulumi.String("NLB target"),
 * 			NetworkLoadBalancerArn: pulumi.Any(lb.Arn),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = ec2.NewTrafficMirrorTarget(ctx, "eni", &ec2.TrafficMirrorTargetArgs{
 * 			Description:        pulumi.String("ENI target"),
 * 			NetworkInterfaceId: pulumi.Any(test.PrimaryNetworkInterfaceId),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = ec2.NewTrafficMirrorTarget(ctx, "gwlb", &ec2.TrafficMirrorTargetArgs{
 * 			Description:                   pulumi.String("GWLB target"),
 * 			GatewayLoadBalancerEndpointId: pulumi.Any(example.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.TrafficMirrorTarget;
 * import com.pulumi.aws.ec2.TrafficMirrorTargetArgs;
 * 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 nlb = new TrafficMirrorTarget("nlb", TrafficMirrorTargetArgs.builder()
 *             .description("NLB target")
 *             .networkLoadBalancerArn(lb.arn())
 *             .build());
 *         var eni = new TrafficMirrorTarget("eni", TrafficMirrorTargetArgs.builder()
 *             .description("ENI target")
 *             .networkInterfaceId(test.primaryNetworkInterfaceId())
 *             .build());
 *         var gwlb = new TrafficMirrorTarget("gwlb", TrafficMirrorTargetArgs.builder()
 *             .description("GWLB target")
 *             .gatewayLoadBalancerEndpointId(example.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   nlb:
 *     type: aws:ec2:TrafficMirrorTarget
 *     properties:
 *       description: NLB target
 *       networkLoadBalancerArn: ${lb.arn}
 *   eni:
 *     type: aws:ec2:TrafficMirrorTarget
 *     properties:
 *       description: ENI target
 *       networkInterfaceId: ${test.primaryNetworkInterfaceId}
 *   gwlb:
 *     type: aws:ec2:TrafficMirrorTarget
 *     properties:
 *       description: GWLB target
 *       gatewayLoadBalancerEndpointId: ${example.id}
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import traffic mirror targets using the `id`. For example:
 * ```sh
 * $ pulumi import aws:ec2/trafficMirrorTarget:TrafficMirrorTarget target tmt-0c13a005422b86606
 * ```
 * @property description A description of the traffic mirror session.
 * @property gatewayLoadBalancerEndpointId The VPC Endpoint Id of the Gateway Load Balancer that is associated with the target.
 * @property networkInterfaceId The network interface ID that is associated with the target.
 * @property networkLoadBalancerArn The Amazon Resource Name (ARN) of the Network Load Balancer that is associated with the target.
 * @property tags Key-value map 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.
 * **NOTE:** Either `network_interface_id` or `network_load_balancer_arn` should be specified and both should not be specified together
 */
public data class TrafficMirrorTargetArgs(
    public val description: Output? = null,
    public val gatewayLoadBalancerEndpointId: Output? = null,
    public val networkInterfaceId: Output? = null,
    public val networkLoadBalancerArn: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.ec2.TrafficMirrorTargetArgs =
        com.pulumi.aws.ec2.TrafficMirrorTargetArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .gatewayLoadBalancerEndpointId(gatewayLoadBalancerEndpointId?.applyValue({ args0 -> args0 }))
            .networkInterfaceId(networkInterfaceId?.applyValue({ args0 -> args0 }))
            .networkLoadBalancerArn(networkLoadBalancerArn?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [TrafficMirrorTargetArgs].
 */
@PulumiTagMarker
public class TrafficMirrorTargetArgsBuilder internal constructor() {
    private var description: Output? = null

    private var gatewayLoadBalancerEndpointId: Output? = null

    private var networkInterfaceId: Output? = null

    private var networkLoadBalancerArn: Output? = null

    private var tags: Output>? = null

    /**
     * @param value A description of the traffic mirror session.
     */
    @JvmName("rtwkpxevrltbpijj")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The VPC Endpoint Id of the Gateway Load Balancer that is associated with the target.
     */
    @JvmName("pklsiimdkhdrnyhc")
    public suspend fun gatewayLoadBalancerEndpointId(`value`: Output) {
        this.gatewayLoadBalancerEndpointId = value
    }

    /**
     * @param value The network interface ID that is associated with the target.
     */
    @JvmName("nvcaxdnejnhcwdmp")
    public suspend fun networkInterfaceId(`value`: Output) {
        this.networkInterfaceId = value
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the Network Load Balancer that is associated with the target.
     */
    @JvmName("lgbkafhwjfidldel")
    public suspend fun networkLoadBalancerArn(`value`: Output) {
        this.networkLoadBalancerArn = value
    }

    /**
     * @param value Key-value map 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.
     * **NOTE:** Either `network_interface_id` or `network_load_balancer_arn` should be specified and both should not be specified together
     */
    @JvmName("nnegtqloerfrdqvs")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value A description of the traffic mirror session.
     */
    @JvmName("opdeqpavoljncgod")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The VPC Endpoint Id of the Gateway Load Balancer that is associated with the target.
     */
    @JvmName("xidfwbflmcjepntl")
    public suspend fun gatewayLoadBalancerEndpointId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.gatewayLoadBalancerEndpointId = mapped
    }

    /**
     * @param value The network interface ID that is associated with the target.
     */
    @JvmName("ivhxybulskwdndoe")
    public suspend fun networkInterfaceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkInterfaceId = mapped
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the Network Load Balancer that is associated with the target.
     */
    @JvmName("cxntqunxqsuejhfa")
    public suspend fun networkLoadBalancerArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkLoadBalancerArn = mapped
    }

    /**
     * @param value Key-value map 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.
     * **NOTE:** Either `network_interface_id` or `network_load_balancer_arn` should be specified and both should not be specified together
     */
    @JvmName("mqdnhyqmxggmcbiv")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Key-value map 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.
     * **NOTE:** Either `network_interface_id` or `network_load_balancer_arn` should be specified and both should not be specified together
     */
    @JvmName("ddhccgxdupqskbsb")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): TrafficMirrorTargetArgs = TrafficMirrorTargetArgs(
        description = description,
        gatewayLoadBalancerEndpointId = gatewayLoadBalancerEndpointId,
        networkInterfaceId = networkInterfaceId,
        networkLoadBalancerArn = networkLoadBalancerArn,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy