Easy ReviewDOP-C02
Resilient Cloud Solutions17

Fargate

Run isolated container tasks or pods on managed compute and provide their required network paths.

Fargate supplies compute for ECS tasks and EKS pods. You configure workloads, permissions, storage, and networking while AWS manages the underlying hosts.

Fargate basics

AWS Fargate is serverless compute for containers: you run tasksAn ECS task runs the containers described by one task definition together. without managing servers.

How it works

  1. Package the app in a container.
  2. Set the CPU and memory for the task.
  3. Fargate runs it with no servers for you to manage.

Exam cues

  • If the question says containers without managing servers, think Fargate.

Remember

  • You choose CPU and memory per task.

Trap: Fargate is not a separate orchestrator; it is the serverless way to run ECS (or EKS) workloads.

From the AWS docs (2)
  • AWS Fargate runs containers without provisioning, configuring or scaling clusters of EC2 instances; you set CPU and memory per task.
  • Fargate runs ECS containers without customers provisioning, patching, or scaling container hosts.

Compute and isolation

Fargate supplies container compute without requiring you to manage worker hosts. ECS runs tasksAn ECS task runs the containers described by one task definition together., groups of containers deployed together, while EKS runs Kubernetes podsA pod is the Kubernetes workload unit that EKS schedules onto Fargate compute.. The isolation boundary surrounds each task or pod, not every container inside it.

How it works

  1. For ECS, register a Fargate task definitionA task definition describes an ECS container workload and its resource and networking requirements., the description of containers and their required CPU, memory, and networking. Fargate requires awsvpc mode, which gives the task a VPC network interface.
  2. Give application code its task roleA task role grants AWS API permissions to application code inside task containers. and give startup operations their execution role. Containers in one task share resources and can communicate over localhost; separate tasks have separate compute boundaries.
  3. Run tasks directly or use an ECS service deployment. EventBridge Scheduler can start tasks at specified times. Linux platform 1.4.0 or later supports EFS, shared file storage that persists beyond a task.
  4. For EKS, define a Fargate profile whose selectors match a pod’s namespaceA namespace groups Kubernetes pods for selection by an EKS Fargate profile., its Kubernetes grouping, and optional labels, its identifying key-value tags. EKS schedules matching pods on Fargate.
  5. Plan task replacement for platform updates. A platform versionA platform version identifies the kernel and container runtime environment for a Fargate task. identifies a runtime environment; a revisionA revision updates a Fargate platform version without changing its version identifier. is an update within that version. Running tasks keep their revision until replaced.
Workload requirement Fargate behavior
ECS load balancing Application, Network, and Gateway Load Balancers are supported; use IP targets
Classic Load Balancer Unsupported for ECS Fargate
Privileged containers or underlying host access Unsupported
EKS DaemonSetA DaemonSet is a Kubernetes workload pattern for running a daemon on nodes and is unsupported on Fargate., one pod on every node Unsupported
EKS HostPort or HostNetwork, which use host ports or networking Unsupported
EKS GPU workload Unsupported
EKS persistent files EFS with static provisioningStatic provisioning prepares persistent file storage before a pod consumes it., where storage is prepared in advance
EKS EBS volume Cannot be mounted to Fargate pods

Exam cues

  • If the question says avoid container-host provisioning and patching, think Fargate, because AWS manages that compute.
  • If the question says adopt a newer ECS service platform version, think a new deployment, because scale-out keeps the version of the current deployment.
  • If the question says shared persistent files across Linux ECS tasks, think EFS on supported Fargate platforms, because the file system is shared across tasks.
  • If the question says choose EKS pods by namespace and labels, think Fargate profiles, because their selectors control pod placement.

Remember

  • New tasks use the latest revision of the selected platform version. An unchanged service’s scale-out keeps its current deployment version.
  • A forced deployment replaces tasks without requiring a service-definition change.
  • The task role authorizes application API calls; the execution role authorizes agent operations.
  • EC2 container workloads need restrictions on instance metadata, the host service that can expose instance-role credentials.

Trap: Containers inside the same Fargate task share its resources. Per-task isolation does not create a separate security boundary between those containers.

ECS places a task on managed compute
12Task definitionECSFargate task
  1. Define the container workload, CPU, memory, and networking for Fargate.

  2. ECS runs the task with its own compute boundary on Fargate.

From the AWS docs (22)
  • Fargate runs ECS containers without customers provisioning, patching, or scaling container hosts.
  • An ECS Fargate task has an isolation boundary that separates its kernel, CPU, memory, and network interface from other tasks.
  • Containers within one Fargate task share task resources and can communicate over localhost.
  • The ECS task role gives application code AWS API permissions; the execution role gives agents permissions for operations such as image pulls and log delivery.
  • On ECS EC2 container instances, containers can potentially access other task credentials or instance metadata unless access is restricted.
  • ECS Fargate task definitions specify CPU, memory, and FARGATE compatibility and require awsvpc networking.
  • Fargate does not support privileged containers or access to the underlying host.
  • A Fargate platform version identifies the kernel and container runtime environment; running tasks remain on one revision for their lifetime.
  • A new Fargate task starts on the latest revision of its selected platform version.
  • Scaling an unchanged ECS Fargate service uses the platform version specified by its current deployment.
  • Changing a service platform version requires a deployment; forcing a new deployment can replace tasks without changing the service definition.
  • ECS tasks on Fargate Linux platform 1.4.0 or later can mount shared persistent EFS file systems.
  • ECS Fargate supports Application, Network, and Gateway Load Balancers.
  • Load balancer target groups for ECS Fargate tasks use target type ip rather than instance.
  • Classic Load Balancers are not supported for ECS Fargate services.
  • EventBridge Scheduler can run ECS tasks at specified times or intervals.
  • EKS runs Kubernetes pods on Fargate with an individual compute boundary per pod.
  • EKS Fargate profiles select pods by namespace and optional labels.
  • EKS Fargate does not support DaemonSets, privileged containers, HostPort, HostNetwork, or GPUs.
  • EKS Fargate supports statically provisioned EFS persistent volumes, not dynamic provisioning.
  • EBS volumes cannot be mounted to EKS Fargate pods.
  • AWS Fargate is billed per second, with a one-minute minimum, for the vCPU and memory you allocate to each task, whether or not they are fully used.

Private subnet connectivity

A private subnet gives a Fargate taskAn ECS task runs the containers described by one task definition together. a private network address, but the task still needs routes to its dependencies. For IPv4 image pulls, provide internet egress through a NAT gatewayA NAT gateway provides outbound internet connectivity for tasks with private IPv4 addresses. or private endpoint paths to ECR and S3.

How it works

  1. ECS attaches the task’s elastic network interfaceAn ENI is the virtual network interface that gives a Fargate task its VPC address. (ENI), a virtual network card, in the selected subnet. On Linux platform 1.4.0 or later, task traffic uses this ENI and can be inspected with VPC Flow Logs.
  2. Choose a dependency path. A NAT gateway lets private IPv4 tasks initiate internet connections. Interface VPC endpointsAn interface VPC endpoint gives resources private-address access to a service API. expose service APIs through private addresses inside the VPC.
  3. For private ECR pulls on platform 1.4.0 or later without internet access, provide both ecr.api and ecr.dkr endpoints. Enable private DNS and allow endpoint security-group inbound TCP 443 from the task subnet.
  4. Associate an S3 gateway endpointAn S3 gateway endpoint supplies a route-table path to S3 for image-layer downloads. with the task subnet’s route tables. ECR supplies the image manifestA manifest describes the image layers a client downloads for a container image., a description of the image’s layers, while S3 supplies those layers.
  5. For awslogs without internet access, add the logs interface endpoint and configure the container’s logConfiguration. Check the execution role for image, log, and configured secret retrieval permissions.
Dependency Private path or configuration
ECR APIs ecr.api interface endpoint
ECR registry ecr.dkr interface endpoint with private DNS
Image layersAn image layer is a part of a container image that ECR stores in S3 for downloading. S3 gateway endpoint and task route-table associations
Container standard output and error awslogs driver and logs interface endpoint
Authorization for startup operations Task execution roleThe execution role gives ECS and Fargate agents permissions for image pulls and other task startup operations.
Application AWS API calls Task roleA task role grants AWS API permissions to application code inside task containers. plus a reachable service path

Exam cues

  • If the question says ECR authentication works but layer downloads fail, think the S3 route, because ECR stores layers in S3.
  • If the question says private tasks cannot send awslogs output, think the Logs endpoint, logConfiguration, and execution role, because each is required for that delivery path.
  • If the question says image-pull permission errors remain after the network works, think the execution role, because application task-role permissions do not authorize the agent’s image pull.

Remember

  • Platform 1.4.0 or later needs both ECR endpoints for endpoint-based pulls. Platform 1.3.0 or earlier needs ecr.dkr and S3.
  • Interface endpoint security groups must permit TCP 443 from the private task subnet.
  • A first ECR pull-through cache request may still need NAT internet access.
  • ECS Fargate can use a public subnet with public IP assignment. EKS Fargate podsA pod is the Kubernetes workload unit that EKS schedules onto Fargate compute. use private subnets only.

Trap: A private ECR registry endpoint alone does not provide the S3 path used to download image layers. Check routes as well as API connectivity.

Private image pulls need registry and image-layer access
VPC endpoint paths for Linux platform 1.4.0 or later1234Fargate taskS3 layersECR APIECR registryCloudWatch Logs
  1. Reach ECR API through its interface endpoint for image-pull API access.

  2. Reach the ECR registry through its interface endpoint.

  3. Download image layers using the S3 gateway endpoint and associated subnet route tables.

  4. Send container output through the Logs interface endpoint when awslogs is configured.

