Alibaba Cloud Resource Orchestration Service (ROS) allows you to use templates to create a group of Alibaba Cloud resources. The ROS template is a JSON text file used to specify the resources that you want to create. This topic describes how to use a template in ROS to deploy a WordPress site based on Elastic Compute Service (ECS) and Relational Database Service (RDS).

Prerequisites

You must have an Alibaba Cloud account before you follow the instructions provided in the tutorial. To create an Alibaba Cloud account, click Create an Alibaba Cloud account.

Procedure

  1. Log on to the ROS console.
    Note The first time that you use the ROS service, you are prompted to activate this service. ROS is a free service, so you can activate ROS free of charge.
  2. In the left-side navigation pane, choose Key Help > ECS Instance Information, click the ECS Instance Type tab to find the target instance type in the Instance Type column, click the ECS Zone tab to find the target zone ID in the ZoneId column, and then click the ECS Image tab to find the target image ID in the Image List column.
  3. In the left-side navigation pane, click Sample Template to display common templates that ROS provides.
  4. Find the sample template wordpress_instance.


  5. Click Preview to check the template in JSON format.
    The following table lists the top-level fields in the JSON file.
    Top-level field Description
    "ROSTemplateFormatVersion" : "2015-09-01" Specifies the version of the template.
    "Parameters" : { } Specifies some parameters. In this example, this field specifies the default image ID and instance type.
    "Resources" : { } Specifies the resources that you can use the template to create. In this example, this field specifies that the resources to be created include an ECS instance and a security group. The properties of these resources are defined in the Parameters field.
    "Outputs": { } Specifies the resource information that the stack outputs after ROS creates the specified resources. In this example, the stack outputs the ECS instance ID, public IP address, and security group ID.
  6. Click Create Stack.
  7. Select the region where the ECS instance is located from the Region drop-down list, and click Next. In this example, China (Beijing) is specified.
  8. Set stack parameters.
    The following table lists the stack parameters.
    Parameter name Description
    Stack Name Specifies a unique stack name. You cannot change the stack name after ROS creates the stack.
    Creation timeout Specifies a period. If ROS fails to create the specified resources within the period, the creation operation will time out. You can select or clear Roll back.
    • If you select Roll back, ROS will delete the created resources when an error such as creation timeout occurs during the creation process.
    • If you clear Roll back, ROS will not delete the created resources when any error such as creation timeout occurs during the creation process.
    ECS Image Id The ID of the image that ROS uses to create the ECS instance. For more information, see Step 2.
    ECS Instance Type The type of the ECS instance that you want to create. For more information, see Step 2.
    ECS Instance Password and (Please Confirm) ECS Instance Password Specify the password for logon to the ECS instance and confirm the password. The password must be 8 to 30 characters in length and must contain at least three of these character categories: letters, digits, and special characters. Special characters include parentheses (( )), grave accents (`), tildes (~), exclamation points (!), at signs (@), number signs (#), dollar signs ($), percent signs (%), carets (^), ampersands (&), asterisks (*), hyphens (-), underscores (_), plus signs (+), equal signs (=), vertical bars (|), braces ({}), brackets ([]), colons (:), semicolons (;), apostrophes ('), angle brackets (<>), commas (,), periods (.), question marks (?), and forward slashes (/).
    Note Passwords for Windows-based instances cannot start with a forward slash (/).
    The VPC Cidrblock The private CIDR block of a Virtual Private Cloud (VPC). For more information, see Plan a VPC network.
    The VSwitch 2 Cidrblock The CIDR block of a VSwitch. The CIDR block of the VSwitch must fall within the CIDR block of the VPC and cannot overlap with the CIDR block of an existing VSwitch. For more information, see Plan a VPC network.
    DB Instance Class The type of the ApsaraDB for RDS instance.
    DB Instance Storage The storage capacity of the ApsaraDB for RDS instance.
    ECS Zone Id The zone ID of the resource that you want to create. For more information, see Step 2.
    Database Instance Engine Type The engine of the database that you want to use.
    Database Engine Version The version of the database engine that you want to use.
    DB Name The name of the MySQL database.
    DB Username The username of the MySQL database.
    DB Password The password for accessing the MySQL database. The password must be 8 to 32 characters in length.
    The following figure shows the configured parameters.

  9. Click Create.
  10. In the left-side navigation pane, click Stack Management, select the specified region in the top navigation bar, and then find the created stack.


  11. Click the stack name, and in the left-side navigation pane, click the following tabs to check the information about the stack:
    • Overview: displays basic information, startup parameters, status, output, and stack parameters.
    • Resource: displays all resources of the stack.
    • Event: records the operations that ROS performs when creating the resource stack. The causes of failed operations are also displayed in the list.
    • Template: displays the original template of the stack.