AWS Fargate is a serverless, pay-as-you-go compute engine that lets you focus on building applications without managing servers. AWS Fargate is compatible [with both Amazon Elastic Container Service](https://aws.amazon.com/ecs/?pg=ln&sec=hiw) ([[Amazon Elastic Container Service|Amazon ECS]]) and [Amazon Elastic Kubernetes Service](https://aws.amazon.com/eks/?pg=ln&sec=hiw) ([[Amazon Elastic Kubernetes Service]]).
> Fargate is an operational mode within [[Amazon Elastic Container Service]] (ECS) that abstracts container host clusters and servers away from the user of the service.
> Fargate determines the correct amount of compute resources required, which means you don’t need to worry about selecting instance types or having to scale the cluster capacity.
From [ELI5: AWS Fargate : aws](https://old.reddit.com/r/aws/comments/dvl601/eli5_aws_fargate/):
With Fargate you say to Amazon "here’s a container, run it for me, I don’t care how you do it". You don’t know anything about the underlying infrastructure, it just works.
With [[Amazon Elastic Container Service|ECS]] or [[Amazon Elastic Kubernetes Service|EKS]] you have a cluster of [[Amazon Elastic Compute Cloud|EC2]] instances to manage. Amazon provides a tools for managing the containers running on the cluster, but you still "own" the underlying EC2 instances so you have to stay on top of security updates, manage the OS, etc.
You pay a premium for Fargate containers, and you lose a bit of control. But it’s a lot easier to manage.
With a virtual machine, someone still has to manage the hardware, but with EC2 that someone is AWS and you never even see the hardware.
With ECS on EC2, someone still has to manage the instances, but with ECS on Fargate that someone is AWS and you never even see the EC2 instances.
ECS has a "launch type" of either EC2 (if you want to manage the instances yourself) or Fargate (if you want AWS to manage the instances).
Some "paths" of these services:
```mermaid
flowchart TD
fg[Amazon Fargate] --> c[Container]
ecs[Amazon ECS] --> ec2[Amazon EC2]
ec2 --> c
eks[Amazon EKS] --> ec2
eks --> fg
```