All Products
Search
Document Center

Resource Orchestration Service:Use Apsara DevOps pipelines to automate the creation of stacks (Legacy Apsara DevOps)

Last Updated:Oct 15, 2025

This topic uses an example of updating an ECS instance in a virtual private cloud (VPC) to describe how to use an Apsara DevOps pipeline and the ROS module to automate stack creation and updates.

Prerequisites

  • Create a service role and grant permissions to the role.

    • Create a service role, such as TestTeamRole. For more information, see Create a RAM role for a trusted Alibaba Cloud service.

    • Grant permissions to the role. For more information, see Grant permissions to a RAM role. The following table describes the required permissions.

      Policy name

      Description

      AliyunTeambitionRolePolicy

      Manages Apsara DevOps

      AliyunROSFullAccess

      Manages ROS

      AliyunECSFullAccess

      Manages ECS

      AliyunVPCFullAccess

      Manages VPC

      AliyunRDSFullAccess

      Manages RDS

  • Prepare a code repository, such as a Git repository, to use as the pipeline trigger source.

Background information

Apsara DevOps is an enterprise-level, one-stop DevOps solution. It provides end-to-end collaboration services and development tools that cover the entire lifecycle from requirements to development, testing, release, and O&M. Apsara DevOps integrates with Resource Orchestration Service (ROS). You can use Apsara DevOps to execute ROS templates from a code repository to automate stack creation and updates.

For example, you typically create or update stacks by manually interacting with ROS for each operation. You can use an Apsara DevOps pipeline to create a release process that automates these operations.

In this example, the Create a WordPress Environment Based on ECS and ApsaraDB for RDS template is uploaded to a code repository. An Apsara DevOps pipeline is then created to execute that template and automate stack creation and updates for the WordPress site.

Step 1: Upload the template code to the code repository

  1. Log on to the Resource Orchestration Service console.

  2. In the navigation pane on the left, click Templates > Public Templates.

  3. In the search box, enter WordPress to find the Create a WordPress Environment Based on ECS and ApsaraDB for RDS public template, and then click View Details.

    模板代码

  4. Upload the template code to the code repository.

Step 2: Create a pipeline to automate stack creation

  1. Log on to Apsara DevOps.

  2. In the upper-right corner, click Create Pipeline.

    1

  3. In the navigation pane on the left, click Others. Select Empty Template and click Create.

    流水线

  4. In the Add Pipeline Source dialog box, select a code source and click Add.

    流水线5

  5. Click Empty Job. In the Edit dialog box, enter a task name and click Add Step > Deploy > ROS Deploy.

  6. Set the Choose Service Connection, Alibaba Cloud Region, ROS Role, Stack Name, Template Path, and Timeout Period parameters. In the upper-right corner, click Save Only.

    Note

    When you create a pipeline for the first time, click Save and Run. In the Run Pipeline dialog box, click Run. The pipeline automatically creates the stack.

  7. Click New Task. In the Select Task Group dialog box, click Tool in the navigation pane on the left.

  8. In the Tool area, click Manual Approval.

  9. In the Edit dialog box, set the Task Name, Validator Type, and Validator parameters.

  10. Click Save and Run. In the Run Pipeline dialog box, click Run. The pipeline automatically creates the stack.

    You can log on to the ROS console and click Stacks. On the Stack List page, you can view information about the created stack.

    The pipeline requires an approval before the next task can start.

    • If the approval is granted, the pipeline proceeds to the next task.

    • If the approval is denied, you must modify the template or configuration file, run the pipeline again, and resubmit the request for approval.

Step 3: Update the stack

If you update the template and upload the new template code to the code repository, the Apsara DevOps pipeline automatically updates the stack when it calls the code.