chalice icon indicating copy to clipboard operation
chalice copied to clipboard

EFS Support

Open rtrive opened this issue 5 years ago • 9 comments

Feature request to support integration with EFS as file system attach to lambda

https://docs.aws.amazon.com/lambda/latest/dg/services-efs.html

rtrive avatar Jul 11 '20 16:07 rtrive

Labeling as feature request.

jamesls avatar Jul 15 '20 18:07 jamesls

This would be super useful.

kalpaitch avatar Jun 05 '21 19:06 kalpaitch

Adding my vote for this.

dazzag24 avatar Aug 12 '21 07:08 dazzag24

Hi, this is one year in development. Anyone working on this, please?

lukashrdy avatar Aug 31 '21 15:08 lukashrdy

Has there been any progress for this?

I attached an EFS resource with the web console, but whenever i try chalice deploy this the error i get

 An error occurred (InvalidParameterValueException) when calling the 
 UpdateFunctionConfiguration operation: Function VPC configuration cannot be 
 removed with access point <ARN> referenced.

I wonder if this is easily fixed if you forward the flag to the aws lambda CLI

aws lambda update-function-configuration --function-name my-function \
     --file-system-configs Arn=$ARN,LocalMountPath=/mnt/efs0

from AWS docs

BDANG avatar Oct 24 '21 00:10 BDANG

I've been able to work around it by writing a custom script:

You'll need to assign a VPC/subnet/security group to the lambda function on the web console first

# use chalice deploy to generate the deployment.zip
chalice deploy

# copy the deployment.zip to S3
aws s3 cp /path/to/chalice-project/.chalice/deployments/<deployment-hash>.zip s3://bucket/path.zip

# deploy/update the Lambda function from an S3-saved .zip
aws lambda update-function-code --function-name <function-name> --region <region> --s3-bucket <bucket> --s3-key path.zip

# attach EFS
aws lambda update-function-configuration --function-name <function-name> --region <region> --file-system-configs Arn=<EFS access point ARN>,LocalMountPath=</mnt/your/path>

Attaching VPC to your chalice project may break S3 functionality

  • You will need to create a 'VPC Endpoint' with S3 gateway info

BDANG avatar Oct 24 '21 02:10 BDANG

Thank you for sharing! Using similar approach. Nevertheless question remains whether this feature is ever to be implemented. Can anyone answer? Since this will become a drawback for our project soon.

lukashrdy avatar Oct 24 '21 10:10 lukashrdy

This feature would be super useful.

BPDanek avatar Dec 29 '23 11:12 BPDanek

I'm also now running into a usecase for using EFS with Chalice and would love to see this natively supported

devinmatte avatar Mar 07 '24 21:03 devinmatte