Run a Container Task on ECS with a Task Definition and Inspect Its Logs
Intermediate · 30 minutes · 5 tasks, checked automatically · 100 points
In this lab you will use Amazon ECS (Elastic Container Service) on a local AWS emulator to define a task, register it, run it inside an ECS cluster, and inspect the resulting CloudWatch logs. You will practise the full ECS task lifecycle: creating a cluster, registering a task definition with a container specification, running the task, and retrieving its execution logs — all without touching a real AWS account.
What you’ll learn
- Create an ECS cluster to host container tasks
- Register an ECS task definition with a container image and log configuration
- Run the task on the cluster and capture its ARN
- Create a CloudWatch log group and retrieve the task's log output
How this lab works
- Start the lab: One click starts an emulated cloud on your computer, with the cloud’s own CLI ready: no account and no bill.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads the emulated cloud’s resources and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: An emulated cloud on your computer: no cloud account, no bill
- Cloud: AWS
- Services: ecs, logs, iam
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop (or Podman / Rancher Desktop) installed and running
- A AWS sandbox created in the Local Cloud Playground
Topics: ecs, containers, fargate, cloudwatch-logs, iam, task-definition, aws
Create a free account to start this lab.
Keep going
- Provision S3 and DynamoDB from a Single CloudFormation Stack
- Schedule a Recurring Cloud Scheduler Job That Publishes to Pub/Sub
- Push and Pull a Container Image with Azure Container Registry
- Publish Custom CloudWatch Metrics and Raise an Alarm
- Split-Horizon DNS with Route 53 Public and Private Hosted Zones
- Create Your First S3 Bucket and Upload an Object