@codedazur/cdk-docker-cluster 2.0.0 → 2.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @codedazur/cdk-docker-cluster
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`f361c4c`](https://github.com/codedazur/toolkit/commit/f361c4cbf2974360c9eeec0feb04c9c2cc33b730) Thanks [@thijsdaniels](https://github.com/thijsdaniels)! - Add support for Container Insights on ECS clusters (`cluster.containerInsights`) and custom health checks on ALB target groups (`service.healthCheck`).
8
+
3
9
  ## 2.0.0
4
10
 
5
11
  ### Major Changes
package/dist/index.d.ts CHANGED
@@ -4,12 +4,21 @@ import { ContainerImage, Secret, ScalableTaskCount } from 'aws-cdk-lib/aws-ecs';
4
4
  import { SiteDistributionProps, SiteDistribution } from '@codedazur/cdk-site-distribution';
5
5
  import { Duration } from 'aws-cdk-lib';
6
6
  import { ApplicationLoadBalancedFargateServiceProps, ApplicationLoadBalancedFargateService } from 'aws-cdk-lib/aws-ecs-patterns';
7
+ import { HealthCheck } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
7
8
  import { Construct } from 'constructs';
8
9
 
10
+ interface ClusterConfig {
11
+ /**
12
+ * Enable CloudWatch Container Insights for the ECS Cluster.
13
+ * @default false
14
+ */
15
+ readonly containerInsights?: boolean;
16
+ }
9
17
  interface DockerClusterProps {
10
18
  readonly source: string | SourceProps | ContainerImage;
11
19
  readonly service?: ServiceProps;
12
20
  readonly distribution?: Omit<SiteDistributionProps, "origin">;
21
+ readonly cluster?: ClusterConfig;
13
22
  }
14
23
  interface ServiceProps {
15
24
  readonly port?: number;
@@ -18,6 +27,10 @@ interface ServiceProps {
18
27
  readonly memory?: ApplicationLoadBalancedFargateServiceProps["memoryLimitMiB"];
19
28
  readonly environment?: Record<string, string>;
20
29
  readonly secrets?: Record<string, Secret>;
30
+ /**
31
+ * Health check configuration for the Application Load Balancer target group.
32
+ */
33
+ readonly healthCheck?: HealthCheck;
21
34
  }
22
35
  interface AutoScalingConfig {
23
36
  /**
@@ -96,4 +109,4 @@ declare class DockerCluster extends Construct {
96
109
  protected getOutputDirectory(): string;
97
110
  }
98
111
 
99
- export { DockerCluster, type DockerClusterProps, type ServiceProps };
112
+ export { type ClusterConfig, DockerCluster, type DockerClusterProps, type ServiceProps };
package/dist/index.js CHANGED
@@ -48,7 +48,9 @@ var DockerCluster = class extends Construct {
48
48
  createService() {
49
49
  const desiredTasks = typeof this.props.service?.tasks === "number" ? this.props.service?.tasks : this.props.service?.tasks?.minimum;
50
50
  const service = new ApplicationLoadBalancedFargateService(this, "Service", {
51
- cluster: new Cluster(this, "Cluster"),
51
+ cluster: new Cluster(this, "Cluster", {
52
+ containerInsights: this.props.cluster?.containerInsights
53
+ }),
52
54
  cpu: this.props.service?.cpu,
53
55
  memoryLimitMiB: this.props.service?.memory,
54
56
  desiredCount: desiredTasks,
@@ -63,6 +65,9 @@ var DockerCluster = class extends Construct {
63
65
  rollback: true
64
66
  }
65
67
  });
68
+ if (this.props.service?.healthCheck) {
69
+ service.targetGroup.configureHealthCheck(this.props.service.healthCheck);
70
+ }
66
71
  return service;
67
72
  }
68
73
  createAutoScaling(service) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codedazur/cdk-docker-cluster",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,12 +23,12 @@
23
23
  "constructs": ">=10"
24
24
  },
25
25
  "dependencies": {
26
- "@codedazur/cdk-site-distribution": "^2.0.0"
26
+ "@codedazur/cdk-site-distribution": "~2.0.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "^25.0.9",
30
- "aws-cdk-lib": "^2.235.1",
31
- "constructs": "^10.4.5",
32
- "esbuild": "^0.27.2"
29
+ "@types/node": "^25.9.1",
30
+ "aws-cdk-lib": "^2.268.0",
31
+ "constructs": "^10.8.1",
32
+ "esbuild": "^0.28.2"
33
33
  }
34
34
  }