Help Center/
    
      
      Resource Formation Service/
      
      
        
        
        User Guide (ME-Abu Dhabi Region)/
        
        
        Template Reference/
        
        
        Template Introduction/
        
      
      Template Structure
    
  
  
    
        Updated on 2022-02-22 GMT+08:00
        
          
          
        
      
      
      
      
      
      
      
      
  
      
      
      
        
Template Structure
Sample Template
# Version of the application template
tosca_definitions_version: cloud_tosca_version_1_0
# Description of the application template
description: template for deploying an ECS
# Definitions of input parameters
inputs:
  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 VPC to which the ECS belongs
mappings:
  regionMap:
    ae-ad-1:
      flavor: c2.medium
      image_id: f2003c7b-99c4-4616-be19-334beaca81b1
# Definitions of element objects
node_templates:
  myecs:
    type: Cloud.ECS.CloudServer
    properties:
      availabilityZone: ae-ad-1a
      flavor:
        get_in_map:
          - regionMap
          - get_input: Cloud.Region
          - flavor
      imageId:
        get_in_map:
          - regionMap
          - get_input: Cloud.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: specifications of the VM to be created
    value:
      get_in_map:
        - regionMap
        - ae-ad-1
        - flavor
 Template Composition
An AOS template consists of the following sections:
- tosca_definitions_version: (mandatory) specifies the version of the template.
    
 
     Currently, only cloud_tosca_version_1_0 is supported by AOS.
 - 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 1,024 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.
 
   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.See the reply and handling status in My Cloud VOC.
                The system is busy. Please try again later.
                
            
        For any further questions, feel free to contact us through the chatbot.
Chatbot