[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A7PFEBQQ30W9RY9V4HD1V3":3,"skill-same:01M7A7PFEBQQ30W9RY9V4HD1V3":148},{"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":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M7A7PFEBQQ30W9RY9V4HD1V3","ecs-task-troubleshooter",null,"Diagnoses AWS ECS task failures via a stoppedReason-first decision tree covering ResourceInitializationError (ENI trunking, subnet IP exhaustion), CannotPullContainerError (ECR auth, throttle, size limit, private-subnet ECR endpoint), EC2InstanceStateError, capacity provider placement failures, task-role vs execution-role confusion, service event messages (task failed to start, unable to place), CPU\u002Fmemory oversubscription, container health check failures, deregistered container instances, Fargate platform version issues, and deployment circuit breaker rollbacks. Walks describe-tasks stoppedReason + containers[].reason + describe-services events to a verified root cause with evidence-backed probes. Emits ROOT_CAUSE_IDENTIFIED or INSUFFICIENT_DATA. Use when an ECS task is stuck in PROVISIONING, transitions to STOPPED, fails placement, cannot pull an image, or the deployment circuit breaker fires.","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\u002Fecs-task-troubleshooter\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ecs-task-troubleshooter\ndescription: Diagnoses AWS ECS task failures via a stoppedReason-first decision tree covering ResourceInitializationError (ENI trunking, subnet IP exhaustion), CannotPullContainerError (ECR auth, throttle, size limit, private-subnet ECR endpoint), EC2InstanceStateError, capacity provider placement failures, task-role vs execution-role confusion, service event messages (task failed to start, unable to place), CPU\u002Fmemory oversubscription, container health check failures, deregistered container instances, Fargate platform version issues, and deployment circuit breaker rollbacks. Walks describe-tasks stoppedReason + containers[].reason + describe-services events to a verified root cause with evidence-backed probes. Emits ROOT_CAUSE_IDENTIFIED or INSUFFICIENT_DATA. Use when an ECS task is stuck in PROVISIONING, transitions to STOPPED, fails placement, cannot pull an image, or the deployment circuit breaker fires.\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline diagnosis works on supplied describe-tasks \u002F describe-services JSON. Live-account diagnosis uses aws ecs describe-tasks, describe-services, describe-task-definition, describe-container-instances, describe-capacity-providers, aws logs get-log-events \u002F filter-log-events, aws elbv2 describe-target-health, aws ecr get-repository-policy \u002F describe-images, aws ec2 describe-subnets \u002F...\nmetadata:\n  domain: aws-cloudops\n  complexity: high\n  requires_llm: 'true'\n  phase: '2'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Compute\n  task_type: troubleshoot\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: ROOT_CAUSE_IDENTIFIED | INSUFFICIENT_DATA\n  when_to_use: Diagnosing why an ECS task stays in PROVISIONING, transitions to STOPPED, fails placement with \"No ContainerInstances were found\" or \"unable to place a task\", cannot pull a container image (CannotPullContainerError), fails container health checks, hits the deployment circuit breaker, or exits with a non-zero code; interpreting describe-tasks stoppedReason \u002F containers[].reason \u002F lastStatus, or triaging an ECS service event message.\n  when_not_to_use: Application-code debugging inside a running container (use CloudWatch Logs and the application's own debugger); EKS pod troubleshooting (use eks-pod-troubleshooter); Fargate capacity reservation sizing (use fargate-cost-optimizer); ECS task-definition IAM posture audits (use ecs-task-definition-auditor); steady-state service-auto-scaling tuning (use autoscaling-policy-deployer).\n  activation_triggers: ECS task stopped, ECS task PROVISIONING stuck, ECS task PENDING forever, ResourceInitializationError, CannotPullContainerError, EC2InstanceStateError, unable to place a task, No ContainerInstances were found, Essential container in task exited, ECS health check failing, ECS task crash loop, ECS task OutOfMemory, deployment circuit breaker, service deregistered container instances, Fargate platform version\n  invocation_schema: 'Input: either (a) a symptom description (the failing service\u002Fcluster, the observed state, any error strings from the console), OR (b) a live-account scenario where the agent runs aws ecs describe-tasks \u002F describe-services \u002F describe-task-definition to gather evidence. Output: a deterministic TARGET \u002F VERDICT \u002F ROOT_CAUSE \u002F REASON \u002F EVIDENCE \u002F REMEDIATION block where VERDICT ∈ {ROOT_CAUSE_IDENTIFIED, INSUFFICIENT_DATA} and ROOT_CAUSE names the specific failure category (RESOURCE_INIT_ENI \u002F RESOURCE_INIT_SUBNET_IP \u002F IMAGE_PULL_AUTH \u002F IMAGE_PULL_ENDPOINT \u002F IMAGE_PULL_SIZE \u002F CAPACITY_PLACEMENT \u002F CAPACITY_DEREGISTERED \u002F CONFIG_TASK_ROLE \u002F CONFIG_EXECUTION_ROLE \u002F CONFIG_DEFINITION_INVALID \u002F HEALTH_CHECK \u002F OOM \u002F ExitCode \u002F CIRCUIT_BREAKER \u002F PLATFORM_VERSION \u002F UNKNOWN).'\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: ECS, Fargate, EC2 launch type, task stopped, stoppedReason, ResourceInitializationError, CannotPullContainerError, EC2InstanceStateError, ENI trunking, awsvpc, task role, execution role, capacity provider, placement failure, service event, unable to place, CPU oversubscription, memory oversubscription, container health check, deregistered container instance, task definition validation, Fargate platform version, ECR image pull, ECR auth, ECR throttle, ECR size limit, deployment circuit breaker\n  tags: ecs, compute, troubleshoot, task-failure, fargate, ec2, eni, ecr, circuit-breaker\n---\n\n# ECS Task Troubleshooter\n\n## Quick navigation\n\n| Symptom \u002F signal | Jump | Likely ROOT_CAUSE |\n|---|---|---|\n| `stoppedReason: ResourceInitializationError: failed to ... ENI` | Step 1 | `RESOURCE_INIT_ENI` (trunk \u002F interface limit) |\n| `stoppedReason: ResourceInitializationError: unable to pull secrets or ...` (awsvpc, private subnet) | Step 1 | `RESOURCE_INIT_SUBNET_IP` (no free IP in subnet) |\n| `stoppedReason: CannotPullContainerError: inspect image ... 401\u002F403` | Step 2 | `IMAGE_PULL_AUTH` (execution role lacks `ecr:*` or ECR policy denies) |\n| `stoppedReason: CannotPullContainerError: RequestError ... timeout` (private subnet, Fargate) | Step 2 | `IMAGE_PULL_ENDPOINT` (no ECR + S3 VPC endpoints) |\n| `stoppedReason: CannotPullContainerError: ... layer size exceeds` | Step 2 | `IMAGE_PULL_SIZE` (> 10 GB uncompressed layer) |\n| `stoppedReason: EC2InstanceStateError: Container instance ... deregistered` | Step 3 | `CAPACITY_DEREGISTERED` |\n| service event `was unable to place a task ... No ContainerInstances` | Step 3 | `CAPACITY_PLACEMENT` (no matching attributes \u002F capacity) |\n| task exits non-zero immediately, `stoppedReason: Essential container in task exited` | Step 4 | `ExitCode` → app error \u002F OOM \u002F `CONFIG_TASK_ROLE` |\n| `CannotPullContainerError` only on first deploy of cross-account image | Step 2 + 5 | `IMAGE_PULL_AUTH` + `CONFIG_EXECUTION_ROLE` |\n| target group `target_health: unhealthy` + service event `task failed to start` | Step 6 | `HEALTH_CHECK` (path\u002Fport\u002Finterval mismatch) |\n| service event `service ... deployment failed: Circuit Breaker` (TaskFailed) | Step 7 | `CIRCUIT_BREAKER` → fold to underlying cause |\n| `runtime platform: LATEST` shifted after a Fargate patch window | Step 8 | `PLATFORM_VERSION` (behavioural regression) |\n| describe-task-definition returns `ClientException: ...` | Step 9 | `CONFIG_DEFINITION_INVALID` |\n| Symptom does not match any row, evidence incomplete | Step 10 | `INSUFFICIENT_DATA` |\n\n## STRICT output contract\n\nEvery invocation MUST emit exactly one diagnostic block as the final\nanswer. The block is machine-parsable; any drift breaks the eval harness\nand the downstream orchestrator.\n\n```text\nTARGET: \u003Ccluster \u002F service \u002F task ARN or unknown>\nVERDICT: ROOT_CAUSE_IDENTIFIED | INSUFFICIENT_DATA\nROOT_CAUSE: \u003CCATEGORY_NAME>\nREASON: \u003C1-3 sentences naming the failing config element + the probe\n  that proves it>\nEVIDENCE:\n  - \u003Cobserved signal — stoppedReason \u002F containers[].reason \u002F exitCode\n    \u002F service event \u002F metric>\n  - \u003Cfailing probe — CLI command and the specific output line that\n    confirms the cause>\n  - \u003Cpassing probes — categories ruled out with one-line justification>\nREMEDIATION:\n  1. \u003Cspecific action with CLI command>\n  2. \u003Cverification command after the fix>\nCONFIRM: Before any state-changing CLI, emit and await operator\n  approval: \"CONFIRM: About to \u003Caction> on \u003Cresource>. Proceed? (yes\u002Fno)\"\n```\n\nRules:\n\n- `VERDICT: ROOT_CAUSE_IDENTIFIED` requires at least one FAILING probe\n  that matches the symptom — never a process-of-elimination answer.\n- `VERDICT: INSUFFICIENT_DATA` MUST list the missing inputs and the next\n  probe to run; it is never a dead-end.\n- `ROOT_CAUSE` is a single UPPER_SNAKE_CASE category name from the set\n  above — free-text root causes are forbidden.\n- `EVIDENCE` lists BOTH the failing probe AND the categories ruled out.\n- One block per target; multi-target incidents separate blocks with `---`.\n\n## NEVER\n\n- **NEVER** declare `ROOT_CAUSE_IDENTIFIED` without a failing probe that\n  matches the symptom. The `stoppedReason` string alone (\"Essential\n  container in task exited\") is a symptom, not a root cause; cross-\n  reference `containers[].reason`, `exitCode`, and CloudWatch Logs\n  before naming the category.\n- **NEVER** conflate the task role with the execution role. The **task\n  role** is assumed by the container at runtime (permissions for the\n  application to call AWS APIs). The **execution role** is assumed by\n  the ECS agent \u002F Fargate to pull the image, fetch secrets, and write\n  CloudWatch Logs. An `AccessDenied` from the application code is the\n  task role; a `CannotPullContainerError: 401` is the execution role.\n  Swapping the two is the single most common ECS misdiagnosis.\n- **NEVER** recommend adding a NAT Gateway to fix `CannotPullContainerError`\n  on Fargate in a private subnet without first checking for the ECR\n  interface endpoint (`ecr.api` + `ecr.dkr`) AND the S3 gateway\n  endpoint. Fargate cannot use a NAT for ECR auth; the S3 gateway is\n  required because ECR layers are stored in S3.\n- **NEVER** assume an `awsvpc` task has an ENI just because the task\n  reached RUNNING. The ENI is attached during PROVISIONING; if the\n  subnet has zero free IPs, the task fails with\n  `ResourceInitializationError` BEFORE the container starts.\n- **NEVER** conclude \"the container image is broken\" without first\n  pulling it locally on the same architecture. A `CMD` typo or an\n  `ENTRYPOINT` override in the task definition produces an exit-code-127\n  that mimics a broken image.\n- **NEVER** propose changing the capacity provider strategy or\n  launch type without confirming the placement failure mode. \"Unable\n  to place\" can be capacity (no free CPU units), attributes (no\n  instance with `ecs.capability.execution-role-awslogs`), or\n  availability-zone constraints. The wrong fix masks the symptom.\n- **NEVER** delete and recreate a service to clear a circuit-breaker\n  rollback. The circuit breaker fires BECAUSE the new task definition\n  is failing; recreate-without-fix triggers the same failure. Read\n  Step 7 first and fold to the underlying category.\n\n## Expert heuristic\n\nMoved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) - load on demand (see References below).\n\n## Configuration dependency graph\n\nMoved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) - load on demand (see References below).\n\n## Mindset\n\nAn ECS task failure is a state-machine problem, not a container-debugging\nproblem. The ECS control plane records exactly what went wrong in\n`stoppedReason`, `containers[].reason`, `exitCode`, and the service\nevent log. Senior container engineers start with `describe-tasks` and\n`describe-services`, then drill into CloudWatch Logs only after the\ncategory is confirmed. Operators who start with the application logs\nfrequently miss a `ResourceInitializationError` that fired BEFORE the\ncontainer ever started.\n\n## Process — stoppedReason-first diagnostic tree\n\n### Step 0: Pre-flight — gather task and service state\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nShort-circuit cases that mimic task failure:\n\n| Signal | Effect on diagnosis |\n|---|---|\n| `desiredCount: 0` (service scaled to zero) | No failure — the scheduler is doing what it was told. Do NOT diagnose as a stopped-task incident. |\n| `pendingTasksCount` rising, no STOPPED tasks | Tasks are PROVISIONING but not failing yet. Wait 60–90s; if they transition to STOPPED, return here. |\n| `status: INACTIVE` on the service | Service was deleted; no live target. Emit `INSUFFICIENT_DATA` listing the deleted service. |\n| AWS Health event `AWS_ECS_SERVICE` open in the region | Fold to AWS-side; surface the event ARN and recommend opening a Support case. Do NOT continue diagnosing customer-side causes. |\n\nIf the input lacks the cluster, service, or task ARN, emit\n`INSUFFICIENT_DATA` listing the missing fields and the exact probe to run.\n\n### Step 1: ResourceInitializationError — ENI and subnet IP\n\n`stoppedReason` contains `ResourceInitializationError`. Two sub-cases.\n\n#### 1a: ENI attachment failure (trunking \u002F interface limit)\n\nSymptom string contains `failed to initialize ENI` or\n`ResourceInitializationError: unable to pull secrets or register log\ndriver`. On EC2 launch type with `awsvpc`, the instance has a per-\ninstance ENI cap. Without trunking, a `c5.large` (2 ENIs) can run at\nmost 1 `awsvpc` task — the second ENI is the host's primary interface.\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nIf `ecs.awsvpc-trunking` is absent or `\"value\": \"disabled\"`, and the\ninstance has hit its ENI cap, **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: RESOURCE_INIT_ENI`. Fix: enable trunking\n(`put-attribute-content --attribute ecs.awsvpc-truncation ...` is NOT\na thing — request a trunk ENI via `create-carrier-gateway` \u002F\n`modify-network-interface-attribute` per the AWS trunking docs) on a\nsupported instance type, OR move the workload to Fargate.\n\n#### 1b: Subnet IP exhaustion (awsvpc private subnet)\n\nFor `awsvpc` mode, each task consumes one primary private IP from its\nsubnet. A `\u002F28` subnet has 11 usable IPs; a burst of tasks can exhaust\nthe pool. Fargate additionally reserves 1 IP per task for the ENI.\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\n`AvailableIpAddressCount \u003C desiredCount + 2` (headroom for the ENI\nitself) is the failure. **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: RESOURCE_INIT_SUBNET_IP`. Fix: widen the subnet CIDR\n(`modify-subnet-attribute` cannot resize; create a new wider subnet\nand update the service's `networkConfiguration`), OR add more subnets\nto the VPC and update the service's `networkConfiguration.awsvpcConfiguration.subnets`.\n\n### Step 2: CannotPullContainerError — ECR auth \u002F endpoint \u002F size\n\n`stoppedReason` contains `CannotPullContainerError`. Three sub-cases.\n\n#### 2a: Authentication failure (401 \u002F 403)\n\nThe image exists but the execution role or ECR repo policy denies the\npull. Symptom string contains `401`, `403`, `no basic auth credentials`,\nor `RequestError ... send request`.\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nIf `implicitDeny`, **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: IMAGE_PULL_AUTH` and the offending side is the execution\nrole. Attach `AmazonECSTaskExecutionRolePolicy` or grant the three\nactions inline.\n\nFor cross-account images, also check the ECR repo policy:\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nThe policy must allow `ecr:BatchGetImage` + `ecr:GetDownloadUrlForLayer`\nfor the task's execution role ARN (or its account). Same-account pulls\nare allowed by the service principal automatically.\n\n#### 2b: Network endpoint failure (private subnet, Fargate)\n\nThe execution role has the right permissions, but the task is in a\nprivate subnet without an ECR VPC endpoint. The pull hangs and\neventually times out. Symptom string contains `Client.Timeout`,\n`RequestError: ... dial tcp ... i\u002Fo timeout`, or\n`net\u002Fhttp: request canceled`.\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nRequired endpoints for ECR from a private subnet:\n\n| Endpoint | Type | Required? |\n|---|---|---|\n| `com.amazonaws.\u003Cregion>.ecr.api` | Interface | YES (auth + manifest) |\n| `com.amazonaws.\u003Cregion>.ecr.dkr` | Interface | YES (Docker registry) |\n| `com.amazonaws.\u003Cregion>.s3` | Gateway | YES (image layers stored in S3) |\n\nIf any of the three is missing, **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: IMAGE_PULL_ENDPOINT`. Fix: create the missing endpoint(s).\nA NAT Gateway is NOT sufficient for Fargate ECR auth.\n\n#### 2c: Image size exceeds limit\n\nSymptom string contains `layer size exceeds` or the image is above the\n10 GB uncompressed cap. Confirm:\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nECS \u002F Fargate caps at 10 GB uncompressed. Above the cap, the pull\nfails deterministically. **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: IMAGE_PULL_SIZE`. Fix: rebuild the image (multi-stage\nbuild, slim base image, exclude dev dependencies).\n\n### Step 3: Placement and capacity failures\n\nService event contains `was unable to place a task`,\n`No ContainerInstances were found`, or `unfulfilled capacity`.\n\n#### 3a: No matching container instance (EC2 launch type)\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nCommon causes:\n\n| Pattern | ROOT_CAUSE |\n|---|---|\n| `status: INACTIVE` or agent disconnected | `CAPACITY_DEREGISTERED` — instance was drained or the agent lost connection |\n| `remaining CPU \u003C task CPU` or `remaining MEMORY \u003C task MEMORY` | `CAPACITY_PLACEMENT` — capacity oversubscribed; add instances or reduce task size |\n| Instance lacks `ecs.capability.execution-role-awslogs` attribute | `CAPACITY_PLACEMENT` — task requires `awslogs` log driver but instance cannot provide it |\n| All instances in wrong AZ vs service's `placementStrategy` | `CAPACITY_PLACEMENT` — AZ constraint cannot be satisfied |\n\n#### 3b: Capacity provider failure (Fargate or EC2)\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nIf `status: INACTIVE` or the ASG has zero instances, the provider\ncannot service the task. **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: CAPACITY_PLACEMENT`. Fix: activate the provider, scale\nthe ASG, or update the service's `capacityProviderStrategy`.\n\n### Step 4: Essential container exit — exit code analysis\n\n`stoppedReason: Essential container in task exited` with a non-zero\n`exitCode`. The exit code routes to the next probe.\n\n| `exitCode` | Likely cause | Next probe |\n|---|---|---|\n| `0` | Container exited cleanly but was marked essential | Application logic \u002F liveness probe mismatch |\n| `1` | Generic application error | CloudWatch Logs for the container |\n| `137` | SIGKILL (OOM killer or ECS resource cap) | Step 4a — CPU\u002Fmemory oversubscription |\n| `139` | SIGSEGV | Application code (out of scope) |\n| `143` | SIGTERM (graceful stop) | Check `stopTimeout` and whether the service was scaled in |\n| `127` | Command not found | `entryPoint` \u002F `command` mismatch in task definition |\n| `255` | Often an auth or framework init failure | CloudWatch Logs |\n\n#### 4a: CPU \u002F memory oversubscription (exit 137)\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nIf the task's `memory` (hard limit) is below the container's resident\nset at peak, the OOM killer fires with exit 137. **ROOT_CAUSE_IDENTIFIED**\nwith `ROOT_CAUSE: OOM`. Fix: raise `memory` in the container definition.\n\nFor Fargate, the task-level `cpu` and `memory` must match a valid\ncombination. A task at `cpu: 256` (0.25 vCPU) and `memory: 0.5 GB` is\nvalid, but the same task with a JVM heap set to 1 GB OOMs deterministically.\n\n#### 4b: Task role AccessDenied (application AWS calls)\n\nIf CloudWatch Logs show `AccessDenied` \u002F `is not authorized`, the\ntask role (NOT the execution role) lacks the IAM permission. Fold to\nStep 5.\n\n### Step 5: Task role vs execution role confusion\n\nThe two roles are easy to conflate. The decision tree:\n\n| Symptom | Which role is broken | Probe |\n|---|---|---|\n| `CannotPullContainerError: 401\u002F403` | Execution role | `simulate-principal-policy` on the execution role for `ecr:*` |\n| `AccessDenied` from application code calling S3\u002FDynamoDB\u002FSecrets | Task role | `simulate-principal-policy` on the task role for the denied action |\n| `AccessDenied` when fetching a secret referenced in `secrets` | Execution role | `simulate-principal-policy` on the execution role for `secretsmanager:GetSecretValue` |\n| No logs in CloudWatch Logs but task ran | Execution role | Execution role needs `logs:CreateLogStream` + `logs:PutLogEvents` on the log group ARN |\n\n**ROOT_CAUSE_IDENTIFIED** with `ROOT_CAUSE: CONFIG_TASK_ROLE` or\n`CONFIG_EXECUTION_ROLE`. Fix: add the missing permission via\n`iam put-role-policy` (inline) or attach a managed policy.\n\n### Step 6: Container health check failures\n\nThe task reaches RUNNING but the ALB \u002F target group health check or\nthe ECS container health check fails. Service event:\n`task failed to start` or\n`container \u003Cname> failed container health checks`.\n\n#### 6a: ECS container health check (in task definition)\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nThe `healthCheck.command` runs inside the container; the exit code\nmust be 0 for HEALTHY. Common failure: `CMD-SHELL` curl against a\npath that returns non-200, or the `interval`\u002F`timeout` is too short\nfor cold-start workloads.\n\n#### 6b: ALB target group health check\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nCommon patterns:\n\n| Pattern | ROOT_CAUSE |\n|---|---|\n| `State: unhealthy`, `Description: Request timed out` | Security group on the task does not allow the ALB's SG on the container port |\n| `State: unhealthy`, `Description: HTTP 404` | `healthCheckPath` in the target group does not match the application's routes |\n| `State: unhealthy`, `Description: HTTP 502` | Application crashed mid-health-check (fold to Step 4) |\n| Target not registered at all | `loadBalancers.containerName` or `containerPort` in the service definition does not match any container in the task definition |\n\n**ROOT_CAUSE_IDENTIFIED** with `ROOT_CAUSE: HEALTH_CHECK`. Fix: align\nthe path\u002Fport\u002FSG to what the application actually serves.\n\n### Step 7: Deployment circuit breaker\n\nService event contains\n`deployment failed: Task failed to start` or\n`service \u003Cname> deployment failed: Circuit Breaker`\n(`deploymentCircuitBreaker: { enable: true, rollback: true }`).\n\nThe circuit breaker is NOT a root cause — it is a rollup signal that\nthe replacement tasks are failing. The actual cause is in the\nunderlying stopped task's `stoppedReason`. ALWAYS fold to the\nunderlying category via Steps 1–6 before declaring\n`ROOT_CAUSE: CIRCUIT_BREAKER`. If the underlying category is\nidentified, emit that category and note the circuit breaker in\n`EVIDENCE`. Reserve `ROOT_CAUSE: CIRCUIT_BREAKER` for the rare case\nwhere the underlying `stoppedReason` is empty or self-contradictory.\n\n### Step 8: Fargate platform version regressions\n\nService recently changed `platformVersion` from a pinned version to\n`LATEST`, or AWS patched `LATEST`. Symptom: tasks that ran fine for\nweeks start failing with no config change.\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nConfirm by pinning to the previous platform version and re-deploying.\nIf the failure disappears, **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: PLATFORM_VERSION`. Fix: pin to the previous working\nversion (`platformVersion: 1.4.0` for Fargate); do NOT use `LATEST`\nfor production.\n\n### Step 9: Task definition validation errors\n\nMoved verbatim to [references\u002Ferror-handling.md](references\u002Ferror-handling.md) - load on demand (see References below).\n\n### Step 10: INSUFFICIENT_DATA — when to bail\n\nEmit `INSUFFICIENT_DATA` when:\n\n- The input lacks the cluster \u002F service \u002F task ARN and the symptom is\n  too generic to identify a category.\n- A probe requires operator input (e.g., the application's expected\n  health check path is unknown).\n- The symptom matches no row in the quick navigation table and the\n  describe-tasks output is empty or stale.\n- An AWS Health event is OPEN in the region and may be the cause; the\n  agent cannot confirm without operator-supplied AWS Health access.\n\nALWAYS list the missing inputs and the exact next probe to run.\n\n## Output format\n\nSee the STRICT output contract above. Two worked examples follow.\n\n### Worked example — CannotPullContainerError, ECR endpoint missing\n\n```text\nTARGET: cluster:prod-app \u002F service:payments-api \u002F task:abc123\nVERDICT: ROOT_CAUSE_IDENTIFIED\nROOT_CAUSE: IMAGE_PULL_ENDPOINT\nREASON: Task stoppedReason is `CannotPullContainerError: inspect image\n  ... i\u002Fo timeout`. The task is in a private subnet (subnet-0abc,\n  10.0.20.0\u002F24) without an ECR interface endpoint. The VPC has the s3\n  gateway endpoint but is missing `ecr.api` and `ecr.dkr`; Fargate\n  cannot use a NAT for ECR auth.\nEVIDENCE:\n  - Probe: aws ecs describe-tasks returns stopCode=EssentialContainerExited,\n    stoppedReason contains `CannotPullContainerError: ... i\u002Fo timeout`.\n  - Probe: aws ec2 describe-vpc-endpoints for vpc-0abc returns only the\n    s3 gateway endpoint; ecr.api and ecr.dkr are absent.\n  - Probe: aws iam simulate-principal-policy on the execution role\n    returns allowed for ecr:BatchGetImage (auth is not the issue).\n  - Passing: subnet-0abc has AvailableIpAddressCount: 22; image is\n    480 MB compressed (size is not the issue).\nREMEDIATION:\n  1. Create the two ECR interface endpoints in the VPC:\n     aws ec2 create-vpc-endpoint --vpc-id vpc-0abc \\\n       --service-name com.amazonaws.us-east-1.ecr.api \\\n       --vpc-endpoint-type Interface --subnet-ids subnet-0abc \\\n       --security-group-ids \u003Csg>\n     aws ec2 create-vpc-endpoint --vpc-id vpc-0abc \\\n       --service-name com.amazonaws.us-east-1.ecr.dkr \\\n       --vpc-endpoint-type Interface --subnet-ids subnet-0abc \\\n       --security-group-ids \u003Csg>\n  2. Verify by running a one-off task in the same subnet and watching\n     it transition to RUNNING without a CannotPullContainerError.\nCONFIRM: Before creating the endpoints, emit and await:\n  \"CONFIRM: About to create ecr.api + ecr.dkr interface endpoints in\n   vpc-0abc. Proceed? (yes\u002Fno)\"\n```\n\n### Worked example — INSUFFICIENT_DATA\n\nMoved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md) - load on demand (see References below).\n\n## Pre-flight safety checks\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation\n  (`update-service`, `register-task-definition`, `create-vpc-endpoint`,\n  `put-role-policy`), emit and await operator approval.\n- **Read-only first.** Every probe in the diagnostic tree is read-only.\n- **Updating a service** with a new task definition is the production\n  cutover; prefer `maximumPercent: 100, minimumHealthyPercent: 100`\n  for rolling deploys.\n- **Circuit breaker rollback** is automatic when\n  `deploymentCircuitBreaker.rollback: true`. Do not disable it to\n  \"force through\" a failing deployment.\n- **Capacity provider swaps** can strand in-flight tasks — confirm\n  during a maintenance window.\n- **Bulk remediation batch limit.** When the same root cause affects\n  multiple services, batch into groups of at most 5 and verify between\n  batches.\n\n## Remediation guidance\n\nMoved verbatim to [references\u002Ferror-handling.md](references\u002Ferror-handling.md) - load on demand (see References below).\n\n## References (load on demand)\n\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — expert heuristic and configuration dependency graph, moved verbatim from SKILL.md\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — canonical per-category command scripts (pre-existing), extended with the Step 0 pre-flight listing and all per-step probe commands moved verbatim from SKILL.md\n- [references\u002Ferror-handling.md](references\u002Ferror-handling.md) — Step 9 task-definition validation error table and the ROOT_CAUSE remediation table, moved verbatim from SKILL.md\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — secondary worked example (INSUFFICIENT_DATA block), moved verbatim from SKILL.md\n- [references\u002Ffailure-decision-tree.md](references\u002Ffailure-decision-tree.md) — pre-existing category deep-dives (A-G) with per-category worked examples\n\n## Domain\n\nAWS CloudOps \u002F ECS & Fargate Compute, Task Lifecycle Diagnostics, ENI\n& VPC Networking for Containers, ECR Image Distribution, ECS Deployment\nAutomation.\n\n## AWS documentation\n\n- ECS troubleshooting — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftroubleshooting.html\n- Stopped tasks — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftroubleshooting.html#ts-stopped\n- CannotPullContainerError — https:\u002F\u002Frepost.aws\u002Fknowledge-center\u002Fecs-pull-container-error\n- ENI trunking — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fcontainer-instance-eni.html\n- ECS circuit breaker — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fdeployment-circuit-breaker.html\n- Fargate platform versions — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fplatform_versions.html\n- ECS task execution role — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftask_execution_IAM_role.html\n- ECS task role — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftask-iam-roles.html\n","# ECS Task Troubleshooter\n\n## Quick navigation\n\n| Symptom \u002F signal | Jump | Likely ROOT_CAUSE |\n|---|---|---|\n| `stoppedReason: ResourceInitializationError: failed to ... ENI` | Step 1 | `RESOURCE_INIT_ENI` (trunk \u002F interface limit) |\n| `stoppedReason: ResourceInitializationError: unable to pull secrets or ...` (awsvpc, private subnet) | Step 1 | `RESOURCE_INIT_SUBNET_IP` (no free IP in subnet) |\n| `stoppedReason: CannotPullContainerError: inspect image ... 401\u002F403` | Step 2 | `IMAGE_PULL_AUTH` (execution role lacks `ecr:*` or ECR policy denies) |\n| `stoppedReason: CannotPullContainerError: RequestError ... timeout` (private subnet, Fargate) | Step 2 | `IMAGE_PULL_ENDPOINT` (no ECR + S3 VPC endpoints) |\n| `stoppedReason: CannotPullContainerError: ... layer size exceeds` | Step 2 | `IMAGE_PULL_SIZE` (> 10 GB uncompressed layer) |\n| `stoppedReason: EC2InstanceStateError: Container instance ... deregistered` | Step 3 | `CAPACITY_DEREGISTERED` |\n| service event `was unable to place a task ... No ContainerInstances` | Step 3 | `CAPACITY_PLACEMENT` (no matching attributes \u002F capacity) |\n| task exits non-zero immediately, `stoppedReason: Essential container in task exited` | Step 4 | `ExitCode` → app error \u002F OOM \u002F `CONFIG_TASK_ROLE` |\n| `CannotPullContainerError` only on first deploy of cross-account image | Step 2 + 5 | `IMAGE_PULL_AUTH` + `CONFIG_EXECUTION_ROLE` |\n| target group `target_health: unhealthy` + service event `task failed to start` | Step 6 | `HEALTH_CHECK` (path\u002Fport\u002Finterval mismatch) |\n| service event `service ... deployment failed: Circuit Breaker` (TaskFailed) | Step 7 | `CIRCUIT_BREAKER` → fold to underlying cause |\n| `runtime platform: LATEST` shifted after a Fargate patch window | Step 8 | `PLATFORM_VERSION` (behavioural regression) |\n| describe-task-definition returns `ClientException: ...` | Step 9 | `CONFIG_DEFINITION_INVALID` |\n| Symptom does not match any row, evidence incomplete | Step 10 | `INSUFFICIENT_DATA` |\n\n## STRICT output contract\n\nEvery invocation MUST emit exactly one diagnostic block as the final\nanswer. The block is machine-parsable; any drift breaks the eval harness\nand the downstream orchestrator.\n\n```text\nTARGET: \u003Ccluster \u002F service \u002F task ARN or unknown>\nVERDICT: ROOT_CAUSE_IDENTIFIED | INSUFFICIENT_DATA\nROOT_CAUSE: \u003CCATEGORY_NAME>\nREASON: \u003C1-3 sentences naming the failing config element + the probe\n  that proves it>\nEVIDENCE:\n  - \u003Cobserved signal — stoppedReason \u002F containers[].reason \u002F exitCode\n    \u002F service event \u002F metric>\n  - \u003Cfailing probe — CLI command and the specific output line that\n    confirms the cause>\n  - \u003Cpassing probes — categories ruled out with one-line justification>\nREMEDIATION:\n  1. \u003Cspecific action with CLI command>\n  2. \u003Cverification command after the fix>\nCONFIRM: Before any state-changing CLI, emit and await operator\n  approval: \"CONFIRM: About to \u003Caction> on \u003Cresource>. Proceed? (yes\u002Fno)\"\n```\n\nRules:\n\n- `VERDICT: ROOT_CAUSE_IDENTIFIED` requires at least one FAILING probe\n  that matches the symptom — never a process-of-elimination answer.\n- `VERDICT: INSUFFICIENT_DATA` MUST list the missing inputs and the next\n  probe to run; it is never a dead-end.\n- `ROOT_CAUSE` is a single UPPER_SNAKE_CASE category name from the set\n  above — free-text root causes are forbidden.\n- `EVIDENCE` lists BOTH the failing probe AND the categories ruled out.\n- One block per target; multi-target incidents separate blocks with `---`.\n\n## NEVER\n\n- **NEVER** declare `ROOT_CAUSE_IDENTIFIED` without a failing probe that\n  matches the symptom. The `stoppedReason` string alone (\"Essential\n  container in task exited\") is a symptom, not a root cause; cross-\n  reference `containers[].reason`, `exitCode`, and CloudWatch Logs\n  before naming the category.\n- **NEVER** conflate the task role with the execution role. The **task\n  role** is assumed by the container at runtime (permissions for the\n  application to call AWS APIs). The **execution role** is assumed by\n  the ECS agent \u002F Fargate to pull the image, fetch secrets, and write\n  CloudWatch Logs. An `AccessDenied` from the application code is the\n  task role; a `CannotPullContainerError: 401` is the execution role.\n  Swapping the two is the single most common ECS misdiagnosis.\n- **NEVER** recommend adding a NAT Gateway to fix `CannotPullContainerError`\n  on Fargate in a private subnet without first checking for the ECR\n  interface endpoint (`ecr.api` + `ecr.dkr`) AND the S3 gateway\n  endpoint. Fargate cannot use a NAT for ECR auth; the S3 gateway is\n  required because ECR layers are stored in S3.\n- **NEVER** assume an `awsvpc` task has an ENI just because the task\n  reached RUNNING. The ENI is attached during PROVISIONING; if the\n  subnet has zero free IPs, the task fails with\n  `ResourceInitializationError` BEFORE the container starts.\n- **NEVER** conclude \"the container image is broken\" without first\n  pulling it locally on the same architecture. A `CMD` typo or an\n  `ENTRYPOINT` override in the task definition produces an exit-code-127\n  that mimics a broken image.\n- **NEVER** propose changing the capacity provider strategy or\n  launch type without confirming the placement failure mode. \"Unable\n  to place\" can be capacity (no free CPU units), attributes (no\n  instance with `ecs.capability.execution-role-awslogs`), or\n  availability-zone constraints. The wrong fix masks the symptom.\n- **NEVER** delete and recreate a service to clear a circuit-breaker\n  rollback. The circuit breaker fires BECAUSE the new task definition\n  is failing; recreate-without-fix triggers the same failure. Read\n  Step 7 first and fold to the underlying category.\n\n## Expert heuristic\n\nMoved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) - load on demand (see References below).\n\n## Configuration dependency graph\n\nMoved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) - load on demand (see References below).\n\n## Mindset\n\nAn ECS task failure is a state-machine problem, not a container-debugging\nproblem. The ECS control plane records exactly what went wrong in\n`stoppedReason`, `containers[].reason`, `exitCode`, and the service\nevent log. Senior container engineers start with `describe-tasks` and\n`describe-services`, then drill into CloudWatch Logs only after the\ncategory is confirmed. Operators who start with the application logs\nfrequently miss a `ResourceInitializationError` that fired BEFORE the\ncontainer ever started.\n\n## Process — stoppedReason-first diagnostic tree\n\n### Step 0: Pre-flight — gather task and service state\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nShort-circuit cases that mimic task failure:\n\n| Signal | Effect on diagnosis |\n|---|---|\n| `desiredCount: 0` (service scaled to zero) | No failure — the scheduler is doing what it was told. Do NOT diagnose as a stopped-task incident. |\n| `pendingTasksCount` rising, no STOPPED tasks | Tasks are PROVISIONING but not failing yet. Wait 60–90s; if they transition to STOPPED, return here. |\n| `status: INACTIVE` on the service | Service was deleted; no live target. Emit `INSUFFICIENT_DATA` listing the deleted service. |\n| AWS Health event `AWS_ECS_SERVICE` open in the region | Fold to AWS-side; surface the event ARN and recommend opening a Support case. Do NOT continue diagnosing customer-side causes. |\n\nIf the input lacks the cluster, service, or task ARN, emit\n`INSUFFICIENT_DATA` listing the missing fields and the exact probe to run.\n\n### Step 1: ResourceInitializationError — ENI and subnet IP\n\n`stoppedReason` contains `ResourceInitializationError`. Two sub-cases.\n\n#### 1a: ENI attachment failure (trunking \u002F interface limit)\n\nSymptom string contains `failed to initialize ENI` or\n`ResourceInitializationError: unable to pull secrets or register log\ndriver`. On EC2 launch type with `awsvpc`, the instance has a per-\ninstance ENI cap. Without trunking, a `c5.large` (2 ENIs) can run at\nmost 1 `awsvpc` task — the second ENI is the host's primary interface.\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nIf `ecs.awsvpc-trunking` is absent or `\"value\": \"disabled\"`, and the\ninstance has hit its ENI cap, **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: RESOURCE_INIT_ENI`. Fix: enable trunking\n(`put-attribute-content --attribute ecs.awsvpc-truncation ...` is NOT\na thing — request a trunk ENI via `create-carrier-gateway` \u002F\n`modify-network-interface-attribute` per the AWS trunking docs) on a\nsupported instance type, OR move the workload to Fargate.\n\n#### 1b: Subnet IP exhaustion (awsvpc private subnet)\n\nFor `awsvpc` mode, each task consumes one primary private IP from its\nsubnet. A `\u002F28` subnet has 11 usable IPs; a burst of tasks can exhaust\nthe pool. Fargate additionally reserves 1 IP per task for the ENI.\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\n`AvailableIpAddressCount \u003C desiredCount + 2` (headroom for the ENI\nitself) is the failure. **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: RESOURCE_INIT_SUBNET_IP`. Fix: widen the subnet CIDR\n(`modify-subnet-attribute` cannot resize; create a new wider subnet\nand update the service's `networkConfiguration`), OR add more subnets\nto the VPC and update the service's `networkConfiguration.awsvpcConfiguration.subnets`.\n\n### Step 2: CannotPullContainerError — ECR auth \u002F endpoint \u002F size\n\n`stoppedReason` contains `CannotPullContainerError`. Three sub-cases.\n\n#### 2a: Authentication failure (401 \u002F 403)\n\nThe image exists but the execution role or ECR repo policy denies the\npull. Symptom string contains `401`, `403`, `no basic auth credentials`,\nor `RequestError ... send request`.\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nIf `implicitDeny`, **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: IMAGE_PULL_AUTH` and the offending side is the execution\nrole. Attach `AmazonECSTaskExecutionRolePolicy` or grant the three\nactions inline.\n\nFor cross-account images, also check the ECR repo policy:\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nThe policy must allow `ecr:BatchGetImage` + `ecr:GetDownloadUrlForLayer`\nfor the task's execution role ARN (or its account). Same-account pulls\nare allowed by the service principal automatically.\n\n#### 2b: Network endpoint failure (private subnet, Fargate)\n\nThe execution role has the right permissions, but the task is in a\nprivate subnet without an ECR VPC endpoint. The pull hangs and\neventually times out. Symptom string contains `Client.Timeout`,\n`RequestError: ... dial tcp ... i\u002Fo timeout`, or\n`net\u002Fhttp: request canceled`.\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nRequired endpoints for ECR from a private subnet:\n\n| Endpoint | Type | Required? |\n|---|---|---|\n| `com.amazonaws.\u003Cregion>.ecr.api` | Interface | YES (auth + manifest) |\n| `com.amazonaws.\u003Cregion>.ecr.dkr` | Interface | YES (Docker registry) |\n| `com.amazonaws.\u003Cregion>.s3` | Gateway | YES (image layers stored in S3) |\n\nIf any of the three is missing, **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: IMAGE_PULL_ENDPOINT`. Fix: create the missing endpoint(s).\nA NAT Gateway is NOT sufficient for Fargate ECR auth.\n\n#### 2c: Image size exceeds limit\n\nSymptom string contains `layer size exceeds` or the image is above the\n10 GB uncompressed cap. Confirm:\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nECS \u002F Fargate caps at 10 GB uncompressed. Above the cap, the pull\nfails deterministically. **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: IMAGE_PULL_SIZE`. Fix: rebuild the image (multi-stage\nbuild, slim base image, exclude dev dependencies).\n\n### Step 3: Placement and capacity failures\n\nService event contains `was unable to place a task`,\n`No ContainerInstances were found`, or `unfulfilled capacity`.\n\n#### 3a: No matching container instance (EC2 launch type)\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nCommon causes:\n\n| Pattern | ROOT_CAUSE |\n|---|---|\n| `status: INACTIVE` or agent disconnected | `CAPACITY_DEREGISTERED` — instance was drained or the agent lost connection |\n| `remaining CPU \u003C task CPU` or `remaining MEMORY \u003C task MEMORY` | `CAPACITY_PLACEMENT` — capacity oversubscribed; add instances or reduce task size |\n| Instance lacks `ecs.capability.execution-role-awslogs` attribute | `CAPACITY_PLACEMENT` — task requires `awslogs` log driver but instance cannot provide it |\n| All instances in wrong AZ vs service's `placementStrategy` | `CAPACITY_PLACEMENT` — AZ constraint cannot be satisfied |\n\n#### 3b: Capacity provider failure (Fargate or EC2)\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nIf `status: INACTIVE` or the ASG has zero instances, the provider\ncannot service the task. **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: CAPACITY_PLACEMENT`. Fix: activate the provider, scale\nthe ASG, or update the service's `capacityProviderStrategy`.\n\n### Step 4: Essential container exit — exit code analysis\n\n`stoppedReason: Essential container in task exited` with a non-zero\n`exitCode`. The exit code routes to the next probe.\n\n| `exitCode` | Likely cause | Next probe |\n|---|---|---|\n| `0` | Container exited cleanly but was marked essential | Application logic \u002F liveness probe mismatch |\n| `1` | Generic application error | CloudWatch Logs for the container |\n| `137` | SIGKILL (OOM killer or ECS resource cap) | Step 4a — CPU\u002Fmemory oversubscription |\n| `139` | SIGSEGV | Application code (out of scope) |\n| `143` | SIGTERM (graceful stop) | Check `stopTimeout` and whether the service was scaled in |\n| `127` | Command not found | `entryPoint` \u002F `command` mismatch in task definition |\n| `255` | Often an auth or framework init failure | CloudWatch Logs |\n\n#### 4a: CPU \u002F memory oversubscription (exit 137)\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nIf the task's `memory` (hard limit) is below the container's resident\nset at peak, the OOM killer fires with exit 137. **ROOT_CAUSE_IDENTIFIED**\nwith `ROOT_CAUSE: OOM`. Fix: raise `memory` in the container definition.\n\nFor Fargate, the task-level `cpu` and `memory` must match a valid\ncombination. A task at `cpu: 256` (0.25 vCPU) and `memory: 0.5 GB` is\nvalid, but the same task with a JVM heap set to 1 GB OOMs deterministically.\n\n#### 4b: Task role AccessDenied (application AWS calls)\n\nIf CloudWatch Logs show `AccessDenied` \u002F `is not authorized`, the\ntask role (NOT the execution role) lacks the IAM permission. Fold to\nStep 5.\n\n### Step 5: Task role vs execution role confusion\n\nThe two roles are easy to conflate. The decision tree:\n\n| Symptom | Which role is broken | Probe |\n|---|---|---|\n| `CannotPullContainerError: 401\u002F403` | Execution role | `simulate-principal-policy` on the execution role for `ecr:*` |\n| `AccessDenied` from application code calling S3\u002FDynamoDB\u002FSecrets | Task role | `simulate-principal-policy` on the task role for the denied action |\n| `AccessDenied` when fetching a secret referenced in `secrets` | Execution role | `simulate-principal-policy` on the execution role for `secretsmanager:GetSecretValue` |\n| No logs in CloudWatch Logs but task ran | Execution role | Execution role needs `logs:CreateLogStream` + `logs:PutLogEvents` on the log group ARN |\n\n**ROOT_CAUSE_IDENTIFIED** with `ROOT_CAUSE: CONFIG_TASK_ROLE` or\n`CONFIG_EXECUTION_ROLE`. Fix: add the missing permission via\n`iam put-role-policy` (inline) or attach a managed policy.\n\n### Step 6: Container health check failures\n\nThe task reaches RUNNING but the ALB \u002F target group health check or\nthe ECS container health check fails. Service event:\n`task failed to start` or\n`container \u003Cname> failed container health checks`.\n\n#### 6a: ECS container health check (in task definition)\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nThe `healthCheck.command` runs inside the container; the exit code\nmust be 0 for HEALTHY. Common failure: `CMD-SHELL` curl against a\npath that returns non-200, or the `interval`\u002F`timeout` is too short\nfor cold-start workloads.\n\n#### 6b: ALB target group health check\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nCommon patterns:\n\n| Pattern | ROOT_CAUSE |\n|---|---|\n| `State: unhealthy`, `Description: Request timed out` | Security group on the task does not allow the ALB's SG on the container port |\n| `State: unhealthy`, `Description: HTTP 404` | `healthCheckPath` in the target group does not match the application's routes |\n| `State: unhealthy`, `Description: HTTP 502` | Application crashed mid-health-check (fold to Step 4) |\n| Target not registered at all | `loadBalancers.containerName` or `containerPort` in the service definition does not match any container in the task definition |\n\n**ROOT_CAUSE_IDENTIFIED** with `ROOT_CAUSE: HEALTH_CHECK`. Fix: align\nthe path\u002Fport\u002FSG to what the application actually serves.\n\n### Step 7: Deployment circuit breaker\n\nService event contains\n`deployment failed: Task failed to start` or\n`service \u003Cname> deployment failed: Circuit Breaker`\n(`deploymentCircuitBreaker: { enable: true, rollback: true }`).\n\nThe circuit breaker is NOT a root cause — it is a rollup signal that\nthe replacement tasks are failing. The actual cause is in the\nunderlying stopped task's `stoppedReason`. ALWAYS fold to the\nunderlying category via Steps 1–6 before declaring\n`ROOT_CAUSE: CIRCUIT_BREAKER`. If the underlying category is\nidentified, emit that category and note the circuit breaker in\n`EVIDENCE`. Reserve `ROOT_CAUSE: CIRCUIT_BREAKER` for the rare case\nwhere the underlying `stoppedReason` is empty or self-contradictory.\n\n### Step 8: Fargate platform version regressions\n\nService recently changed `platformVersion` from a pinned version to\n`LATEST`, or AWS patched `LATEST`. Symptom: tasks that ran fine for\nweeks start failing with no config change.\n\nMoved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) - load on demand (see References below).\n\nConfirm by pinning to the previous platform version and re-deploying.\nIf the failure disappears, **ROOT_CAUSE_IDENTIFIED** with\n`ROOT_CAUSE: PLATFORM_VERSION`. Fix: pin to the previous working\nversion (`platformVersion: 1.4.0` for Fargate); do NOT use `LATEST`\nfor production.\n\n### Step 9: Task definition validation errors\n\nMoved verbatim to [references\u002Ferror-handling.md](references\u002Ferror-handling.md) - load on demand (see References below).\n\n### Step 10: INSUFFICIENT_DATA — when to bail\n\nEmit `INSUFFICIENT_DATA` when:\n\n- The input lacks the cluster \u002F service \u002F task ARN and the symptom is\n  too generic to identify a category.\n- A probe requires operator input (e.g., the application's expected\n  health check path is unknown).\n- The symptom matches no row in the quick navigation table and the\n  describe-tasks output is empty or stale.\n- An AWS Health event is OPEN in the region and may be the cause; the\n  agent cannot confirm without operator-supplied AWS Health access.\n\nALWAYS list the missing inputs and the exact next probe to run.\n\n## Output format\n\nSee the STRICT output contract above. Two worked examples follow.\n\n### Worked example — CannotPullContainerError, ECR endpoint missing\n\n```text\nTARGET: cluster:prod-app \u002F service:payments-api \u002F task:abc123\nVERDICT: ROOT_CAUSE_IDENTIFIED\nROOT_CAUSE: IMAGE_PULL_ENDPOINT\nREASON: Task stoppedReason is `CannotPullContainerError: inspect image\n  ... i\u002Fo timeout`. The task is in a private subnet (subnet-0abc,\n  10.0.20.0\u002F24) without an ECR interface endpoint. The VPC has the s3\n  gateway endpoint but is missing `ecr.api` and `ecr.dkr`; Fargate\n  cannot use a NAT for ECR auth.\nEVIDENCE:\n  - Probe: aws ecs describe-tasks returns stopCode=EssentialContainerExited,\n    stoppedReason contains `CannotPullContainerError: ... i\u002Fo timeout`.\n  - Probe: aws ec2 describe-vpc-endpoints for vpc-0abc returns only the\n    s3 gateway endpoint; ecr.api and ecr.dkr are absent.\n  - Probe: aws iam simulate-principal-policy on the execution role\n    returns allowed for ecr:BatchGetImage (auth is not the issue).\n  - Passing: subnet-0abc has AvailableIpAddressCount: 22; image is\n    480 MB compressed (size is not the issue).\nREMEDIATION:\n  1. Create the two ECR interface endpoints in the VPC:\n     aws ec2 create-vpc-endpoint --vpc-id vpc-0abc \\\n       --service-name com.amazonaws.us-east-1.ecr.api \\\n       --vpc-endpoint-type Interface --subnet-ids subnet-0abc \\\n       --security-group-ids \u003Csg>\n     aws ec2 create-vpc-endpoint --vpc-id vpc-0abc \\\n       --service-name com.amazonaws.us-east-1.ecr.dkr \\\n       --vpc-endpoint-type Interface --subnet-ids subnet-0abc \\\n       --security-group-ids \u003Csg>\n  2. Verify by running a one-off task in the same subnet and watching\n     it transition to RUNNING without a CannotPullContainerError.\nCONFIRM: Before creating the endpoints, emit and await:\n  \"CONFIRM: About to create ecr.api + ecr.dkr interface endpoints in\n   vpc-0abc. Proceed? (yes\u002Fno)\"\n```\n\n### Worked example — INSUFFICIENT_DATA\n\nMoved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md) - load on demand (see References below).\n\n## Pre-flight safety checks\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation\n  (`update-service`, `register-task-definition`, `create-vpc-endpoint`,\n  `put-role-policy`), emit and await operator approval.\n- **Read-only first.** Every probe in the diagnostic tree is read-only.\n- **Updating a service** with a new task definition is the production\n  cutover; prefer `maximumPercent: 100, minimumHealthyPercent: 100`\n  for rolling deploys.\n- **Circuit breaker rollback** is automatic when\n  `deploymentCircuitBreaker.rollback: true`. Do not disable it to\n  \"force through\" a failing deployment.\n- **Capacity provider swaps** can strand in-flight tasks — confirm\n  during a maintenance window.\n- **Bulk remediation batch limit.** When the same root cause affects\n  multiple services, batch into groups of at most 5 and verify between\n  batches.\n\n## Remediation guidance\n\nMoved verbatim to [references\u002Ferror-handling.md](references\u002Ferror-handling.md) - load on demand (see References below).\n\n## References (load on demand)\n\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — expert heuristic and configuration dependency graph, moved verbatim from SKILL.md\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — canonical per-category command scripts (pre-existing), extended with the Step 0 pre-flight listing and all per-step probe commands moved verbatim from SKILL.md\n- [references\u002Ferror-handling.md](references\u002Ferror-handling.md) — Step 9 task-definition validation error table and the ROOT_CAUSE remediation table, moved verbatim from SKILL.md\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — secondary worked example (INSUFFICIENT_DATA block), moved verbatim from SKILL.md\n- [references\u002Ffailure-decision-tree.md](references\u002Ffailure-decision-tree.md) — pre-existing category deep-dives (A-G) with per-category worked examples\n\n## Domain\n\nAWS CloudOps \u002F ECS & Fargate Compute, Task Lifecycle Diagnostics, ENI\n& VPC Networking for Containers, ECR Image Distribution, ECS Deployment\nAutomation.\n\n## AWS documentation\n\n- ECS troubleshooting — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftroubleshooting.html\n- Stopped tasks — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftroubleshooting.html#ts-stopped\n- CannotPullContainerError — https:\u002F\u002Frepost.aws\u002Fknowledge-center\u002Fecs-pull-container-error\n- ENI trunking — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fcontainer-instance-eni.html\n- ECS circuit breaker — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fdeployment-circuit-breaker.html\n- Fargate platform versions — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fplatform_versions.html\n- ECS task execution role — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftask_execution_IAM_role.html\n- ECS task role — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftask-iam-roles.html\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":43},{"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,"when_not_to_use":39,"lifecycle_status":40,"invocation_schema":41,"supports_pipeline":37,"activation_triggers":42},"ecs, compute, troubleshoot, task-failure, fargate, ec2, eni, ecr, circuit-breaker","2","Jacky Chan — AWS Community Builder","aws-cloudops","Compute","0.1.0","ECS, Fargate, EC2 launch type, task stopped, stoppedReason, ResourceInitializationError, CannotPullContainerError, EC2InstanceStateError, ENI trunking, awsvpc, task role, execution role, capacity provider, placement failure, service event, unable to place, CPU oversubscription, memory oversubscription, container health check, deregistered container instance, task definition validation, Fargate platform version, ECR image pull, ECR auth, ECR throttle, ECR size limit, deployment circuit breaker","troubleshoot","high","false","capability","Diagnosing why an ECS task stays in PROVISIONING, transitions to STOPPED, fails placement with \"No ContainerInstances were found\" or \"unable to place a task\", cannot pull a container image (CannotPullContainerError), fails container health checks, hits the deployment circuit breaker, or exits with a non-zero code; interpreting describe-tasks stoppedReason \u002F containers[].reason \u002F lastStatus, or triaging an ECS service event message.","true","ROOT_CAUSE_IDENTIFIED | INSUFFICIENT_DATA","Application-code debugging inside a running container (use CloudWatch Logs and the application's own debugger); EKS pod troubleshooting (use eks-pod-troubleshooter); Fargate capacity reservation sizing (use fargate-cost-optimizer); ECS task-definition IAM posture audits (use ecs-task-definition-auditor); steady-state service-auto-scaling tuning (use autoscaling-policy-deployer).","active","Input: either (a) a symptom description (the failing service\u002Fcluster, the observed state, any error strings from the console), OR (b) a live-account scenario where the agent runs aws ecs describe-tasks \u002F describe-services \u002F describe-task-definition to gather evidence. Output: a deterministic TARGET \u002F VERDICT \u002F ROOT_CAUSE \u002F REASON \u002F EVIDENCE \u002F REMEDIATION block where VERDICT ∈ {ROOT_CAUSE_IDENTIFIED, INSUFFICIENT_DATA} and ROOT_CAUSE names the specific failure category (RESOURCE_INIT_ENI \u002F RESOURCE_INIT_SUBNET_IP \u002F IMAGE_PULL_AUTH \u002F IMAGE_PULL_ENDPOINT \u002F IMAGE_PULL_SIZE \u002F CAPACITY_PLACEMENT \u002F CAPACITY_DEREGISTERED \u002F CONFIG_TASK_ROLE \u002F CONFIG_EXECUTION_ROLE \u002F CONFIG_DEFINITION_INVALID \u002F HEALTH_CHECK \u002F OOM \u002F ExitCode \u002F CIRCUIT_BREAKER \u002F PLATFORM_VERSION \u002F UNKNOWN).","ECS task stopped, ECS task PROVISIONING stuck, ECS task PENDING forever, ResourceInitializationError, CannotPullContainerError, EC2InstanceStateError, unable to place a task, No ContainerInstances were found, Essential container in task exited, ECS health check failing, ECS task crash loop, ECS task OutOfMemory, deployment circuit breaker, service deregistered container instances, Fargate platform version","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline diagnosis works on supplied describe-tasks \u002F describe-services JSON. Live-account diagnosis uses aws ecs describe-tasks, describe-services, describe-task-definition, describe-container-instances, describe-capacity-providers, aws logs get-log-events \u002F filter-log-events, aws elbv2 describe-target-health, aws ecr get-repository-policy \u002F describe-images, aws ec2 describe-subnets \u002F...","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fecs-task-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":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill ecs-task-troubleshooter",{"tool":58,"command":59},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill ecs-task-troubleshooter",{"tool":61,"command":62},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill ecs-task-troubleshooter","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002FSKILL.md",true,[66,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",7233,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Feval\u002Ftest-cases.yaml",{"path":73,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":74,"sourceHtmlUrl":75},"evals\u002Fbaselines\u002Falb-health-check-path-mismatch.md",849,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fbaselines\u002Falb-health-check-path-mismatch.md",{"path":77,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":78,"sourceHtmlUrl":79},"evals\u002Fbaselines\u002Fecr-image-pull-execution-role.md",765,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fbaselines\u002Fecr-image-pull-execution-role.md",{"path":81,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":82,"sourceHtmlUrl":83},"evals\u002Fbaselines\u002Ffargate-essential-container-secret-injection.md",939,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fbaselines\u002Ffargate-essential-container-secret-injection.md",{"path":85,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":86,"sourceHtmlUrl":87},"evals\u002Fbaselines\u002Ffargate-oom-jvm-heap.md",802,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fbaselines\u002Ffargate-oom-jvm-heap.md",{"path":89,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":90,"sourceHtmlUrl":91},"evals\u002Fbaselines\u002Finsufficient-context-need-task-arn.md",859,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fbaselines\u002Finsufficient-context-need-task-arn.md",{"path":93,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":94,"sourceHtmlUrl":95},"evals\u002Feval_config.yaml",2058,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Feval_config.yaml",{"path":97,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":98,"sourceHtmlUrl":99},"evals\u002Fevals.json",4700,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fevals.json",{"path":101,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":102,"sourceHtmlUrl":103},"evals\u002Fprompts\u002Falb-health-check-path-mismatch.md",1523,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fprompts\u002Falb-health-check-path-mismatch.md",{"path":105,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":106,"sourceHtmlUrl":107},"evals\u002Fprompts\u002Fecr-image-pull-execution-role.md",1538,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fprompts\u002Fecr-image-pull-execution-role.md",{"path":109,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":110,"sourceHtmlUrl":111},"evals\u002Fprompts\u002Ffargate-essential-container-secret-injection.md",1711,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fprompts\u002Ffargate-essential-container-secret-injection.md",{"path":113,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":114,"sourceHtmlUrl":115},"evals\u002Fprompts\u002Ffargate-oom-jvm-heap.md",1180,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fprompts\u002Ffargate-oom-jvm-heap.md",{"path":117,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":118,"sourceHtmlUrl":119},"evals\u002Fprompts\u002Finsufficient-context-need-task-arn.md",1155,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fevals\u002Fprompts\u002Finsufficient-context-need-task-arn.md",{"path":121,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":122,"sourceHtmlUrl":123},"examples\u002FREADME.md",7044,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fexamples\u002FREADME.md",{"path":125,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":126,"sourceHtmlUrl":127},"references\u002Fadvanced-patterns.md",4086,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Freferences\u002Fadvanced-patterns.md",{"path":129,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":130,"sourceHtmlUrl":131},"references\u002Fdiagnostic-commands.md",17846,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Freferences\u002Fdiagnostic-commands.md",{"path":133,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":134,"sourceHtmlUrl":135},"references\u002Ferror-handling.md",2899,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Freferences\u002Ferror-handling.md",{"path":137,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":138,"sourceHtmlUrl":139},"references\u002Ffailure-decision-tree.md",18376,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Freferences\u002Ffailure-decision-tree.md",{"path":141,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":142,"sourceHtmlUrl":143},"references\u002Fworked-examples.md",917,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Freferences\u002Fworked-examples.md",{"path":145,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":146,"sourceHtmlUrl":147},"skill.usf.yaml",4559,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-troubleshooter\u002Fskill.usf.yaml",[149,156,163,170,177,184],{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"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":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"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":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":169,"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":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":176,"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":178,"name":179,"nameZh":6,"description":180,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":181,"categories":182,"keywords":183,"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":185,"name":186,"nameZh":6,"description":187,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":188,"categories":189,"keywords":190,"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",[],[]]