I am unable to use EFS with lambda and I am getting permission denied following this example: https://aws.amazon.com/blogs/compute/using-amazon-efs-for-aws-lambda-in-your-serverless-applications/
func function() (events.APIGatewayProxyResponse, error) {
if err := os.Mkdir(fmt.Sprintf("/mnt/efs/%v", "123"), os.ModePerm); err != nil {
return events.APIGatewayProxyResponse{}, err
}
return events.APIGatewayProxyResponse{
StatusCode: 200,
Body: "OK",
}, nil
}
I get this error
mkdir /mnt/efs/123: permission denied: PathError null
This example is very misleading: https://aws.amazon.com/blogs/compute/using-amazon-efs-for-aws-lambda-in-your-serverless-applications/
If you write like this:
```
AccessPointResource:
Type: 'AWS::EFS::AccessPoint'
Properties:
FileSystemId: !Ref FileSystemResource
PosixUser:
Uid: "1000"
Gid: "1000"
RootDirectory:
CreationInfo:
OwnerGid: "1000"
OwnerUid: "1000"
Permissions: "0777"
Path: "/lambda" // <========== this one
Than this have to be:
MyLambdaFunction:
Type: AWS::Serverless::Function
Properties:
...
FileSystemConfigs:
- Arn: arn:aws:elasticfilesystem:us-east-1:xxxxxx:accesspoint/
fsap-123abcdef12abcdef
LocalMountPath: /mnt/lambda // <============ here
and not :
LocalMountPath: /mnt/efs // <====================== wrong
```
I will leave this open, the docs should be changed.
@MatteoInfi Thanks for letting us know. I reached out to the owner of the blog for him to address this. Closing as we don't own that content.
Most helpful comment
@MatteoInfi Thanks for letting us know. I reached out to the owner of the blog for him to address this. Closing as we don't own that content.