RouteTableAssociationArgs

data class RouteTableAssociationArgs(val gatewayId: Output<String>? = null, val routeTableId: Output<String>? = null, val subnetId: Output<String>? = null) : ConvertibleToJava<RouteTableAssociationArgs>

Provides a resource to create an association between a route table and a subnet or a route table and an internet gateway or virtual private gateway.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.RouteTableAssociation;
import com.pulumi.aws.ec2.RouteTableAssociationArgs;
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 routeTableAssociation = new RouteTableAssociation("routeTableAssociation", RouteTableAssociationArgs.builder()
.subnetId(aws_subnet.foo().id())
.routeTableId(aws_route_table.bar().id())
.build());
}
}

Import

With EC2 Internet Gateways: Using pulumi import to import EC2 Route Table Associations using the associated resource ID and Route Table ID separated by a forward slash (/). For example: With EC2 Subnets:

$ pulumi import aws:ec2/routeTableAssociation:RouteTableAssociation assoc subnet-6777656e646f6c796e/rtb-656c65616e6f72

With EC2 Internet Gateways:

$ pulumi import aws:ec2/routeTableAssociation:RouteTableAssociation assoc igw-01b3a60780f8d034a/rtb-656c65616e6f72

Constructors

Link copied to clipboard
fun RouteTableAssociationArgs(gatewayId: Output<String>? = null, routeTableId: Output<String>? = null, subnetId: Output<String>? = null)

Functions

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

Properties

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

The gateway ID to create an association. Conflicts with subnet_id.

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

The ID of the routing table to associate with.

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

The subnet ID to create an association. Conflicts with gateway_id.