Interface IAccessPointOptions
Options to create an AccessPoint.
Namespace: Amazon.CDK.AWS.EFS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IAccessPointOptions
Syntax (vb)
Public Interface IAccessPointOptions
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.EFS;
// create a new VPC
var vpc = new Vpc(this, "VPC");
// create a new Amazon EFS filesystem
var fileSystem = new FileSystem(this, "Efs", new FileSystemProps { Vpc = vpc });
// create a new access point from the filesystem
var accessPoint = fileSystem.AddAccessPoint("AccessPoint", new AccessPointOptions {
// set /export/lambda as the root of the access point
Path = "/export/lambda",
// as /export/lambda does not exist in a new efs filesystem, the efs will create the directory with the following createAcl
CreateAcl = new Acl {
OwnerUid = "1001",
OwnerGid = "1001",
Permissions = "750"
},
// enforce the POSIX identity so lambda function will access with this identity
PosixUser = new PosixUser {
Uid = "1001",
Gid = "1001"
}
});
var fn = new Function(this, "MyLambda", new FunctionProps {
// mount the access point to /mnt/msg in the lambda runtime environment
Filesystem = FileSystem.FromEfsAccessPoint(accessPoint, "/mnt/msg"),
Runtime = Runtime.NODEJS_18_X,
Handler = "index.handler",
Code = Code.FromAsset(Join(__dirname, "lambda-handler")),
Vpc = vpc
});
Synopsis
Properties
CreateAcl | Specifies the POSIX IDs and permissions to apply when creating the access point's root directory. |
Path | Specifies the path on the EFS file system to expose as the root directory to NFS clients using the access point to access the EFS file system. |
PosixUser | The full POSIX identity, including the user ID, group ID, and any secondary group IDs, on the access point that is used for all file system operations performed by NFS clients using the access point. |
Properties
CreateAcl
Specifies the POSIX IDs and permissions to apply when creating the access point's root directory.
virtual IAcl CreateAcl { get; }
Property Value
Remarks
If the
root directory specified by path
does not exist, EFS creates the root directory and applies the
permissions specified here. If the specified path
does not exist, you must specify createAcl
.
Default: - None. The directory specified by path
must exist.
Path
Specifies the path on the EFS file system to expose as the root directory to NFS clients using the access point to access the EFS file system.
virtual string Path { get; }
Property Value
System.String
Remarks
Default: '/'
PosixUser
The full POSIX identity, including the user ID, group ID, and any secondary group IDs, on the access point that is used for all file system operations performed by NFS clients using the access point.
virtual IPosixUser PosixUser { get; }
Property Value
Remarks
Specify this to enforce a user identity using an access point.
Default: - user identity not enforced