Amazon Elastic Container Service (ECS) is a fully managed container orchestration service that makes it straightforward to deploy, run, and scale containerized applications on AWS. In this Cloud Lab, you’ll build a small social media application composed of four services, three backend microservices, and one frontend, packaged as Docker images, stored in Amazon ECR, and orchestrated by ECS. You’ll focus on practical deployment patterns, inter-service communication, and load-balanced access for the web frontend.
The application backend is split into three microservices:
Users: The users microservice is responsible for session management and user authorization.
Posts: The posts service handles the post creation in the application.
Feed: The feed service is responsible for aggregating and rendering posts.
The frontend service provides the web UI that calls these backend services. Data is persisted in Amazon DynamoDB tables (one for users and one for posts), while post images are stored in an Amazon S3 bucket. Container images are built on an Amazon EC2 build host, pushed to separate Amazon ECR repositories, and then deployed onto an Amazon ECS cluster. An Application Load Balancer (ALB) exposes the frontend service via a target group.
You’ll start by creating two DynamoDB tables (users and posts), an S3 bucket for image storage, and four ECR repositories, one each for the users, posts, feed, and frontend services. You’ll launch an EC2 instance to build the Docker images and push them to ECR, then stand up an ECS cluster with task definitions and services for all four components. You’ll wire up inter-service communication for the backend, expose the frontend through an ALB, and verify the end-to-end flow by registering a user, creating a post, and viewing the feed. Finally, you’ll explore horizontal scaling by adjusting service desired counts.
You’ll learn how to decompose an application into ECS services with separate task definitions, package and publish images to ECR from a build host on EC2, and combine DynamoDB and S3 for durable, low latency data and object storage. You’ll also learn how to expose a service with an ALB and target groups, establish service-to-service communication, and use basic scaling and operational controls in ECS to make the deployment resilient and ready for growth.
The diagram below summarizes the infrastructure you’ll create in this Cloud Lab: