[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NW50Z1NEW4D4DKQKY6J66J":3,"skill-same:01M6NW50Z1NEW4D4DKQKY6J66J":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":22,"commitSha":52,"skillDirectory":53,"forksCount":13,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":56,"install":57,"resources":70},"01M6NW50Z1NEW4D4DKQKY6J66J","aws-ecs-fargate",null,"Deploy containers on ECS and Fargate. Configure task definitions, services, and load balancing. Use when running containerized workloads on AWS.","duc-duy-1612\u002FOnline-Delivery-Systems-Web","duc-duy-1612","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192231384?v=4","01M6NSDKQQDKVTHZ8DZMZ1VYY6","01M6NSDKW8DDVTQHBT1HBDDJPT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Faws-ecs-fargate\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"aws ecs fargate","aws","ecs","aws ecs","main","relevant","scripts","critical","os","platform","load balancing","containers","community","agent-skills","only","configure","access","devops-security","license","security","2026-11-10 10:12:30",false,"---\nname: aws-ecs-fargate\ndescription: Deploy containers on ECS and Fargate. Configure task definitions, services,\n  and load balancing. Use when running containerized workloads on AWS.\ncategory: devops\nrisk: critical\nsource: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\nsource_repo: BagelHole\u002FDevOps-Security-Agent-Skills\nsource_type: community\ndate_added: '2026-09-20'\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE\ncompatibility: Requires the relevant OS\u002Fplatform tooling and privileged access where\n  noted. Docs-only; helper scripts and templates not bundled.\nmetadata:\n  author: devops-skills\n  version: '1.0'\n---\n\n# AWS ECS & Fargate\n\nRun containerized applications on Amazon ECS with Fargate serverless compute or EC2 launch type.\n\n## When to Use This Skill\n\n- Deploying Docker containers to AWS without managing servers (Fargate)\n- Running microservices with service discovery and load balancing\n- Setting up blue\u002Fgreen or rolling deployments for containerized apps\n- Configuring auto-scaling for container workloads\n- Migrating from docker-compose or Kubernetes to ECS\n- Troubleshooting task failures, health check issues, or networking problems\n\n## Prerequisites\n\n- AWS CLI v2 installed and configured\n- Docker installed for building and pushing images\n- IAM permissions: `ecs:*`, `ecr:*`, `elasticloadbalancing:*`, `logs:*`, `iam:PassRole`\n- An ECR repository for storing container images\n- A VPC with subnets and an ALB (see aws-vpc (`aws-vpc`))\n\n## Cluster Setup\n\n```bash\n# Create an ECS cluster with Container Insights enabled\naws ecs create-cluster \\\n  --cluster-name production \\\n  --capacity-providers FARGATE FARGATE_SPOT \\\n  --default-capacity-provider-strategy '[\n    {\"capacityProvider\": \"FARGATE\", \"weight\": 1, \"base\": 2},\n    {\"capacityProvider\": \"FARGATE_SPOT\", \"weight\": 3}\n  ]' \\\n  --settings '[{\"name\": \"containerInsights\", \"value\": \"enabled\"}]'\n\n# List clusters\naws ecs list-clusters\n\n# Describe cluster details\naws ecs describe-clusters --clusters production --include STATISTICS ATTACHMENTS\n```\n\n## Push Image to ECR\n\n```bash\n# Create ECR repository\naws ecr create-repository \\\n  --repository-name myapp \\\n  --image-scanning-configuration scanOnPush=true \\\n  --encryption-configuration encryptionType=KMS\n\n# Authenticate Docker to ECR\naws ecr get-login-password --region us-east-1 | \\\n  docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com\n\n# Build, tag, and push\ndocker build -t myapp:latest .\ndocker tag myapp:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com\u002Fmyapp:latest\ndocker push 123456789012.dkr.ecr.us-east-1.amazonaws.com\u002Fmyapp:latest\n```\n\n## Task Definition\n\n```json\n{\n  \"family\": \"myapp\",\n  \"networkMode\": \"awsvpc\",\n  \"requiresCompatibilities\": [\"FARGATE\"],\n  \"cpu\": \"512\",\n  \"memory\": \"1024\",\n  \"executionRoleArn\": \"arn:aws:iam::123456789012:role\u002FecsTaskExecutionRole\",\n  \"taskRoleArn\": \"arn:aws:iam::123456789012:role\u002FecsTaskRole\",\n  \"containerDefinitions\": [\n    {\n      \"name\": \"myapp\",\n      \"image\": \"123456789012.dkr.ecr.us-east-1.amazonaws.com\u002Fmyapp:latest\",\n      \"essential\": true,\n      \"portMappings\": [\n        {\n          \"containerPort\": 8080,\n          \"protocol\": \"tcp\"\n        }\n      ],\n      \"environment\": [\n        {\"name\": \"NODE_ENV\", \"value\": \"production\"},\n        {\"name\": \"PORT\", \"value\": \"8080\"}\n      ],\n      \"secrets\": [\n        {\n          \"name\": \"DB_PASSWORD\",\n          \"valueFrom\": \"arn:aws:secretsmanager:us-east-1:123456789012:secret:myapp\u002Fdb-password\"\n        },\n        {\n          \"name\": \"API_KEY\",\n          \"valueFrom\": \"arn:aws:ssm:us-east-1:123456789012:parameter\u002Fmyapp\u002Fapi-key\"\n        }\n      ],\n      \"healthCheck\": {\n        \"command\": [\"CMD-SHELL\", \"curl -f http:\u002F\u002Flocalhost:8080\u002Fhealth || exit 1\"],\n        \"interval\": 30,\n        \"timeout\": 5,\n        \"retries\": 3,\n        \"startPeriod\": 60\n      },\n      \"logConfiguration\": {\n        \"logDriver\": \"awslogs\",\n        \"options\": {\n          \"awslogs-group\": \"\u002Fecs\u002Fmyapp\",\n          \"awslogs-region\": \"us-east-1\",\n          \"awslogs-stream-prefix\": \"ecs\",\n          \"awslogs-create-group\": \"true\"\n        }\n      },\n      \"ulimits\": [\n        {\"name\": \"nofile\", \"softLimit\": 65536, \"hardLimit\": 65536}\n      ]\n    }\n  ]\n}\n```\n\n```bash\n# Register the task definition\naws ecs register-task-definition --cli-input-json file:\u002F\u002Ftask-definition.json\n\n# List task definition revisions\naws ecs list-task-definitions --family-prefix myapp\n\n# Deregister an old revision\naws ecs deregister-task-definition --task-definition myapp:1\n```\n\n## Create Service with ALB\n\n```bash\n# Create the CloudWatch log group first\naws logs create-log-group --log-group-name \u002Fecs\u002Fmyapp\naws logs put-retention-policy --log-group-name \u002Fecs\u002Fmyapp --retention-in-days 30\n\n# Create ECS service with load balancer\naws ecs create-service \\\n  --cluster production \\\n  --service-name myapp \\\n  --task-definition myapp:2 \\\n  --desired-count 3 \\\n  --launch-type FARGATE \\\n  --platform-version LATEST \\\n  --deployment-configuration '{\n    \"deploymentCircuitBreaker\": {\"enable\": true, \"rollback\": true},\n    \"maximumPercent\": 200,\n    \"minimumHealthyPercent\": 100\n  }' \\\n  --network-configuration '{\n    \"awsvpcConfiguration\": {\n      \"subnets\": [\"subnet-private-a\", \"subnet-private-b\"],\n      \"securityGroups\": [\"sg-app\"],\n      \"assignPublicIp\": \"DISABLED\"\n    }\n  }' \\\n  --load-balancers '[{\n    \"targetGroupArn\": \"arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup\u002Fmyapp-tg\u002Fabc123\",\n    \"containerName\": \"myapp\",\n    \"containerPort\": 8080\n  }]' \\\n  --service-registries '[{\n    \"registryArn\": \"arn:aws:servicediscovery:us-east-1:123456789012:service\u002Fsrv-abc123\"\n  }]' \\\n  --enable-execute-command \\\n  --propagate-tags SERVICE\n```\n\n## Deployments\n\n```bash\n# Rolling update - update task definition and force new deployment\naws ecs update-service \\\n  --cluster production \\\n  --service myapp \\\n  --task-definition myapp:3 \\\n  --force-new-deployment\n\n# Watch deployment progress\naws ecs describe-services \\\n  --cluster production \\\n  --services myapp \\\n  --query \"services[0].deployments[].{Status:status,Running:runningCount,Desired:desiredCount,TaskDef:taskDefinition}\" \\\n  --output table\n\n# Wait for service to stabilize\naws ecs wait services-stable --cluster production --services myapp\n\n# Exec into a running container for debugging\naws ecs execute-command \\\n  --cluster production \\\n  --task arn:aws:ecs:us-east-1:123456789012:task\u002Fproduction\u002Fabc123 \\\n  --container myapp \\\n  --interactive \\\n  --command \"\u002Fbin\u002Fsh\"\n```\n\n## Auto Scaling\n\n```bash\n# Register ECS service as a scalable target\naws application-autoscaling register-scalable-target \\\n  --service-namespace ecs \\\n  --resource-id service\u002Fproduction\u002Fmyapp \\\n  --scalable-dimension ecs:service:DesiredCount \\\n  --min-capacity 2 \\\n  --max-capacity 20\n\n# Target tracking policy - scale on CPU utilization\naws application-autoscaling put-scaling-policy \\\n  --service-namespace ecs \\\n  --resource-id service\u002Fproduction\u002Fmyapp \\\n  --scalable-dimension ecs:service:DesiredCount \\\n  --policy-name cpu-target-tracking \\\n  --policy-type TargetTrackingScaling \\\n  --target-tracking-scaling-policy-configuration '{\n    \"PredefinedMetricSpecification\": {\n      \"PredefinedMetricType\": \"ECSServiceAverageCPUUtilization\"\n    },\n    \"TargetValue\": 70.0,\n    \"ScaleInCooldown\": 300,\n    \"ScaleOutCooldown\": 60\n  }'\n\n# Scale on request count per target (ALB)\naws application-autoscaling put-scaling-policy \\\n  --service-namespace ecs \\\n  --resource-id service\u002Fproduction\u002Fmyapp \\\n  --scalable-dimension ecs:service:DesiredCount \\\n  --policy-name request-count-tracking \\\n  --policy-type TargetTrackingScaling \\\n  --target-tracking-scaling-policy-configuration '{\n    \"PredefinedMetricSpecification\": {\n      \"PredefinedMetricType\": \"ALBRequestCountPerTarget\",\n      \"ResourceLabel\": \"app\u002Fmy-alb\u002Fabc123\u002Ftargetgroup\u002Fmyapp-tg\u002Fdef456\"\n    },\n    \"TargetValue\": 1000.0,\n    \"ScaleInCooldown\": 300,\n    \"ScaleOutCooldown\": 60\n  }'\n```\n\n## Terraform ECS Fargate Service\n\n```hcl\nresource \"aws_ecs_cluster\" \"main\" {\n  name = \"production\"\n\n  setting {\n    name  = \"containerInsights\"\n    value = \"enabled\"\n  }\n}\n\nresource \"aws_ecs_task_definition\" \"myapp\" {\n  family                   = \"myapp\"\n  network_mode             = \"awsvpc\"\n  requires_compatibilities = [\"FARGATE\"]\n  cpu                      = 512\n  memory                   = 1024\n  execution_role_arn       = aws_iam_role.ecs_execution.arn\n  task_role_arn            = aws_iam_role.ecs_task.arn\n\n  container_definitions = jsonencode([{\n    name      = \"myapp\"\n    image     = \"${aws_ecr_repository.myapp.repository_url}:latest\"\n    essential = true\n\n    portMappings = [{\n      containerPort = 8080\n      protocol      = \"tcp\"\n    }]\n\n    logConfiguration = {\n      logDriver = \"awslogs\"\n      options = {\n        awslogs-group         = aws_cloudwatch_log_group.myapp.name\n        awslogs-region        = \"us-east-1\"\n        awslogs-stream-prefix = \"ecs\"\n      }\n    }\n\n    healthCheck = {\n      command     = [\"CMD-SHELL\", \"curl -f http:\u002F\u002Flocalhost:8080\u002Fhealth || exit 1\"]\n      interval    = 30\n      timeout     = 5\n      retries     = 3\n      startPeriod = 60\n    }\n  }])\n}\n\nresource \"aws_ecs_service\" \"myapp\" {\n  name            = \"myapp\"\n  cluster         = aws_ecs_cluster.main.id\n  task_definition = aws_ecs_task_definition.myapp.arn\n  desired_count   = 3\n  launch_type     = \"FARGATE\"\n\n  deployment_circuit_breaker {\n    enable   = true\n    rollback = true\n  }\n\n  network_configuration {\n    subnets          = aws_subnet.private[*].id\n    security_groups  = [aws_security_group.app.id]\n    assign_public_ip = false\n  }\n\n  load_balancer {\n    target_group_arn = aws_lb_target_group.myapp.arn\n    container_name   = \"myapp\"\n    container_port   = 8080\n  }\n\n  enable_execute_command = true\n  propagate_tags         = \"SERVICE\"\n}\n```\n\n## Viewing Logs\n\n```bash\n# Tail logs from CloudWatch\naws logs tail \u002Fecs\u002Fmyapp --follow --since 1h\n\n# Get logs for a specific task\naws logs get-log-events \\\n  --log-group-name \u002Fecs\u002Fmyapp \\\n  --log-stream-name \"ecs\u002Fmyapp\u002Fabc123def456\" \\\n  --start-from-head\n\n# Filter logs for errors\naws logs filter-log-events \\\n  --log-group-name \u002Fecs\u002Fmyapp \\\n  --filter-pattern \"ERROR\" \\\n  --start-time $(date -d '1 hour ago' +%s000)\n```\n\n## Troubleshooting\n\n| Problem | Cause | Fix |\n|---|---|---|\n| Task stuck in PROVISIONING | No available capacity in subnets | Check subnet availability and capacity provider |\n| Task fails immediately | Container crashes on startup | Check CloudWatch logs; run image locally first |\n| Health check failing | App not ready within startPeriod | Increase `startPeriod`; verify health endpoint |\n| Cannot pull ECR image | Execution role missing ECR permissions | Attach `AmazonECSTaskExecutionRolePolicy` |\n| Service stuck at 0 running | Security group blocks ALB health check | Allow ALB SG to reach container port |\n| Exec command fails | SSM agent not initialized | Ensure `enableExecuteCommand` is true; check task role |\n| High Fargate costs | Not using Fargate Spot for tolerant workloads | Add FARGATE_SPOT capacity provider |\n| Container OOM killed | Memory limit too low | Increase `memory` in task definition; check for leaks |\n| Slow deployments | minimumHealthyPercent too high | Set to 50% for faster rolling updates |\n\n## Related Skills\n\n- docker-management (`docker-management`) - Container fundamentals\n- container-registries (`container-registries`) - ECR and image management\n- aws-vpc (`aws-vpc`) - Networking for ECS tasks\n- aws-iam (`aws-iam`) - Task and execution roles\n- terraform-aws (`terraform-aws`) - Infrastructure as Code deployment\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n","# AWS ECS & Fargate\n\nRun containerized applications on Amazon ECS with Fargate serverless compute or EC2 launch type.\n\n## When to Use This Skill\n\n- Deploying Docker containers to AWS without managing servers (Fargate)\n- Running microservices with service discovery and load balancing\n- Setting up blue\u002Fgreen or rolling deployments for containerized apps\n- Configuring auto-scaling for container workloads\n- Migrating from docker-compose or Kubernetes to ECS\n- Troubleshooting task failures, health check issues, or networking problems\n\n## Prerequisites\n\n- AWS CLI v2 installed and configured\n- Docker installed for building and pushing images\n- IAM permissions: `ecs:*`, `ecr:*`, `elasticloadbalancing:*`, `logs:*`, `iam:PassRole`\n- An ECR repository for storing container images\n- A VPC with subnets and an ALB (see aws-vpc (`aws-vpc`))\n\n## Cluster Setup\n\n```bash\n# Create an ECS cluster with Container Insights enabled\naws ecs create-cluster \\\n  --cluster-name production \\\n  --capacity-providers FARGATE FARGATE_SPOT \\\n  --default-capacity-provider-strategy '[\n    {\"capacityProvider\": \"FARGATE\", \"weight\": 1, \"base\": 2},\n    {\"capacityProvider\": \"FARGATE_SPOT\", \"weight\": 3}\n  ]' \\\n  --settings '[{\"name\": \"containerInsights\", \"value\": \"enabled\"}]'\n\n# List clusters\naws ecs list-clusters\n\n# Describe cluster details\naws ecs describe-clusters --clusters production --include STATISTICS ATTACHMENTS\n```\n\n## Push Image to ECR\n\n```bash\n# Create ECR repository\naws ecr create-repository \\\n  --repository-name myapp \\\n  --image-scanning-configuration scanOnPush=true \\\n  --encryption-configuration encryptionType=KMS\n\n# Authenticate Docker to ECR\naws ecr get-login-password --region us-east-1 | \\\n  docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com\n\n# Build, tag, and push\ndocker build -t myapp:latest .\ndocker tag myapp:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com\u002Fmyapp:latest\ndocker push 123456789012.dkr.ecr.us-east-1.amazonaws.com\u002Fmyapp:latest\n```\n\n## Task Definition\n\n```json\n{\n  \"family\": \"myapp\",\n  \"networkMode\": \"awsvpc\",\n  \"requiresCompatibilities\": [\"FARGATE\"],\n  \"cpu\": \"512\",\n  \"memory\": \"1024\",\n  \"executionRoleArn\": \"arn:aws:iam::123456789012:role\u002FecsTaskExecutionRole\",\n  \"taskRoleArn\": \"arn:aws:iam::123456789012:role\u002FecsTaskRole\",\n  \"containerDefinitions\": [\n    {\n      \"name\": \"myapp\",\n      \"image\": \"123456789012.dkr.ecr.us-east-1.amazonaws.com\u002Fmyapp:latest\",\n      \"essential\": true,\n      \"portMappings\": [\n        {\n          \"containerPort\": 8080,\n          \"protocol\": \"tcp\"\n        }\n      ],\n      \"environment\": [\n        {\"name\": \"NODE_ENV\", \"value\": \"production\"},\n        {\"name\": \"PORT\", \"value\": \"8080\"}\n      ],\n      \"secrets\": [\n        {\n          \"name\": \"DB_PASSWORD\",\n          \"valueFrom\": \"arn:aws:secretsmanager:us-east-1:123456789012:secret:myapp\u002Fdb-password\"\n        },\n        {\n          \"name\": \"API_KEY\",\n          \"valueFrom\": \"arn:aws:ssm:us-east-1:123456789012:parameter\u002Fmyapp\u002Fapi-key\"\n        }\n      ],\n      \"healthCheck\": {\n        \"command\": [\"CMD-SHELL\", \"curl -f http:\u002F\u002Flocalhost:8080\u002Fhealth || exit 1\"],\n        \"interval\": 30,\n        \"timeout\": 5,\n        \"retries\": 3,\n        \"startPeriod\": 60\n      },\n      \"logConfiguration\": {\n        \"logDriver\": \"awslogs\",\n        \"options\": {\n          \"awslogs-group\": \"\u002Fecs\u002Fmyapp\",\n          \"awslogs-region\": \"us-east-1\",\n          \"awslogs-stream-prefix\": \"ecs\",\n          \"awslogs-create-group\": \"true\"\n        }\n      },\n      \"ulimits\": [\n        {\"name\": \"nofile\", \"softLimit\": 65536, \"hardLimit\": 65536}\n      ]\n    }\n  ]\n}\n```\n\n```bash\n# Register the task definition\naws ecs register-task-definition --cli-input-json file:\u002F\u002Ftask-definition.json\n\n# List task definition revisions\naws ecs list-task-definitions --family-prefix myapp\n\n# Deregister an old revision\naws ecs deregister-task-definition --task-definition myapp:1\n```\n\n## Create Service with ALB\n\n```bash\n# Create the CloudWatch log group first\naws logs create-log-group --log-group-name \u002Fecs\u002Fmyapp\naws logs put-retention-policy --log-group-name \u002Fecs\u002Fmyapp --retention-in-days 30\n\n# Create ECS service with load balancer\naws ecs create-service \\\n  --cluster production \\\n  --service-name myapp \\\n  --task-definition myapp:2 \\\n  --desired-count 3 \\\n  --launch-type FARGATE \\\n  --platform-version LATEST \\\n  --deployment-configuration '{\n    \"deploymentCircuitBreaker\": {\"enable\": true, \"rollback\": true},\n    \"maximumPercent\": 200,\n    \"minimumHealthyPercent\": 100\n  }' \\\n  --network-configuration '{\n    \"awsvpcConfiguration\": {\n      \"subnets\": [\"subnet-private-a\", \"subnet-private-b\"],\n      \"securityGroups\": [\"sg-app\"],\n      \"assignPublicIp\": \"DISABLED\"\n    }\n  }' \\\n  --load-balancers '[{\n    \"targetGroupArn\": \"arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup\u002Fmyapp-tg\u002Fabc123\",\n    \"containerName\": \"myapp\",\n    \"containerPort\": 8080\n  }]' \\\n  --service-registries '[{\n    \"registryArn\": \"arn:aws:servicediscovery:us-east-1:123456789012:service\u002Fsrv-abc123\"\n  }]' \\\n  --enable-execute-command \\\n  --propagate-tags SERVICE\n```\n\n## Deployments\n\n```bash\n# Rolling update - update task definition and force new deployment\naws ecs update-service \\\n  --cluster production \\\n  --service myapp \\\n  --task-definition myapp:3 \\\n  --force-new-deployment\n\n# Watch deployment progress\naws ecs describe-services \\\n  --cluster production \\\n  --services myapp \\\n  --query \"services[0].deployments[].{Status:status,Running:runningCount,Desired:desiredCount,TaskDef:taskDefinition}\" \\\n  --output table\n\n# Wait for service to stabilize\naws ecs wait services-stable --cluster production --services myapp\n\n# Exec into a running container for debugging\naws ecs execute-command \\\n  --cluster production \\\n  --task arn:aws:ecs:us-east-1:123456789012:task\u002Fproduction\u002Fabc123 \\\n  --container myapp \\\n  --interactive \\\n  --command \"\u002Fbin\u002Fsh\"\n```\n\n## Auto Scaling\n\n```bash\n# Register ECS service as a scalable target\naws application-autoscaling register-scalable-target \\\n  --service-namespace ecs \\\n  --resource-id service\u002Fproduction\u002Fmyapp \\\n  --scalable-dimension ecs:service:DesiredCount \\\n  --min-capacity 2 \\\n  --max-capacity 20\n\n# Target tracking policy - scale on CPU utilization\naws application-autoscaling put-scaling-policy \\\n  --service-namespace ecs \\\n  --resource-id service\u002Fproduction\u002Fmyapp \\\n  --scalable-dimension ecs:service:DesiredCount \\\n  --policy-name cpu-target-tracking \\\n  --policy-type TargetTrackingScaling \\\n  --target-tracking-scaling-policy-configuration '{\n    \"PredefinedMetricSpecification\": {\n      \"PredefinedMetricType\": \"ECSServiceAverageCPUUtilization\"\n    },\n    \"TargetValue\": 70.0,\n    \"ScaleInCooldown\": 300,\n    \"ScaleOutCooldown\": 60\n  }'\n\n# Scale on request count per target (ALB)\naws application-autoscaling put-scaling-policy \\\n  --service-namespace ecs \\\n  --resource-id service\u002Fproduction\u002Fmyapp \\\n  --scalable-dimension ecs:service:DesiredCount \\\n  --policy-name request-count-tracking \\\n  --policy-type TargetTrackingScaling \\\n  --target-tracking-scaling-policy-configuration '{\n    \"PredefinedMetricSpecification\": {\n      \"PredefinedMetricType\": \"ALBRequestCountPerTarget\",\n      \"ResourceLabel\": \"app\u002Fmy-alb\u002Fabc123\u002Ftargetgroup\u002Fmyapp-tg\u002Fdef456\"\n    },\n    \"TargetValue\": 1000.0,\n    \"ScaleInCooldown\": 300,\n    \"ScaleOutCooldown\": 60\n  }'\n```\n\n## Terraform ECS Fargate Service\n\n```hcl\nresource \"aws_ecs_cluster\" \"main\" {\n  name = \"production\"\n\n  setting {\n    name  = \"containerInsights\"\n    value = \"enabled\"\n  }\n}\n\nresource \"aws_ecs_task_definition\" \"myapp\" {\n  family                   = \"myapp\"\n  network_mode             = \"awsvpc\"\n  requires_compatibilities = [\"FARGATE\"]\n  cpu                      = 512\n  memory                   = 1024\n  execution_role_arn       = aws_iam_role.ecs_execution.arn\n  task_role_arn            = aws_iam_role.ecs_task.arn\n\n  container_definitions = jsonencode([{\n    name      = \"myapp\"\n    image     = \"${aws_ecr_repository.myapp.repository_url}:latest\"\n    essential = true\n\n    portMappings = [{\n      containerPort = 8080\n      protocol      = \"tcp\"\n    }]\n\n    logConfiguration = {\n      logDriver = \"awslogs\"\n      options = {\n        awslogs-group         = aws_cloudwatch_log_group.myapp.name\n        awslogs-region        = \"us-east-1\"\n        awslogs-stream-prefix = \"ecs\"\n      }\n    }\n\n    healthCheck = {\n      command     = [\"CMD-SHELL\", \"curl -f http:\u002F\u002Flocalhost:8080\u002Fhealth || exit 1\"]\n      interval    = 30\n      timeout     = 5\n      retries     = 3\n      startPeriod = 60\n    }\n  }])\n}\n\nresource \"aws_ecs_service\" \"myapp\" {\n  name            = \"myapp\"\n  cluster         = aws_ecs_cluster.main.id\n  task_definition = aws_ecs_task_definition.myapp.arn\n  desired_count   = 3\n  launch_type     = \"FARGATE\"\n\n  deployment_circuit_breaker {\n    enable   = true\n    rollback = true\n  }\n\n  network_configuration {\n    subnets          = aws_subnet.private[*].id\n    security_groups  = [aws_security_group.app.id]\n    assign_public_ip = false\n  }\n\n  load_balancer {\n    target_group_arn = aws_lb_target_group.myapp.arn\n    container_name   = \"myapp\"\n    container_port   = 8080\n  }\n\n  enable_execute_command = true\n  propagate_tags         = \"SERVICE\"\n}\n```\n\n## Viewing Logs\n\n```bash\n# Tail logs from CloudWatch\naws logs tail \u002Fecs\u002Fmyapp --follow --since 1h\n\n# Get logs for a specific task\naws logs get-log-events \\\n  --log-group-name \u002Fecs\u002Fmyapp \\\n  --log-stream-name \"ecs\u002Fmyapp\u002Fabc123def456\" \\\n  --start-from-head\n\n# Filter logs for errors\naws logs filter-log-events \\\n  --log-group-name \u002Fecs\u002Fmyapp \\\n  --filter-pattern \"ERROR\" \\\n  --start-time $(date -d '1 hour ago' +%s000)\n```\n\n## Troubleshooting\n\n| Problem | Cause | Fix |\n|---|---|---|\n| Task stuck in PROVISIONING | No available capacity in subnets | Check subnet availability and capacity provider |\n| Task fails immediately | Container crashes on startup | Check CloudWatch logs; run image locally first |\n| Health check failing | App not ready within startPeriod | Increase `startPeriod`; verify health endpoint |\n| Cannot pull ECR image | Execution role missing ECR permissions | Attach `AmazonECSTaskExecutionRolePolicy` |\n| Service stuck at 0 running | Security group blocks ALB health check | Allow ALB SG to reach container port |\n| Exec command fails | SSM agent not initialized | Ensure `enableExecuteCommand` is true; check task role |\n| High Fargate costs | Not using Fargate Spot for tolerant workloads | Add FARGATE_SPOT capacity provider |\n| Container OOM killed | Memory limit too low | Increase `memory` in task definition; check for leaks |\n| Slow deployments | minimumHealthyPercent too high | Set to 50% for faster rolling updates |\n\n## Related Skills\n\n- docker-management (`docker-management`) - Container fundamentals\n- container-registries (`container-registries`) - ECR and image management\n- aws-vpc (`aws-vpc`) - Networking for ECS tasks\n- aws-iam (`aws-iam`) - Task and execution roles\n- terraform-aws (`terraform-aws`) - Infrastructure as Code deployment\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n",{"name":5,"risk":25,"source":43,"license":14,"category":44,"metadata":45,"date_added":48,"description":7,"source_repo":49,"source_type":30,"compatibility":50,"license_source":51},"https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills","devops",{"author":46,"version":47},"devops-skills","1.0","2026-09-20","BagelHole\u002FDevOps-Security-Agent-Skills","Requires the relevant OS\u002Fplatform tooling and privileged access where noted. Docs-only; helper scripts and templates not bundled.","https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE","f3312ba749561b6159f477dbfc9313c875d40a56",".agents\u002Fskills_archive\u002Faws-ecs-fargate","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612","2026-10-25 23:50:58",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill aws-ecs-fargate",{"tool":63,"command":64},"bunx","bunx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill aws-ecs-fargate",{"tool":66,"command":67},"pnpm","pnpm dlx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill aws-ecs-fargate","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Faws-ecs-fargate\u002FSKILL.md",true,[],[72,89,113,137,154,174],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":38},"01M6Q0FA5FZ410Z33Z3TFQ4DBA","zero-trust","Implement zero-trust network architecture. Configure identity-based access, micro-segmentation, and continuous verification. Use when implementing modern security architectures.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzero-trust\u002FSKILL.md",[],[79,80,81,82,83,84,74,85,35,34,33,32,30,22,86,25,87,24,23,88],"ZeRO","trust","zero trust","architecture","assessment","verification","segmentation","active","scope","implementing",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":38},"01M6Q0F1YZJW3KX5FBKEVZ8CV4","zcode-delegate","Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzcode-delegate\u002FSKILL.md",[],[96,97,98,99,100,101,102,103,104,105,106,107,108,32,109,30,110,111,25,112],"delegate","zcode","zcode delegate","review","cli","orchestration","tasks","run","Bash","model","node","read","orchestrator","files","desktop app","app","agent-orchestration",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":38},"01M6Q0ETK41VGNMYEXW0T00AJN","youtube-transcript","Fetch YouTube transcripts through DeepAPI or local fallback tooling and save clean text output.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript\u002FSKILL.md",[],[120,121,122,123,124,125,126,36,127,128,129,130,131,30,22,132,133,134,135,136],"transcript","youtube transcript","youtube","safe","github","codex","research","https","text","fetch","tooling","clean","local","output","deepapi","youtube transcripts","blob",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":38},"01M6Q0EPPH2PVMDW40017F8WX0","youtube-transcript-skills","Fetch YouTube video transcripts, search videos\u002Fchannels, browse channels, and extract playlists via the getyoutubetranscript.com API - free tier, no card required.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript-skills\u002FSKILL.md",[],[120,121,122,144,123,145,124,125,36,146,147,148,149,129,150,30,22,151,152,153],"youtube transcript skills","gemini","search","api","Video","browse","api-integration","free","card","channels",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":38},"01M6Q0EAB96PX83W5PTE8A0R8D","youtube-notetaker","Turn YouTube talks into local study notes with slides, transcripts, editable annotations, and a markdown-backed viewer.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-notetaker\u002FSKILL.md",[],[122,161,162,100,123,163,164,165,166,36,148,167,168,169,170,22,171,132,172,173],"youtube notetaker","notetaker","workflow","official","notes","code","markdown","slides","annotations","README","study","dair-academy","viewer",{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":178,"categories":179,"keywords":180,"publishedAt":38},"01M6Q0E55F0GW5MX48V8HXS8B5","youtube-full","Fetch YouTube transcripts, search videos, browse channels, and extract playlists via TranscriptAPI — no yt-dlp, no Google API key, works from any cloud server.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-full\u002FSKILL.md",[],[181,122,182,183,123,145,146,184,185,147,148,149,129,186,150,30,22,151,187,135],"youtube full","full","google","server","dlp","credits","automatic"]