Class CfnAccessPoint
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.s3files.CfnAccessPoint
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,IAccessPointRef,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)",
date="2026-04-14T18:32:03.771Z")
@Stability(Stable)
public class CfnAccessPoint
extends CfnResource
implements IInspectable, IAccessPointRef, ITaggableV2
Resource Type definition for AWS::S3Files::AccessPoint.
Example:
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.s3.*;
import software.amazon.awscdk.services.s3files.*;
Vpc vpc = new Vpc(this, "Vpc");
// Versioning is required — S3 Files relies on object versions for consistency.
Bucket bucket = Bucket.Builder.create(this, "Bucket").versioned(true).build();
// S3 Files assumes this role to sync data between S3 and the file system.
Role role = Role.Builder.create(this, "S3FilesRole")
.assumedBy(new ServicePrincipal("elasticfilesystem.amazonaws.com"))
.build();
// S3 permissions: read/write access to the bucket and objects
role.addToPolicy(PolicyStatement.Builder.create()
.actions(List.of("s3:ListBucket*"))
.resources(List.of(bucket.getBucketArn()))
.build());
role.addToPolicy(PolicyStatement.Builder.create()
.actions(List.of("s3:AbortMultipartUpload", "s3:DeleteObject", "s3:GetObject*", "s3:List*", "s3:PutObject*"))
.resources(List.of(bucket.arnForObjects("*")))
.build());
// EventBridge permissions: S3 Files creates rules prefixed "DO-NOT-DELETE-S3-Files"
// to detect S3 object changes and trigger data synchronization.
role.addToPolicy(PolicyStatement.Builder.create()
.actions(List.of("events:DeleteRule", "events:DisableRule", "events:EnableRule", "events:PutRule", "events:PutTargets", "events:RemoveTargets"))
.resources(List.of(String.format("arn:%s:events:*:*:rule/DO-NOT-DELETE-S3-Files*", Aws.PARTITION)))
.conditions(Map.of("StringEquals", Map.of("events:ManagedBy", "elasticfilesystem.amazonaws.com")))
.build());
role.addToPolicy(PolicyStatement.Builder.create()
.actions(List.of("events:DescribeRule", "events:ListRuleNamesByTarget", "events:ListRules", "events:ListTargetsByRule"))
.resources(List.of(String.format("arn:%s:events:*:*:rule/*", Aws.PARTITION)))
.build());
CfnFileSystem fileSystem = CfnFileSystem.Builder.create(this, "S3FilesFs")
.bucket(bucket.getBucketArn())
.roleArn(role.getRoleArn())
.build();
SecurityGroup sg = SecurityGroup.Builder.create(this, "MountTargetSG").vpc(vpc).build();
// Create a mount target in each private subnet so Lambda can reach the file system via NFS.
vpc.privateSubnets.forEach((subnet, i) =>
new s3files.CfnMountTarget(this, `MountTarget${i}`, {
fileSystemId: fileSystem.attrFileSystemId,
subnetId: subnet.subnetId,
securityGroups: [sg.securityGroupId],
}));
// The access point defines the POSIX identity and root path Lambda uses on the file system.
CfnAccessPoint accessPoint = CfnAccessPoint.Builder.create(this, "AccessPoint")
.fileSystemId(fileSystem.getAttrFileSystemId())
.rootDirectory(RootDirectoryProperty.builder()
.path("/export/lambda")
.creationPermissions(CreationPermissionsProperty.builder().ownerGid("1001").ownerUid("1001").permissions("750").build())
.build())
.posixUser(PosixUserProperty.builder().gid("1001").uid("1001").build())
.build();
Function fn = Function.Builder.create(this, "MyFunction")
.runtime(Runtime.NODEJS_LATEST)
.handler("index.handler")
.code(Code.fromAsset(join(__dirname, "lambda-handler")))
.vpc(vpc)
.filesystem(FileSystem.fromS3FilesAccessPoint(accessPoint, "/mnt/s3files"))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceExample:static final classA fluent builder forCfnAccessPoint.static interfaceExample:static interfaceExample:static interfaceExample:Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.s3files.IAccessPointRef
IAccessPointRef.Jsii$Default, IAccessPointRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnAccessPoint(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAccessPoint(software.amazon.jsii.JsiiObjectRef objRef) CfnAccessPoint(software.constructs.Construct scope, String id, CfnAccessPointProps props) Create a newAWS::S3Files::AccessPoint. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForAccessPoint(IAccessPointRef resource) A reference to a AccessPoint resource.Tag Manager which manages the tags for this resource.(optional) A string of up to 64 ASCII characters that Amazon EFS uses to ensure idempotent creation.The ID of the S3 Files file system that the access point provides access to.Returns union: eitherIResolvableorCfnAccessPoint.PosixUserPropertyReturns union: eitherIResolvableorCfnAccessPoint.RootDirectoryPropertygetTags()voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnAccessPoint.renderProperties(Map<String, Object> props) voidsetClientToken(String value) (optional) A string of up to 64 ASCII characters that Amazon EFS uses to ensure idempotent creation.voidsetFileSystemId(String value) The ID of the S3 Files file system that the access point provides access to.voidsetPosixUser(IResolvable value) voidvoidsetRootDirectory(IResolvable value) voidvoidMethods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId, withMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnAccessPoint
protected CfnAccessPoint(software.amazon.jsii.JsiiObjectRef objRef) -
CfnAccessPoint
protected CfnAccessPoint(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnAccessPoint
@Stability(Stable) public CfnAccessPoint(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAccessPointProps props) Create a newAWS::S3Files::AccessPoint.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForAccessPoint
@Stability(Stable) @NotNull public static String arnForAccessPoint(@NotNull IAccessPointRef resource) - Parameters:
resource- This parameter is required.
-
isCfnAccessPoint
Checks whether the given object is a CfnAccessPoint.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAccessPointRef
A reference to a AccessPoint resource.- Specified by:
getAccessPointRefin interfaceIAccessPointRef
-
getAttrAccessPointArn
-
getAttrAccessPointId
-
getAttrOwnerId
-
getAttrStatus
-
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getFileSystemId
The ID of the S3 Files file system that the access point provides access to. -
setFileSystemId
The ID of the S3 Files file system that the access point provides access to. -
getClientToken
(optional) A string of up to 64 ASCII characters that Amazon EFS uses to ensure idempotent creation. -
setClientToken
(optional) A string of up to 64 ASCII characters that Amazon EFS uses to ensure idempotent creation. -
getPosixUser
Returns union: eitherIResolvableorCfnAccessPoint.PosixUserProperty -
setPosixUser
-
setPosixUser
-
getRootDirectory
Returns union: eitherIResolvableorCfnAccessPoint.RootDirectoryProperty -
setRootDirectory
-
setRootDirectory
@Stability(Stable) public void setRootDirectory(@Nullable CfnAccessPoint.RootDirectoryProperty value) -
getTags
-
setTags
-