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

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

AWS Classic v6.37.1 published on Friday, May 24, 2024 by Pulumi

aws.ec2transitgateway.getTransitGateway

Explore with Pulumi AI

aws logo

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

AWS Classic v6.37.1 published on Friday, May 24, 2024 by Pulumi

    Get information on an EC2 Transit Gateway.

    Example Usage

    By Filter

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ec2transitgateway.getTransitGateway({
        filters: [{
            name: "options.amazon-side-asn",
            values: ["64512"],
        }],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2transitgateway.get_transit_gateway(filters=[aws.ec2transitgateway.GetTransitGatewayFilterArgs(
        name="options.amazon-side-asn",
        values=["64512"],
    )])
    
    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.LookupTransitGateway(ctx, &ec2transitgateway.LookupTransitGatewayArgs{
    			Filters: []ec2transitgateway.GetTransitGatewayFilter{
    				{
    					Name: "options.amazon-side-asn",
    					Values: []string{
    						"64512",
    					},
    				},
    			},
    		}, 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.GetTransitGateway.Invoke(new()
        {
            Filters = new[]
            {
                new Aws.Ec2TransitGateway.Inputs.GetTransitGatewayFilterInputArgs
                {
                    Name = "options.amazon-side-asn",
                    Values = new[]
                    {
                        "64512",
                    },
                },
            },
        });
    
    });
    
    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.GetTransitGatewayArgs;
    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.getTransitGateway(GetTransitGatewayArgs.builder()
                .filters(GetTransitGatewayFilterArgs.builder()
                    .name("options.amazon-side-asn")
                    .values("64512")
                    .build())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ec2transitgateway:getTransitGateway
          Arguments:
            filters:
              - name: options.amazon-side-asn
                values:
                  - '64512'
    

    By Identifier

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ec2transitgateway.getTransitGateway({
        id: "tgw-12345678",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2transitgateway.get_transit_gateway(id="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.LookupTransitGateway(ctx, &ec2transitgateway.LookupTransitGatewayArgs{
    			Id: pulumi.StringRef("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.GetTransitGateway.Invoke(new()
        {
            Id = "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.GetTransitGatewayArgs;
    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.getTransitGateway(GetTransitGatewayArgs.builder()
                .id("tgw-12345678")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ec2transitgateway:getTransitGateway
          Arguments:
            id: tgw-12345678
    

    Using getTransitGateway

    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 getTransitGateway(args: GetTransitGatewayArgs, opts?: InvokeOptions): Promise<GetTransitGatewayResult>
    function getTransitGatewayOutput(args: GetTransitGatewayOutputArgs, opts?: InvokeOptions): Output<GetTransitGatewayResult>
    def get_transit_gateway(filters: Optional[Sequence[GetTransitGatewayFilter]] = None,
                            id: Optional[str] = None,
                            tags: Optional[Mapping[str, str]] = None,
                            opts: Optional[InvokeOptions] = None) -> GetTransitGatewayResult
    def get_transit_gateway_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetTransitGatewayFilterArgs]]]] = None,
                            id: Optional[pulumi.Input[str]] = None,
                            tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetTransitGatewayResult]
    func LookupTransitGateway(ctx *Context, args *LookupTransitGatewayArgs, opts ...InvokeOption) (*LookupTransitGatewayResult, error)
    func LookupTransitGatewayOutput(ctx *Context, args *LookupTransitGatewayOutputArgs, opts ...InvokeOption) LookupTransitGatewayResultOutput

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

    public static class GetTransitGateway 
    {
        public static Task<GetTransitGatewayResult> InvokeAsync(GetTransitGatewayArgs args, InvokeOptions? opts = null)
        public static Output<GetTransitGatewayResult> Invoke(GetTransitGatewayInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTransitGatewayResult> getTransitGateway(GetTransitGatewayArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2transitgateway/getTransitGateway:getTransitGateway
      arguments:
        # arguments dictionary

    The following arguments are supported:

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

    getTransitGateway Result

    The following output properties are available:

    AmazonSideAsn int
    Private Autonomous System Number (ASN) for the Amazon side of a BGP session
    Arn string
    EC2 Transit Gateway ARN
    AssociationDefaultRouteTableId string
    Identifier of the default association route table
    AutoAcceptSharedAttachments string
    Whether resource attachment requests are automatically accepted
    DefaultRouteTableAssociation string
    Whether resource attachments are automatically associated with the default association route table
    DefaultRouteTablePropagation string
    Whether resource attachments automatically propagate routes to the default propagation route table
    Description string
    Description of the EC2 Transit Gateway
    DnsSupport string
    Whether DNS support is enabled
    Id string
    EC2 Transit Gateway identifier
    MulticastSupport string
    Whether Multicast support is enabled
    OwnerId string
    Identifier of the AWS account that owns the EC2 Transit Gateway
    PropagationDefaultRouteTableId string
    Identifier of the default propagation route table
    Tags Dictionary<string, string>
    Key-value tags for the EC2 Transit Gateway
    TransitGatewayCidrBlocks List<string>
    The list of associated CIDR blocks
    VpnEcmpSupport string
    Whether VPN Equal Cost Multipath Protocol support is enabled
    Filters List<GetTransitGatewayFilter>
    AmazonSideAsn int
    Private Autonomous System Number (ASN) for the Amazon side of a BGP session
    Arn string
    EC2 Transit Gateway ARN
    AssociationDefaultRouteTableId string
    Identifier of the default association route table
    AutoAcceptSharedAttachments string
    Whether resource attachment requests are automatically accepted
    DefaultRouteTableAssociation string
    Whether resource attachments are automatically associated with the default association route table
    DefaultRouteTablePropagation string
    Whether resource attachments automatically propagate routes to the default propagation route table
    Description string
    Description of the EC2 Transit Gateway
    DnsSupport string
    Whether DNS support is enabled
    Id string
    EC2 Transit Gateway identifier
    MulticastSupport string
    Whether Multicast support is enabled
    OwnerId string
    Identifier of the AWS account that owns the EC2 Transit Gateway
    PropagationDefaultRouteTableId string
    Identifier of the default propagation route table
    Tags map[string]string
    Key-value tags for the EC2 Transit Gateway
    TransitGatewayCidrBlocks []string
    The list of associated CIDR blocks
    VpnEcmpSupport string
    Whether VPN Equal Cost Multipath Protocol support is enabled
    Filters []GetTransitGatewayFilter
    amazonSideAsn Integer
    Private Autonomous System Number (ASN) for the Amazon side of a BGP session
    arn String
    EC2 Transit Gateway ARN
    associationDefaultRouteTableId String
    Identifier of the default association route table
    autoAcceptSharedAttachments String
    Whether resource attachment requests are automatically accepted
    defaultRouteTableAssociation String
    Whether resource attachments are automatically associated with the default association route table
    defaultRouteTablePropagation String
    Whether resource attachments automatically propagate routes to the default propagation route table
    description String
    Description of the EC2 Transit Gateway
    dnsSupport String
    Whether DNS support is enabled
    id String
    EC2 Transit Gateway identifier
    multicastSupport String
    Whether Multicast support is enabled
    ownerId String
    Identifier of the AWS account that owns the EC2 Transit Gateway
    propagationDefaultRouteTableId String
    Identifier of the default propagation route table
    tags Map<String,String>
    Key-value tags for the EC2 Transit Gateway
    transitGatewayCidrBlocks List<String>
    The list of associated CIDR blocks
    vpnEcmpSupport String
    Whether VPN Equal Cost Multipath Protocol support is enabled
    filters List<GetTransitGatewayFilter>
    amazonSideAsn number
    Private Autonomous System Number (ASN) for the Amazon side of a BGP session
    arn string
    EC2 Transit Gateway ARN
    associationDefaultRouteTableId string
    Identifier of the default association route table
    autoAcceptSharedAttachments string
    Whether resource attachment requests are automatically accepted
    defaultRouteTableAssociation string
    Whether resource attachments are automatically associated with the default association route table
    defaultRouteTablePropagation string
    Whether resource attachments automatically propagate routes to the default propagation route table
    description string
    Description of the EC2 Transit Gateway
    dnsSupport string
    Whether DNS support is enabled
    id string
    EC2 Transit Gateway identifier
    multicastSupport string
    Whether Multicast support is enabled
    ownerId string
    Identifier of the AWS account that owns the EC2 Transit Gateway
    propagationDefaultRouteTableId string
    Identifier of the default propagation route table
    tags {[key: string]: string}
    Key-value tags for the EC2 Transit Gateway
    transitGatewayCidrBlocks string[]
    The list of associated CIDR blocks
    vpnEcmpSupport string
    Whether VPN Equal Cost Multipath Protocol support is enabled
    filters GetTransitGatewayFilter[]
    amazon_side_asn int
    Private Autonomous System Number (ASN) for the Amazon side of a BGP session
    arn str
    EC2 Transit Gateway ARN
    association_default_route_table_id str
    Identifier of the default association route table
    auto_accept_shared_attachments str
    Whether resource attachment requests are automatically accepted
    default_route_table_association str
    Whether resource attachments are automatically associated with the default association route table
    default_route_table_propagation str
    Whether resource attachments automatically propagate routes to the default propagation route table
    description str
    Description of the EC2 Transit Gateway
    dns_support str
    Whether DNS support is enabled
    id str
    EC2 Transit Gateway identifier
    multicast_support str
    Whether Multicast support is enabled
    owner_id str
    Identifier of the AWS account that owns the EC2 Transit Gateway
    propagation_default_route_table_id str
    Identifier of the default propagation route table
    tags Mapping[str, str]
    Key-value tags for the EC2 Transit Gateway
    transit_gateway_cidr_blocks Sequence[str]
    The list of associated CIDR blocks
    vpn_ecmp_support str
    Whether VPN Equal Cost Multipath Protocol support is enabled
    filters Sequence[GetTransitGatewayFilter]
    amazonSideAsn Number
    Private Autonomous System Number (ASN) for the Amazon side of a BGP session
    arn String
    EC2 Transit Gateway ARN
    associationDefaultRouteTableId String
    Identifier of the default association route table
    autoAcceptSharedAttachments String
    Whether resource attachment requests are automatically accepted
    defaultRouteTableAssociation String
    Whether resource attachments are automatically associated with the default association route table
    defaultRouteTablePropagation String
    Whether resource attachments automatically propagate routes to the default propagation route table
    description String
    Description of the EC2 Transit Gateway
    dnsSupport String
    Whether DNS support is enabled
    id String
    EC2 Transit Gateway identifier
    multicastSupport String
    Whether Multicast support is enabled
    ownerId String
    Identifier of the AWS account that owns the EC2 Transit Gateway
    propagationDefaultRouteTableId String
    Identifier of the default propagation route table
    tags Map<String>
    Key-value tags for the EC2 Transit Gateway
    transitGatewayCidrBlocks List<String>
    The list of associated CIDR blocks
    vpnEcmpSupport String
    Whether VPN Equal Cost Multipath Protocol support is enabled
    filters List<Property Map>

    Supporting Types

    GetTransitGatewayFilter

    Name string
    Name of the field to filter by, as defined by the underlying AWS API.
    Values List<string>
    List of one or more values for the filter.
    Name string
    Name of the field to filter by, as defined by the underlying AWS API.
    Values []string
    List of one or more values for the filter.
    name String
    Name of the field to filter by, as defined by the underlying AWS API.
    values List<String>
    List of one or more values for the filter.
    name string
    Name of the field to filter by, as defined by the underlying AWS API.
    values string[]
    List of one or more values for the filter.
    name str
    Name of the field to filter by, as defined by the underlying AWS API.
    values Sequence[str]
    List of one or more values for the filter.
    name String
    Name of the field to filter by, as defined by the underlying AWS API.
    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.37.1 published on Friday, May 24, 2024 by Pulumi