RouteTableArgs

data class RouteTableArgs(val propagatingVgws: Output<List<String>>? = null, val routes: Output<List<RouteTableRouteArgs>>? = null, val tags: Output<Map<String, String>>? = null, val vpcId: Output<String>? = null) : ConvertibleToJava<RouteTableArgs>

Provides a resource to create a VPC routing table.

NOTE on Route Tables and Routes: This provider currently provides both a standalone Route resource and a Route Table resource with routes defined in-line. At this time you cannot use a Route Table with in-line routes in conjunction with any Route resources. Doing so will cause a conflict of rule settings and will overwrite rules. NOTE on gateway_id and nat_gateway_id: The AWS API is very forgiving with these two attributes and the aws.ec2.RouteTable resource can be created with a NAT ID specified as a Gateway ID attribute. This will lead to a permanent diff between your configuration and statefile, as the API returns the correct parameters in the returned route table. If you're experiencing constant diffs in your aws.ec2.RouteTable resources, the first thing to check is whether or not you're specifying a NAT ID instead of a Gateway ID, or vice-versa. NOTE on propagating_vgws and the aws.ec2.VpnGatewayRoutePropagation resource: If the propagating_vgws argument is present, it's not supported to also define route propagations using aws.ec2.VpnGatewayRoutePropagation, since this resource will delete any propagating gateways not explicitly listed in propagating_vgws. Omit this argument when defining route propagation using the separate resource.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.RouteTable;
import com.pulumi.aws.ec2.RouteTableArgs;
import com.pulumi.aws.ec2.inputs.RouteTableRouteArgs;
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 example = new RouteTable("example", RouteTableArgs.builder()
.vpcId(aws_vpc.example().id())
.routes(
RouteTableRouteArgs.builder()
.cidrBlock("10.0.1.0/24")
.gatewayId(aws_internet_gateway.example().id())
.build(),
RouteTableRouteArgs.builder()
.ipv6CidrBlock("::/0")
.egressOnlyGatewayId(aws_egress_only_internet_gateway.example().id())
.build())
.tags(Map.of("Name", "example"))
.build());
}
}

Import

Route Tables can be imported using the route table id. For example, to import route table rtb-4e616f6d69, use this command

$ pulumi import aws:ec2/routeTable:RouteTable public_rt rtb-4e616f6d69

Constructors

Link copied to clipboard
constructor(propagatingVgws: Output<List<String>>? = null, routes: Output<List<RouteTableRouteArgs>>? = null, tags: Output<Map<String, String>>? = null, vpcId: Output<String>? = null)

Properties

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

A list of virtual gateways for propagation.

Link copied to clipboard
val routes: Output<List<RouteTableRouteArgs>>? = null

A list of route objects. Their keys are documented below. This means that omitting this argument is interpreted as ignoring any existing routes. To remove all managed routes an empty list should be specified. See the example above.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

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

The VPC ID.

Functions

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