@gradientedge/cdk-utils 8.118.0 → 8.119.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.
Files changed (148) hide show
  1. package/app/api-destined-function/package.json +1 -1
  2. package/dist/src/lib/common/construct.d.ts +32 -32
  3. package/dist/src/lib/common/construct.js +36 -59
  4. package/dist/src/lib/common/stack.d.ts +8 -7
  5. package/dist/src/lib/common/stack.js +17 -37
  6. package/dist/src/lib/common/types.d.ts +2 -2
  7. package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +22 -22
  8. package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +9 -9
  9. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +3 -3
  10. package/dist/src/lib/construct/api-to-eventbridge-target/main.js +37 -60
  11. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +9 -9
  12. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +3 -3
  13. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +40 -63
  14. package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +23 -23
  15. package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +2 -2
  16. package/dist/src/lib/construct/api-to-lambda-target/main.js +15 -38
  17. package/dist/src/lib/construct/application-configuration/main.d.ts +7 -7
  18. package/dist/src/lib/construct/application-configuration/main.js +17 -41
  19. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +17 -17
  20. package/dist/src/lib/construct/graphql-api-lambda/main.js +6 -29
  21. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +5 -5
  22. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +7 -7
  23. package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +16 -16
  24. package/dist/src/lib/construct/lambda-with-iam-access/main.js +8 -31
  25. package/dist/src/lib/construct/lambda-with-iam-access/types.d.ts +4 -4
  26. package/dist/src/lib/construct/rest-api-lambda/main.d.ts +16 -16
  27. package/dist/src/lib/construct/rest-api-lambda/main.js +5 -28
  28. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +5 -5
  29. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +9 -32
  30. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +38 -39
  31. package/dist/src/lib/construct/site-with-ecs-backend/main.js +33 -54
  32. package/dist/src/lib/construct/static-asset-deployment/main.d.ts +4 -4
  33. package/dist/src/lib/construct/static-asset-deployment/main.js +3 -26
  34. package/dist/src/lib/construct/static-site/main.d.ts +15 -15
  35. package/dist/src/lib/construct/static-site/main.js +4 -27
  36. package/dist/src/lib/services/aws/api-gateway/main.d.ts +10 -10
  37. package/dist/src/lib/services/aws/api-gateway/main.js +21 -44
  38. package/dist/src/lib/services/aws/api-gateway/types.d.ts +2 -2
  39. package/dist/src/lib/services/aws/appconfig/main.d.ts +7 -7
  40. package/dist/src/lib/services/aws/appconfig/main.js +14 -37
  41. package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -5
  42. package/dist/src/lib/services/aws/certificate-manager/main.js +10 -33
  43. package/dist/src/lib/services/aws/certificate-manager/types.d.ts +2 -2
  44. package/dist/src/lib/services/aws/cloudfront/main.d.ts +18 -18
  45. package/dist/src/lib/services/aws/cloudfront/main.js +46 -45
  46. package/dist/src/lib/services/aws/cloudfront/types.d.ts +2 -3
  47. package/dist/src/lib/services/aws/cloudtrail/main.d.ts +5 -5
  48. package/dist/src/lib/services/aws/cloudtrail/main.js +5 -28
  49. package/dist/src/lib/services/aws/codebuild/main.d.ts +3 -3
  50. package/dist/src/lib/services/aws/codebuild/main.js +7 -30
  51. package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -3
  52. package/dist/src/lib/services/aws/dynamodb/main.js +8 -31
  53. package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +2 -2
  54. package/dist/src/lib/services/aws/elastic-container-registry/main.js +4 -27
  55. package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +10 -10
  56. package/dist/src/lib/services/aws/elastic-container-service/main.js +27 -50
  57. package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +4 -4
  58. package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +3 -3
  59. package/dist/src/lib/services/aws/elastic-file-system/main.js +12 -35
  60. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +4 -4
  61. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -31
  62. package/dist/src/lib/services/aws/elasticache/main.d.ts +4 -4
  63. package/dist/src/lib/services/aws/elasticache/main.js +10 -33
  64. package/dist/src/lib/services/aws/eventbridge/main.d.ts +13 -13
  65. package/dist/src/lib/services/aws/eventbridge/main.js +26 -49
  66. package/dist/src/lib/services/aws/eventbridge/target.d.ts +10 -10
  67. package/dist/src/lib/services/aws/eventbridge/target.js +6 -29
  68. package/dist/src/lib/services/aws/evidently/main.d.ts +7 -7
  69. package/dist/src/lib/services/aws/evidently/main.js +18 -41
  70. package/dist/src/lib/services/aws/identity-access-management/main.d.ts +48 -49
  71. package/dist/src/lib/services/aws/identity-access-management/main.js +110 -133
  72. package/dist/src/lib/services/aws/key-management-service/main.d.ts +2 -2
  73. package/dist/src/lib/services/aws/key-management-service/main.js +5 -28
  74. package/dist/src/lib/services/aws/lambda/main.d.ts +11 -13
  75. package/dist/src/lib/services/aws/lambda/main.js +31 -58
  76. package/dist/src/lib/services/aws/route53/main.d.ts +9 -9
  77. package/dist/src/lib/services/aws/route53/main.js +21 -44
  78. package/dist/src/lib/services/aws/secrets-manager/main.d.ts +5 -6
  79. package/dist/src/lib/services/aws/secrets-manager/main.js +10 -33
  80. package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +4 -4
  81. package/dist/src/lib/services/aws/simple-notification-service/main.js +11 -34
  82. package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +6 -7
  83. package/dist/src/lib/services/aws/simple-queue-service/main.js +15 -38
  84. package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +10 -11
  85. package/dist/src/lib/services/aws/simple-storage-service/main.js +31 -54
  86. package/dist/src/lib/services/aws/step-function/main.d.ts +31 -32
  87. package/dist/src/lib/services/aws/step-function/main.js +33 -57
  88. package/dist/src/lib/services/aws/systems-manager/main.d.ts +4 -4
  89. package/dist/src/lib/services/aws/systems-manager/main.js +10 -33
  90. package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +5 -6
  91. package/dist/src/lib/services/aws/virtual-private-cloud/main.js +14 -37
  92. package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +3 -3
  93. package/dist/src/lib/services/aws/web-application-firewall/main.js +8 -31
  94. package/dist/src/lib/utils/aws/index.d.ts +6 -3
  95. package/dist/src/lib/utils/aws/index.js +9 -26
  96. package/package.json +15 -15
  97. package/src/lib/common/construct.ts +97 -67
  98. package/src/lib/common/stack.ts +12 -12
  99. package/src/lib/common/types.ts +2 -2
  100. package/src/lib/construct/api-to-eventbridge-target/api.ts +31 -22
  101. package/src/lib/construct/api-to-eventbridge-target/event.ts +9 -9
  102. package/src/lib/construct/api-to-eventbridge-target/main.ts +56 -41
  103. package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +9 -9
  104. package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +62 -47
  105. package/src/lib/construct/api-to-lambda-target/api.ts +33 -23
  106. package/src/lib/construct/api-to-lambda-target/main.ts +24 -18
  107. package/src/lib/construct/application-configuration/main.ts +31 -24
  108. package/src/lib/construct/graphql-api-lambda/main.ts +22 -22
  109. package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +13 -13
  110. package/src/lib/construct/lambda-with-iam-access/main.ts +25 -25
  111. package/src/lib/construct/lambda-with-iam-access/types.ts +4 -4
  112. package/src/lib/construct/rest-api-lambda/main.ts +21 -21
  113. package/src/lib/construct/rest-api-lambda-with-cache/main.ts +14 -14
  114. package/src/lib/construct/site-with-ecs-backend/main.ts +79 -60
  115. package/src/lib/construct/static-asset-deployment/main.ts +6 -6
  116. package/src/lib/construct/static-site/main.ts +23 -17
  117. package/src/lib/services/aws/api-gateway/main.ts +42 -36
  118. package/src/lib/services/aws/api-gateway/types.ts +2 -2
  119. package/src/lib/services/aws/appconfig/main.ts +19 -19
  120. package/src/lib/services/aws/certificate-manager/main.ts +14 -14
  121. package/src/lib/services/aws/certificate-manager/types.ts +2 -2
  122. package/src/lib/services/aws/cloudfront/main.ts +88 -74
  123. package/src/lib/services/aws/cloudfront/types.ts +6 -3
  124. package/src/lib/services/aws/cloudtrail/main.ts +11 -11
  125. package/src/lib/services/aws/codebuild/main.ts +7 -7
  126. package/src/lib/services/aws/dynamodb/main.ts +8 -8
  127. package/src/lib/services/aws/elastic-container-registry/main.ts +4 -4
  128. package/src/lib/services/aws/elastic-container-service/main.ts +48 -37
  129. package/src/lib/services/aws/elastic-container-service/types.ts +4 -4
  130. package/src/lib/services/aws/elastic-file-system/main.ts +16 -16
  131. package/src/lib/services/aws/elastic-kubernetes-service/main.ts +11 -11
  132. package/src/lib/services/aws/elasticache/main.ts +10 -10
  133. package/src/lib/services/aws/eventbridge/main.ts +37 -37
  134. package/src/lib/services/aws/eventbridge/target.ts +14 -14
  135. package/src/lib/services/aws/evidently/main.ts +18 -18
  136. package/src/lib/services/aws/identity-access-management/main.ts +142 -134
  137. package/src/lib/services/aws/key-management-service/main.ts +5 -5
  138. package/src/lib/services/aws/lambda/main.ts +65 -59
  139. package/src/lib/services/aws/route53/main.ts +31 -31
  140. package/src/lib/services/aws/secrets-manager/main.ts +11 -15
  141. package/src/lib/services/aws/simple-notification-service/main.ts +13 -13
  142. package/src/lib/services/aws/simple-queue-service/main.ts +18 -18
  143. package/src/lib/services/aws/simple-storage-service/main.ts +40 -40
  144. package/src/lib/services/aws/step-function/main.ts +77 -65
  145. package/src/lib/services/aws/systems-manager/main.ts +17 -12
  146. package/src/lib/services/aws/virtual-private-cloud/main.ts +16 -16
  147. package/src/lib/services/aws/web-application-firewall/main.ts +8 -8
  148. package/src/lib/utils/aws/index.ts +8 -5
