Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

2.2.2. Basic Container Deployment (ECS, Fargate)

First Principle: Basic container deployment enables developers to run packaged applications consistently, leveraging container orchestration to manage runtime environments and simplify scaling.

Once you have your Docker container image in Amazon ECR, you need a way to deploy and run it on AWS. Amazon ECS (Elastic Container Service) is AWS's native container orchestration service, and AWS Fargate provides a serverless compute option for running containers.

  • Amazon ECS: (A fully managed container orchestration service that makes it easy to run, stop, and manage Docker containers on a cluster.) You define a Task Definition (a blueprint for your application specifying containers, CPU, memory, networking, and IAM role). Then, you create an ECS Service that maintains the desired number of tasks (running instances of your Task Definition).
  • AWS Fargate: (A serverless compute engine for containers that works with both ECS and EKS.) With Fargate, you no longer need to provision, configure, or scale clusters of virtual machines. You simply define your Task Definition, and Fargate handles the underlying compute infrastructure.
  • ECS Task: A running instance of a Task Definition on ECS.

Scenario: You've packaged your application as a Docker container image and pushed it to Amazon ECR. You need to deploy it to a scalable environment on AWS, and you prefer to minimize the operational burden of managing servers.

Lambda vs. Fargate Decision Guide
FactorLambdaFargate (ECS)
Execution modelFunction per eventLong-running container
Max duration15 minutesNo limit
ScalingPer-invocation, instantTask-level, seconds
PackagingZip or container imageContainer image only
StateStateless (ephemeral /tmp)Stateful within task lifetime
PricingPer ms + per requestPer vCPU/hour + memory/hour
Best forEvent-driven, short tasksWeb servers, long processes, microservices

āš ļø Exam Trap: Fargate is serverless containers — you don't manage EC2 instances. ECS with EC2 launch type gives you control over the underlying instances. Questions about "reducing operational overhead" for containers point to Fargate.

Alvin Varughese
Written byAlvin Varughese•Founder•15 professional certifications