@gradientedge/cdk-utils 8.166.0 → 9.0.0
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/dist/src/lib/aws/construct/api-to-any-target/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/api-to-eventbridge-target/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/api-to-eventbridge-target-with-sns/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/api-to-lambda-target/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/event-handler/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/piped-event-handler/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/rest-api-lambda/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/rest-api-lambda-with-cache/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/site-with-ecs-backend/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/site-with-lambda-backend/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/static-site/main.d.ts +1 -1
- package/dist/src/lib/aws/construct/static-site/main.js +2 -1
- package/dist/src/lib/aws/construct/static-site/types.d.ts +6 -0
- package/package.json +1 -1
- package/src/lib/aws/construct/api-to-any-target/main.ts +1 -1
- package/src/lib/aws/construct/api-to-eventbridge-target/main.ts +1 -1
- package/src/lib/aws/construct/api-to-eventbridge-target-with-sns/main.ts +1 -1
- package/src/lib/aws/construct/api-to-lambda-target/main.ts +1 -1
- package/src/lib/aws/construct/application-configuration/main.ts +1 -1
- package/src/lib/aws/construct/event-handler/main.ts +1 -1
- package/src/lib/aws/construct/piped-event-handler/main.ts +1 -1
- package/src/lib/aws/construct/rest-api-lambda/main.ts +1 -1
- package/src/lib/aws/construct/rest-api-lambda-with-cache/main.ts +1 -1
- package/src/lib/aws/construct/site-with-ecs-backend/main.ts +1 -1
- package/src/lib/aws/construct/site-with-lambda-backend/main.ts +1 -1
- package/src/lib/aws/construct/static-site/main.ts +3 -2
- package/src/lib/aws/construct/static-site/types.ts +6 -0
|
@@ -25,7 +25,7 @@ export declare class ApiToAnyTarget extends CommonConstruct {
|
|
|
25
25
|
apiToAnyTargetRestApi: ApiToAnyTargetRestApiType;
|
|
26
26
|
apiResource: string;
|
|
27
27
|
constructor(parent: Construct, id: string, props: ApiToAnyTargetProps);
|
|
28
|
-
|
|
28
|
+
initResources(): void;
|
|
29
29
|
/**
|
|
30
30
|
* @summary Method to resolve secrets from SecretsManager
|
|
31
31
|
* - To be implemented in the overriding method in the implementation class
|
|
@@ -27,7 +27,7 @@ export declare class ApiToEventBridgeTarget extends CommonConstruct {
|
|
|
27
27
|
apiToEventBridgeTargetRestApi: ApiToEventBridgeTargetRestApiType;
|
|
28
28
|
apiResource: string;
|
|
29
29
|
constructor(parent: Construct, id: string, props: ApiToEventBridgeTargetProps);
|
|
30
|
-
|
|
30
|
+
initResources(): void;
|
|
31
31
|
/**
|
|
32
32
|
* @summary Method to resolve secrets from SecretsManager
|
|
33
33
|
* - To be implemented in the overriding method in the implementation class
|
|
@@ -30,7 +30,7 @@ export declare class ApiToEventBridgeTargetWithSns extends CommonConstruct {
|
|
|
30
30
|
apiDestinedRestApi: ApiToEventBridgeTargetRestApiType;
|
|
31
31
|
apiResource: string;
|
|
32
32
|
constructor(parent: Construct, id: string, props: ApiToEventBridgeTargetProps);
|
|
33
|
-
|
|
33
|
+
initResources(): void;
|
|
34
34
|
/**
|
|
35
35
|
* @summary Method to resolve secrets from SecretsManager
|
|
36
36
|
* - To be implemented in the overriding method in the implementation class
|
|
@@ -11,7 +11,7 @@ export declare class ApiToLambdaTarget extends CommonConstruct {
|
|
|
11
11
|
apiToLambdaTargetRestApi: ApiToLambdaTargetRestApiType;
|
|
12
12
|
apiResource: string;
|
|
13
13
|
constructor(parent: Construct, id: string, props: ApiToLambdaTargetProps);
|
|
14
|
-
|
|
14
|
+
initResources(): void;
|
|
15
15
|
/**
|
|
16
16
|
* @summary Method to resolve secrets from SecretsManager
|
|
17
17
|
* - To be implemented in the overriding method in the implementation class
|
|
@@ -27,7 +27,7 @@ export declare class EventHandler extends CommonConstruct {
|
|
|
27
27
|
useMapState: boolean;
|
|
28
28
|
vpc: IVpc;
|
|
29
29
|
constructor(parent: Construct, id: string, props: EventHandlerProps);
|
|
30
|
-
|
|
30
|
+
initResources(): void;
|
|
31
31
|
/**
|
|
32
32
|
* @summary Method to resolve common vpc or create a new one.
|
|
33
33
|
*/
|
|
@@ -22,7 +22,7 @@ export declare class PipedEventHandler extends EventHandler {
|
|
|
22
22
|
pipedDlq: IQueue;
|
|
23
23
|
pipedQueue: IQueue;
|
|
24
24
|
protected constructor(parent: Construct, id: string, props: PipedEventHandlerProps);
|
|
25
|
-
|
|
25
|
+
initResources(): void;
|
|
26
26
|
/**
|
|
27
27
|
* @summary Method to create the piped queue and dlq.
|
|
28
28
|
*/
|
|
@@ -42,7 +42,7 @@ export declare abstract class RestApiLambda extends CommonConstruct {
|
|
|
42
42
|
/**
|
|
43
43
|
* @summary Initialise and provision resources
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
initResources(): void;
|
|
46
46
|
/**
|
|
47
47
|
* @summary Method to resolve secrets from SecretsManager
|
|
48
48
|
* - To be implemented in the overriding method in the implementation class
|
|
@@ -28,7 +28,7 @@ export declare abstract class RestApiLambdaWithCache extends RestApiLambda {
|
|
|
28
28
|
restApiSecurityGroup: ISecurityGroup;
|
|
29
29
|
restApiSecurityGroupExportName: string;
|
|
30
30
|
protected constructor(parent: Construct, id: string, props: RestApiLambdaWithCacheProps);
|
|
31
|
-
|
|
31
|
+
initResources(): void;
|
|
32
32
|
/**
|
|
33
33
|
* Create VPC
|
|
34
34
|
*/
|
|
@@ -65,7 +65,7 @@ export declare class SiteWithEcsBackend extends CommonConstruct {
|
|
|
65
65
|
/**
|
|
66
66
|
* @summary Initialise and provision resources
|
|
67
67
|
*/
|
|
68
|
-
|
|
68
|
+
initResources(): void;
|
|
69
69
|
/**
|
|
70
70
|
* @summary Method to resolve a hosted zone based on domain attributes
|
|
71
71
|
*/
|
|
@@ -54,7 +54,7 @@ export declare class SiteWithLambdaBackend extends CommonConstruct {
|
|
|
54
54
|
/**
|
|
55
55
|
* @summary Initialise and provision resources
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
initResources(): void;
|
|
58
58
|
/**
|
|
59
59
|
* @summary Method to resolve a hosted zone based on domain attributes
|
|
60
60
|
*/
|
|
@@ -38,7 +38,7 @@ export declare class StaticSite extends CommonConstruct {
|
|
|
38
38
|
/**
|
|
39
39
|
* @summary Initialise and provision resources
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
initResources(): void;
|
|
42
42
|
/**
|
|
43
43
|
* @summary Method to resolve a hosted zone based on domain attributes
|
|
44
44
|
*/
|
|
@@ -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
|
-
|
|
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
|
@@ -36,7 +36,7 @@ export class ApiToLambdaTarget extends CommonConstruct {
|
|
|
36
36
|
this.apiToLambdaTargetRestApi = new ApiToLambdaTargetRestApi()
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
public initResources() {
|
|
40
40
|
this.resolveSecrets()
|
|
41
41
|
this.resolveHostedZone()
|
|
42
42
|
this.resolveCertificate()
|
|
@@ -33,7 +33,7 @@ export class PipedEventHandler extends EventHandler {
|
|
|
33
33
|
this.provisionTarget = false
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
public initResources() {
|
|
37
37
|
this.createPipedQueue()
|
|
38
38
|
this.handler.sqsTargets = [new SqsQueue(this.pipedQueue)]
|
|
39
39
|
super.initResources()
|
|
@@ -54,7 +54,7 @@ export abstract class RestApiLambda extends CommonConstruct {
|
|
|
54
54
|
/**
|
|
55
55
|
* @summary Initialise and provision resources
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
public initResources() {
|
|
58
58
|
this.resolveSecrets()
|
|
59
59
|
this.resolveHostedZone()
|
|
60
60
|
this.resolveCertificate()
|
|
@@ -97,7 +97,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
|
|
|
97
97
|
/**
|
|
98
98
|
* @summary Initialise and provision resources
|
|
99
99
|
*/
|
|
100
|
-
|
|
100
|
+
public initResources() {
|
|
101
101
|
this.resolveHostedZone()
|
|
102
102
|
this.resolveCertificate()
|
|
103
103
|
this.resolveSiteSecrets()
|
|
@@ -80,7 +80,7 @@ export class SiteWithLambdaBackend extends CommonConstruct {
|
|
|
80
80
|
/**
|
|
81
81
|
* @summary Initialise and provision resources
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
public initResources() {
|
|
84
84
|
this.resolveHostedZone()
|
|
85
85
|
this.resolveCertificate()
|
|
86
86
|
this.resolveSiteSecrets()
|
|
@@ -55,7 +55,7 @@ export class StaticSite extends CommonConstruct {
|
|
|
55
55
|
/**
|
|
56
56
|
* @summary Initialise and provision resources
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
public initResources() {
|
|
59
59
|
this.resolveHostedZone()
|
|
60
60
|
this.resolveCertificate()
|
|
61
61
|
this.createSiteLogBucket()
|
|
@@ -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
|
-
|
|
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
|
}
|