dcl-ops-lib 8.2.0 → 8.3.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.d.ts +2 -0
- package/createFargateTask.js +3 -2
- package/package.json +1 -1
package/createFargateTask.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export type FargateTaskOptions = {
|
|
|
56
56
|
runtimePlatform?: aws.types.input.ecs.TaskDefinitionRuntimePlatform;
|
|
57
57
|
appAutoscaling?: {
|
|
58
58
|
maxCapacity: number;
|
|
59
|
+
minCapacity?: number;
|
|
59
60
|
policy?: {
|
|
60
61
|
metricName: string;
|
|
61
62
|
targetValue: number;
|
|
@@ -129,6 +130,7 @@ export type InternalServiceOptions = {
|
|
|
129
130
|
runtimePlatform?: aws.types.input.ecs.TaskDefinitionRuntimePlatform;
|
|
130
131
|
appAutoscaling?: {
|
|
131
132
|
maxCapacity: number;
|
|
133
|
+
minCapacity?: number;
|
|
132
134
|
policy?: {
|
|
133
135
|
metricName: string;
|
|
134
136
|
targetValue: number;
|
package/createFargateTask.js
CHANGED
|
@@ -305,7 +305,7 @@ function createInternalService(config) {
|
|
|
305
305
|
return __awaiter(this, void 0, void 0, function* () {
|
|
306
306
|
var _a, _b;
|
|
307
307
|
let { serviceName, cluster, securityGroups, ignoreServiceDiscovery, serviceDiscoveryPort, desiredCount, executionRole, taskRole, containerInfo, assignPublicIp, dependsOn, volumes, team, targetGroups, runtimePlatform, ephemeralStorageInGB, appAutoscaling, } = config;
|
|
308
|
-
if (!desiredCount)
|
|
308
|
+
if (!desiredCount && desiredCount !== 0)
|
|
309
309
|
desiredCount = 1;
|
|
310
310
|
assignPublicIp = !!assignPublicIp;
|
|
311
311
|
let serviceRegistries;
|
|
@@ -379,12 +379,13 @@ function createInternalService(config) {
|
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
function setAutoscaling(service, serviceName, config) {
|
|
382
|
+
var _a;
|
|
382
383
|
if ((!config.appAutoscaling.policy && !config.appAutoscaling.scheduleAction) || (config.appAutoscaling.policy && config.appAutoscaling.scheduleAction)) {
|
|
383
384
|
throw new Error("Invalid autoscaling configuration. You must provide either a policy OR a scheduleAction.");
|
|
384
385
|
}
|
|
385
386
|
const ecsTarget = new aws.appautoscaling.Target(`ecs-target-${(0, stack_1.getStackScopedName)(serviceName)}`, {
|
|
386
387
|
maxCapacity: config.appAutoscaling.maxCapacity,
|
|
387
|
-
minCapacity: config.desiredCount,
|
|
388
|
+
minCapacity: (_a = config.appAutoscaling.minCapacity) !== null && _a !== void 0 ? _a : config.desiredCount,
|
|
388
389
|
resourceId: service.id.apply((id) => {
|
|
389
390
|
return id.split(":").pop();
|
|
390
391
|
}),
|