Skip to content

feat(s3files): s3Files Lambda L1 integration#37547

Draft
vishaalmehrishi wants to merge 1 commit intomainfrom
s3files-lambda-l1-integration
Draft

feat(s3files): s3Files Lambda L1 integration#37547
vishaalmehrishi wants to merge 1 commit intomainfrom
s3files-lambda-l1-integration

Conversation

@vishaalmehrishi
Copy link
Copy Markdown
Contributor

@vishaalmehrishi vishaalmehrishi commented Apr 8, 2026

Reason for this change

S3Files is a new feature being developed with S3 and EFS to allow customer to access their S3 buckets as high performant file systems. This PE introduces the L1 generated constructs and adds an integration to the L2 Lambda constructs to allow it to be mounted by the Function.

Description of changes

L1 constructs generated via the added schemas in temporary-schema + a new function for Lambda.FileSystem:

FileSystem.fromS3FilesAccessPoint(ap: IAccessPointRef, mountPath: string): FileSystem

This function enables Lambda to mount an S3 Files file system. It uses AccessPointReflection to automatically
resolve the file system, mount targets, security groups, and IAM policies from the construct tree — so the
user only needs to pass the access point and mount path.

A new AccessPointReflection class in aws-s3files walks the construct tree to find:

  • The CfnFileSystem associated with the access point
  • All CfnMountTarget resources for that file system (added as DependsOn)
  • Security groups from mount targets (wired into Connections for ingress)

Describe any new or updated permissions being added

Lambda gives itself permission to mount and write to the file system:

  • s3files:ClientMount on the access point ARN
  • s3files:ClientMount + s3files:ClientWrite on the file system ARN

Description of how you validated changes

Unit tests (11 passing): AccessPointReflection (10 tests including cross-stack, mixed token matching,
deduplication) + Lambda s3files integration (1 test).

Deployed to an account onboarded for the feature with:

const fileSystem = new s3files.CfnFileSystem(this, 'FileSystem', {
  bucket: bucket.bucketArn,
  roleArn: s3filesRole.roleArn,
});

vpc.privateSubnets.forEach((subnet, i) =>
  new s3files.CfnMountTarget(this, `MountTarget${i}`, {
    fileSystemId: fileSystem.attrFileSystemId,
    subnetId: subnet.subnetId,
    securityGroups: [sg.securityGroupId],
  }),
);

const accessPoint = new s3files.CfnAccessPoint(this, 'AccessPoint', {
  fileSystemId: fileSystem.ref,
  posixUser: { uid: '1000', gid: '1000' },
  rootDirectory: {
    path: '/lambda',
    creationInfo: { ownerUid: '1000', ownerGid: '1000', permissions: '755' },
  },
});

new lambda.Function(this, 'MyFunction', {
  runtime: lambda.Runtime.NODEJS_20_X,
  handler: 'index.handler',
  code: lambda.Code.fromAsset('lambda'),
  vpc,
  filesystem: lambda.FileSystem.fromS3FilesAccessPoint(accessPoint, '/mnt/s3files'),
});

Was able to invoke the lambda which writes a file to the fs. Verified the synthesized template includes
DependsOn for mount targets on the Lambda resource.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the p2 label Apr 8, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 8, 2026 08:35
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Apr 8, 2026
@mergify mergify bot temporarily deployed to automation April 8, 2026 08:35 Inactive
@mergify mergify bot temporarily deployed to automation April 8, 2026 08:36 Inactive
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results48 ran48 passed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates48 ran48 passed
TestResult
No test annotations available

@vishaalmehrishi vishaalmehrishi changed the title feat(aws-s3files): S3Files Lambda L1 integration feat(s3files): s3Files Lambda L1 integration Apr 8, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review April 8, 2026 08:39

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@vishaalmehrishi vishaalmehrishi added the pr/do-not-merge This PR should not be merged at this time. label Apr 8, 2026
@aws-cdk-automation aws-cdk-automation added the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS. p2 pr/do-not-merge This PR should not be merged at this time. pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants