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
On this page

Show all

inputs

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

To enable a template to be more commonly used, do not set all parameter values of the elements to fixed values. For example, it is advised to set the image ID of a VM as an input of a template. In this case, you can select different images every time you use the template to create a stack.

The inputs section is optional and defines the inputs of a stack created based on a template. A maximum of 60 input parameters can be defined in a template. Each input parameter must have a unique name so that the value can be obtained by using the get_input built-in function. If an input parameter is defined repeatedly, the latest definition will overwrite the previous one.

Function scope: node_templates and outputs sections. That is, input parameters can be transferred in the properties of node_templates and values of outputs.

Format of the inputs section:

 <Input parameter name>:
    type: <Type>
    default: <Default value>
    constraints: <Constraints>
    description: <Description>
    label: <Label>
    invisible: <Whether command outputs are visible>

In addition to the reusability of a template, methods of restricting and verifying user inputs also need to be considered during template input design. Template designers must understand parameter statements.

Table 1 Parameter property description

Property

Mandatory

Type

Value Constraint

Description

Input parameter name

Yes

String

The value must be 1 to 20 characters long. Only lowercase letters, digits, and hyphens (-) are allowed.

A maximum of 60 input parameter names can be defined and each name must be unique.

type

Yes

  • string: character string
  • integer: number
  • float: floating-point number
  • boolean: boolean value
  • password: password

When the type is set to password, no output is visible. Currently, only the passwords entered at the system level can be decrypted. If a common parameter is defined as a password, encrypted information may be obtained and such information fails to be decrypted.

Parameter type.

description

No

String

The value must be 0 to 255 characters long.

Parameter description information.

default

No

String

When creating a stack, you can enter a value to replace the default value. If no default value is set, you must enter the value of this parameter.

NOTICE:

The default value type must be the same as the defined parameter type. If they are inconsistent, the parser may perform automatic conversion, resulting in an unexpected result.

Default parameter value.

label

No

String

The value is a string of 0 to 64 characters.

Label of a parameter. The label defined here can be displayed by category during stack creation.

constraints

No

String

There are several constraints. You can define only one rule for each condition of an input parameter. If any of the constraints is not met, the parameter is considered invalid.
  • equal: The value of this parameter must be equal to the specified value.

    For example, if the value of an input parameter is not aos, the value is regarded as invalid.

    constraints:

    equal: 'aos'

  • valid_values: valid value range. This parameter is used to define an array.

    For example, the value of an output parameter can be TCP or UDP.

    constraints:

    valid_values: ['TCP', 'UDP' ]

  • regex: The parameter must meet a certain regular expression and must be of the string type.

    For example, if the input parameter does not meet the regular expression, the parameter is regarded as invalid.

    constraints:

    regex: "^[-_a-zA-Z0-9]*$"

  • invalid_values: invalid value range. If you set a parameter to a value which is within the invalid value range, such a value is regarded as invalid and an error is reported.

    For example, if the value of an input parameter is set to 1 or 12, the value is regarded as invalid.

    constraints:

    invalid_values: ['1', '12' ]

Parameter constraints, which are used to restrict the valid value range of an input parameter.

invisible

No

-

When invisible of an input parameter is set to true, ****** is displayed.

Whether the output is visible.

Example configuration of inputs:

tosca_definitions_version: cloud_tosca_version_1_0
inputs: # defines the variables of a stack created based on a template. 
  instance:
    description: number of ECSs to be created
    default: 1
  image:
    description: ID of the image used by the ECS
    type: Cloud.ECS.Image.Id
  vpc:
    description: ID of the VPC to which the ECS belongs
  subnet:
    description: ID of the subnet to which the ECS belongs

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