Agent skill · software engineering · jeremylongshore

detecting-infrastructure-drift

Execute use when detecting infrastructure drift from desired state.

Why this skill is useful

Adds specific commands and workflows for detecting infrastructure drift using Terraform and other IaC tools that the AI wouldn't reliably generate on its own.

What it needs

Requires aws-cli, pulumi, terraform installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Detecting Infrastructure Drift Current State !ls .tf Dockerfile docker-compose.yml 2>/dev/null echo 'No IaC files found' !terraform version 2>/dev/null echo 'Terraform not installed' Overview Detect discrepancies between actual cloud infrastructure state and the desired state defined in IaC (Terraform, CloudFormation, Pulumi). Run drift detection commands, analyze modified/added/deleted resources, generate drift reports with affected resources, and provide remediation steps to bring infrastructure back into compliance. Prerequisites IaC configuration files up to date in the project directory Cloud provider CLI installed and authenticated with read access to all managed resources IaC tool installed: Terraform 1.0+, AWS CLI (for CloudFormation drift), or Pulumi Remote state storage accessible and current (S3 backend, Terraform Cloud, Pulumi Cloud) Read-only IAM permissions for all resource types managed by IaC Instructions 1. Identify the IaC tool in use by scanning for .tf files, template.yaml, or Pulumi.yaml 2. Initialize the IaC tool if needed: terraform init to download providers and configure backend 3. Run drift detection: terraform plan -detailed-exitcode (exit code 2 = drift detected), aws cloudformation detect-stack-drift, or pulumi preview 4. Parse the output to identify resources with drift: added (exists in cloud but not in IaC), modified (attributes changed), or deleted (in IaC but missing from cloud) 5. For each drifted resource, determine if the drift is intentional (manual hotfix) or unintentional (configuration error, unauthorized change) 6. Generate a structured drift report with resource identifiers, attribute differences, and severity classification 7. Provide remediation options per resource: terraform apply to enforce desired state, terraform import to adopt changes, or update IaC to match reality 8. Schedule recurring drift detection: configure a cron job or CI pipeline to run daily and alert on drift 9. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/detecting-infrastructure-drift--7e2ee6

View the source on GitHub

Browse the @skills marketplace