@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
@@ -16,7 +16,7 @@
16
16
  "test": "npx jest --ci --runInBand --passWithNoTests"
17
17
  },
18
18
  "dependencies": {
19
- "@types/uuid": "^9.0.2",
19
+ "@types/uuid": "^9.0.3",
20
20
  "uuid": "^9.0.0"
21
21
  },
22
22
  "devDependencies": {
@@ -1,6 +1,6 @@
1
- import * as cdk from 'aws-cdk-lib';
1
+ import { CfnOutput } from 'aws-cdk-lib';
2
2
  import { Construct } from 'constructs';
3
- import * as aws from '../services/aws';
3
+ import { AcmManager, ApiManager, AppConfigManager, CloudFrontManager, CloudTrailManager, CloudWatchManager, CodeBuildManager, DynamodbManager, EcrManager, EcsManager, EfsManager, EksManager, ElastiCacheManager, EventManager, EventTargetManager, EvidentlyManager, IamManager, KmsManager, LambdaManager, LogManager, Route53Manager, S3Manager, SecretsManager, SfnManager, SnsManager, SqsManager, SsmManager, VpcManager, WafManager } from '../services';
4
4
  import { CommonStackProps } from './types';
5
5
  /**
6
6
  * @subcategory Construct
@@ -17,35 +17,35 @@ import { CommonStackProps } from './types';
17
17
  */
18
18
  export declare class CommonConstruct extends Construct {
19
19
  props: CommonStackProps;
20
- acmManager: aws.AcmManager;
21
- apiManager: aws.ApiManager;
22
- appConfigManager: aws.AppConfigManager;
23
- codeBuildManager: aws.CodeBuildManager;
24
- cloudFrontManager: aws.CloudFrontManager;
25
- cloudTrailManager: aws.CloudTrailManager;
26
- cloudWatchManager: aws.CloudWatchManager;
27
- dynamodbManager: aws.DynamodbManager;
28
- ecrManager: aws.EcrManager;
29
- ecsManager: aws.EcsManager;
30
- efsManager: aws.EfsManager;
31
- eksManager: aws.EksManager;
32
- elasticacheManager: aws.ElastiCacheManager;
33
- eventManager: aws.EventManager;
34
- eventTargetManager: aws.EventTargetManager;
35
- evidentlyManager: aws.EvidentlyManager;
36
- iamManager: aws.IamManager;
37
- kmsManager: aws.KmsManager;
38
- lambdaManager: aws.LambdaManager;
39
- logManager: aws.LogManager;
40
- route53Manager: aws.Route53Manager;
41
- s3Manager: aws.S3Manager;
42
- secretsManager: aws.SecretsManager;
43
- sfnManager: aws.SfnManager;
44
- snsManager: aws.SnsManager;
45
- sqsManager: aws.SqsManager;
46
- ssmManager: aws.SsmManager;
47
- vpcManager: aws.VpcManager;
48
- wafManager: aws.WafManager;
20
+ acmManager: AcmManager;
21
+ apiManager: ApiManager;
22
+ appConfigManager: AppConfigManager;
23
+ codeBuildManager: CodeBuildManager;
24
+ cloudFrontManager: CloudFrontManager;
25
+ cloudTrailManager: CloudTrailManager;
26
+ cloudWatchManager: CloudWatchManager;
27
+ dynamodbManager: DynamodbManager;
28
+ ecrManager: EcrManager;
29
+ ecsManager: EcsManager;
30
+ efsManager: EfsManager;
31
+ eksManager: EksManager;
32
+ elasticacheManager: ElastiCacheManager;
33
+ eventManager: EventManager;
34
+ eventTargetManager: EventTargetManager;
35
+ evidentlyManager: EvidentlyManager;
36
+ iamManager: IamManager;
37
+ kmsManager: KmsManager;
38
+ lambdaManager: LambdaManager;
39
+ logManager: LogManager;
40
+ route53Manager: Route53Manager;
41
+ s3Manager: S3Manager;
42
+ secretsManager: SecretsManager;
43
+ sfnManager: SfnManager;
44
+ snsManager: SnsManager;
45
+ sqsManager: SqsManager;
46
+ ssmManager: SsmManager;
47
+ vpcManager: VpcManager;
48
+ wafManager: WafManager;
49
49
  fullyQualifiedDomainName: string;
50
50
  constructor(parent: Construct, id: string, props: CommonStackProps);
51
51
  /**
@@ -55,7 +55,7 @@ export declare class CommonConstruct extends Construct {
55
55
  * @param description optional description for the output
56
56
  * @param overrideId Flag which indicates whether to override the default logical id of the output
57
57
  */
58
- protected addCfnOutput(id: string, value: string, description?: string, overrideId?: boolean): cdk.CfnOutput;
58
+ protected addCfnOutput(id: string, value: string, description?: string, overrideId?: boolean): CfnOutput;
59
59
  /**
60
60
  * @summary Determine the fully qualified domain name based on domainName & subDomain
61
61
  */
@@ -1,32 +1,9 @@
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.applyMixins = exports.CommonConstruct = void 0;
27
4
  const constructs_1 = require("constructs");
28
- const aws = __importStar(require("../services/aws"));
29
- const utils = __importStar(require("../utils"));
5
+ const services_1 = require("../services");
6
+ const utils_1 = require("../utils");
30
7
  /**
31
8
  * @subcategory Construct
32
9
  * @classdesc Common construct to use as a base for all higher level constructs.
@@ -75,35 +52,35 @@ class CommonConstruct extends constructs_1.Construct {
75
52
  constructor(parent, id, props) {
76
53
  super(parent, id);
77
54
  this.props = props;
78
- this.acmManager = new aws.AcmManager();
79
- this.apiManager = new aws.ApiManager();
80
- this.appConfigManager = new aws.AppConfigManager();
81
- this.codeBuildManager = new aws.CodeBuildManager();
82
- this.cloudFrontManager = new aws.CloudFrontManager();
83
- this.cloudTrailManager = new aws.CloudTrailManager();
84
- this.cloudWatchManager = new aws.CloudWatchManager();
85
- this.dynamodbManager = new aws.DynamodbManager();
86
- this.ecrManager = new aws.EcrManager();
87
- this.ecsManager = new aws.EcsManager();
88
- this.efsManager = new aws.EfsManager();
89
- this.eksManager = new aws.EksManager();
90
- this.elasticacheManager = new aws.ElastiCacheManager();
91
- this.eventManager = new aws.EventManager();
92
- this.eventTargetManager = new aws.EventTargetManager();
93
- this.evidentlyManager = new aws.EvidentlyManager();
94
- this.iamManager = new aws.IamManager();
95
- this.kmsManager = new aws.KmsManager();
96
- this.lambdaManager = new aws.LambdaManager();
97
- this.logManager = new aws.LogManager();
98
- this.route53Manager = new aws.Route53Manager();
99
- this.s3Manager = new aws.S3Manager();
100
- this.secretsManager = new aws.SecretsManager();
101
- this.sfnManager = new aws.SfnManager();
102
- this.snsManager = new aws.SnsManager();
103
- this.sqsManager = new aws.SqsManager();
104
- this.ssmManager = new aws.SsmManager();
105
- this.vpcManager = new aws.VpcManager();
106
- this.wafManager = new aws.WafManager();
55
+ this.acmManager = new services_1.AcmManager();
56
+ this.apiManager = new services_1.ApiManager();
57
+ this.appConfigManager = new services_1.AppConfigManager();
58
+ this.codeBuildManager = new services_1.CodeBuildManager();
59
+ this.cloudFrontManager = new services_1.CloudFrontManager();
60
+ this.cloudTrailManager = new services_1.CloudTrailManager();
61
+ this.cloudWatchManager = new services_1.CloudWatchManager();
62
+ this.dynamodbManager = new services_1.DynamodbManager();
63
+ this.ecrManager = new services_1.EcrManager();
64
+ this.ecsManager = new services_1.EcsManager();
65
+ this.efsManager = new services_1.EfsManager();
66
+ this.eksManager = new services_1.EksManager();
67
+ this.elasticacheManager = new services_1.ElastiCacheManager();
68
+ this.eventManager = new services_1.EventManager();
69
+ this.eventTargetManager = new services_1.EventTargetManager();
70
+ this.evidentlyManager = new services_1.EvidentlyManager();
71
+ this.iamManager = new services_1.IamManager();
72
+ this.kmsManager = new services_1.KmsManager();
73
+ this.lambdaManager = new services_1.LambdaManager();
74
+ this.logManager = new services_1.LogManager();
75
+ this.route53Manager = new services_1.Route53Manager();
76
+ this.s3Manager = new services_1.S3Manager();
77
+ this.secretsManager = new services_1.SecretsManager();
78
+ this.sfnManager = new services_1.SfnManager();
79
+ this.snsManager = new services_1.SnsManager();
80
+ this.sqsManager = new services_1.SqsManager();
81
+ this.ssmManager = new services_1.SsmManager();
82
+ this.vpcManager = new services_1.VpcManager();
83
+ this.wafManager = new services_1.WafManager();
107
84
  this.determineFullyQualifiedDomain();
108
85
  }
109
86
  /**
@@ -114,7 +91,7 @@ class CommonConstruct extends constructs_1.Construct {
114
91
  * @param overrideId Flag which indicates whether to override the default logical id of the output
115
92
  */
116
93
  addCfnOutput(id, value, description, overrideId = true) {
117
- return utils.createCfnOutput(id, this, value, description, overrideId);
94
+ return (0, utils_1.createCfnOutput)(id, this, value, description, overrideId);
118
95
  }
119
96
  /**
120
97
  * @summary Determine the fully qualified domain name based on domainName & subDomain
@@ -128,22 +105,22 @@ class CommonConstruct extends constructs_1.Construct {
128
105
  * @summary Utility method to determine if the initialisation is in development (dev) stage
129
106
  * This is determined by the stage property injected via cdk context
130
107
  */
131
- isDevelopmentStage = () => utils.isDevStage(this.props.stage);
108
+ isDevelopmentStage = () => (0, utils_1.isDevStage)(this.props.stage);
132
109
  /**
133
110
  * @summary Utility method to determine if the initialisation is in test (tst) stage
134
111
  * This is determined by the stage property injected via cdk context
135
112
  */
136
- isTestStage = () => utils.isTestStage(this.props.stage);
113
+ isTestStage = () => (0, utils_1.isTestStage)(this.props.stage);
137
114
  /**
138
115
  * @summary Utility method to determine if the initialisation is in uat (uat) stage
139
116
  * This is determined by the stage property injected via cdk context
140
117
  */
141
- isUatStage = () => utils.isUatStage(this.props.stage);
118
+ isUatStage = () => (0, utils_1.isUatStage)(this.props.stage);
142
119
  /**
143
120
  * @summary Utility method to determine if the initialisation is in production (prd) stage
144
121
  * This is determined by the stage property injected via cdk context
145
122
  */
146
- isProductionStage = () => utils.isPrdStage(this.props.stage);
123
+ isProductionStage = () => (0, utils_1.isPrdStage)(this.props.stage);
147
124
  }
148
125
  exports.CommonConstruct = CommonConstruct;
149
126
  const applyMixins = (derivedCtor, constructors) => {
@@ -1,29 +1,30 @@
1
- import * as cdk from 'aws-cdk-lib';
2
- import { CommonStackProps } from './types';
1
+ import { App, Stack, StackProps } from 'aws-cdk-lib';
2
+ import { Runtime } from 'aws-cdk-lib/aws-lambda';
3
3
  import { CommonConstruct } from './construct';
4
+ import { CommonStackProps } from './types';
4
5
  /**
5
6
  * @classdesc Common stack to use as a base for all higher level constructs.
6
7
  * @example
7
8
  * import { CommonStack } from '@gradientedge/cdk-utils'
8
9
  *
9
10
  * class CustomStack extends CommonStack {
10
- * constructor(parent: cdk.App, name: string, props: cdk.StackProps) {
11
+ * constructor(parent: App, name: string, props: StackProps) {
11
12
  * super(parent, name, props)
12
13
  * // provision resources
13
14
  * }
14
15
  * }
15
16
  */
16
- export declare class CommonStack extends cdk.Stack {
17
- static NODEJS_RUNTIME: cdk.aws_lambda.Runtime;
17
+ export declare class CommonStack extends Stack {
18
+ static NODEJS_RUNTIME: Runtime;
18
19
  construct: CommonConstruct;
19
20
  props: CommonStackProps;
20
- constructor(parent: cdk.App, name: string, props: cdk.StackProps);
21
+ constructor(parent: App, name: string, props: StackProps);
21
22
  /**
22
23
  * @summary Method to determine the core CDK construct properties injected via context cdk.json
23
24
  * @param props The stack properties
24
25
  * @returns The stack properties
25
26
  */
26
- protected determineConstructProps(props: cdk.StackProps): {
27
+ protected determineConstructProps(props: StackProps): {
27
28
  domainName: any;
28
29
  excludeDomainNameForBuckets: any;
29
30
  extraContexts: any;
@@ -1,49 +1,29 @@
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.CommonStack = void 0;
27
- const cdk = __importStar(require("aws-cdk-lib"));
28
- const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
7
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
8
+ const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
9
+ const fs_1 = __importDefault(require("fs"));
29
10
  const utils_1 = require("../utils");
30
11
  const construct_1 = require("./construct");
31
- const appRoot = require('app-root-path');
32
- const fs = require('fs');
12
+ const app_root_path_1 = __importDefault(require("app-root-path"));
33
13
  /**
34
14
  * @classdesc Common stack to use as a base for all higher level constructs.
35
15
  * @example
36
16
  * import { CommonStack } from '@gradientedge/cdk-utils'
37
17
  *
38
18
  * class CustomStack extends CommonStack {
39
- * constructor(parent: cdk.App, name: string, props: cdk.StackProps) {
19
+ * constructor(parent: App, name: string, props: StackProps) {
40
20
  * super(parent, name, props)
41
21
  * // provision resources
42
22
  * }
43
23
  * }
44
24
  */
45
- class CommonStack extends cdk.Stack {
46
- static NODEJS_RUNTIME = lambda.Runtime.NODEJS_18_X;
25
+ class CommonStack extends aws_cdk_lib_1.Stack {
26
+ static NODEJS_RUNTIME = aws_lambda_1.Runtime.NODEJS_18_X;
47
27
  construct;
48
28
  props;
49
29
  constructor(parent, name, props) {
@@ -90,16 +70,16 @@ class CommonStack extends cdk.Stack {
90
70
  return;
91
71
  }
92
72
  extraContexts.forEach((context) => {
93
- const extraContextPath = `${appRoot.path}/${context}`;
73
+ const extraContextPath = `${app_root_path_1.default.path}/${context}`;
94
74
  /* scenario where extra context is configured in cdk.json but absent in file system */
95
- if (!fs.existsSync(extraContextPath))
75
+ if (!fs_1.default.existsSync(extraContextPath))
96
76
  throw `Extra context properties unavailable in path:${extraContextPath}`;
97
77
  /* read the extra properties */
98
- const extraContextPropsBuffer = fs.readFileSync(extraContextPath);
78
+ const extraContextPropsBuffer = fs_1.default.readFileSync(extraContextPath);
99
79
  if (debug)
100
80
  console.debug(`Adding additional contexts provided in ${extraContextPath}`);
101
81
  /* parse as JSON properties */
102
- const extraContextProps = JSON.parse(extraContextPropsBuffer);
82
+ const extraContextProps = JSON.parse(extraContextPropsBuffer.toString('utf-8'));
103
83
  /* set each of the property into the cdk node context */
104
84
  Object.keys(extraContextProps).forEach((propKey) => {
105
85
  this.node.setContext(propKey, extraContextProps[propKey]);
@@ -114,14 +94,14 @@ class CommonStack extends cdk.Stack {
114
94
  determineStageContexts() {
115
95
  const stage = this.node.tryGetContext('stage');
116
96
  const stageContextPath = this.node.tryGetContext('stageContextPath') || 'cdkEnv';
117
- const stageContextFilePath = `${appRoot.path}/${stageContextPath}/${stage}.json`;
97
+ const stageContextFilePath = `${app_root_path_1.default.path}/${stageContextPath}/${stage}.json`;
118
98
  const debug = this.node.tryGetContext('debug');
119
99
  if ((0, utils_1.isDevStage)(stage)) {
120
100
  if (debug)
121
101
  console.debug(`Development stage. Using default stage context properties`);
122
102
  }
123
103
  /* alert default context usage when extra stage config is missing */
124
- if (!fs.existsSync(stageContextFilePath)) {
104
+ if (!fs_1.default.existsSync(stageContextFilePath)) {
125
105
  if (debug)
126
106
  console.debug(`Stage specific context properties unavailable in path:${stageContextFilePath}`);
127
107
  if (debug)
@@ -129,11 +109,11 @@ class CommonStack extends cdk.Stack {
129
109
  return;
130
110
  }
131
111
  /* read the extra properties */
132
- const stageContextPropsBuffer = fs.readFileSync(stageContextFilePath);
112
+ const stageContextPropsBuffer = fs_1.default.readFileSync(stageContextFilePath);
133
113
  if (debug)
134
114
  console.debug(`Adding additional stage contexts provided in ${stageContextFilePath}`);
135
115
  /* parse as JSON properties */
136
- const stageContextProps = JSON.parse(stageContextPropsBuffer);
116
+ const stageContextProps = JSON.parse(stageContextPropsBuffer.toString('utf-8'));
137
117
  /* set each of the property into the cdk node context */
138
118
  Object.keys(stageContextProps).forEach((propKey) => {
139
119
  /* handle object, array properties */
@@ -1,9 +1,9 @@
1
- import * as cdk from 'aws-cdk-lib';
1
+ import { StackProps } from 'aws-cdk-lib';
2
2
  import { Runtime, Tracing } from 'aws-cdk-lib/aws-lambda';
3
3
  import { RetentionDays } from 'aws-cdk-lib/aws-logs';
4
4
  /**
5
5
  */
6
- export interface CommonStackProps extends cdk.StackProps {
6
+ export interface CommonStackProps extends StackProps {
7
7
  name: string;
8
8
  region: string;
9
9
  stage: string;
@@ -1,34 +1,34 @@
1
- import * as apig from 'aws-cdk-lib/aws-apigateway';
2
- import * as acm from 'aws-cdk-lib/aws-certificatemanager';
3
- import * as iam from 'aws-cdk-lib/aws-iam';
4
- import * as logs from 'aws-cdk-lib/aws-logs';
5
- import * as route53 from 'aws-cdk-lib/aws-route53';
6
- import * as sns from 'aws-cdk-lib/aws-sns';
1
+ import { DomainName, Integration, IntegrationResponse, Method, MethodResponse, Model, Resource, RestApi } from 'aws-cdk-lib/aws-apigateway';
2
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
3
+ import { Role } from 'aws-cdk-lib/aws-iam';
4
+ import { LogGroup } from 'aws-cdk-lib/aws-logs';
5
+ import { IHostedZone } from 'aws-cdk-lib/aws-route53';
6
+ import { Topic } from 'aws-cdk-lib/aws-sns';
7
7
  import { ApiToEventBridgeTargetRestApiType } from './types';
8
8
  /**
9
9
  * @classdesc Provides a construct to contain api resources for ApiToEventBridgeTargetWithSns
10
10
  */
11
11
  export declare class ApiToEventbridgeTargetRestApi implements ApiToEventBridgeTargetRestApiType {
12
- accessLogGroup: logs.LogGroup;
13
- api: apig.RestApi;
14
- certificate: acm.ICertificate;
15
- domain: apig.DomainName;
16
- errorResponseModel: apig.Model;
17
- hostedZone: route53.IHostedZone;
18
- integration: apig.Integration;
19
- integrationErrorResponse: apig.IntegrationResponse;
12
+ accessLogGroup: LogGroup;
13
+ api: RestApi;
14
+ certificate: ICertificate;
15
+ domain: DomainName;
16
+ errorResponseModel: Model;
17
+ hostedZone: IHostedZone;
18
+ integration: Integration;
19
+ integrationErrorResponse: IntegrationResponse;
20
20
  integrationRequestParameters: {
21
21
  [p: string]: string;
22
22
  };
23
23
  integrationRequestTemplates: {
24
24
  [p: string]: string;
25
25
  };
26
- integrationResponse: apig.IntegrationResponse;
27
- method: apig.Method;
28
- methodErrorResponse: apig.MethodResponse;
29
- methodResponse: apig.MethodResponse;
30
- resource: apig.Resource;
31
- responseModel: apig.Model;
32
- topic: sns.Topic;
33
- role: iam.Role;
26
+ integrationResponse: IntegrationResponse;
27
+ method: Method;
28
+ methodErrorResponse: MethodResponse;
29
+ methodResponse: MethodResponse;
30
+ resource: Resource;
31
+ responseModel: Model;
32
+ topic: Topic;
33
+ role: Role;
34
34
  }
@@ -1,15 +1,15 @@
1
- import * as events from 'aws-cdk-lib/aws-events';
2
- import * as logs from 'aws-cdk-lib/aws-logs';
1
+ import { IEventBus, Rule } from 'aws-cdk-lib/aws-events';
2
+ import { LogGroup } from 'aws-cdk-lib/aws-logs';
3
3
  import { ApiToEventBridgeTargetEventType } from './types';
4
4
  /**
5
5
  * @classdesc Provides a construct to contain event resources for ApiToEventBridgeTargetWithSns
6
6
  */
7
7
  export declare class ApiToEventbridgeTargetEvent implements ApiToEventBridgeTargetEventType {
8
- eventBus: events.IEventBus;
9
- logGroup: logs.LogGroup;
10
- logGroupFailure: logs.LogGroup;
11
- logGroupSuccess: logs.LogGroup;
12
- rule: events.Rule;
13
- ruleFailure: events.Rule;
14
- ruleSuccess: events.Rule;
8
+ eventBus: IEventBus;
9
+ logGroup: LogGroup;
10
+ logGroupFailure: LogGroup;
11
+ logGroupSuccess: LogGroup;
12
+ rule: Rule;
13
+ ruleFailure: Rule;
14
+ ruleSuccess: Rule;
15
15
  }
@@ -1,4 +1,4 @@
1
- import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
1
+ import { ISecret } from 'aws-cdk-lib/aws-secretsmanager';
2
2
  import { Construct } from 'constructs';
3
3
  import { CommonConstruct } from '../../common';
4
4
  import { ApiToEventBridgeTargetEventType, ApiToEventBridgeTargetProps, ApiToEventBridgeTargetRestApiType } from './types';
@@ -22,7 +22,7 @@ import { ApiToEventBridgeTargetEventType, ApiToEventBridgeTargetProps, ApiToEven
22
22
  export declare class ApiToEventBridgeTarget extends CommonConstruct {
23
23
  props: ApiToEventBridgeTargetProps;
24
24
  id: string;
25
- applicationSecrets: secretsmanager.ISecret[];
25
+ applicationSecrets: ISecret[];
26
26
  apiEvent: ApiToEventBridgeTargetEventType;
27
27
  apiToEventBridgeTargetRestApi: ApiToEventBridgeTargetRestApiType;
28
28
  apiResource: string;
@@ -42,7 +42,7 @@ export declare class ApiToEventBridgeTarget extends CommonConstruct {
42
42
  */
43
43
  protected resolveCertificate(): void;
44
44
  /**
45
- * @summary Method to create or use an existing eventbus for api payload deliveries
45
+ * @summary Method to create or use an existing event bus for api payload deliveries
46
46
  */
47
47
  protected createApiToEventBridgeTargetEventBus(): void;
48
48
  /**