-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(efs): add grantRead and grantReadWrite, grantRootAccess to FileS…
…ystem (#25486) ## What change I added `grantRead()` and `grantReadWrite()`, `grantRootAccess()` to `efs.FileSystem` as Beta1 method. ## Why need this change? To make IAM authentication easier for clients. Currently, v2.78.0 has implemented `grant()` method in `efs.FileSystem`. However, EFS can't restrict only granted client even when customers only use the `grant()` method. Because EFS default file system policy grants full access to any anonymous client that can connect to the file system using a mount target. To avoid this issue, customers must set file system policies that not grant anonymous clients, to EFS. In this PR, when using the `grantXxx` method that allows IAM authentication for clients, a file system policy that does not allow anonymous clients is set to `efs.FileSystem` by default to suit the customer's use case. Next example is grant read and write access to EC2 Instance. ```ts declare const client: ec2.Instance; const fileSystem = new efs.FileSystem(this, 'FileSystem', { vpc: new ec2.Vpc(this, 'VPC'), }); fileSystem.grantReadWrite(client); ``` ## How do I continue to allow anonymous access? You can use `allowAnonymousAccess` props for allow anonymous access. ```ts declare const client: ec2.Instance; const fileSystem = new efs.FileSystem(this, 'FileSystem', { vpc: new ec2.Vpc(this, 'VPC'), allowAnonymousAccess: true, }); fileSystem.grantRead(client); ``` ## Others The file system policies created to prevent anonymous clients are based on the AWS Management Console. <img width="1326" alt="image" src="https://user-images.githubusercontent.com/49480575/236891324-e0aa4caf-91e2-45dc-9cfe-50cae0ca67bb.png"> ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
1 parent
0dbcea8
commit 9c12199
Showing
55 changed files
with
70,200 additions
and
517 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
...t/aws-ecs/test/fargate/integ.fargate-with-efs.js.snapshot/aws-ecs-fargate-efs.assets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...fargate-with-efs.js.snapshot/awsecsfargatetestDefaultTestDeployAssert78ECD46B.assets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ting/framework-integ/test/aws-ecs/test/fargate/integ.fargate-with-efs.js.snapshot/cdk.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":"32.0.0"} | ||
{"version":"33.0.0"} |
2 changes: 1 addition & 1 deletion
2
...g/framework-integ/test/aws-ecs/test/fargate/integ.fargate-with-efs.js.snapshot/integ.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "32.0.0", | ||
"version": "33.0.0", | ||
"testCases": { | ||
"aws-ecs-fargate-test/DefaultTest": { | ||
"stacks": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.