AWS ECS Fargate Interview Questions

Reviewed by Mark Dickie · Last updated

15 questions on this page you can answer and see marked on the spot. Go to the first one

AWS ECS Fargate is a serverless compute engine for containers that runs on Amazon Elastic Container Service without requiring you to provision or manage EC2 instances. You define how much vCPU and memory each task needs, and Fargate allocates the compute automatically. For interviews, expect questions on the difference between Fargate and EC2 launch types, task definition anatomy, the awsvpc networking mode, IAM roles (task role vs execution role), service auto-scaling, and cost trade-offs. Most questions will test whether you understand what Fargate removes from your plate and what you are still responsible for configuring.

ConceptWhat you controlWhat AWS manages
ComputevCPU and memory per taskServer provisioning, patching, scaling
NetworkingSecurity groups, subnets, ALB/NLB target groupsENI creation and attachment in awsvpc mode
IAMTask role (app permissions) and execution role (API permissions)Credential injection into the task
SchedulingDesired count, auto-scaling policiesPlacing tasks across capacity
StorageEFS mounts, ephemeral storage sizeUnderlying volume lifecycle

What does an ECS Fargate interview typically cover?

  1. Launch type comparison: when to pick Fargate over EC2, and the cost implications at scale.
  2. Task definition internals: CPU/memory combinations, container definitions, the requiresCompatibilities field, and how FARGATE constrains networking to awsvpc.
  3. IAM model: the difference between the task role (permissions your application code assumes) and the task execution role (permissions ECS needs to pull images, log to CloudWatch, and fetch secrets).
  4. Networking: why every Fargate task gets its own ENI and private IP, how that interacts with VPC subnets, and what it means for DNS and security group rules.
  5. Auto-scaling: service auto-scaling via CloudWatch metrics (CPU utilization, memory utilization, or ALB request count per target) and how target tracking policies work.

What are the common mistakes interviewers look for?

Candidates often blur the two IAM roles or forget that Fargate requires the awsvpc network mode. Another frequent gap is not knowing that Fargate does not support host or bridge networking, daemon scheduling, or privileged containers. Interviewers also check whether you can articulate the cost break point: Fargate's per-second pricing is attractive for intermittent workloads, but steady-state, high-density workloads are often cheaper on EC2-backed ECS.

Key facts

  • Tarmac has 27 AWS interview questions on this topic, 25 of them on this page, at difficulty 1–5 of 5.
  • Tarmac tracked 2,755 job postings asking for AWS in November 2026.
  • Roles asking for AWS advertise a median base salary of £80,000, across 1,117 job postings as of November 2026.
  • Tarmac last reviewed these AWS interview questions on 13 October 2026.

At a glance

Questions25 shown · 27 in the bank
Difficulty1–5 of 5
FormatsMultiple choice, Short answer, True / false, Fill in the blank, Multiple answer

What you'll review

  1. ecs fargate

Practice questions

Try one before you open the answer. Pick an option and press Check; it's marked on the spot.

In AWS ECS, what does the Fargate launch type eliminate the need for you to manage?#

Options

Show answer

The Fargate launch type in AWS ECS eliminates the need to manage the underlying EC2 instances that host your containers. AWS provisions and scales the compute infrastructure automatically based on the CPU and memory you specify in the task definition, so you focus only on the application, not the servers.

Why:

With the Fargate launch type, AWS provisions and manages the compute infrastructure (the underlying EC2 instances/servers) for you. You specify the CPU and memory your task needs, and Fargate runs the containers without you having to provision, patch, or scale EC2 instances. You still manage your container images, IAM roles, and VPC/subnet networking. Contrast this with the EC2 launch type, where you register and manage your own container instances.

When running Amazon ECS tasks on AWS Fargate, what infrastructure component does AWS Fargate eliminate the need for you to provision and manage?#

Show answer

EC2 instances. With Fargate, AWS provisions and manages the underlying compute (the servers or EC2 instances that host the containers), so you only define the task's container CPU and memory requirements.

Why:

AWS Fargate is a serverless compute engine for containers. When you launch an ECS task on Fargate, AWS provisions and manages the underlying compute infrastructure on your behalf, so the component you no longer provision, patch, or scale is the EC2 instance (server) that hosts the containers. You specify the container-level CPU and memory requirements for the task, and Fargate handles the rest. This is the core distinction from the EC2 launch type, where you own and manage the cluster's EC2 instances directly.

