What is aws fargate

Last updated: April 1, 2026

Quick Answer: AWS Fargate is a serverless container orchestration platform that runs Docker containers without requiring EC2 instance management, combining containerization benefits with serverless simplicity and automatic scaling.

Key Facts

What is Fargate?

AWS Fargate abstracts away the complexity of managing container infrastructure. Traditionally, running containers on AWS requires launching and managing EC2 instances, configuring Docker daemons, managing patches, and handling autoscaling. Fargate eliminates this operational burden—you define container specifications (Docker image, CPU, memory, networking) and Fargate handles the underlying compute entirely. This serverless approach enables teams to focus on application code rather than infrastructure management.

Fargate vs EC2 Container Instances

With EC2-based ECS/EKS, you manage a cluster of EC2 instances, each running Docker daemon and orchestration agents. You choose instance types, sizes, and quantities; manage scaling policies; apply OS patches; and handle cluster operations. With Fargate, AWS manages all infrastructure. You specify desired resources (CPU and memory) at the task level, and Fargate automatically provisions appropriate compute capacity, patches the underlying system, and scales seamlessly. This trades some granular control for operational simplicity.

Integration with ECS and EKS

ECS (Elastic Container Service): AWS's native container orchestration platform. Fargate serves as the launch type—instead of selecting EC2 instances, you select Fargate and specify task resources. ECS handles scheduling, networking, and monitoring.

EKS (Elastic Kubernetes Service): AWS's managed Kubernetes service. Fargate can replace EC2 worker nodes, enabling fully managed Kubernetes without node management. This is ideal for teams already using Kubernetes across cloud providers.

Resource Allocation and Pricing

Fargate tasks are defined with specific CPU and memory combinations (e.g., 0.5 vCPU with 1-2 GB memory up to 4 vCPU with 30 GB memory). You pay for provisioned CPU and memory resources per second while tasks run. Storage pricing applies to additional EBS volumes or Fargate Spot capacity. The per-second billing provides cost efficiency compared to per-hour EC2 commitments, especially for variable workloads or short-running tasks.

Networking and Security

Fargate tasks run within your VPC, enabling secure communication with databases, caches, and private services. Network configuration happens at the task definition level—you specify subnets, security groups, and whether tasks receive public IP addresses. Load balancing integrates seamlessly with Application Load Balancer (ALB) or Network Load Balancer (NLB) for distributing traffic across tasks. AWS Secrets Manager and Systems Manager Parameter Store integration securely injects credentials and configuration into containers.

Use Cases and Suitability

Fargate excels for microservices architectures, API servers, background job processing, and containerized applications requiring variable scaling. Batch processing, continuous integration pipelines, and scheduled container tasks benefit from Fargate's simplicity. However, for stateful workloads requiring specific hardware, GPU acceleration, or highly predictable traffic where EC2 Reserved Instances provide cost savings, traditional EC2 container instances may be more suitable.

Related Questions

Should I use Fargate or Lambda for my containerized application?

Use Fargate for long-running applications, continuous services, or tasks exceeding Lambda's 15-minute limit. Use Lambda for event-driven, intermittent workloads that complete quickly. Fargate requires container images; Lambda uses zip-uploaded functions.

How does Fargate handle autoscaling?

Fargate integrates with Application Auto Scaling based on metrics like CPU utilization, memory, or custom CloudWatch metrics. You define target metrics and desired ranges; Auto Scaling automatically adjusts task count to meet targets.

Can I run Fargate tasks on-demand and spot instances?

Yes, Fargate supports both on-demand and Spot instances. Spot instances cost ~70% less but may be interrupted. You can mix both capacity types within the same ECS service for cost optimization with availability tradeoffs.

Sources

  1. AWS Fargate Documentation CC-BY-SA-4.0
  2. Wikipedia - Amazon Web Services CC-BY-SA-4.0