All Products
Search
Document Center

Resource Orchestration Service:Create a stack by using a change set

Last Updated:Aug 26, 2026

Change sets let you preview resource changes before a stack takes effect. You can combine change sets with resource import to bring existing cloud resources into a new stack.

Scenarios

When you need to manage a large number of cloud resources and want to verify the expected state before a stack goes live, use a change set together with the resource import feature. Import your existing cloud resources into a stack using resource import, then create a change set to preview how the stack will manage those resources. The stack begins managing resources only after you execute the change set. Before executing, you can review and adjust the stack template as needed.For more information, see Create a stack from existing resources.

Methods to create a stack using a change set

  • Console: Create a stack using a change set in the ROS console.

    For more information, see Create a stack from existing resources.

  • API: Create a stack by calling change set API operations.

    For more information, see CreateChangeSet.

  • Alibaba Cloud CLI: Create a stack using the Alibaba Cloud Command-Line Interface (CLI) and a change set.

    For more information, see the following sections.

Create a stack using the Alibaba Cloud CLI

  1. Install the Alibaba Cloud CLI.

    For more information, see Install Alibaba Cloud CLI.

  2. Configure Alibaba Cloud credentials.

    For more information, see Configure credentials.

  3. Create a stack using a change set.

  4. Create a stack by creating a change set

    Run the aliyun ros CreateChangeSet command to create a stack by creating a change set.

    Set the change set type to CREATE. Specify the stack name, region ID, template, and change set name. For more information, see CreateChangeSet.

    aliyun ros CreateChangeSet --ChangeSetType CREATE --StackName <stack_name> --RegionId <region_id> --TemplateBody <template_body_structure> --ChangeSetName <change_set_name> 

    Create a stack by importing resources

    Run the aliyun ros CreateChangeSet command to create a stack by importing resources.

    Set the change set type to IMPORT. Specify the stack name, region ID, template, the resources to import, and the change set name. For more information, see CreateChangeSet.

    Note
    • You must specify the deletion policy for the resources in the TemplateBody property.

    • You must specify the ResourcesToImport property to complete the resource import.

    aliyun ros CreateChangeSet --ChangeSetType IMPORT --StackName <stack_name> --RegionId <region_id> --TemplateBody <template_body_structure> --ChangeSetName <change_set_name> --ResourcesToImport <resources_to_import>
  5. Run the aliyun ros ExecuteChangeSet command to execute the change set.

    aliyun ros ExecuteChangeSet --ChangeSetId <change_set_id>

References

  • View the impacts of a change set and inspect the stack template. For more information, see View a change set, and Data structures.

  • After you execute a change set, ROS automatically deletes the other change sets associated with that stack. For more information, see Execute a change set.

  • If a change set no longer meets your requirements, delete it before it is executed. For more information, see Delete a change set.

  • To create a stack by calling an API operation to create a change set, see CreateChangeSet.