Repository navigation
Conversation
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
evaluateTemplateBestEffort evaluates every expression in a template's Resources and Outputs with EvaluateCloudFormationTemplate, one expression at a time, and reports the ones it can't evaluate instead of failing: - evaluates Conditions (Fn::Equals, And, Or, Not, Condition), Fn::If and AWS::NoValue, and drops resources and outputs whose condition is false - reports only the innermost failure, and unsupported functions themselves - reports expressions that use unavailable (e.g. NoEcho) parameters, and dynamic references - evaluates each distinct expression once, and looks up the reachable attributes up front, a few at a time - only evaluation failures are reported; other errors (expired credentials, throttling) are thrown Not used yet: the unstable evaluate action builds on it.
iankhou
force-pushed
the
feat/toolkit-lib-best-effort-evaluation
branch
from
October 21, 2026 17:06
ba082b7 to
6442e21
Compare
This branch had an error being deployed
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.
Reason for this change
Second of three stacked PRs that add an unstable
evaluateaction to toolkit-lib (#2066).EvaluateCloudFormationTemplateevaluates one expression and throws on the first failure. The action needs a whole template evaluated, with
every expression that can be evaluated replaced by its value, and the others reported instead of failing.
Stack:
evaluateactionDescription of changes
Adds
evaluateTemplateBestEffort(evaluator, template, { unavailableParameters }), an internal function inlib/api/cloudformation(no public API). It evaluates every expression inResourcesandOutputs, one at atime, and returns the template with the evaluated values and a list of unresolved expressions
(
{ path, intrinsic, reason }).Conditions(Fn::Equals,Fn::And,Fn::Or,Fn::Not,Condition),Fn::Ifand
AWS::NoValue, whichEvaluateCloudFormationTemplatedoesn't support, and drops resources and outputswhose condition is false, as CloudFormation does.
Fn::Equalscompares scalars as strings, as CloudFormationdoes (a deployed
'10'equals10).the innermost failure is reported, and an unsupported function is reported itself.
{{resolve:...}}), arereported rather than evaluated.
AWS::NoValue, is reportedinstead of dropping the property or leaking the placeholder.
(
Fn::GetAttand${Resource.Attribute}inFn::Sub, only in resources, outputs andFn::Ifbranches thatCloudFormation creates) are run up front, 8 at a time.
can't-read error (
ResourceNotFoundException,TypeNotFoundException,UnsupportedActionException,InvalidRequestException,ValidationException, Cloud Control handler failures,AccessDeniedException).Anything else (expired credentials, throttling, network errors, bugs) is thrown.
Describe any new or updated permissions being added
None.
Description of how you validated changes
Unit tests with a fake evaluator: resolved and unresolved expressions, innermost-failure reporting, conditions,
Fn::IfandAWS::NoValue, NoEcho and dynamic references, error classification (including wrapped causes),caching, the bounded and reachable-only prefetch, and untouched template sections. The full stack (#2066) was
run against three apps deployed to a test account and to an emulator.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license