True or false: With AWS Fargate, you specify the CPU and memory required for your Amazon ECS task, and AWS provisions the underlying compute resources automatically, so you never have to manage EC2 instances.#

Options

Show answer

True. AWS Fargate removes the need to manage EC2 instances when running Amazon ECS tasks. You specify the CPU and memory each task needs, and Fargate provisions and runs the underlying compute automatically. This serverless model is what distinguishes Fargate from the ECS EC2 launch type.

Why:

This statement is true. AWS Fargate is a serverless compute engine for containers that works with Amazon ECS. You define each task's CPU and memory requirements, and Fargate allocates the necessary compute capacity and runs the task without you provisioning, patching, or scaling any EC2 instances. This serverless model is the defining difference between Fargate and the ECS EC2 launch type, where you manage the container instances yourself.

True or false: with AWS Fargate, you must provision and manage the underlying EC2 instances that run your Amazon ECS tasks.#

Options

Show answer

False. AWS Fargate does not require you to provision or manage the EC2 instances that run Amazon ECS tasks. Fargate is a serverless compute engine for containers: you specify each task's CPU and memory, and AWS provisions and manages the underlying infrastructure automatically, unlike the EC2 launch type.

Why:

The statement is false. AWS Fargate is a serverless compute engine for containers. When used with Amazon ECS, you specify only the CPU and memory each task needs, and AWS provisions and manages the underlying compute infrastructure. There are no EC2 instances for you to manage, which is the defining difference from the EC2 launch type.

What does it mean that AWS Fargate is 'serverless' in the context of Amazon ECS?#

Show answer

It means you do not provision, manage, or scale the underlying EC2 instances. You specify the CPU and memory for your ECS task, and AWS Fargate provisions and manages the compute infrastructure to run it.

Why:

'Serverless' here means the servers that run your containers are abstracted away: with Fargate you never provision, patch, or scale the EC2 instances that host ECS tasks. You declare each task's vCPU and memory, and AWS allocates and manages the compute capacity behind the scenes. The term describes who operates the server infrastructure, not the absence of servers.

What does it mean for AWS Fargate to be a 'serverless' compute engine for containers?#

Show answer

You do not need to provision or manage any underlying servers or EC2 instances. You specify the CPU and memory for your ECS task, and AWS Fargate automatically provisions and manages the compute resources to run it.

Why:

AWS Fargate is called 'serverless' because it abstracts away the underlying server infrastructure. Instead of launching and managing EC2 instances in your ECS cluster, you define the CPU and memory your task needs and AWS handles the rest. The question is open-ended and has no fixed set of options, so it remains a short-answer question.

When you run tasks on Amazon ECS using the Fargate launch type, which of the following do you NOT need to provision, patch, or manage?#

Options

Show answer

With the Fargate launch type in Amazon ECS, you do not provision, patch, or manage the EC2 instances that host your containers, because AWS runs that compute layer for you. You still define task definitions, container images, and IAM task roles.

Why:

Fargate is serverless compute for ECS: AWS owns and maintains the underlying host machines, so you never provision, patch, or scale the EC2 instances that run your containers. The other three remain your responsibility under Fargate: you still author the task definition, supply the container image, and assign the IAM task role that the containers use.

With the AWS Fargate launch type in Amazon ECS, you pay for the vCPU and memory configured for your running tasks, and you are not charged for idle EC2 host capacity. True or false?#

Options

Show answer

True. Amazon ECS with the AWS Fargate launch type bills for the vCPU and memory configured for each running task. Because Fargate is serverless, you do not manage EC2 hosts, so idle host capacity is not charged to you.

Why:

True. Fargate is a serverless compute engine: AWS provisions the underlying capacity on demand and bills you for the vCPU and memory configured for each task while it runs. Because there is no EC2 instance in your account to keep warm, there is no idle-host charge.

True or false: In Amazon ECS, AWS Fargate removes the need for you to provision, patch, or scale the EC2 instances that host your containers.#

Options

Show answer

AWS Fargate removes the need to provision, patch, or scale the EC2 instances behind Amazon ECS containers, so the statement is true. You specify the container image and the task's vCPU and memory, and AWS manages the underlying compute. The EC2 launch type still requires you to manage the host instances.

Why:

True. Fargate is the serverless compute option for ECS. You define the container image and the vCPU and memory your task needs, and AWS provisions the underlying infrastructure, handles host OS patching, and scales the capacity. You never have to launch or maintain EC2 instances yourself. The EC2 launch type, by contrast, requires you to manage those hosts.

You are writing an ECS task definition that will run on the Fargate launch type. Which of the following configurations is REQUIRED at the task-definition level (not at the container level) for the task to be valid on Fargate?#

Options

Show answer

When running an ECS task on the Fargate launch type, you must specify cpu and memory at the task-definition level using one of Fargate's supported value combinations (e.g., 0.5 vCPU / 1 GB, 1 vCPU / 2 GB). Fargate has no underlying instances you manage, so the task-level resource declaration is what determines provisioning. Host port mappings, placement strategies, and privileged mode do not apply to Fargate.

Why:

Fargate is a serverless launch type, so there are no underlying EC2 instances to manage. AWS requires you to declare the task's total CPU and memory at the task-definition level, and the values must come from Fargate's fixed supported combinations (e.g., 0.5 vCPU / 1 GB, 1 vCPU / 2 GB, etc.). Specifying cpu and memory at the task level using Fargate-supported value combinations is correct. Mapping a hostPort for every containerPort defined in each container is wrong because Fargate enforces the awsvpc network mode, where hostPort is not used — the container port maps directly to the ENI. Defining a placementStrategy so Fargate can choose an optimal host is wrong because placement strategies are an EC2-launch-type concept for selecting which container instance to schedule on; Fargate provisioning is fully managed. Setting the privileged flag to true for containers that need elevated permissions is wrong because privileged containers are not supported on Fargate at all.

When running containers with Amazon ECS using the Fargate launch type, which infrastructure management responsibility does AWS take on that you must handle yourself with the EC2 launch type? In your answer, name the concrete things AWS manages (the servers/instances and their host operating system) rather than a feature or network mode name.#

Show answer

AWS provisions, patches, and maintains the underlying compute infrastructure — the EC2 host instances and their host operating system — so you do not have to manage, patch, or scale servers yourself.

Why:

With the ECS EC2 launch type you provision, patch, and maintain the EC2 instances and their host operating system yourself. With the Fargate launch type AWS takes over that responsibility: it provisions the underlying compute capacity and manages (patches, secures, and scales) the host OS and virtualization layer, so you only specify per-task CPU and memory requirements. The expected answer should name the underlying servers/instances and/or the host operating system — not a network mode such as awsvpc, which is available in both launch types and is not itself a management responsibility AWS takes on.

The only Amazon ECS network mode supported by the Fargate launch type is _____. This mode gives each task its own Elastic Network Interface (ENI) and private IP address.#

Show answer

The only Amazon ECS network mode supported by the Fargate launch type is awsvpc. This mode gives each task its own Elastic Network Interface (ENI) and private IP address.

Why:

Fargate tasks support only the awsvpc network mode. In this mode, ECS attaches a dedicated elastic network interface with its own private IP address to each task, so the task gets VPC-native networking and can use security groups directly. The other ECS network modes (bridge, host, and none) are not available on Fargate.

AWS Fargate requires the _____ network mode for every ECS task. In this mode each task receives its own elastic network interface (ENI) and private IP address, and security groups are attached at the task level rather than the container instance level. Fill in the name of this network mode.#

Show answer

AWS Fargate requires the awsvpc network mode for every ECS task. In this mode each task receives its own elastic network interface (ENI) and private IP address, and security groups are attached at the task level rather than the container instance level. Fill in the name of this network mode.

Why:

Fargate only supports the awsvpc network mode. That mode gives each task its own ENI with a dedicated private IP, so security groups and VPC routing are applied per task. The bridge and host network modes, which are commonly used with the EC2 launch type, are not available with Fargate because there is no shared host network namespace to attach to.

You are launching an ECS task on Fargate that runs a Node.js backend. The task needs to pull its container image from a private ECR repository and also make outbound HTTPS calls to a third-party API on the public internet. The task must NOT have a public IP address. Which combination correctly satisfies Fargate's networking requirements while meeting these constraints?#

Options

Show answer

ECS Fargate requires the awsvpc network mode, which gives each task its own elastic network interface. To keep the task off the public internet while still pulling from ECR and calling external APIs, place it in a private subnet that routes outbound traffic through a NAT gateway. The bridge, host, and none network modes are not supported on Fargate.

Why:

Fargate tasks require the awsvpc network mode; bridge, host, and none are not supported on Fargate. With awsvpc, each task receives its own ENI and private IP. Because the task must not have a public IP, it must be placed in a private subnet. To pull from ECR and reach the third-party API on the public internet, that private subnet needs a route through a NAT gateway (or NAT instance) in a public subnet. Setting the task definition networkMode to bridge and attaching a NAT gateway to the VPC is invalid because bridge is not supported by Fargate. Setting the task definition networkMode to host and enabling public IP assignment on the task is invalid because host is not supported by Fargate. Setting the task definition networkMode to none and configuring a VPC peering connection to a shared services VPC is invalid because none is not supported by Fargate and does not provide outbound connectivity. Setting the task definition networkMode to awsvpc and assigning each task an elastic network interface (ENI) in a private subnet with a route to a NAT gateway is the only configuration that satisfies all constraints.

Your team is migrating an ECS service from the EC2 launch type to Fargate. The existing task definition uses the bridge network mode with Docker port mappings to expose container ports on the host. Which statement correctly describes what must change?#

Options

Show answer

Fargate requires the awsvpc network mode, so an ECS task definition using bridge mode must switch to awsvpc. With awsvpc, each task receives its own elastic network interface and private IP address, so host-level port mappings from bridge mode no longer apply.

Why:

Fargate supports only the awsvpc network mode, so a bridge-mode task definition must be changed to awsvpc. Under awsvpc, each task gets its own elastic network interface with a private IP address, so there is no shared host network namespace and no host-level port mapping to rely on. The bridge and host modes depend on the Docker daemon running on a host EC2 instance, which Fargate does not expose, so keeping either one is not possible. The none mode would leave the task with no network connectivity at all, so it cannot serve traffic.

ECS Fargate requires the _____ network mode for all task definitions. With this mode, each Fargate task receives its own _____ with a private IP address, giving it the same networking properties as a standalone EC2 instance. On the EC2 launch type, the number of tasks that can run using this network mode is bounded by the _____ of the underlying EC2 instance type.#

Show answer

ECS Fargate requires the awsvpc network mode for all task definitions. With this mode, each Fargate task receives its own ENI with a private IP address, giving it the same networking properties as a standalone EC2 instance. On the EC2 launch type, the number of tasks that can run using this network mode is bounded by the ENI limit of the underlying EC2 instance type.

Why:

Fargate mandates the awsvpc network mode, under which each task is assigned its own elastic network interface (ENI) with a private IP. AWS automatically provisions and manages these ENIs on Fargate, so there is no per-instance ENI constraint. On the EC2 launch type, however, each awsvpc task consumes one of the ENIs available to the host EC2 instance, so the maximum number of concurrently running awsvpc tasks is limited by that instance type's ENI limit.

In Amazon ECS with the Fargate launch type, how does each task get network connectivity in your VPC? Name the network mode the task definition must use and the networking resource each task receives.#

Show answer

Fargate requires the awsvpc network mode, so each task gets its own elastic network interface (ENI) in a VPC subnet and a private IP address from that subnet's range. A public IP is optional and is assigned only when assignPublicIp is ENABLED. The subnets and security groups are supplied in the service's network configuration or the RunTask call, not in the task definition, which only sets networkMode to awsvpc.

Why:

With Fargate, the task definition must set networkMode to awsvpc, and each running task is attached its own elastic network interface (ENI) that receives a private IP address from the chosen subnet's range. The subnets and security groups are not in the task definition; they are given in the service's network configuration or the RunTask call. A public IP is optional and is only assigned when assignPublicIp is set to ENABLED. The awsvpc mode is what gives each task a dedicated ENI, so its security groups and IP are scoped to that task; tasks using the bridge or host modes instead share the host's network interface. The EC2 launch type can also use awsvpc, so the per-task ENI comes from the network mode, not from the launch type.

When using the Amazon ECS Fargate launch type, which of the following statements are true? Select all that apply.#

Options

Pick every one that applies.

Show answer

On Amazon ECS with the Fargate launch type, each task receives its own elastic network interface in the subnets you specify, and CPU and memory are declared at the task level using supported size combinations. Host network mode and privileged containers are not available on Fargate, since you do not manage the underlying hosts.

Why:

Fargate requires the awsvpc network mode, so each task gets its own elastic network interface in the subnets you specify. CPU and memory are set at the task level in the task definition, and the values must match one of the supported task-size combinations. Host network mode and privileged containers are not available on Fargate because there is no host instance you manage, so those two statements are false.

An ECS Fargate task definition specifies a container that must: (1) pull its image from a private ECR repository in the SAME AWS account, (2) inject a database password stored in AWS Secrets Manager as an environment variable via the container definition's secrets field, (3) at runtime write application logs to CloudWatch Logs using the awslogs log driver, and (4) at runtime read and write objects in an S3 bucket. Which statement correctly describes the required IAM role configuration?#

Options

Show answer

The task execution role needs ECR pull permissions, secretsmanager:GetSecretValue, and CloudWatch Logs write permissions; the task role needs S3 read/write permissions. The execution role is assumed by the Fargate infrastructure to pull images, retrieve secrets for environment-variable injection, and ship logs via the awslogs driver. The task role is assumed by the application at runtime for its own AWS API calls like S3 access.

Why:

ECS Fargate uses two distinct IAM roles per task. The task execution role (specified via executionRoleArn) is assumed by the Fargate infrastructure (the ECS agent) to perform setup-time actions on behalf of the container: pulling the container image from ECR, retrieving secrets referenced in the container definition's secrets field from Secrets Manager to inject as environment variables, and writing logs to CloudWatch Logs via the awslogs log driver. The task role (specified via taskRoleArn) is assumed by the application code running inside the container at runtime, and is used for the application's own AWS API calls — in this case, reading and writing objects in S3. The statement that the task execution role must include ECR pull permissions, secretsmanager:GetSecretValue, and CloudWatch Logs write permissions; the task role must include S3 read/write permissions is correct because it assigns ECR, Secrets Manager, and CloudWatch Logs permissions to the execution role and S3 permissions to the task role. The statement that the task role must include all of the above permissions (ECR, Secrets Manager, CloudWatch Logs, and S3) because the container performs every operation is wrong because the task role does not handle image pulls, secret injection, or log shipping — those are infrastructure-side operations. The statement that the task execution role must include ECR and S3 permissions; the task role must include Secrets Manager and CloudWatch Logs permissions is wrong because S3 access is an application-level operation (task role), while Secrets Manager retrieval and CloudWatch logging are infrastructure-side (execution role). The statement that the task execution role must include only ECR pull permissions; the task role must include Secrets Manager, CloudWatch Logs, and S3 permissions is wrong because it omits Secrets Manager and CloudWatch Logs permissions from the execution role, which are required for the agent to inject the secret and ship logs.

You are migrating an ECS service from the EC2 launch type (using bridge network mode with dynamic port mapping behind an Application Load Balancer) to Fargate. Which change to the ALB target group is required for the Fargate service to register targets and pass health checks?#

Options

Show answer

Under Fargate's awsvpc network mode, the ALB target group must use target type ip, because each task has its own ENI and private IP. The ALB registers those task IPs on the container port. Instance-type target groups and dynamic host port mapping from bridge mode do not apply to Fargate tasks.

Why:

Fargate supports only the awsvpc network mode. In awsvpc, each task gets its own ENI with a dedicated private IP and its own network namespace, so there is no shared host network namespace and no dynamic host port mapping as in bridge mode. The ALB target group must therefore use target type ip and register each task's ENI private IP on the container port. The instance target type applies only to EC2-backed ECS, where targets are host instance IDs reached through dynamic host ports. Registering host instances or an Auto Scaling group does not work for Fargate tasks, and tasks do not share the host network namespace.

When running an Amazon ECS task on the AWS Fargate launch type, which two of the following are required or enforced by the platform? Select two.#

Options

Pick every one that applies.

Show answer

