SSM Automation Diagnostics
When to use
Any SSM Automation investigation — execution failures, step errors, document creation, versioning, approval workflows, rate control, cross-account automation, multi-region execution, change calendar integration, maintenance window automation, custom actions, output parameters, or service role configuration.
Investigation workflow
Step 1 — Collect and triage
aws ssm describe-automation-executions --filters Key=ExecutionStatus,Values=Failed --max-results 10
aws ssm list-documents --document-filter-list key=DocumentType,value=Automation --max-results 20
aws ssm describe-maintenance-windows --filters "Key=Enabled,Values=true"
Step 2 — Domain deep dive
aws ssm get-automation-execution --automation-execution-id <execution-id>
aws ssm describe-automation-step-executions --automation-execution-id <execution-id>
aws ssm describe-document --name <document-name> --document-version '$LATEST'
Step 3 — Detailed investigation
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventSource,AttributeValue=ssm.amazonaws.com --max-results 20
aws ssm get-calendar-state --calendar-names <calendar-name>
aws iam get-role --role-name <automation-role-name>
Read references/guardrails.md before concluding on any SSM Automation issue.
Tool quick reference
| Tool / API |
When to use |
ssm describe-automation-executions |
List automation executions with status |
ssm get-automation-execution |
Get execution details and step outputs |
ssm describe-automation-step-executions |
Get individual step details |
ssm describe-document |
Get document schema and parameters |
ssm list-document-versions |
List document versions |
ssm get-calendar-state |
Check change calendar open/closed state |
ssm describe-maintenance-windows |
List maintenance windows |
Gotchas: SSM Automation
- Automation documents have TWO execution modes: Simple (sequential steps) and Rate Control (concurrent targets). Rate control requires MaxConcurrency and MaxErrors parameters.
- Cross-account automation requires a management account or delegated admin in Organizations, plus target account IAM roles with proper trust policies.
- Change Calendar integration blocks automation execution when the calendar is CLOSED. Automations fail with CalendarStateIsClosedException, not a permissions error.
- Approval steps have a configurable timeout (default 7 days). If no approver acts, the execution times out — it does NOT auto-approve or auto-reject.
- Output parameters from one step are referenced as
{{stepName.outputKey}} in subsequent steps. Incorrect references cause silent failures with empty values, not errors.
- Service roles for automation need both ssm:* permissions AND permissions for the actions the document performs (ec2, s3, lambda, etc.).
- Document versioning uses $DEFAULT and $LATEST. Executions use $DEFAULT unless explicitly specified. Updating a document does NOT change $DEFAULT automatically.
Anti-hallucination rules
- Always cite specific execution IDs, step names, or API responses as evidence.
- Simple execution vs Rate Control execution have different failure modes. Never conflate them.
- Cross-account automation requires Organizations setup. Never suggest it works with standalone accounts.
- Change Calendar blocks executions, it does NOT modify them. Never claim calendars alter automation behavior.
- Spend no more than 2 minutes on any single hypothesis. Pivot if inconclusive.
14 runbooks
| Category |
IDs |
Covers |
| A — Execution |
A1-A2 |
Automation execution failures, step execution errors |
| B — Documents |
B1-B2 |
Document creation issues, document versioning |
| C — Workflows |
C1-C2 |
Approval workflow failures, rate control issues |
| D — Multi-Scope |
D1-D2 |
Cross-account automation, multi-region execution |
| E — Scheduling |
E1-E2 |
Change calendar integration, maintenance window automation |
| F — Advanced |
F1-F2 |
Custom action errors, output parameter issues |
| G — IAM |
G1 |
Automation service role |
| Z — Catch-All |
Z1 |
General troubleshooting |
1---2name: ssm-automation-diagnostics3description: Use this skill to investigate and troubleshoot AWS Systems Manager Automation problems by analyzing automation execution failures, step errors, document creation, versioning, approval workflows, rate control, cross-account automation, multi-region execution, change calendar integration, maintenance windows, custom actions, output parameters, and service roles. Activate when: automation execution failures, step execution errors, document creation issues, approval workflow failures, rate control problems, cross-account automation errors, multi-region execution issues, change calendar blocks, maintenance window automation failures, custom action errors, output parameter issues, service role problems, or the user says something is wrong with SSM Automation.4---56# SSM Automation Diagnostics78## When to use910Any SSM Automation investigation — execution failures, step errors, document creation, versioning, approval workflows, rate control, cross-account automation, multi-region execution, change calendar integration, maintenance window automation, custom actions, output parameters, or service role configuration.1112## Investigation workflow1314### Step 1 — Collect and triage1516```17aws ssm describe-automation-executions --filters Key=ExecutionStatus,Values=Failed --max-results 1018aws ssm list-documents --document-filter-list key=DocumentType,value=Automation --max-results 2019aws ssm describe-maintenance-windows --filters "Key=Enabled,Values=true"20```2122### Step 2 — Domain deep dive2324```25aws ssm get-automation-execution --automation-execution-id <execution-id>26aws ssm describe-automation-step-executions --automation-execution-id <execution-id>27aws ssm describe-document --name <document-name> --document-version '$LATEST'28```2930### Step 3 — Detailed investigation3132```33aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventSource,AttributeValue=ssm.amazonaws.com --max-results 2034aws ssm get-calendar-state --calendar-names <calendar-name>35aws iam get-role --role-name <automation-role-name>36```3738Read `references/guardrails.md` before concluding on any SSM Automation issue.3940## Tool quick reference4142| Tool / API | When to use |43|------------|-------------|44| `ssm describe-automation-executions` | List automation executions with status |45| `ssm get-automation-execution` | Get execution details and step outputs |46| `ssm describe-automation-step-executions` | Get individual step details |47| `ssm describe-document` | Get document schema and parameters |48| `ssm list-document-versions` | List document versions |49| `ssm get-calendar-state` | Check change calendar open/closed state |50| `ssm describe-maintenance-windows` | List maintenance windows |5152## Gotchas: SSM Automation5354- Automation documents have TWO execution modes: Simple (sequential steps) and Rate Control (concurrent targets). Rate control requires MaxConcurrency and MaxErrors parameters.55- Cross-account automation requires a management account or delegated admin in Organizations, plus target account IAM roles with proper trust policies.56- Change Calendar integration blocks automation execution when the calendar is CLOSED. Automations fail with CalendarStateIsClosedException, not a permissions error.57- Approval steps have a configurable timeout (default 7 days). If no approver acts, the execution times out — it does NOT auto-approve or auto-reject.58- Output parameters from one step are referenced as `{{stepName.outputKey}}` in subsequent steps. Incorrect references cause silent failures with empty values, not errors.59- Service roles for automation need both ssm:* permissions AND permissions for the actions the document performs (ec2, s3, lambda, etc.).60- Document versioning uses $DEFAULT and $LATEST. Executions use $DEFAULT unless explicitly specified. Updating a document does NOT change $DEFAULT automatically.6162## Anti-hallucination rules63641. Always cite specific execution IDs, step names, or API responses as evidence.652. Simple execution vs Rate Control execution have different failure modes. Never conflate them.663. Cross-account automation requires Organizations setup. Never suggest it works with standalone accounts.674. Change Calendar blocks executions, it does NOT modify them. Never claim calendars alter automation behavior.685. Spend no more than 2 minutes on any single hypothesis. Pivot if inconclusive.6970## 14 runbooks7172| Category | IDs | Covers |73|----------|-----|--------|74| A — Execution | A1-A2 | Automation execution failures, step execution errors |75| B — Documents | B1-B2 | Document creation issues, document versioning |76| C — Workflows | C1-C2 | Approval workflow failures, rate control issues |77| D — Multi-Scope | D1-D2 | Cross-account automation, multi-region execution |78| E — Scheduling | E1-E2 | Change calendar integration, maintenance window automation |79| F — Advanced | F1-F2 | Custom action errors, output parameter issues |80| G — IAM | G1 | Automation service role |81| Z — Catch-All | Z1 | General troubleshooting |