Skip to main content
ContainerIntermediateCLF-C02SAA-C03

ECS Fargate Containerized Web App Architecture

Run a containerized web application on ECS Fargate and expose it via an Application Load Balancer over HTTPS.

Published: 2026-06-08/Updated: 2026-06-21
#ECS#Fargate#Container#ALB#ECR

Architecture diagram

ECS Fargate Containerized Web App Architecture architecture diagram

AWS services used

Click a service name to review it on the term detail page.

Overview

This architecture runs a containerized web application on Amazon ECS on AWS Fargate and exposes it publicly through an Application Load Balancer (ALB).

Unlike the ECS-on-EC2 model where you manage the underlying EC2 instances yourself, Fargate offloads container runtime infrastructure management to AWS.

It is well suited for cases like "I want to run my Dockerized web app on AWS, but I want to avoid EC2 patching and capacity management."

Architecture Diagram

flowchart TD
    User[User]
    DNS[Route 53]
    ACM[AWS Certificate Manager]
    ALB[Application Load Balancer]
    VPC[VPC]
    PublicSubnet[Public Subnets]
    PrivateSubnet[Private Subnets]
    ECS[Amazon ECS Service]
    Task[Fargate Tasks]
    ECR[(Amazon ECR)]
    CW[CloudWatch Logs]
    IAM[IAM Task Role]

User -->|HTTPS| DNS
DNS --> ALB
ACM -.-> ALB
ALB --> PublicSubnet
PublicSubnet --> PrivateSubnet
PrivateSubnet --> ECS
ECS --> Task
Task -->|Pull Image| ECR
Task -->|Logs| CW
IAM -.-> Task
```

What This Architecture Provides

ItemDescription
Container executionRun Dockerized web apps on AWS
Reduced server managementEliminate EC2 instance management overhead
HTTPS exposureAccept HTTPS traffic via ALB and ACM
ScalingAdjust task count via the ECS Service's Desired Count
Log visibilityInspect container logs through CloudWatch Logs

AWS Services Used

ServiceRole
Amazon ECSOrchestration service that manages and runs containers
AWS FargateServerless compute engine that runs containers without server management
Amazon ECRStorage for container images
Application Load BalancerRoutes user HTTPS requests to ECS tasks
Amazon VPCNetwork that hosts ECS tasks and the ALB
AWS Certificate ManagerManages HTTPS certificates
Amazon CloudWatch LogsStores and inspects container logs
IAMControls permissions through task execution role and task role

Request Flow

  1. The user accesses your custom domain over HTTPS.
  2. Route 53 resolves the name to the ALB.
  3. The ALB receives the request.
  4. The ALB forwards the request to ECS Fargate tasks via the target group.
  5. The container on the Fargate task processes the request.
  6. Container logs are written to CloudWatch Logs.
  7. On deployment, container images are pulled from ECR.

Design Considerations

Availability

Placing ECS tasks across multiple AZs in private subnets improves resilience against a single AZ failure.

The ALB is also deployed across multiple AZs.

Security

Only the ALB sits in public subnets; ECS tasks are placed in private subnets.

The ECS task security group allows traffic only from the ALB.

The task role is granted only the permissions to AWS services that the application actually needs.

Cost

Fargate is billed based on task vCPU, memory, and runtime.

For an individual developer MVP, always-on costs add up quickly, so this AWS certification study site itself prioritizes S3 + CloudFront.

Fargate becomes a reasonable choice once you build a web app that requires persistent server-side processing.

Performance

Tune task count, CPU, and memory according to application load.

Tasks that fail the ALB health check are detached, so make sure the application exposes a proper health check path.

SAA Exam Focus

  • ECS is a viable choice as a container execution platform.
  • Fargate is the candidate when you want to avoid server management.
  • Combine with an ALB for public-facing exposure.
  • Placing tasks in private subnets is the standard design.
  • Use ECR to store container images.
  • Understand the difference between the task execution role and the task role.

Notes on This Architecture

  • For an individual MVP, costs tend to exceed S3 + CloudFront.
  • Leaving Fargate tasks running incurs ongoing charges.
  • The ALB itself has a cost.
  • Accessing ECR from private subnets requires either a NAT Gateway or VPC Endpoint design.
  • Misconfigured health checks can detach healthy tasks.

Related Terms

Related Comparisons

Role in this Project

ECS Fargate is a strong option for running containerized web apps without managing servers.

However, for an individual MVP centered on a static site, fixed costs tend to grow, so this project treats this architecture as a study reference and prioritizes S3 + CloudFront for the main site.

Explore more AWS architectures

For the SAA exam, understanding AWS as architecture patterns matters more than memorizing individual services.

Back to architectures

Related architectures