Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mount EFS on a Lambda function?

I need to run a periodic cleanup on my EFS drive (which is being shared by multiple autoscaling EC2 instances). The cleanup involves deleting files/folders that meet a certain criterion (date/size etc.).

I imagined AWS Lambda to be the perfect solution for this task. Just trigger the function periodically, which should mount the Shared drive and run the cleanup. But it seems that Lambda only supports Creating/polling the disk for it's type and modifying its mountpoint etc.

Is there any alternative to accomplish this task?

like image 770
lalit Avatar asked Jun 19 '18 08:06

lalit


1 Answers

AWS has released Lambda filesystem support. See these details for configuration information, including CloudFormation and SAM templates. The file system and the Lambda function must be in the same region, and the function must be attached to the VPC, though it may be in a different account.

like image 150
Glenn Nethercutt Avatar answered Oct 13 '22 20:10

Glenn Nethercutt