MainRouteTableAssociation

Provides a resource for managing the main routing table of a VPC.

Notes

On VPC creation, the AWS API always creates an initial Main Route Table. This resource records the ID of that Route Table under original_route_table_id. The “Delete” action for a main_route_table_association consists of resetting this original table as the Main Route Table for the VPC. You’ll see this additional Route Table in the AWS console; it must remain intact in order for the main_route_table_association delete to work properly.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var mainRouteTableAssociation = new Aws.Ec2.MainRouteTableAssociation("mainRouteTableAssociation", new Aws.Ec2.MainRouteTableAssociationArgs
        {
            RouteTableId = aws_route_table.Bar.Id,
            VpcId = aws_vpc.Foo.Id,
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2.NewMainRouteTableAssociation(ctx, "mainRouteTableAssociation", &ec2.MainRouteTableAssociationArgs{
            RouteTableId: pulumi.String(aws_route_table.Bar.Id),
            VpcId:        pulumi.String(aws_vpc.Foo.Id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

main_route_table_association = aws.ec2.MainRouteTableAssociation("mainRouteTableAssociation",
    route_table_id=aws_route_table["bar"]["id"],
    vpc_id=aws_vpc["foo"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const mainRouteTableAssociation = new aws.ec2.MainRouteTableAssociation("a", {
    routeTableId: aws_route_table_bar.id,
    vpcId: aws_vpc_foo.id,
});

Create a MainRouteTableAssociation Resource

def MainRouteTableAssociation(resource_name, opts=None, route_table_id=None, vpc_id=None, __props__=None);
name string
The unique name of the resource.
args MainRouteTableAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args MainRouteTableAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MainRouteTableAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

MainRouteTableAssociation Resource Properties

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

Inputs

The MainRouteTableAssociation resource accepts the following input properties:

RouteTableId string

The ID of the Route Table to set as the new main route table for the target VPC

VpcId string

The ID of the VPC whose main route table should be set

RouteTableId string

The ID of the Route Table to set as the new main route table for the target VPC

VpcId string

The ID of the VPC whose main route table should be set

routeTableId string

The ID of the Route Table to set as the new main route table for the target VPC

vpcId string

The ID of the VPC whose main route table should be set

route_table_id str

The ID of the Route Table to set as the new main route table for the target VPC

vpc_id str

The ID of the VPC whose main route table should be set

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
OriginalRouteTableId string

Used internally, see Notes below

Id string
The provider-assigned unique ID for this managed resource.
OriginalRouteTableId string

Used internally, see Notes below

id string
The provider-assigned unique ID for this managed resource.
originalRouteTableId string

Used internally, see Notes below

id str
The provider-assigned unique ID for this managed resource.
original_route_table_id str

Used internally, see Notes below

Look up an Existing MainRouteTableAssociation Resource

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

static get(resource_name, id, opts=None, original_route_table_id=None, route_table_id=None, vpc_id=None, __props__=None);
func GetMainRouteTableAssociation(ctx *Context, name string, id IDInput, state *MainRouteTableAssociationState, opts ...ResourceOption) (*MainRouteTableAssociation, error)
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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:

OriginalRouteTableId string

Used internally, see Notes below

RouteTableId string

The ID of the Route Table to set as the new main route table for the target VPC

VpcId string

The ID of the VPC whose main route table should be set

OriginalRouteTableId string

Used internally, see Notes below

RouteTableId string

The ID of the Route Table to set as the new main route table for the target VPC

VpcId string

The ID of the VPC whose main route table should be set

originalRouteTableId string

Used internally, see Notes below

routeTableId string

The ID of the Route Table to set as the new main route table for the target VPC

vpcId string

The ID of the VPC whose main route table should be set

original_route_table_id str

Used internally, see Notes below

route_table_id str

The ID of the Route Table to set as the new main route table for the target VPC

vpc_id str

The ID of the VPC whose main route table should be set

Package Details

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