Creates change sets.
Operation Description
Limits
You can create and execute change sets to update running stacks. For more information about change sets, see Overview.
Usage notes
- A stack can contain up to 20 change sets.
- Change sets reflect only the changes of stacks. Change sets do not reflect whether stacks are updated.
- You cannot use change sets to check the following items: whether the upper limit of your Alibaba Cloud account is reached, whether resources that cannot be updated are updated, and whether your Alibaba Cloud account has permissions to modify resources. These items may cause stack updates to fail. If stacks fail to be updated, Resource Orchestration Service (ROS) rolls back the resources to the original status.
In this topic, a change set named MyChangeSet
is created in the China (Hangzhou)
region. In this example, the template of the stack whose ID is 4a6c9851-3b0f-4f5f-b4ca-a14bf691****
is updated to {"ROSTemplateFormatVersion":"2015-09-01"}
.
debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ros:CreateChangeSet | WRITE |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
StackId | string | No | The ID of the stack for which you want to create a change set. ROS compares the stack information with the information that you submit, such as a modified template or a changed parameter value, to generate the change set. Note
This parameter takes effect only for change sets of the UPDATE or IMPORT.
| 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
StackPolicyURL | string | No | The URL of the file that contains the stack policy. The URL must point to a policy that is located on an HTTP or HTTPS web server or in an Object Storage Service (OSS) bucket, such as oss://ros/stack-policy/demo and oss://ros/stack-policy/demo?RegionId=cn-hangzhou. The policy file can be up to 16,384 bytes in length. Note
If you do not specify the region of the OSS bucket, the value of RegionId is used.
You can specify only one of the following parameters: StackPolicyBody and StackPolicyURL. If you set ChangeSetType to CREATE, you can specify StackPolicyBody or StackPolicyURL. If you set ChangeSetType to UPDATE, you can specify only one of the following parameters:
| oss://ros/stack-policy/demo |
StackPolicyBody | string | No | The structure of the stack policy body. The policy body must be 1 to 16,384 bytes in length. If you set ChangeSetType to CREATE, you can specify StackPolicyBody or StackPolicyURL. If you set ChangeSetType to UPDATE, you can specify only one of the following parameters:
| {"Statement":[{"Effect":"Allow","Action":"Update:*","Principal":"*","Resource":"*"}]} |
StackName | string | No | The name of the stack for which you want to create the change set. Note
This parameter takes effect only if you set ChangeSetType to CREATE or IMPORT.
| MyStack |
UsePreviousParameters | boolean | No | Specifies whether to use the values that were passed last time for the parameters that you do not specify in the current request. Valid values:
Note
This parameter takes effect only if you set ChangeSetType to UPDATE or IMPORT.
| true |
ChangeSetType | string | No | The type of the change set. Valid values:
If you create a change set for a new stack, ROS generates a unique stack ID for the stack. The stack remains in the REVIEW_IN_PROGRESS state until you execute the change set. | UPDATE |
Description | string | No | The description of the change set. The description can be up to 1,024 bytes in length. | It is a demo. |
RegionId | string | Yes | The region ID of the change set. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that the value is unique among different requests. | 123e4567-e89b-12d3-a456-42665544**** |
TemplateURL | string | No | The URL of the file that contains the template body. The URL must point to a template that is located on an HTTP or HTTPS web server or in an OSS bucket, such as oss://ros/template/demo and oss://ros/template/demo?RegionId=cn-hangzhou. The template body can be up to 524,288 bytes in length. Note
If you do not specify the region of the OSS bucket, the value of RegionId is used.
You can specify only one of the following parameters: TemplateBody, TemplateURL, and TemplateId. The URL can be up to 1,024 bytes in length. | oss://ros/template/demo |
StackPolicyDuringUpdateURL | string | No | The URL of the stack policy based on which the stack is updated. The URL must point to a policy that is located on an HTTP or HTTPS web server or in an OSS bucket, such as oss://ros/stack-policy/demo and oss://ros/stack-policy/demo?RegionId=cn-hangzhou. The policy file can be up to 16,384 bytes in length. Note
If you do not specify the region of the OSS bucket, the value of RegionId is used.
The URL can be up to 1,350 bytes in length.
| oss://ros/stack-policy/demo |
TemplateBody | string | No | The structure of the template body. The template body must be 1 to 524,288 bytes in length. You can specify only one of the following parameters: TemplateBody, TemplateURL, and TemplateId. | {"ROSTemplateFormatVersion":"2015-09-01"} |
TimeoutInMinutes | long | No | The amount of time that can elapse before the stack enters the CREATE_FAILED or UPDATE_FAILED state.
| 12 |
DisableRollback | boolean | No | Specifies whether to disable rollback when the stack fails to be created.
Note
This parameter takes effect only if you set ChangeSetType to CREATE or IMPORT.
| false |
ChangeSetName | string | Yes | The name of the change set. Note
Make sure that the name is unique among all names of change sets that are associated with the specified stack.
| MyChangeSet |
StackPolicyDuringUpdateBody | string | No | The structure of the temporary overriding stack policy. The policy body must be 1 to 16,384 bytes in length.
| {"Statement":[{"Effect":"Allow","Action":"Update:*","Principal":"*","Resource":"*"}]} |
RamRoleName | string | No | The name of the Resource Access Management (RAM) role. Resource Orchestration Service (ROS) assumes the RAM role to create the stack and uses the credentials of the role to call the APIs of Alibaba Cloud services. | test-role |
ReplacementOption | string | No | Specifies whether to enable replacement update if a resource property is changed and you cannot modify the new resource property. For a change, the physical ID of the resource remains unchanged. For a replacement update, the existing resource is deleted, a new resource is created, and the physical ID of the resource is changed. Valid values:
Note
Operations that you perform to modify the resource properties for an update take precedence over operations you perform to replace the resource properties for an update. This parameter takes effect only if you set ChangeSetType to UPDATE.
| Disabled |
TemplateId | string | No | The ID of the template. This parameter applies to shared and private templates. You can specify only one of the following parameters: TemplateBody, TemplateURL, and TemplateId. | 5ecd1e10-b0e9-4389-a565-e4c15efc**** |
TemplateVersion | string | No | The version of the template. Note
This parameter takes effect only if you specify TemplateId.
| v1 |
Parameters | object [] | No | The parameters that are defined in the template. | |
ParameterKey | string | Yes | The key of parameter N that is defined in the template. If you do not specify the key and value of a parameter, ROS uses the default name and value that are defined in the template. Maximum value of N: 200. Note
Parameters is optional. If you specify Parameters, you must also specify Parameters.N.ParameterKey.
| Amount |
ParameterValue | string | Yes | The value of parameter N that is defined in the template. Maximum value of N: 200. Note
Parameters is optional. If you specify Parameters, you must also specify Parameters.N.ParameterValue.
| 12 |
NotificationURLs | array | No | The callback URLs that are used to receive stack events. | |
string | No | The callback URL that is used to receive stack events. Valid values:
Each URL can be up to 1,024 bytes in length.
When the status of a stack changes, ROS sends an event notification to the EventBridge service. To view the event information, perform the following operations: Log on to the EventBridge console. In the left-side navigation pane, click Event Buses. Note
This feature is supported in the China (Hangzhou), China (Shanghai), China (Beijing), China (Hong Kong), and China (Zhangjiakou) regions.
You can specify up to five callback URLs. When the status of a stack changes, ROS sends a notification to the specified URL. When rollback is enabled for the stack, notifications are sent if the stack is in the CREATE_ROLLBACK or ROLLBACK state, but are not sent if the stack is in the CREATE_FAILED, UPDATE_FAILED, or IN_PROGRESS state. ROS does not send notifications when the stack is in the IN_PROGRESS state.
| http://example.com/ros-notify | |
ResourcesToImport | object [] | No | The resources that you want to import into the stack. | |
ResourceIdentifier | string | Yes | The key-value mapping between strings. The value is a JSON string that identifies resource N that you want to import. Note
This parameter takes effect only if you set ChangeSetType to IMPORT. ResourcesToImport is optional. If you specify ResourcesToImport, you must also specify ResourcesToImport.N.ResourceIdentifier.
| {"VpcId": "vpc-2zevx9ios******"} |
LogicalResourceId | string | Yes | The logical ID of resource N that you want to import. The logical ID specifies the name of resource N that is defined in the template. Note
This parameter takes effect only if you set ChangeSetType to IMPORT. ResourcesToImport is optional. If you specify ResourcesToImport, you must also specify ResourcesToImport.N.LogicalResourceId.
| Vpc |
ResourceType | string | Yes | The type of resource N that you want to import. The resource type must be the same as the resource type that is defined in the template. Note
This parameter takes effect only if you set ChangeSetType to IMPORT. ResourcesToImport is optional. If you specify ResourcesToImport, you must also specify ResourcesToImport.N.ResourceType.
| ALIYUN::ECS::VPC |
TemplateScratchId | string | No | The ID of the scenario template. | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
Parallelism | long | No | The maximum number of concurrent operations that can be performed on resources. By default, this parameter is empty. You can set this parameter to an integer that is greater than or equal to 0. If you set this parameter to a specific value, ROS associates the value with the stack. The value can affect subsequent operations on the stack. This parameter takes effect only if you set ChangeSetType to CREATE or UPDATE.
| 1 |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"ChangeSetId": "e85abe0c-6528-43fb-ae93-fdf8de22****",
"RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
"StackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf691****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||
---|---|---|---|---|
2023-08-15 | The internal configurations of the API operation change but you can still call the operation. | see changesets | ||
|