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

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.network.getVirtualHubConnection

Explore with Pulumi AI

Uses this data source to access information about an existing Virtual Hub Connection.

Virtual Hub Connection Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.network.getVirtualHubConnection({
    name: "example-connection",
    resourceGroupName: "example-resources",
    virtualHubName: "example-hub-name",
});
export const virtualHubConnectionId = example.then(example => example.id);
Copy
import pulumi
import pulumi_azure as azure

example = azure.network.get_virtual_hub_connection(name="example-connection",
    resource_group_name="example-resources",
    virtual_hub_name="example-hub-name")
pulumi.export("virtualHubConnectionId", example.id)
Copy
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.LookupVirtualHubConnection(ctx, &network.LookupVirtualHubConnectionArgs{
			Name:              "example-connection",
			ResourceGroupName: "example-resources",
			VirtualHubName:    "example-hub-name",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("virtualHubConnectionId", example.Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.Network.GetVirtualHubConnection.Invoke(new()
    {
        Name = "example-connection",
        ResourceGroupName = "example-resources",
        VirtualHubName = "example-hub-name",
    });

    return new Dictionary<string, object?>
    {
        ["virtualHubConnectionId"] = example.Apply(getVirtualHubConnectionResult => getVirtualHubConnectionResult.Id),
    };
});
Copy
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.GetVirtualHubConnectionArgs;
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.getVirtualHubConnection(GetVirtualHubConnectionArgs.builder()
            .name("example-connection")
            .resourceGroupName("example-resources")
            .virtualHubName("example-hub-name")
            .build());

        ctx.export("virtualHubConnectionId", example.applyValue(getVirtualHubConnectionResult -> getVirtualHubConnectionResult.id()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:network:getVirtualHubConnection
      arguments:
        name: example-connection
        resourceGroupName: example-resources
        virtualHubName: example-hub-name
outputs:
  virtualHubConnectionId: ${example.id}
Copy

Using getVirtualHubConnection

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 getVirtualHubConnection(args: GetVirtualHubConnectionArgs, opts?: InvokeOptions): Promise<GetVirtualHubConnectionResult>
function getVirtualHubConnectionOutput(args: GetVirtualHubConnectionOutputArgs, opts?: InvokeOptions): Output<GetVirtualHubConnectionResult>
Copy
def get_virtual_hub_connection(name: Optional[str] = None,
                               resource_group_name: Optional[str] = None,
                               virtual_hub_name: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetVirtualHubConnectionResult
def get_virtual_hub_connection_output(name: Optional[pulumi.Input[str]] = None,
                               resource_group_name: Optional[pulumi.Input[str]] = None,
                               virtual_hub_name: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetVirtualHubConnectionResult]
Copy
func LookupVirtualHubConnection(ctx *Context, args *LookupVirtualHubConnectionArgs, opts ...InvokeOption) (*LookupVirtualHubConnectionResult, error)
func LookupVirtualHubConnectionOutput(ctx *Context, args *LookupVirtualHubConnectionOutputArgs, opts ...InvokeOption) LookupVirtualHubConnectionResultOutput
Copy

> Note: This function is named LookupVirtualHubConnection in the Go SDK.

public static class GetVirtualHubConnection 
{
    public static Task<GetVirtualHubConnectionResult> InvokeAsync(GetVirtualHubConnectionArgs args, InvokeOptions? opts = null)
    public static Output<GetVirtualHubConnectionResult> Invoke(GetVirtualHubConnectionInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVirtualHubConnectionResult> getVirtualHubConnection(GetVirtualHubConnectionArgs args, InvokeOptions options)
public static Output<GetVirtualHubConnectionResult> getVirtualHubConnection(GetVirtualHubConnectionArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:network/getVirtualHubConnection:getVirtualHubConnection
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of the Connection which should be retrieved.
ResourceGroupName This property is required. string
The Name of the Resource Group where the Virtual Hub Connection exists.
VirtualHubName This property is required. string
The name of the Virtual Hub where this Connection exists.
Name This property is required. string
The name of the Connection which should be retrieved.
ResourceGroupName This property is required. string
The Name of the Resource Group where the Virtual Hub Connection exists.
VirtualHubName This property is required. string
The name of the Virtual Hub where this Connection exists.
name This property is required. String
The name of the Connection which should be retrieved.
resourceGroupName This property is required. String
The Name of the Resource Group where the Virtual Hub Connection exists.
virtualHubName This property is required. String
The name of the Virtual Hub where this Connection exists.
name This property is required. string
The name of the Connection which should be retrieved.
resourceGroupName This property is required. string
The Name of the Resource Group where the Virtual Hub Connection exists.
virtualHubName This property is required. string
The name of the Virtual Hub where this Connection exists.
name This property is required. str
The name of the Connection which should be retrieved.
resource_group_name This property is required. str
The Name of the Resource Group where the Virtual Hub Connection exists.
virtual_hub_name This property is required. str
The name of the Virtual Hub where this Connection exists.
name This property is required. String
The name of the Connection which should be retrieved.
resourceGroupName This property is required. String
The Name of the Resource Group where the Virtual Hub Connection exists.
virtualHubName This property is required. String
The name of the Virtual Hub where this Connection exists.

getVirtualHubConnection Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
InternetSecurityEnabled bool
Whether Internet Security is enabled to secure internet traffic on this connection
Name string
The name which is used for this Static Route.
RemoteVirtualNetworkId string
The ID of the Virtual Network which the Virtual Hub is connected
ResourceGroupName string
Routings List<GetVirtualHubConnectionRouting>
A routing block as defined below.
VirtualHubId string
The ID of the Virtual Hub within which this connection is created
VirtualHubName string
Id string
The provider-assigned unique ID for this managed resource.
InternetSecurityEnabled bool
Whether Internet Security is enabled to secure internet traffic on this connection
Name string
The name which is used for this Static Route.
RemoteVirtualNetworkId string
The ID of the Virtual Network which the Virtual Hub is connected
ResourceGroupName string
Routings []GetVirtualHubConnectionRouting
A routing block as defined below.
VirtualHubId string
The ID of the Virtual Hub within which this connection is created
VirtualHubName string
id String
The provider-assigned unique ID for this managed resource.
internetSecurityEnabled Boolean
Whether Internet Security is enabled to secure internet traffic on this connection
name String
The name which is used for this Static Route.
remoteVirtualNetworkId String
The ID of the Virtual Network which the Virtual Hub is connected
resourceGroupName String
routings List<GetVirtualHubConnectionRouting>
A routing block as defined below.
virtualHubId String
The ID of the Virtual Hub within which this connection is created
virtualHubName String
id string
The provider-assigned unique ID for this managed resource.
internetSecurityEnabled boolean
Whether Internet Security is enabled to secure internet traffic on this connection
name string
The name which is used for this Static Route.
remoteVirtualNetworkId string
The ID of the Virtual Network which the Virtual Hub is connected
resourceGroupName string
routings GetVirtualHubConnectionRouting[]
A routing block as defined below.
virtualHubId string
The ID of the Virtual Hub within which this connection is created
virtualHubName string
id str
The provider-assigned unique ID for this managed resource.
internet_security_enabled bool
Whether Internet Security is enabled to secure internet traffic on this connection
name str
The name which is used for this Static Route.
remote_virtual_network_id str
The ID of the Virtual Network which the Virtual Hub is connected
resource_group_name str
routings Sequence[GetVirtualHubConnectionRouting]
A routing block as defined below.
virtual_hub_id str
The ID of the Virtual Hub within which this connection is created
virtual_hub_name str
id String
The provider-assigned unique ID for this managed resource.
internetSecurityEnabled Boolean
Whether Internet Security is enabled to secure internet traffic on this connection
name String
The name which is used for this Static Route.
remoteVirtualNetworkId String
The ID of the Virtual Network which the Virtual Hub is connected
resourceGroupName String
routings List<Property Map>
A routing block as defined below.
virtualHubId String
The ID of the Virtual Hub within which this connection is created
virtualHubName String

Supporting Types

GetVirtualHubConnectionRouting

AssociatedRouteTableId This property is required. string
The ID of the route table associated with this Virtual Hub connection.
InboundRouteMapId This property is required. string
The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
OutboundRouteMapId This property is required. string
The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
PropagatedRouteTables This property is required. List<GetVirtualHubConnectionRoutingPropagatedRouteTable>
A propagated_route_table block as defined below.
StaticVnetLocalRouteOverrideCriteria This property is required. string
The static VNet local route override criteria that is used to determine whether NVA in spoke VNet is bypassed for traffic with destination in spoke VNet.
StaticVnetPropagateStaticRoutesEnabled This property is required. bool
Whether the static routes should be propagated to the Virtual Hub or not.
StaticVnetRoutes This property is required. List<GetVirtualHubConnectionRoutingStaticVnetRoute>
A static_vnet_route block as defined below.
AssociatedRouteTableId This property is required. string
The ID of the route table associated with this Virtual Hub connection.
InboundRouteMapId This property is required. string
The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
OutboundRouteMapId This property is required. string
The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
PropagatedRouteTables This property is required. []GetVirtualHubConnectionRoutingPropagatedRouteTable
A propagated_route_table block as defined below.
StaticVnetLocalRouteOverrideCriteria This property is required. string
The static VNet local route override criteria that is used to determine whether NVA in spoke VNet is bypassed for traffic with destination in spoke VNet.
StaticVnetPropagateStaticRoutesEnabled This property is required. bool
Whether the static routes should be propagated to the Virtual Hub or not.
StaticVnetRoutes This property is required. []GetVirtualHubConnectionRoutingStaticVnetRoute
A static_vnet_route block as defined below.
associatedRouteTableId This property is required. String
The ID of the route table associated with this Virtual Hub connection.
inboundRouteMapId This property is required. String
The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
outboundRouteMapId This property is required. String
The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
propagatedRouteTables This property is required. List<GetVirtualHubConnectionRoutingPropagatedRouteTable>
A propagated_route_table block as defined below.
staticVnetLocalRouteOverrideCriteria This property is required. String
The static VNet local route override criteria that is used to determine whether NVA in spoke VNet is bypassed for traffic with destination in spoke VNet.
staticVnetPropagateStaticRoutesEnabled This property is required. Boolean
Whether the static routes should be propagated to the Virtual Hub or not.
staticVnetRoutes This property is required. List<GetVirtualHubConnectionRoutingStaticVnetRoute>
A static_vnet_route block as defined below.
associatedRouteTableId This property is required. string
The ID of the route table associated with this Virtual Hub connection.
inboundRouteMapId This property is required. string
The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
outboundRouteMapId This property is required. string
The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
propagatedRouteTables This property is required. GetVirtualHubConnectionRoutingPropagatedRouteTable[]
A propagated_route_table block as defined below.
staticVnetLocalRouteOverrideCriteria This property is required. string
The static VNet local route override criteria that is used to determine whether NVA in spoke VNet is bypassed for traffic with destination in spoke VNet.
staticVnetPropagateStaticRoutesEnabled This property is required. boolean
Whether the static routes should be propagated to the Virtual Hub or not.
staticVnetRoutes This property is required. GetVirtualHubConnectionRoutingStaticVnetRoute[]
A static_vnet_route block as defined below.
associated_route_table_id This property is required. str
The ID of the route table associated with this Virtual Hub connection.
inbound_route_map_id This property is required. str
The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
outbound_route_map_id This property is required. str
The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
propagated_route_tables This property is required. Sequence[GetVirtualHubConnectionRoutingPropagatedRouteTable]
A propagated_route_table block as defined below.
static_vnet_local_route_override_criteria This property is required. str
The static VNet local route override criteria that is used to determine whether NVA in spoke VNet is bypassed for traffic with destination in spoke VNet.
static_vnet_propagate_static_routes_enabled This property is required. bool
Whether the static routes should be propagated to the Virtual Hub or not.
static_vnet_routes This property is required. Sequence[GetVirtualHubConnectionRoutingStaticVnetRoute]
A static_vnet_route block as defined below.
associatedRouteTableId This property is required. String
The ID of the route table associated with this Virtual Hub connection.
inboundRouteMapId This property is required. String
The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
outboundRouteMapId This property is required. String
The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
propagatedRouteTables This property is required. List<Property Map>
A propagated_route_table block as defined below.
staticVnetLocalRouteOverrideCriteria This property is required. String
The static VNet local route override criteria that is used to determine whether NVA in spoke VNet is bypassed for traffic with destination in spoke VNet.
staticVnetPropagateStaticRoutesEnabled This property is required. Boolean
Whether the static routes should be propagated to the Virtual Hub or not.
staticVnetRoutes This property is required. List<Property Map>
A static_vnet_route block as defined below.

GetVirtualHubConnectionRoutingPropagatedRouteTable

Labels This property is required. List<string>
The list of labels assigned to this route table.
RouteTableIds This property is required. List<string>
A list of Route Table IDs associated with this Virtual Hub Connection.
Labels This property is required. []string
The list of labels assigned to this route table.
RouteTableIds This property is required. []string
A list of Route Table IDs associated with this Virtual Hub Connection.
labels This property is required. List<String>
The list of labels assigned to this route table.
routeTableIds This property is required. List<String>
A list of Route Table IDs associated with this Virtual Hub Connection.
labels This property is required. string[]
The list of labels assigned to this route table.
routeTableIds This property is required. string[]
A list of Route Table IDs associated with this Virtual Hub Connection.
labels This property is required. Sequence[str]
The list of labels assigned to this route table.
route_table_ids This property is required. Sequence[str]
A list of Route Table IDs associated with this Virtual Hub Connection.
labels This property is required. List<String>
The list of labels assigned to this route table.
routeTableIds This property is required. List<String>
A list of Route Table IDs associated with this Virtual Hub Connection.

GetVirtualHubConnectionRoutingStaticVnetRoute

AddressPrefixes This property is required. List<string>
A list of CIDR Ranges which is used as Address Prefixes.
Name This property is required. string
The name of the Connection which should be retrieved.
NextHopIpAddress This property is required. string
The IP Address which is used for the Next Hop.
AddressPrefixes This property is required. []string
A list of CIDR Ranges which is used as Address Prefixes.
Name This property is required. string
The name of the Connection which should be retrieved.
NextHopIpAddress This property is required. string
The IP Address which is used for the Next Hop.
addressPrefixes This property is required. List<String>
A list of CIDR Ranges which is used as Address Prefixes.
name This property is required. String
The name of the Connection which should be retrieved.
nextHopIpAddress This property is required. String
The IP Address which is used for the Next Hop.
addressPrefixes This property is required. string[]
A list of CIDR Ranges which is used as Address Prefixes.
name This property is required. string
The name of the Connection which should be retrieved.
nextHopIpAddress This property is required. string
The IP Address which is used for the Next Hop.
address_prefixes This property is required. Sequence[str]
A list of CIDR Ranges which is used as Address Prefixes.
name This property is required. str
The name of the Connection which should be retrieved.
next_hop_ip_address This property is required. str
The IP Address which is used for the Next Hop.
addressPrefixes This property is required. List<String>
A list of CIDR Ranges which is used as Address Prefixes.
name This property is required. String
The name of the Connection which should be retrieved.
nextHopIpAddress This property is required. String
The IP Address which is used for the Next Hop.

Package Details

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