AWS Elastic File System (EFS) provides incredible scalability for your storage requirements, making it easy to share data across hundreds or even thousands of EC2 instances. In this lab, students will create an Amazon Elastic File System in the US-East-1 Region with encryption enabled. Students will also configure mount targets for this file system, enforce encryption in-flight, and finally mount the file system to a pre-created EC2 instance.
Successfully complete this lab by achieving the following learning objectives:
- Create an EFS File System Named “devshare” with Encryption Enabled
Create an EFS file system with the name of
Leave default creation settings to leave encryption enabled.
- Create Mount Targets for EFS Using the EFSMountSecurityGroup in Each Availability Zone
Select your new EFS file system and navigate to the Network tab. Add the
EFSMountSecurityGroupsecurity group to each mount target to ensure our EC2 instance will have access to this volume.
- Apply a File System Policy to the EFS Volume to Enforce In-Transit Encryption for All Clients
Create a file system policy for the EFS volume to enforce in-transit encryption for all of our clients.
- Mount the EFS Volume to the EC2 Instance and Create a File on the Elastic File System
Use the following command to mount your volume with encryption in flight, replacing
fs-00000000with your file system ID.
sudo mount -t efs -o tls file-system-id efs-mount-point/
Example command mounting to local EFS directory you have created:
sudo mount -t efs -o tls fs-000000000 efs/
Verify the volume is ready for use by creating a file:
sudo touch /efs/llama.txt
Note: Keep in mind without adding this to our
/etc/fstab, the mount will not persist through a reboot. In this case, we are only preparing the volume for use by our team, so that’s okay in this lab.