1. Packages
  2. AWS
  3. API Docs
  4. ec2transitgateway
  5. RouteTable
AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi

aws.ec2transitgateway.RouteTable

Explore with Pulumi AI

Manages an EC2 Transit Gateway Route Table.

Example Usage

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

const example = new aws.ec2transitgateway.RouteTable("example", {transitGatewayId: exampleAwsEc2TransitGateway.id});
Copy
import pulumi
import pulumi_aws as aws

example = aws.ec2transitgateway.RouteTable("example", transit_gateway_id=example_aws_ec2_transit_gateway["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.NewRouteTable(ctx, "example", &ec2transitgateway.RouteTableArgs{
			TransitGatewayId: pulumi.Any(exampleAwsEc2TransitGateway.Id),
		})
		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 example = new Aws.Ec2TransitGateway.RouteTable("example", new()
    {
        TransitGatewayId = exampleAwsEc2TransitGateway.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2transitgateway.RouteTable;
import com.pulumi.aws.ec2transitgateway.RouteTableArgs;
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) {
        var example = new RouteTable("example", RouteTableArgs.builder()
            .transitGatewayId(exampleAwsEc2TransitGateway.id())
            .build());

    }
}
Copy
resources:
  example:
    type: aws:ec2transitgateway:RouteTable
    properties:
      transitGatewayId: ${exampleAwsEc2TransitGateway.id}
Copy

Create RouteTable Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RouteTable(name: string, args: RouteTableArgs, opts?: CustomResourceOptions);
@overload
def RouteTable(resource_name: str,
               args: RouteTableArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def RouteTable(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               transit_gateway_id: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
func NewRouteTable(ctx *Context, name string, args RouteTableArgs, opts ...ResourceOption) (*RouteTable, error)
public RouteTable(string name, RouteTableArgs args, CustomResourceOptions? opts = null)
public RouteTable(String name, RouteTableArgs args)
public RouteTable(String name, RouteTableArgs args, CustomResourceOptions options)
type: aws:ec2transitgateway:RouteTable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RouteTableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RouteTableArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RouteTableArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RouteTableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RouteTableArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var awsRouteTableResource = new Aws.Ec2TransitGateway.RouteTable("awsRouteTableResource", new()
{
    TransitGatewayId = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := ec2transitgateway.NewRouteTable(ctx, "awsRouteTableResource", &ec2transitgateway.RouteTableArgs{
	TransitGatewayId: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var awsRouteTableResource = new RouteTable("awsRouteTableResource", RouteTableArgs.builder()
    .transitGatewayId("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
aws_route_table_resource = aws.ec2transitgateway.RouteTable("awsRouteTableResource",
    transit_gateway_id="string",
    tags={
        "string": "string",
    })
Copy
const awsRouteTableResource = new aws.ec2transitgateway.RouteTable("awsRouteTableResource", {
    transitGatewayId: "string",
    tags: {
        string: "string",
    },
});
Copy
type: aws:ec2transitgateway:RouteTable
properties:
    tags:
        string: string
    transitGatewayId: string
Copy

RouteTable Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The RouteTable resource accepts the following input properties:

TransitGatewayId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of EC2 Transit Gateway.
Tags Dictionary<string, string>
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TransitGatewayId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of EC2 Transit Gateway.
Tags map[string]string
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
transitGatewayId
This property is required.
Changes to this property will trigger replacement.
String
Identifier of EC2 Transit Gateway.
tags Map<String,String>
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
transitGatewayId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of EC2 Transit Gateway.
tags {[key: string]: string}
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
transit_gateway_id
This property is required.
Changes to this property will trigger replacement.
str
Identifier of EC2 Transit Gateway.
tags Mapping[str, str]
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
transitGatewayId
This property is required.
Changes to this property will trigger replacement.
String
Identifier of EC2 Transit Gateway.
tags Map<String>
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

All input properties are implicitly available as output properties. Additionally, the RouteTable resource produces the following output properties:

Arn string
EC2 Transit Gateway Route Table Amazon Resource Name (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
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Arn string
EC2 Transit Gateway Route Table Amazon Resource Name (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
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
EC2 Transit Gateway Route Table Amazon Resource Name (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
The provider-assigned unique ID for this managed resource.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn string
EC2 Transit Gateway Route Table Amazon Resource Name (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
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn str
EC2 Transit Gateway Route Table Amazon Resource Name (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
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
EC2 Transit Gateway Route Table Amazon Resource Name (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
The provider-assigned unique ID for this managed resource.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Look up Existing RouteTable Resource

Get an existing RouteTable resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RouteTableState, opts?: CustomResourceOptions): RouteTable
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        default_association_route_table: Optional[bool] = None,
        default_propagation_route_table: Optional[bool] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        transit_gateway_id: Optional[str] = None) -> RouteTable
func GetRouteTable(ctx *Context, name string, id IDInput, state *RouteTableState, opts ...ResourceOption) (*RouteTable, error)
public static RouteTable Get(string name, Input<string> id, RouteTableState? state, CustomResourceOptions? opts = null)
public static RouteTable get(String name, Output<String> id, RouteTableState state, CustomResourceOptions options)
resources:  _:    type: aws:ec2transitgateway:RouteTable    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string
EC2 Transit Gateway Route Table Amazon Resource Name (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.
Tags Dictionary<string, string>
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TransitGatewayId Changes to this property will trigger replacement. string
Identifier of EC2 Transit Gateway.
Arn string
EC2 Transit Gateway Route Table Amazon Resource Name (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.
Tags map[string]string
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TransitGatewayId Changes to this property will trigger replacement. string
Identifier of EC2 Transit Gateway.
arn String
EC2 Transit Gateway Route Table Amazon Resource Name (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.
tags Map<String,String>
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

transitGatewayId Changes to this property will trigger replacement. String
Identifier of EC2 Transit Gateway.
arn string
EC2 Transit Gateway Route Table Amazon Resource Name (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.
tags {[key: string]: string}
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

transitGatewayId Changes to this property will trigger replacement. string
Identifier of EC2 Transit Gateway.
arn str
EC2 Transit Gateway Route Table Amazon Resource Name (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.
tags Mapping[str, str]
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

transit_gateway_id Changes to this property will trigger replacement. str
Identifier of EC2 Transit Gateway.
arn String
EC2 Transit Gateway Route Table Amazon Resource Name (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.
tags Map<String>
Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

transitGatewayId Changes to this property will trigger replacement. String
Identifier of EC2 Transit Gateway.

Import

Using pulumi import, import aws_ec2_transit_gateway_route_table using the EC2 Transit Gateway Route Table identifier. For example:

$ pulumi import aws:ec2transitgateway/routeTable:RouteTable example tgw-rtb-12345678
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

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