VpnGateway

Manages a VPN Gateway within a Virtual Hub, which enables Site-to-Site communication.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
        {
            Location = "West Europe",
        });
        var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new Azure.Network.VirtualNetworkArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            AddressSpaces = 
            {
                "10.0.0.0/16",
            },
        });
        var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new Azure.Network.VirtualWanArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            Location = exampleResourceGroup.Location,
        });
        var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new Azure.Network.VirtualHubArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            Location = exampleResourceGroup.Location,
            VirtualWanId = exampleVirtualWan.Id,
            AddressPrefix = "10.0.1.0/24",
        });
        var exampleVpnGateway = new Azure.Network.VpnGateway("exampleVpnGateway", new Azure.Network.VpnGatewayArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            VirtualHubId = exampleVirtualHub.Id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/network"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
            Location: pulumi.String("West Europe"),
        })
        if err != nil {
            return err
        }
        _, err = network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
            Location:          exampleResourceGroup.Location,
            ResourceGroupName: exampleResourceGroup.Name,
            AddressSpaces: pulumi.StringArray{
                pulumi.String("10.0.0.0/16"),
            },
        })
        if err != nil {
            return err
        }
        exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{
            ResourceGroupName: exampleResourceGroup.Name,
            Location:          exampleResourceGroup.Location,
        })
        if err != nil {
            return err
        }
        exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{
            ResourceGroupName: exampleResourceGroup.Name,
            Location:          exampleResourceGroup.Location,
            VirtualWanId:      exampleVirtualWan.ID(),
            AddressPrefix:     pulumi.String("10.0.1.0/24"),
        })
        if err != nil {
            return err
        }
        _, err = network.NewVpnGateway(ctx, "exampleVpnGateway", &network.VpnGatewayArgs{
            Location:          exampleResourceGroup.Location,
            ResourceGroupName: exampleResourceGroup.Name,
            VirtualHubId:      exampleVirtualHub.ID(),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    address_spaces=["10.0.0.0/16"])
example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location)
example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    virtual_wan_id=example_virtual_wan.id,
    address_prefix="10.0.1.0/24")
example_vpn_gateway = azure.network.VpnGateway("exampleVpnGateway",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    virtual_hub_id=example_virtual_hub.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    addressSpaces: ["10.0.0.0/16"],
});
const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
});
const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    virtualWanId: exampleVirtualWan.id,
    addressPrefix: "10.0.1.0/24",
});
const exampleVpnGateway = new azure.network.VpnGateway("exampleVpnGateway", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    virtualHubId: exampleVirtualHub.id,
});

Create a VpnGateway Resource

