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

com.pulumi.azure.network.kotlin.VpnGatewayArgs.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.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.network.kotlin

import com.pulumi.azure.network.VpnGatewayArgs.builder
import com.pulumi.azure.network.kotlin.inputs.VpnGatewayBgpSettingsArgs
import com.pulumi.azure.network.kotlin.inputs.VpnGatewayBgpSettingsArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a VPN Gateway within a Virtual Hub, which enables Site-to-Site communication.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-network",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     addressSpaces: ["10.0.0.0/16"],
 * });
 * const exampleVirtualWan = new azure.network.VirtualWan("example", {
 *     name: "example-vwan",
 *     resourceGroupName: example.name,
 *     location: example.location,
 * });
 * const exampleVirtualHub = new azure.network.VirtualHub("example", {
 *     name: "example-hub",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     virtualWanId: exampleVirtualWan.id,
 *     addressPrefix: "10.0.1.0/24",
 * });
 * const exampleVpnGateway = new azure.network.VpnGateway("example", {
 *     name: "example-vpng",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     virtualHubId: exampleVirtualHub.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_virtual_network = azure.network.VirtualNetwork("example",
 *     name="example-network",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     address_spaces=["10.0.0.0/16"])
 * example_virtual_wan = azure.network.VirtualWan("example",
 *     name="example-vwan",
 *     resource_group_name=example.name,
 *     location=example.location)
 * example_virtual_hub = azure.network.VirtualHub("example",
 *     name="example-hub",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     virtual_wan_id=example_virtual_wan.id,
 *     address_prefix="10.0.1.0/24")
 * example_vpn_gateway = azure.network.VpnGateway("example",
 *     name="example-vpng",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     virtual_hub_id=example_virtual_hub.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
 *     {
 *         Name = "example-network",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AddressSpaces = new[]
 *         {
 *             "10.0.0.0/16",
 *         },
 *     });
 *     var exampleVirtualWan = new Azure.Network.VirtualWan("example", new()
 *     {
 *         Name = "example-vwan",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *     });
 *     var exampleVirtualHub = new Azure.Network.VirtualHub("example", new()
 *     {
 *         Name = "example-hub",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         VirtualWanId = exampleVirtualWan.Id,
 *         AddressPrefix = "10.0.1.0/24",
 *     });
 *     var exampleVpnGateway = new Azure.Network.VpnGateway("example", new()
 *     {
 *         Name = "example-vpng",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         VirtualHubId = exampleVirtualHub.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
 * 			Name:              pulumi.String("example-network"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			AddressSpaces: pulumi.StringArray{
 * 				pulumi.String("10.0.0.0/16"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleVirtualWan, err := network.NewVirtualWan(ctx, "example", &network.VirtualWanArgs{
 * 			Name:              pulumi.String("example-vwan"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleVirtualHub, err := network.NewVirtualHub(ctx, "example", &network.VirtualHubArgs{
 * 			Name:              pulumi.String("example-hub"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			VirtualWanId:      exampleVirtualWan.ID(),
 * 			AddressPrefix:     pulumi.String("10.0.1.0/24"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVpnGateway(ctx, "example", &network.VpnGatewayArgs{
 * 			Name:              pulumi.String("example-vpng"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			VirtualHubId:      exampleVirtualHub.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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.network.VirtualNetwork;
 * import com.pulumi.azure.network.VirtualNetworkArgs;
 * import com.pulumi.azure.network.VirtualWan;
 * import com.pulumi.azure.network.VirtualWanArgs;
 * import com.pulumi.azure.network.VirtualHub;
 * import com.pulumi.azure.network.VirtualHubArgs;
 * import com.pulumi.azure.network.VpnGateway;
 * import com.pulumi.azure.network.VpnGatewayArgs;
 * 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 ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
 *             .name("example-network")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .addressSpaces("10.0.0.0/16")
 *             .build());
 *         var exampleVirtualWan = new VirtualWan("exampleVirtualWan", VirtualWanArgs.builder()
 *             .name("example-vwan")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .build());
 *         var exampleVirtualHub = new VirtualHub("exampleVirtualHub", VirtualHubArgs.builder()
 *             .name("example-hub")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .virtualWanId(exampleVirtualWan.id())
 *             .addressPrefix("10.0.1.0/24")
 *             .build());
 *         var exampleVpnGateway = new VpnGateway("exampleVpnGateway", VpnGatewayArgs.builder()
 *             .name("example-vpng")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .virtualHubId(exampleVirtualHub.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleVirtualNetwork:
 *     type: azure:network:VirtualNetwork
 *     name: example
 *     properties:
 *       name: example-network
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       addressSpaces:
 *         - 10.0.0.0/16
 *   exampleVirtualWan:
 *     type: azure:network:VirtualWan
 *     name: example
 *     properties:
 *       name: example-vwan
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *   exampleVirtualHub:
 *     type: azure:network:VirtualHub
 *     name: example
 *     properties:
 *       name: example-hub
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       virtualWanId: ${exampleVirtualWan.id}
 *       addressPrefix: 10.0.1.0/24
 *   exampleVpnGateway:
 *     type: azure:network:VpnGateway
 *     name: example
 *     properties:
 *       name: example-vpng
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       virtualHubId: ${exampleVirtualHub.id}
 * ```
 * 
 * ## Import
 * VPN Gateways can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/vpnGateway:VpnGateway gateway1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/vpnGateways/gateway1
 * ```
 * @property bgpRouteTranslationForNatEnabled Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to `false`.
 * @property bgpSettings A `bgp_settings` block as defined below.
 * @property location The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.
 * @property name The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.
 * @property resourceGroupName The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.
 * @property routingPreference Azure routing preference lets you to choose how your traffic routes between Azure and the internet. You can choose to route traffic either via the Microsoft network (default value, `Microsoft Network`), or via the ISP network (public internet, set to `Internet`). More context of the configuration can be found in the [Microsoft Docs](https://docs.microsoft.com/azure/virtual-wan/virtual-wan-site-to-site-portal#gateway) to create a VPN Gateway. Changing this forces a new resource to be created.
 * @property scaleUnit The Scale Unit for this VPN Gateway. Defaults to `1`.
 * @property tags A mapping of tags to assign to the VPN Gateway.
 * @property virtualHubId The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.
 */
public data class VpnGatewayArgs(
    public val bgpRouteTranslationForNatEnabled: Output? = null,
    public val bgpSettings: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val routingPreference: Output? = null,
    public val scaleUnit: Output? = null,
    public val tags: Output>? = null,
    public val virtualHubId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.network.VpnGatewayArgs =
        com.pulumi.azure.network.VpnGatewayArgs.builder()
            .bgpRouteTranslationForNatEnabled(bgpRouteTranslationForNatEnabled?.applyValue({ args0 -> args0 }))
            .bgpSettings(bgpSettings?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .routingPreference(routingPreference?.applyValue({ args0 -> args0 }))
            .scaleUnit(scaleUnit?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .virtualHubId(virtualHubId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [VpnGatewayArgs].
 */
@PulumiTagMarker
public class VpnGatewayArgsBuilder internal constructor() {
    private var bgpRouteTranslationForNatEnabled: Output? = null

    private var bgpSettings: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var routingPreference: Output? = null

    private var scaleUnit: Output? = null

    private var tags: Output>? = null

    private var virtualHubId: Output? = null

    /**
     * @param value Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to `false`.
     */
    @JvmName("ylaxggmqslesewfm")
    public suspend fun bgpRouteTranslationForNatEnabled(`value`: Output) {
        this.bgpRouteTranslationForNatEnabled = value
    }

    /**
     * @param value A `bgp_settings` block as defined below.
     */
    @JvmName("lcrvenhnxrbribld")
    public suspend fun bgpSettings(`value`: Output) {
        this.bgpSettings = value
    }

    /**
     * @param value The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.
     */
    @JvmName("dmbpbbegjvohjrqx")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.
     */
    @JvmName("srqxhwsqdksyphbc")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.
     */
    @JvmName("yxpkbmhgcpkybhcv")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Azure routing preference lets you to choose how your traffic routes between Azure and the internet. You can choose to route traffic either via the Microsoft network (default value, `Microsoft Network`), or via the ISP network (public internet, set to `Internet`). More context of the configuration can be found in the [Microsoft Docs](https://docs.microsoft.com/azure/virtual-wan/virtual-wan-site-to-site-portal#gateway) to create a VPN Gateway. Changing this forces a new resource to be created.
     */
    @JvmName("kwlolugwsrtwdddb")
    public suspend fun routingPreference(`value`: Output) {
        this.routingPreference = value
    }

    /**
     * @param value The Scale Unit for this VPN Gateway. Defaults to `1`.
     */
    @JvmName("mrxheqxddexuospy")
    public suspend fun scaleUnit(`value`: Output) {
        this.scaleUnit = value
    }

    /**
     * @param value A mapping of tags to assign to the VPN Gateway.
     */
    @JvmName("ccqxlmukawcbucoq")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.
     */
    @JvmName("wstrkhljgggkmago")
    public suspend fun virtualHubId(`value`: Output) {
        this.virtualHubId = value
    }

    /**
     * @param value Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to `false`.
     */
    @JvmName("wsfaxaemeitjqqcd")
    public suspend fun bgpRouteTranslationForNatEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bgpRouteTranslationForNatEnabled = mapped
    }

    /**
     * @param value A `bgp_settings` block as defined below.
     */
    @JvmName("lduxcvkukrycfrpt")
    public suspend fun bgpSettings(`value`: VpnGatewayBgpSettingsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bgpSettings = mapped
    }

    /**
     * @param argument A `bgp_settings` block as defined below.
     */
    @JvmName("jmgdxxddgdnbyxjd")
    public suspend fun bgpSettings(argument: suspend VpnGatewayBgpSettingsArgsBuilder.() -> Unit) {
        val toBeMapped = VpnGatewayBgpSettingsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.bgpSettings = mapped
    }

    /**
     * @param value The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.
     */
    @JvmName("umrojmckpmylwojg")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.
     */
    @JvmName("wbxlohjhmkihbnru")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.
     */
    @JvmName("jhvguuifbumcalnr")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Azure routing preference lets you to choose how your traffic routes between Azure and the internet. You can choose to route traffic either via the Microsoft network (default value, `Microsoft Network`), or via the ISP network (public internet, set to `Internet`). More context of the configuration can be found in the [Microsoft Docs](https://docs.microsoft.com/azure/virtual-wan/virtual-wan-site-to-site-portal#gateway) to create a VPN Gateway. Changing this forces a new resource to be created.
     */
    @JvmName("kqajnweclwmwoosl")
    public suspend fun routingPreference(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routingPreference = mapped
    }

    /**
     * @param value The Scale Unit for this VPN Gateway. Defaults to `1`.
     */
    @JvmName("iannbiifnexigdaq")
    public suspend fun scaleUnit(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scaleUnit = mapped
    }

    /**
     * @param value A mapping of tags to assign to the VPN Gateway.
     */
    @JvmName("hskixvqiqfnmhkqu")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the VPN Gateway.
     */
    @JvmName("ksseinskwhmtsynv")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.
     */
    @JvmName("crskchumbojcrxlr")
    public suspend fun virtualHubId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualHubId = mapped
    }

    internal fun build(): VpnGatewayArgs = VpnGatewayArgs(
        bgpRouteTranslationForNatEnabled = bgpRouteTranslationForNatEnabled,
        bgpSettings = bgpSettings,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        routingPreference = routingPreference,
        scaleUnit = scaleUnit,
        tags = tags,
        virtualHubId = virtualHubId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy