Repository navigation
fix(E2529): count subscription filters per condition scenario - #4917
Merged
kddejong merged 1 commit intoNov 2, 2026
Merged
Conversation
Contributor
Author
|
Hi maintainers, this is a first-time contribution from an external contributor, so the workflow runs are waiting on approval. The fix is ready for review whenever you have a chance to approve the workflows. Thanks! |
kddejong
approved these changes
Nov 2, 2026
E2529 counted every SubscriptionFilter on a log group together, even when their Conditions made them mutually exclusive. A template with 3 IsProd and 3 IsDev filters on one log group was reported as exceeding the 5 filter limit, although at most 3 filters can exist in any deployment. Count filters per satisfiable condition scenario using the existing condition solver, and report only when the largest scenario exceeds the limit. Unconditional filters count in every scenario, SAM CloudWatchLogs events inherit their function's Condition, and templates with unresolvable Conditions fall back to the previous flat count so the rule never goes silent. Fixes aws-cloudformation#4845 Signed-off-by: Varshith Puli <pulivarshit@gmail.com>
kddejong
force-pushed
the
fix-4845-e2529-conditions
branch
from
November 2, 2026 17:42
e7c88cd to
fc742f6
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4917 +/- ##
==========================================
- Coverage 94.75% 94.73% -0.02%
==========================================
Files 442 442
Lines 16105 16130 +25
Branches 3125 3133 +8
==========================================
+ Hits 15260 15281 +21
- Misses 466 469 +3
- Partials 379 380 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4845
What was wrong
E2529 counted every
AWS::Logs::SubscriptionFilteron a log group together, ignoring each resource'sCondition. A template with 3 filters underIsProdand 3 underIsDev(whereIsDevisFn::NotofIsProd) was reported as exceeding the 5 filter limit, although at most 3 filters can exist in any deployment. CloudFormation itself deploys such a template cleanly.What the fix does
E2529 now counts filters per satisfiable condition scenario, using the existing condition solver:
Conditioncount in every scenario.Conditioncount only in scenarios where that condition is true, so mutually exclusive filters are never counted together.CloudWatchLogsevents inherit theConditionof their function.Test evidence
Conditions counted together against the 5-per-log-group limit #4845 (3IsProd+ 3IsDevfilters): 1 finding before the fix, 0 after.test/unit/rules/resources/lmbd/test_events_log_group_name.py(mutually exclusive conditions, same-condition over limit, unconditional plus conditional over limit, SAM events under mutually exclusive function conditions).test/unit/rules/resources/lmbd/test_events_log_group_name.py: 19 passed.test/unit/rules/resources/lmbd/: 217 passed.ruff checkandruff formatclean on the changed files.