EFS Practical
Learn how to create a shared file system and access it from multiple EC2 instances.
We'll cover the following
Introduction
In the widget below, we’ll take the following steps to create an EFS and access it from two EC2 instances:
- Create a security group for EC2 with SSH access.
- Create a security group for EFS to allow NFS connections from the EC2 security group.
- Create an EC2 key pair.
- Launch two EC2 instances in two different subnets of the region.
- Create an EFS file system.
- Create EFS mount points in these subnets so that EC2 instances can connect to the EFS.
- Use the SSH command in Instance A to:
- Create a directory
/efs-mount-point
. - Mount EFS to this directory.
- Create a file in the EFS.
- Create a directory
- Use the SSH command in Instance B to:
- Create a directory
/efs-mount-point
. - Mount EFS to this directory.
- View the file created by EC2 Instance A.
- Create a directory
Note: Both EC2 instances share the file system and data added to the file system.
Practical
Execute the widget below by using our AWS credentials to explore how an EFS is created and connected with EC2 instances. Please pay attention to how we create mount points and mount targets to connect the EFS with EC2 instances.
Get hands-on with 1400+ tech skills courses.