giuseppe-trisciuoglio/developer-kit/aws-cloudformation-ecs
Claude Code and agent skill by giuseppe-trisciuoglio/developer-kit
- community
Checking that the SKILL.md file is still in the repository.
Provides AWS CloudFormation patterns for ECS clusters, task definitions, services, container definitions, auto scaling, blue/green deployments, CodeDeploy integration, ALB integration, service discovery, monitoring, logging, template structure, parameters, outputs, and cross-stack references. Use when creating ECS clusters with CloudFormation, configuring Fargate and EC2 launch types, implementing blue/green deployments, managing auto scaling, integrating with ALB and NLB, and implementing ECS best practices.
Install
npx vskill@latest install giuseppe-trisciuoglio/developer-kit/aws-cloudformation-ecsSKILL.md
The same SKILL.md was published earlier as giuseppe-trisciuoglio/developer-kit/aws-cloudformation-ecs.
AWS CloudFormation ECS
Overview
Provides CloudFormation patterns for ECS clusters, task definitions, services, container definitions, auto scaling, blue/green deployments, ALB integration, monitoring, and cross-stack references.
When to Use
- Creating or updating ECS clusters with CloudFormation
- Configuring Fargate/EC2 launch types and capacity providers
- Deploying services with ALB/NLB integration or blue/green deployments
- Implementing auto scaling for ECS services
- Setting up monitoring with Container Insights
Instructions
Follow these steps to create ECS infrastructure with CloudFormation:
1. Define ECS Cluster Parameters
Specify launch type, networking, and capacity settings:
2. Create ECS Cluster
Define the cluster infrastructure:
3. Create Task Definition
Define container configurations:
Validate task definition syntax before proceeding:
4. Configure Execution Roles
Set up IAM roles for task execution:
5. Create ECS Service
Define the service configuration:
6. Configure Load Balancer
Set up ALB for traffic distribution:
7. Implement Auto Scaling
Configure Application Auto Scaling:
8. Configure Monitoring
Enable CloudWatch Container Insights:
Before deployment: Create a change set to preview changes:
Best Practices
Task Definition
- Use
Familynaming for version tracking and immutable deployments - Keep task definition under 1 KB (CloudFormation limit) by referencing external configs
- Configure
HealthCheckin container definitions for ECS health monitoring - Set both
CpuandMemoryat task level for Fargate
Service Deployment
- Enable
DeploymentCircuitBreakerfor automatic rollback on failures - Use
HealthCheckGracePeriodSecondsmatching application startup time - Configure
MinimumHealthyPercent(100) andMaximumPercent(200) for zero-downtime updates - Reference task definition by logical ID only—ECS automatically uses latest revision
Networking
- Always use
awsvpcnetwork mode for Fargate - Place tasks in private subnets with NAT gateway for outbound access
- Configure security groups to allow only required ports (not 0.0.0.0/0)
Scaling
- Use Fargate Spot with base capacity of 1 on-demand for cost optimization
- Set
MaxHealthyDurationon capacity provider strategy for Spot interruption handling - Monitor
STEADY_STATEfailures in CloudWatch for task startup issues
Constraints and Warnings
Resource Limits
- Task definition size limit: 1 KB when using CloudFormation (use ParameterStore/Secrets Manager for large configs)
- Maximum 10 containers per task definition in Fargate
- CPU must be specified for Fargate tasks (256-4096 units, in 1024 increments)
- Memory must be allocated (512-30720 MB depending on CPU)
Operational Limits
- ENI limits apply per subnet—plan for at least 1 ENI per task in each AZ
- Fargate Spot tasks receive 2-minute interruption notice—implement graceful shutdown signals (SIGTERM)
- Service updates require new task definition revision—cannot modify existing versions
DesiredCountupdates during deployment may conflict with auto scaling policies
CloudFormation-Specific
- Cross-stack references required for VPC IDs, Subnet IDs, and Security Group IDs passed between stacks
- Use
!GetAttfor referencing stack outputs in same template - Ensure IAM role ARNs use
Fn::Subwith stack name for portability
Examples
Minimal Fargate Service
ECS with ALB Integration
References
For detailed implementation guidance, see:
- [constraints.md](references/constraints.md) - Resource limits (task definition size, container limits, memory limits, CPU limits), operational constraints (service updates, ENI limits, task start time, scaling delays), security constraints (IAM roles, network mode, security groups, secrets rotation), cost considerations (Fargate pricing, data transfer, ECR storage, monitoring), deployment constraints (blue/green requirements, CodeDeploy integration, rollbacks, task drift), and availability constraints (Fargate Spot, multi-AZ, health checks, service discovery)
Related Resources
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 repositoryCheckingplugins/developer-kit-aws/skills/aws-cloudformation/aws-cloudformation-ecs/SKILL.md
Popularity
- Repository stars
- 298
- Repository forks
- 35
- 7-day trend score
- 29
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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/giuseppe-trisciuoglio/developer-kit/aws-cloudformation-ecs)