def VpnGateway(resource_name, opts=None, bgp_settings=None, location=None, name=None, resource_group_name=None, scale_unit=None, tags=None, virtual_hub_id=None, __props__=None);
func NewVpnGateway(ctx *Context, name string, args VpnGatewayArgs, opts ...ResourceOption) (*VpnGateway, error)
public VpnGateway(string name, VpnGatewayArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args VpnGatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args VpnGatewayArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VpnGatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

VpnGateway Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The VpnGateway resource accepts the following input properties:

ResourceGroupName string

The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.

VirtualHubId string

The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.

BgpSettings List<VpnGatewayBgpSettingArgs>

A bgp_settings block as defined below.

Location string

The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.

Name string

The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.

ScaleUnit int

The Scale Unit for this VPN Gateway. Defaults to 1.

Tags Dictionary<string, string>

A mapping of tags to assign to the VPN Gateway.

ResourceGroupName string

The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.

VirtualHubId string

The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.

BgpSettings []VpnGatewayBgpSetting

A bgp_settings block as defined below.

Location string

The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.

Name string

The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.

ScaleUnit int

The Scale Unit for this VPN Gateway. Defaults to 1.

Tags map[string]string

A mapping of tags to assign to the VPN Gateway.

resourceGroupName string

The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.

virtualHubId string

The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.

bgpSettings VpnGatewayBgpSetting[]

A bgp_settings block as defined below.

location string

The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.

name string

The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.

scaleUnit number

The Scale Unit for this VPN Gateway. Defaults to 1.

tags {[key: string]: string}

A mapping of tags to assign to the VPN Gateway.

resource_group_name str

The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.

virtual_hub_id str

The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.

bgp_settings List[VpnGatewayBgpSetting]

A bgp_settings block as defined below.

location str

The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.

name str

The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.

scale_unit float

The Scale Unit for this VPN Gateway. Defaults to 1.

tags Dict[str, str]

A mapping of tags to assign to the VPN Gateway.

Outputs

All input properties are implicitly available as output properties. Additionally, the VpnGateway resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing VpnGateway Resource

Get an existing VpnGateway resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: VpnGatewayState, opts?: CustomResourceOptions): VpnGateway
static get(resource_name, id, opts=None, bgp_settings=None, location=None, name=None, resource_group_name=None, scale_unit=None, tags=None, virtual_hub_id=None, __props__=None);
func GetVpnGateway(ctx *Context, name string, id IDInput, state *VpnGatewayState, opts ...ResourceOption) (*VpnGateway, error)
public static VpnGateway Get(string name, Input<string> id, VpnGatewayState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

BgpSettings List<VpnGatewayBgpSettingArgs>

A bgp_settings block as defined below.

Location string

The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.

Name string

The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.

ResourceGroupName string

The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.

ScaleUnit int

The Scale Unit for this VPN Gateway. Defaults to 1.

Tags Dictionary<string, string>

A mapping of tags to assign to the VPN Gateway.

VirtualHubId string

The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.

BgpSettings []VpnGatewayBgpSetting

A bgp_settings block as defined below.

Location string

The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.

Name string

The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.

ResourceGroupName string

The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.

ScaleUnit int

The Scale Unit for this VPN Gateway. Defaults to 1.

Tags map[string]string

A mapping of tags to assign to the VPN Gateway.

VirtualHubId string

The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.

bgpSettings VpnGatewayBgpSetting[]

A bgp_settings block as defined below.

location string

The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.

name string

The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.

resourceGroupName string

The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.

scaleUnit number

The Scale Unit for this VPN Gateway. Defaults to 1.

tags {[key: string]: string}

A mapping of tags to assign to the VPN Gateway.

virtualHubId string

The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.

bgp_settings List[VpnGatewayBgpSetting]

A bgp_settings block as defined below.

location str

The Azure location where this VPN Gateway should be created. Changing this forces a new resource to be created.

name str

The Name which should be used for this VPN Gateway. Changing this forces a new resource to be created.

resource_group_name str

The Name of the Resource Group in which this VPN Gateway should be created. Changing this forces a new resource to be created.

scale_unit float

The Scale Unit for this VPN Gateway. Defaults to 1.

tags Dict[str, str]

A mapping of tags to assign to the VPN Gateway.

virtual_hub_id str

The ID of the Virtual Hub within which this VPN Gateway should be created. Changing this forces a new resource to be created.

Supporting Types

VpnGatewayBgpSetting

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Asn int

The ASN of the BGP Speaker. Changing this forces a new resource to be created.

PeerWeight int

The weight added to Routes learned from this BGP Speaker. Changing this forces a new resource to be created.

BgpPeeringAddress string

The Address which should be used for the BGP Peering.

Asn int

The ASN of the BGP Speaker. Changing this forces a new resource to be created.

PeerWeight int

The weight added to Routes learned from this BGP Speaker. Changing this forces a new resource to be created.

BgpPeeringAddress string

The Address which should be used for the BGP Peering.

asn number

The ASN of the BGP Speaker. Changing this forces a new resource to be created.

peerWeight number

The weight added to Routes learned from this BGP Speaker. Changing this forces a new resource to be created.

bgpPeeringAddress string

The Address which should be used for the BGP Peering.

asn float

The ASN of the BGP Speaker. Changing this forces a new resource to be created.

peerWeight float

The weight added to Routes learned from this BGP Speaker. Changing this forces a new resource to be created.

bgpPeeringAddress str

The Address which should be used for the BGP Peering.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.