This article introduces new modes of automatic cloud resource deployment based on Resource Orchestration Service (ROS), Terraform hosting, and ROS CDK.
On May 29, at the sub-forum of the Alibaba Cloud Developer Conference on On-Cloud Infrastructure Optimization for Application Development, Wang Binxin, a Technical Expert from Alibaba Cloud, delivered a speech. His speech is themed New Modes of Automatic Cloud Resource Deployment, which elaborated on new modes of automatic deployment of cloud resources. These automatic deployment modes are based on ROS, Terraform hosting, and ROS CDK.
This article is based on Wang Binxin's speech.
Most users deploy resources on the cloud through traditional modes, such as the console, APIs, and SDKs. Such modes face challenges from four aspects, including scale, efficiency, compliance, and cost-effectiveness.
Facing the challenges of traditional deployment modes, we wondered if we could help our customers automate the deployment of cloud resources. Alibaba Cloud ROS is developed based on the idea of Infrastructure as Code (IaC). It allows developers and administrators to orchestrate resources on the cloud using templates to achieve automatic deployment.
Compared with manual deployment, automatic deployment using ROS brings the following benefits:
The process of automatic deployment using ROS is very simple:
Note: The ROS service is free and integrates identity authentication and security auditing functions. The result of resource creation is visual. It also supports multi-account and cross-region deployment as well as detecting and rectifying the differences between stacks and actual resources.
Is there any other way to implement automatic deployment besides using ROS templates?
Like ROS, Terraform is an automatic orchestration tool based on the idea of IaC. Terraform uses Hashicorp Configuration Language (HCL) to describe infrastructure resources. The syntax is shown in the figure above.
Terraform and ROS are automatic orchestration tools based on the same idea, so they share the same goal of creating a better deployment experience on the cloud for users.
They have a lot in common. For example, the configuration file of Terraform corresponds to the ROS template, the state of Terraform is the equivalent of the resource stack in ROS, and the CLI program of Terraform is the orchestration engine of ROS.
Both options have their respective advantages. Terraform has a simpler syntax and is well suited to multiple clouds. ROS provides free service hosting with cloud-native authentication and auditing capabilities.
How can we combine their advantages? The result is Terraform hosting.
When using Terraform locally, users must download the corresponding Terraform CLI based on the current operating system, write templates, manage the versions of various Providers, and manage files, such as status files.
When performing the Terraform management function, users only need to write a Terraform template in the ROS console to deploy Terraform directly and then manage the resources defined in the template through the resource stack. ROS is responsible for the management at the underlying level.
In terms of the principle, the ROS console combines Terraform templates and converts them into templates that conform to the ROS syntax specification. Then, the ROS server verifies the syntax and generates the tenant information before transferring them to the ROS Terraform service for resource deployment.
We can use Terraform hosting in many scenarios.
Conventionally, when using Terraform for scheduled resources deployment, users need to create a local scheduled task and run Terraform CLI to achieve scheduled resource deployment. However, on the cloud, we can do this in a different way.
Users may want to deploy resources of various cloud platforms, such as Alibaba Cloud and AWS, and get visualized results and feedback at the same time. They can write Terraform templates directly to declare various cloud resources and use the Terraform hosting function of ROS to deploy the resources.
Terraform hosting allows users to use Terraform directly on the cloud and provides users with the same console experience as the ROS templates. It is also compatible with the ROS native API and provides unified identity authentication and permission control. Compared with using Terraform locally, users do not need to manage multiple Providers and various Terraform CLI versions.
Users can write an ROS template directly or use a visual editor to generate a template for resources deployment, which can improve resource deployment efficiency significantly. However, this resource deployment method also has some disadvantages:
In response to these problems, how can we go further and solve these deficiencies on the template?
ROS CDK is a command-line tool and multi-language SDK provided by ROS. It defines cloud resources in an advanced and object-oriented abstract mode so that users can build their cloud resources quickly.
ROS CDK uses applications as the entry to resource management. A single application manages multiple resource stacks, and each resource stack contains multiple components. A component can be regarded as a component of cloud resources and can contain one or more resources.
The procedure for using ROS CDK is simple:
In the deployment phase, CDK will instantiate all types of resource objects based on the resource code written by users. Then, some adjustments will be made before the final state in the preparation phase (usually completed by the framework automatically.) Next, various resource attributes will be verified to ensure correct deployment. Finally, an ROS template is synthesized and used to deploy the resource stack.
In the preceding figure, the resource code of ROS CDK is on the left side, where one VPC is declared, and three VSwitches are dynamically generated in a loop. On the right is the ROS template generated by ROS CDK. This shows that ROS CDK can simplify template development in dynamic generation scenarios.
Let's assume that we need to implement a CI/CD system to deploy a resource architecture that uses API Gateway to provided APIs and functions of Function Compute to provide business logic. To do this, we need to deploy the resources in test, pre-release, and online environments, respectively. The resources must be supported when transferring from the test environment to the pre-release environment and then to the online environment.
For such a resource architecture, if we use ROS templates directly, we need to prepare three templates for the three environments. At the same time, templates must be dynamically joined for resource deployment between two environments, which is not friendly to the application. We recommend ROS CDK so applications can specify variables in different environments and produce resources that can meet the dynamic deployment requirements.
Compared with resource deployment by using ROS templates directly, ROS CDK allows developers to choose a programming language they are familiar with and use its dynamic characteristics to achieve complex orchestration. ROS CDK can be integrated into applications easily to facilitate resource deployment in applications.
As an increasing number of enterprises begin their migration to the cloud, the way enterprises deploy cloud resources has changed from manual deployment to automatic deployment, from a single cloud to multiple clouds, and from atomic operations to template-based deployment. As the popularity of IaC rises, resource deployment modes vary according to different scenarios. In general, the following four deployment modes are recommended:
Alibaba Clouder - February 15, 2021
Alibaba Cloud Native Community - September 16, 2022
Alibaba Cloud New Products - June 1, 2020
Alibaba Cloud New Products - January 19, 2021
Alibaba Cloud New Products - March 10, 2021
Alibaba Clouder - December 31, 2020
High Performance Computing (HPC) and AI technology helps scientific research institutions to perform viral gene sequencing, conduct new drug research and development, and shorten the research and development cycle.Learn More
An online computing service that offers elastic and secure virtual cloud servers to cater all your cloud hosting needs.Learn More
A HPCaaS cloud platform providing an all-in-one high-performance public computing serviceLearn More
Accelerate software development and delivery by integrating DevOps with the cloudLearn More
More Posts by Alibaba Cloud ECS