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

We recommend using Azure Native.

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

azure.network.getVirtualHubRouteTable

Explore with Pulumi AI

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

Virtual Hub Route Table Usage

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

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

example = azure.network.get_virtual_hub_route_table(name="example-hub-route-table",
    resource_group_name="example-resources",
    virtual_hub_name="example-hub-name")
pulumi.export("virtualHubRouteTableId", 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.LookupVirtualHubRouteTable(ctx, &network.LookupVirtualHubRouteTableArgs{
			Name:              "example-hub-route-table",
			ResourceGroupName: "example-resources",
			VirtualHubName:    "example-hub-name",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("virtualHubRouteTableId", 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.GetVirtualHubRouteTable.Invoke(new()
    {
        Name = "example-hub-route-table",
        ResourceGroupName = "example-resources",
        VirtualHubName = "example-hub-name",
    });

    return new Dictionary<string, object?>
    {
        ["virtualHubRouteTableId"] = example.Apply(getVirtualHubRouteTableResult => getVirtualHubRouteTableResult.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.GetVirtualHubRouteTableArgs;
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.getVirtualHubRouteTable(GetVirtualHubRouteTableArgs.builder()
            .name("example-hub-route-table")
            .resourceGroupName("example-resources")
            .virtualHubName("example-hub-name")
            .build());

        ctx.export("virtualHubRouteTableId", example.applyValue(getVirtualHubRouteTableResult -> getVirtualHubRouteTableResult.id()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:network:getVirtualHubRouteTable
      arguments:
        name: example-hub-route-table
        resourceGroupName: example-resources
        virtualHubName: example-hub-name
outputs:
  virtualHubRouteTableId: ${example.id}
Copy

Using getVirtualHubRouteTable

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 getVirtualHubRouteTable(args: GetVirtualHubRouteTableArgs, opts?: InvokeOptions): Promise<GetVirtualHubRouteTableResult>
function getVirtualHubRouteTableOutput(args: GetVirtualHubRouteTableOutputArgs, opts?: InvokeOptions): Output<GetVirtualHubRouteTableResult>
Copy
def get_virtual_hub_route_table(name: Optional[str] = None,
                                resource_group_name: Optional[str] = None,
                                virtual_hub_name: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetVirtualHubRouteTableResult
def get_virtual_hub_route_table_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[GetVirtualHubRouteTableResult]
Copy
func LookupVirtualHubRouteTable(ctx *Context, args *LookupVirtualHubRouteTableArgs, opts ...InvokeOption) (*LookupVirtualHubRouteTableResult, error)
func LookupVirtualHubRouteTableOutput(ctx *Context, args *LookupVirtualHubRouteTableOutputArgs, opts ...InvokeOption) LookupVirtualHubRouteTableResultOutput
Copy

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

public static class GetVirtualHubRouteTable 
{
    public static Task<GetVirtualHubRouteTableResult> InvokeAsync(GetVirtualHubRouteTableArgs args, InvokeOptions? opts = null)
    public static Output<GetVirtualHubRouteTableResult> Invoke(GetVirtualHubRouteTableInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVirtualHubRouteTableResult> getVirtualHubRouteTable(GetVirtualHubRouteTableArgs args, InvokeOptions options)
public static Output<GetVirtualHubRouteTableResult> getVirtualHubRouteTable(GetVirtualHubRouteTableArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:network/getVirtualHubRouteTable:getVirtualHubRouteTable
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

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

getVirtualHubRouteTable Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Labels List<string>
List of labels associated with this route table.
Name string
The name which is used for this route.
ResourceGroupName string
Routes List<GetVirtualHubRouteTableRoute>
A route block as defined below.
VirtualHubId string
The ID of the Virtual Hub within which this route table is created
VirtualHubName string
Id string
The provider-assigned unique ID for this managed resource.
Labels []string
List of labels associated with this route table.
Name string
The name which is used for this route.
ResourceGroupName string
Routes []GetVirtualHubRouteTableRouteType
A route block as defined below.
VirtualHubId string
The ID of the Virtual Hub within which this route table is created
VirtualHubName string
id String
The provider-assigned unique ID for this managed resource.
labels List<String>
List of labels associated with this route table.
name String
The name which is used for this route.
resourceGroupName String
routes List<GetVirtualHubRouteTableRoute>
A route block as defined below.
virtualHubId String
The ID of the Virtual Hub within which this route table is created
virtualHubName String
id string
The provider-assigned unique ID for this managed resource.
labels string[]
List of labels associated with this route table.
name string
The name which is used for this route.
resourceGroupName string
routes GetVirtualHubRouteTableRoute[]
A route block as defined below.
virtualHubId string
The ID of the Virtual Hub within which this route table is created
virtualHubName string
id str
The provider-assigned unique ID for this managed resource.
labels Sequence[str]
List of labels associated with this route table.
name str
The name which is used for this route.
resource_group_name str
routes Sequence[GetVirtualHubRouteTableRoute]
A route block as defined below.
virtual_hub_id str
The ID of the Virtual Hub within which this route table is created
virtual_hub_name str
id String
The provider-assigned unique ID for this managed resource.
labels List<String>
List of labels associated with this route table.
name String
The name which is used for this route.
resourceGroupName String
routes List<Property Map>
A route block as defined below.
virtualHubId String
The ID of the Virtual Hub within which this route table is created
virtualHubName String

Supporting Types

GetVirtualHubRouteTableRoute

Destinations This property is required. List<string>
A list of destination addresses for this route.
DestinationsType This property is required. string
The type of destinations.
Name This property is required. string
The name of the Virtual Hub Route Table.
NextHop This property is required. string
The next hop's resource ID.
NextHopType This property is required. string
The type of next hop.
Destinations This property is required. []string
A list of destination addresses for this route.
DestinationsType This property is required. string
The type of destinations.
Name This property is required. string
The name of the Virtual Hub Route Table.
NextHop This property is required. string
The next hop's resource ID.
NextHopType This property is required. string
The type of next hop.
destinations This property is required. List<String>
A list of destination addresses for this route.
destinationsType This property is required. String
The type of destinations.
name This property is required. String
The name of the Virtual Hub Route Table.
nextHop This property is required. String
The next hop's resource ID.
nextHopType This property is required. String
The type of next hop.
destinations This property is required. string[]
A list of destination addresses for this route.
destinationsType This property is required. string
The type of destinations.
name This property is required. string
The name of the Virtual Hub Route Table.
nextHop This property is required. string
The next hop's resource ID.
nextHopType This property is required. string
The type of next hop.
destinations This property is required. Sequence[str]
A list of destination addresses for this route.
destinations_type This property is required. str
The type of destinations.
name This property is required. str
The name of the Virtual Hub Route Table.
next_hop This property is required. str
The next hop's resource ID.
next_hop_type This property is required. str
The type of next hop.
destinations This property is required. List<String>
A list of destination addresses for this route.
destinationsType This property is required. String
The type of destinations.
name This property is required. String
The name of the Virtual Hub Route Table.
nextHop This property is required. String
The next hop's resource ID.
nextHopType This property is required. String
The type of 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.