@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,33 +1,10 @@
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.EcsManager = void 0;
27
- const cdk = __importStar(require("aws-cdk-lib"));
28
- const ecs = __importStar(require("aws-cdk-lib/aws-ecs"));
29
- const ecsPatterns = __importStar(require("aws-cdk-lib/aws-ecs-patterns"));
30
- const utils = __importStar(require("../../../utils"));
4
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
5
+ const aws_ecs_1 = require("aws-cdk-lib/aws-ecs");
6
+ const aws_ecs_patterns_1 = require("aws-cdk-lib/aws-ecs-patterns");
7
+ const utils_1 = require("../../../utils");
31
8
  /**
32
9
  * @classdesc Provides operations on AWS Elastic Container Service.
33
10
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
@@ -36,7 +13,7 @@ const utils = __importStar(require("../../../utils"));
36
13
  * import { CommonConstruct } from '@gradientedge/cdk-utils'
37
14
  *
38
15
  * class CustomConstruct extends CommonConstruct {
39
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
16
+ * constructor(parent: Construct, id: string, props: common.CommonStackProps) {
40
17
  * super(parent, id, props)
41
18
  * this.props = props
42
19
  * this.ecsManager.createEcsCluster('MyCluster', this, vpc)
@@ -55,7 +32,7 @@ class EcsManager {
55
32
  createEcsCluster(id, scope, props, vpc) {
56
33
  if (!props)
57
34
  throw `Ecs Cluster props undefined for ${id}`;
58
- const ecsCluster = new ecs.Cluster(scope, `${id}`, {
35
+ const ecsCluster = new aws_ecs_1.Cluster(scope, `${id}`, {
59
36
  capacity: props.capacity,
60
37
  clusterName: `${props.clusterName}-${scope.props.stage}`,
61
38
  containerInsights: props.containerInsights,
@@ -66,11 +43,11 @@ class EcsManager {
66
43
  });
67
44
  if (props.tags && props.tags.length > 0) {
68
45
  props.tags.forEach(tag => {
69
- cdk.Tags.of(ecsCluster).add(tag.key, tag.value);
46
+ aws_cdk_lib_1.Tags.of(ecsCluster).add(tag.key, tag.value);
70
47
  });
71
48
  }
72
- utils.createCfnOutput(`${id}-clusterArn`, scope, ecsCluster.clusterArn);
73
- utils.createCfnOutput(`${id}-clusterName`, scope, ecsCluster.clusterName);
49
+ (0, utils_1.createCfnOutput)(`${id}-clusterArn`, scope, ecsCluster.clusterArn);
50
+ (0, utils_1.createCfnOutput)(`${id}-clusterName`, scope, ecsCluster.clusterName);
74
51
  return ecsCluster;
75
52
  }
76
53
  /**
@@ -89,8 +66,8 @@ class EcsManager {
89
66
  createEcsFargateTask(id, scope, props, cluster, role, logGroup, containerImage, environment, secrets, command) {
90
67
  if (!props)
91
68
  throw `EcsTask props undefined for ${id}`;
92
- const ecsTask = new ecs.TaskDefinition(scope, `${id}`, {
93
- compatibility: ecs.Compatibility.FARGATE,
69
+ const ecsTask = new aws_ecs_1.TaskDefinition(scope, `${id}`, {
70
+ compatibility: aws_ecs_1.Compatibility.FARGATE,
94
71
  cpu: props.cpu,
95
72
  ephemeralStorageGiB: props.ephemeralStorageGiB,
96
73
  executionRole: role,
@@ -98,13 +75,13 @@ class EcsManager {
98
75
  inferenceAccelerators: props.inferenceAccelerators,
99
76
  ipcMode: props.ipcMode,
100
77
  memoryMiB: props.memoryMiB,
101
- networkMode: ecs.NetworkMode.AWS_VPC,
78
+ networkMode: aws_ecs_1.NetworkMode.AWS_VPC,
102
79
  pidMode: props.pidMode,
103
80
  placementConstraints: props.placementConstraints,
104
81
  proxyConfiguration: props.proxyConfiguration,
105
82
  runtimePlatform: {
106
- cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? ecs.CpuArchitecture.X86_64,
107
- operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? ecs.OperatingSystemFamily.LINUX,
83
+ cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? aws_ecs_1.CpuArchitecture.X86_64,
84
+ operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? aws_ecs_1.OperatingSystemFamily.LINUX,
108
85
  },
109
86
  taskRole: role,
110
87
  volumes: props.volumes,
@@ -115,7 +92,7 @@ class EcsManager {
115
92
  disableNetworking: false,
116
93
  environment: environment,
117
94
  image: containerImage,
118
- logging: ecs.LogDriver.awsLogs({
95
+ logging: aws_ecs_1.LogDriver.awsLogs({
119
96
  logGroup: logGroup,
120
97
  logRetention: props.logging?.logRetention,
121
98
  multilinePattern: props.logging?.multilinePattern,
@@ -127,14 +104,14 @@ class EcsManager {
127
104
  });
128
105
  if (props.tags && props.tags.length > 0) {
129
106
  props.tags.forEach(tag => {
130
- cdk.Tags.of(ecsTask).add(tag.key, tag.value);
107
+ aws_cdk_lib_1.Tags.of(ecsTask).add(tag.key, tag.value);
131
108
  });
132
109
  }
133
- utils.createCfnOutput(`${id}-taskArn`, scope, ecsTask.taskDefinitionArn);
110
+ (0, utils_1.createCfnOutput)(`${id}-taskArn`, scope, ecsTask.taskDefinitionArn);
134
111
  return ecsTask;
135
112
  }
136
113
  /**
137
- * @summary Method to create an application loadbalanced ecs fargate task
114
+ * @summary Method to create an application load balanced ecs fargate task
138
115
  * @param id scoped id of the resource
139
116
  * @param scope scope in which this resource is defined
140
117
  * @param props
@@ -143,10 +120,10 @@ class EcsManager {
143
120
  */
