Aws/cfn Diagnostics
Read-only diagnostics for failed or rolled-back CloudFormation stack operations. Pulls stack event history, separates root-cause failures from cancellation cascades and rollback blockers, follows nested stacks, and looks up the CloudTrail API calls behind a failure (AccessDenied, ExpiredToken, and similar).
Authentication
Uses the default AWS credential chain. Set the optional profile global argument to
resolve credentials from a named AWS shared-config profile (SSO token cache / fromIni),
enabling multi-account use within a single swamp repo. Only Describe*, List* and
LookupEvents calls are made, so a read-only profile is sufficient.
Required IAM Permissions
cloudformation:ListStackscloudformation:DescribeStackscloudformation:DescribeStackEventscloudformation:ListStackResourcescloudtrail:LookupEvents
Usage
swamp model create @webframp/aws/cfn-diagnostics cfn-prod \
--global-arg region=us-east-1 --global-arg profile=prod-account
# Find the stack
swamp model method run cfn-prod list_stacks --input nameContains=my-app
# What failed, and which failure is the root cause?
swamp model method run cfn-prod list_stack_events \
--input stackName=my-app --input since=7d
# Which API call was denied, and as which principal?
swamp model method run cfn-prod lookup_events \
--input startTime=2026-10-09T18:00:00Z --input endTime=2026-10-09T18:15:00Z \
--input lookupAttribute=EventSource --input lookupValue=rds.amazonaws.comMethods
- list_stacks - List stacks, optionally filtered by name substring and status
- describe_stack - Stack status, parameters, tags, and every resource's state
- list_stack_events - Events in a time window with failed events, root-cause candidates, and rollback blockers extracted; follows nested stacks
- lookup_events - CloudTrail LookupEvents (management events, last 90 days) with principal extraction and an error roll-up
2026.10.14.1
Added: The manifest now declares license: Apache-2.0 (SPDX). The registry quality rubric scores a declared license separately from the bundled LICENSE.md.
Upgrade note: Metadata only. No code, schema, or behavioral changes.
2026.10.13.1
Added: Initial release. Read-only CloudFormation failure diagnostics:
list_stacks, describe_stack, list_stack_events (failed events,
root-cause candidates, rollback blockers, nested-stack follow), and
lookup_events (CloudTrail LookupEvents with principal extraction and an error
roll-up).
| Argument | Type | Description |
|---|---|---|
| nameContains? | string | Case-insensitive substring of the stack name |
| includeDeleted? | boolean | Include DELETE_COMPLETE stacks (kept by CloudFormation for 90 days). |
| Argument | Type | Description |
|---|---|---|
| stackName | string | Stack name or full stack ARN (required for deleted stacks) |
| Argument | Type | Description |
|---|---|---|
| stackName | string | Stack name or full stack ARN (ARN required for deleted stacks) |
| since? | string | Window start (ISO date or relative: 30m, 6h, 2d) |
| followNested? | boolean | Also fetch events for nested AWS::CloudFormation::Stack resources |
| Argument | Type | Description |
|---|---|---|
| startTime? | string | Window start (ISO date or relative: 30m, 6h, 2d) |
| endTime? | string | Window end (default now) |
| lookupValue? | string | Value for lookupAttribute |
| errorsOnly? | boolean | Keep only events carrying an errorCode (client-side filter) |
| eventSource? | string | Client-side filter, e.g. rds.amazonaws.com (useful alongside a server-side filter) |
| maxEvents? | number | Maximum matching events to keep |
Resources
2026.10.13.1
Added: Initial release. Read-only CloudFormation failure diagnostics:
list_stacks, describe_stack, list_stack_events (failed events,
root-cause candidates, rollback blockers, nested-stack follow), and
lookup_events (CloudTrail LookupEvents with principal extraction and an error
roll-up).
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned