@gradientedge/cdk-utils 4.2.0 → 4.3.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 (231) hide show
  1. package/dist/index.d.ts +3 -25
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +3 -25
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/lib/common/commonConstruct.d.ts +26 -45
  6. package/dist/src/lib/common/commonConstruct.d.ts.map +1 -1
  7. package/dist/src/lib/common/commonConstruct.js +50 -49
  8. package/dist/src/lib/common/commonConstruct.js.map +1 -1
  9. package/dist/src/lib/common/commonStack.d.ts +1 -1
  10. package/dist/src/lib/common/commonStack.d.ts.map +1 -1
  11. package/dist/src/lib/common/commonStack.js.map +1 -1
  12. package/dist/src/lib/common/index.d.ts +3 -0
  13. package/dist/src/lib/common/index.d.ts.map +1 -0
  14. package/dist/src/lib/common/index.js +15 -0
  15. package/dist/src/lib/common/index.js.map +1 -0
  16. package/dist/src/lib/construct/graphQLApiLambda.d.ts +5 -5
  17. package/dist/src/lib/construct/graphQLApiLambda.d.ts.map +1 -1
  18. package/dist/src/lib/construct/graphQLApiLambda.js +2 -2
  19. package/dist/src/lib/construct/graphQLApiLambda.js.map +1 -1
  20. package/dist/src/lib/construct/index.d.ts +4 -0
  21. package/dist/src/lib/construct/index.d.ts.map +1 -0
  22. package/dist/src/lib/construct/index.js +16 -0
  23. package/dist/src/lib/construct/index.js.map +1 -0
  24. package/dist/src/lib/construct/siteWithEcsBackend.d.ts +8 -8
  25. package/dist/src/lib/construct/siteWithEcsBackend.d.ts.map +1 -1
  26. package/dist/src/lib/construct/siteWithEcsBackend.js +4 -4
  27. package/dist/src/lib/construct/siteWithEcsBackend.js.map +1 -1
  28. package/dist/src/lib/construct/staticSite.d.ts +5 -5
  29. package/dist/src/lib/construct/staticSite.d.ts.map +1 -1
  30. package/dist/src/lib/construct/staticSite.js +1 -1
  31. package/dist/src/lib/construct/staticSite.js.map +1 -1
  32. package/dist/src/lib/manager/{acmManager.d.ts → aws/acmManager.d.ts} +7 -7
  33. package/dist/src/lib/manager/aws/acmManager.d.ts.map +1 -0
  34. package/dist/src/lib/manager/{acmManager.js → aws/acmManager.js} +7 -7
  35. package/dist/src/lib/manager/aws/acmManager.js.map +1 -0
  36. package/dist/src/lib/manager/{apiManager.d.ts → aws/apiManager.d.ts} +10 -10
  37. package/dist/src/lib/manager/aws/apiManager.d.ts.map +1 -0
  38. package/dist/src/lib/manager/{apiManager.js → aws/apiManager.js} +12 -14
  39. package/dist/src/lib/manager/aws/apiManager.js.map +1 -0
  40. package/dist/src/lib/manager/{appConfigManager.d.ts → aws/appConfigManager.d.ts} +16 -16
  41. package/dist/src/lib/manager/aws/appConfigManager.d.ts.map +1 -0
  42. package/dist/src/lib/manager/{appConfigManager.js → aws/appConfigManager.js} +18 -18
  43. package/dist/src/lib/manager/aws/appConfigManager.js.map +1 -0
  44. package/dist/src/lib/manager/{cloudFrontManager.d.ts → aws/cloudFrontManager.d.ts} +26 -25
  45. package/dist/src/lib/manager/aws/cloudFrontManager.d.ts.map +1 -0
  46. package/dist/src/lib/manager/{cloudFrontManager.js → aws/cloudFrontManager.js} +26 -26
  47. package/dist/src/lib/manager/aws/cloudFrontManager.js.map +1 -0
  48. package/dist/src/lib/manager/{cloudTrailManager.d.ts → aws/cloudTrailManager.d.ts} +8 -8
  49. package/dist/src/lib/manager/aws/cloudTrailManager.d.ts.map +1 -0
  50. package/dist/src/lib/manager/{cloudTrailManager.js → aws/cloudTrailManager.js} +8 -8
  51. package/dist/src/lib/manager/aws/cloudTrailManager.js.map +1 -0
  52. package/dist/src/lib/manager/aws/cloudWatchManager.d.ts +121 -0
  53. package/dist/src/lib/manager/aws/cloudWatchManager.d.ts.map +1 -0
  54. package/dist/src/lib/manager/{cloudWatchManager.js → aws/cloudWatchManager.js} +46 -35
  55. package/dist/src/lib/manager/aws/cloudWatchManager.js.map +1 -0
  56. package/dist/src/lib/manager/{codeBuildManager.d.ts → aws/codeBuildManager.d.ts} +7 -8
  57. package/dist/src/lib/manager/aws/codeBuildManager.d.ts.map +1 -0
  58. package/dist/src/lib/manager/{codeBuildManager.js → aws/codeBuildManager.js} +5 -5
  59. package/dist/src/lib/manager/aws/codeBuildManager.js.map +1 -0
  60. package/dist/src/lib/manager/aws/dynamodbManager.d.ts +32 -0
  61. package/dist/src/lib/manager/aws/dynamodbManager.d.ts.map +1 -0
  62. package/dist/src/lib/manager/aws/dynamodbManager.js +79 -0
  63. package/dist/src/lib/manager/aws/dynamodbManager.js.map +1 -0
  64. package/dist/src/lib/manager/{ecrManager.d.ts → aws/ecrManager.d.ts} +6 -6
  65. package/dist/src/lib/manager/aws/ecrManager.d.ts.map +1 -0
  66. package/dist/src/lib/manager/{ecrManager.js → aws/ecrManager.js} +6 -6
  67. package/dist/src/lib/manager/aws/ecrManager.js.map +1 -0
  68. package/dist/src/lib/manager/{ecsManager.d.ts → aws/ecsManager.d.ts} +11 -11
  69. package/dist/src/lib/manager/aws/ecsManager.d.ts.map +1 -0
  70. package/dist/src/lib/manager/{ecsManager.js → aws/ecsManager.js} +11 -11
  71. package/dist/src/lib/manager/aws/ecsManager.js.map +1 -0
  72. package/dist/src/lib/manager/{eksManager.d.ts → aws/eksManager.d.ts} +8 -8
  73. package/dist/src/lib/manager/aws/eksManager.d.ts.map +1 -0
  74. package/dist/src/lib/manager/{eksManager.js → aws/eksManager.js} +8 -8
  75. package/dist/src/lib/manager/aws/eksManager.js.map +1 -0
  76. package/dist/src/lib/manager/{eventManager.d.ts → aws/eventManager.d.ts} +11 -11
  77. package/dist/src/lib/manager/aws/eventManager.d.ts.map +1 -0
  78. package/dist/src/lib/manager/{eventManager.js → aws/eventManager.js} +12 -12
  79. package/dist/src/lib/manager/aws/eventManager.js.map +1 -0
  80. package/dist/src/lib/manager/aws/iamManager.d.ts +156 -0
  81. package/dist/src/lib/manager/aws/iamManager.d.ts.map +1 -0
  82. package/dist/src/lib/manager/{iamManager.js → aws/iamManager.js} +35 -34
  83. package/dist/src/lib/manager/aws/iamManager.js.map +1 -0
  84. package/dist/src/lib/manager/aws/index.d.ts +23 -0
  85. package/dist/src/lib/manager/aws/index.d.ts.map +1 -0
  86. package/dist/src/lib/manager/aws/index.js +35 -0
  87. package/dist/src/lib/manager/aws/index.js.map +1 -0
  88. package/dist/src/lib/manager/{lambdaManager.d.ts → aws/lambdaManager.d.ts} +19 -19
  89. package/dist/src/lib/manager/aws/lambdaManager.d.ts.map +1 -0
  90. package/dist/src/lib/manager/{lambdaManager.js → aws/lambdaManager.js} +19 -19
  91. package/dist/src/lib/manager/aws/lambdaManager.js.map +1 -0
  92. package/dist/src/lib/manager/{logManager.d.ts → aws/logManager.d.ts} +14 -14
  93. package/dist/src/lib/manager/aws/logManager.d.ts.map +1 -0
  94. package/dist/src/lib/manager/{logManager.js → aws/logManager.js} +12 -12
  95. package/dist/src/lib/manager/aws/logManager.js.map +1 -0
  96. package/dist/src/lib/manager/{route53Manager.d.ts → aws/route53Manager.d.ts} +16 -16
  97. package/dist/src/lib/manager/aws/route53Manager.d.ts.map +1 -0
  98. package/dist/src/lib/manager/{route53Manager.js → aws/route53Manager.js} +17 -17
  99. package/dist/src/lib/manager/aws/route53Manager.js.map +1 -0
  100. package/dist/src/lib/manager/aws/s3Manager.d.ts +73 -0
  101. package/dist/src/lib/manager/aws/s3Manager.d.ts.map +1 -0
  102. package/dist/src/lib/manager/{s3Manager.js → aws/s3Manager.js} +15 -15
  103. package/dist/src/lib/manager/aws/s3Manager.js.map +1 -0
  104. package/dist/src/lib/manager/{secretsManager.d.ts → aws/secretsManager.d.ts} +5 -5
  105. package/dist/src/lib/manager/aws/secretsManager.d.ts.map +1 -0
  106. package/dist/src/lib/manager/{secretsManager.js → aws/secretsManager.js} +3 -3
  107. package/dist/src/lib/manager/aws/secretsManager.js.map +1 -0
  108. package/dist/src/lib/manager/{snsManager.d.ts → aws/snsManager.d.ts} +11 -11
  109. package/dist/src/lib/manager/aws/snsManager.d.ts.map +1 -0
  110. package/dist/src/lib/manager/{snsManager.js → aws/snsManager.js} +12 -12
  111. package/dist/src/lib/manager/aws/snsManager.js.map +1 -0
  112. package/dist/src/lib/manager/{ssmManager.d.ts → aws/ssmManager.d.ts} +16 -16
  113. package/dist/src/lib/manager/aws/ssmManager.d.ts.map +1 -0
  114. package/dist/src/lib/manager/{ssmManager.js → aws/ssmManager.js} +13 -13
  115. package/dist/src/lib/manager/aws/ssmManager.js.map +1 -0
  116. package/dist/src/lib/manager/{vpcManager.d.ts → aws/vpcManager.d.ts} +10 -10
  117. package/dist/src/lib/manager/aws/vpcManager.d.ts.map +1 -0
  118. package/dist/src/lib/manager/{vpcManager.js → aws/vpcManager.js} +13 -13
  119. package/dist/src/lib/manager/aws/vpcManager.js.map +1 -0
  120. package/dist/src/lib/manager/aws/wafManager.d.ts +39 -0
  121. package/dist/src/lib/manager/aws/wafManager.d.ts.map +1 -0
  122. package/dist/src/lib/manager/{wafManager.js → aws/wafManager.js} +12 -12
  123. package/dist/src/lib/manager/aws/wafManager.js.map +1 -0
  124. package/dist/src/lib/manager/index.d.ts +2 -0
  125. package/dist/src/lib/manager/index.d.ts.map +1 -0
  126. package/dist/src/lib/manager/index.js +14 -0
  127. package/dist/src/lib/manager/index.js.map +1 -0
  128. package/dist/src/lib/{types.d.ts → types/aws/index.d.ts} +22 -16
  129. package/dist/src/lib/types/aws/index.d.ts.map +1 -0
  130. package/dist/src/lib/{types.js → types/aws/index.js} +1 -1
  131. package/dist/src/lib/types/aws/index.js.map +1 -0
  132. package/dist/src/lib/types/index.d.ts +2 -0
  133. package/dist/src/lib/types/index.d.ts.map +1 -0
  134. package/dist/src/lib/types/index.js +14 -0
  135. package/dist/src/lib/types/index.js.map +1 -0
  136. package/dist/src/lib/utils/aws/index.d.ts +16 -0
  137. package/dist/src/lib/utils/aws/index.d.ts.map +1 -0
  138. package/dist/src/lib/utils/aws/index.js +50 -0
  139. package/dist/src/lib/utils/aws/index.js.map +1 -0
  140. package/dist/src/lib/{utils.d.ts → utils/index.d.ts} +2 -26
  141. package/dist/src/lib/utils/index.d.ts.map +1 -0
  142. package/dist/src/lib/utils/index.js +85 -0
  143. package/dist/src/lib/utils/index.js.map +1 -0
  144. package/index.ts +3 -25
  145. package/package.json +19 -16
  146. package/src/lib/common/commonConstruct.ts +55 -73
  147. package/src/lib/common/commonStack.ts +1 -1
  148. package/src/lib/common/index.ts +2 -0
  149. package/src/lib/construct/graphQLApiLambda.ts +5 -5
  150. package/src/lib/construct/index.ts +3 -0
  151. package/src/lib/construct/siteWithEcsBackend.ts +9 -9
  152. package/src/lib/construct/staticSite.ts +5 -5
  153. package/src/lib/manager/{acmManager.ts → aws/acmManager.ts} +11 -11
  154. package/src/lib/manager/{apiManager.ts → aws/apiManager.ts} +16 -18
  155. package/src/lib/manager/{appConfigManager.ts → aws/appConfigManager.ts} +30 -26
  156. package/src/lib/manager/{cloudFrontManager.ts → aws/cloudFrontManager.ts} +42 -42
  157. package/src/lib/manager/{cloudTrailManager.ts → aws/cloudTrailManager.ts} +12 -12
  158. package/src/lib/manager/{cloudWatchManager.ts → aws/cloudWatchManager.ts} +78 -56
  159. package/src/lib/manager/{codeBuildManager.ts → aws/codeBuildManager.ts} +8 -8
  160. package/src/lib/manager/aws/dynamodbManager.ts +60 -0
  161. package/src/lib/manager/{ecrManager.ts → aws/ecrManager.ts} +8 -8
  162. package/src/lib/manager/{ecsManager.ts → aws/ecsManager.ts} +16 -16
  163. package/src/lib/manager/{eksManager.ts → aws/eksManager.ts} +12 -12
  164. package/src/lib/manager/{eventManager.ts → aws/eventManager.ts} +18 -18
  165. package/src/lib/manager/{iamManager.ts → aws/iamManager.ts} +65 -54
  166. package/src/lib/manager/aws/index.ts +22 -0
  167. package/src/lib/manager/{lambdaManager.ts → aws/lambdaManager.ts} +29 -29
  168. package/src/lib/manager/{logManager.ts → aws/logManager.ts} +22 -17
  169. package/src/lib/manager/{route53Manager.ts → aws/route53Manager.ts} +24 -24
  170. package/src/lib/manager/{s3Manager.ts → aws/s3Manager.ts} +24 -24
  171. package/src/lib/manager/{secretsManager.ts → aws/secretsManager.ts} +10 -5
  172. package/src/lib/manager/{snsManager.ts → aws/snsManager.ts} +18 -18
  173. package/src/lib/manager/{ssmManager.ts → aws/ssmManager.ts} +24 -19
  174. package/src/lib/manager/{vpcManager.ts → aws/vpcManager.ts} +17 -17
  175. package/src/lib/manager/{wafManager.ts → aws/wafManager.ts} +16 -16
  176. package/src/lib/manager/index.ts +1 -0
  177. package/src/lib/{types.ts → types/aws/index.ts} +21 -15
  178. package/src/lib/types/index.ts +1 -0
  179. package/src/lib/utils/aws/index.ts +34 -0
  180. package/src/lib/{utils.ts → utils/index.ts} +1 -45
  181. package/dist/src/lib/manager/acmManager.d.ts.map +0 -1
  182. package/dist/src/lib/manager/acmManager.js.map +0 -1
  183. package/dist/src/lib/manager/apiManager.d.ts.map +0 -1
  184. package/dist/src/lib/manager/apiManager.js.map +0 -1
  185. package/dist/src/lib/manager/appConfigManager.d.ts.map +0 -1
  186. package/dist/src/lib/manager/appConfigManager.js.map +0 -1
  187. package/dist/src/lib/manager/cloudFrontManager.d.ts.map +0 -1
  188. package/dist/src/lib/manager/cloudFrontManager.js.map +0 -1
  189. package/dist/src/lib/manager/cloudTrailManager.d.ts.map +0 -1
  190. package/dist/src/lib/manager/cloudTrailManager.js.map +0 -1
  191. package/dist/src/lib/manager/cloudWatchManager.d.ts +0 -121
  192. package/dist/src/lib/manager/cloudWatchManager.d.ts.map +0 -1
  193. package/dist/src/lib/manager/cloudWatchManager.js.map +0 -1
  194. package/dist/src/lib/manager/codeBuildManager.d.ts.map +0 -1
  195. package/dist/src/lib/manager/codeBuildManager.js.map +0 -1
  196. package/dist/src/lib/manager/ecrManager.d.ts.map +0 -1
  197. package/dist/src/lib/manager/ecrManager.js.map +0 -1
  198. package/dist/src/lib/manager/ecsManager.d.ts.map +0 -1
  199. package/dist/src/lib/manager/ecsManager.js.map +0 -1
  200. package/dist/src/lib/manager/eksManager.d.ts.map +0 -1
  201. package/dist/src/lib/manager/eksManager.js.map +0 -1
  202. package/dist/src/lib/manager/eventManager.d.ts.map +0 -1
  203. package/dist/src/lib/manager/eventManager.js.map +0 -1
  204. package/dist/src/lib/manager/iamManager.d.ts +0 -155
  205. package/dist/src/lib/manager/iamManager.d.ts.map +0 -1
  206. package/dist/src/lib/manager/iamManager.js.map +0 -1
  207. package/dist/src/lib/manager/lambdaManager.d.ts.map +0 -1
  208. package/dist/src/lib/manager/lambdaManager.js.map +0 -1
  209. package/dist/src/lib/manager/logManager.d.ts.map +0 -1
  210. package/dist/src/lib/manager/logManager.js.map +0 -1
  211. package/dist/src/lib/manager/route53Manager.d.ts.map +0 -1
  212. package/dist/src/lib/manager/route53Manager.js.map +0 -1
  213. package/dist/src/lib/manager/s3Manager.d.ts +0 -73
  214. package/dist/src/lib/manager/s3Manager.d.ts.map +0 -1
  215. package/dist/src/lib/manager/s3Manager.js.map +0 -1
  216. package/dist/src/lib/manager/secretsManager.d.ts.map +0 -1
  217. package/dist/src/lib/manager/secretsManager.js.map +0 -1
  218. package/dist/src/lib/manager/snsManager.d.ts.map +0 -1
  219. package/dist/src/lib/manager/snsManager.js.map +0 -1
  220. package/dist/src/lib/manager/ssmManager.d.ts.map +0 -1
  221. package/dist/src/lib/manager/ssmManager.js.map +0 -1
  222. package/dist/src/lib/manager/vpcManager.d.ts.map +0 -1
  223. package/dist/src/lib/manager/vpcManager.js.map +0 -1
  224. package/dist/src/lib/manager/wafManager.d.ts +0 -39
  225. package/dist/src/lib/manager/wafManager.d.ts.map +0 -1
  226. package/dist/src/lib/manager/wafManager.js.map +0 -1
  227. package/dist/src/lib/types.d.ts.map +0 -1
  228. package/dist/src/lib/types.js.map +0 -1
  229. package/dist/src/lib/utils.d.ts.map +0 -1
  230. package/dist/src/lib/utils.js +0 -131
  231. package/dist/src/lib/utils.js.map +0 -1
