Menu
Amazon Elastic File System
User Guide

Creating or Deleting Mount Targets in a VPC

To access an Amazon EFS file system in a VPC you need mount targets. For an Amazon EFS file system:

  • You can create one mount target in each Availability Zone.

  • If the VPC has multiple subnets in an Availability Zone, you can create a mount target in only one of those subnets. All EC2 instances in the Availability Zone can share the single mount target.

Note

We recommend that you create a mount target in each of the Availability Zones. There are cost considerations for mounting a file system on an EC2 instance in an Availability Zone through a mount target created in another Availability Zone. For more information, see Amazon EFS. In addition, by always using a mount target local to the instance's Availability Zone, you eliminate a partial failure scenario. If the mount target's zone goes down, you won't be able to access your file system through that mount target.

For more information about the operation, see CreateMountTarget.

You can delete mount targets. Note that a mount target deletion forcibly breaks any mounts of the file system via that mount target, which might disrupt instances or applications using those mounts. For more information, see DeleteMountTarget.

Using the Console

Use the following procedure to create new mount targets, delete, or update existing mount targets using the AWS Management Console.

  1. In the Amazon EFS console, select the file system, choose Actions, and then choose Manage File System Access.

    The console displays the Manage File System Access page with a list of file system mount targets you have created in the selected VPC. The console shows a list of Availability Zones and mount target information, if there is a mount target in that Availability Zone.

    The console shows that the file system has one mount target in the eu-west-2c Availability Zone, as shown following:

  2. To create new mount targets

    1. Click on the left side in the specific Availability Zone row.

    2. If the Availability Zone has multiple subnets, select a subnet from the Subnet list.

    3. Amazon EFS automatically selects an available IP address, or you can provide another IP address explicitly.

    4. Choose a Security Group from the list.

      For more information about security groups, see Amazon EC2 Security Groups in the Amazon EC2 User Guide for Linux Instances.

  3. To delete a mount target, choose the X next to the Availability Zone from which you want to remove a mount target.

Using the AWS CLI

To create a mount target, use the create-mount-target AWS CLI command (corresponding operation is CreateMountTarget), as shown following:

Copy
$ aws efs create-mount-target \ --file-system-id file-system-ID (for which to create the mount target) \ --subnet-id vpc-subnet-ID (in which to create mount target) \ --security-group security-group IDs (to associate with the mount target) \ --region aws-region (for example, us-west-2) \ --profile adminuser

Note that the AWS region (the region parameter) must be the VPC region.

You can get a list of mount targets created for a file system using the describe-mount-target AWS CLI command (corresponding operation is DescribeMountTargets), as shown following:

Copy
$ aws efs describe-mount-targets \ --file-system-id file-system-ID \ --region aws-region-where-file-system-exists \ --profile adminuser

Here's a sample response:

Copy
{ "MountTargets": [ { "MountTargetId": "fsmt-52a643fb", "NetworkInterfaceId": "eni-f11e8395", "FileSystemId": "fs-6fa144c6", "LifeCycleState": "available", "SubnetId": "subnet-15d45170", "OwnerId": "23124example", "IpAddress": "10.0.2.99" }, { "MountTargetId": "fsmt-55a643fc", "NetworkInterfaceId": "eni-14a6ae4d", "FileSystemId": "fs-6fa144c6", "LifeCycleState": "available", "SubnetId": "subnet-0b05fc52", "OwnerId": "23124example", "IpAddress": "10.0.19.174" } ] }

To delete an existing mount target, use the delete-mount-target AWS CLI command (corresponding operation is DeleteMountTarget), as shown following:

Copy
$ aws efs delete-mount-target \ --mount-target-id mount-target-ID-to-delete \ --region aws-region-where-mount-target-exists \ --profile adminuser