I want to use AWS DataSync to transfer data from Amazon Elastic File System (Amazon EFS) to Amazon Simple Storage Service (Amazon S3).
Short description
AWS DataSync transfers data between Amazon EFS and Amazon S3. You create a DataSync task that specifies the source EFS file system and destination S3 bucket, then configure security settings and transfer options.
Resolution
Complete the following steps:
- Open the DataSync console.
- Change the AWS Region to the same AWS Region as the source Amazon EFS file system.
- Choose Tasks, and then choose Create task.
- For Configure source location, select Create a new location.
- Under Configuration, for Location type, select Amazon EFS file system.
- For EFS File system, choose the EFS file system that you want to use as the source location.
- For Mount path, enter the mount path for your EFS file system.
Note: The path can include a subdirectory in the EFS file system. The subdirectory reads data from the EFS source or writes data to the EFS destination. By default, DataSync uses the root directory.
- For Subnet, choose a subnet.
Note: The subnet must be in the same VPC as the EFS file system. The subnet must include at least one mount target for your EFS file system.
- For Security Group, choose the security group that's attached to the mount target.
Note: You can choose more than one security group. The security groups that you specify must allow inbound traffic on NFS port 2049. For more information, see Determining the subnet and security groups for your mount target.
Important: DataSync uses the security group that's specified in step 9 to connect to your EFS. You must configure the security group to communicate within itself. Or, choose a different subnet and security group.
- For In-transit encryption, choose None.
Note: You can also choose TLS 1.2. This option encrypts the data when DataSync connects with the EFS file system. This option is necessary if you have an EFS policy that restricts IAM roles or users that access the EFS file system. This option is also necessary when DataSync uses an EFS access point to access the file system. After you choose TLS 1.2, choose the EFS access point that's created in your EFS. Then, choose the IAM role that you want DataSync to assume when you connect to the EFS. For more information, see Accessing restricted file systems.
- Choose Next.
- For Destination location options, select Create a new location.
- Under Configuration, for Location type, select Amazon S3 bucket.
- For Region, choose the Region where the S3 bucket is created.
- For S3 URI, enter the S3 URI of the bucket with a prefix like the following example: s3://amzn-s3-demo-bucket/efs/.
Note: In this example, /efs is the prefix where data is transferred to. Or, choose Browse S3 and then choose the bucket and prefix inside the bucket where you want the data to be transferred to.
Important: DataSync uses this folder to read data from an S3 source location or write data to an S3 destination. You can only provide the s3://amzn-s3-demo-bucket/ URI if you copy the files into the root of the bucket. For more information, see Creating your transfer location for an Amazon S3 general purpose bucket.
- For S3 storage class, choose the storage class that you want to use for the transferred files.
- For IAM role, select a role that has permissions to access the S3 bucket. Or, choose Autogenerate for DataSync to automatically create a role with the required permissions. If DataSync previously created an IAM role for the S3 bucket, then that role is the default.
- Choose Next.
- For Configure settings, configure the task settings for your use case.
- Choose Next.
- Choose Create task.
After the task is created, you can start the task to transfer files from the EFS file system to the S3 bucket. You can schedule periodic replications of your EFS file system to the S3 bucket within the same AWS account. For more information, see Scheduling when your AWS DataSync task runs.
Related information
Where can I transfer my data with AWS DataSync?
Configuring AWS DataSync transfers with Amazon EFS
Configuring AWS DataSync transfers with Amazon S3
Allow DataSync to read and write to your Amazon S3 bucket