A change set lets you preview the impact of proposed changes on your running resources before you apply them. This topic describes how to use a change set to update a stack in Resource Orchestration Service (ROS).
Use cases
When you want to verify the impact of a stack update before it takes effect — for example, to check whether key resources will be deleted or replaced — create a change set instead of updating the stack directly. The change set shows you what will change. The update takes effect only after you execute the change set. Before executing, you can review and modify the stack template to confirm it meets your requirements. For more information, see Update a stack by using a change set.
Prerequisites
A stack must already exist. For more information, see Create a stack.
Limitations
You can create a change set only for a stack that is in one of the following states.
State | Description |
CREATE_COMPLETE | The stack is successfully created. |
UPDATE_FAILED | The stack update failed. |
UPDATE_COMPLETE | The stack update is complete. |
ROLLBACK_COMPLETE | The stack rollback is complete. |
ROLLBACK_FAILED | The stack rollback failed. |
IMPORT_CREATE_COMPLETE | The stack is successfully created from imported resources. |
IMPORT_UPDATE_COMPLETE | The stack is successfully updated with imported resources. |
IMPORT_UPDATE_FAILED | The stack update from imported resources failed. |
IMPORT_UPDATE_ROLLBACK_COMPLETE | The stack update from imported resources failed, and the rollback is complete. |
IMPORT_UPDATE_ROLLBACK_FAILED | The stack update from imported resources failed, and the rollback also failed. |
CHECK_FAILED | The stack validation failed. |
CHECK_COMPLETE | The stack validation is complete. |
Supported methods
Console: Use the ROS console to update a stack with a change set.
For instructions, see the procedures in this topic.
API: Call the CreateChangeSet API operation to update a stack with a change set.
For more information, see CreateChangeSet.
Alibaba Cloud CLI: Use the Alibaba Cloud CLI to update a stack with a change set.
For instructions, see the procedures in this topic.
Update a stack by using the console
Log in 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 a stack from the region drop-down list. For example, select China (Hangzhou).
On the Stacks page, click the name of your stack.
On the stack details page, click the Change Sets tab.
On the Change Sets tab, click Create Change Set.
On the Select Template page, select an existing or public template, and then click Next.
On the Configure Parameters page, set the Change set name and other parameters from the template.
NoteThe template parameters are parsed from the selected template. Enter the values as prompted on the page.
In the Configure Change Set section, configure the Stack Policy, Rollback on Failure, Timeout Period, Maximum Concurrent Resources, RAM Role, and Whether to enable replacement update options. Then, click Next.
On the Check and Confirm page, click Create Change Set.
Update a stack by using the CLI
Install the Alibaba Cloud CLI.
For more information, see Install Alibaba Cloud CLI.
Configure Alibaba Cloud credentials.
For more information, see Configure credentials.
Create a change set to update the stack.
Run the
aliyun ros CreateChangeSetcommand. You must set the ChangeSetType parameter to UPDATE and specify the stack name, region ID, template, and change set name.For more information, see CreateChangeSet.
aliyun ros CreateChangeSet --ChangeSetType UPDATE --StackName <your_stack_name> --RegionId <your_region_id> --TemplateBody <your_template_body> --ChangeSetName <your_change_set_name>Run the
aliyun ros ExecuteChangeSetcommand 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 change set using the API, see CreateChangeSet.