@codedazur/cdk-docker-cluster 1.1.0 → 1.1.1
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/CHANGELOG.md +9 -0
- package/dist/index.js +19 -22
- package/dist/index.mjs +16 -19
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @codedazur/cdk-docker-cluster
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b24894a`](https://github.com/codedazur/toolkit/commit/b24894a2de01e596669c2b5aca51bc0b28533106) Thanks [@thijsdaniels](https://github.com/thijsdaniels)! - Mark the package as side-effect-free for tree shaking.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`b24894a`](https://github.com/codedazur/toolkit/commit/b24894a2de01e596669c2b5aca51bc0b28533106)]:
|
|
10
|
+
- @codedazur/cdk-site-distribution@1.0.1
|
|
11
|
+
|
|
3
12
|
## 1.1.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
DockerCluster: () => DockerCluster
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
|
|
27
27
|
// src/constructs/DockerCluster.ts
|
|
28
28
|
var import_cdk_site_distribution = require("@codedazur/cdk-site-distribution");
|
|
@@ -60,18 +60,17 @@ var DockerCluster = class extends import_constructs.Construct {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
createService() {
|
|
63
|
-
|
|
64
|
-
const desiredTasks = typeof ((_a = this.props.service) == null ? void 0 : _a.tasks) === "number" ? (_b = this.props.service) == null ? void 0 : _b.tasks : (_d = (_c = this.props.service) == null ? void 0 : _c.tasks) == null ? void 0 : _d.minimum;
|
|
63
|
+
const desiredTasks = typeof this.props.service?.tasks === "number" ? this.props.service?.tasks : this.props.service?.tasks?.minimum;
|
|
65
64
|
const service = new import_aws_ecs_patterns.ApplicationLoadBalancedFargateService(this, "Service", {
|
|
66
65
|
cluster: new import_aws_ecs.Cluster(this, "Cluster"),
|
|
67
|
-
cpu:
|
|
68
|
-
memoryLimitMiB:
|
|
66
|
+
cpu: this.props.service?.cpu,
|
|
67
|
+
memoryLimitMiB: this.props.service?.memory,
|
|
69
68
|
desiredCount: desiredTasks,
|
|
70
69
|
taskImageOptions: {
|
|
71
70
|
image: this.image,
|
|
72
|
-
containerPort:
|
|
73
|
-
environment:
|
|
74
|
-
secrets:
|
|
71
|
+
containerPort: this.props.service?.port,
|
|
72
|
+
environment: this.props.service?.environment,
|
|
73
|
+
secrets: this.props.service?.secrets
|
|
75
74
|
},
|
|
76
75
|
circuitBreaker: {
|
|
77
76
|
enable: true,
|
|
@@ -81,23 +80,22 @@ var DockerCluster = class extends import_constructs.Construct {
|
|
|
81
80
|
return service;
|
|
82
81
|
}
|
|
83
82
|
createAutoScaling(service) {
|
|
84
|
-
|
|
85
|
-
if (typeof ((_a = this.props.service) == null ? void 0 : _a.tasks) !== "object") {
|
|
83
|
+
if (typeof this.props.service?.tasks !== "object") {
|
|
86
84
|
return;
|
|
87
85
|
}
|
|
88
86
|
const autoScaling = service.service.autoScaleTaskCount({
|
|
89
|
-
minCapacity:
|
|
90
|
-
maxCapacity:
|
|
87
|
+
minCapacity: this.props.service?.tasks.minimum,
|
|
88
|
+
maxCapacity: this.props.service?.tasks.maximum
|
|
91
89
|
});
|
|
92
90
|
autoScaling.scaleOnMemoryUtilization("MemoryScaling", {
|
|
93
|
-
targetUtilizationPercent:
|
|
94
|
-
scaleInCooldown:
|
|
95
|
-
scaleOutCooldown:
|
|
91
|
+
targetUtilizationPercent: this.props.service?.tasks.threshold?.memory ?? 75,
|
|
92
|
+
scaleInCooldown: this.props.service?.tasks.cooldown?.in,
|
|
93
|
+
scaleOutCooldown: this.props.service?.tasks.cooldown?.out
|
|
96
94
|
});
|
|
97
95
|
autoScaling.scaleOnCpuUtilization("CpuScaling", {
|
|
98
|
-
targetUtilizationPercent:
|
|
99
|
-
scaleInCooldown:
|
|
100
|
-
scaleOutCooldown:
|
|
96
|
+
targetUtilizationPercent: this.props.service?.tasks.threshold?.cpu ?? 75,
|
|
97
|
+
scaleInCooldown: this.props.service?.tasks.cooldown?.in,
|
|
98
|
+
scaleOutCooldown: this.props.service?.tasks.cooldown?.out
|
|
101
99
|
});
|
|
102
100
|
return autoScaling;
|
|
103
101
|
}
|
|
@@ -132,8 +130,7 @@ var DockerCluster = class extends import_constructs.Construct {
|
|
|
132
130
|
});
|
|
133
131
|
}
|
|
134
132
|
getOutputDirectory() {
|
|
135
|
-
|
|
136
|
-
return (_b = (_a = import_aws_cdk_lib.App.of(this)) == null ? void 0 : _a.outdir) != null ? _b : "cdk.out";
|
|
133
|
+
return import_aws_cdk_lib.App.of(this)?.outdir ?? "cdk.out";
|
|
137
134
|
}
|
|
138
135
|
};
|
|
139
136
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -44,18 +44,17 @@ var DockerCluster = class extends Construct {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
createService() {
|
|
47
|
-
|
|
48
|
-
const desiredTasks = typeof ((_a = this.props.service) == null ? void 0 : _a.tasks) === "number" ? (_b = this.props.service) == null ? void 0 : _b.tasks : (_d = (_c = this.props.service) == null ? void 0 : _c.tasks) == null ? void 0 : _d.minimum;
|
|
47
|
+
const desiredTasks = typeof this.props.service?.tasks === "number" ? this.props.service?.tasks : this.props.service?.tasks?.minimum;
|
|
49
48
|
const service = new ApplicationLoadBalancedFargateService(this, "Service", {
|
|
50
49
|
cluster: new Cluster(this, "Cluster"),
|
|
51
|
-
cpu:
|
|
52
|
-
memoryLimitMiB:
|
|
50
|
+
cpu: this.props.service?.cpu,
|
|
51
|
+
memoryLimitMiB: this.props.service?.memory,
|
|
53
52
|
desiredCount: desiredTasks,
|
|
54
53
|
taskImageOptions: {
|
|
55
54
|
image: this.image,
|
|
56
|
-
containerPort:
|
|
57
|
-
environment:
|
|
58
|
-
secrets:
|
|
55
|
+
containerPort: this.props.service?.port,
|
|
56
|
+
environment: this.props.service?.environment,
|
|
57
|
+
secrets: this.props.service?.secrets
|
|
59
58
|
},
|
|
60
59
|
circuitBreaker: {
|
|
61
60
|
enable: true,
|
|
@@ -65,23 +64,22 @@ var DockerCluster = class extends Construct {
|
|
|
65
64
|
return service;
|
|
66
65
|
}
|
|
67
66
|
createAutoScaling(service) {
|
|
68
|
-
|
|
69
|
-
if (typeof ((_a = this.props.service) == null ? void 0 : _a.tasks) !== "object") {
|
|
67
|
+
if (typeof this.props.service?.tasks !== "object") {
|
|
70
68
|
return;
|
|
71
69
|
}
|
|
72
70
|
const autoScaling = service.service.autoScaleTaskCount({
|
|
73
|
-
minCapacity:
|
|
74
|
-
maxCapacity:
|
|
71
|
+
minCapacity: this.props.service?.tasks.minimum,
|
|
72
|
+
maxCapacity: this.props.service?.tasks.maximum
|
|
75
73
|
});
|
|
76
74
|
autoScaling.scaleOnMemoryUtilization("MemoryScaling", {
|
|
77
|
-
targetUtilizationPercent:
|
|
78
|
-
scaleInCooldown:
|
|
79
|
-
scaleOutCooldown:
|
|
75
|
+
targetUtilizationPercent: this.props.service?.tasks.threshold?.memory ?? 75,
|
|
76
|
+
scaleInCooldown: this.props.service?.tasks.cooldown?.in,
|
|
77
|
+
scaleOutCooldown: this.props.service?.tasks.cooldown?.out
|
|
80
78
|
});
|
|
81
79
|
autoScaling.scaleOnCpuUtilization("CpuScaling", {
|
|
82
|
-
targetUtilizationPercent:
|
|
83
|
-
scaleInCooldown:
|
|
84
|
-
scaleOutCooldown:
|
|
80
|
+
targetUtilizationPercent: this.props.service?.tasks.threshold?.cpu ?? 75,
|
|
81
|
+
scaleInCooldown: this.props.service?.tasks.cooldown?.in,
|
|
82
|
+
scaleOutCooldown: this.props.service?.tasks.cooldown?.out
|
|
85
83
|
});
|
|
86
84
|
return autoScaling;
|
|
87
85
|
}
|
|
@@ -116,8 +114,7 @@ var DockerCluster = class extends Construct {
|
|
|
116
114
|
});
|
|
117
115
|
}
|
|
118
116
|
getOutputDirectory() {
|
|
119
|
-
|
|
120
|
-
return (_b = (_a = App.of(this)) == null ? void 0 : _a.outdir) != null ? _b : "cdk.out";
|
|
117
|
+
return App.of(this)?.outdir ?? "cdk.out";
|
|
121
118
|
}
|
|
122
119
|
};
|
|
123
120
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codedazur/cdk-docker-cluster",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"main": ".dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
|
+
"sideEffects": false,
|
|
17
18
|
"scripts": {
|
|
18
19
|
"develop": "tsup src/index.ts --format esm,cjs --dts --watch",
|
|
19
20
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
@@ -27,12 +28,12 @@
|
|
|
27
28
|
"constructs": ">=10"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@codedazur/cdk-site-distribution": "^1.0.
|
|
31
|
+
"@codedazur/cdk-site-distribution": "^1.0.1"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
|
-
"@types/node": "^
|
|
34
|
-
"aws-cdk-lib": "^2.
|
|
35
|
-
"constructs": "^10.
|
|
36
|
-
"esbuild": "^0.
|
|
34
|
+
"@types/node": "^24.0.3",
|
|
35
|
+
"aws-cdk-lib": "^2.201.0",
|
|
36
|
+
"constructs": "^10.4.2",
|
|
37
|
+
"esbuild": "^0.25.5"
|
|
37
38
|
}
|
|
38
39
|
}
|