itsmostafa/aws-agent-skills/ecs
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
AWS ECS container orchestration for running Docker containers. Use when deploying containerized applications, configuring task definitions, setting up services, managing clusters, or troubleshooting container issues.
Install
npx vskill@latest install itsmostafa/aws-agent-skills/ecsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
AWS ECS
Amazon Elastic Container Service (ECS) is a fully managed container orchestration service. Run containers on AWS Fargate (serverless) or EC2 instances.
Table of Contents
Core Concepts
Cluster
Logical grouping of tasks or services. Can contain Fargate tasks, EC2 instances, or both.
Task Definition
Blueprint for your application. Defines containers, resources, networking, and IAM roles.
Task
Running instance of a task definition. Can run standalone or as part of a service.
Service
Maintains desired count of tasks. Handles deployments, load balancing, and auto scaling.
Launch Types
| Type | Description | Use Case | |
|---|---|---|---|
| Fargate | Serverless, pay per task | Most workloads | |
| EC2 | Self-managed instances | GPU, Windows, specific requirements |
Common Patterns
Create a Fargate Cluster
AWS CLI:
Register Task Definition
Create Service with Load Balancer
Run Standalone Task
Update Service (Deploy New Image)
Fargate Spot with SQS-Based Scaling
Use FARGATE_SPOT for batch/queue workloads to cut costs ~70%. Always include a fallback to regular FARGATE.
Backlog per task (AWS-recommended): Raw queue depth over-scales. Target-track queue depth / RunningTaskCount via metric math instead; Application Auto Scaling manages the alarms. Requires Container Insights on the cluster (RunningTaskCount in ECS/ContainerInsights). With 0 running tasks the divisor has no data, so this cannot scale from zero; keep the alarm pattern above when min-capacity is 0.
Protect in-flight work from scale-in: the worker sets ProtectionEnabled=true while processing (container agent endpoint $ECS_AGENT_URI/task-protection/v1/state, or aws ecs update-task-protection --cluster <c> --tasks <id> --protection-enabled --expires-in-minutes 60) and clears it when done. Task role needs ecs:GetTaskProtection and ecs:UpdateTaskProtection. Service tasks only.
Fargate Spot interruption handling: Spot tasks receive a SIGTERM 2 minutes before termination. Catch it in your application for graceful shutdown. For SQS consumers, call ChangeMessageVisibility on in-flight messages so they return to the queue rather than timing out.
Auto Scaling
Faster scaling with 20-second metrics: enable high-resolution service metrics, then use ECSServiceAverageCPUUtilizationHighResolution or ECSServiceAverageMemoryUtilizationHighResolution as the PredefinedMetricType. On an existing service the --monitoring change triggers a deployment; create the high-res policy only after it completes. Not supported with CODE_DEPLOY/EXTERNAL deployment controllers. Extra CloudWatch charges apply.
CLI Reference
Cluster Management
| Command | Description | |
|---|---|---|
aws ecs create-cluster | Create cluster | |
aws ecs describe-clusters | Get cluster details | |
aws ecs list-clusters | List clusters | |
aws ecs delete-cluster | Delete cluster |
Task Definitions
| Command | Description | |
|---|---|---|
aws ecs register-task-definition | Create task definition | |
aws ecs describe-task-definition | Get task definition | |
aws ecs list-task-definitions | List task definitions | |
aws ecs deregister-task-definition | Deregister version |
Services
| Command | Description | |
|---|---|---|
aws ecs create-service | Create service | |
aws ecs update-service | Update service | |
aws ecs describe-services | Get service details | |
aws ecs delete-service | Delete service |
Tasks
| Command | Description | |
|---|---|---|
aws ecs run-task | Run standalone task | |
aws ecs stop-task | Stop running task | |
aws ecs describe-tasks | Get task details | |
aws ecs list-tasks | List tasks |
Best Practices
Security
- Use task roles for AWS API access (not access keys)
- Use execution roles for ECR/Secrets access
- Store secrets in Secrets Manager or Parameter Store
- Use private subnets with NAT gateway
- Enable CloudTrail for API auditing
- Cap task size with IAM —
ecs:task-cpu/ecs:task-memorycondition keys apply toRunTaskandStartTaskas well asRegisterTaskDefinition,CreateService,UpdateService
Performance
- Right-size CPU/memory — monitor and adjust
- Use Fargate Spot for fault-tolerant workloads (70% savings)
- Enable container insights for monitoring
- Use service discovery for internal communication
Reliability
- Deploy across multiple AZs
- Configure health checks properly
- Set appropriate deregistration delay
- Use circuit breaker for deployments
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ecs/SKILL.md
Popularity
- Repository stars
- 1,158
- Repository forks
- 443
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 22 Mar 2026, 7 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/itsmostafa/aws-agent-skills/ecs)