interface AccessPointOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.EFS.AccessPointOptions |
![]() | software.amazon.awscdk.services.efs.AccessPointOptions |
![]() | aws_cdk.aws_efs.AccessPointOptions |
![]() | @aws-cdk/aws-efs » AccessPointOptions |
Options to create an AccessPoint.
Example
import * as ec2 from '@aws-cdk/aws-ec2';
import * as efs from '@aws-cdk/aws-efs';
// create a new VPC
const vpc = new ec2.Vpc(this, 'VPC');
// create a new Amazon EFS filesystem
const fileSystem = new efs.FileSystem(this, 'Efs', { vpc });
// create a new access point from the filesystem
const accessPoint = fileSystem.addAccessPoint('AccessPoint', {
// 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: {
ownerUid: '1001',
ownerGid: '1001',
permissions: '750',
},
// enforce the POSIX identity so lambda function will access with this identity
posixUser: {
uid: '1001',
gid: '1001',
},
});
const fn = new lambda.Function(this, 'MyLambda', {
// mount the access point to /mnt/msg in the lambda runtime environment
filesystem: lambda.FileSystem.fromEfsAccessPoint(accessPoint, '/mnt/msg'),
runtime: lambda.Runtime.NODEJS_16_X,
handler: 'index.handler',
code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
vpc,
});
Properties
Name | Type | Description |
---|---|---|
create | Acl | Specifies the POSIX IDs and permissions to apply when creating the access point's root directory. |
path? | string | 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. |
posix | Posix | 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. |
createAcl?
Type:
Acl
(optional, default: None. The directory specified by path
must exist.)
Specifies the POSIX IDs and permissions to apply when creating the access point's root directory.
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
.
path?
Type:
string
(optional, default: '/')
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?
Type:
Posix
(optional, default: user identity not enforced)
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.
Specify this to enforce a user identity using an access point.
See also: [- Enforcing a User Identity Using an Access Point](- Enforcing a User Identity Using an Access Point)