We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 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);
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)
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
	})
}
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),
    };
});
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()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:network:getVirtualHubConnection
      arguments:
        name: example-connection
        resourceGroupName: example-resources
        virtualHubName: example-hub-name
outputs:
  virtualHubConnectionId: ${example.id}
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>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]func LookupVirtualHubConnection(ctx *Context, args *LookupVirtualHubConnectionArgs, opts ...InvokeOption) (*LookupVirtualHubConnectionResult, error)
func LookupVirtualHubConnectionOutput(ctx *Context, args *LookupVirtualHubConnectionOutputArgs, opts ...InvokeOption) LookupVirtualHubConnectionResultOutput> 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)
}public static CompletableFuture<GetVirtualHubConnectionResult> getVirtualHubConnection(GetVirtualHubConnectionArgs args, InvokeOptions options)
public static Output<GetVirtualHubConnectionResult> getVirtualHubConnection(GetVirtualHubConnectionArgs args, InvokeOptions options)
fn::invoke:
  function: azure:network/getVirtualHubConnection:getVirtualHubConnection
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- The name of the Connection which should be retrieved.
- ResourceGroup stringName 
- The Name of the Resource Group where the Virtual Hub Connection exists.
- VirtualHub stringName 
- The name of the Virtual Hub where this Connection exists.
- Name string
- The name of the Connection which should be retrieved.
- ResourceGroup stringName 
- The Name of the Resource Group where the Virtual Hub Connection exists.
- VirtualHub stringName 
- The name of the Virtual Hub where this Connection exists.
- name String
- The name of the Connection which should be retrieved.
- resourceGroup StringName 
- The Name of the Resource Group where the Virtual Hub Connection exists.
- virtualHub StringName 
- The name of the Virtual Hub where this Connection exists.
- name string
- The name of the Connection which should be retrieved.
- resourceGroup stringName 
- The Name of the Resource Group where the Virtual Hub Connection exists.
- virtualHub stringName 
- The name of the Virtual Hub where this Connection exists.
- name str
- The name of the Connection which should be retrieved.
- resource_group_ strname 
- The Name of the Resource Group where the Virtual Hub Connection exists.
- virtual_hub_ strname 
- The name of the Virtual Hub where this Connection exists.
- name String
- The name of the Connection which should be retrieved.
- resourceGroup StringName 
- The Name of the Resource Group where the Virtual Hub Connection exists.
- virtualHub StringName 
- 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.
- InternetSecurity boolEnabled 
- Whether Internet Security is enabled to secure internet traffic on this connection
- Name string
- The name which is used for this Static Route.
- RemoteVirtual stringNetwork Id 
- The ID of the Virtual Network which the Virtual Hub is connected
- ResourceGroup stringName 
- Routings
List<GetVirtual Hub Connection Routing> 
- A routingblock as defined below.
- VirtualHub stringId 
- The ID of the Virtual Hub within which this connection is created
- VirtualHub stringName 
- Id string
- The provider-assigned unique ID for this managed resource.
- InternetSecurity boolEnabled 
- Whether Internet Security is enabled to secure internet traffic on this connection
- Name string
- The name which is used for this Static Route.
- RemoteVirtual stringNetwork Id 
- The ID of the Virtual Network which the Virtual Hub is connected
- ResourceGroup stringName 
- Routings
[]GetVirtual Hub Connection Routing 
- A routingblock as defined below.
- VirtualHub stringId 
- The ID of the Virtual Hub within which this connection is created
- VirtualHub stringName 
- id String
- The provider-assigned unique ID for this managed resource.
- internetSecurity BooleanEnabled 
- Whether Internet Security is enabled to secure internet traffic on this connection
- name String
- The name which is used for this Static Route.
- remoteVirtual StringNetwork Id 
- The ID of the Virtual Network which the Virtual Hub is connected
- resourceGroup StringName 
- routings
List<GetVirtual Hub Connection Routing> 
- A routingblock as defined below.
- virtualHub StringId 
- The ID of the Virtual Hub within which this connection is created
- virtualHub StringName 
- id string
- The provider-assigned unique ID for this managed resource.
- internetSecurity booleanEnabled 
- Whether Internet Security is enabled to secure internet traffic on this connection
- name string
- The name which is used for this Static Route.
- remoteVirtual stringNetwork Id 
- The ID of the Virtual Network which the Virtual Hub is connected
- resourceGroup stringName 
- routings
GetVirtual Hub Connection Routing[] 
- A routingblock as defined below.
- virtualHub stringId 
- The ID of the Virtual Hub within which this connection is created
- virtualHub stringName 
- id str
- The provider-assigned unique ID for this managed resource.
- internet_security_ boolenabled 
- 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_ strnetwork_ id 
- The ID of the Virtual Network which the Virtual Hub is connected
- resource_group_ strname 
- routings
Sequence[GetVirtual Hub Connection Routing] 
- A routingblock as defined below.
- virtual_hub_ strid 
- The ID of the Virtual Hub within which this connection is created
- virtual_hub_ strname 
- id String
- The provider-assigned unique ID for this managed resource.
- internetSecurity BooleanEnabled 
- Whether Internet Security is enabled to secure internet traffic on this connection
- name String
- The name which is used for this Static Route.
- remoteVirtual StringNetwork Id 
- The ID of the Virtual Network which the Virtual Hub is connected
- resourceGroup StringName 
- routings List<Property Map>
- A routingblock as defined below.
- virtualHub StringId 
- The ID of the Virtual Hub within which this connection is created
- virtualHub StringName 
Supporting Types
GetVirtualHubConnectionRouting    
- AssociatedRoute stringTable Id 
- The ID of the route table associated with this Virtual Hub connection.
- InboundRoute stringMap Id 
- The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
- OutboundRoute stringMap Id 
- The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
- PropagatedRoute List<GetTables Virtual Hub Connection Routing Propagated Route Table> 
- A propagated_route_tableblock as defined below.
- StaticVnet stringLocal Route Override Criteria 
- 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.
- StaticVnet List<GetRoutes Virtual Hub Connection Routing Static Vnet Route> 
- A static_vnet_routeblock as defined below.
- AssociatedRoute stringTable Id 
- The ID of the route table associated with this Virtual Hub connection.
- InboundRoute stringMap Id 
- The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
- OutboundRoute stringMap Id 
- The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
- PropagatedRoute []GetTables Virtual Hub Connection Routing Propagated Route Table 
- A propagated_route_tableblock as defined below.
- StaticVnet stringLocal Route Override Criteria 
- 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.
- StaticVnet []GetRoutes Virtual Hub Connection Routing Static Vnet Route 
- A static_vnet_routeblock as defined below.
- associatedRoute StringTable Id 
- The ID of the route table associated with this Virtual Hub connection.
- inboundRoute StringMap Id 
- The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
- outboundRoute StringMap Id 
- The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
- propagatedRoute List<GetTables Virtual Hub Connection Routing Propagated Route Table> 
- A propagated_route_tableblock as defined below.
- staticVnet StringLocal Route Override Criteria 
- 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.
- staticVnet List<GetRoutes Virtual Hub Connection Routing Static Vnet Route> 
- A static_vnet_routeblock as defined below.
- associatedRoute stringTable Id 
- The ID of the route table associated with this Virtual Hub connection.
- inboundRoute stringMap Id 
- The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
- outboundRoute stringMap Id 
- The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
- propagatedRoute GetTables Virtual Hub Connection Routing Propagated Route Table[] 
- A propagated_route_tableblock as defined below.
- staticVnet stringLocal Route Override Criteria 
- 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.
- staticVnet GetRoutes Virtual Hub Connection Routing Static Vnet Route[] 
- A static_vnet_routeblock as defined below.
- associated_route_ strtable_ id 
- The ID of the route table associated with this Virtual Hub connection.
- inbound_route_ strmap_ id 
- The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
- outbound_route_ strmap_ id 
- The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
- propagated_route_ Sequence[Gettables Virtual Hub Connection Routing Propagated Route Table] 
- A propagated_route_tableblock as defined below.
- static_vnet_ strlocal_ route_ override_ criteria 
- 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_ Sequence[Getroutes Virtual Hub Connection Routing Static Vnet Route] 
- A static_vnet_routeblock as defined below.
- associatedRoute StringTable Id 
- The ID of the route table associated with this Virtual Hub connection.
- inboundRoute StringMap Id 
- The ID of the Route Map associated with this Routing Configuration for inbound learned routes.
- outboundRoute StringMap Id 
- The ID of the Route Map associated with this Routing Configuration for outbound advertised routes.
- propagatedRoute List<Property Map>Tables 
- A propagated_route_tableblock as defined below.
- staticVnet StringLocal Route Override Criteria 
- 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.
- staticVnet List<Property Map>Routes 
- A static_vnet_routeblock as defined below.
GetVirtualHubConnectionRoutingPropagatedRouteTable       
- Labels List<string>
- The list of labels assigned to this route table.
- RouteTable List<string>Ids 
- A list of Route Table IDs associated with this Virtual Hub Connection.
- Labels []string
- The list of labels assigned to this route table.
- RouteTable []stringIds 
- A list of Route Table IDs associated with this Virtual Hub Connection.
- labels List<String>
- The list of labels assigned to this route table.
- routeTable List<String>Ids 
- A list of Route Table IDs associated with this Virtual Hub Connection.
- labels string[]
- The list of labels assigned to this route table.
- routeTable string[]Ids 
- A list of Route Table IDs associated with this Virtual Hub Connection.
- labels Sequence[str]
- The list of labels assigned to this route table.
- route_table_ Sequence[str]ids 
- A list of Route Table IDs associated with this Virtual Hub Connection.
- labels List<String>
- The list of labels assigned to this route table.
- routeTable List<String>Ids 
- A list of Route Table IDs associated with this Virtual Hub Connection.
GetVirtualHubConnectionRoutingStaticVnetRoute       
- AddressPrefixes List<string>
- A list of CIDR Ranges which is used as Address Prefixes.
- Name string
- The name of the Connection which should be retrieved.
- NextHop stringIp Address 
- The IP Address which is used for the Next Hop.
- AddressPrefixes []string
- A list of CIDR Ranges which is used as Address Prefixes.
- Name string
- The name of the Connection which should be retrieved.
- NextHop stringIp Address 
- The IP Address which is used for the Next Hop.
- addressPrefixes List<String>
- A list of CIDR Ranges which is used as Address Prefixes.
- name String
- The name of the Connection which should be retrieved.
- nextHop StringIp Address 
- The IP Address which is used for the Next Hop.
- addressPrefixes string[]
- A list of CIDR Ranges which is used as Address Prefixes.
- name string
- The name of the Connection which should be retrieved.
- nextHop stringIp Address 
- The IP Address which is used for the Next Hop.
- address_prefixes Sequence[str]
- A list of CIDR Ranges which is used as Address Prefixes.
- name str
- The name of the Connection which should be retrieved.
- next_hop_ strip_ address 
- The IP Address which is used for the Next Hop.
- addressPrefixes List<String>
- A list of CIDR Ranges which is used as Address Prefixes.
- name String
- The name of the Connection which should be retrieved.
- nextHop StringIp Address 
- 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 azurermTerraform Provider.