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(autoscaling): Allow adding AutoScalingGroup to multiple target groups #23044
fix(autoscaling): Allow adding AutoScalingGroup to multiple target groups #23044
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.
f4d532a
to
89f051a
Compare
I don't think an update to integration is needed as we are not changing anything in what CFN is created. |
89f051a
to
7d16f05
Compare
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
7d16f05
to
1c22d00
Compare
✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.
1c22d00
to
5cb114e
Compare
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.
This looks really good! Could we add a unit test for the positive case too?
private validateTargetGroup(): string[] { | ||
const errors = new Array<string>(); | ||
if (this.hasSetScaleOnRequest && this.targetGroupArns.length > 1) { | ||
errors.push('Cannon use multiple target groups if `setScaleOnRequest()` is being used.'); |
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.
setScaleOnRequest()
should be scaleOnRequestCount()
, no? scaleOnRequestCount()
enables hasSetScaleOnRequest()
, I don't see a setScaleOnRequest()
method in the auto-scaling-group.ts
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.
Oops, the "set" part in the variable meant to reflect that the method had been called; Seems I transposed that to method name when writing the error message. Changed in 1928074
packages/@aws-cdk/aws-autoscaling/test/auto-scaling-group.test.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-autoscaling/test/auto-scaling-group.test.ts
Outdated
Show resolved
Hide resolved
Pull request has been modified.
1928074
to
1ae1d8c
Compare
The test for the positive case was kinda in the test already; In any case, I did split the test into two separate tests in db1f0de to be more explicit. |
…oups While this doesn't solve the underlying problem, which will require an API breakage in `scaleOnRequestCount()` (see aws#5667 (comment)). As `scaleOnRequestCount()` seems to be the only part that is affected by this, we'll only issue a validation error if we have multiple `targetGroupArns` and `scaleOnRequestCount()` has been called. closes aws#5667
Co-authored-by: Calvin Combs <66279577+comcalvi@users.noreply.github.com>
The naming and information didn't fully match eachother.
this to clearly indicate that one is positive and the other is negative.
db1f0de
to
9d96ab7
Compare
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). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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). |
…oups (aws#23044) While this doesn't solve the underlying problem, which will require an API breakage in `scaleOnRequestCount()` (see aws#5667 (comment)). As `scaleOnRequestCount()` seems to be the only part that is affected by this, we'll only issue a validation error if we have multiple `targetGroupArns` and `scaleOnRequestCount()` has been called. closes aws#5667 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…oups (aws#23044) While this doesn't solve the underlying problem, which will require an API breakage in `scaleOnRequestCount()` (see aws#5667 (comment)). As `scaleOnRequestCount()` seems to be the only part that is affected by this, we'll only issue a validation error if we have multiple `targetGroupArns` and `scaleOnRequestCount()` has been called. closes aws#5667 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
While this doesn't solve the underlying problem, which will require an API breakage in
scaleOnRequestCount()
(see#5667 (comment)).
As
scaleOnRequestCount()
seems to be the only part that is affected by this, we'll only issue a validation error if we have multipletargetGroupArns
andscaleOnRequestCount()
has been called.closes #5667
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license