1. Packages
  2. AWS
  3. API Docs
  4. ec2transitgateway
  5. getRouteTableRoutes
AWS v6.71.0 published on Friday, Mar 7, 2025 by Pulumi

aws.ec2transitgateway.getRouteTableRoutes

Explore with Pulumi AI

Provides informations for routes of a specific transit gateway, such as state, type, cidr

Example Usage

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

const test = aws.ec2transitgateway.getRouteTableRoutes({
    filters: [{
        name: "type",
        values: ["propagated"],
    }],
    transitGatewayRouteTableId: example.id,
});
Copy
import pulumi
import pulumi_aws as aws

test = aws.ec2transitgateway.get_route_table_routes(filters=[{
        "name": "type",
        "values": ["propagated"],
    }],
    transit_gateway_route_table_id=example["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2transitgateway.GetRouteTableRoutes(ctx, &ec2transitgateway.GetRouteTableRoutesArgs{
			Filters: []ec2transitgateway.GetRouteTableRoutesFilter{
				{
					Name: "type",
					Values: []string{
						"propagated",
					},
				},
			},
			TransitGatewayRouteTableId: example.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var test = Aws.Ec2TransitGateway.GetRouteTableRoutes.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Ec2TransitGateway.Inputs.GetRouteTableRoutesFilterInputArgs
            {
                Name = "type",
                Values = new[]
                {
                    "propagated",
                },
            },
        },
        TransitGatewayRouteTableId = example.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2transitgateway.Ec2transitgatewayFunctions;
import com.pulumi.aws.ec2transitgateway.inputs.GetRouteTableRoutesArgs;
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 test = Ec2transitgatewayFunctions.getRouteTableRoutes(GetRouteTableRoutesArgs.builder()
            .filters(GetRouteTableRoutesFilterArgs.builder()
                .name("type")
                .values("propagated")
                .build())
            .transitGatewayRouteTableId(example.id())
            .build());

    }
}
Copy
variables:
  test:
    fn::invoke:
      function: aws:ec2transitgateway:getRouteTableRoutes
      arguments:
        filters:
          - name: type
            values:
              - propagated
        transitGatewayRouteTableId: ${example.id}
Copy

Using getRouteTableRoutes

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 getRouteTableRoutes(args: GetRouteTableRoutesArgs, opts?: InvokeOptions): Promise<GetRouteTableRoutesResult>
function getRouteTableRoutesOutput(args: GetRouteTableRoutesOutputArgs, opts?: InvokeOptions): Output<GetRouteTableRoutesResult>
Copy
def get_route_table_routes(filters: Optional[Sequence[GetRouteTableRoutesFilter]] = None,
                           transit_gateway_route_table_id: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetRouteTableRoutesResult
def get_route_table_routes_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetRouteTableRoutesFilterArgs]]]] = None,
                           transit_gateway_route_table_id: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetRouteTableRoutesResult]
Copy
func GetRouteTableRoutes(ctx *Context, args *GetRouteTableRoutesArgs, opts ...InvokeOption) (*GetRouteTableRoutesResult, error)
func GetRouteTableRoutesOutput(ctx *Context, args *GetRouteTableRoutesOutputArgs, opts ...InvokeOption) GetRouteTableRoutesResultOutput
Copy

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

