@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-05-10T17:05:56.523Z") @Stability(value=Stable) public class FileSystem extends software.amazon.jsii.JsiiObject
Example:
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.efs.*;
// create a new VPC
Vpc vpc = new Vpc(this, "VPC");
// create a new Amazon EFS filesystem
FileSystem fileSystem = FileSystem.Builder.create(this, "Efs").vpc(vpc).build();
// create a new access point from the filesystem
AccessPoint accessPoint = fileSystem.addAccessPoint("AccessPoint", AccessPointOptions.builder()
// 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(Acl.builder()
.ownerUid("1001")
.ownerGid("1001")
.permissions("750")
.build())
// enforce the POSIX identity so lambda function will access with this identity
.posixUser(PosixUser.builder()
.uid("1001")
.gid("1001")
.build())
.build());
Function fn = Function.Builder.create(this, "MyLambda")
// mount the access point to /mnt/msg in the lambda runtime environment
.filesystem(FileSystem.fromEfsAccessPoint(accessPoint, "/mnt/msg"))
.runtime(Runtime.NODEJS_16_X)
.handler("index.handler")
.code(Code.fromAsset(join(__dirname, "lambda-handler")))
.vpc(vpc)
.build();
| Modifier | Constructor and Description |
|---|---|
protected |
FileSystem(FileSystemConfig config) |
protected |
FileSystem(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
FileSystem(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static FileSystem |
fromEfsAccessPoint(IAccessPoint ap,
String mountPath)
mount the filesystem from Amazon EFS.
|
FileSystemConfig |
getConfig()
the FileSystem configurations for the Lambda function.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected FileSystem(software.amazon.jsii.JsiiObjectRef objRef)
protected FileSystem(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
protected FileSystem(@NotNull
FileSystemConfig config)
config - the FileSystem configurations for the Lambda function. This parameter is required.@Stability(value=Stable) @NotNull public static FileSystem fromEfsAccessPoint(@NotNull IAccessPoint ap, @NotNull String mountPath)
ap - the Amazon EFS access point. This parameter is required.mountPath - the target path in the lambda runtime environment. This parameter is required.@Stability(value=Stable) @NotNull public FileSystemConfig getConfig()
Copyright © 2023. All rights reserved.