Expand description
Provides a resource to manage a default route table of a VPC. This resource can manage the default route table of the default or a non-default VPC.
NOTE: This is an advanced resource with special caveats. Please read this document in its entirety before using this resource. The
aws.ec2.DefaultRouteTable
resource behaves differently from normal resources. This provider does not create this resource but instead attempts to “adopt” it into management. Do not use bothaws.ec2.DefaultRouteTable
to manage a default route table andaws.ec2.MainRouteTableAssociation
with the same VPC due to possible route conflicts. See aws.ec2.MainRouteTableAssociation documentation for more details.
Every VPC has a default route table that can be managed but not destroyed. When the provider first adopts a default route table, it immediately removes all defined routes. It then proceeds to create any routes specified in the configuration. This step is required so that only the routes specified in the configuration exist in the default route table.
For more information, see the Amazon VPC User Guide on Route Tables. For information about managing normal route tables in this provider, see aws.ec2.RouteTable
.
§Example Usage
resources:
example:
type: aws:ec2:DefaultRouteTable
properties:
defaultRouteTableId: ${exampleAwsVpc.defaultRouteTableId}
routes:
- cidrBlock: 10.0.1.0/24
gatewayId: ${exampleAwsInternetGateway.id}
- ipv6CidrBlock: ::/0
egressOnlyGatewayId: ${exampleAwsEgressOnlyInternetGateway.id}
tags:
Name: example
To subsequently remove all managed routes:
resources:
example:
type: aws:ec2:DefaultRouteTable
properties:
defaultRouteTableId: ${exampleAwsVpc.defaultRouteTableId}
routes: []
tags:
Name: example
§Import
Using pulumi import
, import Default VPC route tables using the vpc_id
. For example:
$ pulumi import aws:ec2/defaultRouteTable:DefaultRouteTable example vpc-33cc44dd
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments