@gradientedge/cdk-utils 6.3.0 → 6.3.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.
@@ -31,7 +31,6 @@ export declare class StaticSite extends CommonConstruct {
31
31
  siteHostedZone: route53.IHostedZone;
32
32
  siteCertificate: certificateManager.ICertificate;
33
33
  siteARecord: route53.ARecord;
34
- siteARecordAlt: route53.ARecord;
35
34
  siteBucket: s3.IBucket;
36
35
  siteOrigin: origins.S3Origin;
37
36
  siteDistribution: cloudfront.Distribution;
@@ -81,11 +80,6 @@ export declare class StaticSite extends CommonConstruct {
81
80
  * @protected
82
81
  */
83
82
  protected createSiteDistribution(): void;
84
- /**
85
- * Method to invalidation the cloudfront distribution cache after a deployment
86
- * @protected
87
- */
88
- protected invalidateDistributionCache(): void;
89
83
  /**
90
84
  * @summary Method to create route53 records for static site
91
85
  * @protected
@@ -96,4 +90,9 @@ export declare class StaticSite extends CommonConstruct {
96
90
  * @protected
97
91
  */
98
92
  protected deploySite(): void;
93
+ /**
94
+ * Method to invalidation the cloudfront distribution cache after a deployment
95
+ * @protected
96
+ */
97
+ protected invalidateDistributionCache(): void;
99
98
  }
@@ -54,7 +54,6 @@ class StaticSite extends common_1.CommonConstruct {
54
54
  siteHostedZone;
55
55
  siteCertificate;
56
56
  siteARecord;
57
- siteARecordAlt;
58
57
  siteBucket;
59
58
  siteOrigin;
60
59
  siteDistribution;
@@ -80,9 +79,9 @@ class StaticSite extends common_1.CommonConstruct {
80
79
  this.createSiteCloudfrontFunction();
81
80
  this.resolveSiteFunctionAssociations();
82
81
  this.createSiteDistribution();
83
- this.invalidateDistributionCache();
84
82
  this.createSiteRouteAssets();
85
83
  this.deploySite();
84
+ this.invalidateDistributionCache();
86
85
  }
87
86
  /**
88
87
  * @summary Method to resolve a hosted zone based on domain attributes
@@ -152,15 +151,6 @@ class StaticSite extends common_1.CommonConstruct {
152
151
  throw 'SiteDistribution props undefined';
153
152
  this.siteDistribution = this.cloudFrontManager.createDistributionWithS3Origin(`${this.id}-distribution`, this, this.props.siteDistribution, this.siteOrigin, this.siteBucket, this.siteLogBucket, this.siteOriginAccessIdentity, this.siteCertificate, this.props.siteAliases, this.siteFunctionAssociations);
154
153
  }
155
- /**
156
- * Method to invalidation the cloudfront distribution cache after a deployment
157
- * @protected
158
- */
159
- invalidateDistributionCache() {
160
- if (this.props.siteCacheInvalidationDockerFilePath) {
161
- this.cloudFrontManager.invalidateCache(`${this.id}-cache-invalidation`, this, this.props.siteCacheInvalidationDockerFilePath, this.siteDistribution.distributionId);
162
- }
163
- }
164
154
  /**
165
155
  * @summary Method to create route53 records for static site
166
156
  * @protected
@@ -175,5 +165,14 @@ class StaticSite extends common_1.CommonConstruct {
175
165
  deploySite() {
176
166
  this.s3Manager.doBucketDeployment(`${this.id}-deployment`, this, this.siteBucket, this.siteDistribution, [this.props.siteSource], '', true);
177
167
  }
168
+ /**
169
+ * Method to invalidation the cloudfront distribution cache after a deployment
170
+ * @protected
171
+ */
172
+ invalidateDistributionCache() {
173
+ if (this.props.siteCacheInvalidationDockerFilePath) {
174
+ this.cloudFrontManager.invalidateCache(`${this.id}-cache-invalidation`, this, this.props.siteCacheInvalidationDockerFilePath, this.siteDistribution.distributionId);
175
+ }
176
+ }
178
177
  }
179
178
  exports.StaticSite = StaticSite;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "6.3.0",
3
+ "version": "6.3.1",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -35,7 +35,6 @@ export class StaticSite extends CommonConstruct {
35
35
  siteHostedZone: route53.IHostedZone
36
36
  siteCertificate: certificateManager.ICertificate
37
37
  siteARecord: route53.ARecord
38
- siteARecordAlt: route53.ARecord
39
38
  siteBucket: s3.IBucket
40
39
  siteOrigin: origins.S3Origin
41
40
  siteDistribution: cloudfront.Distribution
@@ -64,9 +63,9 @@ export class StaticSite extends CommonConstruct {
64
63
  this.createSiteCloudfrontFunction()
65
64
  this.resolveSiteFunctionAssociations()
66
65
  this.createSiteDistribution()
67
- this.invalidateDistributionCache()
68
66
  this.createSiteRouteAssets()
69
67
  this.deploySite()
68
+ this.invalidateDistributionCache()
70
69
  }
71
70
 
72
71
  /**
@@ -175,21 +174,6 @@ export class StaticSite extends CommonConstruct {
175
174
  )
176
175
  }
177
176
 
178
- /**
179
- * Method to invalidation the cloudfront distribution cache after a deployment
180
- * @protected
181
- */
182
- protected invalidateDistributionCache() {
183
- if (this.props.siteCacheInvalidationDockerFilePath) {
184
- this.cloudFrontManager.invalidateCache(
185
- `${this.id}-cache-invalidation`,
186
- this,
187
- this.props.siteCacheInvalidationDockerFilePath,
188
- this.siteDistribution.distributionId
189
- )
190
- }
191
- }
192
-
193
177
  /**
194
178
  * @summary Method to create route53 records for static site
195
179
  * @protected
@@ -220,4 +204,19 @@ export class StaticSite extends CommonConstruct {
220
204
  true
221
205
  )
222
206
  }
207
+
208
+ /**
209
+ * Method to invalidation the cloudfront distribution cache after a deployment
210
+ * @protected
211
+ */
212
+ protected invalidateDistributionCache() {
213
+ if (this.props.siteCacheInvalidationDockerFilePath) {
214
+ this.cloudFrontManager.invalidateCache(
215
+ `${this.id}-cache-invalidation`,
216
+ this,
217
+ this.props.siteCacheInvalidationDockerFilePath,
218
+ this.siteDistribution.distributionId
219
+ )
220
+ }
221
+ }
223
222
  }