Skip to main content

Drift Detection

Drift detection compares your Infrastructure-as-Code definitions against the live state of your AWS resources. When the two diverge — for example, someone changes a resource manually in the AWS console — frugally.app flags it as drift and alerts your team.


What drift is

Drift occurs when the actual state of an AWS resource no longer matches what your IaC code defines. Common causes:

CauseExample
Manual console changeSomeone changes an instance type in the AWS console without updating Terraform
Emergency fixA security group rule is added manually during an incident and never back-ported to code
Automation outside IaCA Lambda function is updated by a CI/CD pipeline that does not go through the IaC workflow
AWS auto-scalingAuto Scaling changes desired capacity, which differs from the IaC-defined value

How drift detection works

  1. frugally.app reads your IaC definitions from the connected GitHub repositories
  2. It queries the live state of the corresponding AWS resources via your Connections
  3. It compares the two and identifies differences
  4. Drift is reported as alerts with severity levels

Drift detection frequency

ModeHow it works
ScheduledRuns automatically on a configurable schedule (default: daily at 6 AM UTC)
On-demandTriggered manually from Settings > GitHub > Run Drift Detection
Post-mergeRuns automatically after a PR containing IaC changes is merged

Configure the schedule at Settings > GitHub > Drift Detection.


Drift alerts

When drift is detected, frugally.app creates an alert with:

FieldDescription
ResourceThe AWS resource that has drifted
IaC definitionWhat the code says the resource should look like
Live stateWhat the resource actually looks like in AWS
DiffA side-by-side comparison of the differences
SeverityBased on the type and impact of the drift
RepositoryWhich IaC repository defines the resource
FileThe specific file and line number

Severity levels

SeverityCriteria
CriticalSecurity-related drift (e.g. security group rules changed, encryption disabled)
HighCost-impacting drift (e.g. instance type upgraded, additional resources created)
MediumConfiguration drift that may affect behaviour (e.g. environment variables changed)
LowCosmetic drift (e.g. tags changed, descriptions updated)

Alert delivery

Drift alerts are delivered through:

ChannelConfiguration
In-appAlways enabled — alerts appear in the dashboard under Guard
SlackPosted to the configured Guard channel
GitHubPosted as an issue or PR comment in the affected repository
EmailBased on user notification preferences

Remediation options

When drift is detected, you can:

ActionDescription
Update IaCModify your code to match the live state (accept the manual change)
Revert in AWSChange the AWS resource back to match the IaC definition
Create a Guard ProjectPropose a formal change through the approval workflow
DismissMark the drift as accepted with a reason (e.g. "Expected — auto-scaling behaviour")

Configuring drift detection

Navigate to Settings > GitHub > Drift Detection:

SettingDescription
ScheduleHow often drift detection runs (hourly, daily, weekly, custom CRON)
RepositoriesWhich repositories to include in drift detection
Resource typesWhich AWS resource types to check (default: all)
ExclusionsSpecific resources or attributes to exclude (e.g. auto-scaling desired capacity)
Severity thresholdsMinimum severity to create alerts
tip

Exclude attributes that change frequently by design (like Auto Scaling desired capacity or ECS running task count) to reduce noise. Focus drift detection on attributes that should only change through code.


Drift detection and frugally.app Automate

frugally.app Automate actions (stopping, starting, scaling resources) are not flagged as drift by default. frugally.app recognises its own actions and excludes them from drift comparisons. If you want to include Automate-caused state changes in drift detection, enable this in Settings > GitHub > Drift Detection > Include Automate actions.