---
name: "aws-ecs-fargate-task-def"
description: "Deploy serverless container workloads on AWS ECS Fargate with CloudWatch logs and auto-scaling."
metadata:
  author: "AWS"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create ecs fargate task definition"
  - "configure ecs target tracking scaling"
  - "inject secrets ecs fargate"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# AWS ECS Fargate Task Definitions & Service Auto-Scaling

Configures AWS ECS Fargate: authoring task definitions (CPU/memory shares, container definitions, secrets injection via SSM/SecretsManager), awsvpc networking, Application Load Balancer target groups, and target tracking scaling.

## When to Invoke
Invoke this skill whenever you need to:
- create ecs fargate task definition
- configure ecs target tracking scaling
- inject secrets ecs fargate

## Execution SOP & Rules
1. Define task definition JSON with requiresCompatibilities: ['FARGATE'] and networkMode: 'awsvpc'.
2. Specify executionRoleArn with permissions to pull ECR images and decrypt SSM parameters.
3. Create ECS service attached to Application Load Balancer target group with health check path /healthz.
4. Register scalable target with Application Auto Scaling and attach target tracking metric specification.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
