Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi
alicloud.vpc.Subnet
Explore with Pulumi AI
Deprecated: This resource has been deprecated and replaced by the Switch resource.
Create Subnet Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Subnet(name: string, args?: SubnetArgs, opts?: CustomResourceOptions);@overload
def Subnet(resource_name: str,
           args: Optional[SubnetArgs] = None,
           opts: Optional[ResourceOptions] = None)
@overload
def Subnet(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           availability_zone: Optional[str] = None,
           cidr_block: Optional[str] = None,
           description: Optional[str] = None,
           enable_ipv6: Optional[bool] = None,
           ipv6_cidr_block_mask: Optional[int] = None,
           is_default: Optional[bool] = None,
           name: Optional[str] = None,
           tags: Optional[Mapping[str, str]] = None,
           vpc_id: Optional[str] = None,
           vswitch_name: Optional[str] = None,
           zone_id: Optional[str] = None)func NewSubnet(ctx *Context, name string, args *SubnetArgs, opts ...ResourceOption) (*Subnet, error)public Subnet(string name, SubnetArgs? args = null, CustomResourceOptions? opts = null)
public Subnet(String name, SubnetArgs args)
public Subnet(String name, SubnetArgs args, CustomResourceOptions options)
type: alicloud:vpc:Subnet
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 SubnetArgs
- 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 SubnetArgs
- 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 SubnetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SubnetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SubnetArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Subnet Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Subnet resource accepts the following input properties:
- AvailabilityZone string
- CidrBlock string
- Description string
- EnableIpv6 bool
- Ipv6CidrBlock intMask 
- IsDefault bool
- Name string
- Dictionary<string, string>
- VpcId string
- VswitchName string
- ZoneId string
- AvailabilityZone string
- CidrBlock string
- Description string
- EnableIpv6 bool
- Ipv6CidrBlock intMask 
- IsDefault bool
- Name string
- map[string]string
- VpcId string
- VswitchName string
- ZoneId string
- availabilityZone String
- cidrBlock String
- description String
- enableIpv6 Boolean
- ipv6CidrBlock IntegerMask 
- isDefault Boolean
- name String
- Map<String,String>
- vpcId String
- vswitchName String
- zoneId String
- availabilityZone string
- cidrBlock string
- description string
- enableIpv6 boolean
- ipv6CidrBlock numberMask 
- isDefault boolean
- name string
- {[key: string]: string}
- vpcId string
- vswitchName string
- zoneId string
- availability_zone str
- cidr_block str
- description str
- enable_ipv6 bool
- ipv6_cidr_ intblock_ mask 
- is_default bool
- name str
- Mapping[str, str]
- vpc_id str
- vswitch_name str
- zone_id str
- availabilityZone String
- cidrBlock String
- description String
- enableIpv6 Boolean
- ipv6CidrBlock NumberMask 
- isDefault Boolean
- name String
- Map<String>
- vpcId String
- vswitchName String
- zoneId String
Outputs
All input properties are implicitly available as output properties. Additionally, the Subnet resource produces the following output properties:
- CreateTime string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6CidrBlock string
- Status string
- CreateTime string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6CidrBlock string
- Status string
- createTime String
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlock String
- status String
- createTime string
- id string
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlock string
- status string
- create_time str
- id str
- The provider-assigned unique ID for this managed resource.
- ipv6_cidr_ strblock 
- status str
- createTime String
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlock String
- status String
Look up Existing Subnet Resource
Get an existing Subnet 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?: SubnetState, opts?: CustomResourceOptions): Subnet@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,
        is_default: Optional[bool] = None,
        name: Optional[str] = None,
        status: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        vpc_id: Optional[str] = None,
        vswitch_name: Optional[str] = None,
        zone_id: Optional[str] = None) -> Subnetfunc GetSubnet(ctx *Context, name string, id IDInput, state *SubnetState, opts ...ResourceOption) (*Subnet, error)public static Subnet Get(string name, Input<string> id, SubnetState? state, CustomResourceOptions? opts = null)public static Subnet get(String name, Output<String> id, SubnetState state, CustomResourceOptions options)resources:  _:    type: alicloud:vpc:Subnet    get:      id: ${id}- 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.
- AvailabilityZone string
- CidrBlock string
- CreateTime string
- Description string
- EnableIpv6 bool
- Ipv6CidrBlock string
- Ipv6CidrBlock intMask 
- IsDefault bool
- Name string
- Status string
- Dictionary<string, string>
- VpcId string
- VswitchName string
- ZoneId string
- AvailabilityZone string
- CidrBlock string
- CreateTime string
- Description string
- EnableIpv6 bool
- Ipv6CidrBlock string
- Ipv6CidrBlock intMask 
- IsDefault bool
- Name string
- Status string
- map[string]string
- VpcId string
- VswitchName string
- ZoneId string
- availabilityZone String
- cidrBlock String
- createTime String
- description String
- enableIpv6 Boolean
- ipv6CidrBlock String
- ipv6CidrBlock IntegerMask 
- isDefault Boolean
- name String
- status String
- Map<String,String>
- vpcId String
- vswitchName String
- zoneId String
- availabilityZone string
- cidrBlock string
- createTime string
- description string
- enableIpv6 boolean
- ipv6CidrBlock string
- ipv6CidrBlock numberMask 
- isDefault boolean
- name string
- status string
- {[key: string]: string}
- vpcId string
- vswitchName string
- zoneId string
- availability_zone str
- cidr_block str
- create_time str
- description str
- enable_ipv6 bool
- ipv6_cidr_ strblock 
- ipv6_cidr_ intblock_ mask 
- is_default bool
- name str
- status str
- Mapping[str, str]
- vpc_id str
- vswitch_name str
- zone_id str
- availabilityZone String
- cidrBlock String
- createTime String
- description String
- enableIpv6 Boolean
- ipv6CidrBlock String
- ipv6CidrBlock NumberMask 
- isDefault Boolean
- name String
- status String
- Map<String>
- vpcId String
- vswitchName String
- zoneId String
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the alicloudTerraform Provider.