Package com.pulumi.alicloud.vpc
Class RouteTableAttachment
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.alicloud.vpc.RouteTableAttachment
-
public class RouteTableAttachment extends com.pulumi.resources.CustomResource
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](https://www.alibabacloud.com/help/doc-detail/174112.htm). > **NOTE:** Available since v1.194.0. ## Example Usage Basic Usage ```java 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. ```sh $ pulumi import alicloud:vpc/routeTableAttachment:RouteTableAttachment example <route_table_id>:<vswitch_id> ```
-
-
Constructor Summary
Constructors Constructor Description RouteTableAttachment(java.lang.String name)
RouteTableAttachment(java.lang.String name, RouteTableAttachmentArgs args)
RouteTableAttachment(java.lang.String name, RouteTableAttachmentArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RouteTableAttachment
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, RouteTableAttachmentState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>
routeTableId()
com.pulumi.core.Output<java.lang.String>
status()
com.pulumi.core.Output<java.lang.String>
vswitchId()
-
-
-
Constructor Detail
-
RouteTableAttachment
public RouteTableAttachment(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
RouteTableAttachment
public RouteTableAttachment(java.lang.String name, RouteTableAttachmentArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
RouteTableAttachment
public RouteTableAttachment(java.lang.String name, RouteTableAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
routeTableId
public com.pulumi.core.Output<java.lang.String> routeTableId()
- Returns:
- The ID of the route table to be bound to the switch.
-
status
public com.pulumi.core.Output<java.lang.String> status()
- Returns:
- The status of the resource.
-
vswitchId
public com.pulumi.core.Output<java.lang.String> vswitchId()
- Returns:
- The ID of the switch to bind the route table.
-
get
public static RouteTableAttachment get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable RouteTableAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-