Show / Hide Table of Contents

Class RouteTable

Provides a resource to create a VPC routing table.

NOTE on Route Tables and Routes: This provider currently provides both a standalone Route resource and a Route Table resource with routes defined in-line. At this time you cannot use a Route Table with in-line routes in conjunction with any Route resources. Doing so will cause a conflict of rule settings and will overwrite rules.

NOTE on gateway_id and nat_gateway_id: The AWS API is very forgiving with these two attributes and the aws.ec2.RouteTable resource can be created with a NAT ID specified as a Gateway ID attribute. This will lead to a permanent diff between your configuration and statefile, as the API returns the correct parameters in the returned route table. If you're experiencing constant diffs in your aws.ec2.RouteTable resources, the first thing to check is whether or not you're specifying a NAT ID instead of a Gateway ID, or vice-versa.

NOTE on propagating_vgws and the aws.ec2.VpnGatewayRoutePropagation resource: If the propagating_vgws argument is present, it's not supported to also define route propagations using aws.ec2.VpnGatewayRoutePropagation, since this resource will delete any propagating gateways not explicitly listed in propagating_vgws. Omit this argument when defining route propagation using the separate resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var routeTable = new Aws.Ec2.RouteTable("routeTable", new Aws.Ec2.RouteTableArgs
    {
        Routes = 
        {
            new Aws.Ec2.Inputs.RouteTableRouteArgs
            {
                CidrBlock = "10.0.1.0/24",
                GatewayId = aws_internet_gateway.Main.Id,
            },
            new Aws.Ec2.Inputs.RouteTableRouteArgs
            {
                EgressOnlyGatewayId = aws_egress_only_internet_gateway.Foo.Id,
                Ipv6CidrBlock = "::/0",
            },
        },
        Tags = 
        {
            { "Name", "main" },
        },
        VpcId = aws_vpc.Default.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
RouteTable
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class RouteTable : CustomResource

Constructors

View Source

RouteTable(String, RouteTableArgs, CustomResourceOptions)

Create a RouteTable resource with the given unique name, arguments, and options.

Declaration
public RouteTable(string name, RouteTableArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

RouteTableArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

OwnerId

The ID of the AWS account that owns the route table.

Declaration
public Output<string> OwnerId { get; }
Property Value
Type Description
Output<System.String>
View Source

PropagatingVgws

A list of virtual gateways for propagation.

Declaration
public Output<ImmutableArray<string>> PropagatingVgws { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Routes

A list of route objects. Their keys are documented below.

Declaration
public Output<ImmutableArray<RouteTableRoute>> Routes { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<RouteTableRoute>>
View Source

Tags

A mapping of tags to assign to the resource.

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

VpcId

The VPC ID.

Declaration
public Output<string> VpcId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, RouteTableState, CustomResourceOptions)

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

Declaration
public static RouteTable Get(string name, Input<string> id, RouteTableState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

RouteTableState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
RouteTable
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.