Terraform drift detection using GitHub actions

6 min readNov 7, 2023

If you use Terraform for managing your infrastructure as code, it is important to know when the current state of your infrastructure is different to the infrastructure you have specified in your repository.

Here is Hashicorp’s article on Terraform drift to explain in more detail: https://www.hashicorp.com/blog/detecting-and-managing-drift-with-terraform

In this article I’m going to be covering how to use a scheduled GitHub actions workflow to detect when this “drift” has occurred and send a message to a Slack channel…