-
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
chore(ecs-service-extensions): Deprecate scale on CPU utilization extension #17802
chore(ecs-service-extensions): Deprecate scale on CPU utilization extension #17802
Conversation
packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/scale-on-cpu-utilization.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts
Outdated
Show resolved
Hide resolved
Pull request has been modified.
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.
Looks great! Just have one final comment :)
@@ -126,6 +134,9 @@ export class ScaleOnCpuUtilization extends ServiceExtension { | |||
// This hook utilizes the resulting service construct | |||
// once it is created. | |||
public useService(service: ecs.Ec2Service | ecs.FargateService) { | |||
if (this.parentService.scalableTaskCount) { | |||
throw Error('Cannot specify \'minTaskCount\' or \'maxTaskCount\' in the Service construct and also provide a \'ScaleOnCpuUtilization\' extension. \'ScaleOnCpuUtilization\' is deprecated. Please only provide \'minTaskCount\' and \'maxTaskCount\'.'); |
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.
Just realized we can make this error a little bit shorter and clearer by referring to the property name that contains minTaskCount
and maxTaskCount
.
throw Error('Cannot specify \'minTaskCount\' or \'maxTaskCount\' in the Service construct and also provide a \'ScaleOnCpuUtilization\' extension. \'ScaleOnCpuUtilization\' is deprecated. Please only provide \'minTaskCount\' and \'maxTaskCount\'.'); | |
throw Error('Cannot specify \'autoScaleTaskCount\' in the Service construct and also provide a \'ScaleOnCpuUtilization\' extension. \'ScaleOnCpuUtilization\' is deprecated. Please only provide \'autoScaleTaskCount\'.'); |
Thank you for contributing! Your pull request will be updated from master 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 master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…ension (aws#17802) ---- This PR deprecates one of the existing `scaleOnCpuUtilization` extension. We recommend users to configure task auto scaling using the [`autoScaleTaskCount`](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/lib/service.ts#L61) in the `Service` construct. Related PR: aws#17101 *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR deprecates one of the existing
scaleOnCpuUtilization
extension. We recommend users to configure task auto scaling using theautoScaleTaskCount
in theService
construct.Related PR: #17101
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license