Acl

class aws_cdk.aws_efs.Acl(*, owner_gid, owner_uid, permissions)

Bases: object

Permissions as POSIX ACL.

Parameters:
  • owner_gid (str) – Specifies the POSIX group ID to apply to the RootDirectory. Accepts values from 0 to 2^32 (4294967295).

  • owner_uid (str) – Specifies the POSIX user ID to apply to the RootDirectory. Accepts values from 0 to 2^32 (4294967295).

  • permissions (str) – Specifies the POSIX permissions to apply to the RootDirectory, in the format of an octal number representing the file’s mode bits.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_ec2 as ec2
import aws_cdk.aws_efs as efs


# create a new VPC
vpc = ec2.Vpc(self, "VPC")

# create a new Amazon EFS filesystem
file_system = efs.FileSystem(self, "Efs", vpc=vpc)

# create a new access point from the filesystem
access_point = file_system.add_access_point("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
    create_acl=efs.Acl(
        owner_uid="1001",
        owner_gid="1001",
        permissions="750"
    ),
    # enforce the POSIX identity so lambda function will access with this identity
    posix_user=efs.PosixUser(
        uid="1001",
        gid="1001"
    )
)

fn = lambda_.Function(self, "MyLambda",
    # mount the access point to /mnt/msg in the lambda runtime environment
    filesystem=lambda_.FileSystem.from_efs_access_point(access_point, "/mnt/msg"),
    runtime=lambda_.Runtime.NODEJS_16_X,
    handler="index.handler",
    code=lambda_.Code.from_asset(path.join(__dirname, "lambda-handler")),
    vpc=vpc
)

Attributes

owner_gid

Specifies the POSIX group ID to apply to the RootDirectory.

Accepts values from 0 to 2^32 (4294967295).

owner_uid

Specifies the POSIX user ID to apply to the RootDirectory.

Accepts values from 0 to 2^32 (4294967295).

permissions

Specifies the POSIX permissions to apply to the RootDirectory, in the format of an octal number representing the file’s mode bits.