The alarm went off at 03:17. The Infrastructure as Code stack was out of sync with reality. Drift had crept in.
Cloud environments change without asking. Scripts fail silently. Human fixes leave footprints you don’t see until it’s too late. IAC drift detection is the only way to know when your declared state and your deployed state have split. Without it, your DynamoDB queries could be running against a table you no longer control.
Drift detection starts with a snapshot of your infrastructure state. Compare what your Terraform or CloudFormation says with what AWS actually reports. For DynamoDB, this means checking table schemas, indexes, provisioned throughput, and stream settings. Any mismatch is drift.
Once you detect drift, you need a plan. This is where runbooks matter. A good runbook lives close to the code, versioned, and exact. It tells you how to verify the data, confirm query patterns, and restore configs. For DynamoDB queries, include steps for scanning tables with filters, checking Global Secondary Indexes, and validating read/write capacity against expected load.