1. Packages
  2. Packages
  3. Volcenginecc Provider
  4. API Docs
  5. vpc
  6. Subnet
Viewing docs for volcenginecc v0.0.32
published on Thursday, Apr 23, 2026 by Volcengine
volcenginecc logo
Viewing docs for volcenginecc v0.0.32
published on Thursday, Apr 23, 2026 by Volcengine

    The subnet is a segment allocated within a specified availability zone from a VPC CIDR block, providing private IP addresses for cloud resources such as cloud servers and load balancers

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcenginecc from "@volcengine/pulumi-volcenginecc";
    
    const subnetDemo = new volcenginecc.vpc.Subnet("SubnetDemo", {
        vpcId: "vpc-xxxx",
        zoneId: "cn-beijing",
        subnetName: "subnetDemo",
        description: "subnetDemo description",
        cidrBlock: "192.168.xx.0/24",
        tags: [{
            key: "env",
            value: "test",
        }],
    });
    
    import pulumi
    import pulumi_volcenginecc as volcenginecc
    
    subnet_demo = volcenginecc.vpc.Subnet("SubnetDemo",
        vpc_id="vpc-xxxx",
        zone_id="cn-beijing",
        subnet_name="subnetDemo",
        description="subnetDemo description",
        cidr_block="192.168.xx.0/24",
        tags=[{
            "key": "env",
            "value": "test",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcenginecc/sdk/go/volcenginecc/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vpc.NewSubnet(ctx, "SubnetDemo", &vpc.SubnetArgs{
    			VpcId:       pulumi.String("vpc-xxxx"),
    			ZoneId:      pulumi.String("cn-beijing"),
    			SubnetName:  pulumi.String("subnetDemo"),
    			Description: pulumi.String("subnetDemo description"),
    			CidrBlock:   pulumi.String("192.168.xx.0/24"),
    			Tags: vpc.SubnetTagArray{
    				&vpc.SubnetTagArgs{
    					Key:   pulumi.String("env"),
    					Value: pulumi.String("test"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcenginecc = Volcengine.Pulumi.Volcenginecc;
    
    return await Deployment.RunAsync(() => 
    {
        var subnetDemo = new Volcenginecc.Vpc.Subnet("SubnetDemo", new()
        {
            VpcId = "vpc-xxxx",
            ZoneId = "cn-beijing",
            SubnetName = "subnetDemo",
            Description = "subnetDemo description",
            CidrBlock = "192.168.xx.0/24",
            Tags = new[]
            {
                new Volcenginecc.Vpc.Inputs.SubnetTagArgs
                {
                    Key = "env",
                    Value = "test",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.volcengine.volcenginecc.vpc.Subnet;
    import com.volcengine.volcenginecc.vpc.SubnetArgs;
    import com.pulumi.volcenginecc.vpc.inputs.SubnetTagArgs;
    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) {
            var subnetDemo = new Subnet("subnetDemo", SubnetArgs.builder()
                .vpcId("vpc-xxxx")
                .zoneId("cn-beijing")
                .subnetName("subnetDemo")
                .description("subnetDemo description")
                .cidrBlock("192.168.xx.0/24")
                .tags(SubnetTagArgs.builder()
                    .key("env")
                    .value("test")
                    .build())
                .build());
    
        }
    }
    
    resources:
      subnetDemo:
        type: volcenginecc:vpc:Subnet
        name: SubnetDemo
        properties:
          vpcId: vpc-xxxx
          zoneId: cn-beijing
          subnetName: subnetDemo
          description: subnetDemo description
          cidrBlock: 192.168.xx.0/24
          tags:
            - key: env
              value: test
    

    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: SubnetArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Subnet(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               cidr_block: Optional[str] = None,
               vpc_id: Optional[str] = None,
               zone_id: Optional[str] = None,
               description: Optional[str] = None,
               enable_ipv6: Optional[bool] = None,
               ipv6_cidr_block: Optional[str] = None,
               subnet_name: Optional[str] = None,
               tags: Optional[Sequence[SubnetTagArgs]] = None)
    func NewSubnet(ctx *Context, name string, args SubnetArgs, opts ...ResourceOption) (*Subnet, error)
    public Subnet(string name, SubnetArgs args, CustomResourceOptions? opts = null)
    public Subnet(String name, SubnetArgs args)
    public Subnet(String name, SubnetArgs args, CustomResourceOptions options)
    
    type: volcenginecc: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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var subnetResource = new Volcenginecc.Vpc.Subnet("subnetResource", new()
    {
        CidrBlock = "string",
        VpcId = "string",
        ZoneId = "string",
        Description = "string",
        EnableIpv6 = false,
        Ipv6CidrBlock = "string",
        SubnetName = "string",
        Tags = new[]
        {
            new Volcenginecc.Vpc.Inputs.SubnetTagArgs
            {
                Key = "string",
                Value = "string",
            },
        },
    });
    
    example, err := vpc.NewSubnet(ctx, "subnetResource", &vpc.SubnetArgs{
    	CidrBlock:     pulumi.String("string"),
    	VpcId:         pulumi.String("string"),
    	ZoneId:        pulumi.String("string"),
    	Description:   pulumi.String("string"),
    	EnableIpv6:    pulumi.Bool(false),
    	Ipv6CidrBlock: pulumi.String("string"),
    	SubnetName:    pulumi.String("string"),
    	Tags: vpc.SubnetTagArray{
    		&vpc.SubnetTagArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    })
    
    var subnetResource = new Subnet("subnetResource", SubnetArgs.builder()
        .cidrBlock("string")
        .vpcId("string")
        .zoneId("string")
        .description("string")
        .enableIpv6(false)
        .ipv6CidrBlock("string")
        .subnetName("string")
        .tags(SubnetTagArgs.builder()
            .key("string")
            .value("string")
            .build())
        .build());
    
    subnet_resource = volcenginecc.vpc.Subnet("subnetResource",
        cidr_block="string",
        vpc_id="string",
        zone_id="string",
        description="string",
        enable_ipv6=False,
        ipv6_cidr_block="string",
        subnet_name="string",
        tags=[{
            "key": "string",
            "value": "string",
        }])
    
    const subnetResource = new volcenginecc.vpc.Subnet("subnetResource", {
        cidrBlock: "string",
        vpcId: "string",
        zoneId: "string",
        description: "string",
        enableIpv6: false,
        ipv6CidrBlock: "string",
        subnetName: "string",
        tags: [{
            key: "string",
            value: "string",
        }],
    });
    
    type: volcenginecc:vpc:Subnet
    properties:
        cidrBlock: string
        description: string
        enableIpv6: false
        ipv6CidrBlock: string
        subnetName: string
        tags:
            - key: string
              value: string
        vpcId: string
        zoneId: string
    

    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:

    CidrBlock string
    Subnet IPv4 CIDR block
    VpcId string
    ID of the VPC to which the subnet belongs
    ZoneId string
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    Description string
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    EnableIpv6 bool
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    Ipv6CidrBlock string
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    SubnetName string
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    Tags List<Volcengine.SubnetTag>
    CidrBlock string
    Subnet IPv4 CIDR block
    VpcId string
    ID of the VPC to which the subnet belongs
    ZoneId string
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    Description string
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    EnableIpv6 bool
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    Ipv6CidrBlock string
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    SubnetName string
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    Tags []SubnetTagArgs
    cidrBlock String
    Subnet IPv4 CIDR block
    vpcId String
    ID of the VPC to which the subnet belongs
    zoneId String
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    description String
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    enableIpv6 Boolean
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    ipv6CidrBlock String
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    subnetName String
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    tags List<SubnetTag>
    cidrBlock string
    Subnet IPv4 CIDR block
    vpcId string
    ID of the VPC to which the subnet belongs
    zoneId string
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    description string
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    enableIpv6 boolean
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    ipv6CidrBlock string
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    subnetName string
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    tags SubnetTag[]
    cidr_block str
    Subnet IPv4 CIDR block
    vpc_id str
    ID of the VPC to which the subnet belongs
    zone_id str
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    description str
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    enable_ipv6 bool
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    ipv6_cidr_block str
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    subnet_name str
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    tags Sequence[SubnetTagArgs]
    cidrBlock String
    Subnet IPv4 CIDR block
    vpcId String
    ID of the VPC to which the subnet belongs
    zoneId String
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    description String
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    enableIpv6 Boolean
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    ipv6CidrBlock String
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    subnetName String
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    tags List<Property Map>

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Subnet resource produces the following output properties:

    AccountId string
    ID of the account to which the subnet belongs
    AvailableIpAddressCount int
    Number of available IP addresses in the subnet
    CreatedTime string
    Subnet creation time
    Id string
    The provider-assigned unique ID for this managed resource.
    IsDefault bool
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    NetworkAclId string
    ID of the network ACL associated with the subnet
    ProjectName string
    Name of the project associated with the VPC instance where the subnet resides
    ReadIpv6CidrBlock string
    Read-only field, subnet IPv6 CIDR block
    RouteTable Volcengine.SubnetRouteTable
    Route table information
    Status string
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    SubnetId string
    ID of the subnet whose information is to be modified
    TotalIpv4Count int
    Total number of available IPs in the subnet
    UpdatedTime string
    Subnet update time
    AccountId string
    ID of the account to which the subnet belongs
    AvailableIpAddressCount int
    Number of available IP addresses in the subnet
    CreatedTime string
    Subnet creation time
    Id string
    The provider-assigned unique ID for this managed resource.
    IsDefault bool
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    NetworkAclId string
    ID of the network ACL associated with the subnet
    ProjectName string
    Name of the project associated with the VPC instance where the subnet resides
    ReadIpv6CidrBlock string
    Read-only field, subnet IPv6 CIDR block
    RouteTable SubnetRouteTable
    Route table information
    Status string
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    SubnetId string
    ID of the subnet whose information is to be modified
    TotalIpv4Count int
    Total number of available IPs in the subnet
    UpdatedTime string
    Subnet update time
    accountId String
    ID of the account to which the subnet belongs
    availableIpAddressCount Integer
    Number of available IP addresses in the subnet
    createdTime String
    Subnet creation time
    id String
    The provider-assigned unique ID for this managed resource.
    isDefault Boolean
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    networkAclId String
    ID of the network ACL associated with the subnet
    projectName String
    Name of the project associated with the VPC instance where the subnet resides
    readIpv6CidrBlock String
    Read-only field, subnet IPv6 CIDR block
    routeTable SubnetRouteTable
    Route table information
    status String
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    subnetId String
    ID of the subnet whose information is to be modified
    totalIpv4Count Integer
    Total number of available IPs in the subnet
    updatedTime String
    Subnet update time
    accountId string
    ID of the account to which the subnet belongs
    availableIpAddressCount number
    Number of available IP addresses in the subnet
    createdTime string
    Subnet creation time
    id string
    The provider-assigned unique ID for this managed resource.
    isDefault boolean
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    networkAclId string
    ID of the network ACL associated with the subnet
    projectName string
    Name of the project associated with the VPC instance where the subnet resides
    readIpv6CidrBlock string
    Read-only field, subnet IPv6 CIDR block
    routeTable SubnetRouteTable
    Route table information
    status string
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    subnetId string
    ID of the subnet whose information is to be modified
    totalIpv4Count number
    Total number of available IPs in the subnet
    updatedTime string
    Subnet update time
    account_id str
    ID of the account to which the subnet belongs
    available_ip_address_count int
    Number of available IP addresses in the subnet
    created_time str
    Subnet creation time
    id str
    The provider-assigned unique ID for this managed resource.
    is_default bool
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    network_acl_id str
    ID of the network ACL associated with the subnet
    project_name str
    Name of the project associated with the VPC instance where the subnet resides
    read_ipv6_cidr_block str
    Read-only field, subnet IPv6 CIDR block
    route_table SubnetRouteTable
    Route table information
    status str
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    subnet_id str
    ID of the subnet whose information is to be modified
    total_ipv4_count int
    Total number of available IPs in the subnet
    updated_time str
    Subnet update time
    accountId String
    ID of the account to which the subnet belongs
    availableIpAddressCount Number
    Number of available IP addresses in the subnet
    createdTime String
    Subnet creation time
    id String
    The provider-assigned unique ID for this managed resource.
    isDefault Boolean
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    networkAclId String
    ID of the network ACL associated with the subnet
    projectName String
    Name of the project associated with the VPC instance where the subnet resides
    readIpv6CidrBlock String
    Read-only field, subnet IPv6 CIDR block
    routeTable Property Map
    Route table information
    status String
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    subnetId String
    ID of the subnet whose information is to be modified
    totalIpv4Count Number
    Total number of available IPs in the subnet
    updatedTime String
    Subnet update time

    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,
            account_id: Optional[str] = None,
            available_ip_address_count: Optional[int] = None,
            cidr_block: Optional[str] = None,
            created_time: Optional[str] = None,
            description: Optional[str] = None,
            enable_ipv6: Optional[bool] = None,
            ipv6_cidr_block: Optional[str] = None,
            is_default: Optional[bool] = None,
            network_acl_id: Optional[str] = None,
            project_name: Optional[str] = None,
            read_ipv6_cidr_block: Optional[str] = None,
            route_table: Optional[SubnetRouteTableArgs] = None,
            status: Optional[str] = None,
            subnet_id: Optional[str] = None,
            subnet_name: Optional[str] = None,
            tags: Optional[Sequence[SubnetTagArgs]] = None,
            total_ipv4_count: Optional[int] = None,
            updated_time: Optional[str] = None,
            vpc_id: Optional[str] = None,
            zone_id: Optional[str] = None) -> Subnet
    func 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: volcenginecc: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.
    The following state arguments are supported:
    AccountId string
    ID of the account to which the subnet belongs
    AvailableIpAddressCount int
    Number of available IP addresses in the subnet
    CidrBlock string
    Subnet IPv4 CIDR block
    CreatedTime string
    Subnet creation time
    Description string
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    EnableIpv6 bool
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    Ipv6CidrBlock string
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    IsDefault bool
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    NetworkAclId string
    ID of the network ACL associated with the subnet
    ProjectName string
    Name of the project associated with the VPC instance where the subnet resides
    ReadIpv6CidrBlock string
    Read-only field, subnet IPv6 CIDR block
    RouteTable Volcengine.SubnetRouteTable
    Route table information
    Status string
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    SubnetId string
    ID of the subnet whose information is to be modified
    SubnetName string
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    Tags List<Volcengine.SubnetTag>
    TotalIpv4Count int
    Total number of available IPs in the subnet
    UpdatedTime string
    Subnet update time
    VpcId string
    ID of the VPC to which the subnet belongs
    ZoneId string
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    AccountId string
    ID of the account to which the subnet belongs
    AvailableIpAddressCount int
    Number of available IP addresses in the subnet
    CidrBlock string
    Subnet IPv4 CIDR block
    CreatedTime string
    Subnet creation time
    Description string
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    EnableIpv6 bool
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    Ipv6CidrBlock string
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    IsDefault bool
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    NetworkAclId string
    ID of the network ACL associated with the subnet
    ProjectName string
    Name of the project associated with the VPC instance where the subnet resides
    ReadIpv6CidrBlock string
    Read-only field, subnet IPv6 CIDR block
    RouteTable SubnetRouteTableArgs
    Route table information
    Status string
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    SubnetId string
    ID of the subnet whose information is to be modified
    SubnetName string
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    Tags []SubnetTagArgs
    TotalIpv4Count int
    Total number of available IPs in the subnet
    UpdatedTime string
    Subnet update time
    VpcId string
    ID of the VPC to which the subnet belongs
    ZoneId string
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    accountId String
    ID of the account to which the subnet belongs
    availableIpAddressCount Integer
    Number of available IP addresses in the subnet
    cidrBlock String
    Subnet IPv4 CIDR block
    createdTime String
    Subnet creation time
    description String
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    enableIpv6 Boolean
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    ipv6CidrBlock String
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    isDefault Boolean
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    networkAclId String
    ID of the network ACL associated with the subnet
    projectName String
    Name of the project associated with the VPC instance where the subnet resides
    readIpv6CidrBlock String
    Read-only field, subnet IPv6 CIDR block
    routeTable SubnetRouteTable
    Route table information
    status String
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    subnetId String
    ID of the subnet whose information is to be modified
    subnetName String
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    tags List<SubnetTag>
    totalIpv4Count Integer
    Total number of available IPs in the subnet
    updatedTime String
    Subnet update time
    vpcId String
    ID of the VPC to which the subnet belongs
    zoneId String
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    accountId string
    ID of the account to which the subnet belongs
    availableIpAddressCount number
    Number of available IP addresses in the subnet
    cidrBlock string
    Subnet IPv4 CIDR block
    createdTime string
    Subnet creation time
    description string
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    enableIpv6 boolean
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    ipv6CidrBlock string
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    isDefault boolean
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    networkAclId string
    ID of the network ACL associated with the subnet
    projectName string
    Name of the project associated with the VPC instance where the subnet resides
    readIpv6CidrBlock string
    Read-only field, subnet IPv6 CIDR block
    routeTable SubnetRouteTable
    Route table information
    status string
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    subnetId string
    ID of the subnet whose information is to be modified
    subnetName string
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    tags SubnetTag[]
    totalIpv4Count number
    Total number of available IPs in the subnet
    updatedTime string
    Subnet update time
    vpcId string
    ID of the VPC to which the subnet belongs
    zoneId string
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    account_id str
    ID of the account to which the subnet belongs
    available_ip_address_count int
    Number of available IP addresses in the subnet
    cidr_block str
    Subnet IPv4 CIDR block
    created_time str
    Subnet creation time
    description str
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    enable_ipv6 bool
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    ipv6_cidr_block str
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    is_default bool
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    network_acl_id str
    ID of the network ACL associated with the subnet
    project_name str
    Name of the project associated with the VPC instance where the subnet resides
    read_ipv6_cidr_block str
    Read-only field, subnet IPv6 CIDR block
    route_table SubnetRouteTableArgs
    Route table information
    status str
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    subnet_id str
    ID of the subnet whose information is to be modified
    subnet_name str
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    tags Sequence[SubnetTagArgs]
    total_ipv4_count int
    Total number of available IPs in the subnet
    updated_time str
    Subnet update time
    vpc_id str
    ID of the VPC to which the subnet belongs
    zone_id str
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones
    accountId String
    ID of the account to which the subnet belongs
    availableIpAddressCount Number
    Number of available IP addresses in the subnet
    cidrBlock String
    Subnet IPv4 CIDR block
    createdTime String
    Subnet creation time
    description String
    Subnet description. Limited to 0–255 characters. Must start with a letter, Chinese character, or number. Can include English comma (,), period (.), underscore (_), space ( ), equals sign (=), hyphen (-), Chinese comma (,), and Chinese period (。). Cannot start with http:// or https://
    enableIpv6 Boolean
    Enable or disable IPv6. This parameter can be configured only if the VPC to which the subnet belongs has IPv6 enabled. 1. true: Enable. 2. false: Disable. This value can be configured only if no cloud resources in the subnet have assigned IPv6 addresses
    ipv6CidrBlock String
    Subnet IPv6 CIDR block. 1. When creating or modifying, enter the last 8 bits of the subnet IPv6 CIDR block (subnet mask is fixed at /64). 2. This parameter is supported only when EnableIpv6 is set to true. 3. Value range: 0–255. Mask is fixed at /64
    isDefault Boolean
    Whether the subnet is a default subnet. 1. true: Default subnet, created automatically when an ECS instance is created. 2. false: Non-default subnet, created manually by the user
    networkAclId String
    ID of the network ACL associated with the subnet
    projectName String
    Name of the project associated with the VPC instance where the subnet resides
    readIpv6CidrBlock String
    Read-only field, subnet IPv6 CIDR block
    routeTable Property Map
    Route table information
    status String
    Subnet status. 1. Pending: Configuring. 2. Available: Available
    subnetId String
    ID of the subnet whose information is to be modified
    subnetName String
    Subnet name, limited to 1–128 characters. Must start with a letter, Chinese character, or number. Can include period (.), underscore (_), and hyphen (-). Cannot start with http:// or https://. If not specified, defaults to the subnet ID
    tags List<Property Map>
    totalIpv4Count Number
    Total number of available IPs in the subnet
    updatedTime String
    Subnet update time
    vpcId String
    ID of the VPC to which the subnet belongs
    zoneId String
    Availability zone ID for the subnet to be created. For more information, see Regions and Availability Zones

    Supporting Types

    SubnetRouteTable, SubnetRouteTableArgs

    RouteTableId string
    ID of the route table associated with the subnet
    RouteTableType string
    Type of route table associated with the subnet. 1. System: System route table. 2. Custom: Custom route table
    RouteTableId string
    ID of the route table associated with the subnet
    RouteTableType string
    Type of route table associated with the subnet. 1. System: System route table. 2. Custom: Custom route table
    routeTableId String
    ID of the route table associated with the subnet
    routeTableType String
    Type of route table associated with the subnet. 1. System: System route table. 2. Custom: Custom route table
    routeTableId string
    ID of the route table associated with the subnet
    routeTableType string
    Type of route table associated with the subnet. 1. System: System route table. 2. Custom: Custom route table
    route_table_id str
    ID of the route table associated with the subnet
    route_table_type str
    Type of route table associated with the subnet. 1. System: System route table. 2. Custom: Custom route table
    routeTableId String
    ID of the route table associated with the subnet
    routeTableType String
    Type of route table associated with the subnet. 1. System: System route table. 2. Custom: Custom route table

    SubnetTag, SubnetTagArgs

    Key string
    User tag key
    Value string
    User tag value
    Key string
    User tag key
    Value string
    User tag value
    key String
    User tag key
    value String
    User tag value
    key string
    User tag key
    value string
    User tag value
    key str
    User tag key
    value str
    User tag value
    key String
    User tag key
    value String
    User tag value

    Import

    $ pulumi import volcenginecc:vpc/subnet:Subnet example "subnet_id"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    volcenginecc volcengine/pulumi-volcenginecc
    License
    MPL-2.0
    Notes
    This Pulumi package is based on the volcenginecc Terraform Provider.
    volcenginecc logo
    Viewing docs for volcenginecc v0.0.32
    published on Thursday, Apr 23, 2026 by Volcengine
      Try Pulumi Cloud free. Your team will thank you.