dcl-ops-lib 6.10.2 → 6.10.4

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.
@@ -379,13 +379,13 @@ function createInternalService(config) {
379
379
  });
380
380
  }
381
381
  function setAutoscaling(service, config) {
382
- const ecsTarget = new aws.appautoscaling.Target(`ecs-target-asset-bundle-windows-converter-dev`, {
382
+ const serviceId = service.id.apply((id) => {
383
+ return id.split(':').pop();
384
+ });
385
+ const ecsTarget = new aws.appautoscaling.Target(`ecs-target-${serviceId}`, {
383
386
  maxCapacity: config.maxCapacity,
384
387
  minCapacity: config.desiredCount,
385
- resourceId: service.id.apply((id) => {
386
- console.log({ serviceId: id });
387
- return id;
388
- }),
388
+ resourceId: serviceId,
389
389
  scalableDimension: "ecs:service:DesiredCount",
390
390
  serviceNamespace: "ecs",
391
391
  });
@@ -405,10 +405,13 @@ function setAutoscaling(service, config) {
405
405
  if (config.metricName === "ApproximateNumberOfMessagesVisible") {
406
406
  TTS_CustomizedMetricSpecification = CSM_ApproximateNumberOfMessagesVisible;
407
407
  }
408
- return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-asset-bundle-converter-windows-dev`, {
408
+ return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${serviceId}`, {
409
409
  policyType: "TargetTrackingScaling",
410
410
  resourceId: ecsTarget.resourceId,
411
- scalableDimension: "ecs:service:DesiredCount",
411
+ scalableDimension: ecsTarget.scalableDimension.apply((value) => {
412
+ console.log({ scalableDimension: value });
413
+ return value;
414
+ }),
412
415
  serviceNamespace: "ecs",
413
416
  targetTrackingScalingPolicyConfiguration: {
414
417
  targetValue: config.targetValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcl-ops-lib",
3
- "version": "6.10.2",
3
+ "version": "6.10.4",
4
4
  "scripts": {
5
5
  "build": "tsc && cp bin/* . && node test.js",
6
6
  "clean": "rm *.d.ts *.js *.js.map"