RouteTableAttachment

class RouteTableAttachment : KotlinCustomResource

Provides a VPC Route Table Attachment resource. Routing table associated resource type. For information about VPC Route Table Attachment and how to use it, see What is Route Table Attachment.

NOTE: Available since v1.194.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.vpc.RouteTable;
import com.pulumi.alicloud.vpc.RouteTableArgs;
import com.pulumi.alicloud.vpc.RouteTableAttachment;
import com.pulumi.alicloud.vpc.RouteTableAttachmentArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var fooNetwork = new Network("fooNetwork", NetworkArgs.builder()
.cidrBlock("172.16.0.0/12")
.build());
final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var fooSwitch = new Switch("fooSwitch", SwitchArgs.builder()
.vpcId(fooNetwork.id())
.cidrBlock("172.16.0.0/21")
.zoneId(default_.zones()[0].id())
.build());
var fooRouteTable = new RouteTable("fooRouteTable", RouteTableArgs.builder()
.vpcId(fooNetwork.id())
.routeTableName(name)
.description("route_table_attachment")
.build());
var fooRouteTableAttachment = new RouteTableAttachment("fooRouteTableAttachment", RouteTableAttachmentArgs.builder()
.vswitchId(fooSwitch.id())
.routeTableId(fooRouteTable.id())
.build());
}
}

Import

VPC Route Table Attachment can be imported using the id, e.g.

$ pulumi import alicloud:vpc/routeTableAttachment:RouteTableAttachment example <route_table_id>:<vswitch_id>

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val routeTableId: Output<String>

The ID of the route table to be bound to the switch.

Link copied to clipboard
val status: Output<String>

The status of the resource.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val vswitchId: Output<String>

The ID of the switch to bind the route table.