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
new VpnGateway(name: string, args: VpnGatewayArgs, opts?: CustomResourceOptions);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:
- Resource
Group stringName 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 stringId 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<VpnGateway Bgp Setting Args> A
bgp_settingsblock 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.
- Scale
Unit int The Scale Unit for this VPN Gateway. Defaults to
1.- Dictionary<string, string>
A mapping of tags to assign to the VPN Gateway.
- Resource
Group stringName 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 stringId 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 []VpnGateway Bgp Setting A
bgp_settingsblock 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.
- Scale
Unit int The Scale Unit for this VPN Gateway. Defaults to
1.- map[string]string
A mapping of tags to assign to the VPN Gateway.
- resource
Group stringName 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 stringId 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 VpnGateway Bgp Setting[] A
bgp_settingsblock 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.
- scale
Unit number The Scale Unit for this VPN Gateway. Defaults to
1.- {[key: string]: string}
A mapping of tags to assign to the VPN Gateway.
- resource_
group_ strname 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_ strid 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[VpnGateway Bgp Setting] A
bgp_settingsblock 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.- 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:
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): VpnGatewaystatic 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:
- Bgp
Settings List<VpnGateway Bgp Setting Args> A
bgp_settingsblock 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.
- Resource
Group stringName 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 int The Scale Unit for this VPN Gateway. Defaults to
1.- Dictionary<string, string>
A mapping of tags to assign to the VPN Gateway.
- Virtual
Hub stringId 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 []VpnGateway Bgp Setting A
bgp_settingsblock 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.
- Resource
Group stringName 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 int The Scale Unit for this VPN Gateway. Defaults to
1.- map[string]string
A mapping of tags to assign to the VPN Gateway.
- Virtual
Hub stringId 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 VpnGateway Bgp Setting[] A
bgp_settingsblock 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.
- resource
Group stringName 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 number The Scale Unit for this VPN Gateway. Defaults to
1.- {[key: string]: string}
A mapping of tags to assign to the VPN Gateway.
- virtual
Hub stringId 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[VpnGateway Bgp Setting] A
bgp_settingsblock 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_ strname 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.- Dict[str, str]
A mapping of tags to assign to the VPN Gateway.
- virtual_
hub_ strid 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
- Asn int
The ASN of the BGP Speaker. Changing this forces a new resource to be created.
- Peer
Weight int The weight added to Routes learned from this BGP Speaker. Changing this forces a new resource to be created.
- Bgp
Peering stringAddress 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.
- Peer
Weight int The weight added to Routes learned from this BGP Speaker. Changing this forces a new resource to be created.
- Bgp
Peering stringAddress 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.
- peer
Weight number The weight added to Routes learned from this BGP Speaker. Changing this forces a new resource to be created.
- bgp
Peering stringAddress 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.
- peer
Weight float The weight added to Routes learned from this BGP Speaker. Changing this forces a new resource to be created.
- bgp
Peering strAddress 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
azurermTerraform Provider.