1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. getTransitGatewayRouteTables

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

AWS Classic v6.45.0 published on Tuesday, Jul 16, 2024 by Pulumi

aws.ec2.getTransitGatewayRouteTables

Explore with Pulumi AI

aws logo

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

AWS Classic v6.45.0 published on Tuesday, Jul 16, 2024 by Pulumi

    Provides information for multiple EC2 Transit Gateway Route Tables, such as their identifiers.

    Example Usage

    The following shows outputting all Transit Gateway Route Table Ids.

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    export = async () => {
        const example = await aws.ec2.getTransitGatewayRouteTables({});
        return {
            example: example.ids,
        };
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.get_transit_gateway_route_tables()
    pulumi.export("example", example.ids)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ec2.GetTransitGatewayRouteTables(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("example", example.Ids)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Ec2.GetTransitGatewayRouteTables.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["example"] = example.Apply(getTransitGatewayRouteTablesResult => getTransitGatewayRouteTablesResult.Ids),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.Ec2Functions;
    import com.pulumi.aws.ec2.inputs.GetTransitGatewayRouteTablesArgs;
    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 = Ec2Functions.getTransitGatewayRouteTables();
    
            ctx.export("example", example.applyValue(getTransitGatewayRouteTablesResult -> getTransitGatewayRouteTablesResult.ids()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ec2:getTransitGatewayRouteTables
          Arguments: {}
    outputs:
      example: ${example.ids}
    

    Using getTransitGatewayRouteTables

    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 getTransitGatewayRouteTables(args: GetTransitGatewayRouteTablesArgs, opts?: InvokeOptions): Promise<GetTransitGatewayRouteTablesResult>
    function getTransitGatewayRouteTablesOutput(args: GetTransitGatewayRouteTablesOutputArgs, opts?: InvokeOptions): Output<GetTransitGatewayRouteTablesResult>
    def get_transit_gateway_route_tables(filters: Optional[Sequence[GetTransitGatewayRouteTablesFilter]] = None,
                                         tags: Optional[Mapping[str, str]] = None,
                                         opts: Optional[InvokeOptions] = None) -> GetTransitGatewayRouteTablesResult
    def get_transit_gateway_route_tables_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetTransitGatewayRouteTablesFilterArgs]]]] = None,
                                         tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                                         opts: Optional[InvokeOptions] = None) -> Output[GetTransitGatewayRouteTablesResult]
    func GetTransitGatewayRouteTables(ctx *Context, args *GetTransitGatewayRouteTablesArgs, opts ...InvokeOption) (*GetTransitGatewayRouteTablesResult, error)
    func GetTransitGatewayRouteTablesOutput(ctx *Context, args *GetTransitGatewayRouteTablesOutputArgs, opts ...InvokeOption) GetTransitGatewayRouteTablesResultOutput

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

    public static class GetTransitGatewayRouteTables 
    {
        public static Task<GetTransitGatewayRouteTablesResult> InvokeAsync(GetTransitGatewayRouteTablesArgs args, InvokeOptions? opts = null)
        public static Output<GetTransitGatewayRouteTablesResult> Invoke(GetTransitGatewayRouteTablesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTransitGatewayRouteTablesResult> getTransitGatewayRouteTables(GetTransitGatewayRouteTablesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2/getTransitGatewayRouteTables:getTransitGatewayRouteTables
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetTransitGatewayRouteTablesFilter>
    Custom filter block as described below.
    Tags Dictionary<string, string>

    Mapping of tags, each pair of which must exactly match a pair on the desired transit gateway route table.

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

    Filters []GetTransitGatewayRouteTablesFilter
    Custom filter block as described below.
    Tags map[string]string

    Mapping of tags, each pair of which must exactly match a pair on the desired transit gateway route table.

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

    filters List<GetTransitGatewayRouteTablesFilter>
    Custom filter block as described below.
    tags Map<String,String>

    Mapping of tags, each pair of which must exactly match a pair on the desired transit gateway route table.

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

    filters GetTransitGatewayRouteTablesFilter[]
    Custom filter block as described below.
    tags {[key: string]: string}

    Mapping of tags, each pair of which must exactly match a pair on the desired transit gateway route table.

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

    filters Sequence[GetTransitGatewayRouteTablesFilter]
    Custom filter block as described below.
    tags Mapping[str, str]

    Mapping of tags, each pair of which must exactly match a pair on the desired transit gateway route table.

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

    filters List<Property Map>
    Custom filter block as described below.
    tags Map<String>

    Mapping of tags, each pair of which must exactly match a pair on the desired transit gateway route table.

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

    getTransitGatewayRouteTables Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Set of Transit Gateway Route Table identifiers.
    Tags Dictionary<string, string>
    Filters List<GetTransitGatewayRouteTablesFilter>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Set of Transit Gateway Route Table identifiers.
    Tags map[string]string
    Filters []GetTransitGatewayRouteTablesFilter
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    Set of Transit Gateway Route Table identifiers.
    tags Map<String,String>
    filters List<GetTransitGatewayRouteTablesFilter>
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    Set of Transit Gateway Route Table identifiers.
    tags {[key: string]: string}
    filters GetTransitGatewayRouteTablesFilter[]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    Set of Transit Gateway Route Table identifiers.
    tags Mapping[str, str]
    filters Sequence[GetTransitGatewayRouteTablesFilter]
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    Set of Transit Gateway Route Table identifiers.
    tags Map<String>
    filters List<Property Map>

    Supporting Types

    GetTransitGatewayRouteTablesFilter

    Name string
    Name of the field to filter by, as defined by the underlying AWS API.
    Values List<string>
    Set of values that are accepted for the given field. A Transit Gateway Route Table will be selected if any one of the given values matches.
    Name string
    Name of the field to filter by, as defined by the underlying AWS API.
    Values []string
    Set of values that are accepted for the given field. A Transit Gateway Route Table will be selected if any one of the given values matches.
    name String
    Name of the field to filter by, as defined by the underlying AWS API.
    values List<String>
    Set of values that are accepted for the given field. A Transit Gateway Route Table will be selected if any one of the given values matches.
    name string
    Name of the field to filter by, as defined by the underlying AWS API.
    values string[]
    Set of values that are accepted for the given field. A Transit Gateway Route Table will be selected if any one of the given values matches.
    name str
    Name of the field to filter by, as defined by the underlying AWS API.
    values Sequence[str]
    Set of values that are accepted for the given field. A Transit Gateway Route Table will be selected if any one of the given values matches.
    name String
    Name of the field to filter by, as defined by the underlying AWS API.
    values List<String>
    Set of values that are accepted for the given field. A Transit Gateway Route Table will be selected if any one of the given values matches.

    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.45.0 published on Tuesday, Jul 16, 2024 by Pulumi