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

feat(efs): One-Zone filesystem #28501

Merged
merged 19 commits into from
Jan 16, 2024

Conversation

badmintoncryer
Copy link
Contributor

@badmintoncryer badmintoncryer commented Dec 27, 2023

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 the oneZone 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 from props.vpc.selectSubnets()) remains token, making it impossible to compare it with the given availabilityZoneName.

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

@github-actions github-actions bot added valued-contributor [Pilot] contributed between 6-12 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Dec 27, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team December 27, 2023 15:04
Copy link
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.

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.

@badmintoncryer badmintoncryer changed the title feat(efs): Create One-Zone filesystem feat(efs): One-Zone filesystem Dec 28, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review December 28, 2023 07:33

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

@badmintoncryer badmintoncryer marked this pull request as ready for review December 28, 2023 10:56
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 28, 2023
Copy link
Contributor

@lpizzinidev lpizzinidev left a 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.

packages/aws-cdk-lib/aws-efs/lib/efs-file-system.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-efs/lib/efs-file-system.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-efs/test/efs-file-system.test.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-efs/README.md Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-efs/README.md Outdated Show resolved Hide resolved
Comment on lines 575 to 578
subnetSelection = {
...props.vpcSubnets,
...subnetSelection,
};
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Given:

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.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 31, 2023
@badmintoncryer
Copy link
Contributor Author

@lpizzinidev Thank you for your review!! I have addressed the comments you provided.

@badmintoncryer
Copy link
Contributor Author

@lpizzinidev I have implemented an error for cases where the vpcSubnets argument is specified in a oneZone file system.

Copy link
Contributor

@lpizzinidev lpizzinidev left a 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.

packages/aws-cdk-lib/aws-efs/lib/efs-file-system.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-efs/test/efs-file-system.test.ts Outdated Show resolved Hide resolved
@badmintoncryer
Copy link
Contributor Author

@lpizzinidev Thanks. I fixed it!

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 4, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: ae275db
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@paulhcsun paulhcsun left a 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!

Copy link
Contributor

mergify bot commented Jan 16, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-efs): support one-zone FileSystem
4 participants