A new model for automatic deployment of resources on the cloud

Current resource deployment model on the cloud

Challenges of Traditional Deployment Models of Cloud Resources

Most users generally deploy resources on the cloud through traditional modes such as console/API/SDK. This deployment mode will face four challenges in terms of scale, efficiency, specification and cost:

• In terms of scale, with the development of business, the scale of resources to be managed continues to increase, and deployment and management of various resources bring challenges.
• In terms of efficiency, as the scale increases, manual batch deployment becomes unsustainable.
• In terms of norms, how to ensure that changes to the infrastructure comply with organizational management norms.
• In terms of cost, the manual deployment method cannot take full advantage of the elastic capabilities on the cloud, and there is still room for optimization of its cost.

Alibaba Cloud Automated Deployment Mode
Core Values of Resource Orchestration Service (ROS)

Facing the challenges of traditional deployment models, we are wondering if we can help customers automate the deployment of resources on the cloud? Therefore, there is Alibaba Cloud Resource Orchestration Service (ROS), which is based on the concept of infrastructure as code (IaC), allowing developers and administrators to use templates to orchestrate various resources on the cloud for automatic deployment.

Compared with manual deployment, automatic deployment using resource orchestration service ROS will bring the following benefits:

Efficiency improvement, which can effectively improve deployment efficiency for complex solutions such as SAP, and can also help MSP, ISV, and onECS services to improve deployment efficiency;

Architecture optimization, ROS provides a wide variety of Alibaba Cloud best practice templates, and users can deploy solution-level architectures without rich architecture experience;

Process control, IT administrators manage the infrastructure in a unified manner to avoid various risks, and can conduct audits based on templates and further combine CI/CD to standardize IT management processes;

Save costs, the automated deployment method can deploy and release resources on demand, so as to make the ultimate use of the elastic capabilities of the cloud to reduce costs.

The use process and core functions of ROS

The process of automating deployment with ROS is very simple:

• Write templates according to the ROS template syntax to define various cloud resources that you want to create.

• Create resource stacks using templates in the ROS console for deployment. Wherein, the resource stack is a collection of a group of resources, and these resources are resources defined in the template.

• View the resource stack on the ROS console, you can view the creation of various resources in the stack, and jump to the console of the corresponding resource.

It is worth mentioning that the ROS service itself is completely free and integrates the functions of identity authentication and security auditing. The result of resource creation is visualized and can be deployed across regions with multiple accounts. It supports the detection of differences between resource stacks and actual resources. fix.

Besides using ROS templates directly for automatic deployment, is there any other way?

New model 1: Terraform hosting
What is Terraform

Terraform, like ROS, is also an automated orchestration tool based on the concept of infrastructure as code (IaC). It uses a specific configuration language (HCL, Hashicorp Configuration Language) to describe infrastructure resources, and the syntax sample is shown in the figure above.

Terraform & ROS

Since both Terraform and ROS are automated orchestration tools based on the same concept, their goals are also the same, both of which are to create a good cloud deployment experience for users.

The two have many similarities. For example, the configuration file of Terraform is equivalent to the template of ROS, the state of Terraform is equivalent to the resource stack of ROS, and the CLI program of Terraform is equivalent to the orchestration engine of ROS.

Both also have their own advantages. Terraform has a more concise syntax and perfect support for multi-cloud; while ROS provides free service hosting and has cloud-native authentication and auditing capabilities.

So is it possible to combine the advantages of both? Hence the Terraform hosting capability.

Terraform Hosting

When users directly use Terraform locally, they need to download the corresponding Terraform CLI according to the current operating system, write templates, manage the versions of various Providers used, and manage status and other files.

When using the Terraform hosting function, you only need to write a Terraform template in the ROS console to deploy it directly, and then manage the resources defined in the template through the resource stack. All kinds of management at the bottom are handed over to ROS.

In principle, the ROS console will combine Terraform templates into templates that conform to the ROS syntax specification, and the ROS server will perform syntax verification, generate tenant information, and dispatch to the Terraform service of ROS for resource deployment.

Timing and practice in multi-cloud scenarios

We can use Terraform-hosted functionality in many scenarios.

Scenario 1: Scheduled deployment of resources

Suppose we need to deploy resources regularly through Terraform. In the traditional way, we need to create scheduled tasks locally and execute Terraform CLI to do it. On the cloud, we can:

• Write a Terraform template in advance, declaring the cloud resources you want to deploy;

• Write an OOS operation and maintenance template in advance to declare that it calls ROS for resource deployment;

• Set it as scheduled execution in OOS, OOS will trigger ROS at regular intervals, and ROS will use Terraform hosting function for resource deployment.

Scenario 2: Multi-cloud management

If we want to deploy resources on multiple cloud platforms (such as Alibaba Cloud, AWS, etc.) and have visual feedback on the results, we can directly write Terraform templates to declare resources on each cloud, and use ROS's Terraform hosting function to deploy.

Terraofrm Hosting Summary

The Terraform hosting function allows users to directly use Terraform on the cloud, and has a consistent console experience with the direct use of ROS template deployment, and is compatible with ROS native APIs, as well as unified identity authentication and permission control. Compared with using Terraform locally, there is no need to manage multiple Providers and multiple Terraform CLI versions.

New Mode 2: ROS CDK

Inadequacies in the way existing resources are defined

In fact, by directly writing ROS templates, or generating templates through a visual editor, and then deploying resources, the efficiency of resource deployment can be greatly improved, but there are also some shortcomings:

• Lack of procedural support
• Writing complex scenes is less efficient
• Less program friendly
• Poor dynamic support

In response to these problems, can we go further and solve these shortcomings on the template?

What is the ROS CDK?


ROS CDK is a command-line tool and multi-language SDK provided by Resource Orchestration (ROS). It uses object-oriented high-level abstract patterns to standardize cloud resources, so as to quickly build cloud resources.

ROS CDK uses applications as the entry point for resource management. An application manages multiple resource stacks, and each resource stack can have multiple components. Components can be understood as components of resources on the cloud, and can contain one or more resources.

We can choose a familiar programming language (TypeScript/JavaScript/Java/Python/C#) to write application code and declare the resources we want to deploy. ROS CDK will convert the project code into a ROS template, and then use the template for automatic deployment.

Working with steps and the project lifecycle

The steps to use ROS CDK are also very simple:

• First, initialize the project and configure the access credentials (AccessKey) of Alibaba Cloud

• Second, write resource code and test cases for local testing

• Finally, deploy resources through CDK CLI or direct programs, and manage resource stacks

In the deployment stage, CDK will construct according to the resource code written by the user, and instantiate various resource objects; then make adjustments before the final state in the preparation stage (usually done automatically by the framework); and then verify various resource attributes, Ensure correct deployment; finally synthesize a ROS template and use it to deploy as a resource stack.

Code, template examples

In the figure above, the resource code of ROS CDK is on the left, in which a VPC is declared and 3 VSwitches are dynamically generated using a loop. On the right is the ROS template generated by the ROS CDK. It can be seen from this that for dynamically generated scenarios, ROS CDK can greatly simplify the complexity of template writing.

Application Integration CDK for Continuous Deployment Scenarios

Suppose we need to implement a CI/CD system that can deploy such a resource architecture: use API Gateway to provide APIs, use Function Compute functions to provide business logic, deploy test, pre-release, and online environment resources separately, and support from From test release to pre-release, from pre-release deployment to online.

For such a resource architecture, in the way of directly using ROS templates, it is necessary to prepare three templates for each of the three environments, and the deployment between environments requires dynamic splicing of templates, which is not friendly to the application. It is recommended to use ROS CDK here, so that the application can specify corresponding variables according to different environments and produce corresponding resources, so as to meet the dynamic deployment of the environment.

ROS CDK summary

Compared with directly using ROS template deployment, using ROS CDK allows developers to choose a programming language they are familiar with, and can use its dynamic features to achieve complex orchestration effects. ROS CDK can be easily integrated into the application, so that resources can be easily deployed in the program.


The scale of enterprise cloud migration is gradually increasing, and the deployment method of enterprise cloud resources has changed from manual to automatic, from single cloud to multi-cloud, and from atomic operation to template deployment. With the rise of the concept of infrastructure as code, the deployment mode of resources also varies according to different scenarios. In general, there are four suggestions for deployment modes as follows:

• As an entry-level user, you only need to manage a few resources, and the way to directly use the console is the most simple and intuitive;

• As an enterprise IT administrator, who needs to manage large-scale cloud resources, using ROS templates to manage infrastructure will be the most efficient choice;

• As an operation and maintenance researcher, it is necessary to implement resource deployment logic in the business system, then ROS CDK will be the best choice;

As a multi-cloud administrator, it is necessary to visually manage the resources of multiple clouds such as Alibaba Cloud, AWS, and Azure. Using the hosting function of ROS Terraform is the best choice.

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00

phone Contact Us