Complete the code to start drift detection on a CloudFormation stack.
aws cloudformation detect-stack-drift --stack-name [1]Complete the command to check the drift detection status for a stack.
aws cloudformation describe-stack-drift-detection-status --stack-drift-detection-id [1]Fix the error in the command to list all resources with drift information for a stack.
aws cloudformation [1] --stack-name MyStack --query 'StackResourceDrifts[?[2]==`MODIFIED`]'
Fill both blanks to create a command that detects drift and waits until detection completes.
aws cloudformation detect-stack-drift --stack-name [1] && aws cloudformation wait stack-drift-detection-complete --stack-drift-detection-id [2]
Fill all three blanks to create a script snippet that detects drift, waits for completion, and then lists modified resources.
detection_id=$(aws cloudformation detect-stack-drift --stack-name [1] --query 'StackDriftDetectionId' --output text) aws cloudformation wait stack-drift-detection-complete --stack-drift-detection-id [2] aws cloudformation describe-stack-resource-drifts --stack-name [3] --query 'StackResourceDrifts[?ResourceDriftStatus==`MODIFIED`]'