From the AWS docs (16)
  • Each ECS Fargate task receives a network interface with a private IP address.
  • An IPv4 Fargate task in a private subnet can use a NAT gateway for internet access to pull container images.
  • A Fargate task in a public subnet can be assigned a public IP address for internet access.
  • Without internet egress, Fargate platform 1.4.0 or later needs ecr.api and ecr.dkr interface endpoints and an S3 gateway endpoint for ECR image pulls.
  • Fargate platform 1.3.0 or earlier needs ecr.dkr and the S3 gateway endpoint for endpoint-based ECR image pulls.
  • ECR stores image layers in S3; image pulling accesses ECR for the manifest and S3 for the layers.
  • An ECR endpoint security group must allow incoming TCP 443 from the task private subnet.
  • The ECR Docker registry endpoint requires private DNS; enabling private DNS lets standard ECR hostnames resolve through endpoints.
  • The S3 gateway endpoint must be associated with the route tables used by the tasks.
  • Fargate tasks using awslogs without internet access need the logs interface endpoint.
  • Configure logConfiguration with the awslogs driver to send container standard output and standard error to CloudWatch Logs.
  • The execution role authorizes image pulls, awslogs delivery, and task-definition secret retrieval when configured.
  • The task IAM role supplies permissions used by application code inside the container.
  • On Linux Fargate platform 1.4.0 or later, task network traffic passes through one task ENI and is visible in VPC Flow Logs.
  • An initial ECR pull-through cache pull may still require NAT internet access even when ECR endpoints exist.
  • EKS Fargate pods run only in private subnets, without a direct route to an internet gateway.

Flashcards

tap to flip
Answer

·

All 17 cards as a list

A team wants to run containers on ECS without managing any EC2 instances. What should it use?

AWS Fargate.

A team wants to run Amazon ECS containers without provisioning or patching container hosts. Which compute option fits?

AWS Fargate runs ECS containers without customers provisioning, patching or scaling container hosts.

Who manages container hosts for ECS Fargate, and what is the isolation boundary?

AWS manages Fargate compute hosts. Each task is isolated from other tasks, while containers inside one task share resources. EC2 container instances need controls to restrict access to instance metadata and other credentials.

An ECS application on AWS Fargate needs a shared persistent file system for its tasks. Which storage option fits?

Use Amazon EFS. ECS tasks on Fargate Linux platform 1.4.0 or later can mount shared persistent EFS file systems.

Two ECS Fargate tasks must share persistent files across replacements. Which storage service fits?

Amazon EFS, supported by Linux Fargate platform 1.4.0 or later.

A Kubernetes workload on EKS needs a privileged DaemonSet with host networking. Is Fargate suitable?

No. EKS Fargate does not support DaemonSets, privileged containers, or HostNetwork.

How does EKS decide which Kubernetes pods run on Fargate?

A Fargate profile selects pods using a namespace and optional labels.

Can an EKS Fargate pod mount an EBS persistent volume?

No. Use supported EFS persistent storage with static provisioning when shared files fit the workload.

Which target type should an Application Load Balancer use for an ECS Fargate service?

ip. Fargate tasks use task network interfaces rather than EC2 instance targets. Classic Load Balancers are unsupported.

An application in an ECS Fargate container calls S3. Should its S3 permissions be placed only on the task execution role?

No. Application API permissions belong to the task role. The execution role supplies agent permissions for startup and log delivery.

A team wants to run Kubernetes pods without managing the underlying compute hosts. Which AWS Fargate integration fits?

Use Amazon EKS on Fargate. Each pod runs with its own compute boundary.

An ECS Fargate Linux platform 1.4.0 task in a private subnet cannot pull a private ECR image without internet access. What should operators check?

Check ecr.api and ecr.dkr interface endpoints, private DNS, the S3 gateway endpoint and route tables, endpoint TCP 443 access, and execution-role permissions.

A private ECS Fargate task reaches ECR APIs, but image-layer downloads fail. Which missing path should be checked?

The S3 gateway endpoint and task-subnet route tables. ECR image layers are stored in S3.

A private ECS Fargate task pulls images successfully but cannot send awslogs output without internet access. What does it need?

A logs interface endpoint, awslogs logConfiguration, and execution-role permissions for CloudWatch Logs.

Do ECR VPC endpoints guarantee that every first pull-through cache download works without internet egress?

No. The first pull through a cache rule may require NAT internet access; subsequent cached pulls do not have that requirement.

For ECS Fargate, does granting the application task role ECR permissions replace the execution-role permissions needed to pull its image?

No. Image pulling uses the execution role. Application API calls use the task role.

Where can operators inspect network traffic for an ECS Fargate Linux platform 1.4.0 task?

VPC Flow Logs for the task ENI. Its network traffic uses that interface.

You finished every topic of DOP-C02!

Your badge turned gold. Next step: book the exam on AWS. Once you pass, add yourself to Who passed.

Share

Share that you finished this certification

I finished every topic of AWS Certified DevOps Engineer - Professional (DOP-C02) on Easy Review. Come study too!