dcl-ops-lib 6.10.2 → 6.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/createFargateTask.js +10 -7
- package/package.json +1 -1
package/createFargateTask.js
CHANGED
|
@@ -379,13 +379,13 @@ function createInternalService(config) {
|
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
function setAutoscaling(service, config) {
|
|
382
|
-
const
|
|
382
|
+
const serviceId = service.id.apply((id) => {
|
|
383
|
+
return id.split(':').pop();
|
|
384
|
+
});
|
|
385
|
+
const ecsTarget = new aws.appautoscaling.Target(`ecs-target-${serviceId}`, {
|
|
383
386
|
maxCapacity: config.maxCapacity,
|
|
384
387
|
minCapacity: config.desiredCount,
|
|
385
|
-
resourceId:
|
|
386
|
-
console.log({ serviceId: id });
|
|
387
|
-
return id;
|
|
388
|
-
}),
|
|
388
|
+
resourceId: serviceId,
|
|
389
389
|
scalableDimension: "ecs:service:DesiredCount",
|
|
390
390
|
serviceNamespace: "ecs",
|
|
391
391
|
});
|
|
@@ -405,10 +405,13 @@ function setAutoscaling(service, config) {
|
|
|
405
405
|
if (config.metricName === "ApproximateNumberOfMessagesVisible") {
|
|
406
406
|
TTS_CustomizedMetricSpecification = CSM_ApproximateNumberOfMessagesVisible;
|
|
407
407
|
}
|
|
408
|
-
return new aws.appautoscaling.Policy(`ecs-autoscaling-policy
|
|
408
|
+
return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${serviceId}`, {
|
|
409
409
|
policyType: "TargetTrackingScaling",
|
|
410
410
|
resourceId: ecsTarget.resourceId,
|
|
411
|
-
scalableDimension:
|
|
411
|
+
scalableDimension: ecsTarget.scalableDimension.apply((value) => {
|
|
412
|
+
console.log({ scalableDimension: value });
|
|
413
|
+
return value;
|
|
414
|
+
}),
|
|
412
415
|
serviceNamespace: "ecs",
|
|
413
416
|
targetTrackingScalingPolicyConfiguration: {
|
|
414
417
|
targetValue: config.targetValue,
|