@gradientedge/cdk-utils 8.166.0 → 8.166.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.
@@ -131,7 +131,8 @@ class StaticSite extends common_1.CommonConstruct {
131
131
  * @summary Method to deploy the static assets into s3 bucket for static site
132
132
  */
133
133
  deploySite() {
134
- this.s3Manager.doBucketDeployment(`${this.id}-deployment`, this, this.siteBucket, this.siteDistribution, [this.props.siteSource], '', true);
134
+ const prune = this.props.pruneOnDeployment ?? true;
135
+ this.s3Manager.doBucketDeployment(`${this.id}-deployment`, this, this.siteBucket, this.siteDistribution, [this.props.siteSource], '', prune);
135
136
  }
136
137
  /**
137
138
  * Method to invalidation the cloudfront distribution cache after a deployment
@@ -20,5 +20,11 @@ export interface StaticSiteProps extends CommonStackProps {
20
20
  siteSource: ISource;
21
21
  siteSubDomain?: string;
22
22
  timezone: string;
23
+ /**
24
+ * Whether to prune the contents of the bucket when deploying assets.
25
+ *
26
+ * @default true
27
+ */
28
+ pruneOnDeployment?: boolean;
23
29
  useExistingHostedZone: boolean;
24
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "8.166.0",
3
+ "version": "8.166.1",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -192,6 +192,7 @@ export class StaticSite extends CommonConstruct {
192
192
  * @summary Method to deploy the static assets into s3 bucket for static site
193
193
  */
194
194
  protected deploySite() {
195
+ const prune = this.props.pruneOnDeployment ?? true
195
196
  this.s3Manager.doBucketDeployment(
196
197
  `${this.id}-deployment`,
197
198
  this,
@@ -199,7 +200,7 @@ export class StaticSite extends CommonConstruct {
199
200
  this.siteDistribution,
200
201
  [this.props.siteSource],
201
202
  '',
202
- true
203
+ prune
203
204
  )
204
205
  }
205
206
 
@@ -21,5 +21,11 @@ export interface StaticSiteProps extends CommonStackProps {
21
21
  siteSource: ISource
22
22
  siteSubDomain?: string
23
23
  timezone: string
24
+ /**
25
+ * Whether to prune the contents of the bucket when deploying assets.
26
+ *
27
+ * @default true
28
+ */
29
+ pruneOnDeployment?: boolean
24
30
  useExistingHostedZone: boolean
25
31
  }