-
Notifications
You must be signed in to change notification settings - Fork 4k
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(elasticloadbalancingv2): support Weighted Random algorithm and Automatic Target Weights for alb #30542
Merged
mergify
merged 17 commits into
aws:main
from
mazyu36:elb-automatic-target-weights-29969
Jul 30, 2024
Merged
feat(elasticloadbalancingv2): support Weighted Random algorithm and Automatic Target Weights for alb #30542
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0f2eab1
feat: support Weighted Randdom algorithm and Automatic Target Weights…
mazyu36 ded7d36
fix: update README
mazyu36 83c0406
Merge branch 'main' into elb-automatic-target-weights-29969
mazyu36 4f7a148
Update packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/applic…
mazyu36 4e27419
Update packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/applic…
mazyu36 14bb6a9
Update packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/applic…
mazyu36 9e6f50b
Update packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/alb/liste…
mazyu36 1ef611b
Update packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/alb/liste…
mazyu36 68ca394
Update packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/alb/targe…
mazyu36 4bcf5b9
Update packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md
mazyu36 398b91d
fix: incorporate review comments
mazyu36 efb2342
chore update integ test name
mazyu36 5ba0fc0
Merge branch 'main' into elb-automatic-target-weights-29969
mazyu36 1ab04b2
Merge branch 'main' into elb-automatic-target-weights-29969
mazyu36 1a1a23f
update integ test
mazyu36 26c08ba
update README
mazyu36 e1733c1
Merge branch 'main' into elb-automatic-target-weights-29969
mazyu36 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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 want to throw an error when anomaly mitigation is enabled and the algorithm is not
weighted_random
, so I added a '!' beforeisWeightedRandomAlgorithm
.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 codechanges make sense to me but the only thing I'm not so keen on is enforcing the restrictions on the properties:
weighted_random
algorithm cannot be used in slow start modeweighted_random
algorithm is usedwith error handling in the constructor. For this current case it works fine because we're not adding much but this can slowly grow over time into a wall of error handling checks as more properties with restrictions are added.
What I had in mind here was to instead create another version of this class that specifically has the
weighted_random
algorithm set by default and does not allow the user to set other conflicting properties to remove the need for these error checks.i.e. A class like
ApplicationTargetGroupWeightedRandomRouting
or something where the anomaly mitigation can be enabled or not without the need for error handling and slow start mode is disabled and cannot be enabled.Although part of me worries that this may be a bit confusing as a DX to use because we're not providing the option through
ApplicationTargetGroup
and I'm not sure how many other routing algorithm options there are that we may not have done this for. What do you think?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.
Thank you for your suggestion.
Personally, I like the current consolidated form of ApplicationTargetGroup.
For the reasons mentioned above, I personally think the current format is preferable.
However, as you've expressed concern, your suggestion might be better considering the possibility of increased constraints in the future.
But honestly, I'm not sure if they will increase...
Given the above, I'd appreciate your thoughts on this.
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 sharing your thoughts.
After hearing your reasonings I agree that separating out a new class just for this algorithm is probably not necessary. As you mentioned, the restriction is not super complex so I'm okay to accept this change as is.
Thanks @mazyu36!