@gradientedge/cdk-utils 4.4.1 → 4.4.5

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 (406) hide show
  1. package/README.md +2 -6
  2. package/app/api-destined-function/package.json +0 -1
  3. package/lerna.json +6 -0
  4. package/package.json +15 -16
  5. package/src/lib/common/construct.ts +2 -1
  6. package/src/lib/common/stack.ts +2 -1
  7. package/src/lib/construct/api-to-eventbridge-target/api-destination-event.ts +2 -1
  8. package/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.ts +2 -1
  9. package/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.ts +2 -1
  10. package/src/lib/construct/api-to-eventbridge-target/main.ts +2 -1
  11. package/src/lib/construct/graphql-api-lambda/main.ts +2 -1
  12. package/src/lib/construct/site-with-ecs-backend/main.ts +2 -1
  13. package/src/lib/construct/static-site/main.ts +2 -1
  14. package/src/lib/manager/aws/acm-manager.ts +2 -1
  15. package/src/lib/manager/aws/api-manager.ts +2 -1
  16. package/src/lib/manager/aws/app-config-manager.ts +4 -2
  17. package/src/lib/manager/aws/cloudfront-manager.ts +2 -1
  18. package/src/lib/manager/aws/cloudtrail-manager.ts +2 -1
  19. package/src/lib/manager/aws/cloudwatch-manager.ts +4 -2
  20. package/src/lib/manager/aws/codebuild-manager.ts +2 -1
  21. package/src/lib/manager/aws/dynamodb-manager.ts +2 -1
  22. package/src/lib/manager/aws/ecr-manager.ts +2 -1
  23. package/src/lib/manager/aws/ecs-manager.ts +2 -1
  24. package/src/lib/manager/aws/eks-manager.ts +2 -1
  25. package/src/lib/manager/aws/event-manager.ts +2 -1
  26. package/src/lib/manager/aws/iam-manager.ts +2 -1
  27. package/src/lib/manager/aws/lambda-manager.ts +2 -1
  28. package/src/lib/manager/aws/log-manager.ts +2 -1
  29. package/src/lib/manager/aws/route53-manager.ts +2 -1
  30. package/src/lib/manager/aws/s3-manager.ts +2 -1
  31. package/src/lib/manager/aws/secrets-manager.ts +2 -1
  32. package/src/lib/manager/aws/sns-manager.ts +2 -1
  33. package/src/lib/manager/aws/ssm-manager.ts +4 -2
  34. package/src/lib/manager/aws/vpc-manager.ts +4 -2
  35. package/src/lib/manager/aws/waf-manager.ts +2 -1
  36. package/src/lib/types/aws/index.ts +98 -47
  37. package/src/lib/utils/aws/index.ts +1 -1
  38. package/src/lib/utils/index.ts +8 -9
  39. package/api-docs/AcmManager.html +0 -619
  40. package/api-docs/AcmProps.html +0 -235
  41. package/api-docs/AlarmProps.html +0 -235
  42. package/api-docs/AlarmStatusWidgetProps.html +0 -235
  43. package/api-docs/ApiDestinationEvent.html +0 -294
  44. package/api-docs/ApiDestinationEventType.html +0 -235
  45. package/api-docs/ApiDestinedLambda.html +0 -294
  46. package/api-docs/ApiDestinedLambdaEnvironment.html +0 -235
  47. package/api-docs/ApiDestinedLambdaType.html +0 -235
  48. package/api-docs/ApiDestinedRestApi.html +0 -294
  49. package/api-docs/ApiDestinedRestApiType.html +0 -235
  50. package/api-docs/ApiManager.html +0 -763
  51. package/api-docs/ApiToEventBridgeTarget.html +0 -1874
  52. package/api-docs/ApiToEventBridgeTarget.jpg +0 -0
  53. package/api-docs/ApiToEventBridgeTargetEventProps.html +0 -235
  54. package/api-docs/ApiToEventBridgeTargetLambdaProps.html +0 -235
  55. package/api-docs/ApiToEventBridgeTargetProps.html +0 -235
  56. package/api-docs/AppConfigManager.html +0 -1200
  57. package/api-docs/AppConfigProps.html +0 -235
  58. package/api-docs/CloudFrontManager.html +0 -2399
  59. package/api-docs/CloudFrontProps.html +0 -235
  60. package/api-docs/CloudTrailManager.html +0 -634
  61. package/api-docs/CloudTrailProps.html +0 -235
  62. package/api-docs/CloudWatchManager.html +0 -2983
  63. package/api-docs/CloudfrontFunctionProps.html +0 -235
  64. package/api-docs/CodeBuildManager.html +0 -733
  65. package/api-docs/CommonConstruct.html +0 -1296
  66. package/api-docs/CommonStack.html +0 -810
  67. package/api-docs/CommonStackProps.html +0 -235
  68. package/api-docs/DashboardProps.html +0 -235
  69. package/api-docs/DistributionProps.html +0 -235
  70. package/api-docs/DynamodbManager.html +0 -527
  71. package/api-docs/EcrManager.html +0 -527
  72. package/api-docs/EcsClusterProps.html +0 -235
  73. package/api-docs/EcsManager.html +0 -877
  74. package/api-docs/EcsTaskProps.html +0 -235
  75. package/api-docs/EksClusterProps.html +0 -235
  76. package/api-docs/EksManager.html +0 -577
  77. package/api-docs/EventBusProps.html +0 -235
  78. package/api-docs/EventManager.html +0 -1451
  79. package/api-docs/EventRuleProps.html +0 -235
  80. package/api-docs/GraphQLApiLambda.html +0 -1668
  81. package/api-docs/GraphQLApiLambda.jpg +0 -0
  82. package/api-docs/GraphQlApiLambdaEnvironment.html +0 -235
  83. package/api-docs/GraphQlApiLambdaProps.html +0 -235
  84. package/api-docs/GraphWidgetProps.html +0 -235
  85. package/api-docs/HealthCheck.html +0 -235
  86. package/api-docs/IamManager.html +0 -3818
  87. package/api-docs/LambdaEdgeProps.html +0 -235
  88. package/api-docs/LambdaEnvironment.html +0 -235
  89. package/api-docs/LambdaManager.html +0 -2375
  90. package/api-docs/LambdaProps.html +0 -235
  91. package/api-docs/LogManager.html +0 -952
  92. package/api-docs/LogProps.html +0 -235
  93. package/api-docs/LogQueryWidgetProps.html +0 -235
  94. package/api-docs/MetricFilterProps.html +0 -235
  95. package/api-docs/MetricProps.html +0 -235
  96. package/api-docs/NumericWidgetProps.html +0 -235
  97. package/api-docs/Route53Manager.html +0 -1457
  98. package/api-docs/Route53Props.html +0 -235
  99. package/api-docs/RuleProps.html +0 -235
  100. package/api-docs/S3BucketProps.html +0 -235
  101. package/api-docs/S3Manager.html +0 -1543
  102. package/api-docs/SSMParameterReader.html +0 -428
  103. package/api-docs/SSMParameterReaderProps.html +0 -235
  104. package/api-docs/SecretsManager.html +0 -1137
  105. package/api-docs/SiteWithEcsBackend.html +0 -2388
  106. package/api-docs/SiteWithEcsBackendProps.html +0 -235
  107. package/api-docs/SnsManager.html +0 -777
  108. package/api-docs/SsmManager.html +0 -952
  109. package/api-docs/StaticSite.html +0 -1355
  110. package/api-docs/StaticSiteProps.html +0 -235
  111. package/api-docs/SubscriptionProps.html +0 -235
  112. package/api-docs/TableProps.html +0 -235
  113. package/api-docs/TextWidgetProps.html +0 -235
  114. package/api-docs/VpcManager.html +0 -983
  115. package/api-docs/WafIPSetProps.html +0 -235
  116. package/api-docs/WafManager.html +0 -727
  117. package/api-docs/WafWebACLProps.html +0 -235
  118. package/api-docs/common_construct.ts.html +0 -275
  119. package/api-docs/common_stack.ts.html +0 -299
  120. package/api-docs/construct_api-to-eventbridge-target_api-destination-event.ts.html +0 -171
  121. package/api-docs/construct_api-to-eventbridge-target_api-destined-lambda.ts.html +0 -174
  122. package/api-docs/construct_api-to-eventbridge-target_api-destined-rest-api.ts.html +0 -186
  123. package/api-docs/construct_api-to-eventbridge-target_main.ts.html +0 -747
  124. package/api-docs/construct_graphql-api-lambda_main.ts.html +0 -404
  125. package/api-docs/construct_site-with-ecs-backend_main.ts.html +0 -540
  126. package/api-docs/construct_static-site_main.ts.html +0 -370
  127. package/api-docs/global.html +0 -1527
  128. package/api-docs/index.html +0 -207
  129. package/api-docs/manager_aws_acm-manager.ts.html +0 -232
  130. package/api-docs/manager_aws_api-manager.ts.html +0 -256
  131. package/api-docs/manager_aws_app-config-manager.ts.html +0 -305
  132. package/api-docs/manager_aws_cloudfront-manager.ts.html +0 -487
  133. package/api-docs/manager_aws_cloudtrail-manager.ts.html +0 -247
  134. package/api-docs/manager_aws_cloudwatch-manager.ts.html +0 -548
  135. package/api-docs/manager_aws_codebuild-manager.ts.html +0 -236
  136. package/api-docs/manager_aws_dynamodb-manager.ts.html +0 -215
  137. package/api-docs/manager_aws_ecr-manager.ts.html +0 -195
  138. package/api-docs/manager_aws_ecs-manager.ts.html +0 -255
  139. package/api-docs/manager_aws_eks-manager.ts.html +0 -256
  140. package/api-docs/manager_aws_event-manager.ts.html +0 -332
  141. package/api-docs/manager_aws_iam-manager.ts.html +0 -569
  142. package/api-docs/manager_aws_lambda-manager.ts.html +0 -396
  143. package/api-docs/manager_aws_log-manager.ts.html +0 -255
  144. package/api-docs/manager_aws_route53-manager.ts.html +0 -329
  145. package/api-docs/manager_aws_s3-manager.ts.html +0 -357
  146. package/api-docs/manager_aws_secrets-manager.ts.html +0 -270
  147. package/api-docs/manager_aws_sns-manager.ts.html +0 -242
  148. package/api-docs/manager_aws_ssm-manager.ts.html +0 -268
  149. package/api-docs/manager_aws_vpc-manager.ts.html +0 -239
  150. package/api-docs/manager_aws_waf-manager.ts.html +0 -228
  151. package/api-docs/scripts/app.min.js +0 -1
  152. package/api-docs/scripts/linenumber.js +0 -26
  153. package/api-docs/scripts/search.js +0 -39
  154. package/api-docs/styles/app.min.css +0 -1
  155. package/api-docs/styles/iframe.css +0 -13
  156. package/api-docs/styles/prettify-jsdoc.css +0 -111
  157. package/api-docs/styles/prettify-tomorrow.css +0 -132
  158. package/api-docs/styles/reset.css +0 -44
  159. package/api-docs/tutorial-Architecture.html +0 -147
  160. package/api-docs/tutorial-Build.html +0 -146
  161. package/api-docs/tutorial-CI-CD.html +0 -150
  162. package/api-docs/tutorial-Development.html +0 -223
  163. package/api-docs/types_aws_index.ts.html +0 -611
  164. package/api-docs/utils_aws_index.ts.html +0 -189
  165. package/api-docs/utils_index.ts.html +0 -225
  166. package/app/api-destined-function/node_modules/uuid/dist/bin/uuid +0 -2
  167. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/index.js +0 -9
  168. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/md5.js +0 -215
  169. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/nil.js +0 -1
  170. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/parse.js +0 -35
  171. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/regex.js +0 -1
  172. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/rng.js +0 -19
  173. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/sha1.js +0 -96
  174. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/stringify.js +0 -30
  175. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v1.js +0 -95
  176. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v3.js +0 -4
  177. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v35.js +0 -64
  178. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v4.js +0 -24
  179. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v5.js +0 -4
  180. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/validate.js +0 -7
  181. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/version.js +0 -11
  182. package/app/api-destined-function/node_modules/uuid/dist/esm-node/index.js +0 -9
  183. package/app/api-destined-function/node_modules/uuid/dist/esm-node/md5.js +0 -13
  184. package/app/api-destined-function/node_modules/uuid/dist/esm-node/nil.js +0 -1
  185. package/app/api-destined-function/node_modules/uuid/dist/esm-node/parse.js +0 -35
  186. package/app/api-destined-function/node_modules/uuid/dist/esm-node/regex.js +0 -1
  187. package/app/api-destined-function/node_modules/uuid/dist/esm-node/rng.js +0 -12
  188. package/app/api-destined-function/node_modules/uuid/dist/esm-node/sha1.js +0 -13
  189. package/app/api-destined-function/node_modules/uuid/dist/esm-node/stringify.js +0 -29
  190. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v1.js +0 -95
  191. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v3.js +0 -4
  192. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v35.js +0 -64
  193. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v4.js +0 -24
  194. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v5.js +0 -4
  195. package/app/api-destined-function/node_modules/uuid/dist/esm-node/validate.js +0 -7
  196. package/app/api-destined-function/node_modules/uuid/dist/esm-node/version.js +0 -11
  197. package/app/api-destined-function/node_modules/uuid/dist/index.js +0 -79
  198. package/app/api-destined-function/node_modules/uuid/dist/md5-browser.js +0 -223
  199. package/app/api-destined-function/node_modules/uuid/dist/md5.js +0 -23
  200. package/app/api-destined-function/node_modules/uuid/dist/nil.js +0 -8
  201. package/app/api-destined-function/node_modules/uuid/dist/parse.js +0 -45
  202. package/app/api-destined-function/node_modules/uuid/dist/regex.js +0 -8
  203. package/app/api-destined-function/node_modules/uuid/dist/rng-browser.js +0 -26
  204. package/app/api-destined-function/node_modules/uuid/dist/rng.js +0 -24
  205. package/app/api-destined-function/node_modules/uuid/dist/sha1-browser.js +0 -104
  206. package/app/api-destined-function/node_modules/uuid/dist/sha1.js +0 -23
  207. package/app/api-destined-function/node_modules/uuid/dist/stringify.js +0 -39
  208. package/app/api-destined-function/node_modules/uuid/dist/umd/uuid.min.js +0 -1
  209. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidNIL.min.js +0 -1
  210. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidParse.min.js +0 -1
  211. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidStringify.min.js +0 -1
  212. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidValidate.min.js +0 -1
  213. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidVersion.min.js +0 -1
  214. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv1.min.js +0 -1
  215. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv3.min.js +0 -1
  216. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv4.min.js +0 -1
  217. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv5.min.js +0 -1
  218. package/app/api-destined-function/node_modules/uuid/dist/uuid-bin.js +0 -85
  219. package/app/api-destined-function/node_modules/uuid/dist/v1.js +0 -107
  220. package/app/api-destined-function/node_modules/uuid/dist/v3.js +0 -16
  221. package/app/api-destined-function/node_modules/uuid/dist/v35.js +0 -78
  222. package/app/api-destined-function/node_modules/uuid/dist/v4.js +0 -37
  223. package/app/api-destined-function/node_modules/uuid/dist/v5.js +0 -16
  224. package/app/api-destined-function/node_modules/uuid/dist/validate.js +0 -17
  225. package/app/api-destined-function/node_modules/uuid/dist/version.js +0 -21
  226. package/dist/app/api-destined-function/src/lib/lambda.d.ts +0 -19
  227. package/dist/app/api-destined-function/src/lib/lambda.d.ts.map +0 -1
  228. package/dist/app/api-destined-function/src/lib/lambda.js +0 -34
  229. package/dist/app/api-destined-function/src/lib/lambda.js.map +0 -1
  230. package/dist/index.d.ts +0 -6
  231. package/dist/index.d.ts.map +0 -1
  232. package/dist/index.js.map +0 -1
  233. package/dist/src/lib/common/construct.d.ts +0 -79
  234. package/dist/src/lib/common/construct.d.ts.map +0 -1
  235. package/dist/src/lib/common/construct.js +0 -133
  236. package/dist/src/lib/common/construct.js.map +0 -1
  237. package/dist/src/lib/common/index.d.ts +0 -3
  238. package/dist/src/lib/common/index.d.ts.map +0 -1
  239. package/dist/src/lib/common/index.js +0 -15
  240. package/dist/src/lib/common/index.js.map +0 -1
  241. package/dist/src/lib/common/stack.d.ts +0 -54
  242. package/dist/src/lib/common/stack.d.ts.map +0 -1
  243. package/dist/src/lib/common/stack.js +0 -147
  244. package/dist/src/lib/common/stack.js.map +0 -1
  245. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.d.ts +0 -16
  246. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.d.ts.map +0 -1
  247. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.js +0 -17
  248. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.js.map +0 -1
  249. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.d.ts +0 -19
  250. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.d.ts.map +0 -1
  251. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.js +0 -19
  252. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.js.map +0 -1
  253. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.d.ts +0 -35
  254. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.d.ts.map +0 -1
  255. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.js +0 -29
  256. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.js.map +0 -1
  257. package/dist/src/lib/construct/api-to-eventbridge-target/index.d.ts +0 -5
  258. package/dist/src/lib/construct/api-to-eventbridge-target/index.d.ts.map +0 -1
  259. package/dist/src/lib/construct/api-to-eventbridge-target/index.js +0 -17
  260. package/dist/src/lib/construct/api-to-eventbridge-target/index.js.map +0 -1
  261. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -134
  262. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts.map +0 -1
  263. package/dist/src/lib/construct/api-to-eventbridge-target/main.js +0 -487
  264. package/dist/src/lib/construct/api-to-eventbridge-target/main.js.map +0 -1
  265. package/dist/src/lib/construct/graphql-api-lambda/index.d.ts +0 -2
  266. package/dist/src/lib/construct/graphql-api-lambda/index.d.ts.map +0 -1
  267. package/dist/src/lib/construct/graphql-api-lambda/index.js +0 -14
  268. package/dist/src/lib/construct/graphql-api-lambda/index.js.map +0 -1
  269. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +0 -112
  270. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts.map +0 -1
  271. package/dist/src/lib/construct/graphql-api-lambda/main.js +0 -201
  272. package/dist/src/lib/construct/graphql-api-lambda/main.js.map +0 -1
  273. package/dist/src/lib/construct/index.d.ts +0 -5
  274. package/dist/src/lib/construct/index.d.ts.map +0 -1
  275. package/dist/src/lib/construct/index.js +0 -17
  276. package/dist/src/lib/construct/index.js.map +0 -1
  277. package/dist/src/lib/construct/site-with-ecs-backend/index.d.ts +0 -2
  278. package/dist/src/lib/construct/site-with-ecs-backend/index.d.ts.map +0 -1
  279. package/dist/src/lib/construct/site-with-ecs-backend/index.js +0 -14
  280. package/dist/src/lib/construct/site-with-ecs-backend/index.js.map +0 -1
  281. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -167
  282. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts.map +0 -1
  283. package/dist/src/lib/construct/site-with-ecs-backend/main.js +0 -327
  284. package/dist/src/lib/construct/site-with-ecs-backend/main.js.map +0 -1
  285. package/dist/src/lib/construct/static-site/index.d.ts +0 -2
  286. package/dist/src/lib/construct/static-site/index.d.ts.map +0 -1
  287. package/dist/src/lib/construct/static-site/index.js +0 -14
  288. package/dist/src/lib/construct/static-site/index.js.map +0 -1
  289. package/dist/src/lib/construct/static-site/main.d.ts +0 -94
  290. package/dist/src/lib/construct/static-site/main.d.ts.map +0 -1
  291. package/dist/src/lib/construct/static-site/main.js +0 -168
  292. package/dist/src/lib/construct/static-site/main.js.map +0 -1
  293. package/dist/src/lib/manager/aws/acm-manager.d.ts +0 -46
  294. package/dist/src/lib/manager/aws/acm-manager.d.ts.map +0 -1
  295. package/dist/src/lib/manager/aws/acm-manager.js +0 -90
  296. package/dist/src/lib/manager/aws/acm-manager.js.map +0 -1
  297. package/dist/src/lib/manager/aws/api-manager.d.ts +0 -43
  298. package/dist/src/lib/manager/aws/api-manager.d.ts.map +0 -1
  299. package/dist/src/lib/manager/aws/api-manager.js +0 -111
  300. package/dist/src/lib/manager/aws/api-manager.js.map +0 -1
  301. package/dist/src/lib/manager/aws/app-config-manager.d.ts +0 -64
  302. package/dist/src/lib/manager/aws/app-config-manager.d.ts.map +0 -1
  303. package/dist/src/lib/manager/aws/app-config-manager.js +0 -147
  304. package/dist/src/lib/manager/aws/app-config-manager.js.map +0 -1
  305. package/dist/src/lib/manager/aws/cloudfront-manager.d.ts +0 -112
  306. package/dist/src/lib/manager/aws/cloudfront-manager.d.ts.map +0 -1
  307. package/dist/src/lib/manager/aws/cloudfront-manager.js +0 -282
  308. package/dist/src/lib/manager/aws/cloudfront-manager.js.map +0 -1
  309. package/dist/src/lib/manager/aws/cloudtrail-manager.d.ts +0 -48
  310. package/dist/src/lib/manager/aws/cloudtrail-manager.d.ts.map +0 -1
  311. package/dist/src/lib/manager/aws/cloudtrail-manager.js +0 -99
  312. package/dist/src/lib/manager/aws/cloudtrail-manager.js.map +0 -1
  313. package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts +0 -121
  314. package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts.map +0 -1
  315. package/dist/src/lib/manager/aws/cloudwatch-manager.js +0 -351
  316. package/dist/src/lib/manager/aws/cloudwatch-manager.js.map +0 -1
  317. package/dist/src/lib/manager/aws/codebuild-manager.d.ts +0 -40
  318. package/dist/src/lib/manager/aws/codebuild-manager.d.ts.map +0 -1
  319. package/dist/src/lib/manager/aws/codebuild-manager.js +0 -94
  320. package/dist/src/lib/manager/aws/codebuild-manager.js.map +0 -1
  321. package/dist/src/lib/manager/aws/dynamodb-manager.d.ts +0 -32
  322. package/dist/src/lib/manager/aws/dynamodb-manager.d.ts.map +0 -1
  323. package/dist/src/lib/manager/aws/dynamodb-manager.js +0 -79
  324. package/dist/src/lib/manager/aws/dynamodb-manager.js.map +0 -1
  325. package/dist/src/lib/manager/aws/ecr-manager.d.ts +0 -31
  326. package/dist/src/lib/manager/aws/ecr-manager.d.ts.map +0 -1
  327. package/dist/src/lib/manager/aws/ecr-manager.js +0 -60
  328. package/dist/src/lib/manager/aws/ecr-manager.js.map +0 -1
  329. package/dist/src/lib/manager/aws/ecs-manager.d.ts +0 -48
  330. package/dist/src/lib/manager/aws/ecs-manager.d.ts.map +0 -1
  331. package/dist/src/lib/manager/aws/ecs-manager.js +0 -103
  332. package/dist/src/lib/manager/aws/ecs-manager.js.map +0 -1
  333. package/dist/src/lib/manager/aws/eks-manager.d.ts +0 -36
  334. package/dist/src/lib/manager/aws/eks-manager.d.ts.map +0 -1
  335. package/dist/src/lib/manager/aws/eks-manager.js +0 -109
  336. package/dist/src/lib/manager/aws/eks-manager.js.map +0 -1
  337. package/dist/src/lib/manager/aws/event-manager.d.ts +0 -67
  338. package/dist/src/lib/manager/aws/event-manager.d.ts.map +0 -1
  339. package/dist/src/lib/manager/aws/event-manager.js +0 -162
  340. package/dist/src/lib/manager/aws/event-manager.js.map +0 -1
  341. package/dist/src/lib/manager/aws/iam-manager.d.ts +0 -154
  342. package/dist/src/lib/manager/aws/iam-manager.d.ts.map +0 -1
  343. package/dist/src/lib/manager/aws/iam-manager.js +0 -380
  344. package/dist/src/lib/manager/aws/iam-manager.js.map +0 -1
  345. package/dist/src/lib/manager/aws/index.d.ts +0 -23
  346. package/dist/src/lib/manager/aws/index.d.ts.map +0 -1
  347. package/dist/src/lib/manager/aws/index.js +0 -35
  348. package/dist/src/lib/manager/aws/index.js.map +0 -1
  349. package/dist/src/lib/manager/aws/lambda-manager.d.ts +0 -94
  350. package/dist/src/lib/manager/aws/lambda-manager.d.ts.map +0 -1
  351. package/dist/src/lib/manager/aws/lambda-manager.js +0 -196
  352. package/dist/src/lib/manager/aws/lambda-manager.js.map +0 -1
  353. package/dist/src/lib/manager/aws/log-manager.d.ts +0 -51
  354. package/dist/src/lib/manager/aws/log-manager.d.ts.map +0 -1
  355. package/dist/src/lib/manager/aws/log-manager.js +0 -108
  356. package/dist/src/lib/manager/aws/log-manager.js.map +0 -1
  357. package/dist/src/lib/manager/aws/route53-manager.d.ts +0 -68
  358. package/dist/src/lib/manager/aws/route53-manager.d.ts.map +0 -1
  359. package/dist/src/lib/manager/aws/route53-manager.js +0 -158
  360. package/dist/src/lib/manager/aws/route53-manager.js.map +0 -1
  361. package/dist/src/lib/manager/aws/s3-manager.d.ts +0 -73
  362. package/dist/src/lib/manager/aws/s3-manager.d.ts.map +0 -1
  363. package/dist/src/lib/manager/aws/s3-manager.js +0 -202
  364. package/dist/src/lib/manager/aws/s3-manager.js.map +0 -1
  365. package/dist/src/lib/manager/aws/secrets-manager.d.ts +0 -57
  366. package/dist/src/lib/manager/aws/secrets-manager.d.ts.map +0 -1
  367. package/dist/src/lib/manager/aws/secrets-manager.js +0 -116
  368. package/dist/src/lib/manager/aws/secrets-manager.js.map +0 -1
  369. package/dist/src/lib/manager/aws/sns-manager.d.ts +0 -42
  370. package/dist/src/lib/manager/aws/sns-manager.d.ts.map +0 -1
  371. package/dist/src/lib/manager/aws/sns-manager.js +0 -90
  372. package/dist/src/lib/manager/aws/sns-manager.js.map +0 -1
  373. package/dist/src/lib/manager/aws/ssm-manager.d.ts +0 -59
  374. package/dist/src/lib/manager/aws/ssm-manager.d.ts.map +0 -1
  375. package/dist/src/lib/manager/aws/ssm-manager.js +0 -123
  376. package/dist/src/lib/manager/aws/ssm-manager.js.map +0 -1
  377. package/dist/src/lib/manager/aws/vpc-manager.d.ts +0 -45
  378. package/dist/src/lib/manager/aws/vpc-manager.d.ts.map +0 -1
  379. package/dist/src/lib/manager/aws/vpc-manager.js +0 -93
  380. package/dist/src/lib/manager/aws/vpc-manager.js.map +0 -1
  381. package/dist/src/lib/manager/aws/waf-manager.d.ts +0 -39
  382. package/dist/src/lib/manager/aws/waf-manager.d.ts.map +0 -1
  383. package/dist/src/lib/manager/aws/waf-manager.js +0 -89
  384. package/dist/src/lib/manager/aws/waf-manager.js.map +0 -1
  385. package/dist/src/lib/manager/index.d.ts +0 -2
  386. package/dist/src/lib/manager/index.d.ts.map +0 -1
  387. package/dist/src/lib/manager/index.js +0 -14
  388. package/dist/src/lib/manager/index.js.map +0 -1
  389. package/dist/src/lib/types/aws/index.d.ts +0 -429
  390. package/dist/src/lib/types/aws/index.d.ts.map +0 -1
  391. package/dist/src/lib/types/aws/index.js +0 -3
  392. package/dist/src/lib/types/aws/index.js.map +0 -1
  393. package/dist/src/lib/types/index.d.ts +0 -2
  394. package/dist/src/lib/types/index.d.ts.map +0 -1
  395. package/dist/src/lib/types/index.js +0 -14
  396. package/dist/src/lib/types/index.js.map +0 -1
  397. package/dist/src/lib/utils/aws/index.d.ts +0 -16
  398. package/dist/src/lib/utils/aws/index.d.ts.map +0 -1
  399. package/dist/src/lib/utils/aws/index.js +0 -50
  400. package/dist/src/lib/utils/aws/index.js.map +0 -1
  401. package/dist/src/lib/utils/index.d.ts +0 -64
  402. package/dist/src/lib/utils/index.d.ts.map +0 -1
  403. package/dist/src/lib/utils/index.js +0 -86
  404. package/dist/src/lib/utils/index.js.map +0 -1
  405. package/img/ApiToEventBridgeTarget.jpg +0 -0
  406. package/img/GraphQLApiLambda.jpg +0 -0
