Switch

class Switch : KotlinCustomResource

Provides a VPC Vswitch resource. ## Module Support You can use to the existing vpc module to create a VPC and several VSwitches one-click. For information about VPC Vswitch and how to use it, see What is Vswitch.

NOTE: Available since v1.0.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.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
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 fooZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var fooNetwork = new Network("fooNetwork", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.16.0.0/12")
.build());
var fooSwitch = new Switch("fooSwitch", SwitchArgs.builder()
.vswitchName("terraform-example")
.cidrBlock("172.16.0.0/21")
.vpcId(fooNetwork.id())
.zoneId(fooZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
}
}

Import

VPC Vswitch can be imported using the id, e.g.

$ pulumi import alicloud:vpc/switch:Switch example <id>

Properties

Link copied to clipboard

Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.

Link copied to clipboard
val cidrBlock: Output<String>

The IPv4 CIDR block of the VSwitch.

Link copied to clipboard
val createTime: Output<String>

The creation time of the VSwitch.

Link copied to clipboard
val description: Output<String>?

The description of VSwitch.

Link copied to clipboard
val enableIpv6: Output<Boolean>?

Whether the IPv6 function is enabled in the switch. Value:

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val ipv6CidrBlock: Output<String>

The IPv6 CIDR block of the VSwitch.

Link copied to clipboard
val ipv6CidrBlockMask: Output<Int>

The IPv6 CIDR block of the VSwitch.

Link copied to clipboard
val name: Output<String>

Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.

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

The status of the resource.

Link copied to clipboard
val tags: Output<Map<String, Any>>?

The tags of VSwitch.

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

The VPC ID. The following arguments will be discarded. Please use new fields as soon as possible:

Link copied to clipboard
val vswitchName: Output<String>

The name of the VSwitch.

Link copied to clipboard
val zoneId: Output<String>

The AZ for the VSwitch. Note: Required for a VPC VSwitch.