@gradientedge/cdk-utils 8.91.0 → 8.92.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 +0 -18
  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 +0 -18
  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 +1 -19
  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 +1 -19
  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,8 +28,6 @@ const cdk = __importStar(require("aws-cdk-lib"));
28
28
  const watch = __importStar(require("aws-cdk-lib/aws-cloudwatch"));
29
29
  const utils = __importStar(require("../../../utils"));
30
30
  /**
31
- * @category cdk-utils.cloudwatch-manager
32
- * @subcategory Construct
33
31
  */
34
32
  var CloudWatchWidgetType;
35
33
  (function (CloudWatchWidgetType) {
@@ -41,9 +39,6 @@ var CloudWatchWidgetType;
41
39
  CloudWatchWidgetType["LogQuery"] = "LogQuery";
42
40
  })(CloudWatchWidgetType || (CloudWatchWidgetType = {}));
43
41
  /**
44
- * @stability stable
45
- * @category cdk-utils.cloudwatch-manager
46
- * @subcategory Construct
47
42
  * @classdesc Provides operations on AWS CloudWatch.
48
43
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
49
44
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -57,15 +52,14 @@ var CloudWatchWidgetType;
57
52
  * this.cloudWatchManager.createAlarmForMetric('MyAlarm', this, metric)
58
53
  * }
59
54
  * }
60
- *
61
55
  * @see [CDK CloudWatch Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch-readme.html}
62
56
  */
