Help Center/ Resource Formation Service/ Template Reference/ Application Orchestration Service/ Template Introduction/ Template Structure
Updated on 2023-08-11 GMT+08:00
Template Structure
Sample Template
# Version of the application template
tosca_definitions_version: huaweicloud_tosca_version_1_0
# Description of the application template
description: template for deploying an Elastic Cloud Server (ECS)
# Definitions of input parameters
inputs:
image:
description: ID of the image used by the ECS
type: HuaweiCloud.ECS.Image.Id
instance:
default: 1
description: number of ECSs to be created
subnet:
description: ID of the subnet to which the ECS belongs
vpc:
description: ID of the Virtual Private Cloud (VPC) to which the ECS belongs
mappings:
regionMap:
cn-east-3:
flavor: c2.medium
image_id: f2003c7b-99c4-4616-be19-334beaca81b1
cn-north-1:
flavor: c1.medium
image_id: 42f34d95-a538-4d17-be48-e690b48c1643
cn-south-1:
flavor: c1.medium
image_id: a3934478-bfeb-4a02-b257-9089779f0380
# Definitions of element objects
node_templates:
myecs:
type: HuaweiCloud.ECS.CloudServer
properties:
availabilityZone: cn-south-1a
flavor:
get_in_map:
- regionMap
- get_input: HuaweiCloud.Region
- flavor
imageId:
get_in_map:
- regionMap
- get_input: HuaweiCloud.Region
- image_id
instances:
get_input: instance
name: my-ecs
nics:
- subnetId:
get_input: subnet
publicIP:
eip:
bandwidth:
shareType: PER
size: 1
ipType: 5_sbgp
rootVolume:
size: 40
volumeType: SATA
vpcId:
get_input: vpc
# Definitions of output parameters
outputs:
ecs-eip:
description: elastic IP address of the ECS
value:
get_attribute:
- myecs
- publicIps
south-flavor:
description: VM specifications of the South China region
value:
get_in_map:
- regionMap
- cn-south-1
- flavor Template Composition
An Application Orchestration Service (AOS) template consists of the following sections:
- tosca_definitions_version: (mandatory) specifies the version of the template.
Currently, only huaweicloud_tosca_version_1_0 is supported.
- node_templates: (mandatory) defines the set of objects, which are all elements, to be orchestrated in a template. For more information, see node_templates.
- description: (optional) describes the template. The maximum length is 1024 characters.
- inputs: (optional) defines the input parameters used during stack creation. For more information, see inputs.
- outputs: (optional) defines the output parameters during stack running. For more information, see outputs.
- mappings: (optional) defines a mapping table. For more information, see mappings.
- conditions: (optional) defines conditions. For more information, see conditions.
- policies: (optional) defines security, monitoring, and other policies. For more information, see policies.
Parent topic: Template Introduction
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.