@codedazur/cdk-docker-cluster 0.9.2 → 0.9.4

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,18 @@
1
1
  # @codedazur/cdk-docker-cluster
2
2
 
3
+ ## 0.9.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`55ddf9b`](https://github.com/codedazur/toolkit/commit/55ddf9b6d47be519a7ad7a932d20ec1526b5d1e2) Thanks [@thijsdaniels](https://github.com/thijsdaniels)! - THe default cache and origin request policies were simplified.
8
+
9
+ ## 0.9.3
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [[`ddef1e0`](https://github.com/codedazur/toolkit/commit/386a7c9615180fe642ea240ce7a90086d9a4b744)]:
14
+ - @codedazur/cdk-site-distribution@0.5.1
15
+
3
16
  ## 0.9.2
4
17
 
5
18
  ### Patch Changes
package/dist/index.js CHANGED
@@ -84,20 +84,29 @@ var DockerCluster = class extends import_constructs.Construct {
84
84
  return service;
85
85
  }
86
86
  createDistribution() {
87
- const cachePolicy = import_aws_cloudfront.CachePolicy.fromCachePolicyId(
88
- this,
89
- "CachePolicy",
90
- "4cc15a8a-d715-48a4-82b8-cc0b614638fe"
91
- );
92
- const originRequestPolicy = import_aws_cloudfront.OriginRequestPolicy.fromOriginRequestPolicyId(
93
- this,
94
- "OriginRequestPolicy",
95
- "216adef6-5c7f-47e4-b989-5492eafa07d3"
96
- );
97
87
  return new import_cdk_site_distribution.SiteDistribution(this, "Distribution", {
98
88
  allowedMethods: import_aws_cloudfront.AllowedMethods.ALLOW_ALL,
99
- cachePolicy,
100
- originRequestPolicy,
89
+ cachePolicy: {
90
+ /**
91
+ * The managed "UseOriginCacheControlHeaders-QueryStrings" cache policy,
92
+ * which is designed for use with an origin that sends Cache-Control
93
+ * headers with the object, which is recommended for use with an
94
+ * Application Load Balancer, and includes query strings in the cache
95
+ * key.
96
+ * @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html#managed-cache-policy-origin-cache-headers-query-strings
97
+ */
98
+ cachePolicyId: "4cc15a8a-d715-48a4-82b8-cc0b614638fe"
99
+ },
100
+ originRequestPolicy: {
101
+ /**
102
+ * The managed "AllViewer" origin request policy, which includes all
103
+ * values (query strings, headers, and cookies) in the viewer request,
104
+ * which is recommended for use with an Application Load Balancer
105
+ * endpoint.
106
+ * @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html#managed-origin-request-policy-all-viewer
107
+ */
108
+ originRequestPolicyId: "216adef6-5c7f-47e4-b989-5492eafa07d3"
109
+ },
101
110
  ...this.props.distribution,
102
111
  origin: new import_aws_cloudfront_origins.LoadBalancerV2Origin(this.service.loadBalancer, {
103
112
  protocolPolicy: import_aws_cloudfront.OriginProtocolPolicy.HTTP_ONLY
package/dist/index.mjs CHANGED
@@ -5,9 +5,7 @@ import {
5
5
  import { App } from "aws-cdk-lib";
6
6
  import {
7
7
  AllowedMethods,
8
- CachePolicy,
9
- OriginProtocolPolicy,
10
- OriginRequestPolicy
8
+ OriginProtocolPolicy
11
9
  } from "aws-cdk-lib/aws-cloudfront";
12
10
  import { LoadBalancerV2Origin } from "aws-cdk-lib/aws-cloudfront-origins";
13
11
  import { Platform } from "aws-cdk-lib/aws-ecr-assets";
@@ -70,20 +68,29 @@ var DockerCluster = class extends Construct {
70
68
  return service;
71
69
  }
72
70
  createDistribution() {
73
- const cachePolicy = CachePolicy.fromCachePolicyId(
74
- this,
75
- "CachePolicy",
76
- "4cc15a8a-d715-48a4-82b8-cc0b614638fe"
77
- );
78
- const originRequestPolicy = OriginRequestPolicy.fromOriginRequestPolicyId(
79
- this,
80
- "OriginRequestPolicy",
81
- "216adef6-5c7f-47e4-b989-5492eafa07d3"
82
- );
83
71
  return new SiteDistribution(this, "Distribution", {
84
72
  allowedMethods: AllowedMethods.ALLOW_ALL,
85
- cachePolicy,
86
- originRequestPolicy,
73
+ cachePolicy: {
74
+ /**
75
+ * The managed "UseOriginCacheControlHeaders-QueryStrings" cache policy,
76
+ * which is designed for use with an origin that sends Cache-Control
77
+ * headers with the object, which is recommended for use with an
78
+ * Application Load Balancer, and includes query strings in the cache
79
+ * key.
80
+ * @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html#managed-cache-policy-origin-cache-headers-query-strings
81
+ */
82
+ cachePolicyId: "4cc15a8a-d715-48a4-82b8-cc0b614638fe"
83
+ },
84
+ originRequestPolicy: {
85
+ /**
86
+ * The managed "AllViewer" origin request policy, which includes all
87
+ * values (query strings, headers, and cookies) in the viewer request,
88
+ * which is recommended for use with an Application Load Balancer
89
+ * endpoint.
90
+ * @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html#managed-origin-request-policy-all-viewer
91
+ */
92
+ originRequestPolicyId: "216adef6-5c7f-47e4-b989-5492eafa07d3"
93
+ },
87
94
  ...this.props.distribution,
88
95
  origin: new LoadBalancerV2Origin(this.service.loadBalancer, {
89
96
  protocolPolicy: OriginProtocolPolicy.HTTP_ONLY
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codedazur/cdk-docker-cluster",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
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.0"
30
+ "@codedazur/cdk-site-distribution": "^0.5.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^20.14.10",