StackGuardian / StackGuardian/tirith

feat(terraform_plan): filter `count` by change action

Open Beginner friendly
#299 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
165
Forks
42
Avg merge
1d 3h
Merged PRs (30d)
11

Description

count matches on terraform_resource_type only, and Terraform includes unchanged resources in
resource_changes as no-op entries — so count(*) returns the size of the root module, not the
size of the change. A representative plan with 240 entries of which 238 are no-ops counts 240 while
the blast radius is 2. Related: #230.

Fix. Optional actions list in provider_args; skip entries whose change.actions do not
intersect it (~15 lines in the count branch). Unlocks the blast-radius rule
(actions: ["delete"] + LessThanEqualTo: 2) as one policy — a pattern hand-rolled with
jq and shell in many pipelines today, and hard to express per-resource.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the count evaluation branch and its provider_args handling; trace how resource_changes entries are counted, using the representative plan described in the issue. Done means an optional actions filter counts only entries whose change.actions intersects the requested list, while existing count behavior remains unchanged when actions is omitted.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, terraform
Domain
devops, infrastructure
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.