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
new MainRouteTableAssociation(name: string, args: MainRouteTableAssociationArgs, opts?: CustomResourceOptions);def MainRouteTableAssociation(resource_name, opts=None, route_table_id=None, vpc_id=None, __props__=None);func NewMainRouteTableAssociation(ctx *Context, name string, args MainRouteTableAssociationArgs, opts ...ResourceOption) (*MainRouteTableAssociation, error)public MainRouteTableAssociation(string name, MainRouteTableAssociationArgs args, CustomResourceOptions? opts = null)- 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:
- Route
Table stringId The ID of the Route Table to set as the new main route table for the target VPC
- Vpc
Id string The ID of the VPC whose main route table should be set
- Route
Table stringId The ID of the Route Table to set as the new main route table for the target VPC
- Vpc
Id string The ID of the VPC whose main route table should be set
- route
Table stringId The ID of the Route Table to set as the new main route table for the target VPC
- vpc
Id string The ID of the VPC whose main route table should be set
- route_
table_ strid 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.
- Original
Route stringTable Id Used internally, see Notes below
- Id string
- The provider-assigned unique ID for this managed resource.
- Original
Route stringTable Id Used internally, see Notes below
- id string
- The provider-assigned unique ID for this managed resource.
- original
Route stringTable Id Used internally, see Notes below
- id str
- The provider-assigned unique ID for this managed resource.
- original_
route_ strtable_ id 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.
public static get(name: string, id: Input<ID>, state?: MainRouteTableAssociationState, opts?: CustomResourceOptions): MainRouteTableAssociationstatic 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)public static MainRouteTableAssociation Get(string name, Input<string> id, MainRouteTableAssociationState? state, CustomResourceOptions? opts = null)- 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:
- Original
Route stringTable Id Used internally, see Notes below
- Route
Table stringId The ID of the Route Table to set as the new main route table for the target VPC
- Vpc
Id string The ID of the VPC whose main route table should be set
- Original
Route stringTable Id Used internally, see Notes below
- Route
Table stringId The ID of the Route Table to set as the new main route table for the target VPC
- Vpc
Id string The ID of the VPC whose main route table should be set
- original
Route stringTable Id Used internally, see Notes below
- route
Table stringId The ID of the Route Table to set as the new main route table for the target VPC
- vpc
Id string The ID of the VPC whose main route table should be set
- original_
route_ strtable_ id Used internally, see Notes below
- route_
table_ strid 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
awsTerraform Provider.