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

Templates (Cloud-Based Automation Scripts)

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

AOS templates are text files in YAML or JSON format. They describe the cloud objects that you want, including applications, resources, and services. AOS creates various cloud objects automatically from AOS templates.

Each automated process requires a descriptive language to control its execution flow. For example, a shell script (text file) describes how to automatically run commands. Similarly, an AOS template describes the process of creating and deleting cloud objects.

The following is an example execution logic of a shell script:

A shell script has the following features:

  • A script is a text file.
  • If a script is properly written, it can be reused.

An AOS template has the same execution logic as a shell script. The AOS service functions as the interpreter of AOS templates and executes actions according to templates. An AOS template can be considered as cloud automation standards.

A good shell script or function should have inputs, execution logic, and returned values. Likewise, a good template also should have inputs, orchestration, and outputs. A good template eases knowledge transfer and sharing.

Figure 1 Comparison between the function and template

Elements (Cloud Objects)

Cloud objects can be cloud resources, services, or applications. Cloud resources are the most common cloud objects. AOS treats cloud objects as elements. A template is a collection of elements.

  • Cloud resources: including resources such as Elastic Cloud Server (ECS) and Virtual Private Cloud (VPC).
  • Cloud services: including services such as Distributed Cache Service (DCS).
  • Cloud applications: including applications such as containerized applications in Cloud Container Engine (CCE).

You need to set inputs to create any cloud object. After a cloud object is created, a result is displayed. The following figure uses an ECS (VM) as an example.

Figure 2 Inputs and outputs of a cloud object

Inputs (Properties)

Inputs are requirements or parameters involved during the creation of a cloud object. The parameters required by a cloud object are determined by the characteristics of the object. Some objects require many parameters, for example, VMs. Some objects can be created with a few parameters or without parameters, for example, Object Storage Service (OBS) buckets. Some input parameters are complex and consist of multiple basic parameters, for example, network attributes of VMs.

Figure 3 Inputs

The syntax is as follows:

Cloud object (element):
  description: description of the cloud object
  properties: # Parameters of the cloud object
    Property 1:  # Parameter 1
    Property 2: # Parameter 2
    Property...:  # Parameter...

Orchestration (Elements)

If elements are initialized just one by one according to the order in which they are arranged, no orchestration is required. AOS supports orchestration of elements with complex dependencies between them. The initialization (input) of an element depends on the result (output) of another element. Such a relationship can be specified by using an AOS template.

In an AOS template, you can specify the output of any element as the input of another element. The initialization process can be controlled freely, which is called orchestration. Only orchestration can meet various automation requirements.

An AOS template is the collection of objects that you want to orchestrate. To be more specific, an AOS template is a collection of objects that you want to control during the initialization process.

Figure 4 Orchestration

The relationship between elements is classified into two types: dependency and inclusion.

  • Dependency: The input of an element depends on the output of another element. If element A depends on element B, element A can be created only after element B is successfully created.
  • Inclusion: An element is a part of another element. If element A contains element B, element B can be created only after element A is successfully created.

Outputs (Return Values)

Outputs are the results returned after a cloud object is successfully created. The returned results of a cloud object are determined by the characteristics of the object. Some objects have many results, and some objects have few results.

The output of a cloud object is used in the following two scenarios. Generally, it is used together with the get_attribute built-in function.

  • The output is used as an input of another cloud object.
  • The output is used as the result of the entire stack.

The syntax is as follows:

# Result of another ECS. The service name is Service.
value: {get_attribute: [ecs, Service, ports, 0, nodePort]} 

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