@gradientedge/cdk-utils 8.91.0 → 8.93.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 (223) hide show
  1. package/.eslintrc.json +40 -0
  2. package/app/api-destined-function/src/lib/lambda.ts +6 -6
  3. package/dist/app/api-destined-function/src/lib/lambda.d.ts +6 -6
  4. package/dist/app/api-destined-function/src/lib/lambda.js +6 -6
  5. package/dist/lib/lambda.d.ts +6 -6
  6. package/dist/lib/lambda.js +6 -6
  7. package/dist/lib/lambda.js.map +1 -1
  8. package/dist/src/lib/common/construct.d.ts +4 -7
  9. package/dist/src/lib/common/construct.js +4 -7
  10. package/dist/src/lib/common/stack.d.ts +9 -13
  11. package/dist/src/lib/common/stack.js +9 -13
  12. package/dist/src/lib/common/types.d.ts +0 -2
  13. package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +0 -3
  14. package/dist/src/lib/construct/api-to-eventbridge-target/api.js +0 -3
  15. package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +0 -3
  16. package/dist/src/lib/construct/api-to-eventbridge-target/event.js +0 -3
  17. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -27
  18. package/dist/src/lib/construct/api-to-eventbridge-target/main.js +41 -68
  19. package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +13 -25
  20. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -3
  21. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -3
  22. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +0 -37
  23. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +44 -81
  24. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +1 -5
  25. package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +0 -3
  26. package/dist/src/lib/construct/api-to-lambda-target/api.js +0 -3
  27. package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +0 -14
  28. package/dist/src/lib/construct/api-to-lambda-target/main.js +7 -21
  29. package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +7 -13
  30. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +1 -19
  31. package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -19
  32. package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +4 -8
  33. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +0 -11
  34. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -12
  35. package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +1 -3
  36. package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +0 -12
  37. package/dist/src/lib/construct/lambda-with-iam-access/main.js +2 -14
  38. package/dist/src/lib/construct/rest-api-lambda/main.d.ts +1 -19
  39. package/dist/src/lib/construct/rest-api-lambda/main.js +1 -19
  40. package/dist/src/lib/construct/rest-api-lambda/types.d.ts +6 -10
  41. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +0 -11
  42. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +3 -14
  43. package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +1 -3
  44. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -25
  45. package/dist/src/lib/construct/site-with-ecs-backend/main.js +32 -52
  46. package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +10 -11
  47. package/dist/src/lib/construct/static-asset-deployment/main.d.ts +0 -8
  48. package/dist/src/lib/construct/static-asset-deployment/main.js +0 -8
  49. package/dist/src/lib/construct/static-asset-deployment/types.d.ts +1 -1
  50. package/dist/src/lib/construct/static-site/main.d.ts +0 -17
  51. package/dist/src/lib/construct/static-site/main.js +1 -18
  52. package/dist/src/lib/construct/static-site/types.d.ts +9 -11
  53. package/dist/src/lib/services/aws/api-gateway/main.d.ts +21 -25
  54. package/dist/src/lib/services/aws/api-gateway/main.js +42 -46
  55. package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -2
  56. package/dist/src/lib/services/aws/appconfig/constants.d.ts +0 -6
  57. package/dist/src/lib/services/aws/appconfig/constants.js +26 -32
  58. package/dist/src/lib/services/aws/appconfig/main.d.ts +16 -19
  59. package/dist/src/lib/services/aws/appconfig/main.js +19 -22
  60. package/dist/src/lib/services/aws/appconfig/types.d.ts +1 -3
  61. package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -10
  62. package/dist/src/lib/services/aws/certificate-manager/main.js +5 -10
  63. package/dist/src/lib/services/aws/certificate-manager/types.d.ts +3 -5
  64. package/dist/src/lib/services/aws/cloudfront/main.d.ts +41 -47
  65. package/dist/src/lib/services/aws/cloudfront/main.js +56 -62
  66. package/dist/src/lib/services/aws/cloudfront/types.d.ts +1 -7
  67. package/dist/src/lib/services/aws/cloudtrail/main.d.ts +8 -12
  68. package/dist/src/lib/services/aws/cloudtrail/main.js +8 -12
  69. package/dist/src/lib/services/aws/cloudtrail/types.d.ts +0 -2
  70. package/dist/src/lib/services/aws/cloudwatch/logs.d.ts +11 -15
  71. package/dist/src/lib/services/aws/cloudwatch/logs.js +15 -19
  72. package/dist/src/lib/services/aws/cloudwatch/main.d.ts +80 -84
  73. package/dist/src/lib/services/aws/cloudwatch/main.js +116 -122
  74. package/dist/src/lib/services/aws/cloudwatch/types.d.ts +20 -42
  75. package/dist/src/lib/services/aws/codebuild/main.d.ts +0 -4
  76. package/dist/src/lib/services/aws/codebuild/main.js +3 -7
  77. package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -7
  78. package/dist/src/lib/services/aws/dynamodb/main.js +13 -17
  79. package/dist/src/lib/services/aws/dynamodb/types.d.ts +0 -2
  80. package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +3 -7
  81. package/dist/src/lib/services/aws/elastic-container-registry/main.js +3 -7
  82. package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +19 -23
  83. package/dist/src/lib/services/aws/elastic-container-service/main.js +35 -39
  84. package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +1 -9
  85. package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +9 -13
  86. package/dist/src/lib/services/aws/elastic-file-system/main.js +14 -18
  87. package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +1 -5
  88. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +5 -9
  89. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -12
  90. package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +1 -3
  91. package/dist/src/lib/services/aws/elasticache/main.d.ts +14 -18
  92. package/dist/src/lib/services/aws/elasticache/main.js +35 -39
  93. package/dist/src/lib/services/aws/elasticache/types.d.ts +0 -4
  94. package/dist/src/lib/services/aws/eventbridge/main.d.ts +25 -29
  95. package/dist/src/lib/services/aws/eventbridge/main.js +34 -38
  96. package/dist/src/lib/services/aws/eventbridge/target.d.ts +6 -9
  97. package/dist/src/lib/services/aws/eventbridge/target.js +8 -10
  98. package/dist/src/lib/services/aws/eventbridge/types.d.ts +2 -10
  99. package/dist/src/lib/services/aws/evidently/main.d.ts +15 -19
  100. package/dist/src/lib/services/aws/evidently/main.js +19 -23
  101. package/dist/src/lib/services/aws/evidently/types.d.ts +0 -10
  102. package/dist/src/lib/services/aws/identity-access-management/main.d.ts +66 -70
  103. package/dist/src/lib/services/aws/identity-access-management/main.js +97 -101
  104. package/dist/src/lib/services/aws/key-management-service/main.d.ts +3 -7
  105. package/dist/src/lib/services/aws/key-management-service/main.js +6 -10
  106. package/dist/src/lib/services/aws/key-management-service/types.d.ts +0 -2
  107. package/dist/src/lib/services/aws/lambda/main.d.ts +42 -47
  108. package/dist/src/lib/services/aws/lambda/main.js +64 -69
  109. package/dist/src/lib/services/aws/lambda/types.d.ts +6 -16
  110. package/dist/src/lib/services/aws/route53/main.d.ts +17 -21
  111. package/dist/src/lib/services/aws/route53/main.js +19 -23
  112. package/dist/src/lib/services/aws/route53/types.d.ts +0 -2
  113. package/dist/src/lib/services/aws/secrets-manager/main.d.ts +6 -19
  114. package/dist/src/lib/services/aws/secrets-manager/main.js +6 -25
  115. package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +8 -12
  116. package/dist/src/lib/services/aws/simple-notification-service/main.js +10 -14
  117. package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +0 -2
  118. package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +11 -15
  119. package/dist/src/lib/services/aws/simple-queue-service/main.js +19 -23
  120. package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +4 -6
  121. package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +24 -32
  122. package/dist/src/lib/services/aws/simple-storage-service/main.js +32 -40
  123. package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +2 -8
  124. package/dist/src/lib/services/aws/step-function/main.d.ts +55 -59
  125. package/dist/src/lib/services/aws/step-function/main.js +91 -95
  126. package/dist/src/lib/services/aws/step-function/types.d.ts +0 -32
  127. package/dist/src/lib/services/aws/systems-manager/main.d.ts +10 -16
  128. package/dist/src/lib/services/aws/systems-manager/main.js +13 -19
  129. package/dist/src/lib/services/aws/systems-manager/types.d.ts +0 -2
  130. package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +9 -12
  131. package/dist/src/lib/services/aws/virtual-private-cloud/main.js +10 -16
  132. package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
  133. package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
  134. package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
  135. package/dist/src/lib/types/aws/index.d.ts +0 -2
  136. package/dist/src/lib/utils/aws/index.d.ts +6 -9
  137. package/dist/src/lib/utils/aws/index.js +7 -10
  138. package/dist/src/lib/utils/index.d.ts +6 -13
  139. package/dist/src/lib/utils/index.js +4 -12
  140. package/package.json +1 -1
  141. package/src/lib/common/construct.ts +4 -7
  142. package/src/lib/common/stack.ts +9 -13
  143. package/src/lib/common/types.ts +0 -2
  144. package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
  145. package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
  146. package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
  147. package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
  148. package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
  149. package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
  150. package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
  151. package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
  152. package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
  153. package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
  154. package/src/lib/construct/graphql-api-lambda/main.ts +2 -20
  155. package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
  156. package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
  157. package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
  158. package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
  159. package/src/lib/construct/rest-api-lambda/main.ts +2 -20
  160. package/src/lib/construct/rest-api-lambda/types.ts +6 -10
  161. package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
  162. package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
  163. package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
  164. package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
  165. package/src/lib/construct/static-asset-deployment/main.ts +0 -8
  166. package/src/lib/construct/static-asset-deployment/types.ts +1 -1
  167. package/src/lib/construct/static-site/main.ts +1 -18
  168. package/src/lib/construct/static-site/types.ts +9 -11
  169. package/src/lib/services/aws/api-gateway/main.ts +43 -47
  170. package/src/lib/services/aws/api-gateway/types.ts +0 -2
  171. package/src/lib/services/aws/appconfig/constants.ts +26 -32
  172. package/src/lib/services/aws/appconfig/main.ts +19 -22
  173. package/src/lib/services/aws/appconfig/types.ts +1 -3
  174. package/src/lib/services/aws/certificate-manager/main.ts +5 -10
  175. package/src/lib/services/aws/certificate-manager/types.ts +3 -5
  176. package/src/lib/services/aws/cloudfront/main.ts +56 -62
  177. package/src/lib/services/aws/cloudfront/types.ts +1 -7
  178. package/src/lib/services/aws/cloudtrail/main.ts +8 -12
  179. package/src/lib/services/aws/cloudtrail/types.ts +0 -2
  180. package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
  181. package/src/lib/services/aws/cloudwatch/main.ts +116 -122
  182. package/src/lib/services/aws/cloudwatch/types.ts +20 -42
  183. package/src/lib/services/aws/codebuild/main.ts +3 -7
  184. package/src/lib/services/aws/dynamodb/main.ts +13 -17
  185. package/src/lib/services/aws/dynamodb/types.ts +0 -2
  186. package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
  187. package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
  188. package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
  189. package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
  190. package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
  191. package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
  192. package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
  193. package/src/lib/services/aws/elasticache/main.ts +35 -39
  194. package/src/lib/services/aws/elasticache/types.ts +0 -4
  195. package/src/lib/services/aws/eventbridge/main.ts +34 -38
  196. package/src/lib/services/aws/eventbridge/target.ts +8 -11
  197. package/src/lib/services/aws/eventbridge/types.ts +2 -10
  198. package/src/lib/services/aws/evidently/main.ts +19 -23
  199. package/src/lib/services/aws/evidently/types.ts +0 -10
  200. package/src/lib/services/aws/identity-access-management/main.ts +97 -101
  201. package/src/lib/services/aws/key-management-service/main.ts +6 -10
  202. package/src/lib/services/aws/key-management-service/types.ts +0 -2
  203. package/src/lib/services/aws/lambda/main.ts +64 -69
  204. package/src/lib/services/aws/lambda/types.ts +6 -16
  205. package/src/lib/services/aws/route53/main.ts +19 -23
  206. package/src/lib/services/aws/route53/types.ts +0 -2
  207. package/src/lib/services/aws/secrets-manager/main.ts +6 -28
  208. package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
  209. package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
  210. package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
  211. package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
  212. package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
  213. package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
  214. package/src/lib/services/aws/step-function/main.ts +91 -95
  215. package/src/lib/services/aws/step-function/types.ts +0 -32
  216. package/src/lib/services/aws/systems-manager/main.ts +13 -19
  217. package/src/lib/services/aws/systems-manager/types.ts +0 -2
  218. package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
  219. package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
  220. package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
  221. package/src/lib/types/aws/index.ts +0 -2
  222. package/src/lib/utils/aws/index.ts +7 -10
  223. package/src/lib/utils/index.ts +4 -12
@@ -28,9 +28,6 @@ const cdk = __importStar(require("aws-cdk-lib"));
28
28
  const iam = __importStar(require("aws-cdk-lib/aws-iam"));
29
29
  const utils = __importStar(require("../../../utils"));
30
30
  /**
31
- * @stability stable
32
- * @category cdk-utils.iam-manager
33
- * @subcategory Construct
34
31
  * @classdesc Provides operations on AWS IAM.
35
32
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
36
33
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -44,19 +41,18 @@ const utils = __importStar(require("../../../utils"));
44
41
  * this.iamManager.createRoleForEcsEvent('MyEcsRole', this, cluster, task)
45
42
  * }
46
43
  * }
47
- *
48
44
  * @see [CDK IAM Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam-readme.html}
49
45
  */
50
46
  class IamManager {
51
47
  /**
52
48
  * @summary Method to create iam statement to read secrets
53
- * @param {CommonConstruct} scope scope in which this resource is defined
54
- * @param {string[]} resourceArns list of ARNs to allow access to
49
+ * @param scope scope in which this resource is defined
50
+ * @param resourceArns list of ARNs to allow access to
55
51
  */
56
52
  statementForReadSecrets(scope, resourceArns) {
57
53
  return new iam.PolicyStatement({
58
- effect: iam.Effect.ALLOW,
59
54
  actions: ['secretsmanager:GetSecretValue'],
55
+ effect: iam.Effect.ALLOW,
60
56
  resources: resourceArns ?? [
61
57
  `arn:aws:secretsmanager:${cdk.Stack.of(scope).region}:${cdk.Stack.of(scope).account}:secret:*`,
62
58
  ],
@@ -64,55 +60,54 @@ class IamManager {
64
60
  }
65
61
  /**
66
62
  * @summary Method to create iam statement to put events
67
- * @param {string[]} resourceArns list of ARNs to allow access to
63
+ * @param resourceArns list of ARNs to allow access to
68
64
  */
69
65
  statementForPutEvents(resourceArns) {
70
66
  return new iam.PolicyStatement({
71
- effect: iam.Effect.ALLOW,
72
67
  actions: ['events:PutEvents'],
68
+ effect: iam.Effect.ALLOW,
73
69
  resources: resourceArns ?? ['*'],
74
70
  });
75
71
  }
76
72
  /**
77
73
  * @summary Method to create iam statement to start stepfunction execution
78
- * @param {string[]} resourceArns list of ARNs to allow access to
74
+ * @param resourceArns list of ARNs to allow access to
79
75
  */
80
76
  statementForStartExecution(resourceArns) {
81
77
  return new iam.PolicyStatement({
82
- effect: iam.Effect.ALLOW,
83
78
  actions: ['states:StartExecution'],
79
+ effect: iam.Effect.ALLOW,
84
80
  resources: resourceArns ?? ['*'],
85
81
  });
86
82
  }
87
83
  /**
88
84
  * @summary Method to create iam statement to poll queue
89
- * @param {string[]} resourceArns list of ARNs to allow access to
85
+ * @param resourceArns list of ARNs to allow access to
90
86
  */
91
87
  statementForPollQueue(resourceArns) {
92
88
  return new iam.PolicyStatement({
93
- effect: iam.Effect.ALLOW,
94
89
  actions: ['sqs:ReceiveMessage', 'sqs:DeleteMessage', 'sqs:GetQueueAttributes'],
90
+ effect: iam.Effect.ALLOW,
95
91
  resources: resourceArns ?? ['*'],
96
92
  });
97
93
  }
98
94
  /**
99
95
  * @summary Method to create iam statement to invoke lambda function
100
- * @param {string[]} resourceArns list of ARNs to allow access to
96
+ * @param resourceArns list of ARNs to allow access to
101
97
  */
102
98
  statementForInvokeLambda(resourceArns) {
103
99
  return new iam.PolicyStatement({
104
- effect: iam.Effect.ALLOW,
105
100
  actions: ['lambda:InvokeFunction'],
101
+ effect: iam.Effect.ALLOW,
106
102
  resources: resourceArns ?? ['*'],
107
103
  });
108
104
  }
109
105
  /**
110
106
  * @summary Method to create iam statement to read app config
111
- * @param {string[]} resourceArns list of ARNs to allow access to
107
+ * @param resourceArns list of ARNs to allow access to
112
108
  */
113
109
  statementForReadAnyAppConfig(resourceArns) {
114
110
  return new iam.PolicyStatement({
115
- effect: iam.Effect.ALLOW,
116
111
  actions: [
117
112
  'ssm:GetDocument',
118
113
  'ssm:ListDocuments',
@@ -127,140 +122,141 @@ class IamManager {
127
122
  'appconfig:GetConfiguration',
128
123
  'appconfig:ListDeployments',
129
124
  ],
125
+ effect: iam.Effect.ALLOW,
130
126
  resources: resourceArns ?? ['*'],
131
127
  });
132
128
  }
133
129
  /**
134
130
  * @summary Method to create iam statement to access app config
135
- * @param {string[]} resourceArns list of ARNs to allow access to
131
+ * @param resourceArns list of ARNs to allow access to
136
132
  */
137
133
  statementForAppConfigExecution(resourceArns) {
138
134
  return new iam.PolicyStatement({
139
- effect: iam.Effect.ALLOW,
140
135
  actions: ['appconfig:GetLatestConfiguration', 'appconfig:StartConfigurationSession'],
136
+ effect: iam.Effect.ALLOW,
141
137
  resources: resourceArns ?? ['*'],
142
138
  });
143
139
  }
144
140
  /**
145
141
  * @summary Method to create iam statement to put xray telemetry
146
- * @param {string[]} resourceArns list of ARNs to allow access to
142
+ * @param resourceArns list of ARNs to allow access to
147
143
  */
148
144
  statementForPutXrayTelemetry(resourceArns) {
149
145
  return new iam.PolicyStatement({
150
- effect: iam.Effect.ALLOW,
151
146
  actions: ['xray:PutTraceSegments', 'xray:PutTelemetryRecords'],
147
+ effect: iam.Effect.ALLOW,
152
148
  resources: resourceArns ?? ['*'],
153
149
  });
154
150
  }
155
151
  /**
156
152
  * @summary Method to create iam statement to decrypt kms
157
- * @param {string[]} resourceArns list of ARNs to allow access to
153
+ * @param resourceArns list of ARNs to allow access to
158
154
  */
159
155
  statementForDecryptKms(resourceArns) {
160
156
  return new iam.PolicyStatement({
161
- effect: iam.Effect.ALLOW,
162
157
  actions: ['kms:Decrypt'],
158
+ effect: iam.Effect.ALLOW,
163
159
  resources: resourceArns ?? ['*'],
164
160
  });
165
161
  }
166
162
  /**
167
163
  * @summary Method to create iam statement to list s3 buckets
168
- * @param {CommonConstruct} scope scope in which this resource is defined
169
- * @param {s3.IBucket} bucket
164
+ * @param scope scope in which this resource is defined
165
+ * @param bucket
170
166
  */
171
167
  statementForListBucket(scope, bucket) {
172
168
  return new iam.PolicyStatement({
173
- effect: iam.Effect.ALLOW,
174
169
  actions: ['s3:ListBucket'],
170
+ effect: iam.Effect.ALLOW,
175
171
  resources: [bucket.bucketArn],
176
172
  });
177
173
  }
178
174
  /**
179
175
  * @summary Method to create iam statement to list all s3 buckets
180
- * @param {string[]} resourceArns list of ARNs to allow access to
176
+ * @param resourceArns list of ARNs to allow access to
181
177
  */
182
178
  statementForListAllMyBuckets(resourceArns) {
183
179
  return new iam.PolicyStatement({
184
- effect: iam.Effect.ALLOW,
185
180
  actions: ['s3:ListAllMyBuckets'],
181
+ effect: iam.Effect.ALLOW,
186
182
  resources: resourceArns ?? ['*'],
187
183
  });
188
184
  }
189
185
  /**
190
186
  * @summary Method to create iam statement to get s3 objects in buckets
191
- * @param {CommonConstruct} scope scope in which this resource is defined
192
- * @param {s3.IBucket} bucket
193
- * @param {string[]} resourceArns list of ARNs to allow access to
187
+ * @param scope scope in which this resource is defined
188
+ * @param bucket
189
+ * @param resourceArns list of ARNs to allow access to
194
190
  */
195
191
  statementForGetAnyS3Objects(scope, bucket, resourceArns) {
196
192
  return new iam.PolicyStatement({
197
- effect: iam.Effect.ALLOW,
198
193
  actions: ['s3:GetObject', 's3:GetObjectAcl'],
194
+ effect: iam.Effect.ALLOW,
199
195
  resources: resourceArns ?? [bucket.arnForObjects(`*`)],
200
196
  });
201
197
  }
202
198
  /**
203
199
  * @summary Method to create iam statement to delete s3 objects in buckets
204
- * @param {CommonConstruct} scope scope in which this resource is defined
205
- * @param {s3.IBucket} bucket
206
- * @param {string[]} resourceArns list of ARNs to allow access to
200
+ * @param scope scope in which this resource is defined
201
+ * @param bucket
202
+ * @param resourceArns list of ARNs to allow access to
207
203
  */
208
204
  statementForDeleteAnyS3Objects(scope, bucket, resourceArns) {
209
205
  return new iam.PolicyStatement({
210
- effect: iam.Effect.ALLOW,
211
206
  actions: ['s3:DeleteObject'],
207
+ effect: iam.Effect.ALLOW,
212
208
  resources: resourceArns ?? [bucket.arnForObjects(`*`)],
213
209
  });
214
210
  }
215
211
  /**
216
212
  * @summary Method to create iam statement to write s3 objects in buckets
217
- * @param {CommonConstruct} scope scope in which this resource is defined
218
- * @param {s3.IBucket} bucket
219
- * @param {string[]} resourceArns list of ARNs to allow access to
213
+ * @param scope scope in which this resource is defined
214
+ * @param bucket
215
+ * @param resourceArns list of ARNs to allow access to
220
216
  */
221
217
  statementForPutAnyS3Objects(scope, bucket, resourceArns) {
222
218
  return new iam.PolicyStatement({
223
- effect: iam.Effect.ALLOW,
224
219
  actions: ['s3:PutObject', 's3:PutObjectAcl'],
220
+ effect: iam.Effect.ALLOW,
225
221
  resources: resourceArns ?? [bucket.arnForObjects(`*`)],
226
222
  });
227
223
  }
228
224
  /**
229
225
  * @summary Method to create iam statement to pass iam role
230
- * @param {string[]} resourceArns list of ARNs to allow access to
226
+ * @param resourceArns list of ARNs to allow access to
231
227
  */
232
228
  statementForPassRole(resourceArns) {
233
229
  return new iam.PolicyStatement({
234
- effect: iam.Effect.ALLOW,
235
230
  actions: ['iam:PassRole'],
231
+ effect: iam.Effect.ALLOW,
236
232
  resources: resourceArns ?? ['*'],
237
233
  });
238
234
  }
239
235
  /**
240
236
  * @summary Method to create iam statement to invalidate cloudfront cache
241
- * @param {string[]} resourceArns list of ARNs to allow access to
237
+ * @param resourceArns list of ARNs to allow access to
242
238
  */
243
239
  statementForCloudfrontInvalidation(resourceArns) {
244
240
  return new iam.PolicyStatement({
245
- effect: iam.Effect.ALLOW,
246
241
  actions: ['cloudfront:GetInvalidation', 'cloudfront:CreateInvalidation'],
242
+ effect: iam.Effect.ALLOW,
247
243
  resources: resourceArns ?? ['*'],
248
244
  });
249
245
  }
250
246
  /**
251
247
  * @summary Method to create iam statement to access efs
252
- * @param {string[]} resourceArns list of ARNs to allow access to
248
+ * @param resourceArns list of ARNs to allow access to
253
249
  */
254
250
  statementForWriteEfs(resourceArns) {
255
251
  return new iam.PolicyStatement({
256
- effect: iam.Effect.ALLOW,
257
252
  actions: ['elasticfilesystem:*'],
253
+ effect: iam.Effect.ALLOW,
258
254
  resources: resourceArns ?? ['*'],
259
255
  });
260
256
  }
261
257
  /**
262
258
  * @summary Method to create iam policy to invalidate cloudfront cache
263
- * @param {string[]} resourceArns list of ARNs to allow access to
259
+ * @param resourceArns list of ARNs to allow access to
264
260
  */
265
261
  policyForCloudfrontInvalidation(resourceArns) {
266
262
  return new iam.PolicyDocument({
@@ -269,13 +265,13 @@ class IamManager {
269
265
  this.statementForPutAnyLogEvent(),
270
266
  this.statementForCloudfrontInvalidation(),
271
267
  new iam.PolicyStatement({
272
- effect: iam.Effect.ALLOW,
273
268
  actions: [
274
269
  'ecr:GetDownloadUrlForLayer',
275
270
  'ecr:BatchGetImage',
276
271
  'ecr:BatchCheckLayerAvailability',
277
272
  'ecr:GetAuthorizationToken',
278
273
  ],
274
+ effect: iam.Effect.ALLOW,
279
275
  resources: resourceArns ?? ['*'],
280
276
  }),
281
277
  ],
@@ -283,8 +279,8 @@ class IamManager {
283
279
  }
284
280
  /**
285
281
  * @summary Method to create iam role to invalidate cloudfront cache
286
- * @param {string} id scoped id of the resource
287
- * @param {CommonConstruct} scope scope in which this resource is defined
282
+ * @param id scoped id of the resource
283
+ * @param scope scope in which this resource is defined
288
284
  */
289
285
  roleForCloudfrontInvalidation(id, scope) {
290
286
  return new iam.Role(scope, `${id}-install-deps-project-role`, {
@@ -296,51 +292,51 @@ class IamManager {
296
292
  }
297
293
  /**
298
294
  * @summary Method to create iam statement to assume iam role
299
- * @param {CommonConstruct} scope scope in which this resource is defined
300
- * @param {iam.ServicePrincipal[]} servicePrincipals
295
+ * @param scope scope in which this resource is defined
296
+ * @param servicePrincipals
301
297
  */
302
298
  statementForAssumeRole(scope, servicePrincipals) {
303
299
  return new iam.PolicyStatement({
304
- effect: iam.Effect.ALLOW,
305
300
  actions: ['sts:AssumeRole'],
301
+ effect: iam.Effect.ALLOW,
306
302
  principals: servicePrincipals,
307
303
  });
308
304
  }
309
305
  /**
310
306
  * @summary Method to create iam statement to pass ecs role
311
- * @param {string[]} resourceArns list of ARNs to allow access to
307
+ * @param resourceArns list of ARNs to allow access to
312
308
  */
313
309
  statementForEcsPassRole(resourceArns) {
314
310
  return new iam.PolicyStatement({
315
- effect: iam.Effect.ALLOW,
316
311
  actions: ['iam:PassRole'],
317
- resources: resourceArns ?? ['*'],
318
312
  conditions: { StringLike: { 'iam:PassedToService': 'ecs-tasks.amazonaws.com' } },
313
+ effect: iam.Effect.ALLOW,
314
+ resources: resourceArns ?? ['*'],
319
315
  });
320
316
  }
321
317
  /**
322
318
  * @summary Method to create iam statement to run ecs task
323
- * @param {CommonConstruct} scope scope in which this resource is defined
324
- * @param {ecs.ICluster} cluster
325
- * @param {ecs.ITaskDefinition} task
319
+ * @param scope scope in which this resource is defined
320
+ * @param cluster
321
+ * @param task
326
322
  */
327
323
  statementForRunEcsTask(scope, cluster, task) {
328
324
  return new iam.PolicyStatement({
329
- effect: iam.Effect.ALLOW,
330
325
  actions: ['ecs:RunTask'],
331
- resources: [task.taskDefinitionArn],
332
326
  conditions: { ArnLike: { 'ecs:cluster': cluster.clusterArn } },
327
+ effect: iam.Effect.ALLOW,
328
+ resources: [task.taskDefinitionArn],
333
329
  });
334
330
  }
335
331
  /**
336
332
  * @summary Method to create iam statement to create log stream
337
- * @param {CommonConstruct} scope scope in which this resource is defined
338
- * @param {logs.CfnLogGroup} logGroup
333
+ * @param scope scope in which this resource is defined
334
+ * @param logGroup
339
335
  */
340
336
  statementForCreateLogStream(scope, logGroup) {
341
337
  return new iam.PolicyStatement({
342
- effect: iam.Effect.ALLOW,
343
338
  actions: ['logs:CreateLogStream'],
339
+ effect: iam.Effect.ALLOW,
344
340
  resources: [
345
341
  `arn:aws:logs:${cdk.Stack.of(scope).region}:${cdk.Stack.of(scope).account}:log-group:${logGroup.logGroupName}:log-stream:${cdk.Stack.of(scope).account}_CloudTrail_eu-west-1*`,
346
342
  ],
@@ -349,24 +345,24 @@ class IamManager {
349
345
  }
350
346
  /**
351
347
  * @summary Method to create iam statement to create any log stream
352
- * @param {string[]} resourceArns list of ARNs to allow access to
348
+ * @param resourceArns list of ARNs to allow access to
353
349
  */
354
350
  statementForCreateAnyLogStream(resourceArns) {
355
351
  return new iam.PolicyStatement({
356
- effect: iam.Effect.ALLOW,
357
352
  actions: ['logs:CreateLogStream'],
353
+ effect: iam.Effect.ALLOW,
358
354
  resources: resourceArns ?? ['*'],
359
355
  });
360
356
  }
361
357
  /**
362
358
  * @summary Method to create iam statement to write log events
363
- * @param {CommonConstruct} scope scope in which this resource is defined
364
- * @param {logs.CfnLogGroup} logGroup
359
+ * @param scope scope in which this resource is defined
360
+ * @param logGroup
365
361
  */
366
362
  statementForPutLogEvent(scope, logGroup) {
367
363
  return new iam.PolicyStatement({
368
- effect: iam.Effect.ALLOW,
369
364
  actions: ['logs:PutLogEvents'],
365
+ effect: iam.Effect.ALLOW,
370
366
  resources: [
371
367
  `arn:aws:logs:${cdk.Stack.of(scope).region}:${cdk.Stack.of(scope).account}:log-group:${logGroup.logGroupName}:log-stream:${cdk.Stack.of(scope).account}_CloudTrail_eu-west-1*`,
372
368
  ],
@@ -375,22 +371,21 @@ class IamManager {
375
371
  }
376
372
  /**
377
373
  * @summary Method to create iam statement to write any log events
378
- * @param {string[]} resourceArns list of ARNs to allow access to
374
+ * @param resourceArns list of ARNs to allow access to
379
375
  */
380
376
  statementForPutAnyLogEvent(resourceArns) {
381
377
  return new iam.PolicyStatement({
382
- effect: iam.Effect.ALLOW,
383
378
  actions: ['logs:PutLogEvents'],
379
+ effect: iam.Effect.ALLOW,
384
380
  resources: resourceArns ?? ['*'],
385
381
  });
386
382
  }
387
383
  /**
388
384
  * @summary Method to create iam statement to read items from dynamodb table
389
- * @param {string[]} resourceArns list of ARNs to allow access to
385
+ * @param resourceArns list of ARNs to allow access to
390
386
  */
391
387
  statementForReadTableItems(resourceArns) {
392
388
  return new iam.PolicyStatement({
393
- effect: iam.Effect.ALLOW,
394
389
  actions: [
395
390
  'dynamodb:PartiQLSelect',
396
391
  'dynamodb:DescribeTable',
@@ -401,25 +396,26 @@ class IamManager {
401
396
  'dynamodb:GetRecords',
402
397
  'dynamodb:BatchGetItem',
403
398
  ],
399
+ effect: iam.Effect.ALLOW,
404
400
  resources: resourceArns ?? ['*'],
405
401
  });
406
402
  }
407
403
  /**
408
404
  * @summary Method to create iam statement to write items from dynamodb table
409
- * @param {string[]} resourceArns list of ARNs to allow access to
405
+ * @param resourceArns list of ARNs to allow access to
410
406
  */
411
407
  statementForWriteTableItems(resourceArns) {
412
408
  return new iam.PolicyStatement({
413
- effect: iam.Effect.ALLOW,
414
409
  actions: ['dynamodb:BatchWriteItem', 'dynamodb:DeleteItem', 'dynamodb:PutItem', 'dynamodb:UpdateItem'],
410
+ effect: iam.Effect.ALLOW,
415
411
  resources: resourceArns ?? ['*'],
416
412
  });
417
413
  }
418
414
  /**
419
415
  * @summary Method to create iam statement for cloud trail
420
- * @param {string} id scoped id of the resource
421
- * @param {CommonConstruct} scope scope in which this resource is defined
422
- * @param {logs.CfnLogGroup} logGroup
416
+ * @param id scoped id of the resource
417
+ * @param scope scope in which this resource is defined
418
+ * @param logGroup
423
419
  */
424
420
  createRoleForCloudTrail(id, scope, logGroup) {
425
421
  const policy = new iam.PolicyDocument({
@@ -431,8 +427,8 @@ class IamManager {
431
427
  }),
432
428
  policies: [
433
429
  {
434
- policyName: `${id}-policy-${scope.props.stage}`,
435
430
  policyDocument: policy,
431
+ policyName: `${id}-policy-${scope.props.stage}`,
436
432
  },
437
433
  ],
438
434
  roleName: `${id}-${scope.props.stage}`,
@@ -443,10 +439,10 @@ class IamManager {
443
439
  }
444
440
  /**
445
441
  * @summary Method to create iam statement for ecs event
446
- * @param {string} id scoped id of the resource
447
- * @param {CommonConstruct} scope scope in which this resource is defined
448
- * @param {ecs.ICluster} cluster
449
- * @param {ecs.ITaskDefinition} task
442
+ * @param id scoped id of the resource
443
+ * @param scope scope in which this resource is defined
444
+ * @param cluster
445
+ * @param task
450
446
  */
451
447
  createRoleForEcsEvent(id, scope, cluster, task) {
452
448
  const policy = new iam.PolicyDocument({
@@ -464,9 +460,9 @@ class IamManager {
464
460
  }
465
461
  /**
466
462
  * @summary Method to create iam statement for ecs execution
467
- * @param {string} id scoped id of the resource
468
- * @param {CommonConstruct} scope scope in which this resource is defined
469
- * @param {iam.PolicyDocument} policy
463
+ * @param id scoped id of the resource
464
+ * @param scope scope in which this resource is defined
465
+ * @param policy
470
466
  */
471
467
  createRoleForEcsExecution(id, scope, policy) {
472
468
  const role = new iam.Role(scope, `${id}`, {
@@ -484,10 +480,10 @@ class IamManager {
484
480
  }
485
481
  /**
486
482
  * @summary Method to create iam statement for lambda execution
487
- * @param {string} id scoped id of the resource
488
- * @param {CommonConstruct} scope scope in which this resource is defined
489
- * @param {iam.PolicyDocument} policy
490
- * @param {iam.ServicePrincipal} servicePrinicpal
483
+ * @param id scoped id of the resource
484
+ * @param scope scope in which this resource is defined
485
+ * @param policy
486
+ * @param servicePrinicpal
491
487
  */
492
488
  createRoleForLambda(id, scope, policy, servicePrinicpal) {
493
489
  const role = new iam.Role(scope, `${id}`, {
@@ -505,10 +501,10 @@ class IamManager {
505
501
  }
506
502
  /**
507
503
  * @summary Method to create iam statement for step function execution
508
- * @param {string} id scoped id of the resource
509
- * @param {CommonConstruct} scope scope in which this resource is defined
510
- * @param {iam.PolicyDocument} policy
511
- * @param {iam.ServicePrincipal} servicePrinicpal
504
+ * @param id scoped id of the resource
505
+ * @param scope scope in which this resource is defined
506
+ * @param policy
507
+ * @param servicePrinicpal
512
508
  */
513
509
  createRoleForStepFunction(id, scope, policy, servicePrinicpal) {
514
510
  const role = new iam.Role(scope, `${id}`, {
@@ -526,10 +522,10 @@ class IamManager {
526
522
  }
527
523
  /**
528
524
  * @summary Method to create iam statement for sqs to step function pipe
529
- * @param {string} id scoped id of the resource
530
- * @param {CommonConstruct} scope scope in which this resource is defined
531
- * @param {string} queueArn the arn of the sqs queue
532
- * @param {string} stepFunctionArn the arn of the step function
525
+ * @param id scoped id of the resource
526
+ * @param scope scope in which this resource is defined
527
+ * @param queueArn the arn of the sqs queue
528
+ * @param stepFunctionArn the arn of the step function
533
529
  */
534
530
  createRoleForSqsToSfnPipe(id, scope, queueArn, stepFunctionArn) {
535
531
  const role = new iam.Role(scope, `${id}`, {
@@ -545,8 +541,8 @@ class IamManager {
545
541
  }
546
542
  /**
547
543
  * @summary Method to create iam policy for sqs
548
- * @param {string} id scoped id of the resource
549
- * @param {CommonConstruct} scope scope in which this resource is defined
544
+ * @param id scoped id of the resource
545
+ * @param scope scope in which this resource is defined
550
546
  * @param sqsQueue
551
547
  * @param eventBridgeRule
552
548
  * @param servicePrincipals
@@ -556,12 +552,12 @@ class IamManager {
556
552
  statements: [
557
553
  new iam.PolicyStatement({
558
554
  actions: ['sqs:*'],
559
- effect: iam.Effect.ALLOW,
560
555
  conditions: {
561
556
  ArnEquals: {
562
557
  'aws:SourceArn': eventBridgeRule,
563
558
  },
564
559
  },
560
+ effect: iam.Effect.ALLOW,
565
561
  principals: servicePrincipals ?? [new iam.ServicePrincipal('events.amazonaws.com')],
566
562
  resources: [sqsQueue.queueArn],
567
563
  }),
@@ -2,9 +2,6 @@ import * as kms from 'aws-cdk-lib/aws-kms';
2
2
  import { CommonConstruct } from '../../../common';
3
3
  import { KmsKeyProps } from './types';
4
4
  /**
5
- * @stability stable
6
- * @category cdk-utils.kms-manager
7
- * @subcategory Construct
8
5
  * @classdesc Provides operations on AWS KMS.
9
6
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
10
7
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -18,15 +15,14 @@ import { KmsKeyProps } from './types';
18
15
  * this.kms.createKey('MyKey', this)
19
16
  * }
20
17
  * }
21
- *
22
18
  * @see [CDK KMS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms-readme.html}
23
19
  */
24
20
  export declare class KmsManager {
25
21
  /**
26
22
  * @summary Method to create a KMS key
27
- * @param {string} id scoped id of the resource
28
- * @param {CommonConstruct} scope scope in which this resource is defined
29
- * @param {KmsKeyProps} props KMS key props
23
+ * @param id scoped id of the resource
24
+ * @param scope scope in which this resource is defined
25
+ * @param props KMS key props
30
26
  */
31
27
  createKey(id: string, scope: CommonConstruct, props: KmsKeyProps): kms.Key;
32
28
  }
@@ -27,9 +27,6 @@ exports.KmsManager = void 0;
27
27
  const kms = __importStar(require("aws-cdk-lib/aws-kms"));
28
28
  const utils = __importStar(require("../../../utils"));
29
29
  /**
30
- * @stability stable
31
- * @category cdk-utils.kms-manager
32
- * @subcategory Construct
33
30
  * @classdesc Provides operations on AWS KMS.
34
31
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
35
32
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -43,30 +40,29 @@ const utils = __importStar(require("../../../utils"));
43
40
  * this.kms.createKey('MyKey', this)
44
41
  * }
45
42
  * }
46
- *
47
43
  * @see [CDK KMS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms-readme.html}
48
44
  */
49
45
  class KmsManager {
50
46
  /**
51
47
  * @summary Method to create a KMS key
52
- * @param {string} id scoped id of the resource
53
- * @param {CommonConstruct} scope scope in which this resource is defined
54
- * @param {KmsKeyProps} props KMS key props
48
+ * @param id scoped id of the resource
49
+ * @param scope scope in which this resource is defined
50
+ * @param props KMS key props
55
51
  */
56
52
  createKey(id, scope, props) {
57
53
  if (!props)
58
54
  throw `KMS Key props undefined for ${id}`;
59
55
  const key = new kms.Key(scope, `${id}`, {
60
- description: props.description,
56
+ admins: props.admins,
61
57
  alias: `${props.alias}-${scope.props.stage}`,
58
+ description: props.description,
62
59
  enableKeyRotation: props.enableKeyRotation,
63
60
  enabled: props.enabled,
64
61
  keySpec: props.keySpec,
65
62
  keyUsage: props.keyUsage,
63
+ pendingWindow: props.pendingWindow,
66
64
  policy: props.policy,
67
- admins: props.admins,
68
65
  removalPolicy: props.removalPolicy,
69
- pendingWindow: props.pendingWindow,
70
66
  });
71
67
  utils.createCfnOutput(`${id}-keyId`, scope, key.keyId);
72
68
  utils.createCfnOutput(`${id}-keyArn`, scope, key.keyArn);
@@ -1,7 +1,5 @@
1
1
  import { KeyProps } from 'aws-cdk-lib/aws-kms';
2
2
  /**
3
- * @category cdk-utils.kms-manager
4
- * @subcategory Properties
5
3
  */
6
4
  export interface KmsKeyProps extends KeyProps {
7
5
  }