tf-drift

Terraform Config Selection

Problem and Goal

tf-drift scans every discovered Terraform layer after -dir, -env, and -layer filtering. Users need one more narrowing step: interactive users should be able to tick the detected configs they want to check, and CI users should be able to include or exclude configs with flags.

Scope

Add selection in two surfaces:

Selection applies before the worker pool starts. The existing scanning, reporting, exit-code, and detail-inspector behavior stays unchanged once the selected list is built.

Workflow

The diagram shows selection as a shared step between discovery and scanning.

Config selection flow

Interaction Contract

The interactive picker defaults every discovered config to selected. Keyboard controls:

If the user presses enter with no configs selected, the picker stays open and shows Select at least one config.

CLI Contract

-include and -exclude accept comma-separated patterns. Patterns match config base names, relative suffixes, and slash-separated path suffixes. Include runs first, then exclude.

Examples:

tf-drift -dir examples -non-interactive -include "clean-empty,drift-*"
tf-drift -dir examples -non-interactive -exclude "error-*"

Acceptance Criteria

Test Plan