-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(efs): One-Zone filesystem #28501
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
4ac87bc
to
ee5df85
Compare
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
I left some comments for minor documentation adjustments and a question.
subnetSelection = { | ||
...props.vpcSubnets, | ||
...subnetSelection, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this, what happens if the user specifies subnets from different AZs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, the return value from props.vpc.selectSubnets(subnetSelection) is an empty array, and the mountTarget is not created.
Should it be considered an error when the return value of selectSubnets is an empty array with oneZone=true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given:
- Amazon EFS One Zone file systems support only a single mount target which is located in the same Availability Zone as the file system. You cannot add additional mount targets.
selectSubnets
Requires that at least one subnet is matched, throws a descriptive error message otherwise.
I think that the best option here is to validate that the users can specify either oneZone
or vpcSubnets
, not both, to prevent deployment errors and change the implementation accordingly.
@lpizzinidev Thank you for your review!! I have addressed the comments you provided. |
dd7514f
to
fbaa065
Compare
Co-authored-by: Luca Pizzini <[email protected]>
Co-authored-by: Luca Pizzini <[email protected]>
Co-authored-by: Luca Pizzini <[email protected]>
Co-authored-by: Luca Pizzini <[email protected]>
Co-authored-by: Luca Pizzini <[email protected]>
fbaa065
to
1e37816
Compare
@lpizzinidev I have implemented an error for cases where the vpcSubnets argument is specified in a oneZone file system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just a minor change on the validation message.
Co-authored-by: Luca Pizzini <[email protected]>
Co-authored-by: Luca Pizzini <[email protected]>
@lpizzinidev Thanks. I fixed it! |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this support for One-Zone filesystems @badmintoncryer! And thanks for reviewing @lpizzinidev!
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
In this PR, I have added support for creating one zone filesystems.
As discussed in the issue, I considered including
availabilityZoneName
in the props, but for now, I have added only theoneZone
argument.The
efs.FileSystem
construct also generates a mount target simultaneously. However, when creating a one zone file system, both the mount target and the file system should be located in the same Availability Zone. The issue arises because the name of the Availability Zone where the mount target will be placed (obtained fromprops.vpc.selectSubnets()
) remains token, making it impossible to compare it with the givenavailabilityZoneName
.Please let me know if there is a smart way to resolve this.
Closes #15864
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license