If you want to create a stack based on the template and the parameters of an existing stack, you can clone the existing stack. This topic describes how to clone a stack in the Resource Orchestration Service (ROS) console.
Prerequisites
A stack is created. For more information, see Create a stack.
Limits
You can clone a stack that is only in one of the following states.
State | Description |
CREATE_COMPLETE | The stack is created. |
UPDATE_COMPLETE | The stack is updated. |
ROLLBACK_COMPLETE | The resources of the stack are rolled back. |
IMPORT_CREATE_COMPLETE | The stack is created by using imported resources. |
IMPORT_UPDATE_COMPLETE | The stack is updated by using imported resources. |
IMPORT_UPDATE_ROLLBACK_COMPLETE | The resources are rolled back after the stack fails to be updated by using imported resources. |
CHECK_COMPLETE | The stack is validated. |
Procedure
Log on to the ROS console.
In the left-side navigation pane, click Stacks.
In the top navigation bar, select the region where the stack you want to clone resides from the region drop-down list. For example, you can select China (Hangzhou).
On the Stacks page, find the stack and choose
in the Actions column.In the Configure Parameters step, specify the Stack Name parameter and configure parameters in the Configure Template Parameters section.
NoteThe parameters that you configure vary based on the template you use. Follow the on-screen instructions in the console to configure the parameters.
In the Configure Stack Settings section, configure the following parameters and click Next.
NoteThe parameters that you configure vary based on the template you use. Follow the on-screen instructions in the console to configure the parameters.
Parameter
Description
Stack Policy
Valid values:
No Stack Policy: You do not need to specify a stack policy.
Input Stack Policy: You must upload a stack policy file or enter a stack policy in the code editor.
For more information about stack policies, see Stack policies.
Rollback on Failure
Valid values:
Yes: performs a rollback when the stack fails to be created.
No: does not perform a rollback when the stack fails to be created.
Timeout Period
If resources failed to be created or updated within the timeout period, the system automatically rolls the resources back to the status before the system creates or updates the resources.
Valid values: 10 to 1440.
Unit: minutes.
Maximum Concurrent Resources
The maximum number of concurrent operations that can be performed on resources. If you set this parameter to a value other than 0, the value is used. If you set this parameter to 0, no limit is imposed.
If you leave this parameter empty when you update a stack or continue to create a stack, the value that you specified for this parameter in the previous operation is used.
Deletion Protection
This parameter prevents the stack from being unintentionally deleted. Valid values:
Enabled: enables deletion protection.
Disabled: disables deletion protection.
RAM Role
The Resource Access Management (RAM) role of which the trusted entity is ROS. You can create a RAM role and grant the minimum permissions to the RAM role based on the required permissions of resources in the template.
If you specify a RAM role, ROS creates resources based on the permissions of the RAM role.
If you want to create resources by using a stack role instead of the current account, make sure that the current account has the permissions to manage ROS resources. This ensures that you can create a stack role and use the stack role to create resources. For more information, see Use a stack role.
For more information about how to create a RAM role and grant permissions to the RAM role, see Create a RAM role for a trusted Alibaba Cloud service and Grant permissions to a RAM role.
If you do not specify a RAM role, ROS creates the stack based on the permissions of the current account.
Tags
A tag is a key-value pair that you can use to classify stacks.
To add a tag, click Add. In the Edit tag dialog box, configure the Tag key and Tag value parameters, and click OK.
Resource Group
The resource group to which the stack belongs. If you do not specify a resource group, 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 URLs that are used to receive the events of the stack.
Manual Payment
Specifies whether to manually pay for the subscription resources that are involved in the template.
If you select the check box, you must manually pay for orders generated for subscription resources. You can view the orders to be paid 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 of ROS.
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.
In the Check and Confirm step, check and confirm the configurations of the stack.
Click Create.