title: "Subnet" title_tag: "huaweicloud.Vpc.Subnet" meta_desc: "Documentation for the huaweicloud.Vpc.Subnet resource with examples, input properties, output properties, lookup functions, and supporting types." layout: api no_edit_this_page: true


Provides a VPC subnet resource within HuaweiCloud.

Create Subnet Resource {#create}

new Subnet(name: string, args: SubnetArgs, opts?: CustomResourceOptions);
@overload
def Subnet(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           availability_zone: Optional[str] = None,
           cidr: Optional[str] = None,
           description: Optional[str] = None,
           dhcp_enable: Optional[bool] = None,
           dns_lists: Optional[Sequence[str]] = None,
           gateway_ip: Optional[str] = None,
           ipv6_enable: Optional[bool] = None,
           name: Optional[str] = None,
           primary_dns: Optional[str] = None,
           region: Optional[str] = None,
           secondary_dns: Optional[str] = None,
           tags: Optional[Mapping[str, str]] = None,
           vpc_id: Optional[str] = None)
@overload
def Subnet(resource_name: str,
           args: SubnetArgs,
           opts: Optional[ResourceOptions] = 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: huaweicloud:Vpc:Subnet
properties: # The arguments to resource properties.
options: # 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.
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 {#properties}

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Subnet resource accepts the following input properties:

Cidr string
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
GatewayIp string
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
VpcId string
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
AvailabilityZone string
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
Description string

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

DhcpEnable bool
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
DnsLists List<string>
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
Ipv6Enable bool
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
Name string
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
PrimaryDns string
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
Region string

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

SecondaryDns string
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
Tags Dictionary<string, string>

The key/value pairs to associate with the subnet.

Cidr string
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
GatewayIp string
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
VpcId string
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
AvailabilityZone string
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
Description string

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

DhcpEnable bool
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
DnsLists []string
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
Ipv6Enable bool
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
Name string
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
PrimaryDns string
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
Region string

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

SecondaryDns string
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
Tags map[string]string

The key/value pairs to associate with the subnet.

cidr String
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
gatewayIp String
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
vpcId String
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
availabilityZone String
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
description String

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

dhcpEnable Boolean
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
dnsLists List<String>
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
ipv6Enable Boolean
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
name String
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
primaryDns String
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
region String

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

secondaryDns String
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
tags Map<String,String>

The key/value pairs to associate with the subnet.

cidr string
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
gatewayIp string
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
vpcId string
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
availabilityZone string
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
description string

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

dhcpEnable boolean
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
dnsLists string[]
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
ipv6Enable boolean
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
name string
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
primaryDns string
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
region string

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

secondaryDns string
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
tags {[key: string]: string}

The key/value pairs to associate with the subnet.

cidr str
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
gateway_ip str
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
vpc_id str
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
availability_zone str
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
description str

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

dhcp_enable bool
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
dns_lists Sequence[str]
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
ipv6_enable bool
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
name str
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
primary_dns str
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
region str

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

secondary_dns str
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
tags Mapping[str, str]

The key/value pairs to associate with the subnet.

cidr String
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
gatewayIp String
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
vpcId String
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
availabilityZone String
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
description String

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

dhcpEnable Boolean
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
dnsLists List<String>
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
ipv6Enable Boolean
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
name String
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
primaryDns String
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
region String

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

secondaryDns String
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
tags Map<String>

The key/value pairs to associate with the subnet.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Ipv4SubnetId string

The ID of the IPv4 subnet (Native OpenStack API).

Ipv6Cidr string

The IPv6 subnet CIDR block.

Ipv6Gateway string

The IPv6 subnet gateway.

Ipv6SubnetId string

The ID of the IPv6 subnet (Native OpenStack API).

SubnetId string

schema: Deprecated

Id string

The provider-assigned unique ID for this managed resource.

Ipv4SubnetId string

The ID of the IPv4 subnet (Native OpenStack API).

Ipv6Cidr string

The IPv6 subnet CIDR block.

Ipv6Gateway string

The IPv6 subnet gateway.

Ipv6SubnetId string

The ID of the IPv6 subnet (Native OpenStack API).

SubnetId string

schema: Deprecated

id String

The provider-assigned unique ID for this managed resource.

ipv4SubnetId String

The ID of the IPv4 subnet (Native OpenStack API).

ipv6Cidr String

The IPv6 subnet CIDR block.

ipv6Gateway String

The IPv6 subnet gateway.

ipv6SubnetId String

The ID of the IPv6 subnet (Native OpenStack API).

subnetId String

schema: Deprecated

id string

The provider-assigned unique ID for this managed resource.

ipv4SubnetId string

The ID of the IPv4 subnet (Native OpenStack API).

ipv6Cidr string

The IPv6 subnet CIDR block.

ipv6Gateway string

The IPv6 subnet gateway.

ipv6SubnetId string

The ID of the IPv6 subnet (Native OpenStack API).

subnetId string

schema: Deprecated

id str

The provider-assigned unique ID for this managed resource.

ipv4_subnet_id str

The ID of the IPv4 subnet (Native OpenStack API).

ipv6_cidr str

The IPv6 subnet CIDR block.

ipv6_gateway str

The IPv6 subnet gateway.

ipv6_subnet_id str

The ID of the IPv6 subnet (Native OpenStack API).

subnet_id str

schema: Deprecated

id String

The provider-assigned unique ID for this managed resource.

ipv4SubnetId String

The ID of the IPv4 subnet (Native OpenStack API).

ipv6Cidr String

The IPv6 subnet CIDR block.

ipv6Gateway String

The IPv6 subnet gateway.

ipv6SubnetId String

The ID of the IPv6 subnet (Native OpenStack API).

subnetId String

schema: Deprecated

Look up Existing Subnet Resource {#look-up}

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: Optional[str] = None,
        description: Optional[str] = None,
        dhcp_enable: Optional[bool] = None,
        dns_lists: Optional[Sequence[str]] = None,
        gateway_ip: Optional[str] = None,
        ipv4_subnet_id: Optional[str] = None,
        ipv6_cidr: Optional[str] = None,
        ipv6_enable: Optional[bool] = None,
        ipv6_gateway: Optional[str] = None,
        ipv6_subnet_id: Optional[str] = None,
        name: Optional[str] = None,
        primary_dns: Optional[str] = None,
        region: Optional[str] = None,
        secondary_dns: Optional[str] = None,
        subnet_id: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        vpc_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)
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.
The following state arguments are supported:
AvailabilityZone string
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
Cidr string
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
Description string

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

DhcpEnable bool
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
DnsLists List<string>
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
GatewayIp string
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
Ipv4SubnetId string

The ID of the IPv4 subnet (Native OpenStack API).

Ipv6Cidr string

The IPv6 subnet CIDR block.

Ipv6Enable bool
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
Ipv6Gateway string

The IPv6 subnet gateway.

Ipv6SubnetId string

The ID of the IPv6 subnet (Native OpenStack API).

Name string
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
PrimaryDns string
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
Region string

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

SecondaryDns string
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
SubnetId string

schema: Deprecated

Tags Dictionary<string, string>

The key/value pairs to associate with the subnet.

VpcId string
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
AvailabilityZone string
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
Cidr string
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
Description string

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

DhcpEnable bool
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
DnsLists []string
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
GatewayIp string
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
Ipv4SubnetId string

The ID of the IPv4 subnet (Native OpenStack API).

Ipv6Cidr string

The IPv6 subnet CIDR block.

Ipv6Enable bool
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
Ipv6Gateway string

The IPv6 subnet gateway.

Ipv6SubnetId string

The ID of the IPv6 subnet (Native OpenStack API).

Name string
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
PrimaryDns string
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
Region string

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

SecondaryDns string
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
SubnetId string

schema: Deprecated

Tags map[string]string

The key/value pairs to associate with the subnet.

VpcId string
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
availabilityZone String
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
cidr String
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
description String

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

dhcpEnable Boolean
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
dnsLists List<String>
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
gatewayIp String
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
ipv4SubnetId String

The ID of the IPv4 subnet (Native OpenStack API).

ipv6Cidr String

The IPv6 subnet CIDR block.

ipv6Enable Boolean
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
ipv6Gateway String

The IPv6 subnet gateway.

ipv6SubnetId String

The ID of the IPv6 subnet (Native OpenStack API).

name String
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
primaryDns String
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
region String

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

secondaryDns String
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
subnetId String

schema: Deprecated

tags Map<String,String>

The key/value pairs to associate with the subnet.

vpcId String
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
availabilityZone string
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
cidr string
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
description string

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

dhcpEnable boolean
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
dnsLists string[]
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
gatewayIp string
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
ipv4SubnetId string

The ID of the IPv4 subnet (Native OpenStack API).

ipv6Cidr string

The IPv6 subnet CIDR block.

ipv6Enable boolean
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
ipv6Gateway string

The IPv6 subnet gateway.

ipv6SubnetId string

The ID of the IPv6 subnet (Native OpenStack API).

name string
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
primaryDns string
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
region string

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

secondaryDns string
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
subnetId string

schema: Deprecated

tags {[key: string]: string}

The key/value pairs to associate with the subnet.

vpcId string
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
availability_zone str
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
cidr str
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
description str

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

dhcp_enable bool
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
dns_lists Sequence[str]
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
gateway_ip str
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
ipv4_subnet_id str

The ID of the IPv4 subnet (Native OpenStack API).

ipv6_cidr str

The IPv6 subnet CIDR block.

ipv6_enable bool
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
ipv6_gateway str

The IPv6 subnet gateway.

ipv6_subnet_id str

The ID of the IPv6 subnet (Native OpenStack API).

name str
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
primary_dns str
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
region str

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

secondary_dns str
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
subnet_id str

schema: Deprecated

tags Mapping[str, str]

The key/value pairs to associate with the subnet.

vpc_id str
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.
availabilityZone String
  • Specifies the availability zone (AZ) to which the subnet belongs. The value must be an existing AZ in the system. Changing this creates a new Subnet.
cidr String
  • Specifies the network segment on which the subnet resides. The value must be in CIDR format and within the CIDR block of the VPC. The subnet mask cannot be greater than 28. Changing this creates a new Subnet.
description String

Specifies supplementary information about the subnet. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).

dhcpEnable Boolean
  • Specifies whether the DHCP function is enabled for the subnet. Defaults to true.
dnsLists List<String>
  • Specifies the DNS server address list of a subnet. This field is required if you need to use more than two DNS servers. This parameter value is the superset of both DNS server address 1 and DNS server address 2.
gatewayIp String
  • Specifies the gateway of the subnet. The value must be a valid IP address in the subnet segment. Changing this creates a new Subnet.
ipv4SubnetId String

The ID of the IPv4 subnet (Native OpenStack API).

ipv6Cidr String

The IPv6 subnet CIDR block.

ipv6Enable Boolean
  • Specifies whether the IPv6 function is enabled for the subnet. Defaults to false.
ipv6Gateway String

The IPv6 subnet gateway.

ipv6SubnetId String

The ID of the IPv6 subnet (Native OpenStack API).

name String
  • Specifies the subnet name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores (_), and hyphens (-).
primaryDns String
  • Specifies the IP address of DNS server 1 on the subnet. The value must be a valid IP address.
region String

Specifies tThe region in which to create the vpc subnet. If omitted, the provider-level region will be used. Changing this creates a new Subnet.

secondaryDns String
  • Specifies the IP address of DNS server 2 on the subnet. The value must be a valid IP address.
subnetId String

schema: Deprecated

tags Map<String>

The key/value pairs to associate with the subnet.

vpcId String
  • Specifies the ID of the VPC to which the subnet belongs. Changing this creates a new Subnet.

Import

Subnets can be imported using the subnet Network ID, e.g.

 $ pulumi import huaweicloud:Vpc/subnet:Subnet huaweicloud_vpc_subnet 4779ab1c-7c1a-44b1-a02e-93dfc361b32d

Package Details

Repository
https://github.com/huaweicloud/pulumi-huaweicloud
License
Apache-2.0
Notes

This Pulumi package is based on the huaweicloud Terraform Provider.