[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ACW4P45B9BYYRRHBDKYMGC":3,"skill-same:01M7ACW4P45B9BYYRRHBDKYMGC":131},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M7ACW4P45B9BYYRRHBDKYMGC","ssm-association-troubleshooter",null,"Diagnoses AWS Systems Manager (SSM) association failures via a systematic 5-symptom decision tree: association status Failed, TimedOut, instance not appearing in SSM (not managed), association never runs (wrong schedule or targets), and document execution fails mid-run. Maps each symptom to root cause via diagnostic commands (describe-instance-information, list-associations, describe-association-executions, describe-association-execution-targets, SSM agent logs), common causes (invalid parameters, document not found, S3 bucket access denied, SSM agent unreachable, instance offline, network connectivity, IAM role missing AmazonSSMManagedInstanceCore, cron expression wrong, tag mismatch, association enabled=False, rate limiting, script error, platform unsupported), and specific fixes. Emits ROOT_CAUSE_FOUND with a fix plan, NEED_MORE_INFO with the next diagnostic, or ESCALATE with the escalation path. Use when an SSM association is failing, timing out, not running, or producing errors.","jhkchan\u002Faws-agent-skills","jhkchan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1083902?v=4","01M7A2SVQYP9GQTPTDXP5JKYQ4","Jacky Chan","01M7A2SVS117YWCTZABB75HZR1",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ssm-association-troubleshooter\ndescription: 'Diagnoses AWS Systems Manager (SSM) association failures via a systematic 5-symptom decision tree: association status Failed, TimedOut, instance not appearing in SSM (not managed), association never runs (wrong schedule or targets), and document execution fails mid-run. Maps each symptom to root cause via diagnostic commands (describe-instance-information, list-associations, describe-association-executions, describe-association-execution-targets, SSM agent logs), common causes (invalid parameters, document not found, S3 bucket access denied, SSM agent unreachable, instance offline, network connectivity, IAM role missing AmazonSSMManagedInstanceCore, cron expression wrong, tag mismatch, association enabled=False, rate limiting, script error, platform unsupported), and specific fixes. Emits ROOT_CAUSE_FOUND with a fix plan, NEED_MORE_INFO with the next diagnostic, or ESCALATE with the escalation path. Use when an SSM association is failing, timing out, not running, or producing errors.'\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline diagnosis. Live- account troubleshooting uses aws ssm describe-instance-information, list-associations, describe-association, describe-association- executions, describe-association-execution-targets, list-association- versions, describe-instance-associations-status, describe-document, describe-activations, list-command-invocations, aws ec2 describe- instances...\nmetadata:\n  domain: aws-cloudops\n  complexity: medium\n  requires_llm: 'true'\n  phase: '2'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Management\n  task_type: troubleshoot\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE\n  when_to_use: 'Diagnosing an SSM association that is failing, timing out, never running, or producing errors mid-execution. Covers the five primary symptom categories: association status Failed, TimedOut, instance not appearing in SSM (unmanaged), association never runs (schedule\u002Ftarget mismatch), document execution fails (script\u002Fpermission\u002Fplatform). Use when an association shows red in the console, an instance is missing from SSM, a patch or inventory run failed, or a custom document run produced errors.'\n  activation_triggers: SSM association failed, association TimedOut, association never runs, association not running, instance not in SSM, instance not managed, SSM agent unreachable, SSM ConnectionLost, association execution failed, document execution fails, patch association failed, inventory association failed, association wrong schedule, association targets wrong, association enabled false, SSM rate limiting, IAM role missing SSM, AmazonSSMManagedInstanceCore, hybrid activation, SSM VPC endpoints\n  invocation_schema: 'Input: either (a) an association-id or association name with observed symptom (Failed \u002F TimedOut \u002F never-runs \u002F document- error \u002F instance-missing), optionally with execution-id, OR (b) live-account diagnostic output from describe-instance- information, describe-association-executions, etc. Output: deterministic DIAGNOSIS block per association — SYMPTOM\u002F ROOT_CAUSE\u002FEVIDENCE\u002FFIX\u002FVERDICT — where VERDICT is ROOT_CAUSE_FOUND (cause identified + fix actionable), NEED_MORE_INFO (specific next diagnostic cited), or ESCALATE (requires AWS Support or out-of-band action).'\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: Systems Manager, SSM, SSM Association, association failed, association TimedOut, association never runs, SSM Agent, PingStatus, ConnectionLost, Inactive, AmazonSSMManagedInstanceCore, association execution, document execution, SSM Document, patch baseline, hybrid activation, SSM VPC endpoints, ssmmesages, ec2messages, cron expression, association targets, instance profile, S3 output bucket, rate limiting\n  tags: ssm, systems-manager, management, troubleshoot, association, agent, diagnostic\n---\n\n# SSM Association Troubleshooter\n\n## Mindset\n\nAn SSM association runs only when three independent layers are healthy —\n**IAM** (instance can talk to SSM), **connectivity** (instance reaches SSM\nendpoints), and **agent** (SSM Agent running and current). Most association\nfailures are one of these three layers masquerading as an association problem.\nDiagnose the layer first, then the association-specific config.\n\n- **The 3-layer health check is the upstream gate.** If the instance is not pinging SSM (ConnectionLost, Inactive, missing from console), no association can run. Diagnose IAM, then connectivity, then agent — in that order.\n- **`describe-association-executions` is the source of truth.** The console shows a status enum; the API returns detailed execution output including per-target results, error messages, and S3 output URIs.\n- **Association status and document execution status are different.** `Success` association status means the document started; it does NOT mean the script inside succeeded. Always cross-reference `describe-association-execution-targets`.\n\n## Quick navigation\n\n| You want to... | Go to |\n|---|---|\n| Run the 3-layer health check first (recommended) | Step 1 |\n| Diagnose association status: Failed | Step 2 |\n| Diagnose association status: TimedOut | Step 3 |\n| Diagnose instance not appearing in SSM | Step 4 |\n| Diagnose association never runs | Step 5 |\n| Diagnose document execution fails mid-run | Step 6 |\n| Map symptom to root cause quickly | Appendix B |\n| Avoid misdiagnosis pitfalls | Anti-Patterns |\n\n## Critical rules at a glance\n\n1. **Run the 3-layer health check FIRST.** Before any association-specific diagnosis, confirm: (1) IAM role has `AmazonSSMManagedInstanceCore`, (2) instance can reach SSM endpoints (`ssm.`, `ec2messages.`, `ssmmessages.`), (3) agent is running and current.\n2. **Use `describe-association-executions`, not the console.** The console aggregates; the API returns per-target detail including the actual error message, S3 output URI, and execution-id.\n3. **Association status `Success` does NOT mean the script succeeded.** A `Success` association status means the document orchestration started; per-target `Failed` is a separate field. Always read `describe-association-execution-targets`.\n4. **Patch `Scan` vs `Install` matters.** An `AWS-ApplyPatchBaseline` association with `Operation=Scan` reports compliance but does NOT install patches. A \"failing\" patch association may simply be running Scan against a non-compliant host.\n5. **Hybrid activations have a different diagnosis path than EC2.** `mi-*` instances are registered via activation code\u002FID; their IAM role comes from the activation, not an EC2 instance profile. Do not run `ec2 describe-instances` for `mi-*`.\n\n## Pre-flight: data requirements\n\n| Input | Source | Why |\n|---|---|---|\n| Association-id or name | Console \u002F `list-associations` | Drives `describe-association-executions` |\n| Observed symptom | Console status \u002F alert | Routes to the right diagnostic branch |\n| Instance-id(s) | Console \u002F association targets | Needed for `describe-instance-information` |\n| Region | Console | Required for all CLI calls |\n| Execution-id (if available) | Console \u002F API | For per-target drill-down |\n| Recent CLI output (if any) | `describe-instance-information`, etc. | Speeds up diagnosis |\n| SSM agent log excerpt (if any) | `\u002Fvar\u002Flog\u002Famazon\u002Fssm\u002Famazon-ssm-agent.log` | For agent-side errors |\n\n**If the input is malformed** (no association-id, no instance-id, ambiguous\nsymptom), emit:\n\n```text\nDIAGNOSIS: \u003Creference>\nSYMPTOM: unknown\nVERDICT: NEED_MORE_INFO\nGAP: Cannot start diagnosis — required inputs missing.\n     Re-supply: association-id or name, the observed symptom\n     (Failed \u002F TimedOut \u002F never-runs \u002F document-error \u002F instance-missing),\n     and at least one instance-id or target.\n```\n\n## Process — Diagnostic decision tree (apply in order)\n\n### Step 0: Expert knowledge — non-obvious SSM behaviors\n\n- **`describe-instance-information` only shows instances SSM already knows about.** A freshly launched EC2 instance with no IAM profile will NOT appear. Diff `ec2 describe-instances` (full set) against `ssm describe-instance-information` (managed subset) to find coverage gaps.\n- **`PingStatus: Active` is heartbeat, not health.** Active only means the agent pinged SSM in the last ~5 minutes. Does NOT mean associations are running or the document can execute. Always pair with `LastPingDateTime`.\n- **Association `Status` is orchestration status, not document result.** `Status: Success` means SSM started the document. Per-target `Status: Failed` (in `describe-association-execution-targets`) is where the script error lives.\n- **`AWS-ApplyPatchBaseline` has two Operations: `Scan` and `Install`.** `Scan` records compliance but does not patch. A \"failing\" patch association may be a `Scan` correctly reporting NON_COMPLIANT.\n- **`Patch Group` is a TAG, not an association property.** Case-sensitive tag key `Patch Group` (with space, capital G) links instance to baseline. Without it, instance uses default regional baseline silently.\n- **`AmazonSSMManagedInstanceCore` is the modern role policy.** The deprecated `AmazonEC2RoleforSSM` lacks `ssmmessages:*` (Session Manager). A \"managed\" instance on legacy policy may run associations but cannot run Session Manager.\n- **Hybrid activation `mi-*` instances use the activation role, not an EC2 profile.** Different remediation path than EC2.\n- **Three VPC endpoints required for fully-private SSM:** `ssm`, `ssmmessages`, `ec2messages`. Missing any one produces `ConnectionLost` even with correct IAM and healthy agent.\n- **SSM enforces per-instance command concurrency limit (default 1).** A second concurrent command returns `InvalidInstanceId` or `TargetNotConnected`. Diagnose as transient back-off, not coverage failure.\n- **`AWS-UpdateSSMAgent` is the auto-update association.** Without it, agent only updates on instance stop\u002Fstart or manual command. Missing it is root cause of most `IsLatestVersion: false` findings.\n- **`scheduleExpression` uses `rate()` or `cron()`.** SSM uses AWS cron syntax requiring `?` in either day-of-month or day-of-week. `cron(0 2 * * *)` is INVALID; use `cron(0 2 * * ? *)`.\n- **Targets are evaluated at execution time, not creation time.** Tag-based targets match whatever currently has the tag — retagging mid-run changes the target set silently.\n- **Document parameters are validated at execution time.** A reference to a deleted parameter (e.g., an S3 bucket that no longer exists) produces `Failed` only when the association runs — not at creation.\n- **Association versions are immutable; SSM keeps up to 99.** To \"revert,\" update the document-version reference or recreate with old parameters.\n\n### Step 1: The 3-layer SSM health check (run FIRST)\n\nBefore any association-specific diagnosis, confirm all three layers. A\nfailing layer invalidates all downstream diagnosis.\n\n**Layer 1 — IAM (instance profile has AmazonSSMManagedInstanceCore):**\n\n```bash\naws ec2 describe-instances --instance-ids \u003Cinstance-id> \\\n  --query 'Reservations[*].Instances[*].IamInstanceProfile.Arn' --output text\naws iam list-attached-role-policies --role-name \u003Crole-name> --output text\n```\n\nFor hybrid `mi-*` instances, check the activation role:\n```bash\naws ssm describe-instance-information \\\n  --instance-information-filter-list Key=InstanceIds,ValueSet=\u003Cmi-id> \\\n  --query 'InstanceInformationList[*].IamRoleARN' --output text\naws ssm describe-activations --filters Key=RegistrationStatus,Values=Registered\n```\n\n**Layer 2 — Connectivity (instance can reach SSM endpoints):**\n\nFor private-subnet instances, confirm the three required VPC endpoints:\n```bash\naws ec2 describe-vpc-endpoints \\\n  --filters Name=vpc-id,Values=\u003Cvpc-id> \\\n  Name=service-name,Values=com.amazonaws.\u003Cregion>.ssm,com.amazonaws.\u003Cregion>.ssmmessages,com.amazonaws.\u003Cregion>.ec2messages \\\n  --query 'VpcEndpoints[*].[ServiceName,State]' --output table\n```\n\n**Layer 3 — Agent (running and current):**\n\n```bash\naws ssm describe-instance-information \\\n  --instance-information-filter-list Key=InstanceIds,ValueSet=\u003Cinstance-id> \\\n  --query 'InstanceInformationList[*].[PingStatus,LastPingDateTime,AgentVersion,IsLatestVersion,PlatformType]' --output table\n```\n\nFlags: `ConnectionLost`\u002F`Inactive` = Layer 1 or 2 failure. `IsLatestVersion: false` = agent out of date. `LastPingDateTime` > 1 hour = flapping agent.\n\n**If any layer fails, fix the layer FIRST.** Most association failures\nresolve when coverage is restored. Specifically:\n- Layer 1 fails → attach `AmazonSSMManagedInstanceCore` to instance profile (EC2) or re-activate with new role (`mi-*`).\n- Layer 2 fails → deploy VPC endpoints or fix security group outbound.\n- Layer 3 fails → restart agent or update via `AWS-UpdateSSMAgent`.\n\n**On-host agent status** (if instance is reachable via SSH\u002FSSM):\n```bash\n# Linux\nsystemctl status amazon-ssm-agent\nsudo ssm-cli get-agent-connection-status --region \u003Cregion>\n# Windows\nGet-Service AmazonSSMAgent\n```\n\n### Step 2: Diagnose association status: Failed\n\n**Symptom:** association `Status: Failed`.\n\n```bash\naws ssm describe-association-executions --association-id \u003Cassociation-id> \\\n  --query 'Executions[0].[ExecutionId,Status,StatusMessage,ExecutionTime]' --output table\naws ssm describe-association-execution-targets --association-id \u003Cassociation-id> \\\n  --execution-id \u003Cexecution-id> \\\n  --query 'Targets[*].[Status,StatusMessage,ResourceId,OutputSource.S3Url]' --output table\n```\n\nFetch detailed output from S3 if `OutputSource` is configured.\n\n```bash\naws ssm list-association-versions --association-id \u003Cassociation-id> \\\n  --query 'AssociationVersions[*].[Version,Date,CreatedBy]' --output table\n```\n\n| Cause | Diagnostic signal | Fix |\n|---|---|---|\n| Invalid parameters | `StatusMessage: Invalid parameters` | Fix parameters; document schema may have changed |\n| Document not found | `StatusMessage: Document does not exist` | Document deleted or name typo; recreate or fix reference |\n| S3 bucket access denied | `StatusMessage: AccessDenied on s3:PutObject` | Add `s3:PutObject` for output bucket to instance role |\n| Instance profile missing permissions | `StatusMessage: AccessDenied` on target API | Add required action to instance role |\n| Document version drift | `StatusMessage: schema drift` | Pin document-version or update association to match |\n\n**VERDICT:** ROOT_CAUSE_FOUND when StatusMessage + S3 output identifies a\nspecific cause; NEED_MORE_INFO when message is generic and S3 output is\nempty (fetch agent log — Appendix A in references).\n\n### Step 3: Diagnose association status: TimedOut\n\n**Symptom:** association `Status: TimedOut`.\n\nCheck instance reachability NOW (the timeout may be transient): run\n`describe-instance-information` for PingStatus. If `ConnectionLost`\u002F`Inactive`,\nrun the 3-layer check (Step 1). If reachable, check command-level timeout via\n`list-command-invocations`.\n\n```bash\naws ssm list-command-invocations --instance-id \u003Cinstance-id> \\\n  --query 'CommandInvocations[*].[CommandId,Status,StatusDetails]' --output table\n```\n\n| Cause | Diagnostic signal | Fix |\n|---|---|---|\n| SSM Agent unreachable | `PingStatus: ConnectionLost` or `Inactive` | Run 3-layer check; fix IAM, endpoints, or restart agent |\n| Instance offline | `ec2 describe-instances` shows `stopped`\u002F`terminated` | Start or recreate instance |\n| Network connectivity lost | Agent unreachable but EC2 reachable; endpoints missing\u002FSG blocking | Deploy endpoints \u002F fix SG |\n| Script hangs (deadlock, infinite loop) | Instance healthy, agent running, command never completes | Review document script; add `timeoutSeconds` |\n| `ExecutionTimeout` too short | `StatusDetails: Timeout` immediately | Increase document `ExecutionTimeout` |\n\n**VERDICT:** ROOT_CAUSE_FOUND when 3-layer check identifies a specific layer\nfailure or script-hang signal is clear; NEED_MORE_INFO if instance is\nreachable and agent is current (fetch agent log).\n\n### Step 4: Diagnose instance not appearing in SSM (not managed)\n\n**Symptom:** instance missing from SSM console \u002F Fleet Manager \u002F\n`describe-instance-information`.\n\nConfirm the instance exists in EC2 and is running. Check for IAM instance\nprofile, VPC endpoints, and SSM agent status.\n\n```bash\naws ec2 describe-instances --instance-ids \u003Cinstance-id> \\\n  --query 'Reservations[*].Instances[*].[State.Name,LaunchTime,IamInstanceProfile.Arn]' --output table\naws ec2 describe-vpc-endpoints --filters Name=vpc-id,Values=\u003Cvpc-id> \\\n  --query 'VpcEndpoints[?contains(ServiceName,`.ssm.`)].[ServiceName,State]' --output table\n```\n\n| Cause | Diagnostic signal | Fix |\n|---|---|---|\n| No IAM instance profile | `describe-instances` returns empty `IamInstanceProfile.Arn` | Attach profile with `AmazonSSMManagedInstanceCore` |\n| Profile missing `AmazonSSMManagedInstanceCore` | `list-attached-role-policies` does not include it | Attach `AmazonSSMManagedInstanceCore` |\n| Legacy policy only (`AmazonEC2RoleforSSM`) | Role has deprecated policy only | Replace with `AmazonSSMManagedInstanceCore` |\n| Private subnet without VPC endpoints | No `ssm.`, `ssmmessages.`, or `ec2messages.` endpoints | Deploy all three interface endpoints |\n| SSM Agent not installed\u002Frunning | `ssm-cli get-agent-connection-status` fails | Install agent for OS \u002F `systemctl start amazon-ssm-agent` |\n| Hybrid activation expired | `describe-activations` shows `Expired: true` | Create new activation; re-register instance |\n| Instance launched \u003C 5 min ago | Agent has not bootstrapped yet | Wait 5-10 minutes; do not flag as UNMANAGED |\n\n### Step 5: Diagnose association never runs (wrong schedule or targets)\n\n**Symptom:** association exists and is `Enabled` but has no executions.\n\nConfirm association State, targets match current instances, and\nschedule expression syntax is valid (AWS cron with `?` in DOM or DOW).\n\n```bash\naws ssm describe-association --association-id \u003Cassociation-id> \\\n  --query 'AssociationDescription.[Name,State,ScheduleExpression,LastExecutionDate,NextExecutionDate]' --output table\naws ssm describe-association-executions --association-id \u003Cassociation-id> \\\n  --query 'Executions[*].[ExecutionId,Status,ExecutionTime]' --output table\n```\n\n| Cause | Diagnostic signal | Fix |\n|---|---|---|\n| Schedule expression wrong | Malformed `cron()` or `rate()`; both DOM and DOW set (no `?`) | Fix syntax; use `?` in one of DOM\u002FDOW |\n| Targets don't match any instance | Tag key\u002Fvalue mismatch; `Targets` returns empty | Fix tag values or retag instances |\n| Association `State: Disabled` | `State: Disabled` on `describe-association` | `update-association-state` to `Enabled` |\n| Rate-limiting | Many associations on same instance; throttling in CloudTrail | Stagger schedules; reduce concurrency |\n| Targeting wrong instance-id | Typo in `Key=InstanceIds,Values=\u003Cwrong-id>` | Fix target list |\n\n### Step 6: Diagnose document execution fails mid-run\n\n**Symptom:** association orchestration succeeds but per-target `Status: Failed`.\n\n```bash\naws ssm describe-association-execution-targets --association-id \u003Cassociation-id> \\\n  --execution-id \u003Cexecution-id> \\\n  --query 'Targets[*].[Status,StatusMessage,ResourceId,OutputSource.S3Url]' --output table\n# Fetch S3 output (actual script stdout\u002Fstderr)\naws s3 cp \u003Cs3-url> -\n```\n\nIf `OutputSource` is empty, the instance role lacks `s3:PutObject` — verify\nvia `simulate-principal-policy`.\n\n```bash\naws iam simulate-principal-policy --policy-source-arn \u003Cinstance-role-arn> \\\n  --action-names s3:PutObject s3:GetObject \\\n  --resource-arns arn:aws:s3:::\u003Coutput-bucket>\u002F*\naws ssm describe-document --name \u003Cdocument-name> \\\n  --query 'Document.[LatestVersion,DefaultVersion,PlatformTypes]' --output table\n```\n\n| Cause | Diagnostic signal | Fix |\n|---|---|---|\n| Script error (syntax, logic) | `StandardErrorContent` shows error | Fix the document script |\n| Permission denied | `AccessDenied` in script output | Add required action to instance role |\n| Platform unsupported | `PlatformTypes` does not include instance OS | Use different document or extend platform support |\n| Document references missing resource | `ResourceNotFound` in output | Recreate or fix reference |\n| Document version drift | `DefaultVersion` changed; association pinned to old | Update association `DocumentVersion` |\n| Script exceeds `timeoutSeconds` | `StatusDetails: Timeout` mid-execution | Increase timeout or split document |\n| Reboot mid-script (Windows) | Script restarts instance; subsequent steps fail | Split document; use `aws:rebootInstance` explicitly |\n\n**VERDICT:** ROOT_CAUSE_FOUND when S3 output \u002F standard error identifies a\nspecific failure; NEED_MORE_INFO when output is empty (fetch SSM agent log\nfrom the host — see references).\n\n**SSM agent log locations:**\n| OS | Path |\n|---|---|\n| Linux (most) | `\u002Fvar\u002Flog\u002Famazon\u002Fssm\u002Famazon-ssm-agent.log` |\n| Linux (AL2023 \u002F snap) | `\u002Fvar\u002Fsnap\u002Famazon-ssm-agent\u002Fcurrent\u002Famazon-ssm-agent.log` |\n| Windows | `C:\\ProgramData\\Amazon\\SSM\\Logs\\amazon-ssm-agent.log` |\n\n## Output format\n\n```text\nDIAGNOSIS: \u003Creference>\nASSOCIATION: \u003Cassociation-id or name>\nINSTANCE: \u003Cinstance-id or \"multiple-targets\">\nSYMPTOM: Failed | TimedOut | NotManaged | NeverRuns | DocumentError\nROOT_CAUSE: \u003Cspecific cause cited>\nEVIDENCE:\n  - \u003Cdiagnostic signal 1>\n  - \u003Cdiagnostic signal 2>\nLAYER_CHECK:\n  - IAM: \u003CPASS | FAIL — reason>\n  - Connectivity: \u003CPASS | FAIL — reason>\n  - Agent: \u003CPASS | FAIL — reason>\nFIX:\n  - \u003Caction 1 with CLI snippet>\n  - \u003Caction 2 ...>\nVERIFICATION:\n  - \u003Ccommand to confirm fix>\nVERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE\nNEXT_STEP: \u003Cif NEED_MORE_INFO, the specific next diagnostic>\nESCALATION_PATH: \u003Cif ESCALATE, the recommended path>\n```\n\n### Worked example — ROOT_CAUSE_FOUND, Failed association\n\n```text\nDIAGNOSIS: patch-association-prod\nASSOCIATION: 0123456789abcdef0123456789abcdef0123456789abcdef0\nINSTANCE: i-0abc123def456789a\nSYMPTOM: Failed\nROOT_CAUSE: Instance role lacks s3:PutObject on the S3 output bucket;\n            association execution failed writing command output.\nEVIDENCE:\n  - describe-association-executions Status=Failed, StatusMessage=\"AccessDenied on s3:PutObject for arn:aws:s3:::ssm-output-prod\u002F...\"\n  - simulate-principal-policy returned Denied for s3:PutObject on arn:aws:s3:::ssm-output-prod\u002F*\nLAYER_CHECK:\n  - IAM: FAIL — instance role has AmazonSSMManagedInstanceCore but NOT s3:PutObject on ssm-output-prod\n  - Connectivity: PASS — PingStatus Active, agent v3.2.x\n  - Agent: PASS — IsLatestVersion true\nFIX:\n  - Add an inline policy granting s3:PutObject on arn:aws:s3:::ssm-output-prod\u002F*:\n    aws iam put-role-policy --role-name \u003Cinstance-role> --policy-name SsmOutputPut --policy-document '{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":\"s3:PutObject\",\"Resource\":\"arn:aws:s3:::ssm-output-prod\u002F*\"}]}'\n  - Re-run the association:\n    aws ssm start-associations-once --association-ids 0123456789abcdef0123456789abcdef0123456789abcdef0\nVERIFICATION:\n  - aws ssm describe-association-executions --association-id 0123456789abcdef0123456789abcdef0123456789abcdef0 --query 'Executions[0].Status'\n  - Expect: Success\nVERDICT: ROOT_CAUSE_FOUND\nNEXT_STEP: None\nESCALATION_PATH: None\n```\n\n### Worked example — NEED_MORE_INFO, TimedOut\n\n```text\nDIAGNOSIS: nightly-inventory-missing\nASSOCIATION: 1234567890abcdef1234567890abcdef1234567890abcdef1\nINSTANCE: i-0fedcba9876543210\nSYMPTOM: TimedOut\nROOT_CAUSE: Pending diagnosis — instance is reachable (PingStatus Active)\n            and agent is current, but the document hangs mid-execution.\n            Need SSM agent log to identify the hung plugin.\nEVIDENCE:\n  - describe-association-executions Status=TimedOut\n  - describe-instance-information PingStatus=Active, AgentVersion=3.2.1555.0\n  - list-command-invocations StatusDetails=TimedOut (no StatusMessage)\nLAYER_CHECK:\n  - IAM: PASS — AmazonSSMManagedInstanceCore + SSM output bucket access\n  - Connectivity: PASS — PingStatus Active within last 5 min\n  - Agent: PASS — IsLatestVersion true\nFIX: (pending root cause)\nVERIFICATION: (pending fix)\nVERDICT: NEED_MORE_INFO\nNEXT_STEP: Fetch the SSM agent log from the host:\n  aws ssm send-command --instance-ids i-0fedcba9876543210 \\\n    --document-name AWS-RunShellScript \\\n    --parameters commands=[\"tail -n 200 \u002Fvar\u002Flog\u002Famazon\u002Fssm\u002Famazon-ssm-agent.log\"]\n  Then locate the plugin that produced the timeout (look for\n  \"documentname\u002Fgather-software-inventory\" and \"TimeoutExceeded\").\nESCALATION_PATH: If agent log shows no plugin entry, escalate to\n  AWS Support with the execution-id.\n```\n\n### Worked example — ESCALATE, NotManaged with hybrid activation\n\n```text\nDIAGNOSIS: hybrid-edge-device-missing\nASSOCIATION: 234567890abcdef234567890abcdef234567890abcdef2\nINSTANCE: mi-0abc123def456789a\nSYMPTOM: NotManaged\nROOT_CAUSE: Hybrid activation expired (Expired: true). The mi-* instance\n            was registered under this activation; the agent can no longer\n            re-authenticate.\nEVIDENCE:\n  - describe-instance-information returns nothing for mi-0abc123def456789a\n  - describe-activations shows the activation Expired=true (expiry 2026-06-01)\nLAYER_CHECK:\n  - IAM: FAIL — activation role no longer exchangeable\n  - Connectivity: unknown (instance not in SSM)\n  - Agent: unknown (instance not in SSM)\nFIX: Cannot remediate from AWS side alone — the on-prem host must\n  re-register with a new activation code. Requires on-host access.\nVERIFICATION: After re-registration:\n  aws ssm describe-instance-information \\\n    --instance-information-filter-list Key=InstanceIds,ValueSet=mi-0abc123def456789a\n  Expect: PingStatus=Active within 5-10 minutes.\nVERDICT: ESCALATE\nNEXT_STEP: Provide on-prem operator with a new activation code:\n  aws ssm create-activation --iam-role \u003Cactivation-role> \\\n    --registration-limit 1 --expiry-date $(date -u -v+7d +%Y-%m-%d)\nESCALATION_PATH: On-prem \u002F edge-device operator must run on the host:\n  amazon-ssm-agent -register -code \u003Cnew-code> -id \u003Cnew-id> -region \u003Cregion>\n  (requires sudo \u002F admin on the host). Cannot be done from the AWS side.\n```\n\nThis contract is mandatory. The Output format template above is the\nauthoritative structure. Violating any rule is a misdiagnosis.\n\n### Required output structure\n\nEvery diagnosis MUST emit the exact DIAGNOSIS block with all fields\npopulated (no empty fields, no omitted sections, no reordering). All\nthree LAYER_CHECK lines (IAM, Connectivity, Agent) are mandatory —\neven when the failure is association-specific.\n\nVerdict-specific rules:\n- `ROOT_CAUSE_FOUND` → ROOT_CAUSE names a single specific cause; EVIDENCE cites at least one failing API signal; FIX is actionable CLI.\n- `NEED_MORE_INFO` → ROOT_CAUSE is \"Pending diagnosis — \u003Cwhat is known>\"; NEXT_STEP cites the exact next command.\n- `ESCALATE` → ESCALATION_PATH names the recipient and the out-of-band action required.\n\n### FORBIDDEN output patterns\n\n- NEVER diagnose without checking SSM agent status first — the agent must be 'Online' for any association to work. A diagnosis that skips the LAYER_CHECK Agent line is invalid.\n- NEVER confuse association status 'Failed' with instance not being managed — Failed means the document ran but returned non-zero. NotManaged is a different symptom (Step 4).\n- NEVER treat association `Status: Success` as proof the document script succeeded — always read per-target `Status` from `describe-association-execution-targets`.\n- NEVER emit `VERDICT: NEED_MORE_INFO` without a `NEXT_STEP` naming a specific diagnostic command. Generic phrases like \"investigate further\" are not acceptable.\n- NEVER use `ec2 describe-instances` for `mi-*` hybrid instances. They are not EC2 resources; route through `describe-instance-information` and `describe-activations`.\n\n## Anti-Patterns — NEVER do these things\n\n- NEVER diagnose an association without first running the 3-layer health check. Most \"association Failed\" tickets are coverage gaps in IAM, connectivity, or agent.\n- NEVER treat association `Status: Success` as proof that the document script succeeded. Always read `describe-association-execution-targets` for per-target `Status: Failed`.\n- NEVER assume `PingStatus: Active` means the instance is fully healthy. Active is heartbeat (last 5 min), not health. Pair with `LastPingDateTime`.\n- NEVER treat `AWS-ApplyPatchBaseline` `Operation=Scan` as a failure when it reports `NON_COMPLIANT`. Scan records compliance; it does NOT install patches.\n- NEVER recommend `delete-association` as the first remediation. Modify-then-test (`update-association`, `start-associations-once`) preserves targeting and schedule.\n\n## Pre-flight safety checks\n\n- **MANDATORY CONFIRMATION GATE** before any state-changing operation (`update-association`, `start-associations-once`, `delete-association`, `send-command Operation=Install`, `create-activation`).\n- **`start-associations-once` target blast radius:** confirm targets before triggering — tag-based target can hit larger fleet than expected.\n- **`send-command` target blast radius:** always pass `--instance-ids \u003Cid>` (single instance) for diagnostic commands, NEVER `--targets Key=InstanceIds,Values=*`.\n- **Patch Install pre-flight:** verify patch baseline `ApprovalRules` match the intended maintenance window.\n- **Association modification:** snapshot `describe-association --output json` BEFORE `update-association`.\n\n## Appendix A — Symptom-to-cause map (quick reference)\n\n| Symptom | Most common root cause | Verify via |\n|---|---|---|\n| Failed — invalid parameters | Document schema drift \u002F wrong parameter value | `describe-association-executions` StatusMessage |\n| Failed — AccessDenied | Instance role missing required action | `simulate-principal-policy` |\n| Failed — document not found | Document deleted or name typo | `describe-document` |\n| Failed — S3 access denied | Role lacks `s3:PutObject` on output bucket | `simulate-principal-policy` |\n| TimedOut — ConnectionLost | IAM, network, or agent failure | 3-layer health check (Step 1) |\n| TimedOut — script hangs | Document script deadlock or infinite loop | Agent log + `timeoutSeconds` |\n| NotManaged — EC2 | No instance profile \u002F wrong policy | `ec2 describe-instances` + `list-attached-role-policies` |\n| NotManaged — private subnet | VPC endpoints missing | `ec2 describe-vpc-endpoints` |\n| NotManaged — hybrid `mi-*` | Activation expired or quota exhausted | `describe-activations` |\n| NotManaged — fresh launch | Agent still bootstrapping (\u003C 5 min) | `LaunchTime` vs current time |\n| NeverRuns — schedule wrong | Malformed cron (both DOM and DOW set) | `describe-association` ScheduleExpression |\n| NeverRuns — targets empty | Tag key\u002Fvalue mismatch | `ec2 describe-instances --filters` |\n| NeverRuns — Disabled | Association `State: Disabled` | `describe-association` State |\n| DocumentError — script error | Syntax \u002F logic error in document | S3 output or `get-command-invocation` |\n| DocumentError — platform | Document `PlatformTypes` excludes OS | `describe-document` PlatformTypes |\n\n## Recent AWS features (2024-2026)\n\n- **SSM Quick Setup (2024):** Pre-configured baselines (patch policies, Session Manager, inventory) deployable via CloudFormation. Verify Quick Setup-managed resources are not locally overridden when diagnosing drift.\n- **Session Manager port forwarding and SSH proxy (2024-2025):** Enhanced Session Manager with native SSH proxy. Useful for fetching agent logs from instances with no inbound access.\n- **Hybrid Activator (2024):** Streamlined on-prem registration. Verify activation role includes `AmazonSSMManagedInstanceCore`.\n- **Patch baseline enhancements (2024-2025):** Amazon Linux 2023 support, Debian\u002FUbuntu improvements. Verify baseline covers all managed OS types.\n- **SSM Document versioning (2024):** Verify associations reference a specific version (not `$LATEST`) for production stability — `$LATEST` produces silent drift.\n- **Distributor integration (2024-2025):** SSM Distributor can deploy\u002Fupdate agents on hybrid instances. Verify packages are current when diagnosing `IsLatestVersion: false`.\n\n## Domain\n\nAWS CloudOps \u002F Systems Manager Association Diagnostics.\n\n## AWS documentation\n\n- **AWS Systems Manager User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fwhat-is-systems-manager.html\n- **SSM Associations** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fsystems-manager-associations.html\n- **SSM Agent** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fssm-agent.html\n- **SSM Documents** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fdocuments.html\n- **Patch Manager** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fpatch-manager.html\n- **Hybrid Activations** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fmanaged-instances.html\n- **VPC Endpoints for SSM** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fsetup-create-vpc.html\n- **API Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002FAPIReference\u002F\n- **CLI Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fssm\u002F\n- **Troubleshooting SSM Agent** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fssm-agent.html#ssm-agent-troubleshooting\n","# SSM Association Troubleshooter\n\n## Mindset\n\nAn SSM association runs only when three independent layers are healthy —\n**IAM** (instance can talk to SSM), **connectivity** (instance reaches SSM\nendpoints), and **agent** (SSM Agent running and current). Most association\nfailures are one of these three layers masquerading as an association problem.\nDiagnose the layer first, then the association-specific config.\n\n- **The 3-layer health check is the upstream gate.** If the instance is not pinging SSM (ConnectionLost, Inactive, missing from console), no association can run. Diagnose IAM, then connectivity, then agent — in that order.\n- **`describe-association-executions` is the source of truth.** The console shows a status enum; the API returns detailed execution output including per-target results, error messages, and S3 output URIs.\n- **Association status and document execution status are different.** `Success` association status means the document started; it does NOT mean the script inside succeeded. Always cross-reference `describe-association-execution-targets`.\n\n## Quick navigation\n\n| You want to... | Go to |\n|---|---|\n| Run the 3-layer health check first (recommended) | Step 1 |\n| Diagnose association status: Failed | Step 2 |\n| Diagnose association status: TimedOut | Step 3 |\n| Diagnose instance not appearing in SSM | Step 4 |\n| Diagnose association never runs | Step 5 |\n| Diagnose document execution fails mid-run | Step 6 |\n| Map symptom to root cause quickly | Appendix B |\n| Avoid misdiagnosis pitfalls | Anti-Patterns |\n\n## Critical rules at a glance\n\n1. **Run the 3-layer health check FIRST.** Before any association-specific diagnosis, confirm: (1) IAM role has `AmazonSSMManagedInstanceCore`, (2) instance can reach SSM endpoints (`ssm.`, `ec2messages.`, `ssmmessages.`), (3) agent is running and current.\n2. **Use `describe-association-executions`, not the console.** The console aggregates; the API returns per-target detail including the actual error message, S3 output URI, and execution-id.\n3. **Association status `Success` does NOT mean the script succeeded.** A `Success` association status means the document orchestration started; per-target `Failed` is a separate field. Always read `describe-association-execution-targets`.\n4. **Patch `Scan` vs `Install` matters.** An `AWS-ApplyPatchBaseline` association with `Operation=Scan` reports compliance but does NOT install patches. A \"failing\" patch association may simply be running Scan against a non-compliant host.\n5. **Hybrid activations have a different diagnosis path than EC2.** `mi-*` instances are registered via activation code\u002FID; their IAM role comes from the activation, not an EC2 instance profile. Do not run `ec2 describe-instances` for `mi-*`.\n\n## Pre-flight: data requirements\n\n| Input | Source | Why |\n|---|---|---|\n| Association-id or name | Console \u002F `list-associations` | Drives `describe-association-executions` |\n| Observed symptom | Console status \u002F alert | Routes to the right diagnostic branch |\n| Instance-id(s) | Console \u002F association targets | Needed for `describe-instance-information` |\n| Region | Console | Required for all CLI calls |\n| Execution-id (if available) | Console \u002F API | For per-target drill-down |\n| Recent CLI output (if any) | `describe-instance-information`, etc. | Speeds up diagnosis |\n| SSM agent log excerpt (if any) | `\u002Fvar\u002Flog\u002Famazon\u002Fssm\u002Famazon-ssm-agent.log` | For agent-side errors |\n\n**If the input is malformed** (no association-id, no instance-id, ambiguous\nsymptom), emit:\n\n```text\nDIAGNOSIS: \u003Creference>\nSYMPTOM: unknown\nVERDICT: NEED_MORE_INFO\nGAP: Cannot start diagnosis — required inputs missing.\n     Re-supply: association-id or name, the observed symptom\n     (Failed \u002F TimedOut \u002F never-runs \u002F document-error \u002F instance-missing),\n     and at least one instance-id or target.\n```\n\n## Process — Diagnostic decision tree (apply in order)\n\n### Step 0: Expert knowledge — non-obvious SSM behaviors\n\n- **`describe-instance-information` only shows instances SSM already knows about.** A freshly launched EC2 instance with no IAM profile will NOT appear. Diff `ec2 describe-instances` (full set) against `ssm describe-instance-information` (managed subset) to find coverage gaps.\n- **`PingStatus: Active` is heartbeat, not health.** Active only means the agent pinged SSM in the last ~5 minutes. Does NOT mean associations are running or the document can execute. Always pair with `LastPingDateTime`.\n- **Association `Status` is orchestration status, not document result.** `Status: Success` means SSM started the document. Per-target `Status: Failed` (in `describe-association-execution-targets`) is where the script error lives.\n- **`AWS-ApplyPatchBaseline` has two Operations: `Scan` and `Install`.** `Scan` records compliance but does not patch. A \"failing\" patch association may be a `Scan` correctly reporting NON_COMPLIANT.\n- **`Patch Group` is a TAG, not an association property.** Case-sensitive tag key `Patch Group` (with space, capital G) links instance to baseline. Without it, instance uses default regional baseline silently.\n- **`AmazonSSMManagedInstanceCore` is the modern role policy.** The deprecated `AmazonEC2RoleforSSM` lacks `ssmmessages:*` (Session Manager). A \"managed\" instance on legacy policy may run associations but cannot run Session Manager.\n- **Hybrid activation `mi-*` instances use the activation role, not an EC2 profile.** Different remediation path than EC2.\n- **Three VPC endpoints required for fully-private SSM:** `ssm`, `ssmmessages`, `ec2messages`. Missing any one produces `ConnectionLost` even with correct IAM and healthy agent.\n- **SSM enforces per-instance command concurrency limit (default 1).** A second concurrent command returns `InvalidInstanceId` or `TargetNotConnected`. Diagnose as transient back-off, not coverage failure.\n- **`AWS-UpdateSSMAgent` is the auto-update association.** Without it, agent only updates on instance stop\u002Fstart or manual command. Missing it is root cause of most `IsLatestVersion: false` findings.\n- **`scheduleExpression` uses `rate()` or `cron()`.** SSM uses AWS cron syntax requiring `?` in either day-of-month or day-of-week. `cron(0 2 * * *)` is INVALID; use `cron(0 2 * * ? *)`.\n- **Targets are evaluated at execution time, not creation time.** Tag-based targets match whatever currently has the tag — retagging mid-run changes the target set silently.\n- **Document parameters are validated at execution time.** A reference to a deleted parameter (e.g., an S3 bucket that no longer exists) produces `Failed` only when the association runs — not at creation.\n- **Association versions are immutable; SSM keeps up to 99.** To \"revert,\" update the document-version reference or recreate with old parameters.\n\n### Step 1: The 3-layer SSM health check (run FIRST)\n\nBefore any association-specific diagnosis, confirm all three layers. A\nfailing layer invalidates all downstream diagnosis.\n\n**Layer 1 — IAM (instance profile has AmazonSSMManagedInstanceCore):**\n\n```bash\naws ec2 describe-instances --instance-ids \u003Cinstance-id> \\\n  --query 'Reservations[*].Instances[*].IamInstanceProfile.Arn' --output text\naws iam list-attached-role-policies --role-name \u003Crole-name> --output text\n```\n\nFor hybrid `mi-*` instances, check the activation role:\n```bash\naws ssm describe-instance-information \\\n  --instance-information-filter-list Key=InstanceIds,ValueSet=\u003Cmi-id> \\\n  --query 'InstanceInformationList[*].IamRoleARN' --output text\naws ssm describe-activations --filters Key=RegistrationStatus,Values=Registered\n```\n\n**Layer 2 — Connectivity (instance can reach SSM endpoints):**\n\nFor private-subnet instances, confirm the three required VPC endpoints:\n```bash\naws ec2 describe-vpc-endpoints \\\n  --filters Name=vpc-id,Values=\u003Cvpc-id> \\\n  Name=service-name,Values=com.amazonaws.\u003Cregion>.ssm,com.amazonaws.\u003Cregion>.ssmmessages,com.amazonaws.\u003Cregion>.ec2messages \\\n  --query 'VpcEndpoints[*].[ServiceName,State]' --output table\n```\n\n**Layer 3 — Agent (running and current):**\n\n```bash\naws ssm describe-instance-information \\\n  --instance-information-filter-list Key=InstanceIds,ValueSet=\u003Cinstance-id> \\\n  --query 'InstanceInformationList[*].[PingStatus,LastPingDateTime,AgentVersion,IsLatestVersion,PlatformType]' --output table\n```\n\nFlags: `ConnectionLost`\u002F`Inactive` = Layer 1 or 2 failure. `IsLatestVersion: false` = agent out of date. `LastPingDateTime` > 1 hour = flapping agent.\n\n**If any layer fails, fix the layer FIRST.** Most association failures\nresolve when coverage is restored. Specifically:\n- Layer 1 fails → attach `AmazonSSMManagedInstanceCore` to instance profile (EC2) or re-activate with new role (`mi-*`).\n- Layer 2 fails → deploy VPC endpoints or fix security group outbound.\n- Layer 3 fails → restart agent or update via `AWS-UpdateSSMAgent`.\n\n**On-host agent status** (if instance is reachable via SSH\u002FSSM):\n```bash\n# Linux\nsystemctl status amazon-ssm-agent\nsudo ssm-cli get-agent-connection-status --region \u003Cregion>\n# Windows\nGet-Service AmazonSSMAgent\n```\n\n### Step 2: Diagnose association status: Failed\n\n**Symptom:** association `Status: Failed`.\n\n```bash\naws ssm describe-association-executions --association-id \u003Cassociation-id> \\\n  --query 'Executions[0].[ExecutionId,Status,StatusMessage,ExecutionTime]' --output table\naws ssm describe-association-execution-targets --association-id \u003Cassociation-id> \\\n  --execution-id \u003Cexecution-id> \\\n  --query 'Targets[*].[Status,StatusMessage,ResourceId,OutputSource.S3Url]' --output table\n```\n\nFetch detailed output from S3 if `OutputSource` is configured.\n\n```bash\naws ssm list-association-versions --association-id \u003Cassociation-id> \\\n  --query 'AssociationVersions[*].[Version,Date,CreatedBy]' --output table\n```\n\n| Cause | Diagnostic signal | Fix |\n|---|---|---|\n| Invalid parameters | `StatusMessage: Invalid parameters` | Fix parameters; document schema may have changed |\n| Document not found | `StatusMessage: Document does not exist` | Document deleted or name typo; recreate or fix reference |\n| S3 bucket access denied | `StatusMessage: AccessDenied on s3:PutObject` | Add `s3:PutObject` for output bucket to instance role |\n| Instance profile missing permissions | `StatusMessage: AccessDenied` on target API | Add required action to instance role |\n| Document version drift | `StatusMessage: schema drift` | Pin document-version or update association to match |\n\n**VERDICT:** ROOT_CAUSE_FOUND when StatusMessage + S3 output identifies a\nspecific cause; NEED_MORE_INFO when message is generic and S3 output is\nempty (fetch agent log — Appendix A in references).\n\n### Step 3: Diagnose association status: TimedOut\n\n**Symptom:** association `Status: TimedOut`.\n\nCheck instance reachability NOW (the timeout may be transient): run\n`describe-instance-information` for PingStatus. If `ConnectionLost`\u002F`Inactive`,\nrun the 3-layer check (Step 1). If reachable, check command-level timeout via\n`list-command-invocations`.\n\n```bash\naws ssm list-command-invocations --instance-id \u003Cinstance-id> \\\n  --query 'CommandInvocations[*].[CommandId,Status,StatusDetails]' --output table\n```\n\n| Cause | Diagnostic signal | Fix |\n|---|---|---|\n| SSM Agent unreachable | `PingStatus: ConnectionLost` or `Inactive` | Run 3-layer check; fix IAM, endpoints, or restart agent |\n| Instance offline | `ec2 describe-instances` shows `stopped`\u002F`terminated` | Start or recreate instance |\n| Network connectivity lost | Agent unreachable but EC2 reachable; endpoints missing\u002FSG blocking | Deploy endpoints \u002F fix SG |\n| Script hangs (deadlock, infinite loop) | Instance healthy, agent running, command never completes | Review document script; add `timeoutSeconds` |\n| `ExecutionTimeout` too short | `StatusDetails: Timeout` immediately | Increase document `ExecutionTimeout` |\n\n**VERDICT:** ROOT_CAUSE_FOUND when 3-layer check identifies a specific layer\nfailure or script-hang signal is clear; NEED_MORE_INFO if instance is\nreachable and agent is current (fetch agent log).\n\n### Step 4: Diagnose instance not appearing in SSM (not managed)\n\n**Symptom:** instance missing from SSM console \u002F Fleet Manager \u002F\n`describe-instance-information`.\n\nConfirm the instance exists in EC2 and is running. Check for IAM instance\nprofile, VPC endpoints, and SSM agent status.\n\n```bash\naws ec2 describe-instances --instance-ids \u003Cinstance-id> \\\n  --query 'Reservations[*].Instances[*].[State.Name,LaunchTime,IamInstanceProfile.Arn]' --output table\naws ec2 describe-vpc-endpoints --filters Name=vpc-id,Values=\u003Cvpc-id> \\\n  --query 'VpcEndpoints[?contains(ServiceName,`.ssm.`)].[ServiceName,State]' --output table\n```\n\n| Cause | Diagnostic signal | Fix |\n|---|---|---|\n| No IAM instance profile | `describe-instances` returns empty `IamInstanceProfile.Arn` | Attach profile with `AmazonSSMManagedInstanceCore` |\n| Profile missing `AmazonSSMManagedInstanceCore` | `list-attached-role-policies` does not include it | Attach `AmazonSSMManagedInstanceCore` |\n| Legacy policy only (`AmazonEC2RoleforSSM`) | Role has deprecated policy only | Replace with `AmazonSSMManagedInstanceCore` |\n| Private subnet without VPC endpoints | No `ssm.`, `ssmmessages.`, or `ec2messages.` endpoints | Deploy all three interface endpoints |\n| SSM Agent not installed\u002Frunning | `ssm-cli get-agent-connection-status` fails | Install agent for OS \u002F `systemctl start amazon-ssm-agent` |\n| Hybrid activation expired | `describe-activations` shows `Expired: true` | Create new activation; re-register instance |\n| Instance launched \u003C 5 min ago | Agent has not bootstrapped yet | Wait 5-10 minutes; do not flag as UNMANAGED |\n\n### Step 5: Diagnose association never runs (wrong schedule or targets)\n\n**Symptom:** association exists and is `Enabled` but has no executions.\n\nConfirm association State, targets match current instances, and\nschedule expression syntax is valid (AWS cron with `?` in DOM or DOW).\n\n```bash\naws ssm describe-association --association-id \u003Cassociation-id> \\\n  --query 'AssociationDescription.[Name,State,ScheduleExpression,LastExecutionDate,NextExecutionDate]' --output table\naws ssm describe-association-executions --association-id \u003Cassociation-id> \\\n  --query 'Executions[*].[ExecutionId,Status,ExecutionTime]' --output table\n```\n\n| Cause | Diagnostic signal | Fix |\n|---|---|---|\n| Schedule expression wrong | Malformed `cron()` or `rate()`; both DOM and DOW set (no `?`) | Fix syntax; use `?` in one of DOM\u002FDOW |\n| Targets don't match any instance | Tag key\u002Fvalue mismatch; `Targets` returns empty | Fix tag values or retag instances |\n| Association `State: Disabled` | `State: Disabled` on `describe-association` | `update-association-state` to `Enabled` |\n| Rate-limiting | Many associations on same instance; throttling in CloudTrail | Stagger schedules; reduce concurrency |\n| Targeting wrong instance-id | Typo in `Key=InstanceIds,Values=\u003Cwrong-id>` | Fix target list |\n\n### Step 6: Diagnose document execution fails mid-run\n\n**Symptom:** association orchestration succeeds but per-target `Status: Failed`.\n\n```bash\naws ssm describe-association-execution-targets --association-id \u003Cassociation-id> \\\n  --execution-id \u003Cexecution-id> \\\n  --query 'Targets[*].[Status,StatusMessage,ResourceId,OutputSource.S3Url]' --output table\n# Fetch S3 output (actual script stdout\u002Fstderr)\naws s3 cp \u003Cs3-url> -\n```\n\nIf `OutputSource` is empty, the instance role lacks `s3:PutObject` — verify\nvia `simulate-principal-policy`.\n\n```bash\naws iam simulate-principal-policy --policy-source-arn \u003Cinstance-role-arn> \\\n  --action-names s3:PutObject s3:GetObject \\\n  --resource-arns arn:aws:s3:::\u003Coutput-bucket>\u002F*\naws ssm describe-document --name \u003Cdocument-name> \\\n  --query 'Document.[LatestVersion,DefaultVersion,PlatformTypes]' --output table\n```\n\n| Cause | Diagnostic signal | Fix |\n|---|---|---|\n| Script error (syntax, logic) | `StandardErrorContent` shows error | Fix the document script |\n| Permission denied | `AccessDenied` in script output | Add required action to instance role |\n| Platform unsupported | `PlatformTypes` does not include instance OS | Use different document or extend platform support |\n| Document references missing resource | `ResourceNotFound` in output | Recreate or fix reference |\n| Document version drift | `DefaultVersion` changed; association pinned to old | Update association `DocumentVersion` |\n| Script exceeds `timeoutSeconds` | `StatusDetails: Timeout` mid-execution | Increase timeout or split document |\n| Reboot mid-script (Windows) | Script restarts instance; subsequent steps fail | Split document; use `aws:rebootInstance` explicitly |\n\n**VERDICT:** ROOT_CAUSE_FOUND when S3 output \u002F standard error identifies a\nspecific failure; NEED_MORE_INFO when output is empty (fetch SSM agent log\nfrom the host — see references).\n\n**SSM agent log locations:**\n| OS | Path |\n|---|---|\n| Linux (most) | `\u002Fvar\u002Flog\u002Famazon\u002Fssm\u002Famazon-ssm-agent.log` |\n| Linux (AL2023 \u002F snap) | `\u002Fvar\u002Fsnap\u002Famazon-ssm-agent\u002Fcurrent\u002Famazon-ssm-agent.log` |\n| Windows | `C:\\ProgramData\\Amazon\\SSM\\Logs\\amazon-ssm-agent.log` |\n\n## Output format\n\n```text\nDIAGNOSIS: \u003Creference>\nASSOCIATION: \u003Cassociation-id or name>\nINSTANCE: \u003Cinstance-id or \"multiple-targets\">\nSYMPTOM: Failed | TimedOut | NotManaged | NeverRuns | DocumentError\nROOT_CAUSE: \u003Cspecific cause cited>\nEVIDENCE:\n  - \u003Cdiagnostic signal 1>\n  - \u003Cdiagnostic signal 2>\nLAYER_CHECK:\n  - IAM: \u003CPASS | FAIL — reason>\n  - Connectivity: \u003CPASS | FAIL — reason>\n  - Agent: \u003CPASS | FAIL — reason>\nFIX:\n  - \u003Caction 1 with CLI snippet>\n  - \u003Caction 2 ...>\nVERIFICATION:\n  - \u003Ccommand to confirm fix>\nVERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE\nNEXT_STEP: \u003Cif NEED_MORE_INFO, the specific next diagnostic>\nESCALATION_PATH: \u003Cif ESCALATE, the recommended path>\n```\n\n### Worked example — ROOT_CAUSE_FOUND, Failed association\n\n```text\nDIAGNOSIS: patch-association-prod\nASSOCIATION: 0123456789abcdef0123456789abcdef0123456789abcdef0\nINSTANCE: i-0abc123def456789a\nSYMPTOM: Failed\nROOT_CAUSE: Instance role lacks s3:PutObject on the S3 output bucket;\n            association execution failed writing command output.\nEVIDENCE:\n  - describe-association-executions Status=Failed, StatusMessage=\"AccessDenied on s3:PutObject for arn:aws:s3:::ssm-output-prod\u002F...\"\n  - simulate-principal-policy returned Denied for s3:PutObject on arn:aws:s3:::ssm-output-prod\u002F*\nLAYER_CHECK:\n  - IAM: FAIL — instance role has AmazonSSMManagedInstanceCore but NOT s3:PutObject on ssm-output-prod\n  - Connectivity: PASS — PingStatus Active, agent v3.2.x\n  - Agent: PASS — IsLatestVersion true\nFIX:\n  - Add an inline policy granting s3:PutObject on arn:aws:s3:::ssm-output-prod\u002F*:\n    aws iam put-role-policy --role-name \u003Cinstance-role> --policy-name SsmOutputPut --policy-document '{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":\"s3:PutObject\",\"Resource\":\"arn:aws:s3:::ssm-output-prod\u002F*\"}]}'\n  - Re-run the association:\n    aws ssm start-associations-once --association-ids 0123456789abcdef0123456789abcdef0123456789abcdef0\nVERIFICATION:\n  - aws ssm describe-association-executions --association-id 0123456789abcdef0123456789abcdef0123456789abcdef0 --query 'Executions[0].Status'\n  - Expect: Success\nVERDICT: ROOT_CAUSE_FOUND\nNEXT_STEP: None\nESCALATION_PATH: None\n```\n\n### Worked example — NEED_MORE_INFO, TimedOut\n\n```text\nDIAGNOSIS: nightly-inventory-missing\nASSOCIATION: 1234567890abcdef1234567890abcdef1234567890abcdef1\nINSTANCE: i-0fedcba9876543210\nSYMPTOM: TimedOut\nROOT_CAUSE: Pending diagnosis — instance is reachable (PingStatus Active)\n            and agent is current, but the document hangs mid-execution.\n            Need SSM agent log to identify the hung plugin.\nEVIDENCE:\n  - describe-association-executions Status=TimedOut\n  - describe-instance-information PingStatus=Active, AgentVersion=3.2.1555.0\n  - list-command-invocations StatusDetails=TimedOut (no StatusMessage)\nLAYER_CHECK:\n  - IAM: PASS — AmazonSSMManagedInstanceCore + SSM output bucket access\n  - Connectivity: PASS — PingStatus Active within last 5 min\n  - Agent: PASS — IsLatestVersion true\nFIX: (pending root cause)\nVERIFICATION: (pending fix)\nVERDICT: NEED_MORE_INFO\nNEXT_STEP: Fetch the SSM agent log from the host:\n  aws ssm send-command --instance-ids i-0fedcba9876543210 \\\n    --document-name AWS-RunShellScript \\\n    --parameters commands=[\"tail -n 200 \u002Fvar\u002Flog\u002Famazon\u002Fssm\u002Famazon-ssm-agent.log\"]\n  Then locate the plugin that produced the timeout (look for\n  \"documentname\u002Fgather-software-inventory\" and \"TimeoutExceeded\").\nESCALATION_PATH: If agent log shows no plugin entry, escalate to\n  AWS Support with the execution-id.\n```\n\n### Worked example — ESCALATE, NotManaged with hybrid activation\n\n```text\nDIAGNOSIS: hybrid-edge-device-missing\nASSOCIATION: 234567890abcdef234567890abcdef234567890abcdef2\nINSTANCE: mi-0abc123def456789a\nSYMPTOM: NotManaged\nROOT_CAUSE: Hybrid activation expired (Expired: true). The mi-* instance\n            was registered under this activation; the agent can no longer\n            re-authenticate.\nEVIDENCE:\n  - describe-instance-information returns nothing for mi-0abc123def456789a\n  - describe-activations shows the activation Expired=true (expiry 2026-06-01)\nLAYER_CHECK:\n  - IAM: FAIL — activation role no longer exchangeable\n  - Connectivity: unknown (instance not in SSM)\n  - Agent: unknown (instance not in SSM)\nFIX: Cannot remediate from AWS side alone — the on-prem host must\n  re-register with a new activation code. Requires on-host access.\nVERIFICATION: After re-registration:\n  aws ssm describe-instance-information \\\n    --instance-information-filter-list Key=InstanceIds,ValueSet=mi-0abc123def456789a\n  Expect: PingStatus=Active within 5-10 minutes.\nVERDICT: ESCALATE\nNEXT_STEP: Provide on-prem operator with a new activation code:\n  aws ssm create-activation --iam-role \u003Cactivation-role> \\\n    --registration-limit 1 --expiry-date $(date -u -v+7d +%Y-%m-%d)\nESCALATION_PATH: On-prem \u002F edge-device operator must run on the host:\n  amazon-ssm-agent -register -code \u003Cnew-code> -id \u003Cnew-id> -region \u003Cregion>\n  (requires sudo \u002F admin on the host). Cannot be done from the AWS side.\n```\n\nThis contract is mandatory. The Output format template above is the\nauthoritative structure. Violating any rule is a misdiagnosis.\n\n### Required output structure\n\nEvery diagnosis MUST emit the exact DIAGNOSIS block with all fields\npopulated (no empty fields, no omitted sections, no reordering). All\nthree LAYER_CHECK lines (IAM, Connectivity, Agent) are mandatory —\neven when the failure is association-specific.\n\nVerdict-specific rules:\n- `ROOT_CAUSE_FOUND` → ROOT_CAUSE names a single specific cause; EVIDENCE cites at least one failing API signal; FIX is actionable CLI.\n- `NEED_MORE_INFO` → ROOT_CAUSE is \"Pending diagnosis — \u003Cwhat is known>\"; NEXT_STEP cites the exact next command.\n- `ESCALATE` → ESCALATION_PATH names the recipient and the out-of-band action required.\n\n### FORBIDDEN output patterns\n\n- NEVER diagnose without checking SSM agent status first — the agent must be 'Online' for any association to work. A diagnosis that skips the LAYER_CHECK Agent line is invalid.\n- NEVER confuse association status 'Failed' with instance not being managed — Failed means the document ran but returned non-zero. NotManaged is a different symptom (Step 4).\n- NEVER treat association `Status: Success` as proof the document script succeeded — always read per-target `Status` from `describe-association-execution-targets`.\n- NEVER emit `VERDICT: NEED_MORE_INFO` without a `NEXT_STEP` naming a specific diagnostic command. Generic phrases like \"investigate further\" are not acceptable.\n- NEVER use `ec2 describe-instances` for `mi-*` hybrid instances. They are not EC2 resources; route through `describe-instance-information` and `describe-activations`.\n\n## Anti-Patterns — NEVER do these things\n\n- NEVER diagnose an association without first running the 3-layer health check. Most \"association Failed\" tickets are coverage gaps in IAM, connectivity, or agent.\n- NEVER treat association `Status: Success` as proof that the document script succeeded. Always read `describe-association-execution-targets` for per-target `Status: Failed`.\n- NEVER assume `PingStatus: Active` means the instance is fully healthy. Active is heartbeat (last 5 min), not health. Pair with `LastPingDateTime`.\n- NEVER treat `AWS-ApplyPatchBaseline` `Operation=Scan` as a failure when it reports `NON_COMPLIANT`. Scan records compliance; it does NOT install patches.\n- NEVER recommend `delete-association` as the first remediation. Modify-then-test (`update-association`, `start-associations-once`) preserves targeting and schedule.\n\n## Pre-flight safety checks\n\n- **MANDATORY CONFIRMATION GATE** before any state-changing operation (`update-association`, `start-associations-once`, `delete-association`, `send-command Operation=Install`, `create-activation`).\n- **`start-associations-once` target blast radius:** confirm targets before triggering — tag-based target can hit larger fleet than expected.\n- **`send-command` target blast radius:** always pass `--instance-ids \u003Cid>` (single instance) for diagnostic commands, NEVER `--targets Key=InstanceIds,Values=*`.\n- **Patch Install pre-flight:** verify patch baseline `ApprovalRules` match the intended maintenance window.\n- **Association modification:** snapshot `describe-association --output json` BEFORE `update-association`.\n\n## Appendix A — Symptom-to-cause map (quick reference)\n\n| Symptom | Most common root cause | Verify via |\n|---|---|---|\n| Failed — invalid parameters | Document schema drift \u002F wrong parameter value | `describe-association-executions` StatusMessage |\n| Failed — AccessDenied | Instance role missing required action | `simulate-principal-policy` |\n| Failed — document not found | Document deleted or name typo | `describe-document` |\n| Failed — S3 access denied | Role lacks `s3:PutObject` on output bucket | `simulate-principal-policy` |\n| TimedOut — ConnectionLost | IAM, network, or agent failure | 3-layer health check (Step 1) |\n| TimedOut — script hangs | Document script deadlock or infinite loop | Agent log + `timeoutSeconds` |\n| NotManaged — EC2 | No instance profile \u002F wrong policy | `ec2 describe-instances` + `list-attached-role-policies` |\n| NotManaged — private subnet | VPC endpoints missing | `ec2 describe-vpc-endpoints` |\n| NotManaged — hybrid `mi-*` | Activation expired or quota exhausted | `describe-activations` |\n| NotManaged — fresh launch | Agent still bootstrapping (\u003C 5 min) | `LaunchTime` vs current time |\n| NeverRuns — schedule wrong | Malformed cron (both DOM and DOW set) | `describe-association` ScheduleExpression |\n| NeverRuns — targets empty | Tag key\u002Fvalue mismatch | `ec2 describe-instances --filters` |\n| NeverRuns — Disabled | Association `State: Disabled` | `describe-association` State |\n| DocumentError — script error | Syntax \u002F logic error in document | S3 output or `get-command-invocation` |\n| DocumentError — platform | Document `PlatformTypes` excludes OS | `describe-document` PlatformTypes |\n\n## Recent AWS features (2024-2026)\n\n- **SSM Quick Setup (2024):** Pre-configured baselines (patch policies, Session Manager, inventory) deployable via CloudFormation. Verify Quick Setup-managed resources are not locally overridden when diagnosing drift.\n- **Session Manager port forwarding and SSH proxy (2024-2025):** Enhanced Session Manager with native SSH proxy. Useful for fetching agent logs from instances with no inbound access.\n- **Hybrid Activator (2024):** Streamlined on-prem registration. Verify activation role includes `AmazonSSMManagedInstanceCore`.\n- **Patch baseline enhancements (2024-2025):** Amazon Linux 2023 support, Debian\u002FUbuntu improvements. Verify baseline covers all managed OS types.\n- **SSM Document versioning (2024):** Verify associations reference a specific version (not `$LATEST`) for production stability — `$LATEST` produces silent drift.\n- **Distributor integration (2024-2025):** SSM Distributor can deploy\u002Fupdate agents on hybrid instances. Verify packages are current when diagnosing `IsLatestVersion: false`.\n\n## Domain\n\nAWS CloudOps \u002F Systems Manager Association Diagnostics.\n\n## AWS documentation\n\n- **AWS Systems Manager User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fwhat-is-systems-manager.html\n- **SSM Associations** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fsystems-manager-associations.html\n- **SSM Agent** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fssm-agent.html\n- **SSM Documents** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fdocuments.html\n- **Patch Manager** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fpatch-manager.html\n- **Hybrid Activations** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fmanaged-instances.html\n- **VPC Endpoints for SSM** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fsetup-create-vpc.html\n- **API Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002FAPIReference\u002F\n- **CLI Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fssm\u002F\n- **Troubleshooting SSM Agent** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fssm-agent.html#ssm-agent-troubleshooting\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":42},{"tags":25,"phase":26,"author":27,"domain":28,"family":29,"version":30,"keywords":31,"task_type":32,"complexity":33,"entry_point":34,"skill_class":35,"when_to_use":36,"requires_llm":37,"verdict_shape":38,"lifecycle_status":39,"invocation_schema":40,"supports_pipeline":37,"activation_triggers":41},"ssm, systems-manager, management, troubleshoot, association, agent, diagnostic","2","Jacky Chan — AWS Community Builder","aws-cloudops","Management","0.1.0","Systems Manager, SSM, SSM Association, association failed, association TimedOut, association never runs, SSM Agent, PingStatus, ConnectionLost, Inactive, AmazonSSMManagedInstanceCore, association execution, document execution, SSM Document, patch baseline, hybrid activation, SSM VPC endpoints, ssmmesages, ec2messages, cron expression, association targets, instance profile, S3 output bucket, rate limiting","troubleshoot","medium","false","capability","Diagnosing an SSM association that is failing, timing out, never running, or producing errors mid-execution. Covers the five primary symptom categories: association status Failed, TimedOut, instance not appearing in SSM (unmanaged), association never runs (schedule\u002Ftarget mismatch), document execution fails (script\u002Fpermission\u002Fplatform). Use when an association shows red in the console, an instance is missing from SSM, a patch or inventory run failed, or a custom document run produced errors.","true","ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE","active","Input: either (a) an association-id or association name with observed symptom (Failed \u002F TimedOut \u002F never-runs \u002F document- error \u002F instance-missing), optionally with execution-id, OR (b) live-account diagnostic output from describe-instance- information, describe-association-executions, etc. Output: deterministic DIAGNOSIS block per association — SYMPTOM\u002F ROOT_CAUSE\u002FEVIDENCE\u002FFIX\u002FVERDICT — where VERDICT is ROOT_CAUSE_FOUND (cause identified + fix actionable), NEED_MORE_INFO (specific next diagnostic cited), or ESCALATE (requires AWS Support or out-of-band action).","SSM association failed, association TimedOut, association never runs, association not running, instance not in SSM, instance not managed, SSM agent unreachable, SSM ConnectionLost, association execution failed, document execution fails, patch association failed, inventory association failed, association wrong schedule, association targets wrong, association enabled false, SSM rate limiting, IAM role missing SSM, AmazonSSMManagedInstanceCore, hybrid activation, SSM VPC endpoints","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline diagnosis. Live- account troubleshooting uses aws ssm describe-instance-information, list-associations, describe-association, describe-association- executions, describe-association-execution-targets, list-association- versions, describe-instance-associations-status, describe-document, describe-activations, list-command-invocations, aws ec2 describe- instances...","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fssm-association-troubleshooter",0,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills","https:\u002F\u002Fgithub.com\u002Fjhkchan","CTO & Co-Founder @Beever-AI  & @votee. CAISP. AWS Community Builder. Organizer@GDGCloudHK. MongoDB Champion. Technopreneur + Infornographer.","2026-09-24 08:54:10",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill ssm-association-troubleshooter",{"tool":57,"command":58},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill ssm-association-troubleshooter",{"tool":60,"command":61},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill ssm-association-troubleshooter","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002FSKILL.md",true,[65,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",8032,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Feval\u002Ftest-cases.yaml",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"evals\u002Fbaselines\u002Fdocument-script-error.md",675,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fbaselines\u002Fdocument-script-error.md",{"path":76,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":77,"sourceHtmlUrl":78},"evals\u002Fbaselines\u002Ffailed-s3-access-denied.md",613,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fbaselines\u002Ffailed-s3-access-denied.md",{"path":80,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":81,"sourceHtmlUrl":82},"evals\u002Fbaselines\u002Fhybrid-activation-expired.md",619,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fbaselines\u002Fhybrid-activation-expired.md",{"path":84,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":85,"sourceHtmlUrl":86},"evals\u002Fbaselines\u002Fnever-runs-tag-mismatch.md",600,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fbaselines\u002Fnever-runs-tag-mismatch.md",{"path":88,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":89,"sourceHtmlUrl":90},"evals\u002Fbaselines\u002Ftimedout-agent-unreachable.md",651,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fbaselines\u002Ftimedout-agent-unreachable.md",{"path":92,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":93,"sourceHtmlUrl":94},"evals\u002Feval_config.yaml",1736,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Feval_config.yaml",{"path":96,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":97,"sourceHtmlUrl":98},"evals\u002Fevals.json",4445,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fevals.json",{"path":100,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":101,"sourceHtmlUrl":102},"evals\u002Fprompts\u002Fdocument-script-error.md",1070,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fprompts\u002Fdocument-script-error.md",{"path":104,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":105,"sourceHtmlUrl":106},"evals\u002Fprompts\u002Ffailed-s3-access-denied.md",933,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fprompts\u002Ffailed-s3-access-denied.md",{"path":108,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":109,"sourceHtmlUrl":110},"evals\u002Fprompts\u002Fhybrid-activation-expired.md",802,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fprompts\u002Fhybrid-activation-expired.md",{"path":112,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":113,"sourceHtmlUrl":114},"evals\u002Fprompts\u002Fnever-runs-tag-mismatch.md",867,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fprompts\u002Fnever-runs-tag-mismatch.md",{"path":116,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":117,"sourceHtmlUrl":118},"evals\u002Fprompts\u002Ftimedout-agent-unreachable.md",978,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fevals\u002Fprompts\u002Ftimedout-agent-unreachable.md",{"path":120,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":121,"sourceHtmlUrl":122},"examples\u002Fend-to-end.md",8701,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fexamples\u002Fend-to-end.md",{"path":124,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":125,"sourceHtmlUrl":126},"references\u002Fssm-association-diagnostics.md",17538,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Freferences\u002Fssm-association-diagnostics.md",{"path":128,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":129,"sourceHtmlUrl":130},"skill.usf.yaml",4429,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fssm-association-troubleshooter\u002Fskill.usf.yaml",[132,139,146,153,160,167],{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":19},"01M7ADVD60X4PCAPKSE58P9NDC","xray-tracing-deployer","Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL \u002F method \u002F service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry \u002F ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS \u002F EKS \u002F Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxray-tracing-deployer\u002FSKILL.md",[],[],{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":19},"01M7ADTVJ7DCBM9CB1FY51GH7J","wellarchitected-workload-auditor","Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-workload-auditor\u002FSKILL.md",[],[],{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":19},"01M7ADT59G6FTTNZYHT2QRPNNP","wellarchitected-review-operator","Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer \u002F get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-review-operator\u002FSKILL.md",[],[],{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":19},"01M7ADSH5JA9QHNPPHQCD7EVA7","wafv2-web-acl-deployer","Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB\u002FAPI Gateway\u002FCloudFront, or configuring CAPTCHA\u002FChallenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-deployer\u002FSKILL.md",[],[],{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":19},"01M7ADRYFAT8R73FBNCHRC573X","wafv2-web-acl-auditor","Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow\u002Fbypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-auditor\u002FSKILL.md",[],[],{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":19},"01M7ADR8W7G72JX4KFGN03QK8Q","waf-rule-deployer","Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwaf-rule-deployer\u002FSKILL.md",[],[]]