dcl-ops-lib 6.7.0 → 6.8.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.
@@ -23,9 +23,7 @@ export type FargateTaskOptions = {
23
23
  cluster?: aws.ecs.Cluster | string;
24
24
  healthCheck?: Partial<aws.types.input.alb.TargetGroupHealthCheck>;
25
25
  healthCheckContainer?: HealthCheck;
26
- ephemeralStorage?: {
27
- sizeInGiB: number;
28
- };
26
+ ephemeralStorageInGB?: number;
29
27
  desiredCount?: number;
30
28
  memoryReservation?: number;
31
29
  cpuReservation?: number;
@@ -104,9 +102,7 @@ export type InternalServiceOptions = {
104
102
  securityGroups?: (string | pulumi.Output<string>)[];
105
103
  ignoreServiceDiscovery?: boolean;
106
104
  serviceDiscoveryPort?: number;
107
- ephemeralStorage?: {
108
- sizeInGiB: number;
109
- };
105
+ ephemeralStorageInGB?: number;
110
106
  desiredCount?: number;
111
107
  executionRole?: aws.iam.Role;
112
108
  taskRole?: aws.iam.Role;
@@ -115,7 +115,7 @@ function getFargateTaskRole(name, policyArnNamedMap) {
115
115
  */
116
116
  function createFargateTask(serviceName, dockerImage, dockerListeningPort, environment, hostname, options) {
117
117
  return __awaiter(this, void 0, void 0, function* () {
118
- let { healthCheck, healthCheckContainer, essential, dontExpose, securityGroups, cluster, memoryReservation, command, version, ephemeralStorage, desiredCount, cpuReservation, extraPortMappings, extraALBMappings, executionRolePolicies, taskRolePolicies, ignoreServiceDiscovery, secrets, metrics, dontAssignPublicIp, dependsOn, volumes, deregistrationDelay, mountPoints, repositoryCredentials, team, } = options;
118
+ let { healthCheck, healthCheckContainer, essential, dontExpose, securityGroups, cluster, memoryReservation, command, version, ephemeralStorageInGB, desiredCount, cpuReservation, extraPortMappings, extraALBMappings, executionRolePolicies, taskRolePolicies, ignoreServiceDiscovery, secrets, metrics, dontAssignPublicIp, dependsOn, volumes, deregistrationDelay, mountPoints, repositoryCredentials, team, } = options;
119
119
  if (undefined === essential) {
120
120
  essential = true;
121
121
  }
@@ -210,7 +210,7 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
210
210
  serviceName,
211
211
  cluster,
212
212
  desiredCount,
213
- ephemeralStorage,
213
+ ephemeralStorageInGB,
214
214
  executionRole,
215
215
  taskRole,
216
216
  assignPublicIp: !dontAssignPublicIp,
@@ -263,7 +263,7 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
263
263
  serviceName,
264
264
  cluster,
265
265
  desiredCount,
266
- ephemeralStorage,
266
+ ephemeralStorageInGB,
267
267
  executionRole,
268
268
  taskRole,
269
269
  assignPublicIp: !dontAssignPublicIp,
@@ -297,7 +297,7 @@ function createFargateTask(serviceName, dockerImage, dockerListeningPort, enviro
297
297
  function createInternalService(config) {
298
298
  return __awaiter(this, void 0, void 0, function* () {
299
299
  var _a, _b;
300
- let { serviceName, cluster, securityGroups, ignoreServiceDiscovery, serviceDiscoveryPort, desiredCount, executionRole, taskRole, containerInfo, assignPublicIp, dependsOn, volumes, team, targetGroups, runtimePlatform, ephemeralStorage } = config;
300
+ let { serviceName, cluster, securityGroups, ignoreServiceDiscovery, serviceDiscoveryPort, desiredCount, executionRole, taskRole, containerInfo, assignPublicIp, dependsOn, volumes, team, targetGroups, runtimePlatform, ephemeralStorageInGB, appAutoscaling } = config;
301
301
  if (!desiredCount)
302
302
  desiredCount = 1;
303
303
  assignPublicIp = !!assignPublicIp;
@@ -329,7 +329,9 @@ function createInternalService(config) {
329
329
  taskRoleArn: taskRole === null || taskRole === void 0 ? void 0 : taskRole.arn,
330
330
  tags: { ServiceName: serviceName, Team: team },
331
331
  containerDefinitions: pulumi.jsonStringify([Object.assign(Object.assign({}, containerInfo), { logConfiguration: (0, exports.getDefaultLogs)(serviceName, logGroup) })]),
332
- ephemeralStorage: !!ephemeralStorage ? ephemeralStorage : undefined,
332
+ ephemeralStorage: !!ephemeralStorageInGB ? {
333
+ sizeInGib: ephemeralStorageInGB
334
+ } : undefined,
333
335
  cpu: (_a = containerInfo.cpu) === null || _a === void 0 ? void 0 : _a.toString(),
334
336
  memory: (_b = containerInfo.memoryReservation) === null || _b === void 0 ? void 0 : _b.toString(),
335
337
  runtimePlatform: runtimePlatform,
@@ -359,8 +361,9 @@ function createInternalService(config) {
359
361
  }))
360
362
  ]
361
363
  }, Object.assign(Object.assign({}, extraOpts), { dependsOn }));
362
- if (!!config.appAutoscaling) {
363
- setAutoscaling(service, Object.assign(Object.assign({}, config.appAutoscaling), { desiredCount }));
364
+ console.log('Should set-up autoscaling', { should: !!appAutoscaling });
365
+ if (!!appAutoscaling) {
366
+ setAutoscaling(service, Object.assign(Object.assign({}, appAutoscaling), { desiredCount }));
364
367
  }
365
368
  return service;
366
369
  });
@@ -390,7 +393,7 @@ function setAutoscaling(service, config) {
390
393
  if (config.metricName === "ApproximateNumberOfMessagesVisible") {
391
394
  TTS_CustomizedMetricSpecification = CSM_ApproximateNumberOfMessagesVisible;
392
395
  }
393
- new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${taskUniqueIdentifier}`, {
396
+ return new aws.appautoscaling.Policy(`ecs-autoscaling-policy-${taskUniqueIdentifier}`, {
394
397
  policyType: "TargetTrackingScaling",
395
398
  resourceId: ecsTarget.resourceId,
396
399
  scalableDimension: ecsTarget.scalableDimension,
@@ -401,6 +404,6 @@ function setAutoscaling(service, config) {
401
404
  scaleOutCooldown: config.scaleOutCooldown,
402
405
  scaleInCooldown: config.scaleInCooldown,
403
406
  },
404
- });
407
+ }, { dependsOn: [ecsTarget] });
405
408
  }
406
409
  //# sourceMappingURL=createFargateTask.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcl-ops-lib",
3
- "version": "6.7.0",
3
+ "version": "6.8.0",
4
4
  "scripts": {
5
5
  "build": "tsc && cp bin/* . && node test.js",
6
6
  "clean": "rm *.d.ts *.js *.js.map"