Skip to content
VirtualLP Virtual Learning Platform
Amazon Web Services AWS-14 intermediate

Containerise an API and run it on Amazon ECS with Fargate

Build a Docker image in CloudShell, test it locally, push it to a private Amazon ECR repository, then run it as an ECS service on Fargate with public tasks, logs in CloudWatch and scaling – no servers to manage.

What you'll do

  • Write and build a Dockerfile
  • Run and test a container locally
  • Push images to Amazon ECR with docker login
  • Create a Fargate task definition and execution role
  • Run and scale an ECS service

Lab tasks

  1. 1 Build the image in CloudShell
  2. 2 Run and test the container locally
  3. 3 Create the ECR repository shop-api
  4. 4 Log in, tag and push version v1
  5. 5 Create the ECS cluster shop-cluster
  6. 6 Register the task definition shop-api-task
  7. 7 Run it as a service with 2 tasks
  8. 8 Call a running task
  9. 9 Scale the service to 3 tasks