On AWS Fargate, ECS tasks must use the awsvpc network mode, the only mode Fargate supports, and each task gets its own elastic network interface with a private IP address. Bridge mode with dynamic host port mapping and host network mode are not available on Fargate because each task runs in an isolated network namespace.

Why:

Fargate supports only the awsvpc network mode, so every task gets a dedicated elastic network interface (ENI) with its own private IP address and attachable security groups. Because of this, bridge mode with dynamic host port mapping does not apply, since that is an EC2-launch-type networking concept. host network mode is not supported on Fargate at all, because each task runs in its own isolated network namespace.

On AWS ECS Fargate using awsvpc network mode, containers within the same task definition instance (the same running task) can communicate with each other over localhost.#

Options

Show answer

Containers in the same ECS Fargate task can communicate over localhost. In awsvpc network mode, all containers in a task share one network namespace and one elastic network interface, so they reach each other on the ports they listen on. Separate tasks have their own IP addresses and must communicate through those IPs or service discovery.

Why:

In awsvpc mode, every container in a task shares the task's single elastic network interface and therefore one network namespace. Containers in the same task can reach each other on localhost using the ports they listen on, just as containers do in host mode. Communication between different tasks is different: those tasks have separate ENIs and private IPs, so they must reach each other by IP address or through service discovery.

An ECS Fargate service has a desired count of 80 tasks in a VPC with exactly four subnets: two public subnets (AZ a and AZ b) and two private subnets (AZ a and AZ b). The service's tasks run only in the two private subnets. The private subnets contain no other ENIs: no interface VPC endpoints, no NAT or other appliances. Each task's container listens on port 8080, and internal gRPC calls also use port 8080. The service uses awsvpc networking, and tasks must have no public IPs. Internet traffic enters through an internet-facing Application Load Balancer with a single listener and no HTTP port 80 listener or redirect. The service's rolling deployment has a minimum healthy percent of 100% and a maximum percent of 200%. In your answer, state: (1) the ALB listener protocol and port, and the target group's target type, protocol, protocol version, and port; (2) the inbound rules on the ALB security group and on the task security group, referencing security groups by ID, plus the ALB security group's outbound rule to the task security group; (3) the maximum number of private IPs the service can consume at once during a deployment, and whether one /24 private subnet per AZ is enough even if every one of those tasks landed in the same AZ.#

Show answer

The ALB uses one HTTPS listener on port 443, because the GRPC protocol version requires an HTTPS listener. The target group uses target type 'ip', protocol HTTP, protocol version GRPC, and port 8080, with health checks on port 8080. The ALB security group allows inbound 443 from 0.0.0.0/0 and outbound 8080 to the task security group. The task security group allows inbound 8080 from the ALB security group and inbound 8080 from itself for gRPC calls between tasks. Under awsvpc, each task uses one ENI and one private IP. At 200% maximum percent with a desired count of 80, the service can run at most 160 tasks at once, so at most 160 private IPs are consumed at any moment. A /24 subnet has 256 addresses, minus 5 reserved by AWS, leaving 251 usable. That is enough for one private subnet per AZ even if all 160 tasks land in one AZ, since there are no other ENIs in those subnets.

Why:

The question pins the topology so that task placement does not matter: the private subnets hold only the service's tasks, and the 200% maximum percent caps concurrent tasks at 160, which is the ceiling the service can reach during a deployment. Each awsvpc task consumes one private IP from its subnet, and AWS reserves 5 addresses per subnet, so one /24 offers 251 usable IPs. That is enough for 160 tasks even in the worst case of all of them in one AZ. The ALB uses a single HTTPS listener on 443 because the GRPC protocol version requires it, and the target group uses target type 'ip' so awsvpc tasks register by private IP. The security group rules are the minimum needed for the stated topology, and the ALB's own ENIs sit in the public subnets, so they do not consume task-subnet IPs.

An ECS Fargate task in a private subnet with a NAT Gateway and platform version 1.4.0 fails with ResourceInitializationError: unable to pull secrets or registry auth. The task execution role has correct IAM permissions for ECR and Secrets Manager. The task's security group allows inbound TCP 8080 from the ALB and outbound TCP 443 only to the ALB's security group. The identical task definition and networking configuration works on Fargate platform version 1.3.0.#

Options

Show answer

