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.
- package/createFargateTask.d.ts +2 -2
- package/createFargateTask.js +10 -9
- package/package.json +1 -1
package/createFargateTask.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export type FargateTaskOptions = {
|
|
|
56
56
|
runtimePlatform?: aws.types.input.ecs.TaskDefinitionRuntimePlatform;
|
|
57
57
|
appAutoscaling?: {
|
|
58
58
|
maxCapacity: number;
|
|
59
|
-
|
|
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
|
-
|
|
120
|
+
items: {
|
|
121
121
|
metricName: string;
|
|
122
122
|
targetValue: number;
|
|
123
123
|
metricDimensionValue: pulumi.Output<string>;
|
package/createFargateTask.js
CHANGED
|
@@ -388,36 +388,37 @@ function setAutoscaling(service, serviceName, config) {
|
|
|
388
388
|
scalableDimension: "ecs:service:DesiredCount",
|
|
389
389
|
serviceNamespace: "ecs",
|
|
390
390
|
});
|
|
391
|
-
config.
|
|
391
|
+
config.items.forEach((item, index) => {
|
|
392
392
|
const CSM_ApproximateNumberOfMessagesVisible = {
|
|
393
|
-
metricName:
|
|
393
|
+
metricName: item.metricName,
|
|
394
394
|
namespace: "AWS/SQS",
|
|
395
395
|
dimensions: [
|
|
396
396
|
{
|
|
397
397
|
name: "QueueName",
|
|
398
|
-
value:
|
|
398
|
+
value: item.metricDimensionValue.apply((value) => {
|
|
399
399
|
return value.split("/").pop();
|
|
400
400
|
}),
|
|
401
401
|
},
|
|
402
402
|
],
|
|
403
|
-
statistic:
|
|
403
|
+
statistic: item.statistic,
|
|
404
404
|
unit: "Count",
|
|
405
405
|
};
|
|
406
406
|
let TTS_CustomizedMetricSpecification = undefined;
|
|
407
|
-
if (
|
|
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:
|
|
418
|
+
targetValue: item.targetValue,
|
|
418
419
|
customizedMetricSpecification: TTS_CustomizedMetricSpecification,
|
|
419
|
-
scaleOutCooldown:
|
|
420
|
-
scaleInCooldown:
|
|
420
|
+
scaleOutCooldown: item.scaleOutCooldown,
|
|
421
|
+
scaleInCooldown: item.scaleInCooldown,
|
|
421
422
|
},
|
|
422
423
|
}, { dependsOn: [ecsTarget] });
|
|
423
424
|
});
|