MainRouteTableAssociationArgs

data class MainRouteTableAssociationArgs(val routeTableId: Output<String>? = null, val vpcId: Output<String>? = null) : ConvertibleToJava<MainRouteTableAssociationArgs>

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

NOTE: Do not use both aws.ec2.DefaultRouteTable to manage a default route table and aws.ec2.MainRouteTableAssociation with the same VPC due to possible route conflicts. See aws.ec2.DefaultRouteTable documentation for more details. For more information, see the Amazon VPC User Guide on Route Tables. For information about managing normal route tables in the provider, see aws.ec2.RouteTable.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.MainRouteTableAssociation;
import com.pulumi.aws.ec2.MainRouteTableAssociationArgs;
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 mainRouteTableAssociation = new MainRouteTableAssociation("mainRouteTableAssociation", MainRouteTableAssociationArgs.builder()
.vpcId(aws_vpc.foo().id())
.routeTableId(aws_route_table.bar().id())
.build());
}
}

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.

Constructors

Link copied to clipboard
constructor(routeTableId: Output<String>? = null, vpcId: Output<String>? = null)

Properties

Link copied to clipboard
val routeTableId: Output<String>? = null

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

Link copied to clipboard
val vpcId: Output<String>? = null

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

Functions

Link copied to clipboard
open override fun toJava(): MainRouteTableAssociationArgs