public static class GetRouteTableRoutes 
{
    public static Task<GetRouteTableRoutesResult> InvokeAsync(GetRouteTableRoutesArgs args, InvokeOptions? opts = null)
    public static Output<GetRouteTableRoutesResult> Invoke(GetRouteTableRoutesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRouteTableRoutesResult> getRouteTableRoutes(GetRouteTableRoutesArgs args, InvokeOptions options)
public static Output<GetRouteTableRoutesResult> getRouteTableRoutes(GetRouteTableRoutesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:ec2transitgateway/getRouteTableRoutes:getRouteTableRoutes
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters This property is required. List<GetRouteTableRoutesFilter>
Custom filter block as described below.
TransitGatewayRouteTableId This property is required. string

Identifier of EC2 Transit Gateway Route Table.

More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

Filters This property is required. []GetRouteTableRoutesFilter
Custom filter block as described below.
TransitGatewayRouteTableId This property is required. string

Identifier of EC2 Transit Gateway Route Table.

More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

filters This property is required. List<GetRouteTableRoutesFilter>
Custom filter block as described below.
transitGatewayRouteTableId This property is required. String

Identifier of EC2 Transit Gateway Route Table.

More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

filters This property is required. GetRouteTableRoutesFilter[]
Custom filter block as described below.
transitGatewayRouteTableId This property is required. string

Identifier of EC2 Transit Gateway Route Table.

More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

filters This property is required. Sequence[GetRouteTableRoutesFilter]
Custom filter block as described below.
transit_gateway_route_table_id This property is required. str

Identifier of EC2 Transit Gateway Route Table.

More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

filters This property is required. List<Property Map>
Custom filter block as described below.
transitGatewayRouteTableId This property is required. String

Identifier of EC2 Transit Gateway Route Table.

More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

getRouteTableRoutes Result

The following output properties are available:

Filters List<GetRouteTableRoutesFilter>
Id string
The provider-assigned unique ID for this managed resource.
Routes List<GetRouteTableRoutesRoute>
List of Transit Gateway Routes.
TransitGatewayRouteTableId string
Filters []GetRouteTableRoutesFilter
Id string
The provider-assigned unique ID for this managed resource.
Routes []GetRouteTableRoutesRoute
List of Transit Gateway Routes.
TransitGatewayRouteTableId string
filters List<GetRouteTableRoutesFilter>
id String
The provider-assigned unique ID for this managed resource.
routes List<GetRouteTableRoutesRoute>
List of Transit Gateway Routes.
transitGatewayRouteTableId String
filters GetRouteTableRoutesFilter[]
id string
The provider-assigned unique ID for this managed resource.
routes GetRouteTableRoutesRoute[]
List of Transit Gateway Routes.
transitGatewayRouteTableId string
filters Sequence[GetRouteTableRoutesFilter]
id str
The provider-assigned unique ID for this managed resource.
routes Sequence[GetRouteTableRoutesRoute]
List of Transit Gateway Routes.
transit_gateway_route_table_id str
filters List<Property Map>
id String
The provider-assigned unique ID for this managed resource.
routes List<Property Map>
List of Transit Gateway Routes.
transitGatewayRouteTableId String

Supporting Types

GetRouteTableRoutesFilter

Name This property is required. string
Name of the field to filter by, as defined by the underlying AWS API.
Values This property is required. List<string>
Set of values that are accepted for the given field.
Name This property is required. string
Name of the field to filter by, as defined by the underlying AWS API.
Values This property is required. []string
Set of values that are accepted for the given field.
name This property is required. String
Name of the field to filter by, as defined by the underlying AWS API.
values This property is required. List<String>
Set of values that are accepted for the given field.
name This property is required. string
Name of the field to filter by, as defined by the underlying AWS API.
values This property is required. string[]
Set of values that are accepted for the given field.
name This property is required. str
Name of the field to filter by, as defined by the underlying AWS API.
values This property is required. Sequence[str]
Set of values that are accepted for the given field.
name This property is required. String
Name of the field to filter by, as defined by the underlying AWS API.
values This property is required. List<String>
Set of values that are accepted for the given field.

GetRouteTableRoutesRoute

DestinationCidrBlock This property is required. string
The CIDR used for route destination matches.
PrefixListId This property is required. string
The ID of the prefix list used for destination matches.
State This property is required. string
The current state of the route, can be active, deleted, pending, blackhole, deleting.
TransitGatewayRouteTableAnnouncementId This property is required. string
The id of the transit gateway route table announcement, most of the time it is an empty string.
Type This property is required. string
The type of the route, can be propagated or static.
DestinationCidrBlock This property is required. string
The CIDR used for route destination matches.
PrefixListId This property is required. string
The ID of the prefix list used for destination matches.
State This property is required. string
The current state of the route, can be active, deleted, pending, blackhole, deleting.
TransitGatewayRouteTableAnnouncementId This property is required. string
The id of the transit gateway route table announcement, most of the time it is an empty string.
Type This property is required. string
The type of the route, can be propagated or static.
destinationCidrBlock This property is required. String
The CIDR used for route destination matches.
prefixListId This property is required. String
The ID of the prefix list used for destination matches.
state This property is required. String
The current state of the route, can be active, deleted, pending, blackhole, deleting.
transitGatewayRouteTableAnnouncementId This property is required. String
The id of the transit gateway route table announcement, most of the time it is an empty string.
type This property is required. String
The type of the route, can be propagated or static.
destinationCidrBlock This property is required. string
The CIDR used for route destination matches.
prefixListId This property is required. string
The ID of the prefix list used for destination matches.
state This property is required. string
The current state of the route, can be active, deleted, pending, blackhole, deleting.
transitGatewayRouteTableAnnouncementId This property is required. string
The id of the transit gateway route table announcement, most of the time it is an empty string.
type This property is required. string
The type of the route, can be propagated or static.
destination_cidr_block This property is required. str
The CIDR used for route destination matches.
prefix_list_id This property is required. str
The ID of the prefix list used for destination matches.
state This property is required. str
The current state of the route, can be active, deleted, pending, blackhole, deleting.
transit_gateway_route_table_announcement_id This property is required. str
The id of the transit gateway route table announcement, most of the time it is an empty string.
type This property is required. str
The type of the route, can be propagated or static.
destinationCidrBlock This property is required. String
The CIDR used for route destination matches.
prefixListId This property is required. String
The ID of the prefix list used for destination matches.
state This property is required. String
The current state of the route, can be active, deleted, pending, blackhole, deleting.
transitGatewayRouteTableAnnouncementId This property is required. String
The id of the transit gateway route table announcement, most of the time it is an empty string.
type This property is required. String
The type of the route, can be propagated or static.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.