dcl-ops-lib 8.0.0 → 8.0.1
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 +3 -4
- package/package.json +1 -1
package/createFargateTask.js
CHANGED
|
@@ -372,15 +372,14 @@ function createInternalService(config) {
|
|
|
372
372
|
})),
|
|
373
373
|
],
|
|
374
374
|
}, Object.assign(Object.assign({}, extraOpts), { dependsOn }));
|
|
375
|
-
if (
|
|
376
|
-
setAutoscaling(service, serviceName,
|
|
375
|
+
if (appAutoscaling) {
|
|
376
|
+
setAutoscaling(service, serviceName, { appAutoscaling, desiredCount });
|
|
377
377
|
}
|
|
378
378
|
return service;
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
function setAutoscaling(service, serviceName, config) {
|
|
382
|
-
|
|
383
|
-
if ((!((_a = config === null || config === void 0 ? void 0 : config.appAutoscaling) === null || _a === void 0 ? void 0 : _a.policy) && !((_b = config.appAutoscaling) === null || _b === void 0 ? void 0 : _b.scheduleAction)) || ((config === null || config === void 0 ? void 0 : config.appAutoscaling.policy) && ((_c = config.appAutoscaling) === null || _c === void 0 ? void 0 : _c.scheduleAction))) {
|
|
382
|
+
if ((!config.appAutoscaling.policy && !config.appAutoscaling.scheduleAction) || (config.appAutoscaling.policy && config.appAutoscaling.scheduleAction)) {
|
|
384
383
|
throw new Error("Invalid autoscaling configuration. You must provide either a policy OR a scheduleAction.");
|
|
385
384
|
}
|
|
386
385
|
const ecsTarget = new aws.appautoscaling.Target(`ecs-target-${(0, stack_1.getStackScopedName)(serviceName)}`, {
|