1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2transitgateway
  5. getRouteTable

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

aws.ec2transitgateway.getRouteTable

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

    Get information on an EC2 Transit Gateway Route Table.

    Example Usage

    By Filter

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ec2transitgateway.getRouteTable({
        filters: [
            {
                name: "default-association-route-table",
                values: ["true"],
            },
            {
                name: "transit-gateway-id",
                values: ["tgw-12345678"],
            },
        ],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2transitgateway.get_route_table(filters=[
        aws.ec2transitgateway.GetRouteTableFilterArgs(
            name="default-association-route-table",
            values=["true"],
        ),
        aws.ec2transitgateway.GetRouteTableFilterArgs(
            name="transit-gateway-id",
            values=["tgw-12345678"],
        ),
    ])
    
    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.LookupRouteTable(ctx, &ec2transitgateway.LookupRouteTableArgs{
    			Filters: []ec2transitgateway.GetRouteTableFilter{
    				{
    					Name: "default-association-route-table",
    					Values: []string{
    						"true",
    					},
    				},
    				{
    					Name: "transit-gateway-id",
    					Values: []string{
    						"tgw-12345678",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Ec2TransitGateway.GetRouteTable.Invoke(new()
        {
            Filters = new[]
            {
                new Aws.Ec2TransitGateway.Inputs.GetRouteTableFilterInputArgs
                {
                    Name = "default-association-route-table",
                    Values = new[]
                    {
                        "true",
                    },
                },
                new Aws.Ec2TransitGateway.Inputs.GetRouteTableFilterInputArgs
                {
                    Name = "transit-gateway-id",
                    Values = new[]
                    {
                        "tgw-12345678",
                    },
                },
            },
        });
    
    });
    
    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.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 = Ec2transitgatewayFunctions.getRouteTable(GetRouteTableArgs.builder()
                .filters(            
                    GetRouteTableFilterArgs.builder()
                        .name("default-association-route-table")
                        .values("true")
                        .build(),
                    GetRouteTableFilterArgs.builder()
                        .name("transit-gateway-id")
                        .values("tgw-12345678")
                        .build())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ec2transitgateway:getRouteTable
          Arguments:
            filters:
              - name: default-association-route-table
                values:
                  - 'true'
              - name: transit-gateway-id
                values:
                  - tgw-12345678
    

    By Identifier

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ec2transitgateway.getRouteTable({
        id: "tgw-rtb-12345678",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2transitgateway.get_route_table(id="tgw-rtb-12345678")
    
    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.LookupRouteTable(ctx, &ec2transitgateway.LookupRouteTableArgs{
    			Id: pulumi.StringRef("tgw-rtb-12345678"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Ec2TransitGateway.GetRouteTable.Invoke(new()
        {
            Id = "tgw-rtb-12345678",
        });
    
    });
    
    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.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 = Ec2transitgatewayFunctions.getRouteTable(GetRouteTableArgs.builder()
                .id("tgw-rtb-12345678")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ec2transitgateway:getRouteTable
          Arguments:
            id: tgw-rtb-12345678
    

    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(filters: Optional[Sequence[GetRouteTableFilter]] = None,
                        id: Optional[str] = None,
                        tags: Optional[Mapping[str, str]] = None,
                        opts: Optional[InvokeOptions] = None) -> GetRouteTableResult
    def get_route_table_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetRouteTableFilterArgs]]]] = None,
                        id: Optional[pulumi.Input[str]] = None,
                        tags: Optional[pulumi.Input[Mapping[str, 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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2transitgateway/getRouteTable:getRouteTable
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetRouteTableFilter>
    One or more configuration blocks containing name-values filters. Detailed below.
    Id string
    Identifier of the EC2 Transit Gateway Route Table.
    Tags Dictionary<string, string>
    Key-value tags for the EC2 Transit Gateway Route Table
    Filters []GetRouteTableFilter
    One or more configuration blocks containing name-values filters. Detailed below.
    Id string
    Identifier of the EC2 Transit Gateway Route Table.
    Tags map[string]string
    Key-value tags for the EC2 Transit Gateway Route Table
    filters List<GetRouteTableFilter>
    One or more configuration blocks containing name-values filters. Detailed below.
    id String
    Identifier of the EC2 Transit Gateway Route Table.
    tags Map<String,String>
    Key-value tags for the EC2 Transit Gateway Route Table
    filters GetRouteTableFilter[]
    One or more configuration blocks containing name-values filters. Detailed below.
    id string
    Identifier of the EC2 Transit Gateway Route Table.
    tags {[key: string]: string}
    Key-value tags for the EC2 Transit Gateway Route Table
    filters Sequence[GetRouteTableFilter]
    One or more configuration blocks containing name-values filters. Detailed below.
    id str
    Identifier of the EC2 Transit Gateway Route Table.
    tags Mapping[str, str]
    Key-value tags for the EC2 Transit Gateway Route Table
    filters List<Property Map>
    One or more configuration blocks containing name-values filters. Detailed below.
    id String
    Identifier of the EC2 Transit Gateway Route Table.
    tags Map<String>
    Key-value tags for the EC2 Transit Gateway Route Table

    getRouteTable Result

    The following output properties are available:

    Arn string
    EC2 Transit Gateway Route Table ARN.
    DefaultAssociationRouteTable bool
    Boolean whether this is the default association route table for the EC2 Transit Gateway
    DefaultPropagationRouteTable bool
    Boolean whether this is the default propagation route table for the EC2 Transit Gateway
    Id string
    EC2 Transit Gateway Route Table identifier
    Tags Dictionary<string, string>
    Key-value tags for the EC2 Transit Gateway Route Table
    TransitGatewayId string
    EC2 Transit Gateway identifier
    Filters List<GetRouteTableFilter>
    Arn string
    EC2 Transit Gateway Route Table ARN.
    DefaultAssociationRouteTable bool
    Boolean whether this is the default association route table for the EC2 Transit Gateway
    DefaultPropagationRouteTable bool
    Boolean whether this is the default propagation route table for the EC2 Transit Gateway
    Id string
    EC2 Transit Gateway Route Table identifier
    Tags map[string]string
    Key-value tags for the EC2 Transit Gateway Route Table
    TransitGatewayId string
    EC2 Transit Gateway identifier
    Filters []GetRouteTableFilter
    arn String
    EC2 Transit Gateway Route Table ARN.
    defaultAssociationRouteTable Boolean
    Boolean whether this is the default association route table for the EC2 Transit Gateway
    defaultPropagationRouteTable Boolean
    Boolean whether this is the default propagation route table for the EC2 Transit Gateway
    id String
    EC2 Transit Gateway Route Table identifier
    tags Map<String,String>
    Key-value tags for the EC2 Transit Gateway Route Table
    transitGatewayId String
    EC2 Transit Gateway identifier
    filters List<GetRouteTableFilter>
    arn string
    EC2 Transit Gateway Route Table ARN.
    defaultAssociationRouteTable boolean
    Boolean whether this is the default association route table for the EC2 Transit Gateway
    defaultPropagationRouteTable boolean
    Boolean whether this is the default propagation route table for the EC2 Transit Gateway
    id string
    EC2 Transit Gateway Route Table identifier
    tags {[key: string]: string}
    Key-value tags for the EC2 Transit Gateway Route Table
    transitGatewayId string
    EC2 Transit Gateway identifier
    filters GetRouteTableFilter[]
    arn str
    EC2 Transit Gateway Route Table ARN.
    default_association_route_table bool
    Boolean whether this is the default association route table for the EC2 Transit Gateway
    default_propagation_route_table bool
    Boolean whether this is the default propagation route table for the EC2 Transit Gateway
    id str
    EC2 Transit Gateway Route Table identifier
    tags Mapping[str, str]
    Key-value tags for the EC2 Transit Gateway Route Table
    transit_gateway_id str
    EC2 Transit Gateway identifier
    filters Sequence[GetRouteTableFilter]
    arn String
    EC2 Transit Gateway Route Table ARN.
    defaultAssociationRouteTable Boolean
    Boolean whether this is the default association route table for the EC2 Transit Gateway
    defaultPropagationRouteTable Boolean
    Boolean whether this is the default propagation route table for the EC2 Transit Gateway
    id String
    EC2 Transit Gateway Route Table identifier
    tags Map<String>
    Key-value tags for the EC2 Transit Gateway Route Table
    transitGatewayId String
    EC2 Transit Gateway identifier
    filters List<Property Map>

    Supporting Types

    GetRouteTableFilter

    Name string
    Name of the filter.
    Values List<string>
    List of one or more values for the filter.
    Name string
    Name of the filter.
    Values []string
    List of one or more values for the filter.
    name String
    Name of the filter.
    values List<String>
    List of one or more values for the filter.
    name string
    Name of the filter.
    values string[]
    List of one or more values for the filter.
    name str
    Name of the filter.
    values Sequence[str]
    List of one or more values for the filter.
    name String
    Name of the filter.
    values List<String>
    List of one or more values for the filter.

    Package Details

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

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi