Repository navigation
Conversation
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.
Summary
A value with N independent
Fn::Ifconditions made the core enumerate all 2^N deployment scenarios as deep copies, retain several copies for the validation, and run a solver query per copy. An S3 bucket with 16 optional tags used 1.8 GB. CloudFormation places no limit on conditions, so lowering a count limit is not a valid fix. This change makes the cost polynomial in the number of independent conditions, in shared layers used by both engines.Independent conditions no longer multiply. Consumers now ask only the question they need. Whole-
Propertiesconsumers project to the properties they read before expansion. The schema validator checks property presence andminItems,maxItems, anduniqueItemsfrom member-presence conditions instead of enumerating every list. Cached scenarios are shared behindArcrather than copied on every read.Remaining joint expansions are bounded. Products are enumerated in full up to 4,096 combinations and 2^20 materialized nodes. Larger products use a pairwise-covering set that includes every member alternative and every pair of condition states. Checks that need larger coordinated worlds use dedicated member-presence or projection paths.
YAML expansion is bounded. Nested aliases can multiply a small document into millions of copied nodes. Alias resolution now has a document-wide budget of 2^20 copied nodes, and aliases that would exceed the structural nesting limit are rejected. Both cases return a located parse error instead of exhausting memory.
Performance
Measured with the optimized native CLI; 262 MB is the engine's fixed baseline:
The regression fixtures show the same result with debug builds: a 17-subnet cardinality template exceeded 1.5 GB on
main, while this branch completed in 1.1 s at 264 MB. Other projection fixtures completed 5-27× faster and peaked at 26-72% ofmain's memory.Validation behavior changes
W2530now evaluates every reachableSnapStart.ApplyOnbranch and reports at theApplyOnkey. It is cleared only by anAWS::Lambda::VersionwhoseFunctionNametargets the function in a deployment where both exist. A Version that only depends on or describes the function, exists under an exclusive condition, or targets another function does not count. Unreachable branches do not warn. This intentionally differs from cfn-lint, which accepts any Version that is a graph child and reports warnings on unreachable branches.F3037now finds duplicates in arrays that mix literal andRefitems.Related issue
None.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.