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

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.network.getVpnGateway

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    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/v5/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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:network/getVpnGateway:getVpnGateway
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The Name of the VPN Gateway.
    ResourceGroupName string
    The name of the Resource Group where the VPN Gateway exists.
    Name string
    The Name of the VPN Gateway.
    ResourceGroupName string
    The name of the Resource Group where the VPN Gateway exists.
    name String
    The Name of the VPN Gateway.
    resourceGroupName String
    The name of the Resource Group where the VPN Gateway exists.
    name string
    The Name of the VPN Gateway.
    resourceGroupName string
    The name of the Resource Group where the VPN Gateway exists.
    name str
    The Name of the VPN Gateway.
    resource_group_name str
    The name of the Resource Group where the VPN Gateway exists.
    name String
    The Name of the VPN Gateway.
    resourceGroupName String
    The name of the Resource Group where the VPN Gateway exists.

    getVpnGateway Result

    The following output properties are available:

    BgpSettings List<GetVpnGatewayBgpSetting>
    A bgp_settings block 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
    ResourceGroupName string
    ScaleUnit int
    The Scale Unit of this VPN Gateway.
    Tags Dictionary<string, string>
    A mapping of tags assigned to the VPN Gateway.
    VirtualHubId string
    The ID of the Virtual Hub within which this VPN Gateway has been created.
    BgpSettings []GetVpnGatewayBgpSetting
    A bgp_settings block 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
    ResourceGroupName string
    ScaleUnit int
    The Scale Unit of this VPN Gateway.
    Tags map[string]string
    A mapping of tags assigned to the VPN Gateway.
    VirtualHubId string
    The ID of the Virtual Hub within which this VPN Gateway has been created.
    bgpSettings List<GetVpnGatewayBgpSetting>
    A bgp_settings block 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
    resourceGroupName String
    scaleUnit Integer
    The Scale Unit of this VPN Gateway.
    tags Map<String,String>
    A mapping of tags assigned to the VPN Gateway.
    virtualHubId String
    The ID of the Virtual Hub within which this VPN Gateway has been created.
    bgpSettings GetVpnGatewayBgpSetting[]
    A bgp_settings block 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
    resourceGroupName string
    scaleUnit number
    The Scale Unit of this VPN Gateway.
    tags {[key: string]: string}
    A mapping of tags assigned to the VPN Gateway.
    virtualHubId string
    The ID of the Virtual Hub within which this VPN Gateway has been created.
    bgp_settings Sequence[GetVpnGatewayBgpSetting]
    A bgp_settings block 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_name str
    scale_unit int
    The Scale Unit of this VPN Gateway.
    tags Mapping[str, str]
    A mapping of tags assigned to the VPN Gateway.
    virtual_hub_id str
    The ID of the Virtual Hub within which this VPN Gateway has been created.
    bgpSettings List<Property Map>
    A bgp_settings block 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
    resourceGroupName String
    scaleUnit Number
    The Scale Unit of this VPN Gateway.
    tags Map<String>
    A mapping of tags assigned to the VPN Gateway.
    virtualHubId String
    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.
    BgpPeeringAddress string
    The Address which should be used for the BGP Peering.
    Instance0BgpPeeringAddresses List<GetVpnGatewayBgpSettingInstance0BgpPeeringAddress>
    an instance_bgp_peering_address block as defined below.
    Instance1BgpPeeringAddresses List<GetVpnGatewayBgpSettingInstance1BgpPeeringAddress>
    an instance_bgp_peering_address block as defined below.
    PeerWeight int
    The weight added to Routes learned from this BGP Speaker.
    Asn int
    The ASN of the BGP Speaker.
    BgpPeeringAddress string
    The Address which should be used for the BGP Peering.
    Instance0BgpPeeringAddresses []GetVpnGatewayBgpSettingInstance0BgpPeeringAddress
    an instance_bgp_peering_address block as defined below.
    Instance1BgpPeeringAddresses []GetVpnGatewayBgpSettingInstance1BgpPeeringAddress
    an instance_bgp_peering_address block as defined below.
    PeerWeight int
    The weight added to Routes learned from this BGP Speaker.
    asn Integer
    The ASN of the BGP Speaker.
    bgpPeeringAddress String
    The Address which should be used for the BGP Peering.
    instance0BgpPeeringAddresses List<GetVpnGatewayBgpSettingInstance0BgpPeeringAddress>
    an instance_bgp_peering_address block as defined below.
    instance1BgpPeeringAddresses List<GetVpnGatewayBgpSettingInstance1BgpPeeringAddress>
    an instance_bgp_peering_address block as defined below.
    peerWeight Integer
    The weight added to Routes learned from this BGP Speaker.
    asn number
    The ASN of the BGP Speaker.
    bgpPeeringAddress string
    The Address which should be used for the BGP Peering.
    instance0BgpPeeringAddresses GetVpnGatewayBgpSettingInstance0BgpPeeringAddress[]
    an instance_bgp_peering_address block as defined below.
    instance1BgpPeeringAddresses GetVpnGatewayBgpSettingInstance1BgpPeeringAddress[]
    an instance_bgp_peering_address block 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_address str
    The Address which should be used for the BGP Peering.
    instance0_bgp_peering_addresses Sequence[GetVpnGatewayBgpSettingInstance0BgpPeeringAddress]
    an instance_bgp_peering_address block as defined below.
    instance1_bgp_peering_addresses Sequence[GetVpnGatewayBgpSettingInstance1BgpPeeringAddress]
    an instance_bgp_peering_address block as defined below.
    peer_weight int
    The weight added to Routes learned from this BGP Speaker.
    asn Number
    The ASN of the BGP Speaker.
    bgpPeeringAddress String
    The Address which should be used for the BGP Peering.
    instance0BgpPeeringAddresses List<Property Map>
    an instance_bgp_peering_address block as defined below.
    instance1BgpPeeringAddresses List<Property Map>
    an instance_bgp_peering_address block 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.
    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
    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.
    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>
    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.
    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[]
    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.
    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]
    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_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>
    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.
    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.

    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.
    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
    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.
    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>
    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.
    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[]
    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.
    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]
    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_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>
    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.
    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.

    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.81.0 published on Monday, Jun 24, 2024 by Pulumi