@@ -1,17 +1,17 @@
1
1
  import * as ecr from 'aws-cdk-lib/aws-ecr-assets'
2
- import { CommonConstruct } from '../common/commonConstruct'
3
- import { createCfnOutput } from '../utils'
2
+ import * as common from '../../common'
3
+ import * as utils from '../../utils'
4
4
 
5
5
  /**
6
6
  * @stability stable
7
7
  * @category Containers
8
8
  * @summary Provides operations on AWS Elastic Container Registry.
9
- * - A new instance of this class is injected into {@link CommonConstruct} constructor.
10
- * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
9
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
10
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
11
11
  * @example
12
12
  * import * as common from '@gradientedge/cdk-utils'
13
13
  *
14
- * class CustomConstruct extends common.CommonConstruct {
14
+ * class CustomConstruct extends common.common.CommonConstruct {
15
15
  * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
16
16
  * super(parent, id, props)
17
17
  * this.props = props
@@ -25,15 +25,15 @@ export class EcrManager {
25
25
  /**
26
26
  * @summary Method to create a docker image in ecr
27
27
  * @param {string} id scoped id of the resource
28
- * @param {CommonConstruct} scope scope in which this resource is defined
28
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
29
29
  * @param {string} dockerfilePath
30
30
  */
31
- public createDockerImage(id: string, scope: CommonConstruct, dockerfilePath: string) {
31
+ public createDockerImage(id: string, scope: common.CommonConstruct, dockerfilePath: string) {
32
32
  const asset = new ecr.DockerImageAsset(scope, `${id}`, {
33
33
  directory: dockerfilePath,
34
34
  })
35
35
 
36
- createCfnOutput(`${id}-dockerImageArn`, scope, asset.imageUri)
36
+ utils.createCfnOutput(`${id}-dockerImageArn`, scope, asset.imageUri)
37
37
 
38
38
  return asset
39
39
  }
@@ -2,20 +2,20 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2'
2
2
  import * as ecs from 'aws-cdk-lib/aws-ecs'
3
3
  import * as iam from 'aws-cdk-lib/aws-iam'
4
4
  import * as logs from 'aws-cdk-lib/aws-logs'
5
- import { CommonConstruct } from '../common/commonConstruct'
6
- import { EcsClusterProps, EcsTaskProps } from '../types'
7
- import { createCfnOutput } from '../utils'
5
+ import * as common from '../../common'
6
+ import * as types from '../../types'
7
+ import * as utils from '../../utils'
8
8
 
9
9
  /**
10
10
  * @stability stable
11
11
  * @category Containers
12
12
  * @summary Provides operations on AWS Elastic Container Service.
13
- * - A new instance of this class is injected into {@link CommonConstruct} constructor.
14
- * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
13
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
14
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
15
15
  * @example
16
16
  * import * as common from '@gradientedge/cdk-utils'
17
17
  *
18
- * class CustomConstruct extends common.CommonConstruct {
18
+ * class CustomConstruct extends common.common.CommonConstruct {
19
19
  * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
20
20
  * super(parent, id, props)
21
21
  * this.props = props
@@ -29,11 +29,11 @@ export class EcsManager {
29
29
  /**
30
30
  * @summary Method to create an ecs cluster
31
31
  * @param {string} id scoped id of the resource
32
- * @param {CommonConstruct} scope scope in which this resource is defined
33
- * @param {EcsClusterProps} props
32
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
33
+ * @param {types.EcsClusterProps} props
34
34
  * @param {ec2.IVpc} vpc
35
35
  */
36
- public createEcsCluster(id: string, scope: CommonConstruct, props: EcsClusterProps, vpc: ec2.IVpc) {
36
+ public createEcsCluster(id: string, scope: common.CommonConstruct, props: types.EcsClusterProps, vpc: ec2.IVpc) {
37
37
  if (!props) throw `Ecs Cluster props undefined`
38
38
 
39
39
  const ecsCluster = new ecs.Cluster(scope, `${id}`, {
@@ -41,8 +41,8 @@ export class EcsManager {
41
41
  vpc: vpc,
42
42
  })
43
43
 
44
- createCfnOutput(`${id}-clusterArn`, scope, ecsCluster.clusterArn)
45
- createCfnOutput(`${id}-clusterName`, scope, ecsCluster.clusterName)
44
+ utils.createCfnOutput(`${id}-clusterArn`, scope, ecsCluster.clusterArn)
45
+ utils.createCfnOutput(`${id}-clusterName`, scope, ecsCluster.clusterName)
46
46
 
47
47
  return ecsCluster
48
48
  }
@@ -50,8 +50,8 @@ export class EcsManager {
50
50
  /**
51
51
  * @summary Method to create an ecs fargate task
52
52
  * @param {string} id scoped id of the resource
53
- * @param {CommonConstruct} scope scope in which this resource is defined
54
- * @param {EcsTaskProps} props
53
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
54
+ * @param {types.EcsTaskProps} props
55
55
  * @param {ecs.ICluster} cluster
56
56
  * @param {iam.Role} role
57
57
  * @param {logs.ILogGroup} logGroup
@@ -60,8 +60,8 @@ export class EcsManager {
60
60
  */
61
61
  public createEcsFargateTask(
62
62
  id: string,
63
- scope: CommonConstruct,
64
- props: EcsTaskProps,
63
+ scope: common.CommonConstruct,
64
+ props: types.EcsTaskProps,
65
65
  cluster: ecs.ICluster,
66
66
  role: iam.Role,
67
67
  logGroup: logs.ILogGroup,
@@ -93,7 +93,7 @@ export class EcsManager {
93
93
  privileged: false,
94
94
  })
95
95
 
96
- createCfnOutput(`${id}-taskArn`, scope, ecsTask.taskDefinitionArn)
96
+ utils.createCfnOutput(`${id}-taskArn`, scope, ecsTask.taskDefinitionArn)
97
97
 
98
98
  return ecsTask
99
99
  }
@@ -1,20 +1,20 @@
1
1
  import * as ec2 from 'aws-cdk-lib/aws-ec2'
2
2
  import * as ecr from 'aws-cdk-lib/aws-ecr-assets'
3
3
  import * as eks from 'aws-cdk-lib/aws-eks'
4
- import { CommonConstruct } from '../common/commonConstruct'
5
- import { EksClusterProps } from '../types'
6
- import { createCfnOutput } from '../utils'
4
+ import * as common from '../../common'
5
+ import * as types from '../../types'
6
+ import * as utils from '../../utils'
7
7
 
8
8
  /**
9
9
  * @stability stable
10
10
  * @category Containers
11
11
  * @summary Provides operations on AWS Elastic Kubernetes Service.
12
- * - A new instance of this class is injected into {@link CommonConstruct} constructor.
13
- * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
12
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
13
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
14
14
  * @example
15
15
  * import * as common from '@gradientedge/cdk-utils'
16
16
  *
17
- * class CustomConstruct extends common.CommonConstruct {
17
+ * class CustomConstruct extends common.common.CommonConstruct {
18
18
  * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
19
19
  * super(parent, id, props)
20
20
  * this.props = props
@@ -28,15 +28,15 @@ export class EksManager {
28
28
  /**
29
29
  * @summary Method to create an eks deployment
30
30
  * @param {string} id scoped id of the resource
31
- * @param {CommonConstruct} scope scope in which this resource is defined
32
- * @param {EksClusterProps} props
31
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
32
+ * @param {types.EksClusterProps} props
33
33
  * @param {ecr.DockerImageAsset} image
34
34
  * @param {ec2.IVpc} vpc
35
35
  */
36
36
  public createEksDeployment(
37
37
  id: string,
38
- scope: CommonConstruct,
39
- props: EksClusterProps,
38
+ scope: common.CommonConstruct,
39
+ props: types.EksClusterProps,
40
40
  image: ecr.DockerImageAsset,
41
41
  vpc: ec2.IVpc
42
42
  ) {
@@ -93,8 +93,8 @@ export class EksManager {
93
93
 
94
94
  cluster.addManifest(`${id}Pod`, service, deployment)
95
95
 
96
- createCfnOutput(`${id}-clusterArn`, scope, cluster.clusterArn)
97
- createCfnOutput(`${id}-clusterEndpoint`, scope, cluster.clusterEndpoint)
96
+ utils.createCfnOutput(`${id}-clusterArn`, scope, cluster.clusterArn)
97
+ utils.createCfnOutput(`${id}-clusterEndpoint`, scope, cluster.clusterEndpoint)
98
98
 
99
99
  return cluster
100
100
  }
@@ -2,20 +2,20 @@ import * as ecs from 'aws-cdk-lib/aws-ecs'
2
2
  import * as events from 'aws-cdk-lib/aws-events'
3
3
  import * as iam from 'aws-cdk-lib/aws-iam'
4
4
  import * as lambda from 'aws-cdk-lib/aws-lambda'
5
- import { CommonConstruct } from '../common/commonConstruct'
6
- import { RuleProps } from '../types'
7
- import { createCfnOutput } from '../utils'
5
+ import * as common from '../../common'
6
+ import * as types from '../../types'
7
+ import * as utils from '../../utils'
8
8
 
9
9
  /**
10
10
  * @stability stable
11
11
  * @category Application Integration
12
12
  * @summary Provides operations on AWS EventBridge.
13
- * - A new instance of this class is injected into {@link CommonConstruct} constructor.
14
- * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
13
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
14
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
15
15
  * @example
16
16
  * import * as common from '@gradientedge/cdk-utils'
17
17
  *
18
- * class CustomConstruct extends common.CommonConstruct {
18
+ * class CustomConstruct extends common.common.CommonConstruct {
19
19
  * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
20
20
  * super(parent, id, props)
21
21
  * this.props = props
@@ -29,8 +29,8 @@ export class EventManager {
29
29
  /**
30
30
  * @summary Method to create an eventbridge rule with lambda target
31
31
  * @param {string} id scoped id of the resource
32
- * @param {CommonConstruct} scope scope in which this resource is defined
33
- * @param {RuleProps} props
32
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
33
+ * @param {types.RuleProps} props
34
34
  * @param {lambda.Function} lambdaFunction
35
35
  * @param {string} eventBusName
36
36
  * @param {any} eventPattern
@@ -38,8 +38,8 @@ export class EventManager {
38
38
  */
39
39
  public createLambdaRule(
40
40
  id: string,
41
- scope: CommonConstruct,
42
- props: RuleProps,
41
+ scope: common.CommonConstruct,
42
+ props: types.RuleProps,
43
43
  lambdaFunction: lambda.Function,
44
44
  eventBusName?: string,
45
45
  eventPattern?: any,
@@ -64,8 +64,8 @@ export class EventManager {
64
64
  sourceArn: eventRule.attrArn,
65
65
  })
66
66
 
67
- createCfnOutput(`${id}-ruleArn`, scope, eventRule.attrArn)
68
- createCfnOutput(`${id}-ruleName`, scope, eventRule.name)
67
+ utils.createCfnOutput(`${id}-ruleArn`, scope, eventRule.attrArn)
68
+ utils.createCfnOutput(`${id}-ruleName`, scope, eventRule.name)
69
69
 
70
70
  return eventRule
71
71
  }
@@ -73,8 +73,8 @@ export class EventManager {
73
73
  /**
74
74
  * @summary Method to create an eventbridge rule with fargate task target
75
75
  * @param {string} id scoped id of the resource
76
- * @param {CommonConstruct} scope scope in which this resource is defined
77
- * @param {RuleProps} props
76
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
77
+ * @param {types.RuleProps} props
78
78
  * @param {ecs.ICluster} cluster
79
79
  * @param {ecs.ITaskDefinition} task
80
80
  * @param {string[]} subnetIds
@@ -83,8 +83,8 @@ export class EventManager {
83
83
  */
84
84
  public createFargateTaskRule(
85
85
  id: string,
86
- scope: CommonConstruct,
87
- props: RuleProps,
86
+ scope: common.CommonConstruct,
87
+ props: types.RuleProps,
88
88
  cluster: ecs.ICluster,
89
89
  task: ecs.ITaskDefinition,
90
90
  subnetIds: string[],
@@ -115,8 +115,8 @@ export class EventManager {
115
115
  ],
116
116
  })
117
117
 
118
- createCfnOutput(`${id}-ruleArn`, scope, eventRule.attrArn)
119
- createCfnOutput(`${id}-ruleName`, scope, eventRule.name)
118
+ utils.createCfnOutput(`${id}-ruleArn`, scope, eventRule.attrArn)
119
+ utils.createCfnOutput(`${id}-ruleName`, scope, eventRule.name)
120
120
 
121
121
  return eventRule
122
122
  }
@@ -3,19 +3,19 @@ import * as ecs from 'aws-cdk-lib/aws-ecs'
3
3
  import * as iam from 'aws-cdk-lib/aws-iam'
4
4
  import * as logs from 'aws-cdk-lib/aws-logs'
5
5
  import * as s3 from 'aws-cdk-lib/aws-s3'
6
- import { CommonConstruct } from '../common/commonConstruct'
7
- import { createCfnOutput } from '../utils'
6
+ import * as common from '../../common'
7
+ import * as utils from '../../utils'
8
8
 
9
9
  /**
10
10
  * @stability stable
11
11
  * @category Security, Identity & Compliance
12
12
  * @summary Provides operations on AWS IAM.
13
- * - A new instance of this class is injected into {@link CommonConstruct} constructor.
14
- * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
13
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
14
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
15
15
  * @example
16
16
  * import * as common from '@gradientedge/cdk-utils'
17
17
  *
18
- * class CustomConstruct extends common.CommonConstruct {
18
+ * class CustomConstruct extends common.common.CommonConstruct {
19
19
  * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
20
20
  * super(parent, id, props)
21
21
  * this.props = props
@@ -28,9 +28,9 @@ import { createCfnOutput } from '../utils'
28
28
  export class IamManager {
29
29
  /**
30
30
  * @summary Method to create iam statement to read secrets
31
- * @param {CommonConstruct} scope scope in which this resource is defined
31
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
32
32
  */
33
- public statementForReadSecrets(scope: CommonConstruct) {
33
+ public statementForReadSecrets(scope: common.CommonConstruct) {
34
34
  return new iam.PolicyStatement({
35
35
  effect: iam.Effect.ALLOW,
36
36
  actions: ['secretsmanager:GetSecretValue'],
@@ -40,9 +40,9 @@ export class IamManager {
40
40
 
41
41
  /**
42
42
  * @summary Method to create iam statement to read app config
43
- * @param {CommonConstruct} scope scope in which this resource is defined
43
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
44
44
  */
45
- public statementForReadAnyAppConfig(scope: CommonConstruct) {
45
+ public statementForReadAnyAppConfig(scope: common.CommonConstruct) {
46
46
  return new iam.PolicyStatement({
47
47
  effect: iam.Effect.ALLOW,
48
48
  actions: [
@@ -65,10 +65,10 @@ export class IamManager {
65
65
 
66
66
  /**
67
67
  * @summary Method to create iam statement to list s3 buckets
68
- * @param {CommonConstruct} scope scope in which this resource is defined
68
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
69
69
  * @param {s3.IBucket} bucket
70
70
  */
71
- public statementForListBucket(scope: CommonConstruct, bucket: s3.IBucket) {
71
+ public statementForListBucket(scope: common.CommonConstruct, bucket: s3.IBucket) {
72
72
  return new iam.PolicyStatement({
73
73
  effect: iam.Effect.ALLOW,
74
74
  actions: ['s3:ListBucket'],
@@ -78,9 +78,9 @@ export class IamManager {
78
78
 
79
79
  /**
80
80
  * @summary Method to create iam statement to list all s3 buckets
81
- * @param {CommonConstruct} scope scope in which this resource is defined
81
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
82
82
  */
83
- public statementForListAllMyBuckets(scope: CommonConstruct) {
83
+ public statementForListAllMyBuckets(scope: common.CommonConstruct) {
84
84
  return new iam.PolicyStatement({
85
85
  effect: iam.Effect.ALLOW,
86
86
  actions: ['s3:ListAllMyBuckets'],
@@ -90,10 +90,10 @@ export class IamManager {
90
90
 
91
91
  /**
92
92
  * @summary Method to create iam statement to get s3 objects in buckets
93
- * @param {CommonConstruct} scope scope in which this resource is defined
93
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
94
94
  * @param {s3.IBucket} bucket
95
95
  */
96
- public statementForGetAnyS3Objects(scope: CommonConstruct, bucket: s3.IBucket) {
96
+ public statementForGetAnyS3Objects(scope: common.CommonConstruct, bucket: s3.IBucket) {
97
97
  return new iam.PolicyStatement({
98
98
  effect: iam.Effect.ALLOW,
99
99
  actions: ['s3:GetObject', 's3:GetObjectAcl'],
@@ -103,10 +103,10 @@ export class IamManager {
103
103
 
104
104
  /**
105
105
  * @summary Method to create iam statement to delete s3 objects in buckets
106
- * @param {CommonConstruct} scope scope in which this resource is defined
106
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
107
107
  * @param {s3.IBucket} bucket
108
108
  */
109
- public statementForDeleteAnyS3Objects(scope: CommonConstruct, bucket: s3.IBucket) {
109
+ public statementForDeleteAnyS3Objects(scope: common.CommonConstruct, bucket: s3.IBucket) {
110
110
  return new iam.PolicyStatement({
111
111
  effect: iam.Effect.ALLOW,
112
112
  actions: ['s3:DeleteObject'],
@@ -116,10 +116,10 @@ export class IamManager {
116
116
 
117
117
  /**
118
118
  * @summary Method to create iam statement to write s3 objects in buckets
119
- * @param {CommonConstruct} scope scope in which this resource is defined
119
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
120
120
  * @param {s3.IBucket} bucket
121
121
  */
122
- public statementForPutAnyS3Objects(scope: CommonConstruct, bucket: s3.IBucket) {
122
+ public statementForPutAnyS3Objects(scope: common.CommonConstruct, bucket: s3.IBucket) {
123
123
  return new iam.PolicyStatement({
124
124
  effect: iam.Effect.ALLOW,
125
125
  actions: ['s3:PutObject', 's3:PutObjectAcl'],
@@ -129,9 +129,9 @@ export class IamManager {
129
129
 
130
130
  /**
131
131
  * @summary Method to create iam statement to pass iam role
132
- * @param {CommonConstruct} scope scope in which this resource is defined
132
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
133
133
  */
134
- public statementForPassRole(scope: CommonConstruct) {
134
+ public statementForPassRole(scope: common.CommonConstruct) {
135
135
  return new iam.PolicyStatement({
136
136
  effect: iam.Effect.ALLOW,
137
137
  actions: ['iam:PassRole'],
@@ -141,9 +141,9 @@ export class IamManager {
141
141
 
142
142
  /**
143
143
  * @summary Method to create iam statement to invalidate cloudfront cache
144
- * @param {CommonConstruct} scope scope in which this resource is defined
144
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
145
145
  */
146
- public statementForCloudfrontInvalidation(scope: CommonConstruct) {
146
+ public statementForCloudfrontInvalidation(scope: common.CommonConstruct) {
147
147
  return new iam.PolicyStatement({
148
148
  effect: iam.Effect.ALLOW,
149
149
  actions: ['cloudfront:GetInvalidation', 'cloudfront:CreateInvalidation'],
@@ -153,9 +153,9 @@ export class IamManager {
153
153
 
154
154
  /**
155
155
  * @summary Method to create iam policy to invalidate cloudfront cache
156
- * @param {CommonConstruct} scope scope in which this resource is defined
156
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
157
157
  */
158
- public policyForCloudfrontInvalidation(scope: CommonConstruct) {
158
+ public policyForCloudfrontInvalidation(scope: common.CommonConstruct) {
159
159
  return new iam.PolicyDocument({
160
160
  statements: [
161
161
  this.statementForCreateAnyLogStream(),
@@ -178,9 +178,9 @@ export class IamManager {
178
178
  /**
179
179
  * @summary Method to create iam role to invalidate cloudfront cache
180
180
  * @param {string} id scoped id of the resource
181
- * @param {CommonConstruct} scope scope in which this resource is defined
181
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
182
182
  */
183
- public roleForCloudfrontInvalidation(id: string, scope: CommonConstruct) {
183
+ public roleForCloudfrontInvalidation(id: string, scope: common.CommonConstruct) {
184
184
  return new iam.Role(scope, `${id}-install-deps-project-role`, {
185
185
  assumedBy: new iam.ServicePrincipal('codebuild.amazonaws.com'),
186
186
  inlinePolicies: {
@@ -191,10 +191,10 @@ export class IamManager {
191
191
 
192
192
  /**
193
193
  * @summary Method to create iam statement to assume iam role
194
- * @param {CommonConstruct} scope scope in which this resource is defined
194
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
195
195
  * @param {iam.ServicePrincipal[]} servicePrincipals
196
196
  */
197
- public statementForAssumeRole(scope: CommonConstruct, servicePrincipals: iam.ServicePrincipal[]) {
197
+ public statementForAssumeRole(scope: common.CommonConstruct, servicePrincipals: iam.ServicePrincipal[]) {
198
198
  return new iam.PolicyStatement({
199
199
  effect: iam.Effect.ALLOW,
200
200
  actions: ['sts:AssumeRole'],
@@ -204,9 +204,9 @@ export class IamManager {
204
204
 
205
205
  /**
206
206
  * @summary Method to create iam statement to pass ecs role
207
- * @param {CommonConstruct} scope scope in which this resource is defined
207
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
208
208
  */
209
- public statementForEcsPassRole(scope: CommonConstruct) {
209
+ public statementForEcsPassRole(scope: common.CommonConstruct) {
210
210
  return new iam.PolicyStatement({
211
211
  effect: iam.Effect.ALLOW,
212
212
  actions: ['iam:PassRole'],
@@ -217,11 +217,11 @@ export class IamManager {
217
217
 
218
218
  /**
219
219
  * @summary Method to create iam statement to run ecs task
220
- * @param {CommonConstruct} scope scope in which this resource is defined
220
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
221
221
  * @param {ecs.ICluster} cluster
222
222
  * @param {ecs.ITaskDefinition} task
223
223
  */
224
- public statementForRunEcsTask(scope: CommonConstruct, cluster: ecs.ICluster, task: ecs.ITaskDefinition) {
224
+ public statementForRunEcsTask(scope: common.CommonConstruct, cluster: ecs.ICluster, task: ecs.ITaskDefinition) {
225
225
  return new iam.PolicyStatement({
226
226
  effect: iam.Effect.ALLOW,
227
227
  actions: ['ecs:RunTask'],
@@ -232,10 +232,10 @@ export class IamManager {
232
232
 
233
233
  /**
234
234
  * @summary Method to create iam statement to create log stream
235
- * @param {CommonConstruct} scope scope in which this resource is defined
235
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
236
236
  * @param {logs.CfnLogGroup} logGroup
237
237
  */
238
- public statementForCreateLogStream(scope: CommonConstruct, logGroup: logs.CfnLogGroup) {
238
+ public statementForCreateLogStream(scope: common.CommonConstruct, logGroup: logs.CfnLogGroup) {
239
239
  return new iam.PolicyStatement({
240
240
  effect: iam.Effect.ALLOW,
241
241
  actions: ['logs:CreateLogStream'],
@@ -261,10 +261,10 @@ export class IamManager {
261
261
 
262
262
  /**
263
263
  * @summary Method to create iam statement to write log events
264
- * @param {CommonConstruct} scope scope in which this resource is defined
264
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
265
265
  * @param {logs.CfnLogGroup} logGroup
266
266
  */
267
- public statementForPutLogEvent(scope: CommonConstruct, logGroup: logs.CfnLogGroup) {
267
+ public statementForPutLogEvent(scope: common.CommonConstruct, logGroup: logs.CfnLogGroup) {
268
268
  return new iam.PolicyStatement({
269
269
  effect: iam.Effect.ALLOW,
270
270
  actions: ['logs:PutLogEvents'],
@@ -291,10 +291,10 @@ export class IamManager {
291
291
  /**
292
292
  * @summary Method to create iam statement for cloud trail
293
293
  * @param {string} id scoped id of the resource
294
- * @param {CommonConstruct} scope scope in which this resource is defined
294
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
295
295
  * @param {logs.CfnLogGroup} logGroup
296
296
  */
297
- public createRoleForCloudTrail(id: string, scope: CommonConstruct, logGroup: logs.CfnLogGroup) {
297
+ public createRoleForCloudTrail(id: string, scope: common.CommonConstruct, logGroup: logs.CfnLogGroup) {
298
298
  const policy = new iam.PolicyDocument({
299
299
  statements: [this.statementForCreateLogStream(scope, logGroup), this.statementForPutLogEvent(scope, logGroup)],
300
300
  })
@@ -311,8 +311,8 @@ export class IamManager {
311
311
  roleName: `${id}-${scope.props.stage}`,
312
312
  })
313
313
 
314
- createCfnOutput(`${id}Arn`, scope, role.attrArn)
315
- createCfnOutput(`${id}Name`, scope, role.roleName)
314
+ utils.createCfnOutput(`${id}Arn`, scope, role.attrArn)
315
+ utils.createCfnOutput(`${id}Name`, scope, role.roleName)
316
316
 
317
317
  return role
318
318
  }
@@ -320,11 +320,16 @@ export class IamManager {
320
320
  /**
321
321
  * @summary Method to create iam statement for ecs event
322
322
  * @param {string} id scoped id of the resource
323
- * @param {CommonConstruct} scope scope in which this resource is defined
323
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
324
324
  * @param {ecs.ICluster} cluster
325
325
  * @param {ecs.ITaskDefinition} task
326
326
  */
327
- public createRoleForEcsEvent(id: string, scope: CommonConstruct, cluster: ecs.ICluster, task: ecs.ITaskDefinition) {
327
+ public createRoleForEcsEvent(
328
+ id: string,
329
+ scope: common.CommonConstruct,
330
+ cluster: ecs.ICluster,
331
+ task: ecs.ITaskDefinition
332
+ ) {
328
333
  const policy = new iam.PolicyDocument({
329
334
  statements: [this.statementForRunEcsTask(scope, cluster, task), this.statementForEcsPassRole(scope)],
330
335
  })
@@ -336,8 +341,8 @@ export class IamManager {
336
341
  roleName: `${id}-${scope.props.stage}`,
337
342
  })
338
343
 
339
- createCfnOutput(`${id}Arn`, scope, role.roleArn)
340
- createCfnOutput(`${id}Name`, scope, role.roleName)
344
+ utils.createCfnOutput(`${id}Arn`, scope, role.roleArn)
345
+ utils.createCfnOutput(`${id}Name`, scope, role.roleName)
341
346
 
342
347
  return role
343
348
  }
@@ -345,10 +350,10 @@ export class IamManager {
345
350
  /**
346
351
  * @summary Method to create iam statement for ecs execution
347
352
  * @param {string} id scoped id of the resource
348
- * @param {CommonConstruct} scope scope in which this resource is defined
353
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
349
354
  * @param {iam.PolicyDocument} policy
350
355
  */
351
- public createRoleForEcsExecution(id: string, scope: CommonConstruct, policy: iam.PolicyDocument) {
356
+ public createRoleForEcsExecution(id: string, scope: common.CommonConstruct, policy: iam.PolicyDocument) {
352
357
  const role = new iam.Role(scope, `${id}`, {
353
358
  assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'),
354
359
  description: `Role for ${id} ECS Task execution`,
@@ -363,8 +368,8 @@ export class IamManager {
363
368
  roleName: `${id}-${scope.props.stage}`,
364
369
  })
365
370
 
366
- createCfnOutput(`${id}Arn`, scope, role.roleArn)
367
- createCfnOutput(`${id}Name`, scope, role.roleName)
371
+ utils.createCfnOutput(`${id}Arn`, scope, role.roleArn)
372
+ utils.createCfnOutput(`${id}Name`, scope, role.roleName)
368
373
 
369
374
  return role
370
375
  }
@@ -372,12 +377,18 @@ export class IamManager {
372
377
  /**
373
378
  * @summary Method to create iam statement for lambda execution
374
379
  * @param {string} id scoped id of the resource
375
- * @param {CommonConstruct} scope scope in which this resource is defined
380
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
376
381
  * @param {iam.PolicyDocument} policy
382
+ * @param {iam.ServicePrincipal} servicePrinicpal
377
383
  */
378
- public createRoleForLambda(id: string, scope: CommonConstruct, policy: iam.PolicyDocument) {
384
+ public createRoleForLambda(
385
+ id: string,
386
+ scope: common.CommonConstruct,
387
+ policy: iam.PolicyDocument,
388
+ servicePrinicpal?: iam.ServicePrincipal
389
+ ) {
379
390
  const role = new iam.Role(scope, `${id}`, {
380
- assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
391
+ assumedBy: servicePrinicpal ?? new iam.ServicePrincipal('lambda.amazonaws.com'),
381
392
  description: `Role for ${id} Lambda function`,
382
393
  inlinePolicies: { policy },
383
394
  managedPolicies: [
@@ -390,8 +401,8 @@ export class IamManager {
390
401
  roleName: `${id}-${scope.props.stage}`,
391
402
  })
392
403
 
393
- createCfnOutput(`${id}Arn`, scope, role.roleArn)
394
- createCfnOutput(`${id}Name`, scope, role.roleName)
404
+ utils.createCfnOutput(`${id}Arn`, scope, role.roleArn)
405
+ utils.createCfnOutput(`${id}Name`, scope, role.roleName)
395
406
 
396
407
  return role
397
408
  }
@@ -0,0 +1,22 @@
1
+ export * from './acmManager'
2
+ export * from './apiManager'
3
+ export * from './appConfigManager'
4
+ export * from './cloudFrontManager'
5
+ export * from './cloudTrailManager'
6
+ export * from './cloudWatchManager'
7
+ export * from './codeBuildManager'
8
+ export * from './dynamodbManager'
9
+ export * from './ecrManager'
10
+ export * from './ecsManager'
11
+ export * from './eksManager'
12
+ export * from './eventManager'
13
+ export * from './iamManager'
14
+ export * from './lambdaManager'
15
+ export * from './logManager'
16
+ export * from './route53Manager'
17
+ export * from './s3Manager'
18
+ export * from './secretsManager'
19
+ export * from './snsManager'
20
+ export * from './ssmManager'
21
+ export * from './vpcManager'
22
+ export * from './wafManager'