devuplabs.cloud
Architecture note5 lab guides5 lab guides

ECS · Elastic Container Service

Task definitions, service discovery, and the deployment failures that leave you at half capacity.

Outcome

    • Create a cluster via CLI with Container Insights enabled
    • Push an image to ECR
    • Write a task definition JSON from scratch
    • Run a one-off Fargate task and get its public IP
    • Read stoppedReason and exitCode from a failed task
    • Create an ALB + target group wired to an ECS service
    • Deploy a new task definition revision via update-service
    • Explain minimumHealthyPercent and maximumPercent in a rolling update
    • Trigger the deployment circuit breaker and confirm auto-rollback
    • Create and assign both the execution role and task role
    • Explain exactly what each role does and when it is used
    • Inject a Secrets Manager secret as an environment variable
    • Diagnose a permissions failure by identifying which role is missing the permission
    • Register a scalable target and attach a target tracking policy
    • Use hey to generate load and observe tasks scaling out
    • Read scaling activity history from Application Auto Scaling
    • ECS Exec into a running Fargate task
    • Inspect the credential endpoint at 169.254.170.2 and identify the Task Role
    • Explain why ECS Exec is safer than SSH
    • Write a Dockerfile with correct layer ordering for cache efficiency
    • Explain why npm ci is used over npm install in a Dockerfile
    • Authenticate Docker to ECR and push an image with a git SHA tag
    • Explain why latest is dangerous in production
    • Distinguish between the Task Execution Role and the Task Role
    • Explain why the Task SG sources from the ALB SG instead of 0.0.0.0/0
    • Register a task definition and explain every required field
    • Connect an ALB target group to an ECS service and explain what containerPort maps to
    • Write a workflow that builds, tags with $GITHUB_SHA: pushes to ECR, and deploys to ECS
    • Explain why $GITHUB_SHA is used instead of latest
    • Explain why tests must run before the Docker build step
    • Store secrets correctly, never hardcode credentials in workflow YAML
    • Explain minimumHealthyPercent and maximumPercent and their tradeoffs
    • Perform a manual rollback to a previous task definition revision
    • Explain connection draining and tune the deregistration delay
    • Identify a stuck deployment (health check loop) from describe-services output
    • Name the four key ALB + ECS metrics to watch post-deployment
    • Create alarms for 5xx rate, healthy host count, and CPU with correct thresholds
    • Read container logs and identify startup errors
    • Distinguish a deployment issue (health check loop) from an application issue (5xx post-deployment)

Unlock all 24 AWS services & 291+ lab sessions (~180 hours)

Pricing