Deploy a WordPress site based on ECS and RDS

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

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.

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.

In the left-side navigation pane, click Sample Template to display common templates that ROS provides.

Find the sample template wordpress_instance.

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.

Click Create Stack.

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.

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.

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.

Click Create.

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

Click the stack name, and in the left-side navigation pane, click the following tabs
to check the information about the stack: