Search code examples
amazon-web-servicesaws-lambdaamazon-efs

lambda + efs - mounting vs access point


I am trying to use aws lambda and efs together so I can perform operations that exceed the default lambda storage limit of 500mb. I am confused what the difference is between Local mount path and Access point.

Is the local mount path a term used to describe where the file system is mounted in the existing file system and the access point (which also has it's own path) the location that an application would reference in code? Or does it not actually matter which path is referenced?

For example

AccessPointResource:
    Type: 'AWS::EFS::AccessPoint'
    Properties:
      FileSystemId: !Ref FileSystemResource
      PosixUser:
        Uid: "1000"
        Gid: "1000"
      RootDirectory:
        CreationInfo:
          OwnerGid: "1000"
          OwnerUid: "1000"
          Permissions: "0777"
        Path: "/myefs"

is how I create the access point and the mount path I have specified directly on the lambda for testing.

enter image description here

I guess the main confusion I am having is why are there 2 paths, what is the difference between them and which one should I use in my lambda?


Solution

  • Your EFS can have many directories on it:

    /myefs
    /myefs2
    /myefs3
    /myefs4
    /important
    /images
    

    Your AccessPointResource will only enable access to /myefs. This folder will be basically the root to anyone who uses the access point. No other folder will be exposed through this access point.

    /mnt/efs is the mount folder in the lambda container. So your function will be able to access /myefs mounted in its local directory tree under the name of /mnt/efs.