@@ -1,569 +0,0 @@
1
-
2
-
3
- <!DOCTYPE html>
4
- <html lang="en">
5
-
6
- <head>
7
-
8
- <meta charset="utf-8">
9
- <meta name="viewport" content="width=device-width, initial-scale=1">
10
- <title>Gradient Edge CDK Utils manager/aws/iam-manager.ts</title>
11
-
12
- <script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
13
- <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
14
- <script src="./build/entry.js"></script>
15
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
16
- <!--[if lt IE 9]>
17
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
18
- <![endif]-->
19
- <link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
20
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
21
- <link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
22
- <link type="text/css" rel="stylesheet" href="styles/app.min.css">
23
- <link type="text/css" rel="stylesheet" href="styles/iframe.css">
24
- <link type="text/css" rel="stylesheet" href="">
25
- <script async defer src="https://buttons.github.io/buttons.js"></script>
26
-
27
-
28
- </head>
29
-
30
-
31
-
32
- <body class="layout small-header">
33
- <div id="stickyNavbarOverlay"></div>
34
-
35
-
36
- <div class="top-nav">
37
- <div class="inner">
38
- <a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
39
- <span aria-hidden="true"></span>
40
- <span aria-hidden="true"></span>
41
- <span aria-hidden="true"></span>
42
- </a>
43
- <div class="logo">
44
-
45
-
46
- <a href="index.html">
47
- <h1 class="navbar-item">Gradient Edge CDK Utils Documentation</h1>
48
- </a>
49
-
50
- </div>
51
- <div class="menu">
52
-
53
- <div class="navigation">
54
- <a
55
- href="index.html"
56
- class="link"
57
- >
58
- API Documentation
59
- </a>
60
-
61
- <div class="dropdown is-hoverable is-right">
62
- <a class="dropdown-trigger link">
63
- Tutorials
64
- <i class="fas fa-chevron-down fa-xs"></i>
65
- </a>
66
- <div class="dropdown-menu">
67
- <div class="dropdown-content">
68
-
69
- <a class="dropdown-item" href="tutorial-Architecture.html">
70
- Architecture
71
- </a>
72
-
73
- <a class="dropdown-item" href="tutorial-Build.html">
74
- Build
75
- </a>
76
-
77
- <a class="dropdown-item" href="tutorial-CI-CD.html">
78
- CI-CD
79
- </a>
80
-
81
- <a class="dropdown-item" href="tutorial-Development.html">
82
- Development
83
- </a>
84
-
85
- </div>
86
- </div>
87
- </div>
88
-
89
-
90
-
91
- <a
92
- class="link user-link "
93
- href="https://github.com/gradientedge/cdk-utils"
94
- >
95
- Github
96
- </a>
97
-
98
-
99
-
100
- </div>
101
- </div>
102
- </div>
103
- </div>
104
- <div id="main">
105
- <div
106
- class="sidebar "
107
- id="sidebarNav"
108
- >
109
-
110
- <div class="search-wrapper">
111
- <input id="search" type="text" placeholder="Search docs..." class="input">
112
- </div>
113
-
114
- <nav>
115
-
116
- <h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Application Integration</h2><h3>Classes</h3><ul><li><a href="EventManager.html">EventManager</a></li><li><a href="SnsManager.html">SnsManager</a></li></ul><h3>Interfaces</h3><ul><li><a href="EventBusProps.html">EventBusProps</a></li><li><a href="EventRuleProps.html">EventRuleProps</a></li><li><a href="RuleProps.html">RuleProps</a></li><li><a href="SubscriptionProps.html">SubscriptionProps</a></li></ul></div><div class="category"><h2>Compute</h2><h3>Classes</h3><ul><li><a href="LambdaManager.html">LambdaManager</a></li></ul><h3>Interfaces</h3><ul><li><a href="HealthCheck.html">HealthCheck</a></li><li><a href="LambdaEdgeProps.html">LambdaEdgeProps</a></li><li><a href="LambdaProps.html">LambdaProps</a></li></ul></div><div class="category"><h2>Constructs</h2><h3>Classes</h3><ul><li><a href="ApiDestinationEvent.html">ApiDestinationEvent</a></li><li><a href="ApiDestinedLambda.html">ApiDestinedLambda</a></li><li><a href="ApiDestinedRestApi.html">ApiDestinedRestApi</a></li><li><a href="ApiToEventBridgeTarget.html">ApiToEventBridgeTarget</a></li><li><a href="CommonConstruct.html">CommonConstruct</a></li><li><a href="GraphQLApiLambda.html">GraphQLApiLambda</a></li><li><a href="SiteWithEcsBackend.html">SiteWithEcsBackend</a></li><li><a href="StaticSite.html">StaticSite</a></li></ul><h3>Interfaces</h3><ul><li><a href="ApiDestinationEventType.html">ApiDestinationEventType</a></li><li><a href="ApiDestinedLambdaEnvironment.html">ApiDestinedLambdaEnvironment</a></li><li><a href="ApiDestinedLambdaType.html">ApiDestinedLambdaType</a></li><li><a href="ApiDestinedRestApiType.html">ApiDestinedRestApiType</a></li><li><a href="ApiToEventBridgeTargetEventProps.html">ApiToEventBridgeTargetEventProps</a></li><li><a href="ApiToEventBridgeTargetLambdaProps.html">ApiToEventBridgeTargetLambdaProps</a></li><li><a href="ApiToEventBridgeTargetProps.html">ApiToEventBridgeTargetProps</a></li><li><a href="CommonStackProps.html">CommonStackProps</a></li><li><a href="GraphQlApiLambdaEnvironment.html">GraphQlApiLambdaEnvironment</a></li><li><a href="GraphQlApiLambdaProps.html">GraphQlApiLambdaProps</a></li><li><a href="LambdaEnvironment.html">LambdaEnvironment</a></li><li><a href="SiteWithEcsBackendProps.html">SiteWithEcsBackendProps</a></li><li><a href="StaticSiteProps.html">StaticSiteProps</a></li></ul></div><div class="category"><h2>Containers</h2><h3>Classes</h3><ul><li><a href="EcrManager.html">EcrManager</a></li><li><a href="EcsManager.html">EcsManager</a></li><li><a href="EksManager.html">EksManager</a></li></ul><h3>Interfaces</h3><ul><li><a href="EcsClusterProps.html">EcsClusterProps</a></li><li><a href="EcsTaskProps.html">EcsTaskProps</a></li><li><a href="EksClusterProps.html">EksClusterProps</a></li></ul></div><div class="category"><h2>Developer Tools</h2><h3>Classes</h3><ul><li><a href="CodeBuildManager.html">CodeBuildManager</a></li></ul></div><div class="category"><h2>Management & Governance</h2><h3>Classes</h3><ul><li><a href="AppConfigManager.html">AppConfigManager</a></li><li><a href="CloudTrailManager.html">CloudTrailManager</a></li><li><a href="CloudWatchManager.html">CloudWatchManager</a></li><li><a href="LogManager.html">LogManager</a></li><li><a href="SsmManager.html">SsmManager</a></li><li><a href="SSMParameterReader.html">SSMParameterReader</a></li></ul><h3>Interfaces</h3><ul><li><a href="AlarmProps.html">AlarmProps</a></li><li><a href="AlarmStatusWidgetProps.html">AlarmStatusWidgetProps</a></li><li><a href="AppConfigProps.html">AppConfigProps</a></li><li><a href="CloudTrailProps.html">CloudTrailProps</a></li><li><a href="DashboardProps.html">DashboardProps</a></li><li><a href="GraphWidgetProps.html">GraphWidgetProps</a></li><li><a href="LogProps.html">LogProps</a></li><li><a href="LogQueryWidgetProps.html">LogQueryWidgetProps</a></li><li><a href="MetricFilterProps.html">MetricFilterProps</a></li><li><a href="MetricProps.html">MetricProps</a></li><li><a href="NumericWidgetProps.html">NumericWidgetProps</a></li><li><a href="SSMParameterReaderProps.html">SSMParameterReaderProps</a></li><li><a href="TextWidgetProps.html">TextWidgetProps</a></li></ul></div><div class="category"><h2>Networking & Content Delivery</h2><h3>Classes</h3><ul><li><a href="ApiManager.html">ApiManager</a></li><li><a href="CloudFrontManager.html">CloudFrontManager</a></li><li><a href="Route53Manager.html">Route53Manager</a></li><li><a href="VpcManager.html">VpcManager</a></li></ul><h3>Interfaces</h3><ul><li><a href="CloudfrontFunctionProps.html">CloudfrontFunctionProps</a></li><li><a href="CloudFrontProps.html">CloudFrontProps</a></li><li><a href="DistributionProps.html">DistributionProps</a></li><li><a href="Route53Props.html">Route53Props</a></li></ul></div><div class="category"><h2>Security, Identity & Compliance</h2><h3>Classes</h3><ul><li><a href="AcmManager.html">AcmManager</a></li><li><a href="IamManager.html">IamManager</a></li><li><a href="SecretsManager.html">SecretsManager</a></li><li><a href="WafManager.html">WafManager</a></li></ul><h3>Interfaces</h3><ul><li><a href="AcmProps.html">AcmProps</a></li><li><a href="WafIPSetProps.html">WafIPSetProps</a></li><li><a href="WafWebACLProps.html">WafWebACLProps</a></li></ul></div><div class="category"><h2>Stacks</h2><h3>Classes</h3><ul><li><a href="CommonStack.html">CommonStack</a></li></ul></div><div class="category"><h2>Storage</h2><h3>Classes</h3><ul><li><a href="DynamodbManager.html">DynamodbManager</a></li><li><a href="S3Manager.html">S3Manager</a></li></ul><h3>Interfaces</h3><ul><li><a href="S3BucketProps.html">S3BucketProps</a></li><li><a href="TableProps.html">TableProps</a></li></ul></div><div class="category"><h2>Utils</h2><h3>Global</h3><ul><li><a href="global.html#ArnsByRegion">ArnsByRegion</a></li><li><a href="global.html#CloudWatchWidgetType">CloudWatchWidgetType</a></li><li><a href="global.html#CommonVpcIdentifier">CommonVpcIdentifier</a></li><li><a href="global.html#createCfnOutput">createCfnOutput</a></li><li><a href="global.html#defaultResponseObject">defaultResponseObject</a></li><li><a href="global.html#isDevStage">isDevStage</a></li><li><a href="global.html#isPrdStage">isPrdStage</a></li><li><a href="global.html#isTestStage">isTestStage</a></li><li><a href="global.html#isUatStage">isUatStage</a></li><li><a href="global.html#redirectError">redirectError</a></li><li><a href="global.html#redirectSuccess">redirectSuccess</a></li></ul></div><div class="category"><h2>Utils
117
- LogLevel enumeration</h2><h3>Global</h3><ul><li><a href="global.html#LogLevel">LogLevel</a></li></ul></div>
118
-
119
- </nav>
120
- </div>
121
- <div class="core" id="main-content-wrapper">
122
- <div class="content">
123
- <header class="page-title">
124
- <p>Source</p>
125
- <h1>manager/aws/iam-manager.ts</h1>
126
- </header>
127
-
128
-
129
-
130
-
131
-
132
- <section>
133
- <article>
134
- <pre class="prettyprint source linenums"><code>import * as cdk from 'aws-cdk-lib'
135
- import * as ecs from 'aws-cdk-lib/aws-ecs'
136
- import * as iam from 'aws-cdk-lib/aws-iam'
137
- import * as logs from 'aws-cdk-lib/aws-logs'
138
- import * as s3 from 'aws-cdk-lib/aws-s3'
139
- import * as common from '../../common'
140
- import * as utils from '../../utils'
141
-
142
- /**
143
- * @stability stable
144
- * @category Security, Identity &amp; Compliance
145
- * @classdesc Provides operations on AWS IAM.
146
- * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
147
- * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
148
- * @example
149
- * import * as common from '@gradientedge/cdk-utils'
150
- *
151
- * class CustomConstruct extends common.common.CommonConstruct {
152
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
153
- * super(parent, id, props)
154
- * this.props = props
155
- * this.iamManager.createRoleForEcsEvent('MyEcsRole', this, cluster, task)
156
- * }
157
- * }
158
- *
159
- * @see [CDK IAM Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam-readme.html}
160
- */
161
- export class IamManager {
162
- /**
163
- * @summary Method to create iam statement to read secrets
164
- * @param {common.CommonConstruct} scope scope in which this resource is defined
165
- */
166
- public statementForReadSecrets(scope: common.CommonConstruct) {
167
- return new iam.PolicyStatement({
168
- effect: iam.Effect.ALLOW,
169
- actions: ['secretsmanager:GetSecretValue'],
170
- resources: [`arn:aws:secretsmanager:${cdk.Stack.of(scope).region}:${cdk.Stack.of(scope).account}:secret:*`],
171
- })
172
- }
173
-
174
- /**
175
- * @summary Method to create iam statement to put events
176
- */
177
- public statementForPutEvents() {
178
- return new iam.PolicyStatement({
179
- effect: iam.Effect.ALLOW,
180
- actions: ['events:PutEvents'],
181
- resources: ['*'],
182
- })
183
- }
184
-
185
- /**
186
- * @summary Method to create iam statement to read app config
187
- */
188
- public statementForReadAnyAppConfig() {
189
- return new iam.PolicyStatement({
190
- effect: iam.Effect.ALLOW,
191
- actions: [
192
- 'ssm:GetDocument',
193
- 'ssm:ListDocuments',
194
- 'appconfig:ListApplications',
195
- 'appconfig:GetApplication',
196
- 'appconfig:ListEnvironments',
197
- 'appconfig:GetEnvironment',
198
- 'appconfig:ListConfigurationProfiles',
199
- 'appconfig:GetConfigurationProfile',
200
- 'appconfig:ListDeploymentStrategies',
201
- 'appconfig:GetDeploymentStrategy',
202
- 'appconfig:GetConfiguration',
203
- 'appconfig:ListDeployments',
204
- ],
205
- resources: ['*'],
206
- })
207
- }
208
-
209
- /**
210
- * @summary Method to create iam statement to list s3 buckets
211
- * @param {common.CommonConstruct} scope scope in which this resource is defined
212
- * @param {s3.IBucket} bucket
213
- */
214
- public statementForListBucket(scope: common.CommonConstruct, bucket: s3.IBucket) {
215
- return new iam.PolicyStatement({
216
- effect: iam.Effect.ALLOW,
217
- actions: ['s3:ListBucket'],
218
- resources: [bucket.bucketArn],
219
- })
220
- }
221
-
222
- /**
223
- * @summary Method to create iam statement to list all s3 buckets
224
- */
225
- public statementForListAllMyBuckets() {
226
- return new iam.PolicyStatement({
227
- effect: iam.Effect.ALLOW,
228
- actions: ['s3:ListAllMyBuckets'],
229
- resources: ['*'],
230
- })
231
- }
232
-
233
- /**
234
- * @summary Method to create iam statement to get s3 objects in buckets
235
- * @param {common.CommonConstruct} scope scope in which this resource is defined
236
- * @param {s3.IBucket} bucket
237
- */
238
- public statementForGetAnyS3Objects(scope: common.CommonConstruct, bucket: s3.IBucket) {
239
- return new iam.PolicyStatement({
240
- effect: iam.Effect.ALLOW,
241
- actions: ['s3:GetObject', 's3:GetObjectAcl'],
242
- resources: [bucket.arnForObjects(`*`)],
243
- })
244
- }
245
-
246
- /**
247
- * @summary Method to create iam statement to delete s3 objects in buckets
248
- * @param {common.CommonConstruct} scope scope in which this resource is defined
249
- * @param {s3.IBucket} bucket
250
- */
251
- public statementForDeleteAnyS3Objects(scope: common.CommonConstruct, bucket: s3.IBucket) {
252
- return new iam.PolicyStatement({
253
- effect: iam.Effect.ALLOW,
254
- actions: ['s3:DeleteObject'],
255
- resources: [bucket.arnForObjects(`*`)],
256
- })
257
- }
258
-
259
- /**
260
- * @summary Method to create iam statement to write s3 objects in buckets
261
- * @param {common.CommonConstruct} scope scope in which this resource is defined
262
- * @param {s3.IBucket} bucket
263
- */
264
- public statementForPutAnyS3Objects(scope: common.CommonConstruct, bucket: s3.IBucket) {
265
- return new iam.PolicyStatement({
266
- effect: iam.Effect.ALLOW,
267
- actions: ['s3:PutObject', 's3:PutObjectAcl'],
268
- resources: [bucket.arnForObjects(`*`)],
269
- })
270
- }
271
-
272
- /**
273
- * @summary Method to create iam statement to pass iam role
274
- */
275
- public statementForPassRole() {
276
- return new iam.PolicyStatement({
277
- effect: iam.Effect.ALLOW,
278
- actions: ['iam:PassRole'],
279
- resources: ['*'],
280
- })
281
- }
282
-
283
- /**
284
- * @summary Method to create iam statement to invalidate cloudfront cache
285
- */
286
- public statementForCloudfrontInvalidation() {
287
- return new iam.PolicyStatement({
288
- effect: iam.Effect.ALLOW,
289
- actions: ['cloudfront:GetInvalidation', 'cloudfront:CreateInvalidation'],
290
- resources: ['*'],
291
- })
292
- }
293
-
294
- /**
295
- * @summary Method to create iam policy to invalidate cloudfront cache
296
- */
297
- public policyForCloudfrontInvalidation() {
298
- return new iam.PolicyDocument({
299
- statements: [
300
- this.statementForCreateAnyLogStream(),
301
- this.statementForPutAnyLogEvent(),
302
- this.statementForCloudfrontInvalidation(),
303
- new iam.PolicyStatement({
304
- effect: iam.Effect.ALLOW,
305
- actions: [
306
- 'ecr:GetDownloadUrlForLayer',
307
- 'ecr:BatchGetImage',
308
- 'ecr:BatchCheckLayerAvailability',
309
- 'ecr:GetAuthorizationToken',
310
- ],
311
- resources: ['*'],
312
- }),
313
- ],
314
- })
315
- }
316
-
317
- /**
318
- * @summary Method to create iam role to invalidate cloudfront cache
319
- * @param {string} id scoped id of the resource
320
- * @param {common.CommonConstruct} scope scope in which this resource is defined
321
- */
322
- public roleForCloudfrontInvalidation(id: string, scope: common.CommonConstruct) {
323
- return new iam.Role(scope, `${id}-install-deps-project-role`, {
324
- assumedBy: new iam.ServicePrincipal('codebuild.amazonaws.com'),
325
- inlinePolicies: {
326
- codeBuildPolicy: this.policyForCloudfrontInvalidation(),
327
- },
328
- })
329
- }
330
-
331
- /**
332
- * @summary Method to create iam statement to assume iam role
333
- * @param {common.CommonConstruct} scope scope in which this resource is defined
334
- * @param {iam.ServicePrincipal[]} servicePrincipals
335
- */
336
- public statementForAssumeRole(scope: common.CommonConstruct, servicePrincipals: iam.ServicePrincipal[]) {
337
- return new iam.PolicyStatement({
338
- effect: iam.Effect.ALLOW,
339
- actions: ['sts:AssumeRole'],
340
- principals: servicePrincipals,
341
- })
342
- }
343
-
344
- /**
345
- * @summary Method to create iam statement to pass ecs role
346
- */
347
- public statementForEcsPassRole() {
348
- return new iam.PolicyStatement({
349
- effect: iam.Effect.ALLOW,
350
- actions: ['iam:PassRole'],
351
- resources: ['*'],
352
- conditions: { StringLike: { 'iam:PassedToService': 'ecs-tasks.amazonaws.com' } },
353
- })
354
- }
355
-
356
- /**
357
- * @summary Method to create iam statement to run ecs task
358
- * @param {common.CommonConstruct} scope scope in which this resource is defined
359
- * @param {ecs.ICluster} cluster
360
- * @param {ecs.ITaskDefinition} task
361
- */
362
- public statementForRunEcsTask(scope: common.CommonConstruct, cluster: ecs.ICluster, task: ecs.ITaskDefinition) {
363
- return new iam.PolicyStatement({
364
- effect: iam.Effect.ALLOW,
365
- actions: ['ecs:RunTask'],
366
- resources: [task.taskDefinitionArn],
367
- conditions: { ArnLike: { 'ecs:cluster': cluster.clusterArn } },
368
- })
369
- }
370
-
371
- /**
372
- * @summary Method to create iam statement to create log stream
373
- * @param {common.CommonConstruct} scope scope in which this resource is defined
374
- * @param {logs.CfnLogGroup} logGroup
375
- */
376
- public statementForCreateLogStream(scope: common.CommonConstruct, logGroup: logs.CfnLogGroup) {
377
- return new iam.PolicyStatement({
378
- effect: iam.Effect.ALLOW,
379
- actions: ['logs:CreateLogStream'],
380
- resources: [
381
- `arn:aws:logs:${cdk.Stack.of(scope).region}:${cdk.Stack.of(scope).account}:log-group:${
382
- logGroup.logGroupName
383
- }:log-stream:${cdk.Stack.of(scope).account}_CloudTrail_eu-west-1*`,
384
- ],
385
- sid: 'AWSCloudTrailCreateLogStream2014110',
386
- })
387
- }
388
-
389
- /**
390
- * @summary Method to create iam statement to create any log stream
391
- */
392
- public statementForCreateAnyLogStream() {
393
- return new iam.PolicyStatement({
394
- effect: iam.Effect.ALLOW,
395
- actions: ['logs:CreateLogStream'],
396
- resources: ['*'],
397
- })
398
- }
399
-
400
- /**
401
- * @summary Method to create iam statement to write log events
402
- * @param {common.CommonConstruct} scope scope in which this resource is defined
403
- * @param {logs.CfnLogGroup} logGroup
404
- */
405
- public statementForPutLogEvent(scope: common.CommonConstruct, logGroup: logs.CfnLogGroup) {
406
- return new iam.PolicyStatement({
407
- effect: iam.Effect.ALLOW,
408
- actions: ['logs:PutLogEvents'],
409
- resources: [
410
- `arn:aws:logs:${cdk.Stack.of(scope).region}:${cdk.Stack.of(scope).account}:log-group:${
411
- logGroup.logGroupName
412
- }:log-stream:${cdk.Stack.of(scope).account}_CloudTrail_eu-west-1*`,
413
- ],
414
- sid: 'AWSCloudTrailPutLogEvents20141101',
415
- })
416
- }
417
-
418
- /**
419
- * @summary Method to create iam statement to write any log events
420
- */
421
- public statementForPutAnyLogEvent() {
422
- return new iam.PolicyStatement({
423
- effect: iam.Effect.ALLOW,
424
- actions: ['logs:PutLogEvents'],
425
- resources: ['*'],
426
- })
427
- }
428
-
429
- /**
430
- * @summary Method to create iam statement for cloud trail
431
- * @param {string} id scoped id of the resource
432
- * @param {common.CommonConstruct} scope scope in which this resource is defined
433
- * @param {logs.CfnLogGroup} logGroup
434
- */
435
- public createRoleForCloudTrail(id: string, scope: common.CommonConstruct, logGroup: logs.CfnLogGroup) {
436
- const policy = new iam.PolicyDocument({
437
- statements: [this.statementForCreateLogStream(scope, logGroup), this.statementForPutLogEvent(scope, logGroup)],
438
- })
439
- const role = new iam.CfnRole(scope, `${id}`, {
440
- assumeRolePolicyDocument: new iam.PolicyDocument({
441
- statements: [this.statementForAssumeRole(scope, [new iam.ServicePrincipal('cloudtrail.amazonaws.com')])],
442
- }),
443
- policies: [
444
- {
445
- policyName: `${id}-policy-${scope.props.stage}`,
446
- policyDocument: policy,
447
- },
448
- ],
449
- roleName: `${id}-${scope.props.stage}`,
450
- })
451
-
452
- utils.createCfnOutput(`${id}Arn`, scope, role.attrArn)
453
- utils.createCfnOutput(`${id}Name`, scope, role.roleName)
454
-
455
- return role
456
- }
457
-
458
- /**
459
- * @summary Method to create iam statement for ecs event
460
- * @param {string} id scoped id of the resource
461
- * @param {common.CommonConstruct} scope scope in which this resource is defined
462
- * @param {ecs.ICluster} cluster
463
- * @param {ecs.ITaskDefinition} task
464
- */
465
- public createRoleForEcsEvent(
466
- id: string,
467
- scope: common.CommonConstruct,
468
- cluster: ecs.ICluster,
469
- task: ecs.ITaskDefinition
470
- ) {
471
- const policy = new iam.PolicyDocument({
472
- statements: [this.statementForRunEcsTask(scope, cluster, task), this.statementForEcsPassRole()],
473
- })
474
-
475
- const role = new iam.Role(scope, `${id}`, {
476
- assumedBy: new iam.ServicePrincipal('events.amazonaws.com'),
477
- description: `Role for ${id} ECS Task execution from EventBridge`,
478
- inlinePolicies: { policy },
479
- roleName: `${id}-${scope.props.stage}`,
480
- })
481
-
482
- utils.createCfnOutput(`${id}Arn`, scope, role.roleArn)
483
- utils.createCfnOutput(`${id}Name`, scope, role.roleName)
484
-
485
- return role
486
- }
487
-
488
- /**
489
- * @summary Method to create iam statement for ecs execution
490
- * @param {string} id scoped id of the resource
491
- * @param {common.CommonConstruct} scope scope in which this resource is defined
492
- * @param {iam.PolicyDocument} policy
493
- */
494
- public createRoleForEcsExecution(id: string, scope: common.CommonConstruct, policy: iam.PolicyDocument) {
495
- const role = new iam.Role(scope, `${id}`, {
496
- assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'),
497
- description: `Role for ${id} ECS Task execution`,
498
- inlinePolicies: { policy },
499
- managedPolicies: [
500
- iam.ManagedPolicy.fromManagedPolicyArn(
501
- scope,
502
- 'AmazonECSTaskExecutionRolePolicy',
503
- 'arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy'
504
- ),
505
- ],
506
- roleName: `${id}-${scope.props.stage}`,
507
- })
508
-
509
- utils.createCfnOutput(`${id}Arn`, scope, role.roleArn)
510
- utils.createCfnOutput(`${id}Name`, scope, role.roleName)
511
-
512
- return role
513
- }
514
-
515
- /**
516
- * @summary Method to create iam statement for lambda execution
517
- * @param {string} id scoped id of the resource
518
- * @param {common.CommonConstruct} scope scope in which this resource is defined
519
- * @param {iam.PolicyDocument} policy
520
- * @param {iam.ServicePrincipal} servicePrinicpal
521
- */
522
- public createRoleForLambda(
523
- id: string,
524
- scope: common.CommonConstruct,
525
- policy: iam.PolicyDocument,
526
- servicePrinicpal?: iam.ServicePrincipal
527
- ) {
528
- const role = new iam.Role(scope, `${id}`, {
529
- assumedBy: servicePrinicpal ?? new iam.ServicePrincipal('lambda.amazonaws.com'),
530
- description: `Role for ${id} Lambda function`,
531
- inlinePolicies: { policy },
532
- managedPolicies: [
533
- iam.ManagedPolicy.fromManagedPolicyArn(
534
- scope,
535
- `${id}-AWSLambdaBasicExecutionRole`,
536
- 'arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'
537
- ),
538
- ],
539
- roleName: `${id}-${scope.props.stage}`,
540
- })
541
-
542
- utils.createCfnOutput(`${id}Arn`, scope, role.roleArn)
543
- utils.createCfnOutput(`${id}Name`, scope, role.roleName)
544
-
545
- return role
546
- }
547
- }
548
- </code></pre>
549
- </article>
550
- </section>
551
-
552
-
553
-
554
-
555
- </div>
556
-
557
- </div>
558
- <div id="side-nav" class="side-nav">
559
- </div>
560
- </div>
561
- <script src="scripts/app.min.js"></script>
562
- <script>PR.prettyPrint();</script>
563
- <script src="scripts/linenumber.js"> </script>
564
-
565
- <script src="scripts/search.js"> </script>
566
-
567
-
568
- </body>
569
- </html>