dcl-ops-lib 6.12.0 → 7.0.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,7 +56,7 @@ export type FargateTaskOptions = {
56
56
  runtimePlatform?: aws.types.input.ecs.TaskDefinitionRuntimePlatform;
57
57
  appAutoscaling?: {
58
58
  maxCapacity: number;
59
- queues: {
59
+ items: {
60
60
  metricName: string;
61
61
  targetValue: number;
62
62
  metricDimensionValue: pulumi.Output<string>;
@@ -117,7 +117,7 @@ export type InternalServiceOptions = {
117
117
  runtimePlatform?: aws.types.input.ecs.TaskDefinitionRuntimePlatform;
118
118
  appAutoscaling?: {
119
119
  maxCapacity: number;
120
- queues: {
120
+ items: {
121
121
  metricName: string;
122
122
  targetValue: number;
123
123
  metricDimensionValue: pulumi.Output<string>;
@@ -388,36 +388,37 @@ function setAutoscaling(service, serviceName, config) {
388
388
  scalableDimension: "ecs:service:DesiredCount",
389
389
  serviceNamespace: "ecs",
390
390
  });
391
- config.queues.forEach((queue) => {
391
+ config.items.forEach((item, index) => {
392
392
  const CSM_ApproximateNumberOfMessagesVisible = {
393
- metricName: queue.metricName,
393
+ metricName: item.metricName,
394
394
  namespace: "AWS/SQS",
395
395
  dimensions: [
396
396
  {
397
397
  name: "QueueName",
398
- value: queue.metricDimensionValue.apply((value) => {
398
+ value: item.metricDimensionValue.apply((value) => {
399
399
  return value.split("/").pop();
400
400
  }),
401
401
  },
402
402
  ],
403
- statistic: queue.statistic,
403
+ statistic: item.statistic,
404
404
  unit: "Count",
405
405
  };
406
406
  let TTS_CustomizedMetricSpecification = undefined;
407
- if (queue.metricName === "ApproximateNumberOfMessagesVisible") {
407
+ if (item.metricName === "ApproximateNumberOfMessagesVisible") {
408
408
  TTS_CustomizedMetricSpecification =
409
409
  CSM_ApproximateNumberOfMessagesVisible;
410
410
  }
411
- return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${(0, stack_1.getStackScopedName)(serviceName)}`, {
411
+ return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${(0, stack_1.getStackScopedName)(serviceName)}-${index.toString()}`, // distinct policies by id
412
+ {
412
413
  policyType: "TargetTrackingScaling",
413
414
  resourceId: ecsTarget.resourceId,
414
415
  scalableDimension: pulumi.interpolate `${ecsTarget.scalableDimension}`,
415
416
  serviceNamespace: "ecs",
416
417
  targetTrackingScalingPolicyConfiguration: {
417
- targetValue: queue.targetValue,
418
+ targetValue: item.targetValue,
418
419
  customizedMetricSpecification: TTS_CustomizedMetricSpecification,
419
- scaleOutCooldown: queue.scaleOutCooldown,
420
- scaleInCooldown: queue.scaleInCooldown,
420
+ scaleOutCooldown: item.scaleOutCooldown,
421
+ scaleInCooldown: item.scaleInCooldown,
421
422
  },
422
423
  }, { dependsOn: [ecsTarget] });
423
424
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcl-ops-lib",
3
- "version": "6.12.0",
3
+ "version": "7.0.0",
4
4
  "scripts": {
5
5
  "build": "tsc && cp bin/* . && node test.js",
6
6
  "clean": "rm *.d.ts *.js *.js.map"