Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EFS: Lookup for filesystems by name #26661

Closed
2 tasks
Balaji-JBC opened this issue Aug 7, 2023 · 4 comments
Closed
2 tasks

EFS: Lookup for filesystems by name #26661

Balaji-JBC opened this issue Aug 7, 2023 · 4 comments
Labels
@aws-cdk/aws-efs Related to Amazon Elastic File System feature-request A feature should be added or improved.

Comments

@Balaji-JBC
Copy link

Describe the feature

Whenever we want to use an existing EFS, we have to refer it by arn or ID. Why not have a look up that returns list of filesystems and we can continue with it

Use Case

First time i deploy, i expect the EFS to be created fresh. Second time when i deploy a stack, i want to code like if this filesystem with the given name already exists, use it, like that. But not able to do as as arn/filesystemid is mandatory

Proposed Solution

Have a lookup function which returns array of file systems available with the given name

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.63.2

Environment details (OS name and version, etc.)

MacOS Ventura 13.4.1

@Balaji-JBC Balaji-JBC added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 7, 2023
@github-actions github-actions bot added the @aws-cdk/aws-efs Related to Amazon Elastic File System label Aug 7, 2023
@peterwoodworth
Copy link
Contributor

First time i deploy, i expect the EFS to be created fresh. Second time when i deploy a stack, i want to code like if this filesystem with the given name already exists, use it, like that.

I'm not sure I understand, if you want to create a new FileSystem and have your stack control that FileSystem, then you want to use new FileSystem(...). Also, how would a list of FileSystems be used exactly especially in this use case?

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Aug 7, 2023
@Balaji-JBC
Copy link
Author

Hi,
I would like to have a cdk code as follows

  1. Define a file system configuration with a file_system_name
  2. If the file_system_name doesn't already exist, create a new one.
  3. else if the file_system_name already exists, get that file system, modify it's properties if needed and deploy

since, file_system_name is not unique, I was expecting a function that returns array of file_system having the given file_system_name and I can work accordingly on them

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Aug 8, 2023
@peterwoodworth
Copy link
Contributor

You need to either have your stack manage a resource (new XXX), or create a proxy class for an existing resource to pass that information into resources your stack will manage (construct.fromXxx). You cannot have both at once while still using CDK the way it was meant to be used

@github-actions
Copy link

github-actions bot commented Aug 8, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-efs Related to Amazon Elastic File System feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants