We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.network.getVpnGateway
Explore with Pulumi AI
Use this data source to access information about an existing VPN Gateway within a Virtual Hub.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.network.getVpnGateway({
    name: "existing-local-vpn_gateway",
    resourceGroupName: "existing-vpn_gateway",
});
export const azurermVpnGatewayId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.network.get_vpn_gateway(name="existing-local-vpn_gateway",
    resource_group_name="existing-vpn_gateway")
pulumi.export("azurermVpnGatewayId", example.id)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := network.LookupVpnGateway(ctx, &network.LookupVpnGatewayArgs{
			Name:              "existing-local-vpn_gateway",
			ResourceGroupName: "existing-vpn_gateway",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("azurermVpnGatewayId", example.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.Network.GetVpnGateway.Invoke(new()
    {
        Name = "existing-local-vpn_gateway",
        ResourceGroupName = "existing-vpn_gateway",
    });
    return new Dictionary<string, object?>
    {
        ["azurermVpnGatewayId"] = example.Apply(getVpnGatewayResult => getVpnGatewayResult.Id),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.network.NetworkFunctions;
import com.pulumi.azure.network.inputs.GetVpnGatewayArgs;
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) {
        final var example = NetworkFunctions.getVpnGateway(GetVpnGatewayArgs.builder()
            .name("existing-local-vpn_gateway")
            .resourceGroupName("existing-vpn_gateway")
            .build());
        ctx.export("azurermVpnGatewayId", example.applyValue(getVpnGatewayResult -> getVpnGatewayResult.id()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:network:getVpnGateway
      arguments:
        name: existing-local-vpn_gateway
        resourceGroupName: existing-vpn_gateway
outputs:
  azurermVpnGatewayId: ${example.id}
Using getVpnGateway
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVpnGateway(args: GetVpnGatewayArgs, opts?: InvokeOptions): Promise<GetVpnGatewayResult>
function getVpnGatewayOutput(args: GetVpnGatewayOutputArgs, opts?: InvokeOptions): Output<GetVpnGatewayResult>def get_vpn_gateway(name: Optional[str] = None,
                    resource_group_name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetVpnGatewayResult
def get_vpn_gateway_output(name: Optional[pulumi.Input[str]] = None,
                    resource_group_name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetVpnGatewayResult]func LookupVpnGateway(ctx *Context, args *LookupVpnGatewayArgs, opts ...InvokeOption) (*LookupVpnGatewayResult, error)
func LookupVpnGatewayOutput(ctx *Context, args *LookupVpnGatewayOutputArgs, opts ...InvokeOption) LookupVpnGatewayResultOutput> Note: This function is named LookupVpnGateway in the Go SDK.
public static class GetVpnGateway 
{
    public static Task<GetVpnGatewayResult> InvokeAsync(GetVpnGatewayArgs args, InvokeOptions? opts = null)
    public static Output<GetVpnGatewayResult> Invoke(GetVpnGatewayInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpnGatewayResult> getVpnGateway(GetVpnGatewayArgs args, InvokeOptions options)
public static Output<GetVpnGatewayResult> getVpnGateway(GetVpnGatewayArgs args, InvokeOptions options)
fn::invoke:
  function: azure:network/getVpnGateway:getVpnGateway
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- The Name of the VPN Gateway.
- ResourceGroup stringName 
- The name of the Resource Group where the VPN Gateway exists.
- Name string
- The Name of the VPN Gateway.
- ResourceGroup stringName 
- The name of the Resource Group where the VPN Gateway exists.
- name String
- The Name of the VPN Gateway.
- resourceGroup StringName 
- The name of the Resource Group where the VPN Gateway exists.
- name string
- The Name of the VPN Gateway.
- resourceGroup stringName 
- The name of the Resource Group where the VPN Gateway exists.
- name str
- The Name of the VPN Gateway.
- resource_group_ strname 
- The name of the Resource Group where the VPN Gateway exists.
- name String
- The Name of the VPN Gateway.
- resourceGroup StringName 
- The name of the Resource Group where the VPN Gateway exists.
getVpnGateway Result
The following output properties are available:
- BgpSettings List<GetVpn Gateway Bgp Setting> 
- A bgp_settingsblock as defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure location where the VPN Gateway exists.
- Name string
- ResourceGroup stringName 
- ScaleUnit int
- The Scale Unit of this VPN Gateway.
- Dictionary<string, string>
- A mapping of tags assigned to the VPN Gateway.
- VirtualHub stringId 
- The ID of the Virtual Hub within which this VPN Gateway has been created.
- BgpSettings []GetVpn Gateway Bgp Setting 
- A bgp_settingsblock as defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure location where the VPN Gateway exists.
- Name string
- ResourceGroup stringName 
- ScaleUnit int
- The Scale Unit of this VPN Gateway.
- map[string]string
- A mapping of tags assigned to the VPN Gateway.
- VirtualHub stringId 
- The ID of the Virtual Hub within which this VPN Gateway has been created.
- bgpSettings List<GetVpn Gateway Bgp Setting> 
- A bgp_settingsblock as defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure location where the VPN Gateway exists.
- name String
- resourceGroup StringName 
- scaleUnit Integer
- The Scale Unit of this VPN Gateway.
- Map<String,String>
- A mapping of tags assigned to the VPN Gateway.
- virtualHub StringId 
- The ID of the Virtual Hub within which this VPN Gateway has been created.
- bgpSettings GetVpn Gateway Bgp Setting[] 
- A bgp_settingsblock as defined below.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- The Azure location where the VPN Gateway exists.
- name string
- resourceGroup stringName 
- scaleUnit number
- The Scale Unit of this VPN Gateway.
- {[key: string]: string}
- A mapping of tags assigned to the VPN Gateway.
- virtualHub stringId 
- The ID of the Virtual Hub within which this VPN Gateway has been created.
- bgp_settings Sequence[GetVpn Gateway Bgp Setting] 
- A bgp_settingsblock as defined below.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- The Azure location where the VPN Gateway exists.
- name str
- resource_group_ strname 
- scale_unit int
- The Scale Unit of this VPN Gateway.
- Mapping[str, str]
- A mapping of tags assigned to the VPN Gateway.
- virtual_hub_ strid 
- The ID of the Virtual Hub within which this VPN Gateway has been created.
- bgpSettings List<Property Map>
- A bgp_settingsblock as defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure location where the VPN Gateway exists.
- name String
- resourceGroup StringName 
- scaleUnit Number
- The Scale Unit of this VPN Gateway.
- Map<String>
- A mapping of tags assigned to the VPN Gateway.
- virtualHub StringId 
- The ID of the Virtual Hub within which this VPN Gateway has been created.
Supporting Types
GetVpnGatewayBgpSetting    
- Asn int
- The ASN of the BGP Speaker.
- BgpPeering stringAddress 
- The Address which should be used for the BGP Peering.
- Instance0BgpPeering List<GetAddresses Vpn Gateway Bgp Setting Instance0Bgp Peering Address> 
- an instance_bgp_peering_addressblock as defined below.
- Instance1BgpPeering List<GetAddresses Vpn Gateway Bgp Setting Instance1Bgp Peering Address> 
- an instance_bgp_peering_addressblock as defined below.
- PeerWeight int
- The weight added to Routes learned from this BGP Speaker.
- Asn int
- The ASN of the BGP Speaker.
- BgpPeering stringAddress 
- The Address which should be used for the BGP Peering.
- Instance0BgpPeering []GetAddresses Vpn Gateway Bgp Setting Instance0Bgp Peering Address 
- an instance_bgp_peering_addressblock as defined below.
- Instance1BgpPeering []GetAddresses Vpn Gateway Bgp Setting Instance1Bgp Peering Address 
- an instance_bgp_peering_addressblock as defined below.
- PeerWeight int
- The weight added to Routes learned from this BGP Speaker.
- asn Integer
- The ASN of the BGP Speaker.
- bgpPeering StringAddress 
- The Address which should be used for the BGP Peering.
- instance0BgpPeering List<GetAddresses Vpn Gateway Bgp Setting Instance0Bgp Peering Address> 
- an instance_bgp_peering_addressblock as defined below.
- instance1BgpPeering List<GetAddresses Vpn Gateway Bgp Setting Instance1Bgp Peering Address> 
- an instance_bgp_peering_addressblock as defined below.
- peerWeight Integer
- The weight added to Routes learned from this BGP Speaker.
- asn number
- The ASN of the BGP Speaker.
- bgpPeering stringAddress 
- The Address which should be used for the BGP Peering.
- instance0BgpPeering GetAddresses Vpn Gateway Bgp Setting Instance0Bgp Peering Address[] 
- an instance_bgp_peering_addressblock as defined below.
- instance1BgpPeering GetAddresses Vpn Gateway Bgp Setting Instance1Bgp Peering Address[] 
- an instance_bgp_peering_addressblock as defined below.
- peerWeight number
- The weight added to Routes learned from this BGP Speaker.
- asn int
- The ASN of the BGP Speaker.
- bgp_peering_ straddress 
- The Address which should be used for the BGP Peering.
- instance0_bgp_ Sequence[Getpeering_ addresses Vpn Gateway Bgp Setting Instance0Bgp Peering Address] 
- an instance_bgp_peering_addressblock as defined below.
- instance1_bgp_ Sequence[Getpeering_ addresses Vpn Gateway Bgp Setting Instance1Bgp Peering Address] 
- an instance_bgp_peering_addressblock as defined below.
- peer_weight int
- The weight added to Routes learned from this BGP Speaker.
- asn Number
- The ASN of the BGP Speaker.
- bgpPeering StringAddress 
- The Address which should be used for the BGP Peering.
- instance0BgpPeering List<Property Map>Addresses 
- an instance_bgp_peering_addressblock as defined below.
- instance1BgpPeering List<Property Map>Addresses 
- an instance_bgp_peering_addressblock as defined below.
- peerWeight Number
- The weight added to Routes learned from this BGP Speaker.
GetVpnGatewayBgpSettingInstance0BgpPeeringAddress       
- CustomIps List<string>
- A list of custom BGP peering addresses to assigned to this instance.
- DefaultIps List<string>
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- IpConfiguration stringId 
- 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
- A list of custom BGP peering addresses to assigned to this instance.
- DefaultIps []string
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- IpConfiguration stringId 
- 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>
- A list of custom BGP peering addresses to assigned to this instance.
- defaultIps List<String>
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- ipConfiguration StringId 
- 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[]
- A list of custom BGP peering addresses to assigned to this instance.
- defaultIps string[]
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- ipConfiguration stringId 
- 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]
- A list of custom BGP peering addresses to assigned to this instance.
- default_ips Sequence[str]
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- ip_configuration_ strid 
- 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>
- A list of custom BGP peering addresses to assigned to this instance.
- defaultIps List<String>
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- ipConfiguration StringId 
- 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.
GetVpnGatewayBgpSettingInstance1BgpPeeringAddress       
- CustomIps List<string>
- A list of custom BGP peering addresses to assigned to this instance.
- DefaultIps List<string>
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- IpConfiguration stringId 
- 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
- A list of custom BGP peering addresses to assigned to this instance.
- DefaultIps []string
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- IpConfiguration stringId 
- 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>
- A list of custom BGP peering addresses to assigned to this instance.
- defaultIps List<String>
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- ipConfiguration StringId 
- 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[]
- A list of custom BGP peering addresses to assigned to this instance.
- defaultIps string[]
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- ipConfiguration stringId 
- 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]
- A list of custom BGP peering addresses to assigned to this instance.
- default_ips Sequence[str]
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- ip_configuration_ strid 
- 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>
- A list of custom BGP peering addresses to assigned to this instance.
- defaultIps List<String>
- The list of default BGP peering addresses which belong to the pre-defined VPN Gateway IP configuration.
- ipConfiguration StringId 
- 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.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.