Getting started with Amazon Elastic File System - Amazon Elastic File System

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 AWS 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're already familiar with using the Amazon EC2 console to launch instances.

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

  • You have a default VPC in the AWS 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 have created an administrator user in your AWS account and are using the credentials for that user to manage resources in your account. For more information, see Setting up for Amazon EFS.

  • You have a key pair set up in the Amazon EC2 console. A key pair is required to launch and connect to an Amazon EC2 instance. For instructions on creating a key pair, see Set up to use Amazon EC2.

You can also perform a similar getting started exercise using AWS Command Line Interface (AWS 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 AWS 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 AWS CLI and API to create file systems. For more information about all of your options for creating a file system, see Creating an Amazon EFS file system.

Transfer files to your Amazon EFS file system using AWS DataSync

After creating an EFS file system, you can transfer files to it from an existing file system by using AWS DataSync. DataSync is a data transfer service that simplifies, automates, and accelerates moving and replicating data between on-premises storage systems and AWS storage services over the internet or AWS 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 AWS DataSync.

Prerequisites for transferring files to Amazon EFS using AWS 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.

  • An EFS file system to transfer files to. If you don't have an EFS file system, create one. For more information, see Create your EFS file system and launch your EC2 instance.

  • You are set up to use DataSync. To learn more, see Setting up with AWS DataSync.

To transfer files to your EFS file system using AWS 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.

For instructions on using DataSync to transfer files to an EFS file system, see Transferring your data with AWS DataSync.

Clean up resources and protect your AWS 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 AWS 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.aws.amazon.com/efs/.

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

  5. For Actions, choose Delete file system.

  6. 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.

  7. Terminate the Amazon EC2 instance that you launched for this getting started exercise. For instructions, see Terminate Amazon EC2 instances.

  8. In the navigation pane, choose Security Groups.

  9. Select the name of the security group that you created for this getting started exercise in Create your EFS file system and launch your EC2 instance as a part of the Amazon EC2 instance launch wizard.

    Warning

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

  10. For Actions, choose Delete Security Group.

  11. In Delete Security Group, choose Yes, Delete to delete the security group you created for this getting started exercise.