1. Packages
  2. Azure Classic
  3. API Docs
  4. network
  5. VpnGateway

We recommend using Azure Native.

Azure Classic v5.80.0 published on Monday, Jun 10, 2024 by Pulumi

azure.network.VpnGateway

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.80.0 published on Monday, Jun 10, 2024 by Pulumi

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

    Example Usage

    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,
    });
    
    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)
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    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}
    

    Create VpnGateway Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VpnGateway(name: string, args: VpnGatewayArgs, opts?: CustomResourceOptions);
    @overload
    def VpnGateway(resource_name: str,
                   args: VpnGatewayArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpnGateway(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   resource_group_name: Optional[str] = None,
                   virtual_hub_id: Optional[str] = None,
                   bgp_route_translation_for_nat_enabled: Optional[bool] = None,
                   bgp_settings: Optional[VpnGatewayBgpSettingsArgs] = None,
                   location: Optional[str] = None,
                   name: Optional[str] = None,
                   routing_preference: Optional[str] = None,
                   scale_unit: Optional[int] = None,
                   tags: Optional[Mapping[str, str]] = None)
    func NewVpnGateway(ctx *Context, name string, args VpnGatewayArgs, opts ...ResourceOption) (*VpnGateway, error)
    public VpnGateway(string name, VpnGatewayArgs args, CustomResourceOptions? opts = null)
    public VpnGateway(String name, VpnGatewayArgs args)
    public VpnGateway(String name, VpnGatewayArgs args, CustomResourceOptions options)
    
    type: azure:network:VpnGateway
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    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.
    args VpnGatewayArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control 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.
    name String
    The unique name of the resource.
    args VpnGatewayArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var vpnGatewayResource = new Azure.Network.VpnGateway("vpnGatewayResource", new()
    {
        ResourceGroupName = "string",
        VirtualHubId = "string",
        BgpRouteTranslationForNatEnabled = false,
        BgpSettings = new Azure.Network.Inputs.VpnGatewayBgpSettingsArgs
        {
            Asn = 0,
            PeerWeight = 0,
            BgpPeeringAddress = "string",
            Instance0BgpPeeringAddress = new Azure.Network.Inputs.VpnGatewayBgpSettingsInstance0BgpPeeringAddressArgs
            {
                CustomIps = new[]
                {
                    "string",
                },
                DefaultIps = new[]
                {
                    "string",
                },
                IpConfigurationId = "string",
                TunnelIps = new[]
                {
                    "string",
                },
            },
            Instance1BgpPeeringAddress = new Azure.Network.Inputs.VpnGatewayBgpSettingsInstance1BgpPeeringAddressArgs
            {
                CustomIps = new[]
                {
                    "string",
                },
                DefaultIps = new[]
                {
                    "string",
                },
                IpConfigurationId = "string",
                TunnelIps = new[]
                {
                    "string",
                },
            },
        },
        Location = "string",
        Name = "string",
        RoutingPreference = "string",
        ScaleUnit = 0,
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := network.NewVpnGateway(ctx, "vpnGatewayResource", &network.VpnGatewayArgs{
    	ResourceGroupName:                pulumi.String("string"),
    	VirtualHubId:                     pulumi.String("string"),
    	BgpRouteTranslationForNatEnabled: pulumi.Bool(false),
    	BgpSettings: &network.VpnGatewayBgpSettingsArgs{
    		Asn:               pulumi.Int(0),
    		PeerWeight:        pulumi.Int(0),
    		BgpPeeringAddress: pulumi.String("string"),
    		Instance0BgpPeeringAddress: &network.VpnGatewayBgpSettingsInstance0BgpPeeringAddressArgs{
    			CustomIps: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			DefaultIps: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			IpConfigurationId: pulumi.String("string"),
    			TunnelIps: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    		Instance1BgpPeeringAddress: &network.VpnGatewayBgpSettingsInstance1BgpPeeringAddressArgs{
    			CustomIps: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			DefaultIps: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			IpConfigurationId: pulumi.String("string"),
    			TunnelIps: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	Location:          pulumi.String("string"),
    	Name:              pulumi.String("string"),
    	RoutingPreference: pulumi.String("string"),
    	ScaleUnit:         pulumi.Int(0),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var vpnGatewayResource = new VpnGateway("vpnGatewayResource", VpnGatewayArgs.builder()
        .resourceGroupName("string")
        .virtualHubId("string")
        .bgpRouteTranslationForNatEnabled(false)
        .bgpSettings(VpnGatewayBgpSettingsArgs.builder()
            .asn(0)
            .peerWeight(0)
            .bgpPeeringAddress("string")
            .instance0BgpPeeringAddress(VpnGatewayBgpSettingsInstance0BgpPeeringAddressArgs.builder()
                .customIps("string")
                .defaultIps("string")
                .ipConfigurationId("string")
                .tunnelIps("string")
                .build())
            .instance1BgpPeeringAddress(VpnGatewayBgpSettingsInstance1BgpPeeringAddressArgs.builder()
                .customIps("string")
                .defaultIps("string")
                .ipConfigurationId("string")
                .tunnelIps("string")
                .build())
            .build())
        .location("string")
        .name("string")
        .routingPreference("string")
        .scaleUnit(0)
        .tags(Map.of("string", "string"))
        .build());
    
    vpn_gateway_resource = azure.network.VpnGateway("vpnGatewayResource",
        resource_group_name="string",
        virtual_hub_id="string",
        bgp_route_translation_for_nat_enabled=False,
        bgp_settings=azure.network.VpnGatewayBgpSettingsArgs(
            asn=0,
            peer_weight=0,
            bgp_peering_address="string",
            instance0_bgp_peering_address=azure.network.VpnGatewayBgpSettingsInstance0BgpPeeringAddressArgs(
                custom_ips=["string"],
                default_ips=["string"],
                ip_configuration_id="string",
                tunnel_ips=["string"],
            ),
            instance1_bgp_peering_address=azure.network.VpnGatewayBgpSettingsInstance1BgpPeeringAddressArgs(
                custom_ips=["string"],
                default_ips=["string"],
                ip_configuration_id="string",
                tunnel_ips=["string"],
            ),
        ),
        location="string",
        name="string",
        routing_preference="string",
        scale_unit=0,
        tags={
            "string": "string",
        })
    
    const vpnGatewayResource = new azure.network.VpnGateway("vpnGatewayResource", {
        resourceGroupName: "string",
        virtualHubId: "string",
        bgpRouteTranslationForNatEnabled: false,
        bgpSettings: {
            asn: 0,
            peerWeight: 0,
            bgpPeeringAddress: "string",
            instance0BgpPeeringAddress: {
                customIps: ["string"],
                defaultIps: ["string"],
                ipConfigurationId: "string",
                tunnelIps: ["string"],
            },
            instance1BgpPeeringAddress: {
                customIps: ["string"],
                defaultIps: ["string"],
                ipConfigurationId: "string",
                tunnelIps: ["string"],
            },
        },
        location: "string",
        name: "string",
        routingPreference: "string",
        scaleUnit: 0,
        tags: {
            string: "string",
        },
    });
    
    type: azure:network:VpnGateway
    properties:
        bgpRouteTranslationForNatEnabled: false
        bgpSettings:
            asn: 0
            bgpPeeringAddress: string
            instance0BgpPeeringAddress:
                customIps:
                    - string
                defaultIps:
                    - string
                ipConfigurationId: string
                tunnelIps:
                    - string
            instance1BgpPeeringAddress:
                customIps:
                    - string
                defaultIps:
                    - string
                ipConfigurationId: string
                tunnelIps:
                    - string
            peerWeight: 0
        location: string
        name: string
        resourceGroupName: string
        routingPreference: string
        scaleUnit: 0
        tags:
            string: string
        virtualHubId: string
    

    VpnGateway Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts 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.
    BgpRouteTranslationForNatEnabled bool
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    BgpSettings VpnGatewayBgpSettings
    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.
    RoutingPreference string
    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 to create a 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.
    BgpRouteTranslationForNatEnabled bool
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    BgpSettings VpnGatewayBgpSettingsArgs
    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.
    RoutingPreference string
    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 to create a 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.
    bgpRouteTranslationForNatEnabled Boolean
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    bgpSettings VpnGatewayBgpSettings
    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.
    routingPreference String
    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 to create a VPN Gateway. Changing this forces a new resource to be created.
    scaleUnit Integer
    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.
    bgpRouteTranslationForNatEnabled boolean
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    bgpSettings VpnGatewayBgpSettings
    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.
    routingPreference string
    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 to create a 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_route_translation_for_nat_enabled bool
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    bgp_settings VpnGatewayBgpSettingsArgs
    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.
    routing_preference str
    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 to create a VPN Gateway. Changing this forces a new resource to be created.
    scale_unit int
    The Scale Unit for this VPN Gateway. Defaults to 1.
    tags Mapping[str, str]
    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.
    bgpRouteTranslationForNatEnabled Boolean
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    bgpSettings Property Map
    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.
    routingPreference String
    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 to create a VPN Gateway. Changing this forces a new resource to be created.
    scaleUnit Number
    The Scale Unit for this VPN Gateway. Defaults to 1.
    tags Map<String>
    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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bgp_route_translation_for_nat_enabled: Optional[bool] = None,
            bgp_settings: Optional[VpnGatewayBgpSettingsArgs] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            routing_preference: Optional[str] = None,
            scale_unit: Optional[int] = None,
            tags: Optional[Mapping[str, str]] = None,
            virtual_hub_id: Optional[str] = None) -> VpnGateway
    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)
    public static VpnGateway get(String name, Output<String> id, VpnGatewayState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    BgpRouteTranslationForNatEnabled bool
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    BgpSettings VpnGatewayBgpSettings
    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.
    RoutingPreference string
    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 to create a 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.
    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.
    BgpRouteTranslationForNatEnabled bool
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    BgpSettings VpnGatewayBgpSettingsArgs
    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.
    RoutingPreference string
    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 to create a 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.
    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.
    bgpRouteTranslationForNatEnabled Boolean
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    bgpSettings VpnGatewayBgpSettings
    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.
    routingPreference String
    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 to create a VPN Gateway. Changing this forces a new resource to be created.
    scaleUnit Integer
    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.
    bgpRouteTranslationForNatEnabled boolean
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    bgpSettings VpnGatewayBgpSettings
    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.
    routingPreference string
    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 to create a 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.
    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_route_translation_for_nat_enabled bool
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    bgp_settings VpnGatewayBgpSettingsArgs
    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.
    routing_preference str
    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 to create a VPN Gateway. Changing this forces a new resource to be created.
    scale_unit int
    The Scale Unit for this VPN Gateway. Defaults to 1.
    tags Mapping[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.
    bgpRouteTranslationForNatEnabled Boolean
    Is BGP route translation for NAT on this VPN Gateway enabled? Defaults to false.
    bgpSettings Property Map
    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.
    routingPreference String
    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 to create a VPN Gateway. Changing this forces a new resource to be created.
    scaleUnit Number
    The Scale Unit for this VPN Gateway. Defaults to 1.
    tags Map<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.

    Supporting Types

    VpnGatewayBgpSettings, VpnGatewayBgpSettingsArgs

    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.
    Instance0BgpPeeringAddress VpnGatewayBgpSettingsInstance0BgpPeeringAddress
    An instance_bgp_peering_address block as defined below.
    Instance1BgpPeeringAddress VpnGatewayBgpSettingsInstance1BgpPeeringAddress
    An instance_bgp_peering_address block as defined below.
    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.
    Instance0BgpPeeringAddress VpnGatewayBgpSettingsInstance0BgpPeeringAddress
    An instance_bgp_peering_address block as defined below.
    Instance1BgpPeeringAddress VpnGatewayBgpSettingsInstance1BgpPeeringAddress
    An instance_bgp_peering_address block as defined below.
    asn Integer
    The ASN of the BGP Speaker. Changing this forces a new resource to be created.
    peerWeight Integer
    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.
    instance0BgpPeeringAddress VpnGatewayBgpSettingsInstance0BgpPeeringAddress
    An instance_bgp_peering_address block as defined below.
    instance1BgpPeeringAddress VpnGatewayBgpSettingsInstance1BgpPeeringAddress
    An instance_bgp_peering_address block as defined below.
    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.
    instance0BgpPeeringAddress VpnGatewayBgpSettingsInstance0BgpPeeringAddress
    An instance_bgp_peering_address block as defined below.
    instance1BgpPeeringAddress VpnGatewayBgpSettingsInstance1BgpPeeringAddress
    An instance_bgp_peering_address block as defined below.
    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_address str
    The Address which should be used for the BGP Peering.
    instance0_bgp_peering_address VpnGatewayBgpSettingsInstance0BgpPeeringAddress
    An instance_bgp_peering_address block as defined below.
    instance1_bgp_peering_address VpnGatewayBgpSettingsInstance1BgpPeeringAddress
    An instance_bgp_peering_address block as defined below.
    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.
    instance0BgpPeeringAddress Property Map
    An instance_bgp_peering_address block as defined below.
    instance1BgpPeeringAddress Property Map
    An instance_bgp_peering_address block as defined below.

    VpnGatewayBgpSettingsInstance0BgpPeeringAddress, VpnGatewayBgpSettingsInstance0BgpPeeringAddressArgs

    CustomIps List<string>
    DefaultIps List<string>
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    IpConfigurationId string
    The pre-defined id of VPN Gateway IP Configuration.
    TunnelIps List<string>
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.
    CustomIps []string
    DefaultIps []string
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    IpConfigurationId string
    The pre-defined id of VPN Gateway IP Configuration.
    TunnelIps []string
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.
    customIps List<String>
    defaultIps List<String>
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    ipConfigurationId String
    The pre-defined id of VPN Gateway IP Configuration.
    tunnelIps List<String>
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.
    customIps string[]
    defaultIps string[]
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    ipConfigurationId string
    The pre-defined id of VPN Gateway IP Configuration.
    tunnelIps string[]
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.
    custom_ips Sequence[str]
    default_ips Sequence[str]
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    ip_configuration_id str
    The pre-defined id of VPN Gateway IP Configuration.
    tunnel_ips Sequence[str]
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.
    customIps List<String>
    defaultIps List<String>
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    ipConfigurationId String
    The pre-defined id of VPN Gateway IP Configuration.
    tunnelIps List<String>
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.

    VpnGatewayBgpSettingsInstance1BgpPeeringAddress, VpnGatewayBgpSettingsInstance1BgpPeeringAddressArgs

    CustomIps List<string>
    DefaultIps List<string>
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    IpConfigurationId string
    The pre-defined id of VPN Gateway IP Configuration.
    TunnelIps List<string>
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.
    CustomIps []string
    DefaultIps []string
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    IpConfigurationId string
    The pre-defined id of VPN Gateway IP Configuration.
    TunnelIps []string
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.
    customIps List<String>
    defaultIps List<String>
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    ipConfigurationId String
    The pre-defined id of VPN Gateway IP Configuration.
    tunnelIps List<String>
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.
    customIps string[]
    defaultIps string[]
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    ipConfigurationId string
    The pre-defined id of VPN Gateway IP Configuration.
    tunnelIps string[]
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.
    custom_ips Sequence[str]
    default_ips Sequence[str]
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    ip_configuration_id str
    The pre-defined id of VPN Gateway IP Configuration.
    tunnel_ips Sequence[str]
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.
    customIps List<String>
    defaultIps List<String>
    The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
    ipConfigurationId String
    The pre-defined id of VPN Gateway IP Configuration.
    tunnelIps List<String>
    The list of tunnel public IP addresses which belong to the pre-defined VPN Gateway IP configuration.

    Import

    VPN Gateways can be imported using the resource id, e.g.

    $ pulumi import azure:network/vpnGateway:VpnGateway gateway1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/vpnGateways/gateway1
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.80.0 published on Monday, Jun 10, 2024 by Pulumi