We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.network.getRouteTable
Explore with Pulumi AI
Use this data source to access information about an existing Route Table.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.network.getRouteTable({
    name: "myroutetable",
    resourceGroupName: "some-resource-group",
});
import pulumi
import pulumi_azure as azure
example = azure.network.get_route_table(name="myroutetable",
    resource_group_name="some-resource-group")
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 {
		_, err := network.LookupRouteTable(ctx, &network.LookupRouteTableArgs{
			Name:              "myroutetable",
			ResourceGroupName: "some-resource-group",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.Network.GetRouteTable.Invoke(new()
    {
        Name = "myroutetable",
        ResourceGroupName = "some-resource-group",
    });
});
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.GetRouteTableArgs;
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.getRouteTable(GetRouteTableArgs.builder()
            .name("myroutetable")
            .resourceGroupName("some-resource-group")
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: azure:network:getRouteTable
      arguments:
        name: myroutetable
        resourceGroupName: some-resource-group
Using getRouteTable
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 getRouteTable(args: GetRouteTableArgs, opts?: InvokeOptions): Promise<GetRouteTableResult>
function getRouteTableOutput(args: GetRouteTableOutputArgs, opts?: InvokeOptions): Output<GetRouteTableResult>def get_route_table(name: Optional[str] = None,
                    resource_group_name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetRouteTableResult
def get_route_table_output(name: Optional[pulumi.Input[str]] = None,
                    resource_group_name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetRouteTableResult]func LookupRouteTable(ctx *Context, args *LookupRouteTableArgs, opts ...InvokeOption) (*LookupRouteTableResult, error)
func LookupRouteTableOutput(ctx *Context, args *LookupRouteTableOutputArgs, opts ...InvokeOption) LookupRouteTableResultOutput> Note: This function is named LookupRouteTable in the Go SDK.
public static class GetRouteTable 
{
    public static Task<GetRouteTableResult> InvokeAsync(GetRouteTableArgs args, InvokeOptions? opts = null)
    public static Output<GetRouteTableResult> Invoke(GetRouteTableInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRouteTableResult> getRouteTable(GetRouteTableArgs args, InvokeOptions options)
public static Output<GetRouteTableResult> getRouteTable(GetRouteTableArgs args, InvokeOptions options)
fn::invoke:
  function: azure:network/getRouteTable:getRouteTable
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- The name of the Route Table.
- ResourceGroup stringName 
- The name of the Resource Group in which the Route Table exists.
- Name string
- The name of the Route Table.
- ResourceGroup stringName 
- The name of the Resource Group in which the Route Table exists.
- name String
- The name of the Route Table.
- resourceGroup StringName 
- The name of the Resource Group in which the Route Table exists.
- name string
- The name of the Route Table.
- resourceGroup stringName 
- The name of the Resource Group in which the Route Table exists.
- name str
- The name of the Route Table.
- resource_group_ strname 
- The name of the Resource Group in which the Route Table exists.
- name String
- The name of the Route Table.
- resourceGroup StringName 
- The name of the Resource Group in which the Route Table exists.
getRouteTable Result
The following output properties are available:
- BgpRoute boolPropagation Enabled 
- Boolean flag which controls propagation of routes learned by BGP on that route table.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region in which the Route Table exists.
- Name string
- The name of the Route.
- ResourceGroup stringName 
- Routes
List<GetRoute Table Route> 
- One or more routeblocks as documented below.
- Subnets List<string>
- The collection of Subnets associated with this route table.
- Dictionary<string, string>
- A mapping of tags assigned to the Route Table.
- BgpRoute boolPropagation Enabled 
- Boolean flag which controls propagation of routes learned by BGP on that route table.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region in which the Route Table exists.
- Name string
- The name of the Route.
- ResourceGroup stringName 
- Routes
[]GetRoute Table Route 
- One or more routeblocks as documented below.
- Subnets []string
- The collection of Subnets associated with this route table.
- map[string]string
- A mapping of tags assigned to the Route Table.
- bgpRoute BooleanPropagation Enabled 
- Boolean flag which controls propagation of routes learned by BGP on that route table.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region in which the Route Table exists.
- name String
- The name of the Route.
- resourceGroup StringName 
- routes
List<GetRoute Table Route> 
- One or more routeblocks as documented below.
- subnets List<String>
- The collection of Subnets associated with this route table.
- Map<String,String>
- A mapping of tags assigned to the Route Table.
- bgpRoute booleanPropagation Enabled 
- Boolean flag which controls propagation of routes learned by BGP on that route table.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- The Azure Region in which the Route Table exists.
- name string
- The name of the Route.
- resourceGroup stringName 
- routes
GetRoute Table Route[] 
- One or more routeblocks as documented below.
- subnets string[]
- The collection of Subnets associated with this route table.
- {[key: string]: string}
- A mapping of tags assigned to the Route Table.
- bgp_route_ boolpropagation_ enabled 
- Boolean flag which controls propagation of routes learned by BGP on that route table.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- The Azure Region in which the Route Table exists.
- name str
- The name of the Route.
- resource_group_ strname 
- routes
Sequence[GetRoute Table Route] 
- One or more routeblocks as documented below.
- subnets Sequence[str]
- The collection of Subnets associated with this route table.
- Mapping[str, str]
- A mapping of tags assigned to the Route Table.
- bgpRoute BooleanPropagation Enabled 
- Boolean flag which controls propagation of routes learned by BGP on that route table.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region in which the Route Table exists.
- name String
- The name of the Route.
- resourceGroup StringName 
- routes List<Property Map>
- One or more routeblocks as documented below.
- subnets List<String>
- The collection of Subnets associated with this route table.
- Map<String>
- A mapping of tags assigned to the Route Table.
Supporting Types
GetRouteTableRoute   
- AddressPrefix string
- The destination CIDR to which the route applies.
- Name string
- The name of the Route Table.
- NextHop stringIn Ip Address 
- Contains the IP address packets should be forwarded to.
- NextHop stringType 
- The type of Azure hop the packet should be sent to.
- AddressPrefix string
- The destination CIDR to which the route applies.
- Name string
- The name of the Route Table.
- NextHop stringIn Ip Address 
- Contains the IP address packets should be forwarded to.
- NextHop stringType 
- The type of Azure hop the packet should be sent to.
- addressPrefix String
- The destination CIDR to which the route applies.
- name String
- The name of the Route Table.
- nextHop StringIn Ip Address 
- Contains the IP address packets should be forwarded to.
- nextHop StringType 
- The type of Azure hop the packet should be sent to.
- addressPrefix string
- The destination CIDR to which the route applies.
- name string
- The name of the Route Table.
- nextHop stringIn Ip Address 
- Contains the IP address packets should be forwarded to.
- nextHop stringType 
- The type of Azure hop the packet should be sent to.
- address_prefix str
- The destination CIDR to which the route applies.
- name str
- The name of the Route Table.
- next_hop_ strin_ ip_ address 
- Contains the IP address packets should be forwarded to.
- next_hop_ strtype 
- The type of Azure hop the packet should be sent to.
- addressPrefix String
- The destination CIDR to which the route applies.
- name String
- The name of the Route Table.
- nextHop StringIn Ip Address 
- Contains the IP address packets should be forwarded to.
- nextHop StringType 
- The type of Azure hop the packet should be sent to.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.