You can clone a stack to create a new one based on the template and parameters of an existing stack. This topic describes how to clone a stack using Resource Orchestration Service (ROS).
Prerequisites
An existing stack is required. For more information, see Create a stack.
Limits
You can clone a stack only when it is in one of the following states:
State | Description |
CREATE_COMPLETE | The stack is successfully created. |
UPDATE_COMPLETE | The stack is successfully updated. |
ROLLBACK_COMPLETE | The stack is successfully rolled back. |
IMPORT_CREATE_COMPLETE | The stack is successfully created by importing resources. |
IMPORT_UPDATE_COMPLETE | The stack is successfully updated by importing resources. |
IMPORT_UPDATE_ROLLBACK_COMPLETE | The stack update by importing resources fails, and the stack is successfully rolled back. |
CHECK_COMPLETE | The stack check is complete. |
Procedure
Log on to the ROS console.
In the navigation pane on the left, click Stacks.
-
In the top navigation bar, select the region where you want to create the stack, such as China (Hangzhou).
On the Stacks page, find the stack that you want to clone and choose in the Actions column.
-
On the Configure Parameters page, enter a Stack Name and configure the Configure Template Parameters.
NoteThe required parameters vary by template. Enter the parameter values as prompted.
In the Configure Stack Settings section, configure the following parameters and click Next.
NoteThe required parameters vary by template. Enter the parameter values as prompted.
Parameter
Description
Stack Policy
Valid values:
-
No Stack Policy: Does not set a stack policy.
-
Input Stack Policy: Upload a file or enter the stack policy in the text box.
For more information about stack policies, see Stack policy.
Rollback on Failure
Valid values:
-
Yes: Enables the rollback policy if stack creation fails.
-
No: Disables the rollback policy if stack creation fails.
Timeout Period
If ROS fails to create or update all resources within the specified period, it rolls back resources to their previous state.
Value range: 10 to 1440.
Unit: minutes.
Maximum Concurrent Resources
A non-zero value limits the number of resources created or updated concurrently. A value of zero means no limit.
When you update a stack or resume its creation, the previous setting is used if a new value is not specified.
Deletion Protection
Prevents the stack from being accidentally deleted. Valid values:
-
Enabled: Enables deletion protection.
-
Disabled: Disables deletion protection.
RAM Role
You can create a RAM role with ROS as a trusted entity, then grant only the permissions required by the resources in the ROS template.
-
If you specify a RAM role, ROS creates resources based on the permissions of the RAM role.
If you want to use a stack role instead of your current account to create resources, ensure that your current account has ROS management permissions. For more information, see Use a stack role.
For more information about how to create a RAM role and grant permissions to a RAM role, see Create a RAM role for a trusted Alibaba Cloud service and Manage the permissions of a RAM role.
-
If unspecified, ROS uses your current account permissions to create the stack.
Tags
Key-value pairs used to categorize and manage stacks.
Click Add. In the Edit Tag Binding dialog box, set a Tag Key and Tag Value, and then click OK.
Resource Group
Select a resource group for the stack. If no resource group is specified, the stack is added to the default resource group.
For more information about how to create a resource group, see Create a resource group.
Stack Event Callback URLs
The callback URL for receiving stack event notifications.
Manual Payment
Specifies whether to manually pay for subscription resources defined in the template.
If you select this option, you must manually pay for the resulting subscription orders. Unpaid orders can be viewed on the stack details page.
-
On the Compliance Precheck page, complete the compliance precheck and click Next.
NoteThe compliance precheck feature is available only for specific resources. For more information, see Compliance precheck.
In the Evaluate Rules section, add compliance rules.
You can add compliance rules based on the cloud resources in the ROS template.
Click Evaluate.
You can modify the template content based on the suggestions that are provided to remediate invalid resources to ensure the compliance of the resources.
On the Check and Confirm page, review the stack configuration.
Click Create.
> Clone