Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

VPC.Subnet

Updated on 2022-02-22 GMT+08:00

Element Description

The VPC.Subnet element is used to create a subnet on a VPC.

Element Properties

Table 1 Property Description

Property

Mandatory

Descripiton

dnsList

No

IP address set of the DNS server on the subnet. Set this field if you want to use more than two DNS servers.

Type: ip array

Value Description: It must be an IP address array, for example, ["8.8.8.8", "4.4.4.4", "6.6.6.6"].

Value Constraint: The value must be an IP address array and contain the values of primaryDns and secondaryDns.

Suggestion: If a DNS server is needed in a subnet, set at least one of the primaryDns and dnsLists parameters. If primaryDns, secondaryDns and dnsLists are not set, the created subnet will not have a DNS server.

vpcId

Yes

ID of the VPC to which the subnet belongs

Type: Cloud.VPC.VPC.Id

Value Description: Use the ID of an existing VPC or a new VPC. To use a new VPC ID, you need to define the VPC object in the template and establish the dependency. You are advised to drag the object to the VPC to automatically establish the dependency.

Value Constraint: The value must be in the CIDR format, for example, 192.168.0.0/16.

Suggestion: 1. You are advised to use the get_input function to set values so that you can select an existing VPC when creating a stack. 2. To obtain the VPC information about this template, you are advised to use the get_reference function. 3. Obtain the ID of the created VPC from the VPC console.

name

Yes

Subnet name

Type: string

Value Description: Customize the value, for example, musubnet.

Default: ""

Value Constraint: The value contains 1 to 64 characters. The value is unique in a VPC. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Suggestion: Customize the value. If this parameter is left blank, the system automatically assigns a name.

secondaryDns

No

IP address 2 of the DNS server on the subnet

Type: ip

Value Description: It must be in the IP address format, for example, 4.4.4.4.

Value Constraint: The value must be an IP address.

gateway

Yes

Subnet gateway

Type: ip

Value Description: gateway address within the subnet CIDR address range

Default: 192.168.1.1

Value Constraint: The value must be an IP address and comply with the gateway IP address rule, for example, 192.168.1.1.

Suggestion: Customize the value based on the IP address range as required.

availabilityZone

No

AZ to which the subnet belongs

Type: Cloud.ECS.AvailabilityZone.Name

Value Description: AZ where the to-be-created ECS is located. The name of the AZ needs to be specified.

Value Constraint: The value varies depending on regions.

Suggestion: You are advised to use the get_input function to set values so that you can select a value from the list when creating a stack.

primaryDns

No

IP address 1 of the DNS server on the subnet

Type: ip

Value Description: It must be in the IP address format, for example, 8.8.8.8.

Value Constraint: The value must be an IP address.

Suggestion: If a DNS server is needed in a subnet, set at least one of the primaryDns and dnsLists parameters. If primaryDns, secondaryDns and dnsLists are not set, the created subnet will not have a DNS server.

dhcpEnable

Yes

Whether to enable DHCP for the VPC subnet

Type: boolean

Value Description: true: Enabling the DHCP function. After an ECS using the VPC starts, the ECS automatically obtains an IP address using the DHCP protocol. false: Disabling the DHCP function. After an ECS using this VPC starts, the ECS cannot automatically obtain an IP address. You must manually assign an IP address to the ECS.

Default: True

Value Constraint: The value can be true or false.

Suggestion: Set the value based on requirements. You are advised to enable the function.

cidr

Yes

Range of available addresses in a subnet

Type: string

Value Description: Range: 10.0.0.0/8-10.255.255.0/24, 172.16.0.0/12-172.31.255.0/24, or 192.168.0.0/16-192.168.255.0/24.

Default: 192.168.1.0/24

Value Constraint: The value must be in the CIDR format, for example, 192.168.0.0/16. The value must be within the VPC CIDR block.

Suggestion: Customize the value based on the IP address range as required.

Relationships Between Elements

Table 2 Relationship description

Description

Target

ContainedIn

VPC.VPC

Return Value

Property

Type

Description

neutron_network_id

string

OpenStack network ID

vpcId

string

ID of the VPC to which the subnet belongs

neutron_subnet_id

string

OpenStack subnet ID

refName

string

Subnet name

refID

string

Subnet ID

Blueprint Example

tosca_definitions_version: cloud_tosca_version_1_0
inputs:
  vpc-name:
    default: vpc
    type: string
  vpc-cidr:
    default: 192.168.0.0/16
    type: string
  subnet-name:
    type: string
    default: subnet
  subnet-cidr:
    default: 192.168.0.0/24
    type: string
  subnet-gateway:
    type: ip
    default: 192.168.0.1
  dhcenable:
    type: boolean
    default: true
  availabilityZone:
    description: Name of az
    label: ''
node_templates:
  my-vpc:
    type: Cloud.VPC.VPC
    properties:
      name:
        get_input: vpc-name
      cidr:
        get_input: vpc-cidr
  my-subnet:
    type: Cloud.VPC.Subnet
    properties:
      name:
        get_input: subnet-name
      cidr:
        get_input: subnet-cidr
      gateway:
        get_input: subnet-gateway
      dhcpEnable:
        get_input: dhcenable
      dnsList: [114.114.114.115,114.114.114.114]
      vpcId:
        get_attribute: [my-vpc,refID] 
      availabilityZone:
        get_input: availabilityZone
    requirements:
      - vpcId:
          node: my-vpc

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback