GetTransitGateway

Get information on an EC2 Transit Gateway.

Example Usage

By Filter

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.Ec2TransitGateway.GetTransitGateway.InvokeAsync(new Aws.Ec2TransitGateway.GetTransitGatewayArgs
        {
            Filters = 
            {
                new Aws.Ec2TransitGateway.Inputs.GetTransitGatewayFilterArgs
                {
                    Name = "options.amazon-side-asn",
                    Values = 
                    {
                        "64512",
                    },
                },
            },
        }));
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2transitgateway.LookupTransitGateway(ctx, &ec2transitgateway.LookupTransitGatewayArgs{
            Filters: []ec2transitgateway.GetTransitGatewayFilter{
                ec2transitgateway.GetTransitGatewayFilter{
                    Name: "options.amazon-side-asn",
                    Values: []string{
                        "64512",
                    },
                },
            },
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.ec2transitgateway.get_transit_gateway(filters=[{
    "name": "options.amazon-side-asn",
    "values": ["64512"],
}])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.ec2transitgateway.getTransitGateway({
    filters: [{
        name: "options.amazon-side-asn",
        values: ["64512"],
    }],
}, { async: true }));

By Identifier

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.Ec2TransitGateway.GetTransitGateway.InvokeAsync(new Aws.Ec2TransitGateway.GetTransitGatewayArgs
        {
            Id = "tgw-12345678",
        }));
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "tgw-12345678"
        _, err := ec2transitgateway.LookupTransitGateway(ctx, &ec2transitgateway.LookupTransitGatewayArgs{
            Id: &opt0,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.ec2transitgateway.get_transit_gateway(id="tgw-12345678")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.ec2transitgateway.getTransitGateway({
    id: "tgw-12345678",
}, { async: true }));

Using GetTransitGateway

function getTransitGateway(args: GetTransitGatewayArgs, opts?: InvokeOptions): Promise<GetTransitGatewayResult>
function  get_transit_gateway(filters=None, id=None, tags=None, opts=None)
func LookupTransitGateway(ctx *Context, args *LookupTransitGatewayArgs, opts ...InvokeOption) (*LookupTransitGatewayResult, error)

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

public static class GetTransitGateway {
    public static Task<GetTransitGatewayResult> InvokeAsync(GetTransitGatewayArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Filters List<GetTransitGatewayFilterArgs>

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 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 List[GetTransitGatewayFilter]

One or more configuration blocks containing name-values filters. Detailed below.

id str

Identifier of the EC2 Transit Gateway.

tags Dict[str, str]

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 Amazon Resource Name (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.

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

VpnEcmpSupport string

Whether VPN Equal Cost Multipath Protocol support is enabled.

Filters List<GetTransitGatewayFilter>
Id string

EC2 Transit Gateway identifier

AmazonSideAsn int

Private Autonomous System Number (ASN) for the Amazon side of a BGP session

Arn string

EC2 Transit Gateway Amazon Resource Name (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.

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

VpnEcmpSupport string

Whether VPN Equal Cost Multipath Protocol support is enabled.

Filters []GetTransitGatewayFilter
Id string

EC2 Transit Gateway identifier

amazonSideAsn number

Private Autonomous System Number (ASN) for the Amazon side of a BGP session

arn string

EC2 Transit Gateway Amazon Resource Name (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.

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

vpnEcmpSupport string

Whether VPN Equal Cost Multipath Protocol support is enabled.

filters GetTransitGatewayFilter[]
id string

EC2 Transit Gateway identifier

amazon_side_asn float

Private Autonomous System Number (ASN) for the Amazon side of a BGP session

arn str

EC2 Transit Gateway Amazon Resource Name (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.

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 Dict[str, str]

Key-value tags for the EC2 Transit Gateway

vpn_ecmp_support str

Whether VPN Equal Cost Multipath Protocol support is enabled.

filters List[GetTransitGatewayFilter]
id str

EC2 Transit Gateway identifier

Supporting Types

GetTransitGatewayFilter

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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 string[]

List of one or more values for the filter.

name str

Name of the filter.

values List[str]

List of one or more values for the filter.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.