dcl-ops-lib 8.2.1 → 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.
@@ -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;
@@ -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
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcl-ops-lib",
3
- "version": "8.2.1",
3
+ "version": "8.3.0",
4
4
  "scripts": {
5
5
  "build": "tsc && cp bin/* . && node test.js",
6
6
  "clean": "rm *.d.ts *.js *.js.map"