How to connect to EFS via CloudShell

A tricky topic when trying to connect to EFS is that you need to create an EC2 instance. But what if your organization is somehow bureaucratic and you need a thousand approvals just to run it locally the first time? A quick win is to use an EC2 instance and CloudShell. So, you just need to follow these steps: Create an EC2 instance with any Linux. Create a Key. Launch it. Create a Bucket in S3. Upload the Key. Open AWS Cloud Shell. Download the Key: aws s3 cp s3://MY_BUCKET/MY_KEY.pem . Give the right permissions to the Key: chmod 400 "MY_KEY.pem" Get your configuration from the **Connect **section in your EC2 instance. Connect to your EC2 instance via SSH: ssh -i "MY_KEY.pem" ec2-user@ec2MY_CONFIGURATOIN.MY_REGION.compute.amazonaws.com Install the Amazon EFS Client: sudo yum install -y amazon-efs-utils Create a folder called efs (sudo mkdir efs). Mount your EFS via the IP, which you can get from Attach button: sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport MY_IP:/ efs And that's all, now, you can mount your EFS without needing any special permissions in your local laptop. Follow me on: Personal LinkedIn YouTube Instagram Cyber Prophets Sharing Your Stories

Apr 14, 2025 - 11:35
 0
How to connect to EFS via CloudShell

A tricky topic when trying to connect to EFS is that you need to create an EC2 instance. But what if your organization is somehow bureaucratic and you need a thousand approvals just to run it locally the first time? A quick win is to use an EC2 instance and CloudShell. So, you just need to follow these steps:

  1. Create an EC2 instance with any Linux.
  2. Create a Key.
  3. Launch it.
  4. Create a Bucket in S3.
  5. Upload the Key.
  6. Open AWS Cloud Shell.
  7. Download the Key: aws s3 cp s3://MY_BUCKET/MY_KEY.pem .
  8. Give the right permissions to the Key: chmod 400 "MY_KEY.pem"
  9. Get your configuration from the **Connect **section in your EC2 instance.
  10. Connect to your EC2 instance via SSH: ssh -i "MY_KEY.pem" ec2-user@ec2MY_CONFIGURATOIN.MY_REGION.compute.amazonaws.com
  11. Install the Amazon EFS Client: sudo yum install -y amazon-efs-utils
  12. Create a folder called efs (sudo mkdir efs).
  13. Mount your EFS via the IP, which you can get from Attach button: sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport MY_IP:/ efs

And that's all, now, you can mount your EFS without needing any special permissions in your local laptop.

Follow me on:

Personal LinkedIn YouTube Instagram Cyber Prophets Sharing Your Stories
Personal LinkedIn YouTube Instagram RedCircle Podcast RedCircle Podcast

sponsor me