Fargate
💡 Definition
AWS Fargate is a serverless compute engine for containers that works with ECS and EKS. Fargate makes it easy for you to focus on building your applications. Fargate removes the need to provision and manage servers, lets you specify and pay for resources per application, and improves security through application isolation by design.
🔑 Key Concepts
- Serverless for Containers: You don't manage the underlying EC2 instances (OS, patching, scaling).
- Pod/Task Level Isolation: Each Fargate task or pod runs in its own kernel, providing secure isolation.
- Resource Specification: You define the CPU and Memory requirements for your container.
⚙️ How it Works
- Build Container Image: Package your application.
- Define Task/Pod: Specify CPU and Memory.
- Run: Launch the task using ECS or EKS with the Fargate launch type. AWS finds the capacity to run it.
🎯 Use Cases
- Microservices: Running containerized services without managing clusters.
- Batch Processing: Running short-lived jobs.
- Web Apps: Scalable web applications.
💰 Pricing Model
- Compute Resources: Pay for the amount of vCPU and memory resources consumed by your containerized applications.
- Per Second Billing: Charged from the time you start downloading the Docker image until the task terminates.
📝 Exam Tips (CLF-C02)
- Fargate removes the operational burden of managing EC2 instances for containers.
- It is serverless (like Lambda, but for long-running containers).
- Works with both ECS and EKS.