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

is already associated, will result in an error (e.g., Resource.AlreadyAssociatedthe specified association for route table rtb-4176657279 conflicts with an existing association) unless you first import the original association. EC2 Route Table Associations can be imported 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

For example with EC2 Internet Gateways

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

Constructors

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

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.

Functions

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