Updates the resource information of a created stack.
Operation description
The values of Parameters and UsePreviousParameters are related. If a parameter defined in the template is not specified in Parameters:
-
If UsePreviousParameters is set to false: the default value of the parameter in the template is used if available. If no default value exists, you must specify the parameter in Parameters.
-
If UsePreviousParameters is set to true: if the parameter was specified when the stack was created, the specified value is used. If the parameter was not specified when the stack was created and the parameter has a default value in the template, the default value is used.
This topic provides an example to show how to update the template content of a stack in the China (Beijing) region to {"ROSTemplateFormatVersion": "2015-09-01"}. The stack ID is 4a6c9851-3b0f-4f5f-b4ca-a14bf691****.
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 |
The client token that is used to ensure the idempotence of the request. This parameter value is generated by the client and must be globally unique. |
123e4567-e89b-12d3-a456-42665544**** |
| StackPolicyDuringUpdateBody |
string |
No |
The structure of the temporary overriding stack policy body. The value must be 1 to 16,384 bytes in length.
|
{"Statement": [{"Effect": "Allow", "Action": "Update:*", "Principal": "*", "Resource": "*"}]} |
| TimeoutInMinutes |
integer |
No |
The timeout period for updating the stack.
|
10 |
| TemplateBody |
string |
No |
The structure of the template body. The value must be 1 to 524,288 bytes in length. If the length is large, we recommend that you use the HTTP POST method with the parameter in the request body to avoid request failures caused by an excessively long URL. Note
You must and can only specify one of the following parameters: TemplateBody, TemplateURL, or TemplateId. |
{"ROSTemplateFormatVersion": "2015-09-01"} |
| StackPolicyURL |
string |
No |
The URL of the file that contains the stack policy. The URL must point to a policy located on a web server (HTTP or HTTPS) or in an Alibaba Cloud OSS bucket, such as oss://ros/stack-policy/demo or oss://ros/stack-policy/demo?RegionId=cn-hangzhou. The maximum file size is 16,384 bytes. If the OSS region is not specified, the value of the RegionId parameter is used by default. Note
You can specify only one of the following parameters: StackPolicyBody or StackPolicyURL. The URL can be up to 1,350 bytes in length. |
oss://ros-stack-policy/demo |
| StackPolicyDuringUpdateURL |
string |
No |
The URL of the file that contains the stack policy for the update. The URL must point to a policy located on a web server (HTTP or HTTPS) or in an Alibaba Cloud OSS bucket, such as oss://ros/stack-policy/demo or oss://ros/stack-policy/demo?RegionId=cn-hangzhou. The maximum file size is 16,384 bytes. Note
If the OSS region is not specified, the value of the RegionId parameter is used by default. The URL can be up to 1,350 bytes in length. To update protected resources, specify a temporary overriding stack policy during the update. If you do not specify a stack policy, the current policy associated with the stack is used. This parameter takes effect only when the change set type is 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 value must be 1 to 16,384 bytes in length. Note
You can specify only one of the following parameters: StackPolicyBody or StackPolicyURL. |
{"Statement": [{"Action": "Update:*", "Resource": "*", "Effect": "Allow", "Principal": "*"}]} |
| UsePreviousParameters |
boolean |
No |
Specifies whether to use the previously specified values for parameters that are not passed in the current request. Valid values:
|
true |
| RegionId |
string |
Yes |
The region ID of the stack. You can call the DescribeRegions operation to query the most recent region list. |
cn-beijing |
DisableRollback
deprecated
|
boolean |
No |
[Deprecated] This parameter has no effect. |
|
| TemplateURL |
string |
No |
The URL of the file that contains the template body. The URL must point to a template located on an HTTP web server (HTTP or HTTPS) or in an Alibaba Cloud OSS bucket. The template must be 1 to 524,288 bytes in length. Examples of the OSS bucket URL: oss://ros/template/demo or oss://ros/template/demo?RegionId=cn-hangzhou. If the OSS region is not specified, the value of the RegionId parameter is used by default. Note
You must and can only specify one of the following parameters: TemplateBody, TemplateURL, or TemplateId. |
oss://ros-template/demo |
| RamRoleName |
string |
No |
The name of the RAM role. Resource Orchestration Service (ROS) assumes the role to create the stack and uses the credentials of the role to call the APIs of each service on behalf of the user. |
test-role |
| ReplacementOption |
string |
No |
Specifies whether to use replacement update. If a resource property does not support modification update, you can use replacement update to change the resource property. Replacement update deletes the resource and then recreates it. The physical ID of the new resource changes. Valid values:
Note
Modification update takes priority over replacement update. |
Disabled |
| TemplateId |
string |
No |
The template ID. Both shared templates and private templates are supported. Note
You must and can only specify one of the following parameters: TemplateBody, TemplateURL, or TemplateId. |
5ecd1e10-b0e9-4389-a565-e4c15efc**** |
| TemplateVersion |
string |
No |
The template version. This parameter takes effect only when TemplateId is specified. |
v1 |
| Parameters |
array<object> |
No |
The parameters. |
|
|
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 specified in the template. Note
Parameters is optional. If you specify Parameters, you must specify both Parameters.N.ParameterKey and Parameters.N.ParameterValue. |
Amount |
| ParameterValue |
string |
Yes |
The value of the parameter. Maximum value of N: 200. Note
Parameters is optional. If you specify Parameters, you must specify both Parameters.N.ParameterKey and Parameters.N.ParameterValue. |
12 |
| Tags |
array<object> |
No |
The tags of the stack. |
|
|
object |
No |
|||
| Key |
string |
Yes |
The tag key of the stack. Note
Tags is optional. If you specify Tags, you must specify Tags.N.Key. This tag is propagated to each resource in the stack that supports tags. For more information, see Propagate tags. |
usage |
| Value |
string |
No |
The tag value of the stack. Note
This tag is propagated to each resource in the stack that supports tags. For more information, see Propagate tags. |
test |
| Parallelism |
integer |
No |
The maximum number of concurrent resources. Default value: empty. You can enter an integer greater than or equal to zero. Note
|
1 |
| ResourceGroupId |
string |
No |
The resource group ID. |
rg-acfmxazb4ph6aiy**** |
| DryRun |
boolean |
No |
Specifies whether to perform only a validation. Valid values:
Note
If no changes are made when updating the stack: if DryRun is set to false, a NotSupported error is returned. If DryRun is set to true, no error is returned. |
false |
| DryRunOptions |
array |
No |
The list of validation options. Maximum length of the list: 1. Note
This parameter takes effect only when DryRun is set to true. |
|
|
string |
No |
The validation option. Valid values:
Note
This option takes effect only for ROS stacks.
|
ParameterAnalysis.ConsiderCondition |
|
| TaintResources |
array |
No |
The list of resources to be marked as tainted. |
|
|
string |
No |
|
my_vpc |
For more information about 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 validation result. This parameter is returned only when DryRun is set to true. |
|
| ParametersAllowedToBeModified |
array |
The parameters that are allowed to be modified. |
|
|
string |
The parameter that is allowed to be modified. When updating the stack, if the template remains unchanged and only the parameter value is modified, modifying this parameter does not cause a validation error. |
param1 |
|
| ParametersConditionallyAllowedToBeModified |
array |
The parameters that may be allowed to be modified. |
|
|
string |
The parameter that may be allowed to be modified. When updating the stack, if the template remains unchanged and only the parameter value is modified, whether modifying this parameter causes a validation error depends on the parameter value. |
param2 |
|
| ParametersUncertainlyAllowedToBeModified |
array |
The parameters that are uncertain to be allowed to be modified. |
|
|
string |
The parameter that is uncertain to be allowed to be modified. When updating the stack, if the template remains unchanged and only the parameter value is modified, whether modifying this parameter causes a validation error can only be determined at runtime. |
param3 |
|
| ParametersNotAllowedToBeModified |
array |
The parameters that are not allowed to be modified. |
|
|
string |
The parameter that is not allowed to be modified. When updating the stack, if the template remains unchanged and only the parameter value is modified, a validation error is always caused. |
param4 |
|
| ParametersCauseInterruptionIfModified |
array |
The list of parameters that will definitely cause resource interruption. Note
|
|
|
string |
The parameter that will definitely cause resource interruption. When updating the stack, if the template remains unchanged and only the parameter value is modified, resource interruption is always caused. |
param1 |
|
| ParametersConditionallyCauseInterruptionIfModified |
array |
The list of parameters that may cause resource interruption. Note
|
|
|
string |
The parameter that may cause resource interruption. When updating the stack, if the template remains unchanged and only the parameter value is modified, whether modifying this parameter causes resource interruption depends on the parameter value and the update behavior of the resource. |
param2 |
|
| ParametersUncertainlyCauseInterruptionIfModified |
array |
The list of parameters that are uncertain to cause resource interruption. Note
|
|
|
string |
The parameter that is uncertain to cause resource interruption. When updating the stack, if the template remains unchanged and only the parameter value is modified, whether this parameter causes resource interruption can only be determined at runtime. |
param3 |
|
| ParametersCauseReplacementIfModified |
array |
The list of parameters that will definitely cause resource replacement update. Note
|
|
|
string |
The parameter that will definitely cause resource replacement update. When updating the stack, if the template remains unchanged and only the parameter value is modified, resource replacement update is always caused. |
param5 |
|
| ParametersConditionallyCauseReplacementIfModified |
array |
The list of parameters that may cause resource replacement update. Note
|
|
|
string |
The parameter that may cause resource replacement update. When updating the stack, if the template remains unchanged and only the parameter value is modified, whether resource replacement update is caused depends on the parameter value. |
param6 |
|
| ParametersUncertainlyCauseReplacementIfModified |
array |
The list of parameters that are uncertain to cause resource replacement update. Note
|
|
|
string |
The parameter that is uncertain to cause resource replacement update. When updating the stack, if the template remains unchanged and only the parameter value is modified, whether this parameter causes resource replacement update can only be 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.