dcl-ops-lib 6.10.5 → 6.10.7
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 +8 -9
- package/package.json +1 -1
package/createFargateTask.js
CHANGED
|
@@ -379,12 +379,14 @@ 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
|
+
console.log({ serviceId });
|
|
386
|
+
const ecsTarget = new aws.appautoscaling.Target(`ecs-target-${serviceId}`, {
|
|
383
387
|
maxCapacity: config.maxCapacity,
|
|
384
388
|
minCapacity: config.desiredCount,
|
|
385
|
-
resourceId:
|
|
386
|
-
return id.split(':').pop();
|
|
387
|
-
}),
|
|
389
|
+
resourceId: serviceId,
|
|
388
390
|
scalableDimension: "ecs:service:DesiredCount",
|
|
389
391
|
serviceNamespace: "ecs",
|
|
390
392
|
});
|
|
@@ -404,13 +406,10 @@ function setAutoscaling(service, config) {
|
|
|
404
406
|
if (config.metricName === "ApproximateNumberOfMessagesVisible") {
|
|
405
407
|
TTS_CustomizedMetricSpecification = CSM_ApproximateNumberOfMessagesVisible;
|
|
406
408
|
}
|
|
407
|
-
return new aws.appautoscaling.Policy(`ecs-autoscaling-policy
|
|
409
|
+
return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${serviceId}`, {
|
|
408
410
|
policyType: "TargetTrackingScaling",
|
|
409
411
|
resourceId: ecsTarget.resourceId,
|
|
410
|
-
scalableDimension: ecsTarget.scalableDimension
|
|
411
|
-
console.log({ scalableDimension: value });
|
|
412
|
-
return value;
|
|
413
|
-
}),
|
|
412
|
+
scalableDimension: pulumi.interpolate `${ecsTarget.scalableDimension}`,
|
|
414
413
|
serviceNamespace: "ecs",
|
|
415
414
|
targetTrackingScalingPolicyConfiguration: {
|
|
416
415
|
targetValue: config.targetValue,
|