@@ -1,31 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.RestApiLambda = void 0;
27
- const apig = __importStar(require("aws-cdk-lib/aws-apigateway"));
28
- const iam = __importStar(require("aws-cdk-lib/aws-iam"));
4
+ const aws_apigateway_1 = require("aws-cdk-lib/aws-apigateway");
5
+ const aws_iam_1 = require("aws-cdk-lib/aws-iam");
29
6
  const common_1 = require("../../common");
30
7
  /**
31
8
  * @classdesc Provides a construct to create and deploy a RestApi as Lambda
@@ -112,7 +89,7 @@ class RestApiLambda extends common_1.CommonConstruct {
112
89
  * @summary Method to create iam policy for RestApi Lambda function
113
90
  */
114
91
  createLambdaPolicy() {
115
- this.restApiLambdaPolicy = new iam.PolicyDocument({
92
+ this.restApiLambdaPolicy = new aws_iam_1.PolicyDocument({
116
93
  statements: [this.iamManager.statementForCreateAnyLogStream()],
117
94
  });
118
95
  }
@@ -171,7 +148,7 @@ class RestApiLambda extends common_1.CommonConstruct {
171
148
  const apiRootPaths = this.props.apiRootPaths;
172
149
  if (apiRootPaths && apiRootPaths.length > 0) {
173
150
  apiRootPaths.forEach((apiRootPath) => {
174
- this.restApiBasePathMappings.push(new apig.BasePathMapping(this, `${this.id}-base-bath-mapping-${apiRootPath}`, {
151
+ this.restApiBasePathMappings.push(new aws_apigateway_1.BasePathMapping(this, `${this.id}-base-bath-mapping-${apiRootPath}`, {
175
152
  basePath: apiRootPath,
176
153
  domainName: this.restApiDomain,
177
154
  restApi: this.restApi,
@@ -181,7 +158,7 @@ class RestApiLambda extends common_1.CommonConstruct {
181
158
  return;
182
159
  }
183
160
  // add default mapping if apiRootPaths not set
184
- new apig.BasePathMapping(this, `${this.id}-base-bath-mapping`, {
161
+ new aws_apigateway_1.BasePathMapping(this, `${this.id}-base-bath-mapping`, {
185
162
  domainName: this.restApiDomain,
186
163
  restApi: this.restApi,
187
164
  stage: this.restApi.deploymentStage,
@@ -1,5 +1,5 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- import * as elasticache from 'aws-cdk-lib/aws-elasticache';
1
+ import { ISecurityGroup, IVpc } from 'aws-cdk-lib/aws-ec2';
2
+ import { CfnReplicationGroup } from 'aws-cdk-lib/aws-elasticache';
3
3
  import { Construct } from 'constructs';
4
4
  import { RestApiLambda } from '..';
5
5
  import { RestApiLambdaWithCacheProps } from './types';
@@ -23,9 +23,9 @@ import { RestApiLambdaWithCacheProps } from './types';
23
23
  export declare abstract class RestApiLambdaWithCache extends RestApiLambda {
24
24
  props: RestApiLambdaWithCacheProps;
25
25
  id: string;
26
- restApivpc: ec2.IVpc;
27
- restApiCache: elasticache.CfnReplicationGroup;
28
- restApiSecurityGroup: ec2.ISecurityGroup;
26
+ restApivpc: IVpc;
27
+ restApiCache: CfnReplicationGroup;
28
+ restApiSecurityGroup: ISecurityGroup;
29
29
  restApiSecurityGroupExportName: string;
30
30
  protected constructor(parent: Construct, id: string, props: RestApiLambdaWithCacheProps);
31
31
  protected initResources(): void;
@@ -1,34 +1,11 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.RestApiLambdaWithCache = void 0;
27
- const cdk = __importStar(require("aws-cdk-lib"));
28
- const ec2 = __importStar(require("aws-cdk-lib/aws-ec2"));
29
- const iam = __importStar(require("aws-cdk-lib/aws-iam"));
4
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
5
+ const aws_ec2_1 = require("aws-cdk-lib/aws-ec2");
6
+ const aws_iam_1 = require("aws-cdk-lib/aws-iam");
30
7
  const __1 = require("..");
31
- const utils = __importStar(require("../../utils"));
8
+ const utils_1 = require("../../utils");
32
9
  /**
33
10
  * @classdesc Provides a construct to create and deploy a RestApi API as Lambda with Caching
34
11
  *
@@ -82,15 +59,15 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
82
59
  */
83
60
  resolveSecurityGroup() {
84
61
  if (this.props.securityGroupExportName) {
85
- this.restApiSecurityGroup = ec2.SecurityGroup.fromSecurityGroupId(this, `${this.id}-security-group`, cdk.Fn.importValue(this.props.securityGroupExportName));
62
+ this.restApiSecurityGroup = aws_ec2_1.SecurityGroup.fromSecurityGroupId(this, `${this.id}-security-group`, aws_cdk_lib_1.Fn.importValue(this.props.securityGroupExportName));
86
63
  }
87
64
  else {
88
- this.restApiSecurityGroup = new ec2.SecurityGroup(this, `${this.id}-security-group-${this.props.stage}`, {
65
+ this.restApiSecurityGroup = new aws_ec2_1.SecurityGroup(this, `${this.id}-security-group-${this.props.stage}`, {
89
66
  securityGroupName: `${this.id}-security-group-${this.props.stage}`,
90
67
  vpc: this.restApivpc,
91
68
  });
92
- this.restApiSecurityGroup.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.allTraffic(), 'All Traffic');
93
- utils.createCfnOutput(`${this.id}-security-group-id`, this, this.restApiSecurityGroup.securityGroupId);
69
+ this.restApiSecurityGroup.addIngressRule(aws_ec2_1.Peer.anyIpv4(), aws_ec2_1.Port.allTraffic(), 'All Traffic');
70
+ (0, utils_1.createCfnOutput)(`${this.id}-security-group-id`, this, this.restApiSecurityGroup.securityGroupId);
94
71
  }
95
72
  }
96
73
  /**
@@ -117,7 +94,7 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
117
94
  */
118
95
  createLambdaRole() {
119
96
  super.createLambdaRole();
120
- this.restApiLambdaRole.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSLambdaVPCAccessExecutionRole'));
97
+ this.restApiLambdaRole.addManagedPolicy(aws_iam_1.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSLambdaVPCAccessExecutionRole'));
121
98
  }
122
99
  /**
123
100
  * @summary Method to create environment variables for RestApi Lambda function
@@ -1,18 +1,17 @@
1
- import * as cdk from 'aws-cdk-lib';
2
- import * as certificateManager from 'aws-cdk-lib/aws-certificatemanager';
3
- import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
4
- import * as origins from 'aws-cdk-lib/aws-cloudfront-origins';
5
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
6
- import * as ecs from 'aws-cdk-lib/aws-ecs';
7
- import * as elb from 'aws-cdk-lib/aws-elasticloadbalancingv2';
8
- import * as iam from 'aws-cdk-lib/aws-iam';
9
- import * as logs from 'aws-cdk-lib/aws-logs';
10
- import * as route53 from 'aws-cdk-lib/aws-route53';
11
- import * as s3 from 'aws-cdk-lib/aws-s3';
12
- import * as efs from 'aws-cdk-lib/aws-efs';
1
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
2
+ import { CachePolicy, Distribution, FunctionAssociation, IFunction, OriginRequestPolicy, ResponseHeadersPolicy } from 'aws-cdk-lib/aws-cloudfront';
3
+ import { HttpOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
4
+ import { IVpc } from 'aws-cdk-lib/aws-ec2';
5
+ import { AssetImage, Cluster, FargateService, FargateTaskDefinition } from 'aws-cdk-lib/aws-ecs';
6
+ import { FileSystem } from 'aws-cdk-lib/aws-efs';
7
+ import { ApplicationListener, ApplicationLoadBalancer, ApplicationTargetGroup } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
8
+ import { PolicyDocument, Role } from 'aws-cdk-lib/aws-iam';
9
+ import { LogGroup } from 'aws-cdk-lib/aws-logs';
10
+ import { IHostedZone } from 'aws-cdk-lib/aws-route53';
11
+ import { IBucket } from 'aws-cdk-lib/aws-s3';
13
12
  import { Construct } from 'constructs';
14
13
  import { CommonConstruct } from '../../common';
15
- import { SiteWithEcsBackendProps, SiteResponseHeadersPolicyProps, SiteCachePolicyProps } from './types';
14
+ import { SiteCachePolicyProps, SiteResponseHeadersPolicyProps, SiteWithEcsBackendProps } from './types';
16
15
  /**
17
16
  * @classdesc Provides a construct to create and deploy a site hosted with an clustered ECS/ELB backend
18
17
  * @example
@@ -31,37 +30,37 @@ import { SiteWithEcsBackendProps, SiteResponseHeadersPolicyProps, SiteCachePolic
31
30
  export declare class SiteWithEcsBackend extends CommonConstruct {
32
31
  props: SiteWithEcsBackendProps;
33
32
  id: string;
34
- siteHostedZone: route53.IHostedZone;
35
- siteCertificate: certificateManager.ICertificate;
36
- siteRegionalCertificate: certificateManager.ICertificate;
37
- siteEcsPolicy: iam.PolicyDocument;
38
- siteEcsRole: iam.Role;
33
+ siteHostedZone: IHostedZone;
34
+ siteCertificate: ICertificate;
35
+ siteRegionalCertificate: ICertificate;
36
+ siteEcsPolicy: PolicyDocument;
37
+ siteEcsRole: Role;
39
38
  siteEcsEnvironment: {
40
39
  [key: string]: string;
41
40
  };
42
- siteVpc: ec2.IVpc;
41
+ siteVpc: IVpc;
43
42
  siteSecrets: any;
44
- siteEcsCluster: ecs.Cluster;
45
- siteEcsLogGroup: logs.LogGroup;
43
+ siteEcsCluster: Cluster;
44
+ siteEcsLogGroup: LogGroup;
46
45
  siteEcsBuildArgs: any;
47
- siteEcsContainerImage: ecs.AssetImage;
48
- siteEcsService: ecs.FargateService;
49
- siteEcsTaskDefinition: ecs.FargateTaskDefinition;
50
- siteEcsListener: elb.ApplicationListener;
51
- siteEcsLoadBalancer: elb.ApplicationLoadBalancer;
52
- siteEcsTargetGroup: elb.ApplicationTargetGroup;
53
- siteFileSystem: efs.FileSystem;
54
- siteLogBucket: s3.IBucket;
55
- siteOrigin: origins.HttpOrigin;
56
- siteDistribution: cloudfront.Distribution;
46
+ siteEcsContainerImage: AssetImage;
47
+ siteEcsService: FargateService;
48
+ siteEcsTaskDefinition: FargateTaskDefinition;
49
+ siteEcsListener: ApplicationListener;
50
+ siteEcsLoadBalancer: ApplicationLoadBalancer;
51
+ siteEcsTargetGroup: ApplicationTargetGroup;
52
+ siteFileSystem: FileSystem;
53
+ siteLogBucket: IBucket;
54
+ siteOrigin: HttpOrigin;
55
+ siteDistribution: Distribution;
57
56
  siteInternalDomainName: string;
58
57
  siteExternalDomainName: string;
59
58
  siteDomainNames: string[];
60
- siteCloudfrontFunction: cloudfront.Function;
61
- siteFunctionAssociations: cloudfront.FunctionAssociation[];
62
- siteOriginRequestPolicy: cloudfront.OriginRequestPolicy;
63
- siteOriginResponseHeadersPolicy?: cloudfront.ResponseHeadersPolicy;
64
- siteCachePolicy: cloudfront.CachePolicy;
59
+ siteCloudfrontFunction: IFunction;
60
+ siteFunctionAssociations: FunctionAssociation[];
61
+ siteOriginRequestPolicy: OriginRequestPolicy;
62
+ siteOriginResponseHeadersPolicy?: ResponseHeadersPolicy;
63
+ siteCachePolicy: CachePolicy;
65
64
  constructor(parent: Construct, id: string, props: SiteWithEcsBackendProps);
66
65
  /**
67
66
  * @summary Initialise and provision resources
@@ -119,17 +118,17 @@ export declare class SiteWithEcsBackend extends CommonConstruct {
119
118
  */
120
119
  protected createEcsContainerImage(): void;
121
120
  /**
122
- * Method to create Application Loadbalanced ECS Fargate Service
121
+ * Method to create Application Load balanced ECS Fargate Service
123
122
  */
124
123
  protected createEcsService(): void;
125
124
  /**
126
125
  * Method to create log bucket for site distribution
127
126
  */
128
127
  protected createSiteLogBucket(): void;
129
- protected createSiteCachePolicy(id: string, siteCachePolicy: SiteCachePolicyProps): cdk.aws_cloudfront.CachePolicy;
128
+ protected createSiteCachePolicy(id: string, siteCachePolicy: SiteCachePolicyProps): CachePolicy;
130
129
  protected createSiteOriginCachePolicy(): void;
131
130
  protected createSiteOriginRequestPolicy(): void;
132
- protected createResponseHeaderPolicy(props: SiteResponseHeadersPolicyProps): cdk.aws_cloudfront.ResponseHeadersPolicy | undefined;
131
+ protected createResponseHeaderPolicy(props: SiteResponseHeadersPolicyProps): ResponseHeadersPolicy | undefined;
133
132
  protected createSiteOriginResponseHeadersPolicy(): void;
134
133
  protected createSiteOrigin(): void;
135
134
  /**
@@ -1,36 +1,16 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
4
  };
25
5
  Object.defineProperty(exports, "__esModule", { value: true });
26
6
  exports.SiteWithEcsBackend = void 0;
27
- const _ = __importStar(require("lodash"));
28
- const cdk = __importStar(require("aws-cdk-lib"));
29
- const cloudfront = __importStar(require("aws-cdk-lib/aws-cloudfront"));
30
- const origins = __importStar(require("aws-cdk-lib/aws-cloudfront-origins"));
31
- const ecs = __importStar(require("aws-cdk-lib/aws-ecs"));
32
- const ecsPatterns = __importStar(require("aws-cdk-lib/aws-ecs-patterns"));
33
- const iam = __importStar(require("aws-cdk-lib/aws-iam"));
7
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
8
+ const aws_cloudfront_1 = require("aws-cdk-lib/aws-cloudfront");
9
+ const aws_cloudfront_origins_1 = require("aws-cdk-lib/aws-cloudfront-origins");
10
+ const aws_ecs_1 = require("aws-cdk-lib/aws-ecs");
11
+ const aws_ecs_patterns_1 = require("aws-cdk-lib/aws-ecs-patterns");
12
+ const aws_iam_1 = require("aws-cdk-lib/aws-iam");
13
+ const lodash_1 = __importDefault(require("lodash"));
34
14
  const common_1 = require("../../common");
35
15
  /**
36
16
  * @classdesc Provides a construct to create and deploy a site hosted with an clustered ECS/ELB backend
@@ -179,7 +159,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
179
159
  * @summary Method to create iam policy for ECS Task
180
160
  */
181
161
  createEcsPolicy() {
182
- this.siteEcsPolicy = new iam.PolicyDocument({
162
+ this.siteEcsPolicy = new aws_iam_1.PolicyDocument({
183
163
  statements: [this.iamManager.statementForCreateAnyLogStream()],
184
164
  });
185
165
  }
@@ -221,15 +201,15 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
221
201
  * Method to create container image for ECS task
222
202
  */
223
203
  createEcsContainerImage() {
224
- this.siteEcsContainerImage = ecs.ContainerImage.fromAsset(this.props.siteEcsContainerImagePath, {
204
+ this.siteEcsContainerImage = aws_ecs_1.ContainerImage.fromAsset(this.props.siteEcsContainerImagePath, {
225
205
  buildArgs: this.siteEcsBuildArgs,
226
206
  });
227
207
  }
228
208
  /**
229
- * Method to create Application Loadbalanced ECS Fargate Service
209
+ * Method to create Application Load balanced ECS Fargate Service
230
210
  */
231
211
  createEcsService() {
232
- const fargateService = new ecsPatterns.ApplicationLoadBalancedFargateService(this, `${this.id}-ecs-service`, {
212
+ const fargateService = new aws_ecs_patterns_1.ApplicationLoadBalancedFargateService(this, `${this.id}-ecs-service`, {
233
213
  assignPublicIp: true,
234
214
  certificate: this.siteRegionalCertificate,
235
215
  cluster: this.siteEcsCluster,
@@ -238,7 +218,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
238
218
  domainName: this.siteInternalDomainName,
239
219
  domainZone: this.siteHostedZone,
240
220
  enableECSManagedTags: true,
241
- healthCheckGracePeriod: cdk.Duration.seconds(60),
221
+ healthCheckGracePeriod: aws_cdk_lib_1.Duration.seconds(60),
242
222
  listenerPort: this.props.siteTask.listenerPort,
243
223
  loadBalancerName: this.props.siteTask.loadBalancerName
244
224
  ? `${this.props.siteTask.loadBalancerName}-${this.props.stage}`
@@ -254,7 +234,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
254
234
  environment: this.siteEcsEnvironment,
255
235
  executionRole: this.siteEcsRole,
256
236
  image: this.siteEcsContainerImage,
257
- logDriver: ecs.LogDriver.awsLogs({
237
+ logDriver: aws_ecs_1.LogDriver.awsLogs({
258
238
  logGroup: this.siteEcsLogGroup,
259
239
  logRetention: this.props.siteTask.logging?.logRetention,
260
240
  multilinePattern: this.props.siteTask.logging?.multilinePattern,
@@ -270,11 +250,11 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
270
250
  healthyGrpcCodes: this.props.siteHealthCheck.healthyGrpcCodes,
271
251
  healthyHttpCodes: this.props.siteHealthCheck.healthyHttpCodes,
272
252
  healthyThresholdCount: this.props.siteHealthCheck.healthyThresholdCount,
273
- interval: cdk.Duration.seconds(this.props.siteHealthCheck.intervalInSecs),
253
+ interval: aws_cdk_lib_1.Duration.seconds(this.props.siteHealthCheck.intervalInSecs),
274
254
  path: this.props.siteHealthCheck.path ?? '/',
275
255
  port: this.props.siteHealthCheck.port,
276
256
  protocol: this.props.siteHealthCheck.protocol,
277
- timeout: cdk.Duration.seconds(this.props.siteHealthCheck.timeoutInSecs),
257
+ timeout: aws_cdk_lib_1.Duration.seconds(this.props.siteHealthCheck.timeoutInSecs),
278
258
  unhealthyThresholdCount: this.props.siteHealthCheck.unhealthyThresholdCount,
279
259
  });
280
260
  }
@@ -316,7 +296,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
316
296
  this.siteFileSystem.connections.allowDefaultPortFrom(this.siteEcsService.connections);
317
297
  this.siteFileSystem.connections.allowDefaultPortTo(this.siteEcsService.connections);
318
298
  /* add EFS permissions to ECS Role */
319
- this.siteEcsRole.addToPolicy(new iam.PolicyStatement(this.iamManager.statementForWriteEfs([this.siteFileSystem.fileSystemArn])));
299
+ this.siteEcsRole.addToPolicy(new aws_iam_1.PolicyStatement(this.iamManager.statementForWriteEfs([this.siteFileSystem.fileSystemArn])));
320
300
  /* add the efs volume to ecs task definition */
321
301
  this.siteEcsTaskDefinition.addVolume({
322
302
  efsVolumeConfiguration: {
@@ -348,45 +328,44 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
348
328
  this.siteLogBucket = this.s3Manager.createS3Bucket(`${this.id}-site-logs`, this, this.props.siteLogBucket);
349
329
  }
350
330
  createSiteCachePolicy(id, siteCachePolicy) {
351
- return new cloudfront.CachePolicy(this, `${id}`, {
331
+ return new aws_cloudfront_1.CachePolicy(this, `${id}`, {
352
332
  cachePolicyName: `${this.id}-${siteCachePolicy.cachePolicyName}`,
353
333
  comment: `Policy for ${this.id}-distribution - ${this.props.stage} stage`,
354
- defaultTtl: cdk.Duration.seconds(siteCachePolicy.defaultTtlInSeconds),
355
- minTtl: cdk.Duration.seconds(siteCachePolicy.minTtlInSeconds),
356
- maxTtl: cdk.Duration.seconds(siteCachePolicy.maxTtlInSeconds),
357
- enableAcceptEncodingGzip: siteCachePolicy.enableAcceptEncodingGzip,
334
+ cookieBehavior: siteCachePolicy.cookieBehavior,
358
335
  enableAcceptEncodingBrotli: siteCachePolicy.enableAcceptEncodingBrotli,
359
- queryStringBehavior: siteCachePolicy.queryStringBehavior,
336
+ enableAcceptEncodingGzip: siteCachePolicy.enableAcceptEncodingGzip,
360
337
  headerBehavior: siteCachePolicy.headerBehavior,
361
- cookieBehavior: siteCachePolicy.cookieBehavior,
338
+ maxTtl: aws_cdk_lib_1.Duration.seconds(siteCachePolicy.maxTtlInSeconds),
339
+ minTtl: aws_cdk_lib_1.Duration.seconds(siteCachePolicy.minTtlInSeconds),
340
+ queryStringBehavior: siteCachePolicy.queryStringBehavior,
362
341
  });
363
342
  }
364
343
  createSiteOriginCachePolicy() {
365
344
  if (!this.props.siteCachePolicy)
366
345
  return;
367
346
  this.siteCachePolicy = this.createSiteCachePolicy(`${this.id}-site-cache-policy`, this.props.siteCachePolicy);
368
- _.assign(this.props.siteDistribution.defaultBehavior, {
347
+ lodash_1.default.assign(this.props.siteDistribution.defaultBehavior, {
369
348
  cachePolicy: this.siteCachePolicy,
370
349
  });
371
350
  }
372
351
  createSiteOriginRequestPolicy() {
373
352
  if (!this.props.siteOriginRequestPolicy)
374
353
  return;
375
- this.siteOriginRequestPolicy = new cloudfront.OriginRequestPolicy(this, `${this.id}-sorp`, {
354
+ this.siteOriginRequestPolicy = new aws_cloudfront_1.OriginRequestPolicy(this, `${this.id}-sorp`, {
376
355
  comment: `Request Policy for ${this.id}-distribution - ${this.props.stage} stage`,
377
356
  cookieBehavior: this.props.siteOriginRequestPolicy.cookieBehavior,
378
357
  headerBehavior: this.props.siteOriginRequestPolicy.headerBehavior,
379
358
  originRequestPolicyName: `${this.id}-origin-request`,
380
359
  queryStringBehavior: this.props.siteOriginRequestPolicy.queryStringBehavior,
381
360
  });
382
- _.assign(this.props.siteDistribution.defaultBehavior, {
361
+ lodash_1.default.assign(this.props.siteDistribution.defaultBehavior, {
383
362
  originRequestPolicy: this.siteOriginRequestPolicy,
384
363
  });
385
364
  }
386
365
  createResponseHeaderPolicy(props) {
387
366
  if (!props)
388
367
  return undefined;
389
- return new cloudfront.ResponseHeadersPolicy(this, `${this.id}-${props.type}-srhp`, {
368
+ return new aws_cloudfront_1.ResponseHeadersPolicy(this, `${this.id}-${props.type}-srhp`, {
390
369
  ...props,
391
370
  comment: `Response Header Policy for ${props.type} for ${this.id}-distribution - ${this.props.stage} stage`,
392
371
  responseHeadersPolicyName: `${this.id}-${props.type}-response`,
@@ -394,7 +373,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
394
373
  ...props.securityHeadersBehavior,
395
374
  strictTransportSecurity: {
396
375
  ...props.securityHeadersBehavior?.strictTransportSecurity,
397
- accessControlMaxAge: cdk.Duration.seconds(props.securityHeadersBehavior?.strictTransportSecurity?.accessControlMaxAgeInSeconds),
376
+ accessControlMaxAge: aws_cdk_lib_1.Duration.seconds(props.securityHeadersBehavior?.strictTransportSecurity?.accessControlMaxAgeInSeconds),
398
377
  },
399
378
  },
400
379
  });
@@ -403,15 +382,15 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
403
382
  if (!this.props.siteOriginResponseHeadersPolicy)
404
383
  return;
405
384
  this.siteOriginResponseHeadersPolicy = this.createResponseHeaderPolicy(this.props.siteOriginResponseHeadersPolicy);
406
- _.assign(this.props.siteDistribution.defaultBehavior, {
385
+ lodash_1.default.assign(this.props.siteDistribution.defaultBehavior, {
407
386
  responseHeadersPolicy: this.siteOriginResponseHeadersPolicy,
408
387
  });
409
388
  }
410
389
  createSiteOrigin() {
411
- this.siteOrigin = new origins.HttpOrigin(this.siteInternalDomainName, {
390
+ this.siteOrigin = new aws_cloudfront_origins_1.HttpOrigin(this.siteInternalDomainName, {
412
391
  httpPort: this.props.siteTask.listenerPort,
413
392
  originId: `${this.id}-server`,
414
- protocolPolicy: cloudfront.OriginProtocolPolicy.HTTPS_ONLY,
393
+ protocolPolicy: aws_cloudfront_1.OriginProtocolPolicy.HTTPS_ONLY,
415
394
  });
416
395
  }
417
396
  /**
@@ -429,7 +408,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
429
408
  if (this.props.siteCloudfrontFunctionProps) {
430
409
  this.siteFunctionAssociations = [
431
410
  {
432
- eventType: cloudfront.FunctionEventType.VIEWER_REQUEST,
411
+ eventType: aws_cloudfront_1.FunctionEventType.VIEWER_REQUEST,
433
412
  function: this.siteCloudfrontFunction,
434
413
  },
435
414
  ];
@@ -1,6 +1,6 @@
1
- import { CommonConstruct } from '../../common';
1
+ import { IBucket } from 'aws-cdk-lib/aws-s3';
2
2
  import { Construct } from 'constructs';
3
- import * as s3 from 'aws-cdk-lib/aws-s3';
3
+ import { CommonConstruct } from '../../common';
4
4
  import { StaticAssetDeploymentProps } from './types';
5
5
  /**
6
6
  * @classdesc Provides a construct to create and deploy static assets into S3 bucket
@@ -20,7 +20,7 @@ import { StaticAssetDeploymentProps } from './types';
20
20
  export declare class StaticAssetDeployment extends CommonConstruct {
21
21
  props: StaticAssetDeploymentProps;
22
22
  id: string;
23
- staticAssetBucket: s3.IBucket;
23
+ staticAssetBucket: IBucket;
24
24
  constructor(parent: Construct, id: string, props: StaticAssetDeploymentProps);
25
25
  /**
26
26
  * @summary Initialise and provision resources
@@ -31,7 +31,7 @@ export declare class StaticAssetDeployment extends CommonConstruct {
31
31
  */
32
32
  protected createAssetBucket(): void;
33
33
  /**
34
- * @summary Deploy the static assests into the static asset bucket
34
+ * @summary Deploy the static assets into the static asset bucket
35
35
  */
36
36
  protected deployStaticAssets(): void;
37
37
  }
@@ -1,31 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.StaticAssetDeployment = void 0;
4
+ const aws_s3_deployment_1 = require("aws-cdk-lib/aws-s3-deployment");
27
5
  const common_1 = require("../../common");
28
- const s3deploy = __importStar(require("aws-cdk-lib/aws-s3-deployment"));
29
6
  /**
30
7
  * @classdesc Provides a construct to create and deploy static assets into S3 bucket
31
8
  * @example
@@ -66,10 +43,10 @@ class StaticAssetDeployment extends common_1.CommonConstruct {
66
43
  this.staticAssetBucket = this.s3Manager.createS3Bucket(`${this.id}-sa-bucket`, this, this.props.staticAssetBucket);
67
44
  }
68
45
  /**
69
- * @summary Deploy the static assests into the static asset bucket
46
+ * @summary Deploy the static assets into the static asset bucket
70
47
  */
71
48
  deployStaticAssets() {
72
- new s3deploy.BucketDeployment(this, `${this.id}-static-deployment`, {
49
+ new aws_s3_deployment_1.BucketDeployment(this, `${this.id}-static-deployment`, {
73
50
  ...this.props.staticAssetDeployment,
74
51
  destinationBucket: this.staticAssetBucket,
75
52
  sources: this.props.staticAssetSources,
@@ -1,8 +1,8 @@
1
- import * as certificateManager from 'aws-cdk-lib/aws-certificatemanager';
2
- import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
3
- import * as origins from 'aws-cdk-lib/aws-cloudfront-origins';
4
- import * as route53 from 'aws-cdk-lib/aws-route53';
5
- import * as s3 from 'aws-cdk-lib/aws-s3';
1
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
2
+ import { FunctionAssociation, IDistribution, IFunction, OriginAccessIdentity } from 'aws-cdk-lib/aws-cloudfront';
3
+ import { S3Origin } from 'aws-cdk-lib/aws-cloudfront-origins';
4
+ import { ARecord, IHostedZone } from 'aws-cdk-lib/aws-route53';
5
+ import { IBucket } from 'aws-cdk-lib/aws-s3';
6
6
  import { Construct } from 'constructs';
7
7
  import { CommonConstruct } from '../../common';
8
8
  import { StaticSiteProps } from './types';
@@ -24,16 +24,16 @@ import { StaticSiteProps } from './types';
24
24
  export declare class StaticSite extends CommonConstruct {
25
25
  props: StaticSiteProps;
26
26
  id: string;
27
- siteHostedZone: route53.IHostedZone;
28
- siteCertificate: certificateManager.ICertificate;
29
- siteARecord: route53.ARecord;
30
- siteBucket: s3.IBucket;
31
- siteOrigin: origins.S3Origin;
32
- siteDistribution: cloudfront.IDistribution;
33
- siteLogBucket: s3.IBucket;
34
- siteOriginAccessIdentity: cloudfront.OriginAccessIdentity;
35
- siteCloudfrontFunction: cloudfront.Function;
36
- siteFunctionAssociations: cloudfront.FunctionAssociation[];
27
+ siteHostedZone: IHostedZone;
28
+ siteCertificate: ICertificate;
29
+ siteARecord: ARecord;
30
+ siteBucket: IBucket;
31
+ siteOrigin: S3Origin;
32
+ siteDistribution: IDistribution;
33
+ siteLogBucket: IBucket;
34
+ siteOriginAccessIdentity: OriginAccessIdentity;
35
+ siteCloudfrontFunction: IFunction;
36
+ siteFunctionAssociations: FunctionAssociation[];
37
37
  constructor(parent: Construct, id: string, props: StaticSiteProps);
38
38
  /**
39
39
  * @summary Initialise and provision resources
@@ -1,31 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.StaticSite = void 0;
27
- const cloudfront = __importStar(require("aws-cdk-lib/aws-cloudfront"));
28
- const origins = __importStar(require("aws-cdk-lib/aws-cloudfront-origins"));
4
+ const aws_cloudfront_1 = require("aws-cdk-lib/aws-cloudfront");
5
+ const aws_cloudfront_origins_1 = require("aws-cdk-lib/aws-cloudfront-origins");
29
6
  const common_1 = require("../../common");
30
7
  /**
31
8
  * @classdesc Provides a construct to create and deploy a s3 hosted static site
@@ -109,7 +86,7 @@ class StaticSite extends common_1.CommonConstruct {
109
86
  this.siteBucket = this.s3Manager.createS3Bucket(`${this.id}-site`, this, this.props.siteBucket);
110
87
  }
111
88
  createSiteOrigin() {
112
- this.siteOrigin = new origins.S3Origin(this.siteBucket);
89
+ this.siteOrigin = new aws_cloudfront_origins_1.S3Origin(this.siteBucket);
113
90
  }
114
91
  /**
115
92
  * @summary Method to create a site cloudfront function
@@ -126,7 +103,7 @@ class StaticSite extends common_1.CommonConstruct {
126
103
  if (this.props.siteCloudfrontFunctionProps) {
127
104
  this.siteFunctionAssociations = [
128
105
  {
129
- eventType: cloudfront.FunctionEventType.VIEWER_REQUEST,
106
+ eventType: aws_cloudfront_1.FunctionEventType.VIEWER_REQUEST,
130
107
  function: this.siteCloudfrontFunction,
131
108
  },
132
109
  ];