Resource Orchestration Service (ROS) is a managed service for Terraform. You can create Terraform templates to define resources from Alibaba Cloud, AWS, or Azure, configure resource parameters, and set dependencies between resources.
Scenarios
To manage resources from multiple cloud platforms, such as AWS and Azure, on Alibaba Cloud, you can define the resources and their dependencies in a template. This method simplifies resource management in a multicloud environment.
Background information
For more information about the structure of Terraform templates, see Structure of Terraform templates.
Procedure
Log on to the ROS console.
In the navigation pane on the left, choose Templates > My Templates.
On the My Templates page, click Create Template.
For Template Type, select Terraform.
Create a Terraform template.
The following example shows how to create a vSwitch in a virtual private cloud (VPC).
Create the
modules/vpc/main.tffile and add content to the file to create a VPC.To the right of the directory, click + and then click Create Folder.

In the Create Folder dialog box, enter modules to create a folder named modules.
Hover the pointer over the modules folder, click + on the right, and then click Create Folder.
In the Create Folder dialog box, enter
vpcto create a subfolder named vpc in themodulesfolder.Hover the pointer over the
vpcfolder, click + on the right, and then click Create File.In the Create File dialog box, enter main.tf to create a main.tf file in the
vpcfolder.Click main.tf and enter the following code in the editor on the right to create a VPC.
resource "alicloud_vpc" "vpc" { name = "tf_test" cidr_block = "172.16.0.0/12" } output "vpc_id" { value = "${alicloud_vpc.vpc.id}" }
Edit the main.tf file in the root directory to create a vSwitch in the VPC.
Click the main.tf file in the root directory.
In the editor on the right, enter the following code to create a vSwitch.
module "my_vpc" { source = "./modules/vpc" } resource "alicloud_vswitch" "vsw" { vpc_id = "${module.my_vpc.vpc_id}" cidr_block = "172.16.0.0/21" availability_zone = "cn-shanghai-b" } output "vsw_id" { value = "${alicloud_vswitch.vsw.id}" }
In the lower-left corner of the Create Template page, choose .
In the Save as My Template dialog box, set the Template Name, Template Description, Resource Group, and Tags.
Click OK.