dcl-ops-lib 6.11.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 +16 -12
- package/createFargateTask.js +35 -31
- package/package.json +1 -1
package/createFargateTask.d.ts
CHANGED
|
@@ -56,12 +56,14 @@ export type FargateTaskOptions = {
|
|
|
56
56
|
runtimePlatform?: aws.types.input.ecs.TaskDefinitionRuntimePlatform;
|
|
57
57
|
appAutoscaling?: {
|
|
58
58
|
maxCapacity: number;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
items: {
|
|
60
|
+
metricName: string;
|
|
61
|
+
targetValue: number;
|
|
62
|
+
metricDimensionValue: pulumi.Output<string>;
|
|
63
|
+
statistic?: "Average" | "Minimum" | "Maximum";
|
|
64
|
+
scaleOutCooldown?: number;
|
|
65
|
+
scaleInCooldown?: number;
|
|
66
|
+
}[];
|
|
65
67
|
};
|
|
66
68
|
};
|
|
67
69
|
/**
|
|
@@ -115,12 +117,14 @@ export type InternalServiceOptions = {
|
|
|
115
117
|
runtimePlatform?: aws.types.input.ecs.TaskDefinitionRuntimePlatform;
|
|
116
118
|
appAutoscaling?: {
|
|
117
119
|
maxCapacity: number;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
items: {
|
|
121
|
+
metricName: string;
|
|
122
|
+
targetValue: number;
|
|
123
|
+
metricDimensionValue: pulumi.Output<string>;
|
|
124
|
+
statistic?: "Average" | "Minimum" | "Maximum";
|
|
125
|
+
scaleOutCooldown?: number;
|
|
126
|
+
scaleInCooldown?: number;
|
|
127
|
+
}[];
|
|
124
128
|
};
|
|
125
129
|
};
|
|
126
130
|
export declare function createInternalService(config: InternalServiceOptions): Promise<import("@pulumi/aws/ecs/service").Service>;
|
package/createFargateTask.js
CHANGED
|
@@ -383,40 +383,44 @@ function setAutoscaling(service, serviceName, config) {
|
|
|
383
383
|
maxCapacity: config.maxCapacity,
|
|
384
384
|
minCapacity: config.desiredCount,
|
|
385
385
|
resourceId: service.id.apply((id) => {
|
|
386
|
-
return id.split(
|
|
386
|
+
return id.split(":").pop();
|
|
387
387
|
}),
|
|
388
388
|
scalableDimension: "ecs:service:DesiredCount",
|
|
389
389
|
serviceNamespace: "ecs",
|
|
390
390
|
});
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
391
|
+
config.items.forEach((item, index) => {
|
|
392
|
+
const CSM_ApproximateNumberOfMessagesVisible = {
|
|
393
|
+
metricName: item.metricName,
|
|
394
|
+
namespace: "AWS/SQS",
|
|
395
|
+
dimensions: [
|
|
396
|
+
{
|
|
397
|
+
name: "QueueName",
|
|
398
|
+
value: item.metricDimensionValue.apply((value) => {
|
|
399
|
+
return value.split("/").pop();
|
|
400
|
+
}),
|
|
401
|
+
},
|
|
402
|
+
],
|
|
403
|
+
statistic: item.statistic,
|
|
404
|
+
unit: "Count",
|
|
405
|
+
};
|
|
406
|
+
let TTS_CustomizedMetricSpecification = undefined;
|
|
407
|
+
if (item.metricName === "ApproximateNumberOfMessagesVisible") {
|
|
408
|
+
TTS_CustomizedMetricSpecification =
|
|
409
|
+
CSM_ApproximateNumberOfMessagesVisible;
|
|
410
|
+
}
|
|
411
|
+
return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${(0, stack_1.getStackScopedName)(serviceName)}-${index.toString()}`, // distinct policies by id
|
|
412
|
+
{
|
|
413
|
+
policyType: "TargetTrackingScaling",
|
|
414
|
+
resourceId: ecsTarget.resourceId,
|
|
415
|
+
scalableDimension: pulumi.interpolate `${ecsTarget.scalableDimension}`,
|
|
416
|
+
serviceNamespace: "ecs",
|
|
417
|
+
targetTrackingScalingPolicyConfiguration: {
|
|
418
|
+
targetValue: item.targetValue,
|
|
419
|
+
customizedMetricSpecification: TTS_CustomizedMetricSpecification,
|
|
420
|
+
scaleOutCooldown: item.scaleOutCooldown,
|
|
421
|
+
scaleInCooldown: item.scaleInCooldown,
|
|
422
|
+
},
|
|
423
|
+
}, { dependsOn: [ecsTarget] });
|
|
424
|
+
});
|
|
421
425
|
}
|
|
422
426
|
//# sourceMappingURL=createFargateTask.js.map
|