You can perform drift detection on a resource in a stack to determine whether the resource has drifted from its expected configurations.
Prerequisites
Detect drift in the ROS console
Detect drift through Alibaba Cloud CLI
You can use the aliyun ros DetectStackResourceDrift
command through Alibaba Cloud Command Line Interface (Alibaba Cloud CLI) to detect
drift on a resource, and view the logical resource ID and the stack to which the resource
belongs.
$ aliyun ros DetectStackResourceDrift --StackId 4334b961-3bfd-419e-9a00-23a95e****** --LogicalResourceId Vpc1
{
"ResourceDriftStatus": "MODIFIED",
"LogicalResourceId": "Vpc1",
"PropertyDifferences": [
{
"ActualValue": "test11",
"PropertyPath": "/Description",
"ExpectedValue": "test1",
"DifferenceType": "NOT_EQUAL"
}
],
"RequestId": "A488767B-7440-4A74-81FD-BCF91A2EE1BB",
"PhysicalResourceId": "vpc-m5euqfvmzygb7xq******",
"ExpectedProperties": "{\"CidrBlock\": \"192.168.0.0/16\", \"Description\": \"test1\", \"VpcName\": \"test1\"}",
"DriftDetectionTime": "2020-03-17T08:35:34",
"ResourceType": "ALIYUN::ECS::VPC",
"ActualProperties": "{\"CidrBlock\": \"192.168.0.0/16\", \"Description\": \"test11\", \"VpcName\": \"test1\"}",
"StackId": "4334b961-3bfd-419e-9a00-23a95e******"
}