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
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.
madeline-k
left a comment
There was a problem hiding this comment.
Looks great! Just have one final comment :)
| // 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.
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
scaleOnCpuUtilizationextension. We recommend users to configure task auto scaling using theautoScaleTaskCountin theServiceconstruct.Related PR: #17101
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license