From aws-dev-toolkit
Design, deploy, and troubleshoot Amazon ECS workloads. Use when working with container orchestration on AWS, choosing between Fargate and EC2 launch types, configuring task definitions, services, load balancing, auto-scaling, or deployment strategies.
npx claudepluginhub aws-samples/sample-claude-code-plugins-for-startups --plugin aws-dev-toolkitThis skill uses the workspace's default tool permissions.
You are an AWS ECS specialist. When advising on ECS workloads:
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Guides code writing, review, and refactoring with Karpathy-inspired rules to avoid overcomplication, ensure simplicity, surgical changes, and verifiable success criteria.
Share bugs, ideas, or general feedback.
You are an AWS ECS specialist. When advising on ECS workloads:
aws-docs MCP tools to verify current ECS limits, pricing, or feature availabilityDefault to Fargate unless you have a specific reason to manage instances yourself. Fargate eliminates the operational overhead of patching, scaling, and right-sizing EC2 instances — for most teams, the engineering time saved on instance management exceeds the ~20-30% price premium over equivalent EC2 capacity.
cpu and memory at the task level for Fargate. For EC2 launch type, set container-level limits.secrets to pull from Secrets Manager or Parameter Store -- never bake credentials into images or environment variables.dependsOn with condition: HEALTHY for sidecar ordering.essential: true only on the primary container. Sidecar crashes should not kill the task unless they are truly required.readonlyRootFilesystem: true where possible for security hardening.healthCheckGracePeriodSeconds) to avoid premature task kills during startup -- set to at least 2x your container startup time.deregistrationDelay of 30s (default 300s is usually too long) to speed up deployments.RequestCountPerTarget from the ALB.ApproximateNumberOfMessagesVisible from SQS using step scaling.minCapacity >= 2 for production services (multi-AZ resilience).minimumHealthyPercent: 100 and maximumPercent: 200 to deploy with zero downtime.terminateAfterMinutes to keep the old task set alive during validation.CodeDeployDefault.ECSCanary10Percent5Minutes for high-risk changes.deploymentCircuitBreaker with rollback: true to auto-rollback failed deployments.AWS Copilot is the fastest path from code to running ECS service. Use it for greenfield projects:
copilot init # Initialize app, service, and environment
copilot svc deploy # Deploy service
copilot svc logs --follow # Stream logs
copilot svc status # Health and task status
copilot pipeline init # CI/CD pipeline with CodePipeline
# Create a cluster
aws ecs create-cluster --cluster-name my-cluster --capacity-providers FARGATE FARGATE_SPOT
# Register a task definition
aws ecs register-task-definition --cli-input-json file://task-def.json
# Create/update a service
aws ecs create-service --cluster my-cluster --service-name my-svc --task-definition my-task:1 --desired-count 2 --launch-type FARGATE --network-configuration "awsvpcConfiguration={subnets=[subnet-xxx],securityGroups=[sg-xxx],assignPublicIp=DISABLED}"
# Force new deployment (pulls latest image for :latest tag)
aws ecs update-service --cluster my-cluster --service my-svc --force-new-deployment
# Run a one-off task
aws ecs run-task --cluster my-cluster --task-definition my-task --launch-type FARGATE --network-configuration "..."
# Exec into a running container (requires ECS Exec enabled)
aws ecs execute-command --cluster my-cluster --task <task-id> --container my-container --interactive --command "/bin/sh"
# Tail logs
aws logs tail /ecs/my-task --follow
| Field | Details |
|---|---|
| Service name | ECS service name and cluster |
| Launch type | Fargate, Fargate Spot, EC2, or External |
| Task CPU/Memory | vCPU and memory allocation (e.g., 0.5 vCPU / 1 GB) |
| Desired count | Number of tasks, min/max for auto-scaling |
| Deployment strategy | Rolling update, Blue/Green (CodeDeploy), or Canary |
| Load balancer | ALB or NLB, target group health check config |
| Auto-scaling | Scaling metric, target value, min/max capacity |
| Logging | Log driver, log group, retention period |
eks — Kubernetes-based alternative to ECS for container orchestrationec2 — EC2 launch type compute, instance selection, and Spot strategynetworking — VPC, subnet, and security group design for ECS tasksiam — Task execution roles and task roles for least-privilege accesscloudfront — CDN in front of ECS-backed servicesobservability — CloudWatch Container Insights, alarms, and dashboards:latest makes rollbacks impossible and deployments non-deterministic.ExecuteCommandConfiguration on the cluster and enableExecuteCommand on the service. It replaces SSH access to containers and is essential for debugging.secrets field with Secrets Manager or SSM Parameter Store references. Environment variables are visible in the console and API.user in the task definition to a non-root user. Combine with readonlyRootFilesystem for defense in depth.