fix(toolkit-lib): warn when hook failure detail can't be fetched - #1950
Merged
aws-cdk-automation merged 2 commits intoSep 7, 2026
Merged
Conversation
Previously, if ListHookResults or GetHookResult failed (e.g. due to a custom deploy role missing cloudformation:ListHookResults), the failure was only logged at debug level and silently swallowed, leaving users with a generic error and no indication that more detail might exist. Both paths now always warn at normal verbosity with a short, friendly message pointing users to `-v` for the full underlying error, instead of special-casing specific error types or IAM actions. Fixes #1923
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
rix0rrr
approved these changes
Sep 7, 2026
aws-cdk-automation
deleted the
mrgrain/fix/toolkit-lib/warn-on-hook-detail-fetch-failure
branch
September 7, 2026 14:52
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 #1923
If your deploy role doesn't have
cloudformation:ListHookResults/cloudformation:GetHookResult(common for custom CDK Pipelines deploy roles or hand-rolled least-privilege roles), a failed CloudFormation Hook used to give you no indication that more detail existed — the lookup failed silently and only showed up in--debuglogs. You'd see the exact same generic message whether the hook truly had nothing more to say, or the CLI just couldn't ask.Before
(No hint that more detail exists. The real reason is buried in
--debugoutput.)After
The warning is attached to the reported error itself and rendered right after the failure message, so you know it's worth investigating instead of assuming the hook had nothing more to say. The full underlying error is available with
-v.This applies both to
ListHookResults(used bycdk deployandcdk diagnoseto find hooks that failed a change set) andGetHookResult(used to fetch a hook's detailed failure reason, e.g. Guard Hook annotations).What was tested
Updated and added unit tests in
stack-diagnoser.test.tsandstack-activity-monitor.test.tscovering the warning being attached on fetch failure. Fulltoolkit-libtest suite (134 suites, 2031 tests) and lint pass.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license