r/Terraform • • 4d ago

AWS Built a maintained replacement for driftctl: refresh-only drift ranked by severity, plus AWS resources not in any state

0 Upvotes

9 comments sorted by

1

u/dusanodalovic 3d ago

the first false positives i'd expect are things other controllers create for you. in eks the load balancer controller makes albs and security groups from your ingress objects, and none of that sits in any terraform state. same for log groups that lambda creates on its own, and anything that came from a cloudformation stack. is there an ignore by tag option, so people can skip anything with the controller tags or the aws:cloudformation tags? that would save fixing the matching rules one resource type at a time.

1

u/dynamicdiver 4d ago

Nice, I’ve been half-assing drift checks with a shell wrapper around `plan -refresh-only` and then manually grepping for anything that touched security groups. It works until it doesn’t.

The severity ranking idea is clever. Nothing worse than sifting through 80 tag-only diffs to find the one IAM role that changed.

What’s the story on the Cloud Control path for unmanaged resources? I’ve seen it return stale data for a few types. Curious if you ran into issues with EC2 Classic leftovers or default VPC resources getting flagged.

1

u/Mehmet-Ozturk 3d ago

default vpcs are free; orphaned nat gateways are worth flagging.

0

u/[deleted] 3d ago

[removed] — view removed comment

1

u/Mehmet-Ozturk 2d ago

nat idle cost should include the ipv4 charge too.

1

u/MongooseWonderful198 2d ago

A matching case worth adding: two CloudWatch log groups named /app/api in the same region, but different AWS accounts. Supply only account A's state while scanning account B. B's group should stay unmanaged.

Reading _find(), it checks region and then accepts any matching identifier/name token. The state parser retains region but not account, so the shared name appears able to match even when the ARNs disagree.

Could you add that beside the existing different-region test? This is source inspection; I haven't run it against AWS.