144
121
  createLoadBalancedFargateService(id, scope, props, cluster, logGroup) {
145
122
  if (!props)
146
- throw `EcsLoadbalanced Fargate Serivice props undefined for ${id}`;
123
+ throw `Ecs Load balanced Fargate Service props undefined for ${id}`;
147
124
  if (!props.taskImageOptions)
148
- throw `TaskImageOptions for EcsLoadbalanced Fargate Serivice props undefined for ${id}`;
149
- const fargateService = new ecsPatterns.ApplicationLoadBalancedFargateService(scope, `${id}-ecs-service`, {
125
+ throw `TaskImageOptions for Ecs Load balanced Fargate Service props undefined for ${id}`;
126
+ const fargateService = new aws_ecs_patterns_1.ApplicationLoadBalancedFargateService(scope, `${id}-ecs-service`, {
150
127
  assignPublicIp: props.assignPublicIp ?? true,
151
128
  certificate: props.certificate,
152
129
  cluster: cluster,
@@ -155,13 +132,13 @@ class EcsManager {
155
132
  domainName: props.domainName,
156
133
  domainZone: props.domainZone,
157
134
  enableECSManagedTags: true,
158
- healthCheckGracePeriod: props.healthCheckGracePeriod ?? cdk.Duration.seconds(60),
135
+ healthCheckGracePeriod: props.healthCheckGracePeriod ?? aws_cdk_lib_1.Duration.seconds(60),
159
136
  listenerPort: props.listenerPort,
160
137
  loadBalancerName: `${id}-${scope.props.stage}`,
161
138
  memoryLimitMiB: props.memoryLimitMiB,
162
139
  runtimePlatform: {
163
- cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? ecs.CpuArchitecture.X86_64,
164
- operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? ecs.OperatingSystemFamily.LINUX,
140
+ cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? aws_ecs_1.CpuArchitecture.X86_64,
141
+ operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? aws_ecs_1.OperatingSystemFamily.LINUX,
165
142
  },
166
143
  serviceName: `${id}-${scope.props.stage}`,
167
144
  taskImageOptions: {
@@ -171,7 +148,7 @@ class EcsManager {
171
148
  executionRole: props.taskImageOptions?.executionRole,
172
149
  image: props.taskImageOptions.image,
173
150
  logDriver: props.taskImageOptions?.logDriver ??
174
- ecs.LogDriver.awsLogs({
151
+ aws_ecs_1.LogDriver.awsLogs({
175
152
  logGroup: logGroup,
176
153
  logRetention: props.logging?.logRetention,
177
154
  multilinePattern: props.logging?.multilinePattern,
@@ -187,11 +164,11 @@ class EcsManager {
187
164
  healthyGrpcCodes: props.healthCheck.healthyGrpcCodes,
188
165
  healthyHttpCodes: props.healthCheck.healthyHttpCodes,
189
166
  healthyThresholdCount: props.healthCheck.healthyThresholdCount,
190
- interval: props.healthCheck.interval ?? cdk.Duration.seconds(props.healthCheck.intervalInSecs),
167
+ interval: props.healthCheck.interval ?? aws_cdk_lib_1.Duration.seconds(props.healthCheck.intervalInSecs),
191
168
  path: props.healthCheck.path ?? '/',
192
169
  port: props.healthCheck.port,
193
170
  protocol: props.healthCheck.protocol,
194
- timeout: props.healthCheck.timeout ?? cdk.Duration.seconds(props.healthCheck.timeoutInSecs),
171
+ timeout: props.healthCheck.timeout ?? aws_cdk_lib_1.Duration.seconds(props.healthCheck.timeoutInSecs),
195
172
  unhealthyThresholdCount: props.healthCheck.unhealthyThresholdCount,
196
173
  });
197
174
  }
@@ -1,8 +1,8 @@
1
- import { TagProps } from '../../../types';
2
- import { AwsLogDriverProps, ClusterProps, MountPoint, TaskDefinitionProps } from 'aws-cdk-lib/aws-ecs';
3
1
  import { ScalingSchedule } from 'aws-cdk-lib/aws-applicationautoscaling';
2
+ import { AwsLogDriverProps, ClusterProps, MountPoint, TaskDefinitionProps } from 'aws-cdk-lib/aws-ecs';
4
3
  import { ApplicationLoadBalancedFargateServiceProps } from 'aws-cdk-lib/aws-ecs-patterns';
5
- import * as elb from 'aws-cdk-lib/aws-elasticloadbalancingv2';
4
+ import { HealthCheck as ElbHealthCheck } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
5
+ import { TagProps } from '../../../types';
6
6
  /**
7
7
  */
8
8
  export interface EcsClusterProps extends ClusterProps {
@@ -24,7 +24,7 @@ export interface EcsScalingProps {
24
24
  }
25
25
  /**
26
26
  */
27
- export interface HealthCheck extends elb.HealthCheck {
27
+ export interface HealthCheck extends ElbHealthCheck {
28
28
  intervalInSecs: number;
29
29
  timeoutInSecs: number;
30
30
  }
@@ -1,5 +1,5 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- import * as efs from 'aws-cdk-lib/aws-efs';
1
+ import { ISecurityGroup, IVpc, SubnetSelection } from 'aws-cdk-lib/aws-ec2';
2
+ import { FileSystem } from 'aws-cdk-lib/aws-efs';
3
3
  import { CommonConstruct } from '../../../common';
4
4
  import { EfsAccessPointOptions, EfsFileSystemProps } from './types';
5
5
  export declare const DEFAULT_CREATE_ACL: {
@@ -38,5 +38,5 @@ export declare class EfsManager {
38
38
  * @param securityGroup optional security groups to configure for the file system
39
39
  * @param vpcSubnets optional subnets to configure for the file system
40
40
  */
41
- createFileSystem(id: string, scope: CommonConstruct, props: EfsFileSystemProps, vpc: ec2.IVpc, accessPointOptions?: EfsAccessPointOptions[], securityGroup?: ec2.ISecurityGroup, vpcSubnets?: ec2.SubnetSelection): efs.FileSystem;
41
+ createFileSystem(id: string, scope: CommonConstruct, props: EfsFileSystemProps, vpc: IVpc, accessPointOptions?: EfsAccessPointOptions[], securityGroup?: ISecurityGroup, vpcSubnets?: SubnetSelection): FileSystem;
42
42
  }
@@ -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.EfsManager = exports.DEFAULT_POSIX_USER = exports.DEFAULT_CREATE_ACL = void 0;
27
- const efs = __importStar(require("aws-cdk-lib/aws-efs"));
28
- const cdk = __importStar(require("aws-cdk-lib"));
29
- const utils = __importStar(require("../../../utils"));
4
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
5
+ const aws_efs_1 = require("aws-cdk-lib/aws-efs");
6
+ const utils_1 = require("../../../utils");
30
7
  exports.DEFAULT_CREATE_ACL = {
31
8
  ownerGid: '1000',
32
9
  ownerUid: '1000',
@@ -67,19 +44,19 @@ class EfsManager {
67
44
  if (!props)
68
45
  throw `EFS props undefined for ${id}`;
69
46
  const fileSystemId = props.provisionNewOnDeployment ? `${id}-${new Date().getMilliseconds()}` : `${id}`;
70
- const fileSystem = new efs.FileSystem(scope, `${fileSystemId}`, {
47
+ const fileSystem = new aws_efs_1.FileSystem(scope, `${fileSystemId}`, {
71
48
  ...props,
72
49
  fileSystemName: props.fileSystemName ? `${props.fileSystemName}-${scope.props.stage}` : undefined,
73
- lifecyclePolicy: props.lifecyclePolicy ?? efs.LifecyclePolicy.AFTER_7_DAYS,
74
- outOfInfrequentAccessPolicy: props.outOfInfrequentAccessPolicy ?? efs.OutOfInfrequentAccessPolicy.AFTER_1_ACCESS,
75
- performanceMode: props.performanceMode ?? efs.PerformanceMode.GENERAL_PURPOSE,
76
- removalPolicy: props.removalPolicy ?? cdk.RemovalPolicy.DESTROY,
50
+ lifecyclePolicy: props.lifecyclePolicy ?? aws_efs_1.LifecyclePolicy.AFTER_7_DAYS,
51
+ outOfInfrequentAccessPolicy: props.outOfInfrequentAccessPolicy ?? aws_efs_1.OutOfInfrequentAccessPolicy.AFTER_1_ACCESS,
52
+ performanceMode: props.performanceMode ?? aws_efs_1.PerformanceMode.GENERAL_PURPOSE,
53
+ removalPolicy: props.removalPolicy ?? aws_cdk_lib_1.RemovalPolicy.DESTROY,
77
54
  securityGroup,
78
55
  vpc,
79
56
  vpcSubnets,
80
57
  });
81
- utils.createCfnOutput(`${id}-fileSystemArn`, scope, fileSystem.fileSystemArn);
82
- utils.createCfnOutput(`${id}-fileSystemId`, scope, fileSystem.fileSystemId);
58
+ (0, utils_1.createCfnOutput)(`${id}-fileSystemArn`, scope, fileSystem.fileSystemArn);
59
+ (0, utils_1.createCfnOutput)(`${id}-fileSystemId`, scope, fileSystem.fileSystemId);
83
60
  /* provision access points if specified */
84
61
  if (accessPointOptions && accessPointOptions.length > 0) {
85
62
  for (const [index, accessPointOption] of accessPointOptions.entries()) {
@@ -90,8 +67,8 @@ class EfsManager {
90
67
  path: accessPointOption.path,
91
68
  posixUser: accessPointOption.posixUser ?? exports.DEFAULT_POSIX_USER,
92
69
  });
93
- utils.createCfnOutput(`${id}-accessPointArn-${index}`, scope, accessPoint.accessPointArn);
94
- utils.createCfnOutput(`${id}-accessPointId-${index}`, scope, accessPoint.accessPointId);
70
+ (0, utils_1.createCfnOutput)(`${id}-accessPointArn-${index}`, scope, accessPoint.accessPointArn);
71
+ (0, utils_1.createCfnOutput)(`${id}-accessPointId-${index}`, scope, accessPoint.accessPointId);
95
72
  }
96
73
  }
97
74
  return fileSystem;
@@ -1,6 +1,6 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- import * as ecr from 'aws-cdk-lib/aws-ecr-assets';
3
- import * as eks from 'aws-cdk-lib/aws-eks';
1
+ import { IVpc } from 'aws-cdk-lib/aws-ec2';
2
+ import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
3
+ import { Cluster } from 'aws-cdk-lib/aws-eks';
4
4
  import { CommonConstruct } from '../../../common';
5
5
  import { EksClusterProps } from './types';
6
6
  /**
@@ -28,5 +28,5 @@ export declare class EksManager {
28
28
  * @param image
29
29
  * @param vpc
30
30
  */
31
- createEksDeployment(id: string, scope: CommonConstruct, props: EksClusterProps, image: ecr.DockerImageAsset, vpc: ec2.IVpc): eks.Cluster;
31
+ createEksDeployment(id: string, scope: CommonConstruct, props: EksClusterProps, image: DockerImageAsset, vpc: IVpc): Cluster;
32
32
  }
@@ -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.EksManager = void 0;
27
- const ec2 = __importStar(require("aws-cdk-lib/aws-ec2"));
28
- const eks = __importStar(require("aws-cdk-lib/aws-eks"));
29
- const utils = __importStar(require("../../../utils"));
4
+ const aws_ec2_1 = require("aws-cdk-lib/aws-ec2");
5
+ const aws_eks_1 = require("aws-cdk-lib/aws-eks");
6
+ const utils_1 = require("../../../utils");
30
7
  /**
31
8
  * @classdesc Provides operations on AWS Elastic Kubernetes Service.
32
9
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
@@ -93,16 +70,16 @@ class EksManager {
93
70
  type: 'LoadBalancer',
94
71
  },
95
72
  };
96
- const cluster = new eks.Cluster(scope, `${id}Cluster`, {
73
+ const cluster = new aws_eks_1.Cluster(scope, `${id}Cluster`, {
97
74
  clusterName: `${id.toLowerCase()}-${scope.props.stage}`,
98
75
  defaultCapacity: props.appCapacity,
99
- defaultCapacityInstance: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.LARGE),
100
- version: eks.KubernetesVersion.V1_18,
76
+ defaultCapacityInstance: aws_ec2_1.InstanceType.of(aws_ec2_1.InstanceClass.T3, aws_ec2_1.InstanceSize.LARGE),
77
+ version: aws_eks_1.KubernetesVersion.V1_27,
101
78
  vpc,
102
79
  });
103
80
  cluster.addManifest(`${id}Pod`, service, deployment);
104
- utils.createCfnOutput(`${id}-clusterArn`, scope, cluster.clusterArn);
105
- utils.createCfnOutput(`${id}-clusterEndpoint`, scope, cluster.clusterEndpoint);
81
+ (0, utils_1.createCfnOutput)(`${id}-clusterArn`, scope, cluster.clusterArn);
82
+ (0, utils_1.createCfnOutput)(`${id}-clusterEndpoint`, scope, cluster.clusterEndpoint);
106
83
  return cluster;
107
84
  }
108
85
  }
@@ -1,4 +1,4 @@
1
- import * as elasticache from 'aws-cdk-lib/aws-elasticache';
1
+ import { CfnCacheCluster, CfnReplicationGroup, CfnSubnetGroup } from 'aws-cdk-lib/aws-elasticache';
2
2
  import { CommonConstruct } from '../../../common';
3
3
  import { ElastiCacheProps, ReplicatedElastiCacheProps } from './types';
4
4
  /**
@@ -24,7 +24,7 @@ export declare class ElastiCacheManager {
24
24
  * @param scope scope in which scope resource is defined
25
25
  * @param subnetIds
26
26
  */
27
- createElastiCacheSubnetGroup(id: string, scope: CommonConstruct, subnetIds: string[]): elasticache.CfnSubnetGroup;
27
+ createElastiCacheSubnetGroup(id: string, scope: CommonConstruct, subnetIds: string[]): CfnSubnetGroup;
28
28
  /**
29
29
  * @summary Method to create an elasticache resource
30
30
  * @param id scoped id of the resource
@@ -34,7 +34,7 @@ export declare class ElastiCacheManager {
34
34
  * @param securityGroupIds
35
35
  * @param logDeliveryConfigurations
36
36
  */
37
- createElastiCache(id: string, scope: CommonConstruct, props: ElastiCacheProps, subnetIds: string[], securityGroupIds: string[], logDeliveryConfigurations?: any): elasticache.CfnCacheCluster;
37
+ createElastiCache(id: string, scope: CommonConstruct, props: ElastiCacheProps, subnetIds: string[], securityGroupIds: string[], logDeliveryConfigurations?: any): CfnCacheCluster;
38
38
  /**
39
39
  * @summary Method to create an replicated elasticache resource
40
40
  * @param id scoped id of the resource
@@ -43,5 +43,5 @@ export declare class ElastiCacheManager {
43
43
  * @param subnetIds
44
44
  * @param securityGroupIds
45
45
  */
46
- createReplicatedElastiCache(id: string, scope: CommonConstruct, props: ReplicatedElastiCacheProps, subnetIds: string[], securityGroupIds: string[]): elasticache.CfnReplicationGroup;
46
+ createReplicatedElastiCache(id: string, scope: CommonConstruct, props: ReplicatedElastiCacheProps, subnetIds: string[], securityGroupIds: string[]): CfnReplicationGroup;
47
47
  }
@@ -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.ElastiCacheManager = void 0;
27
- const elasticache = __importStar(require("aws-cdk-lib/aws-elasticache"));
28
- const utils = __importStar(require("../../../utils"));
29
- const cdk = __importStar(require("aws-cdk-lib"));
4
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
5
+ const aws_elasticache_1 = require("aws-cdk-lib/aws-elasticache");
6
+ const utils_1 = require("../../../utils");
30
7
  /**
31
8
  * @summary Provides operations on AWS ElastiCache Service.
32
9
  * - A new instance of scope class is injected into {@link CommonConstruct} constructor.
@@ -51,7 +28,7 @@ class ElastiCacheManager {
51
28
  * @param subnetIds
52
29
  */
53
30
  createElastiCacheSubnetGroup(id, scope, subnetIds) {
54
- return new elasticache.CfnSubnetGroup(scope, `${id}`, {
31
+ return new aws_elasticache_1.CfnSubnetGroup(scope, `${id}`, {
55
32
  cacheSubnetGroupName: `${id}-subnet-group-${scope.props.stage}`,
56
33
  description: `${id}-subnet-group-${scope.props.stage}`,
57
34
  subnetIds: subnetIds,
@@ -70,7 +47,7 @@ class ElastiCacheManager {
70
47
  if (!props)
71
48
  throw `ElastiCache props undefined for ${id}`;
72
49
  const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds);
73
- const elasticacheCluster = new elasticache.CfnCacheCluster(scope, `${id}`, {
50
+ const elasticacheCluster = new aws_elasticache_1.CfnCacheCluster(scope, `${id}`, {
74
51
  autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
75
52
  azMode: props.azMode,
76
53
  cacheNodeType: props.cacheNodeType,
@@ -94,12 +71,12 @@ class ElastiCacheManager {
94
71
  elasticacheCluster.addDependency(subnetGroup);
95
72
  if (props.tags && props.tags.length > 0) {
96
73
  props.tags.forEach(tag => {
97
- cdk.Tags.of(elasticacheCluster).add(tag.key, tag.value);
74
+ aws_cdk_lib_1.Tags.of(elasticacheCluster).add(tag.key, tag.value);
98
75
  });
99
76
  }
100
- utils.createCfnOutput(`${id}-clusterName`, scope, elasticacheCluster.clusterName);
101
- utils.createCfnOutput(`${id}-redisEndpointPort`, scope, elasticacheCluster.attrRedisEndpointPort);
102
- utils.createCfnOutput(`${id}-redisEndpointAddress`, scope, elasticacheCluster.attrRedisEndpointAddress);
77
+ (0, utils_1.createCfnOutput)(`${id}-clusterName`, scope, elasticacheCluster.clusterName);
78
+ (0, utils_1.createCfnOutput)(`${id}-redisEndpointPort`, scope, elasticacheCluster.attrRedisEndpointPort);
79
+ (0, utils_1.createCfnOutput)(`${id}-redisEndpointAddress`, scope, elasticacheCluster.attrRedisEndpointAddress);
103
80
  return elasticacheCluster;
104
81
  }
105
82
  /**
@@ -114,7 +91,7 @@ class ElastiCacheManager {
114
91
  if (!props)
115
92
  throw `ElastiCache props undefined for ${id}`;
116
93
  const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds);
117
- const elasticacheCluster = new elasticache.CfnReplicationGroup(scope, `${id}`, {
94
+ const elasticacheCluster = new aws_elasticache_1.CfnReplicationGroup(scope, `${id}`, {
118
95
  autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
119
96
  automaticFailoverEnabled: props.automaticFailoverEnabled,
120
97
  cacheNodeType: props.cacheNodeType,
@@ -1,10 +1,10 @@
1
- import * as ecs from 'aws-cdk-lib/aws-ecs';
2
- import * as events from 'aws-cdk-lib/aws-events';
3
- import * as iam from 'aws-cdk-lib/aws-iam';
4
- import * as lambda from 'aws-cdk-lib/aws-lambda';
5
- import * as cdk from 'aws-cdk-lib';
6
- import * as sqs from 'aws-cdk-lib/aws-sqs';
7
- import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
1
+ import { ICluster, ITaskDefinition } from 'aws-cdk-lib/aws-ecs';
2
+ import { CfnRule, EventBus, IEventBus, IRuleTarget, Rule } from 'aws-cdk-lib/aws-events';
3
+ import { CfnRole, Role } from 'aws-cdk-lib/aws-iam';
4
+ import { IFunction } from 'aws-cdk-lib/aws-lambda';
5
+ import { CfnPipe } from 'aws-cdk-lib/aws-pipes';
6
+ import { IQueue } from 'aws-cdk-lib/aws-sqs';
7
+ import { IStateMachine } from 'aws-cdk-lib/aws-stepfunctions';
8
8
  import { CommonConstruct } from '../../../common';
9
9
  import { EventBusProps, EventRuleProps, RuleProps, SqsToSfnPipeProps } from './types';
10
10
  /**
@@ -15,7 +15,7 @@ import { EventBusProps, EventRuleProps, RuleProps, SqsToSfnPipeProps } from './t
15
15
  * import { CommonConstruct } from '@gradientedge/cdk-utils'
16
16
  *
17
17
  * class CustomConstruct extends CommonConstruct {
18
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
18
+ * constructor(parent: Construct, id: string, props: common.CommonStackProps) {
19
19
  * super(parent, id, props)
20
20
  * this.props = props
21
21
  * this.eventManager.createLambdaRule('MyLambdaRule', this, lambdaFunction)
@@ -30,7 +30,7 @@ export declare class EventManager {
30
30
  * @param scope scope in which this resource is defined
31
31
  * @param props event bus properties
32
32
  */
33
- createEventBus(id: string, scope: CommonConstruct, props: EventBusProps): events.EventBus;
33
+ createEventBus(id: string, scope: CommonConstruct, props: EventBusProps): EventBus;
34
34
  /**
35
35
  * Method to create an event rule
36
36
  * @param id scoped id of the resource
@@ -39,7 +39,7 @@ export declare class EventManager {
39
39
  * @param eventBus optional custom event bus
40
40
  * @param targets optional event targets
41
41
  */
42
- createRule(id: string, scope: CommonConstruct, props: EventRuleProps, eventBus?: events.IEventBus, targets?: events.IRuleTarget[]): events.Rule;
42
+ createRule(id: string, scope: CommonConstruct, props: EventRuleProps, eventBus?: IEventBus, targets?: IRuleTarget[]): Rule;
43
43
  /**
44
44
  * @summary Method to create an eventbridge rule with lambda target
45
45
  * @param id scoped id of the resource
@@ -50,7 +50,7 @@ export declare class EventManager {
50
50
  * @param eventPattern
51
51
  * @param scheduleExpression
52
52
  */
53
- createLambdaRule(id: string, scope: CommonConstruct, props: RuleProps, lambdaFunction: lambda.Function, eventBusName?: string, eventPattern?: any, scheduleExpression?: string): events.CfnRule;
53
+ createLambdaRule(id: string, scope: CommonConstruct, props: RuleProps, lambdaFunction: IFunction, eventBusName?: string, eventPattern?: any, scheduleExpression?: string): CfnRule;
54
54
  /**
55
55
  * @summary Method to create an eventbridge rule with fargate task target
56
56
  * @param id scoped id of the resource
@@ -62,7 +62,7 @@ export declare class EventManager {
62
62
  * @param role
63
63
  * @param eventPattern
64
64
  */
65
- createFargateTaskRule(id: string, scope: CommonConstruct, props: RuleProps, cluster: ecs.ICluster, task: ecs.ITaskDefinition, subnetIds: string[], role: iam.Role | iam.CfnRole, eventPattern?: any): events.CfnRule;
65
+ createFargateTaskRule(id: string, scope: CommonConstruct, props: RuleProps, cluster: ICluster, task: ITaskDefinition, subnetIds: string[], role: Role | CfnRole, eventPattern?: any): CfnRule;
66
66
  /**
67
67
  * @summary Method to create an eventbridge pipe with sqs queue as source and step function as target
68
68
  * @param id scoped id of the resource
@@ -71,5 +71,5 @@ export declare class EventManager {
71
71
  * @param sourceQueue the source sqs queue
72
72
  * @param targetStepFunction the target step function
73
73
  */
74
- createSqsToSfnCfnPipe(id: string, scope: CommonConstruct, props: SqsToSfnPipeProps, sourceQueue: sqs.IQueue, targetStepFunction: sfn.IStateMachine): cdk.aws_pipes.CfnPipe;
74
+ createSqsToSfnCfnPipe(id: string, scope: CommonConstruct, props: SqsToSfnPipeProps, sourceQueue: IQueue, targetStepFunction: IStateMachine): CfnPipe;
75
75
  }