dcl-ops-lib 6.10.9 → 6.10.10
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 +5 -12
- package/package.json +1 -1
package/createFargateTask.js
CHANGED
|
@@ -373,23 +373,16 @@ function createInternalService(config) {
|
|
|
373
373
|
],
|
|
374
374
|
}, Object.assign(Object.assign({}, extraOpts), { dependsOn }));
|
|
375
375
|
if (!!appAutoscaling) {
|
|
376
|
-
setAutoscaling(service, Object.assign(Object.assign({}, appAutoscaling), { desiredCount }));
|
|
376
|
+
setAutoscaling(service, serviceName, Object.assign(Object.assign({}, appAutoscaling), { desiredCount }));
|
|
377
377
|
}
|
|
378
378
|
return service;
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
|
-
function setAutoscaling(service, config) {
|
|
382
|
-
|
|
383
|
-
console.log({
|
|
384
|
-
serviceId,
|
|
385
|
-
serviceIdType: typeof serviceId,
|
|
386
|
-
serviceIdCasted: serviceId,
|
|
387
|
-
serviceIdCastedType: typeof serviceId,
|
|
388
|
-
});
|
|
389
|
-
const ecsTarget = new aws.appautoscaling.Target(`ecs-target-${(serviceId)}`, {
|
|
381
|
+
function setAutoscaling(service, serviceName, config) {
|
|
382
|
+
const ecsTarget = new aws.appautoscaling.Target(`ecs-target-${(0, stack_1.getStackScopedName)(serviceName)}`, {
|
|
390
383
|
maxCapacity: config.maxCapacity,
|
|
391
384
|
minCapacity: config.desiredCount,
|
|
392
|
-
resourceId:
|
|
385
|
+
resourceId: service.id,
|
|
393
386
|
scalableDimension: "ecs:service:DesiredCount",
|
|
394
387
|
serviceNamespace: "ecs",
|
|
395
388
|
});
|
|
@@ -409,7 +402,7 @@ function setAutoscaling(service, config) {
|
|
|
409
402
|
if (config.metricName === "ApproximateNumberOfMessagesVisible") {
|
|
410
403
|
TTS_CustomizedMetricSpecification = CSM_ApproximateNumberOfMessagesVisible;
|
|
411
404
|
}
|
|
412
|
-
return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${(
|
|
405
|
+
return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${(0, stack_1.getStackScopedName)(serviceName)}`, {
|
|
413
406
|
policyType: "TargetTrackingScaling",
|
|
414
407
|
resourceId: ecsTarget.resourceId,
|
|
415
408
|
scalableDimension: pulumi.interpolate `${ecsTarget.scalableDimension}`,
|