dcl-ops-lib 6.7.1 → 6.8.0
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 +6 -5
- package/package.json +1 -1
package/createFargateTask.js
CHANGED
|
@@ -297,7 +297,7 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
|
|
|
297
297
|
function createInternalService(config) {
|
|
298
298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
299
299
|
var _a, _b;
|
|
300
|
-
let { serviceName, cluster, securityGroups, ignoreServiceDiscovery, serviceDiscoveryPort, desiredCount, executionRole, taskRole, containerInfo, assignPublicIp, dependsOn, volumes, team, targetGroups, runtimePlatform, ephemeralStorageInGB } = config;
|
|
300
|
+
let { serviceName, cluster, securityGroups, ignoreServiceDiscovery, serviceDiscoveryPort, desiredCount, executionRole, taskRole, containerInfo, assignPublicIp, dependsOn, volumes, team, targetGroups, runtimePlatform, ephemeralStorageInGB, appAutoscaling } = config;
|
|
301
301
|
if (!desiredCount)
|
|
302
302
|
desiredCount = 1;
|
|
303
303
|
assignPublicIp = !!assignPublicIp;
|
|
@@ -361,8 +361,9 @@ function createInternalService(config) {
|
|
|
361
361
|
}))
|
|
362
362
|
]
|
|
363
363
|
}, Object.assign(Object.assign({}, extraOpts), { dependsOn }));
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
console.log('Should set-up autoscaling', { should: !!appAutoscaling });
|
|
365
|
+
if (!!appAutoscaling) {
|
|
366
|
+
setAutoscaling(service, Object.assign(Object.assign({}, appAutoscaling), { desiredCount }));
|
|
366
367
|
}
|
|
367
368
|
return service;
|
|
368
369
|
});
|
|
@@ -392,7 +393,7 @@ function setAutoscaling(service, config) {
|
|
|
392
393
|
if (config.metricName === "ApproximateNumberOfMessagesVisible") {
|
|
393
394
|
TTS_CustomizedMetricSpecification = CSM_ApproximateNumberOfMessagesVisible;
|
|
394
395
|
}
|
|
395
|
-
new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${taskUniqueIdentifier}`, {
|
|
396
|
+
return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${taskUniqueIdentifier}`, {
|
|
396
397
|
policyType: "TargetTrackingScaling",
|
|
397
398
|
resourceId: ecsTarget.resourceId,
|
|
398
399
|
scalableDimension: ecsTarget.scalableDimension,
|
|
@@ -403,6 +404,6 @@ function setAutoscaling(service, config) {
|
|
|
403
404
|
scaleOutCooldown: config.scaleOutCooldown,
|
|
404
405
|
scaleInCooldown: config.scaleInCooldown,
|
|
405
406
|
},
|
|
406
|
-
});
|
|
407
|
+
}, { dependsOn: [ecsTarget] });
|
|
407
408
|
}
|
|
408
409
|
//# sourceMappingURL=createFargateTask.js.map
|