Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix(ec2): descriptive error message when selecting 0 subnets #2025
fix(ec2): descriptive error message when selecting 0 subnets #2025
Changes from 1 commit
06e4bc5
82a0816
19c6fe4
f10a1ee
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Could we maybe hint at what strategies would have matched something? Or are placement strategies too complex?
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.
They are not necessarily, but what are you proposing?
"The VPC network contains 1 Public subnet group with name "Public" and 2 Private subnets groups with names "MyDatabases","MyLambdas"
?
Not sure that a longer error message is necessarily going to make things better. We could, of course.
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.
I mean I wouldn't put the
Use a different VPC placement strategy
if you can't hint at which are "valid".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.
I used that terminology on purpose because:
Although maybe the better solution is to change the parameter name to
subnetSelection
, or something, under the "s" where people that already know things about AWS and CFN are going to look for it.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.
If you get there you've effectively reached the default behavior, I believe. Then you should probably return
private subnets
. If you are willing to assume that the defaults have always been reified before you get here, then why not throw instead of returning???
?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.
I was thinking to throw, but at the same time I didn't want to block a customer from using this construct if we ever forget a code path. Rather have ugly behavior but allow the user to continue (so that we can fix the issue when we have capacity) rather than block them completely by throwing an error and now we have to scramble to get a fix out.
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.
Right but then at least avoid the question marks... Maybe
JSON.stringify
what you've been given.Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.