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

com.pulumi.gcp.compute.kotlin.VPNTunnelArgs.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.VPNTunnelArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * VPN tunnel resource.
 * To get more information about VpnTunnel, see:
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/vpnTunnels)
 * * How-to Guides
 *     * [Cloud VPN Overview](https://cloud.google.com/vpn/docs/concepts/overview)
 *     * [Networks and Tunnel Routing](https://cloud.google.com/vpn/docs/concepts/choosing-networks-routing)
 * ## Example Usage
 * ### Vpn Tunnel Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const network1 = new gcp.compute.Network("network1", {name: "network-1"});
 * const targetGateway = new gcp.compute.VPNGateway("target_gateway", {
 *     name: "vpn-1",
 *     network: network1.id,
 * });
 * const tunnel1 = new gcp.compute.VPNTunnel("tunnel1", {
 *     name: "tunnel-1",
 *     peerIp: "15.0.0.120",
 *     sharedSecret: "a secret message",
 *     targetVpnGateway: targetGateway.id,
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * const vpnStaticIp = new gcp.compute.Address("vpn_static_ip", {name: "vpn-static-ip"});
 * const frEsp = new gcp.compute.ForwardingRule("fr_esp", {
 *     name: "fr-esp",
 *     ipProtocol: "ESP",
 *     ipAddress: vpnStaticIp.address,
 *     target: targetGateway.id,
 * });
 * const frUdp500 = new gcp.compute.ForwardingRule("fr_udp500", {
 *     name: "fr-udp500",
 *     ipProtocol: "UDP",
 *     portRange: "500",
 *     ipAddress: vpnStaticIp.address,
 *     target: targetGateway.id,
 * });
 * const frUdp4500 = new gcp.compute.ForwardingRule("fr_udp4500", {
 *     name: "fr-udp4500",
 *     ipProtocol: "UDP",
 *     portRange: "4500",
 *     ipAddress: vpnStaticIp.address,
 *     target: targetGateway.id,
 * });
 * const route1 = new gcp.compute.Route("route1", {
 *     name: "route1",
 *     network: network1.name,
 *     destRange: "15.0.0.0/24",
 *     priority: 1000,
 *     nextHopVpnTunnel: tunnel1.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * network1 = gcp.compute.Network("network1", name="network-1")
 * target_gateway = gcp.compute.VPNGateway("target_gateway",
 *     name="vpn-1",
 *     network=network1.id)
 * tunnel1 = gcp.compute.VPNTunnel("tunnel1",
 *     name="tunnel-1",
 *     peer_ip="15.0.0.120",
 *     shared_secret="a secret message",
 *     target_vpn_gateway=target_gateway.id,
 *     labels={
 *         "foo": "bar",
 *     })
 * vpn_static_ip = gcp.compute.Address("vpn_static_ip", name="vpn-static-ip")
 * fr_esp = gcp.compute.ForwardingRule("fr_esp",
 *     name="fr-esp",
 *     ip_protocol="ESP",
 *     ip_address=vpn_static_ip.address,
 *     target=target_gateway.id)
 * fr_udp500 = gcp.compute.ForwardingRule("fr_udp500",
 *     name="fr-udp500",
 *     ip_protocol="UDP",
 *     port_range="500",
 *     ip_address=vpn_static_ip.address,
 *     target=target_gateway.id)
 * fr_udp4500 = gcp.compute.ForwardingRule("fr_udp4500",
 *     name="fr-udp4500",
 *     ip_protocol="UDP",
 *     port_range="4500",
 *     ip_address=vpn_static_ip.address,
 *     target=target_gateway.id)
 * route1 = gcp.compute.Route("route1",
 *     name="route1",
 *     network=network1.name,
 *     dest_range="15.0.0.0/24",
 *     priority=1000,
 *     next_hop_vpn_tunnel=tunnel1.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var network1 = new Gcp.Compute.Network("network1", new()
 *     {
 *         Name = "network-1",
 *     });
 *     var targetGateway = new Gcp.Compute.VPNGateway("target_gateway", new()
 *     {
 *         Name = "vpn-1",
 *         Network = network1.Id,
 *     });
 *     var tunnel1 = new Gcp.Compute.VPNTunnel("tunnel1", new()
 *     {
 *         Name = "tunnel-1",
 *         PeerIp = "15.0.0.120",
 *         SharedSecret = "a secret message",
 *         TargetVpnGateway = targetGateway.Id,
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *     });
 *     var vpnStaticIp = new Gcp.Compute.Address("vpn_static_ip", new()
 *     {
 *         Name = "vpn-static-ip",
 *     });
 *     var frEsp = new Gcp.Compute.ForwardingRule("fr_esp", new()
 *     {
 *         Name = "fr-esp",
 *         IpProtocol = "ESP",
 *         IpAddress = vpnStaticIp.IPAddress,
 *         Target = targetGateway.Id,
 *     });
 *     var frUdp500 = new Gcp.Compute.ForwardingRule("fr_udp500", new()
 *     {
 *         Name = "fr-udp500",
 *         IpProtocol = "UDP",
 *         PortRange = "500",
 *         IpAddress = vpnStaticIp.IPAddress,
 *         Target = targetGateway.Id,
 *     });
 *     var frUdp4500 = new Gcp.Compute.ForwardingRule("fr_udp4500", new()
 *     {
 *         Name = "fr-udp4500",
 *         IpProtocol = "UDP",
 *         PortRange = "4500",
 *         IpAddress = vpnStaticIp.IPAddress,
 *         Target = targetGateway.Id,
 *     });
 *     var route1 = new Gcp.Compute.Route("route1", new()
 *     {
 *         Name = "route1",
 *         Network = network1.Name,
 *         DestRange = "15.0.0.0/24",
 *         Priority = 1000,
 *         NextHopVpnTunnel = tunnel1.Id,
 *     });
 * });
 * ```
 * ```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 {
 * 		network1, err := compute.NewNetwork(ctx, "network1", &compute.NetworkArgs{
 * 			Name: pulumi.String("network-1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		targetGateway, err := compute.NewVPNGateway(ctx, "target_gateway", &compute.VPNGatewayArgs{
 * 			Name:    pulumi.String("vpn-1"),
 * 			Network: network1.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		tunnel1, err := compute.NewVPNTunnel(ctx, "tunnel1", &compute.VPNTunnelArgs{
 * 			Name:             pulumi.String("tunnel-1"),
 * 			PeerIp:           pulumi.String("15.0.0.120"),
 * 			SharedSecret:     pulumi.String("a secret message"),
 * 			TargetVpnGateway: targetGateway.ID(),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		vpnStaticIp, err := compute.NewAddress(ctx, "vpn_static_ip", &compute.AddressArgs{
 * 			Name: pulumi.String("vpn-static-ip"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewForwardingRule(ctx, "fr_esp", &compute.ForwardingRuleArgs{
 * 			Name:       pulumi.String("fr-esp"),
 * 			IpProtocol: pulumi.String("ESP"),
 * 			IpAddress:  vpnStaticIp.Address,
 * 			Target:     targetGateway.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewForwardingRule(ctx, "fr_udp500", &compute.ForwardingRuleArgs{
 * 			Name:       pulumi.String("fr-udp500"),
 * 			IpProtocol: pulumi.String("UDP"),
 * 			PortRange:  pulumi.String("500"),
 * 			IpAddress:  vpnStaticIp.Address,
 * 			Target:     targetGateway.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewForwardingRule(ctx, "fr_udp4500", &compute.ForwardingRuleArgs{
 * 			Name:       pulumi.String("fr-udp4500"),
 * 			IpProtocol: pulumi.String("UDP"),
 * 			PortRange:  pulumi.String("4500"),
 * 			IpAddress:  vpnStaticIp.Address,
 * 			Target:     targetGateway.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewRoute(ctx, "route1", &compute.RouteArgs{
 * 			Name:             pulumi.String("route1"),
 * 			Network:          network1.Name,
 * 			DestRange:        pulumi.String("15.0.0.0/24"),
 * 			Priority:         pulumi.Int(1000),
 * 			NextHopVpnTunnel: tunnel1.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.gcp.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.VPNGateway;
 * import com.pulumi.gcp.compute.VPNGatewayArgs;
 * import com.pulumi.gcp.compute.VPNTunnel;
 * import com.pulumi.gcp.compute.VPNTunnelArgs;
 * import com.pulumi.gcp.compute.Address;
 * import com.pulumi.gcp.compute.AddressArgs;
 * import com.pulumi.gcp.compute.ForwardingRule;
 * import com.pulumi.gcp.compute.ForwardingRuleArgs;
 * import com.pulumi.gcp.compute.Route;
 * import com.pulumi.gcp.compute.RouteArgs;
 * 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 network1 = new Network("network1", NetworkArgs.builder()
 *             .name("network-1")
 *             .build());
 *         var targetGateway = new VPNGateway("targetGateway", VPNGatewayArgs.builder()
 *             .name("vpn-1")
 *             .network(network1.id())
 *             .build());
 *         var tunnel1 = new VPNTunnel("tunnel1", VPNTunnelArgs.builder()
 *             .name("tunnel-1")
 *             .peerIp("15.0.0.120")
 *             .sharedSecret("a secret message")
 *             .targetVpnGateway(targetGateway.id())
 *             .labels(Map.of("foo", "bar"))
 *             .build());
 *         var vpnStaticIp = new Address("vpnStaticIp", AddressArgs.builder()
 *             .name("vpn-static-ip")
 *             .build());
 *         var frEsp = new ForwardingRule("frEsp", ForwardingRuleArgs.builder()
 *             .name("fr-esp")
 *             .ipProtocol("ESP")
 *             .ipAddress(vpnStaticIp.address())
 *             .target(targetGateway.id())
 *             .build());
 *         var frUdp500 = new ForwardingRule("frUdp500", ForwardingRuleArgs.builder()
 *             .name("fr-udp500")
 *             .ipProtocol("UDP")
 *             .portRange("500")
 *             .ipAddress(vpnStaticIp.address())
 *             .target(targetGateway.id())
 *             .build());
 *         var frUdp4500 = new ForwardingRule("frUdp4500", ForwardingRuleArgs.builder()
 *             .name("fr-udp4500")
 *             .ipProtocol("UDP")
 *             .portRange("4500")
 *             .ipAddress(vpnStaticIp.address())
 *             .target(targetGateway.id())
 *             .build());
 *         var route1 = new Route("route1", RouteArgs.builder()
 *             .name("route1")
 *             .network(network1.name())
 *             .destRange("15.0.0.0/24")
 *             .priority(1000)
 *             .nextHopVpnTunnel(tunnel1.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   tunnel1:
 *     type: gcp:compute:VPNTunnel
 *     properties:
 *       name: tunnel-1
 *       peerIp: 15.0.0.120
 *       sharedSecret: a secret message
 *       targetVpnGateway: ${targetGateway.id}
 *       labels:
 *         foo: bar
 *   targetGateway:
 *     type: gcp:compute:VPNGateway
 *     name: target_gateway
 *     properties:
 *       name: vpn-1
 *       network: ${network1.id}
 *   network1:
 *     type: gcp:compute:Network
 *     properties:
 *       name: network-1
 *   vpnStaticIp:
 *     type: gcp:compute:Address
 *     name: vpn_static_ip
 *     properties:
 *       name: vpn-static-ip
 *   frEsp:
 *     type: gcp:compute:ForwardingRule
 *     name: fr_esp
 *     properties:
 *       name: fr-esp
 *       ipProtocol: ESP
 *       ipAddress: ${vpnStaticIp.address}
 *       target: ${targetGateway.id}
 *   frUdp500:
 *     type: gcp:compute:ForwardingRule
 *     name: fr_udp500
 *     properties:
 *       name: fr-udp500
 *       ipProtocol: UDP
 *       portRange: '500'
 *       ipAddress: ${vpnStaticIp.address}
 *       target: ${targetGateway.id}
 *   frUdp4500:
 *     type: gcp:compute:ForwardingRule
 *     name: fr_udp4500
 *     properties:
 *       name: fr-udp4500
 *       ipProtocol: UDP
 *       portRange: '4500'
 *       ipAddress: ${vpnStaticIp.address}
 *       target: ${targetGateway.id}
 *   route1:
 *     type: gcp:compute:Route
 *     properties:
 *       name: route1
 *       network: ${network1.name}
 *       destRange: 15.0.0.0/24
 *       priority: 1000
 *       nextHopVpnTunnel: ${tunnel1.id}
 * ```
 * 
 * ## Import
 * VpnTunnel can be imported using any of these accepted formats:
 * * `projects/{{project}}/regions/{{region}}/vpnTunnels/{{name}}`
 * * `{{project}}/{{region}}/{{name}}`
 * * `{{region}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, VpnTunnel can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/vPNTunnel:VPNTunnel default projects/{{project}}/regions/{{region}}/vpnTunnels/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/vPNTunnel:VPNTunnel default {{project}}/{{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/vPNTunnel:VPNTunnel default {{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/vPNTunnel:VPNTunnel default {{name}}
 * ```
 * @property description An optional description of this resource.
 * @property ikeVersion IKE protocol version to use when establishing the VPN tunnel with
 * peer VPN gateway.
 * Acceptable IKE versions are 1 or 2. Default version is 2.
 * @property labels Labels to apply to this VpnTunnel.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the resource.
 * @property localTrafficSelectors Local traffic selector to use when establishing the VPN tunnel with
 * peer VPN gateway. The value should be a CIDR formatted string,
 * for example `192.168.0.0/16`. The ranges should be disjoint.
 * Only IPv4 is supported.
 * @property name Name of the resource. The name must be 1-63 characters long, and
 * comply with RFC1035. Specifically, the name must be 1-63
 * characters long and match the regular expression
 * `a-z?` which means the first character
 * must be a lowercase letter, and all following characters must
 * be a dash, lowercase letter, or digit,
 * except the last character, which cannot be a dash.
 * @property peerExternalGateway URL of the peer side external VPN gateway to which this VPN tunnel is connected.
 * @property peerExternalGatewayInterface The interface ID of the external VPN gateway to which this VPN tunnel is connected.
 * @property peerGcpGateway URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected.
 * If provided, the VPN tunnel will automatically use the same vpn_gateway_interface
 * ID in the peer GCP VPN gateway.
 * This field must reference a `gcp.compute.HaVpnGateway` resource.
 * @property peerIp IP address of the peer VPN gateway. Only IPv4 is supported.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property region The region where the tunnel is located. If unset, is set to the region of `target_vpn_gateway`.
 * @property remoteTrafficSelectors Remote traffic selector to use when establishing the VPN tunnel with
 * peer VPN gateway. The value should be a CIDR formatted string,
 * for example `192.168.0.0/16`. The ranges should be disjoint.
 * Only IPv4 is supported.
 * @property router URL of router resource to be used for dynamic routing.
 * @property sharedSecret Shared secret used to set the secure session between the Cloud VPN
 * gateway and the peer VPN gateway.
 * **Note**: This property is sensitive and will not be displayed in the plan.
 * - - -
 * @property targetVpnGateway URL of the Target VPN gateway with which this VPN tunnel is
 * associated.
 * @property vpnGateway URL of the VPN gateway with which this VPN tunnel is associated.
 * This must be used if a High Availability VPN gateway resource is created.
 * This field must reference a `gcp.compute.HaVpnGateway` resource.
 * @property vpnGatewayInterface The interface ID of the VPN gateway with which this VPN tunnel is associated.
 */
public data class VPNTunnelArgs(
    public val description: Output? = null,
    public val ikeVersion: Output? = null,
    public val labels: Output>? = null,
    public val localTrafficSelectors: Output>? = null,
    public val name: Output? = null,
    public val peerExternalGateway: Output? = null,
    public val peerExternalGatewayInterface: Output? = null,
    public val peerGcpGateway: Output? = null,
    public val peerIp: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
    public val remoteTrafficSelectors: Output>? = null,
    public val router: Output? = null,
    public val sharedSecret: Output? = null,
    public val targetVpnGateway: Output? = null,
    public val vpnGateway: Output? = null,
    public val vpnGatewayInterface: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.VPNTunnelArgs =
        com.pulumi.gcp.compute.VPNTunnelArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .ikeVersion(ikeVersion?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .localTrafficSelectors(localTrafficSelectors?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .peerExternalGateway(peerExternalGateway?.applyValue({ args0 -> args0 }))
            .peerExternalGatewayInterface(peerExternalGatewayInterface?.applyValue({ args0 -> args0 }))
            .peerGcpGateway(peerGcpGateway?.applyValue({ args0 -> args0 }))
            .peerIp(peerIp?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 }))
            .remoteTrafficSelectors(
                remoteTrafficSelectors?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .router(router?.applyValue({ args0 -> args0 }))
            .sharedSecret(sharedSecret?.applyValue({ args0 -> args0 }))
            .targetVpnGateway(targetVpnGateway?.applyValue({ args0 -> args0 }))
            .vpnGateway(vpnGateway?.applyValue({ args0 -> args0 }))
            .vpnGatewayInterface(vpnGatewayInterface?.applyValue({ args0 -> args0 })).build()
}

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

    private var ikeVersion: Output? = null

    private var labels: Output>? = null

    private var localTrafficSelectors: Output>? = null

    private var name: Output? = null

    private var peerExternalGateway: Output? = null

    private var peerExternalGatewayInterface: Output? = null

    private var peerGcpGateway: Output? = null

    private var peerIp: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    private var remoteTrafficSelectors: Output>? = null

    private var router: Output? = null

    private var sharedSecret: Output? = null

    private var targetVpnGateway: Output? = null

    private var vpnGateway: Output? = null

    private var vpnGatewayInterface: Output? = null

    /**
     * @param value An optional description of this resource.
     */
    @JvmName("cmvirsywtalqjbjs")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value IKE protocol version to use when establishing the VPN tunnel with
     * peer VPN gateway.
     * Acceptable IKE versions are 1 or 2. Default version is 2.
     */
    @JvmName("ewuucovhboebcpbo")
    public suspend fun ikeVersion(`value`: Output) {
        this.ikeVersion = value
    }

    /**
     * @param value Labels to apply to this VpnTunnel.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("iybncbqicoxhyomm")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value Local traffic selector to use when establishing the VPN tunnel with
     * peer VPN gateway. The value should be a CIDR formatted string,
     * for example `192.168.0.0/16`. The ranges should be disjoint.
     * Only IPv4 is supported.
     */
    @JvmName("rmguupbjpebhsssn")
    public suspend fun localTrafficSelectors(`value`: Output>) {
        this.localTrafficSelectors = value
    }

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

    /**
     * @param values Local traffic selector to use when establishing the VPN tunnel with
     * peer VPN gateway. The value should be a CIDR formatted string,
     * for example `192.168.0.0/16`. The ranges should be disjoint.
     * Only IPv4 is supported.
     */
    @JvmName("cunwrcluufnsdbwv")
    public suspend fun localTrafficSelectors(values: List>) {
        this.localTrafficSelectors = Output.all(values)
    }

    /**
     * @param value Name of the resource. The name must be 1-63 characters long, and
     * comply with RFC1035. Specifically, the name must be 1-63
     * characters long and match the regular expression
     * `a-z?` which means the first character
     * must be a lowercase letter, and all following characters must
     * be a dash, lowercase letter, or digit,
     * except the last character, which cannot be a dash.
     */
    @JvmName("jqsvhsqbifktqxos")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value URL of the peer side external VPN gateway to which this VPN tunnel is connected.
     */
    @JvmName("qtiwhuwpllrpkkqf")
    public suspend fun peerExternalGateway(`value`: Output) {
        this.peerExternalGateway = value
    }

    /**
     * @param value The interface ID of the external VPN gateway to which this VPN tunnel is connected.
     */
    @JvmName("wlyivmsgsxkvquol")
    public suspend fun peerExternalGatewayInterface(`value`: Output) {
        this.peerExternalGatewayInterface = value
    }

    /**
     * @param value URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected.
     * If provided, the VPN tunnel will automatically use the same vpn_gateway_interface
     * ID in the peer GCP VPN gateway.
     * This field must reference a `gcp.compute.HaVpnGateway` resource.
     */
    @JvmName("aiiglsutogmuxuht")
    public suspend fun peerGcpGateway(`value`: Output) {
        this.peerGcpGateway = value
    }

    /**
     * @param value IP address of the peer VPN gateway. Only IPv4 is supported.
     */
    @JvmName("cfxrchepcymmytkg")
    public suspend fun peerIp(`value`: Output) {
        this.peerIp = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("cwntaotbvtxloiep")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The region where the tunnel is located. If unset, is set to the region of `target_vpn_gateway`.
     */
    @JvmName("ltjkjgofhbsiiwan")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value Remote traffic selector to use when establishing the VPN tunnel with
     * peer VPN gateway. The value should be a CIDR formatted string,
     * for example `192.168.0.0/16`. The ranges should be disjoint.
     * Only IPv4 is supported.
     */
    @JvmName("epmevxdwtjgqgmde")
    public suspend fun remoteTrafficSelectors(`value`: Output>) {
        this.remoteTrafficSelectors = value
    }

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

    /**
     * @param values Remote traffic selector to use when establishing the VPN tunnel with
     * peer VPN gateway. The value should be a CIDR formatted string,
     * for example `192.168.0.0/16`. The ranges should be disjoint.
     * Only IPv4 is supported.
     */
    @JvmName("ppsthsthcvrggfgs")
    public suspend fun remoteTrafficSelectors(values: List>) {
        this.remoteTrafficSelectors = Output.all(values)
    }

    /**
     * @param value URL of router resource to be used for dynamic routing.
     */
    @JvmName("bsqarmcqbwyihmmj")
    public suspend fun router(`value`: Output) {
        this.router = value
    }

    /**
     * @param value Shared secret used to set the secure session between the Cloud VPN
     * gateway and the peer VPN gateway.
     * **Note**: This property is sensitive and will not be displayed in the plan.
     * - - -
     */
    @JvmName("qllvjkxavefvwfgh")
    public suspend fun sharedSecret(`value`: Output) {
        this.sharedSecret = value
    }

    /**
     * @param value URL of the Target VPN gateway with which this VPN tunnel is
     * associated.
     */
    @JvmName("mfvgglgsbayftmjp")
    public suspend fun targetVpnGateway(`value`: Output) {
        this.targetVpnGateway = value
    }

    /**
     * @param value URL of the VPN gateway with which this VPN tunnel is associated.
     * This must be used if a High Availability VPN gateway resource is created.
     * This field must reference a `gcp.compute.HaVpnGateway` resource.
     */
    @JvmName("lxsefkbshklsknid")
    public suspend fun vpnGateway(`value`: Output) {
        this.vpnGateway = value
    }

    /**
     * @param value The interface ID of the VPN gateway with which this VPN tunnel is associated.
     */
    @JvmName("bjamsbfcgeliycxa")
    public suspend fun vpnGatewayInterface(`value`: Output) {
        this.vpnGatewayInterface = value
    }

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

    /**
     * @param value IKE protocol version to use when establishing the VPN tunnel with
     * peer VPN gateway.
     * Acceptable IKE versions are 1 or 2. Default version is 2.
     */
    @JvmName("lrucjgwdgxfpdwjx")
    public suspend fun ikeVersion(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ikeVersion = mapped
    }

    /**
     * @param value Labels to apply to this VpnTunnel.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("iulmjrpuxipqhdge")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Labels to apply to this VpnTunnel.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("oqjwkxmmkokkkaxt")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value Local traffic selector to use when establishing the VPN tunnel with
     * peer VPN gateway. The value should be a CIDR formatted string,
     * for example `192.168.0.0/16`. The ranges should be disjoint.
     * Only IPv4 is supported.
     */
    @JvmName("shifmblgdongtlpa")
    public suspend fun localTrafficSelectors(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.localTrafficSelectors = mapped
    }

    /**
     * @param values Local traffic selector to use when establishing the VPN tunnel with
     * peer VPN gateway. The value should be a CIDR formatted string,
     * for example `192.168.0.0/16`. The ranges should be disjoint.
     * Only IPv4 is supported.
     */
    @JvmName("ykwcwsbwsdbryjnd")
    public suspend fun localTrafficSelectors(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.localTrafficSelectors = mapped
    }

    /**
     * @param value Name of the resource. The name must be 1-63 characters long, and
     * comply with RFC1035. Specifically, the name must be 1-63
     * characters long and match the regular expression
     * `a-z?` which means the first character
     * must be a lowercase letter, and all following characters must
     * be a dash, lowercase letter, or digit,
     * except the last character, which cannot be a dash.
     */
    @JvmName("ahxhukrnwjoletre")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value URL of the peer side external VPN gateway to which this VPN tunnel is connected.
     */
    @JvmName("vdyliiitsesjkpcq")
    public suspend fun peerExternalGateway(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.peerExternalGateway = mapped
    }

    /**
     * @param value The interface ID of the external VPN gateway to which this VPN tunnel is connected.
     */
    @JvmName("qdtfscqwnejyclkk")
    public suspend fun peerExternalGatewayInterface(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.peerExternalGatewayInterface = mapped
    }

    /**
     * @param value URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected.
     * If provided, the VPN tunnel will automatically use the same vpn_gateway_interface
     * ID in the peer GCP VPN gateway.
     * This field must reference a `gcp.compute.HaVpnGateway` resource.
     */
    @JvmName("yaysixvlwcbersos")
    public suspend fun peerGcpGateway(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.peerGcpGateway = mapped
    }

    /**
     * @param value IP address of the peer VPN gateway. Only IPv4 is supported.
     */
    @JvmName("wedxffaxdwpjgvqx")
    public suspend fun peerIp(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.peerIp = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("uyqpylsesexgqowj")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The region where the tunnel is located. If unset, is set to the region of `target_vpn_gateway`.
     */
    @JvmName("fxgsxejdymivxhaa")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value Remote traffic selector to use when establishing the VPN tunnel with
     * peer VPN gateway. The value should be a CIDR formatted string,
     * for example `192.168.0.0/16`. The ranges should be disjoint.
     * Only IPv4 is supported.
     */
    @JvmName("ndnlvgvysuqvpulh")
    public suspend fun remoteTrafficSelectors(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.remoteTrafficSelectors = mapped
    }

    /**
     * @param values Remote traffic selector to use when establishing the VPN tunnel with
     * peer VPN gateway. The value should be a CIDR formatted string,
     * for example `192.168.0.0/16`. The ranges should be disjoint.
     * Only IPv4 is supported.
     */
    @JvmName("bymvvtovihcrcgnd")
    public suspend fun remoteTrafficSelectors(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.remoteTrafficSelectors = mapped
    }

    /**
     * @param value URL of router resource to be used for dynamic routing.
     */
    @JvmName("wnocgiaogijckusg")
    public suspend fun router(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.router = mapped
    }

    /**
     * @param value Shared secret used to set the secure session between the Cloud VPN
     * gateway and the peer VPN gateway.
     * **Note**: This property is sensitive and will not be displayed in the plan.
     * - - -
     */
    @JvmName("hnsondkbwrbeiavs")
    public suspend fun sharedSecret(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sharedSecret = mapped
    }

    /**
     * @param value URL of the Target VPN gateway with which this VPN tunnel is
     * associated.
     */
    @JvmName("wllhteeitwfayuns")
    public suspend fun targetVpnGateway(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetVpnGateway = mapped
    }

    /**
     * @param value URL of the VPN gateway with which this VPN tunnel is associated.
     * This must be used if a High Availability VPN gateway resource is created.
     * This field must reference a `gcp.compute.HaVpnGateway` resource.
     */
    @JvmName("gcxfwrlupdqwmhts")
    public suspend fun vpnGateway(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vpnGateway = mapped
    }

    /**
     * @param value The interface ID of the VPN gateway with which this VPN tunnel is associated.
     */
    @JvmName("bgavssxxkyqhdocp")
    public suspend fun vpnGatewayInterface(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vpnGatewayInterface = mapped
    }

    internal fun build(): VPNTunnelArgs = VPNTunnelArgs(
        description = description,
        ikeVersion = ikeVersion,
        labels = labels,
        localTrafficSelectors = localTrafficSelectors,
        name = name,
        peerExternalGateway = peerExternalGateway,
        peerExternalGatewayInterface = peerExternalGatewayInterface,
        peerGcpGateway = peerGcpGateway,
        peerIp = peerIp,
        project = project,
        region = region,
        remoteTrafficSelectors = remoteTrafficSelectors,
        router = router,
        sharedSecret = sharedSecret,
        targetVpnGateway = targetVpnGateway,
        vpnGateway = vpnGateway,
        vpnGatewayInterface = vpnGatewayInterface,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy