aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.55k stars 1.01k forks source link

EFS Support #1453

Open rtrive opened 4 years ago

rtrive commented 4 years ago

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

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

jamesls commented 4 years ago

Labeling as feature request.

kalpaitch commented 3 years ago

This would be super useful.

dazzag24 commented 2 years ago

Adding my vote for this.

lukashrdy commented 2 years ago

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

BDANG commented 2 years ago

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 commented 2 years ago

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

lukashrdy commented 2 years ago

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.

BPDanek commented 7 months ago

This feature would be super useful.

devinmatte commented 4 months ago

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