63
57
  class CloudWatchManager {
64
58
  /**
65
59
  * @summary Method to create a cloudwatch alarm for a given expression
66
- * @param {string} id scoped id of the resource
67
- * @param {CommonConstruct} scope scope in which this resource is defined
68
- * @param {AlarmProps} props
60
+ * @param id scoped id of the resource
61
+ * @param scope scope in which this resource is defined
62
+ * @param props
69
63
  */
70
64
  createAlarmForExpression(id, scope, props) {
71
65
  if (!props)
@@ -78,17 +72,17 @@ class CloudWatchManager {
78
72
  this.determineMetrics(scope, props.metricProps).map((metric, index) => (metrics[`m${index}`] = metric));
79
73
  const expression = new watch.MathExpression({
80
74
  expression: props.expression,
81
- usingMetrics: metrics,
82
75
  period: props.periodInSecs ? cdk.Duration.seconds(props.periodInSecs) : cdk.Duration.minutes(5),
76
+ usingMetrics: metrics,
83
77
  });
84
78
  const alarm = expression.createAlarm(scope, `${id}`, {
85
- alarmName: props.alarmName,
86
79
  alarmDescription: props.alarmDescription,
87
- threshold: props.threshold,
88
- evaluationPeriods: props.evaluationPeriods,
80
+ alarmName: props.alarmName,
89
81
  comparisonOperator: props.comparisonOperator,
90
- treatMissingData: props.treatMissingData,
91
82
  datapointsToAlarm: props.datapointsToAlarm,
83
+ evaluationPeriods: props.evaluationPeriods,
84
+ threshold: props.threshold,
85
+ treatMissingData: props.treatMissingData,
92
86
  });
93
87
  utils.createCfnOutput(`${id}-alarmArn`, scope, alarm.alarmArn);
94
88
  utils.createCfnOutput(`${id}-alarmName`, scope, alarm.alarmName);
@@ -96,22 +90,22 @@ class CloudWatchManager {
96
90
  }
97
91
  /**
98
92
  * @summary Method to create a cloudwatch alarm for a given metric
99
- * @param {string} id scoped id of the resource
100
- * @param {CommonConstruct} scope scope in which this resource is defined
101
- * @param {AlarmProps} props
93
+ * @param id scoped id of the resource
94
+ * @param scope scope in which this resource is defined
95
+ * @param props
102
96
  * @param metric
103
97
  */
104
98
  createAlarmForMetric(id, scope, props, metric) {
105
99
  if (!props)
106
100
  throw `Alarm props undefined for ${id}`;
107
101
  const alarm = metric.createAlarm(scope, `${id}`, {
108
- alarmName: props.alarmName,
109
102
  alarmDescription: props.alarmDescription,
110
- threshold: props.threshold,
111
- evaluationPeriods: props.evaluationPeriods,
103
+ alarmName: props.alarmName,
112
104
  comparisonOperator: props.comparisonOperator,
113
- treatMissingData: props.treatMissingData,
114
105
  datapointsToAlarm: props.datapointsToAlarm,
106
+ evaluationPeriods: props.evaluationPeriods,
107
+ threshold: props.threshold,
108
+ treatMissingData: props.treatMissingData,
115
109
  });
116
110
  utils.createCfnOutput(`${id}-alarmArn`, scope, alarm.alarmArn);
117
111
  utils.createCfnOutput(`${id}-alarmName`, scope, alarm.alarmName);
@@ -119,9 +113,9 @@ class CloudWatchManager {
119
113
  }
120
114
  /**
121
115
  * @summary Method to create a cloudwatch dashboard
122
- * @param {string} id scoped id of the resource
123
- * @param {CommonConstruct} scope scope in which this resource is defined
124
- * @param {DashboardProps} props
116
+ * @param id scoped id of the resource
117
+ * @param scope scope in which this resource is defined
118
+ * @param props
125
119
  * @param widgets
126
120
  */
127
121
  createDashboard(id, scope, props, widgets) {
@@ -129,9 +123,9 @@ class CloudWatchManager {
129
123
  throw `Dashboard props undefined for ${id}`;
130
124
  const dashboard = new watch.Dashboard(scope, `${id}`, {
131
125
  dashboardName: props.dashboardName,
126
+ end: CloudWatchManager.determineTimeRange(props.end),
132
127
  periodOverride: props.periodOverride,
133
128
  start: CloudWatchManager.determineTimeRange(props.start),
134
- end: CloudWatchManager.determineTimeRange(props.end),
135
129
  widgets: widgets,
136
130
  });
137
131
  utils.createCfnOutput(`${id}-dashboardName`, scope, props.dashboardName);
@@ -139,7 +133,7 @@ class CloudWatchManager {
139
133
  }
140
134
  /**
141
135
  * @summary Method to create cloudwatch widgets
142
- * @param {CommonConstruct} scope scope in which this resource is defined
136
+ * @param scope scope in which this resource is defined
143
137
  * @param props
144
138
  */
145
139
  createWidgets(scope, props) {
@@ -151,8 +145,8 @@ class CloudWatchManager {
151
145
  }
152
146
  /**
153
147
  * @summary Method to create a cloudwatch widget
154
- * @param {string} id scoped id of the resource
155
- * @param {CommonConstruct} scope scope in which this resource is defined
148
+ * @param id scoped id of the resource
149
+ * @param scope scope in which this resource is defined
156
150
  * @param props
157
151
  */
158
152
  createWidget(id, scope, props) {
@@ -181,10 +175,10 @@ class CloudWatchManager {
181
175
  }
182
176
  /**
183
177
  * @summary Method to create a cloudfront distribution widget
184
- * @param {string} id scoped id of the resource
185
- * @param {CommonConstruct} scope scope in which this resource is defined
186
- * @param {TextWidgetProps} props
187
- * @param {string} distributionId the cloudfront distribution id
178
+ * @param id scoped id of the resource
179
+ * @param scope scope in which this resource is defined
180
+ * @param props
181
+ * @param distributionId the cloudfront distribution id
188
182
  */
189
183
  createCloudfrontDistributionWidget(id, scope, props, distributionId) {
190
184
  if (!props)
@@ -199,10 +193,10 @@ class CloudWatchManager {
199
193
  }
200
194
  /**
201
195
  * @summary Method to create a step function widget
202
- * @param {string} id scoped id of the resource
203
- * @param {CommonConstruct} scope scope in which this resource is defined
204
- * @param {TextWidgetProps} props
205
- * @param {string} stateMachineArn the step function arn
196
+ * @param id scoped id of the resource
197
+ * @param scope scope in which this resource is defined
198
+ * @param props
199
+ * @param stateMachineArn the step function arn
206
200
  */
207
201
  createStateWidget(id, scope, props, stateMachineArn) {
208
202
  if (!props)
@@ -217,11 +211,11 @@ class CloudWatchManager {
217
211
  }
218
212
  /**
219
213
  * @summary Method to create an event widget
220
- * @param {string} id scoped id of the resource
221
- * @param {CommonConstruct} scope scope in which this resource is defined
222
- * @param {TextWidgetProps} props
223
- * @param {string} eventBusName the event bus name
224
- * @param {string} ruleName the event rule name
214
+ * @param id scoped id of the resource
215
+ * @param scope scope in which this resource is defined
216
+ * @param props
217
+ * @param eventBusName the event bus name
218
+ * @param ruleName the event rule name
225
219
  */
226
220
  createEventWidget(id, scope, props, eventBusName, ruleName) {
227
221
  if (!props)
@@ -239,10 +233,10 @@ class CloudWatchManager {
239
233
  }
240
234
  /**
241
235
  * @summary Method to create an api gateway widget
242
- * @param {string} id scoped id of the resource
243
- * @param {CommonConstruct} scope scope in which this resource is defined
244
- * @param {TextWidgetProps} props
245
- * @param {string} apiName the api name
236
+ * @param id scoped id of the resource
237
+ * @param scope scope in which this resource is defined
238
+ * @param props
239
+ * @param apiName the api name
246
240
  */
247
241
  createApiGatewayWidget(id, scope, props, apiName) {
248
242
  if (!props)
@@ -257,10 +251,10 @@ class CloudWatchManager {
257
251
  }
258
252
  /**
259
253
  * @summary Method to create a lambda function widget
260
- * @param {string} id scoped id of the resource
261
- * @param {CommonConstruct} scope scope in which this resource is defined
262
- * @param {TextWidgetProps} props
263
- * @param {string} functionName the lambda function name
254
+ * @param id scoped id of the resource
255
+ * @param scope scope in which this resource is defined
256
+ * @param props
257
+ * @param functionName the lambda function name
264
258
  */
265
259
  createLambdaWidget(id, scope, props, functionName) {
266
260
  if (!props)
@@ -275,10 +269,10 @@ class CloudWatchManager {
275
269
  }
276
270
  /**
277
271
  * @summary Method to create a custom widget
278
- * @param {string} id scoped id of the resource
279
- * @param {CommonConstruct} scope scope in which this resource is defined
280
- * @param {TextWidgetProps} props
281
- * @param {string} service the service identifier
272
+ * @param id scoped id of the resource
273
+ * @param scope scope in which this resource is defined
274
+ * @param props
275
+ * @param service the service identifier
282
276
  */
283
277
  createCustomWidget(id, scope, props, service) {
284
278
  if (!props)
@@ -293,10 +287,10 @@ class CloudWatchManager {
293
287
  }
294
288
  /**
295
289
  * @summary Method to create an ecs cluster widget
296
- * @param {string} id scoped id of the resource
297
- * @param {CommonConstruct} scope scope in which this resource is defined
298
- * @param {TextWidgetProps} props
299
- * @param {string} clusterName the ecs cluster name
290
+ * @param id scoped id of the resource
291
+ * @param scope scope in which this resource is defined
292
+ * @param props
293
+ * @param clusterName the ecs cluster name
300
294
  */
301
295
  createEcsClusterWidget(id, scope, props, clusterName) {
302
296
  if (!props)
@@ -311,11 +305,11 @@ class CloudWatchManager {
311
305
  }
312
306
  /**
313
307
  * @summary Method to create an ecs service widget
314
- * @param {string} id scoped id of the resource
315
- * @param {CommonConstruct} scope scope in which this resource is defined
316
- * @param {TextWidgetProps} props
317
- * @param {string} clusterName the ecs cluster name
318
- * @param {string} serviceName the ecs service name
308
+ * @param id scoped id of the resource
309
+ * @param scope scope in which this resource is defined
310
+ * @param props
311
+ * @param clusterName the ecs cluster name
312
+ * @param serviceName the ecs service name
319
313
  */
320
314
  createEcsServiceWidget(id, scope, props, clusterName, serviceName) {
321
315
  if (!props)
@@ -333,10 +327,10 @@ class CloudWatchManager {
333
327
  }
334
328
  /**
335
329
  * @summary Method to create an elb widget
336
- * @param {string} id scoped id of the resource
337
- * @param {CommonConstruct} scope scope in which this resource is defined
338
- * @param {TextWidgetProps} props
339
- * @param {string} loadBalancer the loadbalancer reference
330
+ * @param id scoped id of the resource
331
+ * @param scope scope in which this resource is defined
332
+ * @param props
333
+ * @param loadBalancer the loadbalancer reference
340
334
  */
341
335
  createElbWidget(id, scope, props, loadBalancer) {
342
336
  if (!props)
@@ -351,10 +345,10 @@ class CloudWatchManager {
351
345
  }
352
346
  /**
353
347
  * @summary Method to create an elasticache widget
354
- * @param {string} id scoped id of the resource
355
- * @param {CommonConstruct} scope scope in which this resource is defined
356
- * @param {TextWidgetProps} props
357
- * @param {string} cacheClusterId the elasticache cluster id
348
+ * @param id scoped id of the resource
349
+ * @param scope scope in which this resource is defined
350
+ * @param props
351
+ * @param cacheClusterId the elasticache cluster id
358
352
  */
359
353
  createCacheWidget(id, scope, props, cacheClusterId) {
360
354
  if (!props)
@@ -369,17 +363,17 @@ class CloudWatchManager {
369
363
  }
370
364
  /**
371
365
  * @summary Method to create a cloudwatch text widget
372
- * @param {string} id scoped id of the resource
373
- * @param {CommonConstruct} scope scope in which this resource is defined
374
- * @param {TextWidgetProps} props
366
+ * @param id scoped id of the resource
367
+ * @param scope scope in which this resource is defined
368
+ * @param props
375
369
  */
376
370
  createTextWidget(id, scope, props) {
377
371
  if (!props)
378
372
  throw `Widget props undefined for ${id}`;
379
373
  const widget = new watch.TextWidget({
374
+ height: props.height,
380
375
  markdown: props.markdown,
381
376
  width: props.width,
382
- height: props.height,
383
377
  });
384
378
  if (props.positionX && props.positionY)
385
379
  widget.position(props.positionX, props.positionY);
@@ -387,23 +381,23 @@ class CloudWatchManager {
387
381
  }
388
382
  /**
389
383
  * @summary Method to create a cloudwatch numeric widget
390
- * @param {string} id scoped id of the resource
391
- * @param {CommonConstruct} scope scope in which this resource is defined
392
- * @param {NumericWidgetProps} props
384
+ * @param id scoped id of the resource
385
+ * @param scope scope in which this resource is defined
386
+ * @param props
393
387
  * @param metrics
394
388
  */
395
389
  createSingleValueWidget(id, scope, props, metrics) {
396
390
  if (!props)
397
391
  throw `Widget props undefined for ${id}`;
398
392
  const widget = new watch.SingleValueWidget({
399
- region: props.region ?? scope.props.region,
393
+ fullPrecision: props.fullPrecision,
394
+ height: props.height,
400
395
  metrics: metrics,
396
+ region: props.region ?? scope.props.region,
401
397
  setPeriodToTimeRange: props.setPeriodToTimeRange,
402
- fullPrecision: props.fullPrecision,
403
398
  sparkline: props.sparkline,
404
399
  title: props.title,
405
400
  width: props.width,
406
- height: props.height,
407
401
  });
408
402
  if (props.positionX && props.positionY)
409
403
  widget.position(props.positionX, props.positionY);
@@ -411,23 +405,23 @@ class CloudWatchManager {
411
405
  }
412
406
  /**
413
407
  * @summary Method to create a cloudwatch guage widget
414
- * @param {string} id scoped id of the resource
415
- * @param {CommonConstruct} scope scope in which this resource is defined
416
- * @param {GuageWidgetProps} props
408
+ * @param id scoped id of the resource
409
+ * @param scope scope in which this resource is defined
410
+ * @param props
417
411
  * @param metrics
418
412
  */
419
413
  createGuageWidget(id, scope, props, metrics) {
420
414
  if (!props)
421
415
  throw `Widget props undefined for ${id}`;
422
416
  const widget = new watch.GaugeWidget({
423
- region: props.region ?? scope.props.region,
424
- metrics: metrics,
417
+ height: props.height,
425
418
  leftYAxis: props.leftYAxis,
426
- statistic: props.statistic,
419
+ metrics: metrics,
420
+ region: props.region ?? scope.props.region,
427
421
  setPeriodToTimeRange: props.setPeriodToTimeRange,
422
+ statistic: props.statistic,
428
423
  title: props.title,
429
424
  width: props.width,
430
- height: props.height,
431
425
  });
432
426
  if (props.positionX && props.positionY)
433
427
  widget.position(props.positionX, props.positionY);
@@ -435,9 +429,9 @@ class CloudWatchManager {
435
429
  }
436
430
  /**
437
431
  * @summary Method to create a cloudwatch graph widget
438
- * @param {string} id scoped id of the resource
439
- * @param {CommonConstruct} scope scope in which this resource is defined
440
- * @param {GraphWidgetProps} props
432
+ * @param id scoped id of the resource
433
+ * @param scope scope in which this resource is defined
434
+ * @param props
441
435
  * @param leftYMetrics
442
436
  * @param rightYMetrics
443
437
  */
@@ -445,20 +439,20 @@ class CloudWatchManager {
445
439
  if (!props)
446
440
  throw `Widget props undefined for ${id}`;
447
441
  const widget = new watch.GraphWidget({
448
- region: props.region ?? scope.props.region,
442
+ height: props.height,
449
443
  left: leftYMetrics,
450
- right: rightYMetrics,
451
444
  leftAnnotations: props.leftAnnotations,
452
- rightAnnotations: props.rightAnnotations,
453
- stacked: props.stacked,
454
445
  leftYAxis: props.leftYAxis,
455
- rightYAxis: props.rightYAxis,
456
446
  legendPosition: props.legendPosition,
457
447
  liveData: props.liveData,
458
- view: props.view,
448
+ region: props.region ?? scope.props.region,
449
+ right: rightYMetrics,
450
+ rightAnnotations: props.rightAnnotations,
451
+ rightYAxis: props.rightYAxis,
452
+ stacked: props.stacked,
459
453
  title: props.title,
454
+ view: props.view,
460
455
  width: props.width,
461
- height: props.height,
462
456
  });
463
457
  if (props.positionX && props.positionY)
464
458
  widget.position(props.positionX, props.positionY);
@@ -466,19 +460,19 @@ class CloudWatchManager {
466
460
  }
467
461
  /**
468
462
  * @summary Method to create a cloudwatch alarm status widget
469
- * @param {string} id scoped id of the resource
470
- * @param {CommonConstruct} scope scope in which this resource is defined
471
- * @param {AlarmStatusWidgetProps} props
472
- * @param {watch.IAlarm[]} alarms
463
+ * @param id scoped id of the resource
464
+ * @param scope scope in which this resource is defined
465
+ * @param props
466
+ * @param alarms
473
467
  */
474
468
  createAlarmStatusWidget(id, scope, props, alarms) {
475
469
  if (!props)
476
470
  throw `Widget props undefined for ${id}`;
477
471
  const widget = new watch.AlarmStatusWidget({
478
472
  alarms: alarms,
473
+ height: props.height,
479
474
  title: props.title,
480
475
  width: props.width,
481
- height: props.height,
482
476
  });
483
477
  if (props.positionX && props.positionY)
484
478
  widget.position(props.positionX, props.positionY);
@@ -486,23 +480,23 @@ class CloudWatchManager {
486
480
  }
487
481
  /**
488
482
  * @summary Method to create a cloudwatch log query widget
489
- * @param {string} id scoped id of the resource
490
- * @param {CommonConstruct} scope scope in which this resource is defined
491
- * @param {LogQueryWidgetProps} props
492
- * @param {string[]} logGroupNames
483
+ * @param id scoped id of the resource
484
+ * @param scope scope in which this resource is defined
485
+ * @param props
486
+ * @param logGroupNames
493
487
  */
494
488
  createLogQueryWidget(id, scope, props, logGroupNames) {
495
489
  if (!props)
496
490
  throw `Widget props undefined for ${id}`;
497
491
  const widget = new watch.LogQueryWidget({
498
- region: props.region ?? scope.props.region,
492
+ height: props.height,
499
493
  logGroupNames: logGroupNames,
500
- queryString: props.queryString,
501
494
  queryLines: props.queryLines,
502
- view: props.view,
495
+ queryString: props.queryString,
496
+ region: props.region ?? scope.props.region,
503
497
  title: props.title,
498
+ view: props.view,
504
499
  width: props.width,
505
- height: props.height,
506
500
  });
507
501
  if (props.positionX && props.positionY)
508
502
  widget.position(props.positionX, props.positionY);
@@ -510,8 +504,8 @@ class CloudWatchManager {
510
504
  }
511
505
  /**
512
506
  * @summary Utility method to determine the metrics and dimensions
513
- * @param {CommonConstruct} scope scope in which this resource is defined
514
- * @param {MetricProps[]} metricProps
507
+ * @param scope scope in which this resource is defined
508
+ * @param metricProps
515
509
  */
516
510
  determineMetrics(scope, metricProps) {
517
511
  const metrics = [];
@@ -530,8 +524,8 @@ class CloudWatchManager {
530
524
  metricDimensions = {
531
525
  ...metricProp.dimensionsMap,
532
526
  ...{
533
- ServiceName: `${metricProp.serviceName}`,
534
527
  ClusterName: `${metricProp.clusterName}`,
528
+ ServiceName: `${metricProp.serviceName}`,
535
529
  },
536
530
  };
537
531
  }
@@ -571,8 +565,8 @@ class CloudWatchManager {
571
565
  metricDimensions = {
572
566
  ...metricProp.dimensionsMap,
573
567
  ...{
574
- Region: `Global`,
575
568
  DistributionId: `${metricProp.distributionId}`,
569
+ Region: `Global`,
576
570
  },
577
571
  };
578
572
  }
@@ -618,12 +612,12 @@ class CloudWatchManager {
618
612
  };
619
613
  }
620
614
  const metric = new watch.Metric({
621
- namespace: metricProp.stageSuffix ? `${metricProp.namespace}-${scope.props.stage}` : metricProp.namespace,
622
- metricName: metricProp.stageSuffix ? `${metricProp.metricName}-${scope.props.stage}` : metricProp.metricName,
623
615
  dimensionsMap: metricDimensions,
624
- statistic: metricProp.statistic,
625
- region: metricProp.region,
616
+ metricName: metricProp.stageSuffix ? `${metricProp.metricName}-${scope.props.stage}` : metricProp.metricName,
617
+ namespace: metricProp.stageSuffix ? `${metricProp.namespace}-${scope.props.stage}` : metricProp.namespace,
626
618
  period: metricProp.periodInSecs ? cdk.Duration.seconds(metricProp.periodInSecs) : cdk.Duration.minutes(5),
619
+ region: metricProp.region,
620
+ statistic: metricProp.statistic,
627
621
  });
628
622
  metrics.push(metric);
629
623
  });
@@ -632,7 +626,7 @@ class CloudWatchManager {
632
626
  }
633
627
  /**
634
628
  * @summary Utility method to determine the time range
635
- * @param {string?} range
629
+ * @param range
636
630
  */
637
631
  static determineTimeRange(range) {
638
632
  const moment = require('moment');
@@ -647,9 +641,9 @@ class CloudWatchManager {
647
641
  }
648
642
  /**
649
643
  * @summary Utility method to determine the configured alarms
650
- * @param {string} id scoped id of the resource
651
- * @param {CommonConstruct} scope scope in which this resource is defined
652
- * @param {watch.AlarmProps[]} alarmProps
644
+ * @param id scoped id of the resource
645
+ * @param scope scope in which this resource is defined
646
+ * @param alarmProps
653
647
  */
654
648
  determineAlarms(id, scope, alarmProps) {
655
649
  const alarms = [];
@@ -2,8 +2,6 @@ import * as watch from 'aws-cdk-lib/aws-cloudwatch';
2
2
  import * as logs from 'aws-cdk-lib/aws-logs';
3
3
  import { TagProps } from '../../../types';
4
4
  /**
5
- * @category cdk-utils.cloudwatch-manager
6
- * @subcategory Properties
7
5
  */
8
6
  export interface AlarmProps extends watch.AlarmProps {
9
7
  expression?: string;
@@ -11,100 +9,80 @@ export interface AlarmProps extends watch.AlarmProps {
11
9
  periodInSecs?: number;
12
10
  }
13
11
  /**
14
- * @category cdk-utils.cloudwatch-manager
15
- * @subcategory Properties
16
12
  */
17
13
  export interface DashboardProps extends watch.DashboardProps {
18
14
  }
19
15
  /**
20
- * @category cdk-utils.cloudwatch-manager
21
- * @subcategory Properties
22
16
  */
23
17
  export interface MetricProps extends watch.MetricProps {
24
- stageSuffix: boolean;
25
- periodInSecs?: number;
26
- functionName?: string;
27
- dbClusterIdentifier?: string;
28
- distributionId?: string;
29
- loadBalancer?: string;
30
- serviceName?: string;
31
- clusterName?: string;
32
18
  apiName?: string;
33
19
  cacheClusterId?: string;
34
- stateMachineArn?: string;
20
+ clusterName?: string;
21
+ dbClusterIdentifier?: string;
22
+ distributionId?: string;
35
23
  eventBusName?: string;
24
+ functionName?: string;
25
+ loadBalancer?: string;
26
+ periodInSecs?: number;
36
27
  ruleName?: string;
37
28
  service?: string;
29
+ serviceName?: string;
30
+ stageSuffix: boolean;
31
+ stateMachineArn?: string;
38
32
  }
39
33
  /**
40
- * @category cdk-utils.cloudwatch-manager
41
- * @subcategory Properties
42
34
  */
43
35
  export interface TextWidgetProps extends watch.TextWidgetProps {
44
- type: string;
45
36
  positionX: number;
46
37
  positionY: number;
38
+ type: string;
47
39
  }
48
40
  /**
49
- * @category cdk-utils.cloudwatch-manager
50
- * @subcategory Properties
51
41
  */
52
42
  export interface NumericWidgetProps extends watch.SingleValueWidgetProps {
53
- type: string;
43
+ metricProps: watch.MetricProps[];
54
44
  positionX: number;
55
45
  positionY: number;
56
- metricProps: watch.MetricProps[];
46
+ type: string;
57
47
  }
58
48
  /**
59
- * @category cdk-utils.cloudwatch-manager
60
- * @subcategory Properties
61
49
  */
62
50
  export interface GuageWidgetProps extends watch.GaugeWidgetProps {
63
- type: string;
51
+ metricProps: watch.MetricProps[];
64
52
  positionX: number;
65
53
  positionY: number;
66
- metricProps: watch.MetricProps[];
54
+ type: string;
67
55
  }
68
56
  /**
69
- * @category cdk-utils.cloudwatch-manager
70
- * @subcategory Properties
71
57
  */
72
58
  export interface GraphWidgetProps extends watch.GraphWidgetProps {
73
- type: string;
59
+ metricProps: MetricProps[];
74
60
  positionX: number;
75
61
  positionY: number;
76
- metricProps: MetricProps[];
62
+ type: string;
77
63
  }
78
64
  /**
79
- * @category cdk-utils.cloudwatch-manager
80
- * @subcategory Properties
81
65
  */
82
66
  export interface AlarmStatusWidgetProps extends watch.AlarmStatusWidgetProps {
83
- type: string;
67
+ alarmProps: watch.AlarmProps[];
84
68
  positionX: number;
85
69
  positionY: number;
86
- alarmProps: watch.AlarmProps[];
70
+ type: string;
87
71
  }
88
72
  /**
89
- * @category cdk-utils.cloudwatch-manager
90
- * @subcategory Properties
91
73
  */
92
74
  export interface LogQueryWidgetProps extends watch.LogQueryWidgetProps {
93
- type: string;
94
75
  positionX: number;
95
76
  positionY: number;
77
+ type: string;
96
78
  }
97
79
  /**
98
- * @category cdk-utils.cloudwatch-manager
99
- * @subcategory Properties
100
80
  */
101
81
  export interface MetricFilterProps extends logs.MetricFilterProps {
102
- periodInSecs: number;
103
82
  options: watch.MetricOptions;
83
+ periodInSecs: number;
104
84
  }
105
85
  /**
106
- * @category cdk-utils.cloudwatch-manager
107
- * @subcategory Properties
108
86
  */
109
87
  export interface LogProps extends logs.LogGroupProps {
110
88
  tags?: TagProps[];
@@ -1,9 +1,6 @@
1
1
  import * as cdk from 'aws-cdk-lib';
2
2
  import { CommonConstruct } from '../../../common';
3
3
  /**
4
- * @stability stable
5
- * @category cdk-utils.codebuild-manager
6
- * @subcategory Construct
7
4
  * @classdesc Provides operations on AWS Code Build.
8
5
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
9
6
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -17,7 +14,6 @@ import { CommonConstruct } from '../../../common';
17
14
  * this.codeBuildManager.createImageForCloudfrontInvalidation('MyInvalidation', this, './docker ')
18
15
  * }
19
16
  * }
20
- *
21
17
  * @see [CDK Codebuild Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild-readme.html}
22
18
  */
23
19
  export declare class CodeBuildManager {