@codedazur/cdk-docker-cluster 0.9.5 → 0.9.7

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,20 @@
1
1
  # @codedazur/cdk-docker-cluster
2
2
 
3
+ ## 0.9.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#296](https://github.com/codedazur/toolkit/pull/296) [`ed9f7e6`](https://github.com/codedazur/toolkit/commit/ed9f7e62e0f1a53d34356963ac9bcfab77219b45) Thanks [@rickootes](https://github.com/rickootes)! - Correct typo in autoscaling configuration.
8
+
9
+ ## 0.9.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`315085a`](https://github.com/codedazur/toolkit/commit/315085a029c6f0f2f71b1a48ea223b0b78d316aa) Thanks [@thijsdaniels](https://github.com/thijsdaniels)! - The DockerCluster's site distribution attribute was renamed.
14
+
15
+ - Updated dependencies [[`315085a`](https://github.com/codedazur/toolkit/commit/315085a029c6f0f2f71b1a48ea223b0b78d316aa)]:
16
+ - @codedazur/cdk-site-distribution@0.5.3
17
+
3
18
  ## 0.9.5
4
19
 
5
20
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -29,7 +29,7 @@ interface SourceProps {
29
29
  /**
30
30
  * An Docker cluster on a load balanced Fargate service on EC2, using an image
31
31
  * built from a Dockerfile in a directory and pushed to ECR.
32
- * @todo Make the distribution and laod balancer optional, to reduce cost and
32
+ * @todo Make the distribution and load balancer optional, to reduce cost and
33
33
  * increase deployment speed for development environments.
34
34
  */
35
35
  declare class DockerCluster extends Construct {
@@ -37,11 +37,11 @@ declare class DockerCluster extends Construct {
37
37
  readonly domain?: string;
38
38
  readonly image: ContainerImage;
39
39
  readonly service: ApplicationLoadBalancedFargateService;
40
- readonly distribution: SiteDistribution;
40
+ readonly siteDistribution: SiteDistribution;
41
41
  constructor(scope: Construct, id: string, props: DockerClusterProps);
42
42
  protected createImage(source: string | SourceProps): aws_cdk_lib_aws_ecs.AssetImage;
43
43
  protected createService(): ApplicationLoadBalancedFargateService;
44
- protected createDistribution(): SiteDistribution;
44
+ protected createSiteDistribution(): SiteDistribution;
45
45
  protected getOutputDirectory(): string;
46
46
  }
47
47
 
package/dist/index.d.ts CHANGED
@@ -29,7 +29,7 @@ interface SourceProps {
29
29
  /**
30
30
  * An Docker cluster on a load balanced Fargate service on EC2, using an image
31
31
  * built from a Dockerfile in a directory and pushed to ECR.
32
- * @todo Make the distribution and laod balancer optional, to reduce cost and
32
+ * @todo Make the distribution and load balancer optional, to reduce cost and
33
33
  * increase deployment speed for development environments.
34
34
  */
35
35
  declare class DockerCluster extends Construct {
@@ -37,11 +37,11 @@ declare class DockerCluster extends Construct {
37
37
  readonly domain?: string;
38
38
  readonly image: ContainerImage;
39
39
  readonly service: ApplicationLoadBalancedFargateService;
40
- readonly distribution: SiteDistribution;
40
+ readonly siteDistribution: SiteDistribution;
41
41
  constructor(scope: Construct, id: string, props: DockerClusterProps);
42
42
  protected createImage(source: string | SourceProps): aws_cdk_lib_aws_ecs.AssetImage;
43
43
  protected createService(): ApplicationLoadBalancedFargateService;
44
- protected createDistribution(): SiteDistribution;
44
+ protected createSiteDistribution(): SiteDistribution;
45
45
  protected getOutputDirectory(): string;
46
46
  }
47
47
 
package/dist/index.js CHANGED
@@ -39,12 +39,14 @@ var DockerCluster = class extends import_constructs.Construct {
39
39
  this.props = props;
40
40
  this.image = this.props.source instanceof import_aws_ecs.ContainerImage ? this.props.source : this.createImage(this.props.source);
41
41
  this.service = this.createService();
42
- this.distribution = this.createDistribution();
42
+ this.siteDistribution = this.createSiteDistribution();
43
43
  }
44
44
  createImage(source) {
45
45
  const props = {
46
46
  exclude: [`**/${this.getOutputDirectory()}`],
47
47
  platform: import_aws_ecr_assets.Platform.LINUX_AMD64
48
+ // networkMode: NetworkMode.HOST, // @todo Use the host network mode.
49
+ // cacheFrom: [], // @todo Use the previously built image as a cache.
48
50
  };
49
51
  if (typeof source === "string") {
50
52
  return import_aws_ecs.ContainerImage.fromAsset(source, props);
@@ -76,14 +78,14 @@ var DockerCluster = class extends import_constructs.Construct {
76
78
  }
77
79
  });
78
80
  if (typeof ((_j = this.props.service) == null ? void 0 : _j.tasks) === "object") {
79
- this.service.service.autoScaleTaskCount({
81
+ service.service.autoScaleTaskCount({
80
82
  minCapacity: (_k = this.props.service) == null ? void 0 : _k.tasks.minimum,
81
83
  maxCapacity: (_l = this.props.service) == null ? void 0 : _l.tasks.maximum
82
84
  });
83
85
  }
84
86
  return service;
85
87
  }
86
- createDistribution() {
88
+ createSiteDistribution() {
87
89
  return new import_cdk_site_distribution.SiteDistribution(this, "Distribution", {
88
90
  allowedMethods: import_aws_cloudfront.AllowedMethods.ALLOW_ALL,
89
91
  cachePolicy: {
package/dist/index.mjs CHANGED
@@ -23,12 +23,14 @@ var DockerCluster = class extends Construct {
23
23
  this.props = props;
24
24
  this.image = this.props.source instanceof ContainerImage ? this.props.source : this.createImage(this.props.source);
25
25
  this.service = this.createService();
26
- this.distribution = this.createDistribution();
26
+ this.siteDistribution = this.createSiteDistribution();
27
27
  }
28
28
  createImage(source) {
29
29
  const props = {
30
30
  exclude: [`**/${this.getOutputDirectory()}`],
31
31
  platform: Platform.LINUX_AMD64
32
+ // networkMode: NetworkMode.HOST, // @todo Use the host network mode.
33
+ // cacheFrom: [], // @todo Use the previously built image as a cache.
32
34
  };
33
35
  if (typeof source === "string") {
34
36
  return ContainerImage.fromAsset(source, props);
@@ -60,14 +62,14 @@ var DockerCluster = class extends Construct {
60
62
  }
61
63
  });
62
64
  if (typeof ((_j = this.props.service) == null ? void 0 : _j.tasks) === "object") {
63
- this.service.service.autoScaleTaskCount({
65
+ service.service.autoScaleTaskCount({
64
66
  minCapacity: (_k = this.props.service) == null ? void 0 : _k.tasks.minimum,
65
67
  maxCapacity: (_l = this.props.service) == null ? void 0 : _l.tasks.maximum
66
68
  });
67
69
  }
68
70
  return service;
69
71
  }
70
- createDistribution() {
72
+ createSiteDistribution() {
71
73
  return new SiteDistribution(this, "Distribution", {
72
74
  allowedMethods: AllowedMethods.ALLOW_ALL,
73
75
  cachePolicy: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codedazur/cdk-docker-cluster",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "main": ".dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -27,7 +27,7 @@
27
27
  "constructs": ">=10"
28
28
  },
29
29
  "dependencies": {
30
- "@codedazur/cdk-site-distribution": "^0.5.2"
30
+ "@codedazur/cdk-site-distribution": "^0.5.3"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^20.14.10",