alicloud.vpc.Switch
Explore with Pulumi AI
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
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const foo = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const fooNetwork = new alicloud.vpc.Network("foo", {
vpcName: "terraform-example",
cidrBlock: "172.16.0.0/12",
});
const fooSwitch = new alicloud.vpc.Switch("foo", {
vswitchName: "terraform-example",
cidrBlock: "172.16.0.0/21",
vpcId: fooNetwork.id,
zoneId: foo.then(foo => foo.zones?.[0]?.id),
});
import pulumi
import pulumi_alicloud as alicloud
foo = alicloud.get_zones(available_resource_creation="VSwitch")
foo_network = alicloud.vpc.Network("foo",
vpc_name="terraform-example",
cidr_block="172.16.0.0/12")
foo_switch = alicloud.vpc.Switch("foo",
vswitch_name="terraform-example",
cidr_block="172.16.0.0/21",
vpc_id=foo_network.id,
zone_id=foo.zones[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
foo, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
fooNetwork, err := vpc.NewNetwork(ctx, "foo", &vpc.NetworkArgs{
VpcName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.16.0.0/12"),
})
if err != nil {
return err
}
_, err = vpc.NewSwitch(ctx, "foo", &vpc.SwitchArgs{
VswitchName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.16.0.0/21"),
VpcId: fooNetwork.ID(),
ZoneId: pulumi.String(foo.Zones[0].Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var foo = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var fooNetwork = new AliCloud.Vpc.Network("foo", new()
{
VpcName = "terraform-example",
CidrBlock = "172.16.0.0/12",
});
var fooSwitch = new AliCloud.Vpc.Switch("foo", new()
{
VswitchName = "terraform-example",
CidrBlock = "172.16.0.0/21",
VpcId = fooNetwork.Id,
ZoneId = foo.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
});
});
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 foo = 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(foo.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
}
}
resources:
fooNetwork:
type: alicloud:vpc:Network
name: foo
properties:
vpcName: terraform-example
cidrBlock: 172.16.0.0/12
fooSwitch:
type: alicloud:vpc:Switch
name: foo
properties:
vswitchName: terraform-example
cidrBlock: 172.16.0.0/21
vpcId: ${fooNetwork.id}
zoneId: ${foo.zones[0].id}
variables:
foo:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: VSwitch
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const foo = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const vpc = new alicloud.vpc.Network("vpc", {
vpcName: "terraform-example",
cidrBlock: "172.16.0.0/12",
});
const cidrBlocks = new alicloud.vpc.Ipv4CidrBlock("cidr_blocks", {
vpcId: vpc.id,
secondaryCidrBlock: "192.163.0.0/16",
});
const island_nat = new alicloud.vpc.Switch("island-nat", {
vpcId: cidrBlocks.vpcId,
cidrBlock: "172.16.0.0/21",
zoneId: foo.then(foo => foo.zones?.[0]?.id),
vswitchName: "terraform-example",
tags: {
BuiltBy: "example_value",
cnm_version: "example_value",
Environment: "example_value",
ManagedBy: "example_value",
},
});
import pulumi
import pulumi_alicloud as alicloud
foo = alicloud.get_zones(available_resource_creation="VSwitch")
vpc = alicloud.vpc.Network("vpc",
vpc_name="terraform-example",
cidr_block="172.16.0.0/12")
cidr_blocks = alicloud.vpc.Ipv4CidrBlock("cidr_blocks",
vpc_id=vpc.id,
secondary_cidr_block="192.163.0.0/16")
island_nat = alicloud.vpc.Switch("island-nat",
vpc_id=cidr_blocks.vpc_id,
cidr_block="172.16.0.0/21",
zone_id=foo.zones[0].id,
vswitch_name="terraform-example",
tags={
"BuiltBy": "example_value",
"cnm_version": "example_value",
"Environment": "example_value",
"ManagedBy": "example_value",
})
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
foo, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
vpc, err := vpc.NewNetwork(ctx, "vpc", &vpc.NetworkArgs{
VpcName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.16.0.0/12"),
})
if err != nil {
return err
}
cidrBlocks, err := vpc.NewIpv4CidrBlock(ctx, "cidr_blocks", &vpc.Ipv4CidrBlockArgs{
VpcId: vpc.ID(),
SecondaryCidrBlock: pulumi.String("192.163.0.0/16"),
})
if err != nil {
return err
}
_, err = vpc.NewSwitch(ctx, "island-nat", &vpc.SwitchArgs{
VpcId: cidrBlocks.VpcId,
CidrBlock: pulumi.String("172.16.0.0/21"),
ZoneId: pulumi.String(foo.Zones[0].Id),
VswitchName: pulumi.String("terraform-example"),
Tags: pulumi.Map{
"BuiltBy": pulumi.Any("example_value"),
"cnm_version": pulumi.Any("example_value"),
"Environment": pulumi.Any("example_value"),
"ManagedBy": pulumi.Any("example_value"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var foo = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var vpc = new AliCloud.Vpc.Network("vpc", new()
{
VpcName = "terraform-example",
CidrBlock = "172.16.0.0/12",
});
var cidrBlocks = new AliCloud.Vpc.Ipv4CidrBlock("cidr_blocks", new()
{
VpcId = vpc.Id,
SecondaryCidrBlock = "192.163.0.0/16",
});
var island_nat = new AliCloud.Vpc.Switch("island-nat", new()
{
VpcId = cidrBlocks.VpcId,
CidrBlock = "172.16.0.0/21",
ZoneId = foo.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
VswitchName = "terraform-example",
Tags =
{
{ "BuiltBy", "example_value" },
{ "cnm_version", "example_value" },
{ "Environment", "example_value" },
{ "ManagedBy", "example_value" },
},
});
});
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.Ipv4CidrBlock;
import com.pulumi.alicloud.vpc.Ipv4CidrBlockArgs;
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 foo = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var vpc = new Network("vpc", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.16.0.0/12")
.build());
var cidrBlocks = new Ipv4CidrBlock("cidrBlocks", Ipv4CidrBlockArgs.builder()
.vpcId(vpc.id())
.secondaryCidrBlock("192.163.0.0/16")
.build());
var island_nat = new Switch("island-nat", SwitchArgs.builder()
.vpcId(cidrBlocks.vpcId())
.cidrBlock("172.16.0.0/21")
.zoneId(foo.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchName("terraform-example")
.tags(Map.ofEntries(
Map.entry("BuiltBy", "example_value"),
Map.entry("cnm_version", "example_value"),
Map.entry("Environment", "example_value"),
Map.entry("ManagedBy", "example_value")
))
.build());
}
}
resources:
vpc:
type: alicloud:vpc:Network
properties:
vpcName: terraform-example
cidrBlock: 172.16.0.0/12
cidrBlocks:
type: alicloud:vpc:Ipv4CidrBlock
name: cidr_blocks
properties:
vpcId: ${vpc.id}
secondaryCidrBlock: 192.163.0.0/16
island-nat:
type: alicloud:vpc:Switch
properties:
vpcId: ${cidrBlocks.vpcId}
cidrBlock: 172.16.0.0/21
zoneId: ${foo.zones[0].id}
vswitchName: terraform-example
tags:
BuiltBy: example_value
cnm_version: example_value
Environment: example_value
ManagedBy: example_value
variables:
foo:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: VSwitch
Create a switch associated with the additional network segment
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const foo = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const fooNetwork = new alicloud.vpc.Network("foo", {
vpcName: "terraform-example",
cidrBlock: "172.16.0.0/12",
});
const fooIpv4CidrBlock = new alicloud.vpc.Ipv4CidrBlock("foo", {
vpcId: fooNetwork.id,
secondaryCidrBlock: "192.163.0.0/16",
});
const fooSwitch = new alicloud.vpc.Switch("foo", {
vpcId: fooIpv4CidrBlock.vpcId,
cidrBlock: "192.163.0.0/24",
zoneId: foo.then(foo => foo.zones?.[0]?.id),
});
import pulumi
import pulumi_alicloud as alicloud
foo = alicloud.get_zones(available_resource_creation="VSwitch")
foo_network = alicloud.vpc.Network("foo",
vpc_name="terraform-example",
cidr_block="172.16.0.0/12")
foo_ipv4_cidr_block = alicloud.vpc.Ipv4CidrBlock("foo",
vpc_id=foo_network.id,
secondary_cidr_block="192.163.0.0/16")
foo_switch = alicloud.vpc.Switch("foo",
vpc_id=foo_ipv4_cidr_block.vpc_id,
cidr_block="192.163.0.0/24",
zone_id=foo.zones[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
foo, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
fooNetwork, err := vpc.NewNetwork(ctx, "foo", &vpc.NetworkArgs{
VpcName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.16.0.0/12"),
})
if err != nil {
return err
}
fooIpv4CidrBlock, err := vpc.NewIpv4CidrBlock(ctx, "foo", &vpc.Ipv4CidrBlockArgs{
VpcId: fooNetwork.ID(),
SecondaryCidrBlock: pulumi.String("192.163.0.0/16"),
})
if err != nil {
return err
}
_, err = vpc.NewSwitch(ctx, "foo", &vpc.SwitchArgs{
VpcId: fooIpv4CidrBlock.VpcId,
CidrBlock: pulumi.String("192.163.0.0/24"),
ZoneId: pulumi.String(foo.Zones[0].Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var foo = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var fooNetwork = new AliCloud.Vpc.Network("foo", new()
{
VpcName = "terraform-example",
CidrBlock = "172.16.0.0/12",
});
var fooIpv4CidrBlock = new AliCloud.Vpc.Ipv4CidrBlock("foo", new()
{
VpcId = fooNetwork.Id,
SecondaryCidrBlock = "192.163.0.0/16",
});
var fooSwitch = new AliCloud.Vpc.Switch("foo", new()
{
VpcId = fooIpv4CidrBlock.VpcId,
CidrBlock = "192.163.0.0/24",
ZoneId = foo.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
});
});
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.Ipv4CidrBlock;
import com.pulumi.alicloud.vpc.Ipv4CidrBlockArgs;
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 foo = 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 fooIpv4CidrBlock = new Ipv4CidrBlock("fooIpv4CidrBlock", Ipv4CidrBlockArgs.builder()
.vpcId(fooNetwork.id())
.secondaryCidrBlock("192.163.0.0/16")
.build());
var fooSwitch = new Switch("fooSwitch", SwitchArgs.builder()
.vpcId(fooIpv4CidrBlock.vpcId())
.cidrBlock("192.163.0.0/24")
.zoneId(foo.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
}
}
resources:
fooNetwork:
type: alicloud:vpc:Network
name: foo
properties:
vpcName: terraform-example
cidrBlock: 172.16.0.0/12
fooIpv4CidrBlock:
type: alicloud:vpc:Ipv4CidrBlock
name: foo
properties:
vpcId: ${fooNetwork.id}
secondaryCidrBlock: 192.163.0.0/16
fooSwitch:
type: alicloud:vpc:Switch
name: foo
properties:
vpcId: ${fooIpv4CidrBlock.vpcId}
cidrBlock: 192.163.0.0/24
zoneId: ${foo.zones[0].id}
variables:
foo:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: VSwitch
Create Switch Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Switch(name: string, args: SwitchArgs, opts?: CustomResourceOptions);
@overload
def Switch(resource_name: str,
args: SwitchArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Switch(resource_name: str,
opts: Optional[ResourceOptions] = None,
cidr_block: Optional[str] = None,
vpc_id: Optional[str] = None,
availability_zone: Optional[str] = None,
description: Optional[str] = None,
enable_ipv6: Optional[bool] = None,
ipv6_cidr_block_mask: Optional[int] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, Any]] = None,
vswitch_name: Optional[str] = None,
zone_id: Optional[str] = None)
func NewSwitch(ctx *Context, name string, args SwitchArgs, opts ...ResourceOption) (*Switch, error)
public Switch(string name, SwitchArgs args, CustomResourceOptions? opts = null)
public Switch(String name, SwitchArgs args)
public Switch(String name, SwitchArgs args, CustomResourceOptions options)
type: alicloud:vpc:Switch
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SwitchArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args SwitchArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args SwitchArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SwitchArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SwitchArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var switchResource = new AliCloud.Vpc.Switch("switchResource", new()
{
CidrBlock = "string",
VpcId = "string",
Description = "string",
EnableIpv6 = false,
Ipv6CidrBlockMask = 0,
Tags =
{
{ "string", "any" },
},
VswitchName = "string",
ZoneId = "string",
});
example, err := vpc.NewSwitch(ctx, "switchResource", &vpc.SwitchArgs{
CidrBlock: pulumi.String("string"),
VpcId: pulumi.String("string"),
Description: pulumi.String("string"),
EnableIpv6: pulumi.Bool(false),
Ipv6CidrBlockMask: pulumi.Int(0),
Tags: pulumi.Map{
"string": pulumi.Any("any"),
},
VswitchName: pulumi.String("string"),
ZoneId: pulumi.String("string"),
})
var switchResource = new Switch("switchResource", SwitchArgs.builder()
.cidrBlock("string")
.vpcId("string")
.description("string")
.enableIpv6(false)
.ipv6CidrBlockMask(0)
.tags(Map.of("string", "any"))
.vswitchName("string")
.zoneId("string")
.build());
switch_resource = alicloud.vpc.Switch("switchResource",
cidr_block="string",
vpc_id="string",
description="string",
enable_ipv6=False,
ipv6_cidr_block_mask=0,
tags={
"string": "any",
},
vswitch_name="string",
zone_id="string")
const switchResource = new alicloud.vpc.Switch("switchResource", {
cidrBlock: "string",
vpcId: "string",
description: "string",
enableIpv6: false,
ipv6CidrBlockMask: 0,
tags: {
string: "any",
},
vswitchName: "string",
zoneId: "string",
});
type: alicloud:vpc:Switch
properties:
cidrBlock: string
description: string
enableIpv6: false
ipv6CidrBlockMask: 0
tags:
string: any
vpcId: string
vswitchName: string
zoneId: string
Switch Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Switch resource accepts the following input properties:
- Cidr
Block string - The IPv4 CIDR block of the VSwitch.
- Vpc
Id string The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- Availability
Zone string - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- Description string
- The description of VSwitch.
- Enable
Ipv6 bool - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- Ipv6Cidr
Block intMask - The IPv6 CIDR block of the VSwitch.
- Name string
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- Dictionary<string, object>
- The tags of VSwitch.
- Vswitch
Name string - The name of the VSwitch.
- Zone
Id string - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
- Cidr
Block string - The IPv4 CIDR block of the VSwitch.
- Vpc
Id string The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- Availability
Zone string - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- Description string
- The description of VSwitch.
- Enable
Ipv6 bool - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- Ipv6Cidr
Block intMask - The IPv6 CIDR block of the VSwitch.
- Name string
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- map[string]interface{}
- The tags of VSwitch.
- Vswitch
Name string - The name of the VSwitch.
- Zone
Id string - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
- cidr
Block String - The IPv4 CIDR block of the VSwitch.
- vpc
Id String The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- availability
Zone String - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- description String
- The description of VSwitch.
- enable
Ipv6 Boolean - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- ipv6Cidr
Block IntegerMask - The IPv6 CIDR block of the VSwitch.
- name String
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- Map<String,Object>
- The tags of VSwitch.
- vswitch
Name String - The name of the VSwitch.
- zone
Id String - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
- cidr
Block string - The IPv4 CIDR block of the VSwitch.
- vpc
Id string The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- availability
Zone string - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- description string
- The description of VSwitch.
- enable
Ipv6 boolean - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- ipv6Cidr
Block numberMask - The IPv6 CIDR block of the VSwitch.
- name string
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- {[key: string]: any}
- The tags of VSwitch.
- vswitch
Name string - The name of the VSwitch.
- zone
Id string - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
- cidr_
block str - The IPv4 CIDR block of the VSwitch.
- vpc_
id str The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- availability_
zone str - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- description str
- The description of VSwitch.
- enable_
ipv6 bool - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- ipv6_
cidr_ intblock_ mask - The IPv6 CIDR block of the VSwitch.
- name str
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- Mapping[str, Any]
- The tags of VSwitch.
- vswitch_
name str - The name of the VSwitch.
- zone_
id str - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
- cidr
Block String - The IPv4 CIDR block of the VSwitch.
- vpc
Id String The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- availability
Zone String - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- description String
- The description of VSwitch.
- enable
Ipv6 Boolean - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- ipv6Cidr
Block NumberMask - The IPv6 CIDR block of the VSwitch.
- name String
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- Map<Any>
- The tags of VSwitch.
- vswitch
Name String - The name of the VSwitch.
- zone
Id String - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
Outputs
All input properties are implicitly available as output properties. Additionally, the Switch resource produces the following output properties:
- Create
Time string - The creation time of the VSwitch.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6Cidr
Block string - The IPv6 CIDR block of the VSwitch.
- Status string
- The status of the resource.
- Create
Time string - The creation time of the VSwitch.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6Cidr
Block string - The IPv6 CIDR block of the VSwitch.
- Status string
- The status of the resource.
- create
Time String - The creation time of the VSwitch.
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6Cidr
Block String - The IPv6 CIDR block of the VSwitch.
- status String
- The status of the resource.
- create
Time string - The creation time of the VSwitch.
- id string
- The provider-assigned unique ID for this managed resource.
- ipv6Cidr
Block string - The IPv6 CIDR block of the VSwitch.
- status string
- The status of the resource.
- create_
time str - The creation time of the VSwitch.
- id str
- The provider-assigned unique ID for this managed resource.
- ipv6_
cidr_ strblock - The IPv6 CIDR block of the VSwitch.
- status str
- The status of the resource.
- create
Time String - The creation time of the VSwitch.
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6Cidr
Block String - The IPv6 CIDR block of the VSwitch.
- status String
- The status of the resource.
Look up Existing Switch Resource
Get an existing Switch resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: SwitchState, opts?: CustomResourceOptions): Switch
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
availability_zone: Optional[str] = None,
cidr_block: Optional[str] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
enable_ipv6: Optional[bool] = None,
ipv6_cidr_block: Optional[str] = None,
ipv6_cidr_block_mask: Optional[int] = None,
name: Optional[str] = None,
status: Optional[str] = None,
tags: Optional[Mapping[str, Any]] = None,
vpc_id: Optional[str] = None,
vswitch_name: Optional[str] = None,
zone_id: Optional[str] = None) -> Switch
func GetSwitch(ctx *Context, name string, id IDInput, state *SwitchState, opts ...ResourceOption) (*Switch, error)
public static Switch Get(string name, Input<string> id, SwitchState? state, CustomResourceOptions? opts = null)
public static Switch get(String name, Output<String> id, SwitchState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Availability
Zone string - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- Cidr
Block string - The IPv4 CIDR block of the VSwitch.
- Create
Time string - The creation time of the VSwitch.
- Description string
- The description of VSwitch.
- Enable
Ipv6 bool - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- Ipv6Cidr
Block string - The IPv6 CIDR block of the VSwitch.
- Ipv6Cidr
Block intMask - The IPv6 CIDR block of the VSwitch.
- Name string
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- Status string
- The status of the resource.
- Dictionary<string, object>
- The tags of VSwitch.
- Vpc
Id string The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- Vswitch
Name string - The name of the VSwitch.
- Zone
Id string - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
- Availability
Zone string - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- Cidr
Block string - The IPv4 CIDR block of the VSwitch.
- Create
Time string - The creation time of the VSwitch.
- Description string
- The description of VSwitch.
- Enable
Ipv6 bool - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- Ipv6Cidr
Block string - The IPv6 CIDR block of the VSwitch.
- Ipv6Cidr
Block intMask - The IPv6 CIDR block of the VSwitch.
- Name string
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- Status string
- The status of the resource.
- map[string]interface{}
- The tags of VSwitch.
- Vpc
Id string The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- Vswitch
Name string - The name of the VSwitch.
- Zone
Id string - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
- availability
Zone String - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- cidr
Block String - The IPv4 CIDR block of the VSwitch.
- create
Time String - The creation time of the VSwitch.
- description String
- The description of VSwitch.
- enable
Ipv6 Boolean - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- ipv6Cidr
Block String - The IPv6 CIDR block of the VSwitch.
- ipv6Cidr
Block IntegerMask - The IPv6 CIDR block of the VSwitch.
- name String
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- status String
- The status of the resource.
- Map<String,Object>
- The tags of VSwitch.
- vpc
Id String The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- vswitch
Name String - The name of the VSwitch.
- zone
Id String - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
- availability
Zone string - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- cidr
Block string - The IPv4 CIDR block of the VSwitch.
- create
Time string - The creation time of the VSwitch.
- description string
- The description of VSwitch.
- enable
Ipv6 boolean - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- ipv6Cidr
Block string - The IPv6 CIDR block of the VSwitch.
- ipv6Cidr
Block numberMask - The IPv6 CIDR block of the VSwitch.
- name string
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- status string
- The status of the resource.
- {[key: string]: any}
- The tags of VSwitch.
- vpc
Id string The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- vswitch
Name string - The name of the VSwitch.
- zone
Id string - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
- availability_
zone str - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- cidr_
block str - The IPv4 CIDR block of the VSwitch.
- create_
time str - The creation time of the VSwitch.
- description str
- The description of VSwitch.
- enable_
ipv6 bool - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- ipv6_
cidr_ strblock - The IPv6 CIDR block of the VSwitch.
- ipv6_
cidr_ intblock_ mask - The IPv6 CIDR block of the VSwitch.
- name str
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- status str
- The status of the resource.
- Mapping[str, Any]
- The tags of VSwitch.
- vpc_
id str The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- vswitch_
name str - The name of the VSwitch.
- zone_
id str - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
- availability
Zone String - Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
- cidr
Block String - The IPv4 CIDR block of the VSwitch.
- create
Time String - The creation time of the VSwitch.
- description String
- The description of VSwitch.
- enable
Ipv6 Boolean - Whether the IPv6 function is enabled in the switch. Value:
- true: enables IPv6.
- false (default): IPv6 is not enabled.
- ipv6Cidr
Block String - The IPv6 CIDR block of the VSwitch.
- ipv6Cidr
Block NumberMask - The IPv6 CIDR block of the VSwitch.
- name String
- Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
- status String
- The status of the resource.
- Map<Any>
- The tags of VSwitch.
- vpc
Id String The VPC ID.
The following arguments will be discarded. Please use new fields as soon as possible:
- vswitch
Name String - The name of the VSwitch.
- zone
Id String - The AZ for the VSwitch. Note: Required for a VPC VSwitch.
Import
VPC Vswitch can be imported using the id, e.g.
$ pulumi import alicloud:vpc/switch:Switch example <id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.