-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(ec2): availabilityZones can be empty for Vpc causing subsequent subnet errors #33993
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
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 fails with the following errors:
❌ Fixes must contain a change to an integration test file and the resulting snapshot.
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.
✅ A exemption request has been requested. Please wait for a maintainer's review.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33993 +/- ##
=======================================
Coverage 82.39% 82.39%
=======================================
Files 120 120
Lines 6960 6960
Branches 1175 1175
=======================================
Hits 5735 5735
Misses 1120 1120
Partials 105 105
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
b34a1b9 to
73ae970
Compare
|
Exemption Request for "Fixes must contain a change to an integration test file and the resulting snapshot." -- the fix involves throwing an error at build time and won't end up deploying a stack. A unit test exercising the behavior of the fix was added. |
|
Thank you @gravitylow for submitting this, while i agree that there should be a validation to check whether the availabilty zones is an empty array or not, i also think it is not a good definition of setting an availability zone as '[]' in the Vpc definition, few concerns that I have to add this validation and if we can verify that this doesn't affect those existing implementations will be good to go:
For the exemption request, we can try running the existing integration test just to confirm that these are working fine along with additional unit tests for the scenario's mentioned above. |
|
Hey @shikha372 thanks for your review and feedback. Addressing specific points below:
For the The unrelated error which is thrown from this test case is: (I am actually not immediately sure if this is desirable behavior, it's a bit of a buggy message since of course 0 is a multiple of 0. But seems to handle the concerning case anyway...) |
Thank you @gravitylow , changing this to a warning should not result in any snapshot changes and is least intrusive as well, |
|
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing To prevent automatic closure:
This PR will automatically close in 14 days if no action is taken. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thanks for making the requested change to the warning message. Please let me know if there are any outstanding actions on my side and I'll be happy to address them. |
|
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #32451
Reason for this change
When creating a Vpc construct and specifying a list of availability zones to use for creating subnets with, passing an empty list causing misleading and confusing errors to happen with other Vpc features. See #32451 for further details and examples.
Description of changes
I added a simple check to throw an error when at least one subnet is going to be created, but the provided availabilityZones to use is empty.
Describe any new or updated permissions being added
N/A
Description of how you validated changes
Added a unit test and confirm it fails with the misleading error message prior to fixing the issue:
Fixed the issue and confirm the test now passes, along with others:
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license