Getting started with Amazon Elastic File System - Amazon Elastic File System
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Getting started with Amazon Elastic File System

Larn how to quickly get started using Amazon Elastic File System (Amazon EFS). In this getting started exercise, you'll create your EFS file system and launch your EC2 instance. You'll also transfer files to your EFS file system by using Amazon DataSync and then clean up your resources.

The following steps are included in this getting started exercise.

Prerequisites for getting started

Before you begin the getting started exercise, make sure you have the following requirements:

  • You are set up with Amazon EC2 and are familiar with launching EC2 instances. You need an Amazon Web Services account, a user with administrative access, a key pair, and a security group. For more information, see Set up to use Amazon EC2.

  • Your Amazon VPC, Amazon EC2, and Amazon EFS resources are all in the same Amazon Web Services Region. This exercise uses the US West (Oregon) Region (us-west-2).

  • You have a default VPC in the Amazon Web Services Region that you're using for this getting started exercise. If you don't have a default VPC, or if you want to mount your file system from a new VPC with new or existing security groups, see Using VPC security groups for Amazon EC2 instances and mount targets.

  • You haven't changed the default inbound access rule for the default security group.

You can also perform a similar getting started exercise using Amazon Command Line Interface (Amazon CLI) commands to make the Amazon EFS API calls. For more information, see Walkthrough: Create an Amazon EFS file system and mount it on an Amazon EC2 instance using the Amazon CLI.

Create your EFS file system and launch your EC2 instance

After making sure that you meet the prerequisites for this getting started exercise, you can create your EFS file system and launch your Amazon EC2 instance. The quickest way to complete all of the necessary steps to get started with your first EFS file system is to use the EC2 new launch wizard during instance launch.

Note

You can't use Amazon EFS with Microsoft Windows–based Amazon EC2 instances.

To create your EFS file system and launch your Amazon EC2 instance using the EC2 launch wizard

For instructions on creating and mounting your EFS file system when creating an EC2 instance launch, see Use Amazon EFS with Amazon EC2.

The following are the steps that you'll perform when creating an EFS file system during instance launch.

  1. Create an EC2 instance running on a Linux operating system using the key pair and network settings you choose.

  2. Create a shared EFS file system that has the recommended settings and is automatically mounted to the EC2 instance.

  3. Launch the EC2 instance so that the EFS file system is readily available for file transfers.

Alternatively, in the Amazon EFS console, you can create file systems with recommended settings or custom settings. You can also use the Amazon CLI and API to create file systems. For more information about all of your options for creating a file system, see Creating Amazon EFS file systems.

Transfer files to your Amazon EFS file system using Amazon DataSync

After creating an EFS file system, you can transfer files to it from an existing file system by using Amazon DataSync. DataSync is a data transfer service that simplifies, automates, and accelerates moving and replicating data between on-premises storage systems and Amazon storage services over the internet or Amazon Direct Connect. DataSync can transfer your file data, and also file system metadata such as ownership, timestamps, and access permissions.

For more information about DataSync, see Amazon DataSync.

Prerequisites for transferring files to Amazon EFS using Amazon DataSync

Before transferring files to the EFS file system, make sure you have the following:

  • A source NFS file system that you can transfer files from. This source system needs to be accessible over NFS version 3, version 4, or 4.1. Example file systems include those located in an on-premises data center, self-managed in-cloud file systems, and Amazon EFS file systems.

  • You are set up to use DataSync. To learn more, see Setting up with Amazon DataSync in the Amazon DataSync User Guide.

To transfer files to your EFS file system using Amazon DataSync

For instructions on using DataSync to transfer files to an EFS file system, see Transferring your data with Amazon DataSync in the Amazon DataSync User Guide.

The following are the steps that you'll perform when transferring files to the EFS file system using DataSync.

  1. Connect to your Amazon EC2 instance.

  2. Download, deploy, and activate an agent in your environment.

  3. Create and configure a source and destination location.

  4. Create and configure a task.

  5. Run the task to transfer files from the source to the destination.

Clean up resources and protect your Amazon account

This guide includes walkthroughs that you can use to further explore Amazon EFS. Before you perform this clean-up step, you can use the resources you've created and connected to in this getting started exercise in those walkthroughs. For more information, see Walkthroughs. After you finish the walkthroughs, or if you don't want to explore the walkthroughs, take the following steps to clean up your resources and protect your Amazon Web Services account.

To clean up resources and protect your account
  1. Connect to your Amazon EC2 instance.

  2. Unmount the EFS file system with the following command.

    $ sudo umount efs
  3. Open the Amazon Elastic File System console at https://console.amazonaws.cn/efs/.

  4. Delete the EFS file system that you created in the first step of the getting started exercise.

    1. Choose the EFS file system that you want to delete from the list of file systems.

    2. For Actions, choose Delete file system.

    3. In the Permanently delete file system dialog box, type the file system ID for the EFS file system that you want to delete, and then choose Delete File System.

  5. Terminate the Amazon EC2 instance that you launched for this getting started exercise. For instructions, see Terminate Amazon EC2 instances in the Amazon IAM Identity Center User Guide.

  6. Delete the security group that you created for this getting started exercise. For instructions, see Delete a security group in the Amazon IAM Identity Center User Guide.

    Warning

    Don't delete the default security group for your VPC.