Skip to content

Browse/manage EFS contents with serverless shell commands

License

Notifications You must be signed in to change notification settings

miniwdl-ext/lambdash-efs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lambdash-efs

This is a fork of lambdash by Eric Hammond, an AWS Lambda function that simply runs a shell command inside the Lambda runtime and returns its standard output & error; accompanied by a local command-line invocation helper.

We've modernized it to deploy using Terraform, and to make the Lambda function mount an existing EFS file system at /mnt/efs. This provides a serverless facility to browse & manage EFS contents, at negligible cost whenever needed; filling a gap that exists while AWS Console lacks a browser for EFS contents, CloudShell can't mount EFS, etc.

How to

Requirements:

  • terminal session with AWS CLI configured (administrator/poweruser credentials and default region)
  • git, terraform, python3, boto3
  • an EFS file system, and specifically:
    • EFS Access Point (fsap-xxxx)
    • VPC subnet (subnet-xxxx) that can reach the EFS
    • Security Group (sg-xxxx) that can reach the EFS

Deployment:

git clone https://github.com/miniwdl-ext/lambdash-efs.git
cd lambdash-efs
terraform init -upgrade
terraform apply -var=fsap=fsap-xxxx -var=subnet=subnet-xxxx -var=sg=sg-xxxx

Example session:

$ ./lambdash uname -a
Linux 169.254.195.245 4.14.252-207.481.amzn2.x86_64 #1 SMP Wed Oct 27 20:57:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ ./lambdash bash -c 'echo Hello, world! > /mnt/efs/hello.txt'
$ ./lambdash ls /mnt/efs
hello.txt
$ ./lambdash cat /mnt/efs/hello.txt
Hello, world!
$ ./lambdash rm /mnt/efs/hello.txt

And naturally you may copy the lambdash script somewhere in your PATH.

Limits

The Lambda function is configured with 256 MiB memory and 60-second timeout. The command's stdout & stderr are truncated at 64 MiB each.

Alternatives

About

Browse/manage EFS contents with serverless shell commands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages

  • HCL 51.3%
  • JavaScript 26.8%
  • Python 21.9%