-
Notifications
You must be signed in to change notification settings - Fork 4.4k
(aws-efs): Add fileSystemArn property and grant method for FileSystem construct #14998
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-efsRelated to Amazon Elastic File SystemRelated to Amazon Elastic File Systemeffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp2
Description
When creating or importing a File System in a CDK App, the construct is missing the fileSystemArn property.
Use Case
When trying to grant permissions to a FileSystem, we have to build the fileSystem the policy and the arn manually.
const customStack = new Stack(app);
const customVpc = new ec2.Vpc(customStack, 'VPC');
const fs = new FileSystem(customVpc, 'EfsFileSystem', {
vpc: customVpc,
});
new iam.PolicyStatement({
actions: ['elasticfilesystem:ClientWrite'],
resources: [Stack.of(scope).formatArn({
service: 'elasticfilesystem',
resource: 'file-system',
resourceName: fs.fileSystemId,
})],
});That would become
const customStack = new Stack(app);
const customVpc = new ec2.Vpc(customStack, 'VPC');
const fs = new FileSystem(customVpc, 'EfsFileSystem', {
vpc: customVpc,
});
fs.grant(grantee, 'elasticfilesystem:ClientWrite');Proposed Solution
Add a fileSystemArn attribute to the construct.
Allow import using arn.
Add a grant method.
- 👋 I may be able to implement this feature request
-
⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-efsRelated to Amazon Elastic File SystemRelated to Amazon Elastic File Systemeffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp2