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

com.pulumi.gcp.compute.kotlin.PacketMirroringArgs.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: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.compute.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.PacketMirroringArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.PacketMirroringCollectorIlbArgs
import com.pulumi.gcp.compute.kotlin.inputs.PacketMirroringCollectorIlbArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.PacketMirroringFilterArgs
import com.pulumi.gcp.compute.kotlin.inputs.PacketMirroringFilterArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.PacketMirroringMirroredResourcesArgs
import com.pulumi.gcp.compute.kotlin.inputs.PacketMirroringMirroredResourcesArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.PacketMirroringNetworkArgs
import com.pulumi.gcp.compute.kotlin.inputs.PacketMirroringNetworkArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * Packet Mirroring mirrors traffic to and from particular VM instances.
 * You can use the collected traffic to help you detect security threats
 * and monitor application performance.
 * To get more information about PacketMirroring, see:
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/packetMirrorings)
 * * How-to Guides
 *     * [Using Packet Mirroring](https://cloud.google.com/vpc/docs/using-packet-mirroring#creating)
 * ## Example Usage
 * ### Compute Packet Mirroring Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.compute.Network("default", {name: "my-network"});
 * const mirror = new gcp.compute.Instance("mirror", {
 *     networkInterfaces: [{
 *         accessConfigs: [{}],
 *         network: _default.id,
 *     }],
 *     name: "my-instance",
 *     machineType: "e2-medium",
 *     bootDisk: {
 *         initializeParams: {
 *             image: "debian-cloud/debian-11",
 *         },
 *     },
 * });
 * const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
 *     name: "my-subnetwork",
 *     network: _default.id,
 *     ipCidrRange: "10.2.0.0/16",
 * });
 * const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
 *     name: "my-healthcheck",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 *     tcpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const defaultRegionBackendService = new gcp.compute.RegionBackendService("default", {
 *     name: "my-service",
 *     healthChecks: defaultHealthCheck.id,
 * });
 * const defaultForwardingRule = new gcp.compute.ForwardingRule("default", {
 *     name: "my-ilb",
 *     isMirroringCollector: true,
 *     ipProtocol: "TCP",
 *     loadBalancingScheme: "INTERNAL",
 *     backendService: defaultRegionBackendService.id,
 *     allPorts: true,
 *     network: _default.id,
 *     subnetwork: defaultSubnetwork.id,
 *     networkTier: "PREMIUM",
 * });
 * const foobar = new gcp.compute.PacketMirroring("foobar", {
 *     name: "my-mirroring",
 *     description: "bar",
 *     network: {
 *         url: _default.id,
 *     },
 *     collectorIlb: {
 *         url: defaultForwardingRule.id,
 *     },
 *     mirroredResources: {
 *         tags: ["foo"],
 *         instances: [{
 *             url: mirror.id,
 *         }],
 *     },
 *     filter: {
 *         ipProtocols: ["tcp"],
 *         cidrRanges: ["0.0.0.0/0"],
 *         direction: "BOTH",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.compute.Network("default", name="my-network")
 * mirror = gcp.compute.Instance("mirror",
 *     network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
 *         access_configs=[gcp.compute.InstanceNetworkInterfaceAccessConfigArgs()],
 *         network=default.id,
 *     )],
 *     name="my-instance",
 *     machine_type="e2-medium",
 *     boot_disk=gcp.compute.InstanceBootDiskArgs(
 *         initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
 *             image="debian-cloud/debian-11",
 *         ),
 *     ))
 * default_subnetwork = gcp.compute.Subnetwork("default",
 *     name="my-subnetwork",
 *     network=default.id,
 *     ip_cidr_range="10.2.0.0/16")
 * default_health_check = gcp.compute.HealthCheck("default",
 *     name="my-healthcheck",
 *     check_interval_sec=1,
 *     timeout_sec=1,
 *     tcp_health_check=gcp.compute.HealthCheckTcpHealthCheckArgs(
 *         port=80,
 *     ))
 * default_region_backend_service = gcp.compute.RegionBackendService("default",
 *     name="my-service",
 *     health_checks=default_health_check.id)
 * default_forwarding_rule = gcp.compute.ForwardingRule("default",
 *     name="my-ilb",
 *     is_mirroring_collector=True,
 *     ip_protocol="TCP",
 *     load_balancing_scheme="INTERNAL",
 *     backend_service=default_region_backend_service.id,
 *     all_ports=True,
 *     network=default.id,
 *     subnetwork=default_subnetwork.id,
 *     network_tier="PREMIUM")
 * foobar = gcp.compute.PacketMirroring("foobar",
 *     name="my-mirroring",
 *     description="bar",
 *     network=gcp.compute.PacketMirroringNetworkArgs(
 *         url=default.id,
 *     ),
 *     collector_ilb=gcp.compute.PacketMirroringCollectorIlbArgs(
 *         url=default_forwarding_rule.id,
 *     ),
 *     mirrored_resources=gcp.compute.PacketMirroringMirroredResourcesArgs(
 *         tags=["foo"],
 *         instances=[gcp.compute.PacketMirroringMirroredResourcesInstanceArgs(
 *             url=mirror.id,
 *         )],
 *     ),
 *     filter=gcp.compute.PacketMirroringFilterArgs(
 *         ip_protocols=["tcp"],
 *         cidr_ranges=["0.0.0.0/0"],
 *         direction="BOTH",
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Compute.Network("default", new()
 *     {
 *         Name = "my-network",
 *     });
 *     var mirror = new Gcp.Compute.Instance("mirror", new()
 *     {
 *         NetworkInterfaces = new[]
 *         {
 *             new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
 *             {
 *                 AccessConfigs = new[]
 *                 {
 *                     null,
 *                 },
 *                 Network = @default.Id,
 *             },
 *         },
 *         Name = "my-instance",
 *         MachineType = "e2-medium",
 *         BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
 *         {
 *             InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
 *             {
 *                 Image = "debian-cloud/debian-11",
 *             },
 *         },
 *     });
 *     var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
 *     {
 *         Name = "my-subnetwork",
 *         Network = @default.Id,
 *         IpCidrRange = "10.2.0.0/16",
 *     });
 *     var defaultHealthCheck = new Gcp.Compute.HealthCheck("default", new()
 *     {
 *         Name = "my-healthcheck",
 *         CheckIntervalSec = 1,
 *         TimeoutSec = 1,
 *         TcpHealthCheck = new Gcp.Compute.Inputs.HealthCheckTcpHealthCheckArgs
 *         {
 *             Port = 80,
 *         },
 *     });
 *     var defaultRegionBackendService = new Gcp.Compute.RegionBackendService("default", new()
 *     {
 *         Name = "my-service",
 *         HealthChecks = defaultHealthCheck.Id,
 *     });
 *     var defaultForwardingRule = new Gcp.Compute.ForwardingRule("default", new()
 *     {
 *         Name = "my-ilb",
 *         IsMirroringCollector = true,
 *         IpProtocol = "TCP",
 *         LoadBalancingScheme = "INTERNAL",
 *         BackendService = defaultRegionBackendService.Id,
 *         AllPorts = true,
 *         Network = @default.Id,
 *         Subnetwork = defaultSubnetwork.Id,
 *         NetworkTier = "PREMIUM",
 *     });
 *     var foobar = new Gcp.Compute.PacketMirroring("foobar", new()
 *     {
 *         Name = "my-mirroring",
 *         Description = "bar",
 *         Network = new Gcp.Compute.Inputs.PacketMirroringNetworkArgs
 *         {
 *             Url = @default.Id,
 *         },
 *         CollectorIlb = new Gcp.Compute.Inputs.PacketMirroringCollectorIlbArgs
 *         {
 *             Url = defaultForwardingRule.Id,
 *         },
 *         MirroredResources = new Gcp.Compute.Inputs.PacketMirroringMirroredResourcesArgs
 *         {
 *             Tags = new[]
 *             {
 *                 "foo",
 *             },
 *             Instances = new[]
 *             {
 *                 new Gcp.Compute.Inputs.PacketMirroringMirroredResourcesInstanceArgs
 *                 {
 *                     Url = mirror.Id,
 *                 },
 *             },
 *         },
 *         Filter = new Gcp.Compute.Inputs.PacketMirroringFilterArgs
 *         {
 *             IpProtocols = new[]
 *             {
 *                 "tcp",
 *             },
 *             CidrRanges = new[]
 *             {
 *                 "0.0.0.0/0",
 *             },
 *             Direction = "BOTH",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
 * 			Name: pulumi.String("my-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		mirror, err := compute.NewInstance(ctx, "mirror", &compute.InstanceArgs{
 * 			NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
 * 				&compute.InstanceNetworkInterfaceArgs{
 * 					AccessConfigs: compute.InstanceNetworkInterfaceAccessConfigArray{
 * 						nil,
 * 					},
 * 					Network: _default.ID(),
 * 				},
 * 			},
 * 			Name:        pulumi.String("my-instance"),
 * 			MachineType: pulumi.String("e2-medium"),
 * 			BootDisk: &compute.InstanceBootDiskArgs{
 * 				InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
 * 					Image: pulumi.String("debian-cloud/debian-11"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
 * 			Name:        pulumi.String("my-subnetwork"),
 * 			Network:     _default.ID(),
 * 			IpCidrRange: pulumi.String("10.2.0.0/16"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultHealthCheck, err := compute.NewHealthCheck(ctx, "default", &compute.HealthCheckArgs{
 * 			Name:             pulumi.String("my-healthcheck"),
 * 			CheckIntervalSec: pulumi.Int(1),
 * 			TimeoutSec:       pulumi.Int(1),
 * 			TcpHealthCheck: &compute.HealthCheckTcpHealthCheckArgs{
 * 				Port: pulumi.Int(80),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultRegionBackendService, err := compute.NewRegionBackendService(ctx, "default", &compute.RegionBackendServiceArgs{
 * 			Name:         pulumi.String("my-service"),
 * 			HealthChecks: defaultHealthCheck.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultForwardingRule, err := compute.NewForwardingRule(ctx, "default", &compute.ForwardingRuleArgs{
 * 			Name:                 pulumi.String("my-ilb"),
 * 			IsMirroringCollector: pulumi.Bool(true),
 * 			IpProtocol:           pulumi.String("TCP"),
 * 			LoadBalancingScheme:  pulumi.String("INTERNAL"),
 * 			BackendService:       defaultRegionBackendService.ID(),
 * 			AllPorts:             pulumi.Bool(true),
 * 			Network:              _default.ID(),
 * 			Subnetwork:           defaultSubnetwork.ID(),
 * 			NetworkTier:          pulumi.String("PREMIUM"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewPacketMirroring(ctx, "foobar", &compute.PacketMirroringArgs{
 * 			Name:        pulumi.String("my-mirroring"),
 * 			Description: pulumi.String("bar"),
 * 			Network: &compute.PacketMirroringNetworkArgs{
 * 				Url: _default.ID(),
 * 			},
 * 			CollectorIlb: &compute.PacketMirroringCollectorIlbArgs{
 * 				Url: defaultForwardingRule.ID(),
 * 			},
 * 			MirroredResources: &compute.PacketMirroringMirroredResourcesArgs{
 * 				Tags: pulumi.StringArray{
 * 					pulumi.String("foo"),
 * 				},
 * 				Instances: compute.PacketMirroringMirroredResourcesInstanceArray{
 * 					&compute.PacketMirroringMirroredResourcesInstanceArgs{
 * 						Url: mirror.ID(),
 * 					},
 * 				},
 * 			},
 * 			Filter: &compute.PacketMirroringFilterArgs{
 * 				IpProtocols: pulumi.StringArray{
 * 					pulumi.String("tcp"),
 * 				},
 * 				CidrRanges: pulumi.StringArray{
 * 					pulumi.String("0.0.0.0/0"),
 * 				},
 * 				Direction: pulumi.String("BOTH"),
 * 			},
 * 		})
 * 		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.gcp.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.Instance;
 * import com.pulumi.gcp.compute.InstanceArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
 * import com.pulumi.gcp.compute.Subnetwork;
 * import com.pulumi.gcp.compute.SubnetworkArgs;
 * import com.pulumi.gcp.compute.HealthCheck;
 * import com.pulumi.gcp.compute.HealthCheckArgs;
 * import com.pulumi.gcp.compute.inputs.HealthCheckTcpHealthCheckArgs;
 * import com.pulumi.gcp.compute.RegionBackendService;
 * import com.pulumi.gcp.compute.RegionBackendServiceArgs;
 * import com.pulumi.gcp.compute.ForwardingRule;
 * import com.pulumi.gcp.compute.ForwardingRuleArgs;
 * import com.pulumi.gcp.compute.PacketMirroring;
 * import com.pulumi.gcp.compute.PacketMirroringArgs;
 * import com.pulumi.gcp.compute.inputs.PacketMirroringNetworkArgs;
 * import com.pulumi.gcp.compute.inputs.PacketMirroringCollectorIlbArgs;
 * import com.pulumi.gcp.compute.inputs.PacketMirroringMirroredResourcesArgs;
 * import com.pulumi.gcp.compute.inputs.PacketMirroringFilterArgs;
 * 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 default_ = new Network("default", NetworkArgs.builder()
 *             .name("my-network")
 *             .build());
 *         var mirror = new Instance("mirror", InstanceArgs.builder()
 *             .networkInterfaces(InstanceNetworkInterfaceArgs.builder()
 *                 .accessConfigs()
 *                 .network(default_.id())
 *                 .build())
 *             .name("my-instance")
 *             .machineType("e2-medium")
 *             .bootDisk(InstanceBootDiskArgs.builder()
 *                 .initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
 *                     .image("debian-cloud/debian-11")
 *                     .build())
 *                 .build())
 *             .build());
 *         var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
 *             .name("my-subnetwork")
 *             .network(default_.id())
 *             .ipCidrRange("10.2.0.0/16")
 *             .build());
 *         var defaultHealthCheck = new HealthCheck("defaultHealthCheck", HealthCheckArgs.builder()
 *             .name("my-healthcheck")
 *             .checkIntervalSec(1)
 *             .timeoutSec(1)
 *             .tcpHealthCheck(HealthCheckTcpHealthCheckArgs.builder()
 *                 .port("80")
 *                 .build())
 *             .build());
 *         var defaultRegionBackendService = new RegionBackendService("defaultRegionBackendService", RegionBackendServiceArgs.builder()
 *             .name("my-service")
 *             .healthChecks(defaultHealthCheck.id())
 *             .build());
 *         var defaultForwardingRule = new ForwardingRule("defaultForwardingRule", ForwardingRuleArgs.builder()
 *             .name("my-ilb")
 *             .isMirroringCollector(true)
 *             .ipProtocol("TCP")
 *             .loadBalancingScheme("INTERNAL")
 *             .backendService(defaultRegionBackendService.id())
 *             .allPorts(true)
 *             .network(default_.id())
 *             .subnetwork(defaultSubnetwork.id())
 *             .networkTier("PREMIUM")
 *             .build());
 *         var foobar = new PacketMirroring("foobar", PacketMirroringArgs.builder()
 *             .name("my-mirroring")
 *             .description("bar")
 *             .network(PacketMirroringNetworkArgs.builder()
 *                 .url(default_.id())
 *                 .build())
 *             .collectorIlb(PacketMirroringCollectorIlbArgs.builder()
 *                 .url(defaultForwardingRule.id())
 *                 .build())
 *             .mirroredResources(PacketMirroringMirroredResourcesArgs.builder()
 *                 .tags("foo")
 *                 .instances(PacketMirroringMirroredResourcesInstanceArgs.builder()
 *                     .url(mirror.id())
 *                     .build())
 *                 .build())
 *             .filter(PacketMirroringFilterArgs.builder()
 *                 .ipProtocols("tcp")
 *                 .cidrRanges("0.0.0.0/0")
 *                 .direction("BOTH")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   mirror:
 *     type: gcp:compute:Instance
 *     properties:
 *       networkInterfaces:
 *         - accessConfigs:
 *             - {}
 *           network: ${default.id}
 *       name: my-instance
 *       machineType: e2-medium
 *       bootDisk:
 *         initializeParams:
 *           image: debian-cloud/debian-11
 *   default:
 *     type: gcp:compute:Network
 *     properties:
 *       name: my-network
 *   defaultSubnetwork:
 *     type: gcp:compute:Subnetwork
 *     name: default
 *     properties:
 *       name: my-subnetwork
 *       network: ${default.id}
 *       ipCidrRange: 10.2.0.0/16
 *   defaultRegionBackendService:
 *     type: gcp:compute:RegionBackendService
 *     name: default
 *     properties:
 *       name: my-service
 *       healthChecks: ${defaultHealthCheck.id}
 *   defaultHealthCheck:
 *     type: gcp:compute:HealthCheck
 *     name: default
 *     properties:
 *       name: my-healthcheck
 *       checkIntervalSec: 1
 *       timeoutSec: 1
 *       tcpHealthCheck:
 *         port: '80'
 *   defaultForwardingRule:
 *     type: gcp:compute:ForwardingRule
 *     name: default
 *     properties:
 *       name: my-ilb
 *       isMirroringCollector: true
 *       ipProtocol: TCP
 *       loadBalancingScheme: INTERNAL
 *       backendService: ${defaultRegionBackendService.id}
 *       allPorts: true
 *       network: ${default.id}
 *       subnetwork: ${defaultSubnetwork.id}
 *       networkTier: PREMIUM
 *   foobar:
 *     type: gcp:compute:PacketMirroring
 *     properties:
 *       name: my-mirroring
 *       description: bar
 *       network:
 *         url: ${default.id}
 *       collectorIlb:
 *         url: ${defaultForwardingRule.id}
 *       mirroredResources:
 *         tags:
 *           - foo
 *         instances:
 *           - url: ${mirror.id}
 *       filter:
 *         ipProtocols:
 *           - tcp
 *         cidrRanges:
 *           - 0.0.0.0/0
 *         direction: BOTH
 * ```
 * 
 * ## Import
 * PacketMirroring can be imported using any of these accepted formats:
 * * `projects/{{project}}/regions/{{region}}/packetMirrorings/{{name}}`
 * * `{{project}}/{{region}}/{{name}}`
 * * `{{region}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, PacketMirroring can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/packetMirroring:PacketMirroring default projects/{{project}}/regions/{{region}}/packetMirrorings/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/packetMirroring:PacketMirroring default {{project}}/{{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/packetMirroring:PacketMirroring default {{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/packetMirroring:PacketMirroring default {{name}}
 * ```
 * @property collectorIlb The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL)
 * that will be used as collector for mirrored traffic. The
 * specified forwarding rule must have is_mirroring_collector
 * set to true.
 * Structure is documented below.
 * @property description A human-readable description of the rule.
 * @property filter A filter for mirrored traffic. If unset, all traffic is mirrored.
 * @property mirroredResources A means of specifying which resources to mirror.
 * Structure is documented below.
 * @property name The name of the packet mirroring rule
 * @property network Specifies the mirrored VPC network. Only packets in this network
 * will be mirrored. All mirrored VMs should have a NIC in the given
 * network. All mirrored subnetworks should belong to the given network.
 * Structure is documented below.
 * @property priority Since only one rule can be active at a time, priority is used to break ties in the case of two rules that apply to the
 * same instances.
 * @property project
 * @property region The Region in which the created address should reside. If it is not provided, the provider region is used.
 */
public data class PacketMirroringArgs(
    public val collectorIlb: Output? = null,
    public val description: Output? = null,
    public val filter: Output? = null,
    public val mirroredResources: Output? = null,
    public val name: Output? = null,
    public val network: Output? = null,
    public val priority: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.PacketMirroringArgs =
        com.pulumi.gcp.compute.PacketMirroringArgs.builder()
            .collectorIlb(collectorIlb?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .filter(filter?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .mirroredResources(mirroredResources?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .network(network?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .priority(priority?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [PacketMirroringArgs].
 */
@PulumiTagMarker
public class PacketMirroringArgsBuilder internal constructor() {
    private var collectorIlb: Output? = null

    private var description: Output? = null

    private var filter: Output? = null

    private var mirroredResources: Output? = null

    private var name: Output? = null

    private var network: Output? = null

    private var priority: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    /**
     * @param value The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL)
     * that will be used as collector for mirrored traffic. The
     * specified forwarding rule must have is_mirroring_collector
     * set to true.
     * Structure is documented below.
     */
    @JvmName("tfxtaxkfaydkdabx")
    public suspend fun collectorIlb(`value`: Output) {
        this.collectorIlb = value
    }

    /**
     * @param value A human-readable description of the rule.
     */
    @JvmName("kriienbppydysvbb")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value A filter for mirrored traffic. If unset, all traffic is mirrored.
     */
    @JvmName("rinypxktdmoferex")
    public suspend fun filter(`value`: Output) {
        this.filter = value
    }

    /**
     * @param value A means of specifying which resources to mirror.
     * Structure is documented below.
     */
    @JvmName("caqkqynqrlutvxbj")
    public suspend fun mirroredResources(`value`: Output) {
        this.mirroredResources = value
    }

    /**
     * @param value The name of the packet mirroring rule
     */
    @JvmName("viyxmdpshublpoiw")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Specifies the mirrored VPC network. Only packets in this network
     * will be mirrored. All mirrored VMs should have a NIC in the given
     * network. All mirrored subnetworks should belong to the given network.
     * Structure is documented below.
     */
    @JvmName("hcdoamemtlndrnjm")
    public suspend fun network(`value`: Output) {
        this.network = value
    }

    /**
     * @param value Since only one rule can be active at a time, priority is used to break ties in the case of two rules that apply to the
     * same instances.
     */
    @JvmName("trqkngmhcsyflnpq")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value
     */
    @JvmName("kpmxjrhshkfkfkbh")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The Region in which the created address should reside. If it is not provided, the provider region is used.
     */
    @JvmName("ibceyuramlcltkkt")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL)
     * that will be used as collector for mirrored traffic. The
     * specified forwarding rule must have is_mirroring_collector
     * set to true.
     * Structure is documented below.
     */
    @JvmName("mbjsudvmcsclhxgs")
    public suspend fun collectorIlb(`value`: PacketMirroringCollectorIlbArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.collectorIlb = mapped
    }

    /**
     * @param argument The Forwarding Rule resource (of type load_balancing_scheme=INTERNAL)
     * that will be used as collector for mirrored traffic. The
     * specified forwarding rule must have is_mirroring_collector
     * set to true.
     * Structure is documented below.
     */
    @JvmName("vbqgdtscqsryyntk")
    public suspend fun collectorIlb(argument: suspend PacketMirroringCollectorIlbArgsBuilder.() -> Unit) {
        val toBeMapped = PacketMirroringCollectorIlbArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.collectorIlb = mapped
    }

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

    /**
     * @param value A filter for mirrored traffic. If unset, all traffic is mirrored.
     */
    @JvmName("usomrpqmgdbjvbdo")
    public suspend fun filter(`value`: PacketMirroringFilterArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filter = mapped
    }

    /**
     * @param argument A filter for mirrored traffic. If unset, all traffic is mirrored.
     */
    @JvmName("oneqheqhirfewnev")
    public suspend fun filter(argument: suspend PacketMirroringFilterArgsBuilder.() -> Unit) {
        val toBeMapped = PacketMirroringFilterArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.filter = mapped
    }

    /**
     * @param value A means of specifying which resources to mirror.
     * Structure is documented below.
     */
    @JvmName("ecuwifvqfywtfrba")
    public suspend fun mirroredResources(`value`: PacketMirroringMirroredResourcesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.mirroredResources = mapped
    }

    /**
     * @param argument A means of specifying which resources to mirror.
     * Structure is documented below.
     */
    @JvmName("udgormcpftcchvfw")
    public suspend fun mirroredResources(argument: suspend PacketMirroringMirroredResourcesArgsBuilder.() -> Unit) {
        val toBeMapped = PacketMirroringMirroredResourcesArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.mirroredResources = mapped
    }

    /**
     * @param value The name of the packet mirroring rule
     */
    @JvmName("jnecpomafbtjxpci")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Specifies the mirrored VPC network. Only packets in this network
     * will be mirrored. All mirrored VMs should have a NIC in the given
     * network. All mirrored subnetworks should belong to the given network.
     * Structure is documented below.
     */
    @JvmName("xsabvuoigindvhup")
    public suspend fun network(`value`: PacketMirroringNetworkArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.network = mapped
    }

    /**
     * @param argument Specifies the mirrored VPC network. Only packets in this network
     * will be mirrored. All mirrored VMs should have a NIC in the given
     * network. All mirrored subnetworks should belong to the given network.
     * Structure is documented below.
     */
    @JvmName("kgfuosedtdrwyfng")
    public suspend fun network(argument: suspend PacketMirroringNetworkArgsBuilder.() -> Unit) {
        val toBeMapped = PacketMirroringNetworkArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.network = mapped
    }

    /**
     * @param value Since only one rule can be active at a time, priority is used to break ties in the case of two rules that apply to the
     * same instances.
     */
    @JvmName("cjennravqpapvpkw")
    public suspend fun priority(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value
     */
    @JvmName("qeslwsjjbgjcufyy")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The Region in which the created address should reside. If it is not provided, the provider region is used.
     */
    @JvmName("vmggkhlmqaqpsnwe")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    internal fun build(): PacketMirroringArgs = PacketMirroringArgs(
        collectorIlb = collectorIlb,
        description = description,
        filter = filter,
        mirroredResources = mirroredResources,
        name = name,
        network = network,
        priority = priority,
        project = project,
        region = region,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy