Terminal
Terminal/Skill
Reviews an Amazon ECS service across six pillars using read only AWS calls, producing a scored report with remediation steps.
By Amazon Web Services
Works with
npx skills add aws/tools-for-devops-agent --skill ecs-operation-reviewExecute a comprehensive Amazon ECS operations review across the 6 review pillars with ✓/✗/N/A observations, 7-day CloudWatch baseline metrics, and alarm threshold recommendations for IDR onboarding.
review-common baseline (tagging, encryption, IAM least-privilege, alarms, logging, cost) via existing ECS check IDs. Read for any full review / CWR.Do NOT read all 6 pillar files at once. Read references/checks.md (the index) first, then read each references/pillars/<pillar>.md file ONE AT A TIME as you run that pillar's checks. Agent may add checks beyond the baseline using the next sequential ID in the pillar.
This skill is self-contained — the procedural workflow is embedded below (this copy lives in aws-operations-review and does not depend on any external agent-sops/ SOP). Execute the steps in order; this skill's references/ files supply the check definitions and alarm thresholds.
arn:aws*:ecs:*:*:service/*/*); extract cluster name and service name. Halt if the ARN region does not match the region parameter.ecs.describeServices) MUST succeed before any other call. Save each response verbatim to the scratchpad. On non-Tier-1 access/API errors, mark dependent checks N/A and continue.launchType + capacityProviderStrategy + ecs.describeCapacityProviders: Fargate (FARGATE/FARGATE_SPOT), EC2 ASG capacity provider (autoScalingGroupProvider), Managed Instances (managedInstancesProvider), launchType-only EC2/Fargate (no strategy), or ECS Anywhere (EXTERNAL). Mixed strategies are valid — record every platform present. This decision drives check applicability in every pillar (full rules in references/checks.md). Record the platform in the report header.references/checks.md (the index) first, then for EACH pillar read its references/pillars/<pillar>.md file one at a time and apply its checks against the collected data, recording ✓ / ✗ / N/A with an observation. Use the exact check IDs and severities; mark platform-specific checks N/A where they don't apply (per the resolved compute platform). May add checks beyond the baseline.references/report-format.md exactly (Workload Details, per-pillar ✓/✗/N/A scorecards for all 6 pillars, Prioritized Action Plan, Detailed Findings, Recommended CloudWatch Alarms from references/alarm-thresholds.md, Access Limitations, Review Summary). Before finalizing, run the report-format Coverage gate — every check ID across all 6 pillars must appear in a scorecard as ✓/✗/N/A (including passes; no pillar dropped or truncated), the alarms table must be present, every ✗ needs a detailed finding block, and the shared review-common baseline must be accounted for per references/common-checks-coverage.md (all eight common checks covered via their ECS equivalents or ⚪ N/A with a reason). Default to a Markdown artifact; render DOCX only if asked (build from the same content). Strip internal check IDs from the customer-facing report. Return the Review Summary with verified counts, then delete the scratchpad.Review Pillars:
All calls below are public AWS API operations. Use read-only (describe/list/get) operations only, via the AWS CLI, an AWS SDK (e.g. boto3), or an AWS API MCP with least-privilege read-only credentials.
| API | Tier | Purpose |
|---|---|---|
| ecs.describeServices | 1 | Foundation — service config, task def, LB, deployment, network |
| ecs.describeTaskDefinition | 2 | Container defs, CPU/memory, roles, log config, network mode |
| ecs.describeClusters | 2 | Cluster settings, Container Insights, capacity providers, Exec logging config (include=["CONFIGURATIONS"] for OPS9) |
| ecs.listTasks | 2 | Running task ARNs for the service |
| ecs.describeTasks | 3 | Task health, AZ spread, connectivity status |
| ecs.listContainerInstances | 2 | Container instance ARNs for EC2 launch type clusters |
| ecs.describeContainerInstances | 3 | Agent version, AMI ID, instance status (EC2 only) |
| ecs.describeCapacityProviders | 2 | Compute platform classification (ASG vs Managed Instances vs Fargate), managed termination protection (REL12), managed scaling status/targetCapacity (PERF9), MI network config (REL14) |
| API | Tier | Purpose |
|---|---|---|
| applicationautoscaling.describeScalingPolicies | 2 | Auto scaling policies for the service |
| applicationautoscaling.describeScalableTargets | 2 | Min/max capacity configuration |
| API | Tier | Purpose |
|---|---|---|
| alb.describeTargetHealth | 2 | Target health for service tasks behind ALB/NLB (skip if no LB configured) |
| alb.describeTargetGroups | 2 | Target group details including LoadBalancerArns — used to determine LB type (ALB vs NLB) by ARN path segment: /app/ = ALB, /net/ = NLB, for correct alarm recommendations (skip if no LB configured) |
| elbv2.describeListeners | 2 | Listener protocol/port for the LB fronting the service — HTTPS/TLS vs plaintext HTTP/TCP for encryption-in-transit (SEC20); uses LoadBalancerArns from describeTargetGroups (skip if no LB configured) |
| API | Tier | Purpose |
|---|---|---|
| iam.listAttachedRolePolicies | 4a | Managed policies on execution/task roles |
| iam.listRolePolicies | 4a | Inline policy names on execution/task roles |
| iam.getRolePolicy | 4b | Inline policy document for execution/task roles |
| API | Tier | Purpose |
|---|---|---|
| ecr.describeRepositories | 3 | Image scanning config, tag immutability for container image repos |
| API | Tier | Purpose |
|---|---|---|
| ec2.describeSecurityGroups | 2 | Security group rules for service ENIs (awsvpc mode) |
| ec2.describeSubnets | 2 | Subnet AZ distribution for service network config |
| ec2.describeVpcEndpoints | 3 | VPC endpoints for ECR, CloudWatch Logs, Secrets Manager (uses VPC ID from describeSubnets) |
| ec2.describeRouteTables | 3 | Route table entries for NAT/internet access assessment |
| ec2.describeNatGateways | 3 | NAT Gateway availability for private subnets |
| ec2.describeImages | 4 | AMI creation date for container instance AMI currency check (EC2 only, uses imageId from describeContainerInstances) |
| ec2.describeVolumes | 3 | EBS volume encryption status for task-attached / container-instance volumes (SEC17) |
| ec2.describeFlowLogs | 3 | VPC Flow Logs enablement for the service VPC (SEC18, uses VPC ID from describeSubnets) |
| API | Tier | Purpose |
|---|---|---|
| cloudwatch.describeAlarms | 2 | Existing alarms for ECS service |
| cloudwatch.getMetricStatistics | 5 | 7-day baseline: CPU, memory, task count; plus CapacityProviderReservation (AWS/ECS/ManagedScaling) for EC2 ASG capacity providers (PERF10) |
| API | Tier | Purpose |
|---|---|---|
| logs.describeLogGroups | 3 | Log retention setting and Logs Insights query targeting for the awslogs group (OBS8, ADD6 — uses awslogs-group from task definition) |
| API | Tier | Purpose |
|---|---|---|
| guardduty.listDetectors | 2 | Detector presence in region (SEC19) |
| guardduty.getDetector | 2 | Runtime Monitoring feature status for ECS (SEC19 — uses detector ID from listDetectors) |
| API | Tier | Purpose |
|---|---|---|
| computeoptimizer.getECSServiceRecommendations | 2 | ECS service task CPU/memory rightsizing recommendations (PERF8) |
| Tool | Purpose |
|---|---|
| aws___search_documentation | Search across all AWS documentation with optional topic-based filtering |
| aws___read_documentation | Retrieve and convert AWS documentation pages to markdown |
| aws___recommend | Get content recommendations for AWS documentation pages |
| aws___list_regions | Retrieve a list of all AWS regions |
| aws___get_regional_availability | Retrieve AWS regional availability information |
Tier 1: ecs.describeServices (FOUNDATION — must complete first)
├─ extracts: taskDefinition ARN, clusterArn, loadBalancers,
│ desiredCount, launchType, networkConfiguration, tags
│
├─► Tier 2 (parallel): ecs.describeTaskDefinition, ecs.describeClusters,
│ ecs.listTasks, cloudwatch.describeAlarms,
│ applicationautoscaling.describeScalingPolicies,
│ applicationautoscaling.describeScalableTargets,
│ ecs.describeCapacityProviders (compute platform classification;
│ ASG providers — REL12/PERF9; Managed Instances providers — REL14),
│ guardduty.listDetectors ─► guardduty.getDetector (SEC19),
│ computeoptimizer.getECSServiceRecommendations (PERF8),
│ alb.describeTargetHealth (if LB configured),
│ alb.describeTargetGroups (if LB configured — resolves ALB vs NLB type from LoadBalancerArns: /app/ = ALB, /net/ = NLB; also deregistration delay for REL13),
│ elbv2.describeListeners (if LB configured — listener protocol for encryption-in-transit SEC20),
│ ec2.describeSecurityGroups (from networkConfiguration.securityGroups),
│ ec2.describeSubnets (from networkConfiguration.subnets),
│ ecs.listContainerInstances (EC2 launch type only)
│ │
│ ├─► Tier 3: ecs.describeTasks (using task ARNs from listTasks)
│ │ ecs.describeContainerInstances (EC2 only, using instance ARNs from listContainerInstances)
│ │ ecr.describeRepositories (using repo name from task definition image URI)
│ │ ec2.describeVpcEndpoints (using VPC ID from describeSubnets)
│ │ ec2.describeRouteTables (using subnet IDs from describeSubnets)
│ │ ec2.describeNatGateways (using VPC ID from describeSubnets)
│ │ ec2.describeFlowLogs (using VPC ID from describeSubnets — SEC18)
│ │ ec2.describeVolumes (task-attached / container-instance EBS encryption — SEC17)
│ │ logs.describeLogGroups (using awslogs-group from task definition — OBS8, ADD6)
│ │
│ ├─► Tier 4 (EC2 only): ec2.describeImages (using imageId from describeContainerInstances)
│ │
│ └─► Tier 4a (parallel): iam.listAttachedRolePolicies (execution + task role),
│ iam.listRolePolicies (execution + task role)
│ │
│ └─► Tier 4b: iam.getRolePolicy (execution + task role)
│ (uses policy names from listRolePolicies)
│
└─► Tier 5 (per-metric loop): cloudwatch.getMetricStatistics
When AWS API calls return access denied or authorization errors:
The agent produces a per-service review artifact (Markdown by default; DOCX if asked) containing: service configuration summary, all 6 review pillar scorecards (✓/✗/N/A with observations, every check including passes), 7-day baseline metrics, the recommended-alarms table with clickable doc links, and priority action items. A Review Summary with verified counts is returned to the orchestrator.
aws___search_documentation) to supplement the doc links provided in checks.mddoc_url column from references/alarm-thresholds.md as the canonical link targetecs.describeServices fails after retries: HALT workflow — delete {{scratchpad_dir}}/ and return error to orchestratorpython-docx, retry with --user on install failure) when a DOCX deliverable was explicitly requested{{output_directory}}/ (Markdown by default; DOCX only if requested){{scratchpad_dir}}/ deleted after report verified