On Fargate platform version 1.4.0, all task traffic—including ECR image pulls, Secrets Manager calls, and CloudWatch Logs—egresses through the task's own awsvpc ENI and is subject to the task's security group. In platform version 1.3.0, those control-plane operations used a separate Fargate-managed ENI not governed by the task security group. A restrictive egress rule that works on 1.3.0 can therefore block image pulls and secret fetches on 1.4.0.

Why:

Fargate platform version 1.4.0 consolidated networking onto a single task ENI: all traffic—application data, ECR image pulls, CloudWatch Logs delivery, and Secrets Manager/SSM Parameter Store API calls—now egresses through the awsvpc ENI attached to the task and is therefore governed by the task's own security group and subnet route table. In platform version 1.3.0, Fargate provisioned additional Fargate-managed ENIs for these control-plane operations; those ENIs were not subject to the task's security group, so a restrictive egress rule that only allowed TCP 443 to the ALB would still permit image pulls and secret fetches. Under 1.4.0, the same restrictive rule blocks outbound 443 to ECR and Secrets Manager endpoints (which are not the ALB), producing the ResourceInitializationError. The claim that platform version 1.4.0 introduced stricter IAM evaluation for task execution roles, requiring an explicit sts:AssumeRole permission that 1.3.0 did not enforce, is wrong because no new sts:AssumeRole requirement was introduced. The claim that platform version 1.4.0 mandates VPC endpoints for ECR and Secrets Manager when tasks run in private subnets, whereas 1.3.0 could route these calls through the NAT Gateway transparently, is wrong because 1.4.0 can still use a NAT Gateway; VPC endpoints are an optimization, not a requirement—the real blocker is the security group, not the route. The claim that platform version 1.4.0 changed the default Docker network mode from bridge to awsvpc for Fargate tasks, causing the task security group to apply to traffic that was previously unfiltered, is wrong because Fargate has always required awsvpc network mode; 1.4.0 did not change the Docker network mode.

You run an API on ECS Fargate (awsvpc mode) behind an Application Load Balancer. Some containers hold WebSocket connections, and others run multi-statement database transactions that must not be cut off mid-commit. During a rolling deployment or a Fargate Spot interruption, describe how graceful shutdown is coordinated. Name (1) the task-definition parameter that sets the grace period and its maximum value on Fargate, (2) the signal the container receives first, (3) what happens when the grace period expires, (4) the ALB target group setting that stops new requests going to a draining task, and (5) what the application must do when it receives the signal.#

Show answer

(1) The container definition's stopTimeout sets the grace period; on Fargate the maximum is 120 seconds. (2) ECS sends SIGTERM to each container in the task when it stops the task. (3) If the container has not exited when stopTimeout elapses, ECS sends SIGKILL, which cannot be caught. (4) The ALB target group's deregistration delay keeps the target in draining, so the load balancer stops sending new requests while existing connections finish; WebSocket connections are allowed to drain during that window. (5) The application traps SIGTERM, stops accepting new work, lets in-flight database transactions commit or roll back, closes WebSockets with a close frame, flushes telemetry, and exits with status 0 before the grace period ends. For a Fargate Spot interruption, the same SIGTERM is delivered after the two-minute interruption notice, so the same handling applies.

Why:

The question asks for the mechanics of graceful shutdown on ECS Fargate. The task definition's stopTimeout is the grace period, capped at 120 seconds on Fargate. ECS sends SIGTERM first and sends SIGKILL only after stopTimeout elapses, and SIGKILL cannot be trapped, so the application must finish or roll back in-flight transactions and close WebSockets within that window. The ALB target group's deregistration delay keeps a draining target out of rotation for new requests while existing connections finish. Spot interruptions deliver the same SIGTERM after a two-minute notice, so one shutdown handler covers both deployments and interruptions.

Related interview questions

Job market

See aws salaries and hiring demand from live job postings.

The other 2 questions

This page shows 25 and marks what you pick. That's as far as a page can go. A free account opens the other 2 and keeps every answer. What you miss comes back until it's right: after a day, then at longer gaps.

Start with this topic

Free · the whole bank · 100 answers per 30 days, each marked with written feedback

Interview booked? Practise the job ad instead

What moved, monthly

One email a month when the bulletin comes out: what moved in the markets we track, and the new question topics we published. Confirm your address to join. Unsubscribe any time.