dcl-ops-lib 9.9.0 → 9.9.2
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/buildStatic.js +15 -3
- package/package.json +1 -1
package/buildStatic.js
CHANGED
|
@@ -44,6 +44,11 @@ function buildStatic(staticSite) {
|
|
|
44
44
|
}
|
|
45
45
|
const contentBucket = new aws.s3.Bucket(slug + "contentBucket", bucketInfo, {
|
|
46
46
|
protect,
|
|
47
|
+
// buildStatic never sets the legacy bucket's inline `lifecycleRules`. Ignore that field
|
|
48
|
+
// so a standalone aws.s3.BucketLifecycleConfigurationV2 (defined by the consumer) can own
|
|
49
|
+
// the bucket lifecycle — otherwise this resource reads it back on refresh and deletes it,
|
|
50
|
+
// which flaps against the standalone resource on every `pulumi up`.
|
|
51
|
+
ignoreChanges: ["lifecycleRules"],
|
|
47
52
|
});
|
|
48
53
|
if (staticSite.objectOwnership) {
|
|
49
54
|
new aws.s3.BucketOwnershipControls(`${contentBucket.bucket}OwnershipControls`, {
|
|
@@ -60,6 +65,9 @@ function buildStatic(staticSite) {
|
|
|
60
65
|
tags: logsBucketTags,
|
|
61
66
|
}, {
|
|
62
67
|
protect,
|
|
68
|
+
// See contentBucket: ignore the legacy inline lifecycleRules so a standalone
|
|
69
|
+
// lifecycle resource can own it without flapping.
|
|
70
|
+
ignoreChanges: ["lifecycleRules"],
|
|
63
71
|
});
|
|
64
72
|
const distributionArgs = {
|
|
65
73
|
enabled: true,
|
|
@@ -97,9 +105,13 @@ function buildStatic(staticSite) {
|
|
|
97
105
|
},
|
|
98
106
|
cachePolicyId: staticSite.cachePolicyId,
|
|
99
107
|
responseHeadersPolicyId: staticSite.responseHeadersPolicyId,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
108
|
+
// Only set the legacy inline TTLs when there is no cache policy. When a
|
|
109
|
+
// cachePolicyId is provided the policy governs TTLs and CloudFront ignores
|
|
110
|
+
// these, so setting them produces a permanent no-op diff (0 => 600 / 0 => aYear)
|
|
111
|
+
// on every preview. Mirrors the forwardedValues handling above.
|
|
112
|
+
minTtl: staticSite.cachePolicyId ? undefined : 0,
|
|
113
|
+
defaultTtl: staticSite.cachePolicyId ? undefined : tenMinutes,
|
|
114
|
+
maxTtl: staticSite.cachePolicyId ? undefined : aYear,
|
|
103
115
|
compress: true,
|
|
104
116
|
},
|
|
105
117
|
// "All" is the most broad distribution, and also the most expensive.
|