---
title: "ECS ResourceInitializationError mounting an EFS volume | Proofline"
description: "Compare the NFS client's Availability Zone and security group with the file system's mount targets before you touch IAM."
url: https://proofline.sh/learn/ecs-efs-volume-mount-failed/
---

[Learning center](/learn/)

# ECS ResourceInitializationError mounting an EFS volume

Compare the NFS client's Availability Zone and security group with the file system's mount targets before you touch IAM. The client is the task on Fargate and the container instance on EC2. If a mount target in that zone accepts NFS on TCP 2049 from the client, and the subnets' network ACLs and the VPC's DNS settings let the connection through, the failure is in the revision's authorizationConfig, the IAM policies or the transit encryption settings.

Network outages The Proofline team November 22, 2026 9 min read

## The signature and its nearby causes

A deployment adds or changes an EFS volume, and its tasks stop with stop code `TaskFailedToStart` and a stopped reason that begins `ResourceInitializationError` and says the EFS volume could not be set up. The containers never ran. On Fargate, a supervisor container that the platform creates manages the volume, so the mount happens outside your image. [Task fields](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Task.html) · [ResourceInitializationError troubleshooting](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/resource-initialization-error.html) · [EFS volumes with ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html)

Three layers sit between the task and the files:

-   **The NFS path.** EFS DNS names resolve only when the file system has a mount target in the client's Availability Zone, and the mount target's security group must allow inbound NFS on TCP 2049 from the client's security group: the task's on Fargate, the container instance's on EC2.
-   **Authorization.** With `iam` set to `ENABLED`, ECS mounts with the task role, and EFS evaluates that role together with the file system policy. An access point adds its own root directory and POSIX identity.
-   **Transit encryption.** IAM authorization and access points both require `transitEncryption` set to `ENABLED`, and a file system policy can refuse clients that do not encrypt.

[EFS DNS names](https://docs.aws.amazon.com/efs/latest/ug/mounting-fs-mount-cmd-dns-name.html) · [EFS security groups](https://docs.aws.amazon.com/efs/latest/ug/network-access.html) · [ECS EFS best practices](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-best-practices.html) · [EFSVolumeConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_EFSVolumeConfiguration.html)

When the stopped reason carries the mount helper's output, AWS's troubleshooting article sorts it into the same layers: a connection timeout points at security groups or routing, a failure to resolve the file system's name points at DNS or a missing mount target, and an access-denied result points at IAM or the file system policy. Use the output to choose where to start, and the reads below to confirm it. [Fargate EFS mount issues](https://repost.aws/knowledge-center/fargate-unable-to-mount-efs) · [EFS mount troubleshooting](https://docs.aws.amazon.com/efs/latest/ug/troubleshooting-efs-mounting.html)

## Read the task and the volume configuration

Use a read-only profile and replace the uppercase placeholders. Save the stopped task within an hour of the failure, while ECS still returns it. [Stopped task retention](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/stopped-task-errors.html)

```
aws ecs describe-tasks \
  --profile PROFILE --region REGION --cluster CLUSTER --tasks TASK_ARN \
  --query 'tasks[].{task:taskArn,definition:taskDefinitionArn,deployment:startedBy,launchType:launchType,containerInstance:containerInstanceArn,code:stopCode,reason:stoppedReason,az:availabilityZone,platform:platformVersion,taskRoleOverride:overrides.taskRoleArn,eni:attachments[?type==`ElasticNetworkInterface`].details}' \
  --output json --no-cli-pager

aws ecs describe-task-definition \
  --profile PROFILE --region REGION --task-definition TASK_DEFINITION_ARN \
  --query 'taskDefinition.{definition:taskDefinitionArn,taskRole:taskRoleArn,efs:volumes[?efsVolumeConfiguration].{volume:name,config:efsVolumeConfiguration},mounts:containerDefinitions[].{container:name,mountPoints:mountPoints}}' \
  --output json --no-cli-pager
```

Note `launchType`, `az`, the subnet in the interface details, and from the volume configuration the `fileSystemId`, `rootDirectory`, `transitEncryption`, `transitEncryptionPort`, and `authorizationConfig.accessPointId` and `iam`. The task role that matters is `taskRoleOverride` when it is set, otherwise `taskRole`. The execution role does not mount EFS volumes. [EFSAuthorizationConfig](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_EFSAuthorizationConfig.html) · [Task overrides](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskOverride.html)

The launch type decides which network the NFS client uses. On Fargate the mount goes out through the task's own interface, so the checks below use the task's subnet and security groups. On EC2, ECS mounts the volume on the container instance, so the client is the instance: AWS's EC2 tutorial admits the container instances' security group on the mount target. Read the instance's subnet, zone and groups, and use them in place of the task's below. [EFS tutorial for ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/tutorial-efs-volumes.html)

```
aws ecs describe-container-instances \
  --profile PROFILE --region REGION --cluster CLUSTER --container-instances CONTAINER_INSTANCE_ARN \
  --query 'containerInstances[].ec2InstanceId' --output text --no-cli-pager

aws ec2 describe-instances \
  --profile PROFILE --region REGION --instance-ids INSTANCE_ID \
  --query 'Reservations[].Instances[].{az:Placement.AvailabilityZone,subnet:SubnetId,groups:SecurityGroups[].GroupId}' \
  --output json --no-cli-pager
```

## Check the NFS path first

List the mount targets and the security groups on the one in the client's zone:

```
aws efs describe-mount-targets \
  --profile PROFILE --region REGION --file-system-id FILE_SYSTEM_ID \
  --query 'MountTargets[].{id:MountTargetId,az:AvailabilityZoneName,subnet:SubnetId,state:LifeCycleState,ip:IpAddress}' \
  --output json --no-cli-pager

aws efs describe-mount-target-security-groups \
  --profile PROFILE --region REGION --mount-target-id MOUNT_TARGET_ID \
  --query 'SecurityGroups' --output json --no-cli-pager

aws ec2 describe-security-groups \
  --profile PROFILE --region REGION --group-ids MOUNT_TARGET_SECURITY_GROUP_ID \
  --query 'SecurityGroups[].{id:GroupId,nfs:IpPermissions[?FromPort<=`2049` && ToPort>=`2049` || IpProtocol==`"-1"`].{protocol:IpProtocol,from:FromPort,to:ToPort,groups:UserIdGroupPairs[].GroupId,cidrs:IpRanges[].CidrIp}}' \
  --output json --no-cli-pager
```

[describe-mount-targets](https://docs.aws.amazon.com/cli/latest/reference/efs/describe-mount-targets.html) · [describe-mount-target-security-groups](https://docs.aws.amazon.com/cli/latest/reference/efs/describe-mount-target-security-groups.html) · [describe-security-groups](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-security-groups.html)

A file system has at most one mount target per Availability Zone, and a One Zone file system has exactly one. If no `available` mount target matches the task's `az`, the file system's DNS name cannot resolve from that zone, which is the failure AWS associates with a missing mount target. If the zone has one, the `nfs` rules must name the client's security group, or a CIDR that covers the client's address. On Fargate, read the task's security groups from the failed deployment's `networkConfiguration`; on EC2, use the container instance's groups from above. Check that their outbound rules allow TCP 2049 to the mount target.

Security groups are stateful, but network ACLs are not, and DNS is a separate setting. Read both before ruling the path out:

```
aws ec2 describe-network-acls \
  --profile PROFILE --region REGION \
  --filters Name=association.subnet-id,Values=CLIENT_SUBNET_ID,MOUNT_TARGET_SUBNET_ID \
  --query 'NetworkAcls[].{id:NetworkAclId,subnets:Associations[].SubnetId,rules:Entries[].{n:RuleNumber,out:Egress,action:RuleAction,protocol:Protocol,cidr:CidrBlock,ports:PortRange}}' \
  --output json --no-cli-pager

aws ec2 describe-vpc-attribute \
  --profile PROFILE --region REGION --vpc-id VPC_ID --attribute enableDnsSupport \
  --output json --no-cli-pager
```

The ACL on each subnet must allow TCP 2049 toward the mount target and the ephemeral ports on the way back, in both directions' rules; rules apply in number order and the first match wins. EFS DNS names resolve only when the VPC has both DNS resolution and DNS hostnames enabled; read `enableDnsHostnames` with the same command when the mount output says the name did not resolve. [Network ACLs](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html) · [EFS DNS names](https://docs.aws.amazon.com/efs/latest/ug/mounting-fs-mount-cmd-dns-name.html) · [CreateMountTarget](https://docs.aws.amazon.com/efs/latest/ug/API_CreateMountTarget.html) · [EFS security groups](https://docs.aws.amazon.com/efs/latest/ug/network-access.html) · [Deployment fields](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Deployment.html)

## Then check authorization and encryption

When the mount target, the security groups, the network ACLs and DNS all allow the connection, compare the volume configuration with the rules ECS documents and with the file system's own policy and access point:

```
aws efs describe-file-system-policy \
  --profile PROFILE --region REGION --file-system-id FILE_SYSTEM_ID \
  --query 'Policy' --output text --no-cli-pager

aws efs describe-access-points \
  --profile PROFILE --region REGION --access-point-id ACCESS_POINT_ID \
  --query 'AccessPoints[].{id:AccessPointId,fileSystem:FileSystemId,state:LifeCycleState,root:RootDirectory.Path,creation:RootDirectory.CreationInfo,user:PosixUser}' \
  --output json --no-cli-pager
```

A `PolicyNotFound` error means the file system has no policy, and EFS then lets any client that can reach a mount target connect without IAM. [DescribeFileSystemPolicy](https://docs.aws.amazon.com/efs/latest/ug/API_DescribeFileSystemPolicy.html) · [IAM for EFS clients](https://docs.aws.amazon.com/efs/latest/ug/iam-access-control-nfs-efs.html)

| Read | Reading |
| --- | --- |
| `iam` `ENABLED` or an `accessPointId`, with `transitEncryption` absent or `DISABLED` | The revision breaks a documented rule: both require transit encryption |
| `accessPointId` set and `rootDirectory` other than `/` | Another documented rule: with an access point, omit `rootDirectory` or set it to `/` |
| Access point belongs to another `fileSystem`, or is not `available` | The revision points at the wrong or a deleted access point |
| `iam` `ENABLED`, the policy grants `elasticfilesystem:ClientMount` only to other principals, and the task role's own policies do not allow it either | The task role is not authorized, for example because the file system policy names only the execution role |
| Either policy explicitly denies `elasticfilesystem:ClientMount` to the task role | The deny wins over any allow |
| `iam` `DISABLED`, and the policy grants access only to named principals | The mount carries no role to match, so the policy has nothing to allow |
| Policy denies requests without secure transport, and `transitEncryption` is `DISABLED` | The policy refuses unencrypted clients, whatever the identity |

`elasticfilesystem:ClientMount` gives read-only access, and a container that writes to the volume also needs `elasticfilesystem:ClientWrite`. For a task role in the file system's account, an allow in either the role's own policies or the file system policy is enough when no statement denies it, so a file system policy that names other principals refuses the task role only if the role's own policies grant nothing. Read the role's policies before you edit the file system policy:

```
aws iam list-attached-role-policies --profile PROFILE --role-name TASK_ROLE_NAME --output json --no-cli-pager
aws iam list-role-policies --profile PROFILE --role-name TASK_ROLE_NAME --output json --no-cli-pager
```

The IAM policy simulator gives a direct answer for the identity side: `aws iam simulate-principal-policy --policy-source-arn TASK_ROLE_ARN --action-names elasticfilesystem:ClientMount elasticfilesystem:ClientWrite --resource-arns FILE_SYSTEM_ARN`. A role in another account needs both an allow in its own policies and a grant in the file system policy. [IAM policy evaluation](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html) · [simulate-principal-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/simulate-principal-policy.html) [EFSVolumeConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_EFSVolumeConfiguration.html) · [IAM for EFS clients](https://docs.aws.amazon.com/efs/latest/ug/iam-access-control-nfs-efs.html) · [ECS EFS best practices](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-best-practices.html)

## Two ways checkout:44 can fail

This fixture is illustrative. The fictional service `checkout` moves from `checkout:43` to `checkout:44`, which adds an EFS volume `receipts` on file system `fs-0a1b2c` through access point `fsap-0d4e5f`, with `transitEncryption` and `iam` both `ENABLED`. Tasks run on Fargate 1.4.0 in `us-east-1`.

| Read | Path case | Authorization case |
| --- | --- | --- |
| Mount output in the reason | Connection timed out | Access denied |
| Task `az` | `us-east-1b` | `us-east-1b` |
| Mount targets | `us-east-1a`, `us-east-1b`, both `available` | Same |
| NFS rule on the mount target's group | Allows 2049 from `sg-old-tasks` only | Allows 2049 from `sg-checkout` |
| Deployment security group | `sg-checkout`, new in this release | `sg-checkout` |
| File system policy | Grants `ClientMount`, `ClientWrite` to the task role | Grants them to `ecsTaskExecutionRole` only |
| Task role's own policies | No `elasticfilesystem` actions | No `elasticfilesystem` actions |

In the path case, the release moved the service to a new security group that the mount target does not accept, so the NFS connection never completes. Add an inbound TCP 2049 rule for `sg-checkout` on the mount target's group. In the authorization case, the network is open and EFS refuses the identity: with `iam` enabled the mount presents the task role, the file system policy allows only the execution role, and the task role's own policies allow nothing on EFS. Grant the task role the two actions in either policy. A third variant would show a task in `us-east-1c`, where no mount target exists; there the fix is a mount target in that zone or removing that zone's subnet from the service.

## Confirm on the replacement task

Record the replacement task's ARN, revision, `az` and `startedAt`. A task that reaches `RUNNING` got past volume setup. Then exercise the mount the way the application does, such as writing and reading back a file under the container path, because a read-only grant or an access point's POSIX user can still refuse writes after a successful mount. If the service spans several zones, confirm a replacement in each one, since each zone uses its own mount target.

## Where this reading stops

The rules read now may not be the rules the task met. A security group or policy edited during the incident hides the original cause, so save the stopped reason before changing anything. Treat the helper's text in the reason as a pointer to a layer, not a fixed code. Check platform support before the layers above: on Fargate, EFS volumes need Linux platform version 1.4.0 or later, and on EC2, access points and IAM authorization need container agent 1.38.0 or later, with `amazon-efs-utils` and the ECS volume plugin on a custom AMI. [EFS volumes with ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html)

Other startup failures share this stop code and reason prefix. If the reason names a log group or a secret instead, see [the missing log group guide](/learn/ecs-awslogs-log-group-does-not-exist/) or [the secrets guide](/learn/ecs-secrets-startup-errors/), and [the signature table](/learn/aws-deployment-failure-signatures/) for the rest.

## Questions

### Which IAM role does ECS use to mount an EFS volume?

With `iam` set to `ENABLED` in the volume's `authorizationConfig`, ECS passes the task role, or a task role override, to EFS. The execution role is not used for the mount. A file system policy that names only the execution role refuses the mount unless the task role's own policies allow `elasticfilesystem:ClientMount`.

### What security group rule does an EFS mount target need for ECS tasks?

An inbound rule for NFS on TCP 2049 on the security group attached to the mount target, from the task's security group on Fargate or the container instance's on EC2. The client's group must also allow that traffic outbound.

### Why does an EFS mount fail in only one Availability Zone?

EFS DNS names resolve only when the file system has a mount target in the client's zone. A service whose subnets span a zone without a mount target fails there and works in the others.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [ECS ResourceInitializationError: awslogs log group does not exist](/learn/ecs-awslogs-log-group-does-not-exist/)
    
    Deployment failures The Proofline team November 22, 2026 8 min read
    
-   ### [Fix ECS ResourceInitializationError when pulling secrets](/learn/ecs-secrets-startup-errors/)
    
    Missing secrets The Proofline team November 15, 2026 8 min read
