Main Route Table Association Args
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 andaws.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 aws-route-tables. For information about managing normal route tables in Pulumi, see tf-route-tables.
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.