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

fix(autoscaling): Allow adding AutoScalingGroup to multiple target groups #23044

Merged
merged 5 commits into from Dec 21, 2022

Conversation

azatoth
Copy link
Contributor

@azatoth azatoth commented Nov 22, 2022

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 multiple targetGroupArns and scaleOnRequestCount() has been called.

closes #5667


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • 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

@gitpod-io
Copy link

gitpod-io bot commented Nov 22, 2022

@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1 labels Nov 22, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team November 22, 2022 23:42
@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Nov 22, 2022
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.

@azatoth azatoth force-pushed the allow-autoscalinggroup-2nd-target-group branch from f4d532a to 89f051a Compare November 29, 2022 08:29
@azatoth
Copy link
Contributor Author

azatoth commented Nov 29, 2022

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

PRs must pass status checks before we can provide a meaningful review.

I don't think an update to integration is needed as we are not changing anything in what CFN is created.

@azatoth azatoth force-pushed the allow-autoscalinggroup-2nd-target-group branch from 89f051a to 7d16f05 Compare December 6, 2022 08:46
@aws-cdk-automation
Copy link
Collaborator

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.

@azatoth azatoth force-pushed the allow-autoscalinggroup-2nd-target-group branch from 7d16f05 to 1c22d00 Compare December 14, 2022 21:39
@aws-cdk-automation aws-cdk-automation dismissed their stale review December 14, 2022 21:41

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

@azatoth azatoth force-pushed the allow-autoscalinggroup-2nd-target-group branch from 1c22d00 to 5cb114e Compare December 15, 2022 08:49
Copy link
Contributor

@comcalvi comcalvi left a 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.');
Copy link
Contributor

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

Copy link
Contributor Author

@azatoth azatoth Dec 17, 2022

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

@comcalvi comcalvi self-assigned this Dec 15, 2022
@mergify mergify bot dismissed comcalvi’s stale review December 17, 2022 09:24

Pull request has been modified.

@azatoth azatoth force-pushed the allow-autoscalinggroup-2nd-target-group branch 2 times, most recently from 1928074 to 1ae1d8c Compare December 17, 2022 09:57
@azatoth
Copy link
Contributor Author

azatoth commented Dec 17, 2022

This looks really good! Could we add a unit test for the positive case too?

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.

azatoth and others added 4 commits December 19, 2022 11:26
…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.
@azatoth azatoth force-pushed the allow-autoscalinggroup-2nd-target-group branch from db1f0de to 9d96ab7 Compare December 19, 2022 10:26
@mergify
Copy link
Contributor

mergify bot commented Dec 20, 2022

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mergify mergify bot merged commit 07acd18 into aws:main Dec 21, 2022
@mergify
Copy link
Contributor

mergify bot commented Dec 21, 2022

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

@azatoth azatoth deleted the allow-autoscalinggroup-2nd-target-group branch December 21, 2022 00:54
@azatoth azatoth restored the allow-autoscalinggroup-2nd-target-group branch December 21, 2022 00:54
@azatoth azatoth deleted the allow-autoscalinggroup-2nd-target-group branch December 21, 2022 00:57
@azatoth azatoth restored the allow-autoscalinggroup-2nd-target-group branch December 21, 2022 01:09
brennanho pushed a commit to brennanho/aws-cdk that referenced this pull request Jan 20, 2023
…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*
brennanho pushed a commit to brennanho/aws-cdk that referenced this pull request Feb 22, 2023
…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*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot add AutoScalingGroup to more than one Target Group
3 participants