Updates the resources in a stack.
Operation description
The Parameters and UsePreviousParameters request parameters are related. If a parameter defined in the template is not specified in Parameters:
-
If
UsePreviousParametersis set tofalse, the parameter uses its default value from the template. If the parameter does not have a default value, you must specify it inParameters. -
If
UsePreviousParametersis set totrue, the parameter retains its value from the previous stack creation. If no value was specified at that time and the template provides a default, that default value is used.
This example shows how to update the template for a stack with the ID 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** in the China (Beijing) region to {"ROSTemplateFormatVersion": "2015-09-01"}.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ros:UpdateStack |
update |
*stack
Template
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StackId |
string |
Yes |
The stack ID. |
4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
| ClientToken |
string |
No |
A client-generated token to ensure the idempotency of the request. The token must be globally unique. |
123e4567-e89b-12d3-a456-42665544**** |
| StackPolicyDuringUpdateBody |
string |
No |
The temporary override for the stack policy body. The policy body can be 1 to 16,384 bytes long.
|
{"Statement": [{"Effect": "Allow", "Action": "Update:*", "Principal": "*", "Resource": "*"}]} |
| TimeoutInMinutes |
integer |
No |
The timeout period for the stack update, in minutes.
|
10 |
| TemplateBody |
string |
No |
The template body. The template body can be 1 to 524,288 bytes long. If the template body is large, we recommend that you use the POST request method and pass the parameter in the request body to prevent request failures due to an excessively long URL. Note
You can specify only one of the |
{"ROSTemplateFormatVersion": "2015-09-01"} |
| StackPolicyURL |
string |
No |
The URL of the file that contains the stack policy. The URL must point to a policy that is located on a web server (HTTP or HTTPS) or in an Alibaba Cloud Object Storage Service (OSS) bucket, for example, Note
You can specify only one of the The URL can be up to 1,350 bytes long. |
oss://ros-stack-policy/demo |
| StackPolicyDuringUpdateURL |
string |
No |
The URL of the file that contains the temporary stack policy override. The URL must point to a policy that is located on a web server (HTTP or HTTPS) or in an Alibaba Cloud OSS bucket, for example, Note
If you do not specify the OSS region in the URL, the region specified by the RegionId parameter is used. The URL can be up to 1,350 bytes long. If you want to update protected resources, you must specify a temporary stack policy override during the update. If you do not specify a stack policy, the current policy that is associated with the stack is used. This parameter takes effect only when the change set type is
|
oss://ros-stack-policy/demo |
| StackPolicyBody |
string |
No |
The stack policy body. The policy body can be 1 to 16,384 bytes long. Note
You can specify only one of the |
{"Statement": [{"Action": "Update:*", "Resource": "*", "Effect": "Allow", "Principal": "*"}]} |
| UsePreviousParameters |
boolean |
No |
Specifies whether to reuse the values of parameters that are not specified in the current request. Valid values:
|
true |
| RegionId |
string |
Yes |
The ID of the region where the stack is located. You can call the DescribeRegions operation to query the most recent list of Alibaba Cloud regions. |
cn-beijing |
DisableRollback
deprecated
|
boolean |
No |
(This parameter is deprecated and has no effect.) |
|
| TemplateURL |
string |
No |
The location of the file that contains the template body. The URL must point to a template (1 to 524,288 bytes) that is located on an HTTP or HTTPS web server or in an Alibaba Cloud OSS bucket. The URL of an OSS bucket is in a format such as oss://ros/template/demo or oss://ros/template/demo?RegionId=cn-hangzhou. If an OSS region is not specified, the region defaults to the one specified by the RegionId parameter. Note
You must specify exactly one of the TemplateBody, TemplateURL, or TemplateId parameters. |
oss://ros-template/demo |
| RamRoleName |
string |
No |
The name of the RAM role. ROS assumes this role to create the stack and uses the credentials of the role to make API calls on your behalf. |
test-role |
| ReplacementOption |
string |
No |
Whether to use a replacement update. When the properties of a resource do not support modification updates, you can use a replacement update to change the resource properties. A replacement update deletes the resource and then recreates it. The physical ID of the new resource will change. Valid values:
Note
Modification updates have a higher priority than replacement updates. |
Disabled |
| TemplateId |
string |
No |
The ID of the template. This parameter applies to shared and private templates. Note
You can specify only one of the |
5ecd1e10-b0e9-4389-a565-e4c15efc**** |
| TemplateVersion |
string |
No |
The version of the template. This parameter takes effect only when you specify |
v1 |
| Parameters |
array<object> |
No |
The parameters of the template. |
|
|
object |
No |
|||
| ParameterKey |
string |
Yes |
The name of the parameter. If you do not specify the name and value of a parameter, ROS uses the default value that is specified in the template. Note
|
Amount |
| ParameterValue |
string |
Yes |
The value of the parameter. You can specify a maximum of 200 parameters. Note
|
12 |
| Tags |
array<object> |
No |
The tags of the stack. |
|
|
object |
No |
|||
| Key |
string |
Yes |
The tag key of the stack. Note
|
usage |
| Value |
string |
No |
The tag value of the stack. Note
These tags are propagated to all taggable resources in the stack. For more information, see Tag propagation. |
test |
| Parallelism |
integer |
No |
The maximum number of concurrent operations that can be performed on resources. By default, this parameter is empty. You can specify an integer that is greater than or equal to 0. Note
|
1 |
| ResourceGroupId |
string |
No |
The resource group ID. |
rg-acfmxazb4ph6aiy**** |
| DryRun |
boolean |
No |
Specifies whether to perform only a dry run for the request. Valid values:
Note
If you update a stack without making any changes, the operation fails with a NotSupported error if DryRun is false. If DryRun is true, no error is reported. |
false |
| DryRunOptions |
array |
No |
The dry run options. The list can contain a maximum of one item. Note
This parameter takes effect only when |
|
|
string |
No |
The dry run option. Valid values:
Note
This option is available only for ROS-type stacks.
|
ParameterAnalysis.ConsiderCondition |
For details on common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
B288A0BE-D927-4888-B0F7-B35EF84B6E6F |
| StackId |
string |
The stack ID. |
4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
| DryRunResult |
object |
The dry run result. This parameter is returned only when |
|
| ParametersAllowedToBeModified |
array |
The parameters that can be modified. |
|
|
string |
A parameter that can be modified. If you update a stack without changing the template, modifying only the value of this parameter does not cause a validation error. |
param1 |
|
| ParametersConditionallyAllowedToBeModified |
array |
The parameters that can be modified under specific conditions. |
|
|
string |
A parameter that can be modified under specific conditions. If you update a stack without changing the template, whether modifying only this parameter's value causes a validation error depends on its new value. |
param2 |
|
| ParametersUncertainlyAllowedToBeModified |
array |
The parameters for which it is uncertain whether they can be modified. |
|
|
string |
A parameter for which it is uncertain whether it can be modified. If you update a stack without changing the template, whether modifying only this parameter's value causes a validation error is determined at runtime. |
param3 |
|
| ParametersNotAllowedToBeModified |
array |
The parameters that cannot be modified. |
|
|
string |
A parameter that cannot be modified. If you update a stack without changing the template, modifying only this parameter's value always causes a validation error. |
param4 |
|
| ParametersCauseInterruptionIfModified |
array |
A list of parameters that always cause a resource interruption if modified. Note
|
|
|
string |
A parameter that always causes a resource interruption if modified. If you update a stack without changing the template, modifying only this parameter's value always causes a resource interruption. |
param1 |
|
| ParametersConditionallyCauseInterruptionIfModified |
array |
A list of parameters that may cause a resource interruption if modified. Note
|
|
|
string |
A parameter that may cause a resource interruption if modified. If you update a stack without changing the template, whether modifying only this parameter's value causes a resource interruption depends on its new value and the resource's update behavior. |
param2 |
|
| ParametersUncertainlyCauseInterruptionIfModified |
array |
A list of parameters for which it is uncertain whether a modification will cause a resource interruption. Note
|
|
|
string |
A parameter for which it is uncertain whether a modification will cause a resource interruption. If you update a stack without changing the template, whether modifying only this parameter's value causes a resource interruption is determined at runtime. |
param3 |
|
| ParametersCauseReplacementIfModified |
array |
A list of parameters that always cause a resource replacement if modified. Note
|
|
|
string |
A parameter that always causes a resource replacement if modified. If you update a stack without changing the template, modifying only this parameter's value always causes a resource replacement. |
param5 |
|
| ParametersConditionallyCauseReplacementIfModified |
array |
A list of parameters that may cause a resource replacement if modified. Note
|
|
|
string |
A parameter that may cause a resource replacement if modified. If you update a stack without changing the template, whether modifying only this parameter's value causes a resource replacement depends on its new value. |
param6 |
|
| ParametersUncertainlyCauseReplacementIfModified |
array |
A list of parameters for which it is uncertain whether a modification will cause a resource replacement. Note
|
|
|
string |
A parameter for which it is uncertain whether a modification will cause a resource replacement. If you update a stack without changing the template, whether modifying only this parameter's value causes a resource replacement is determined at runtime. |
param7 |
Examples
Success response
JSON format
{
"RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
"StackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf691****",
"DryRunResult": {
"ParametersAllowedToBeModified": [
"param1"
],
"ParametersConditionallyAllowedToBeModified": [
"param2"
],
"ParametersUncertainlyAllowedToBeModified": [
"param3"
],
"ParametersNotAllowedToBeModified": [
"param4"
],
"ParametersCauseInterruptionIfModified": [
"param1"
],
"ParametersConditionallyCauseInterruptionIfModified": [
"param2"
],
"ParametersUncertainlyCauseInterruptionIfModified": [
"param3"
],
"ParametersCauseReplacementIfModified": [
"param5"
],
"ParametersConditionallyCauseReplacementIfModified": [
"param6"
],
"ParametersUncertainlyCauseReplacementIfModified": [
"param7"
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.