Stack drift correction helps ensure consistency between resource configurations and their template definitions. Changes can be synchronized between stack configurations and template definitions.
Background information
- You can update stacks to synchronize resource configurations with their template definitions. For more information, see Update a stack.
- You can correct templates to synchronize template definitions with the current resource configurations. This topic describes how to correct templates.
Correct templates in the ROS console
Correct templates through Alibaba Cloud CLI
You can use the aliyun ros UpdateStackTemplateByResources
command through Alibaba Cloud Command Line Interface (Alibaba Cloud CLI) to correct
templates. The parameters are the same as those of the UpdateStackTemplateByResources operation. For more information, see UpdateStackTemplateByResources.
$ aliyun ros UpdateStackTemplateByResources --StackId 4334b961-3bfd-419e-9a00-23a95e******
{
"RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
"NewTemplateBody": "{\"ROSTemplateFormatVersion\": \"2015-09-01\", \"Resources\": {\"Vpc\": {\"Type\": \"ALIYUN::ECS::VPC\", \"Properties\": {\"VpcName\": \"test\", \"CidrBlock\": \"192.168.0.0/16\", \"Description\": \"test2\"}}}, \"Outputs\": {\"VpcId\": {\"Value\": {\"Fn::GetAtt\": [\"Vpc\", \"VpcId\"]}}}}",
"OldTemplateBody": "{\"ROSTemplateFormatVersion\": \"2015-09-01\", \"Resources\": {\"Vpc\": {\"Type\": \"ALIYUN::ECS::VPC\", \"Properties\": {\"VpcName\": \"test\", \"CidrBlock\": \"192.168.0.0/16\", \"Description\": \"test1\"}}}, \"Outputs\": {\"VpcId\": {\"Value\": {\"Fn::GetAtt\": [\"Vpc\", \"VpcId\"]}}}}"
}