Route Table Association Args
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
For example with EC2 Internet Gateways
$ pulumi import aws:ec2/routeTableAssociation:RouteTableAssociation assoc igw-01b3a60780f8d034a/rtb-656c65616e6f72
Content copied to clipboard