@gradientedge/cdk-utils-aws 2.5.0 → 2.7.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.
- package/dist/src/construct/api-to-any-target/main.d.ts +11 -0
- package/dist/src/construct/api-to-any-target/main.js +11 -2
- package/dist/src/construct/api-to-any-target/target.d.ts +16 -1
- package/dist/src/construct/api-to-any-target/target.js +16 -1
- package/dist/src/construct/api-to-any-target/types.d.ts +52 -0
- package/dist/src/construct/api-to-eventbridge-target/api.d.ts +18 -0
- package/dist/src/construct/api-to-eventbridge-target/api.js +18 -0
- package/dist/src/construct/api-to-eventbridge-target/event.d.ts +7 -0
- package/dist/src/construct/api-to-eventbridge-target/event.js +7 -0
- package/dist/src/construct/api-to-eventbridge-target/main.d.ts +12 -0
- package/dist/src/construct/api-to-eventbridge-target/main.js +12 -3
- package/dist/src/construct/api-to-eventbridge-target/types.d.ts +67 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +7 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +7 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/main.d.ts +13 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/main.js +13 -4
- package/dist/src/construct/api-to-eventbridge-target-with-sns/types.d.ts +12 -0
- package/dist/src/construct/api-to-lambda-target/api.d.ts +19 -0
- package/dist/src/construct/api-to-lambda-target/api.js +19 -0
- package/dist/src/construct/api-to-lambda-target/main.d.ts +24 -0
- package/dist/src/construct/api-to-lambda-target/main.js +24 -2
- package/dist/src/construct/api-to-lambda-target/types.d.ts +41 -0
- package/dist/src/construct/application-configuration/main.d.ts +29 -1
- package/dist/src/construct/application-configuration/main.js +28 -1
- package/dist/src/construct/application-configuration/types.d.ts +5 -0
- package/dist/src/construct/event-handler/handler.d.ts +23 -1
- package/dist/src/construct/event-handler/handler.js +23 -1
- package/dist/src/construct/event-handler/main.d.ts +13 -0
- package/dist/src/construct/event-handler/main.js +13 -0
- package/dist/src/construct/event-handler/types.d.ts +35 -0
- package/dist/src/construct/lambda-with-iam-access/main.d.ts +21 -0
- package/dist/src/construct/lambda-with-iam-access/main.js +21 -2
- package/dist/src/construct/lambda-with-iam-access/types.d.ts +18 -0
- package/dist/src/construct/piped-event-handler/main.d.ts +9 -0
- package/dist/src/construct/piped-event-handler/main.js +9 -0
- package/dist/src/construct/piped-event-handler/types.d.ts +7 -0
- package/dist/src/construct/rest-api-lambda/main.d.ts +23 -0
- package/dist/src/construct/rest-api-lambda/main.js +19 -2
- package/dist/src/construct/rest-api-lambda/types.d.ts +14 -0
- package/dist/src/construct/rest-api-lambda-with-cache/main.d.ts +12 -0
- package/dist/src/construct/rest-api-lambda-with-cache/main.js +12 -2
- package/dist/src/construct/rest-api-lambda-with-cache/types.d.ts +6 -0
- package/dist/src/construct/site-with-ecs-backend/constants.d.ts +5 -0
- package/dist/src/construct/site-with-ecs-backend/constants.js +5 -0
- package/dist/src/construct/site-with-ecs-backend/main.d.ts +37 -0
- package/dist/src/construct/site-with-ecs-backend/main.js +37 -2
- package/dist/src/construct/site-with-ecs-backend/types.d.ts +45 -0
- package/dist/src/construct/site-with-lambda-backend/constants.d.ts +8 -0
- package/dist/src/construct/site-with-lambda-backend/constants.js +8 -0
- package/dist/src/construct/site-with-lambda-backend/main.d.ts +31 -0
- package/dist/src/construct/site-with-lambda-backend/main.js +31 -2
- package/dist/src/construct/site-with-lambda-backend/types.d.ts +42 -0
- package/dist/src/construct/static-asset-deployment/main.d.ts +10 -0
- package/dist/src/construct/static-asset-deployment/main.js +10 -1
- package/dist/src/construct/static-asset-deployment/types.d.ts +14 -0
- package/dist/src/construct/static-site/main.d.ts +17 -0
- package/dist/src/construct/static-site/main.js +17 -2
- package/dist/src/construct/static-site/types.d.ts +18 -0
- package/dist/src/services/api-gateway/main.d.ts +20 -20
- package/dist/src/services/api-gateway/main.js +20 -20
- package/dist/src/services/api-gateway/types.d.ts +7 -0
- package/dist/src/services/appconfig/constants.d.ts +2 -2
- package/dist/src/services/appconfig/constants.js +2 -2
- package/dist/src/services/appconfig/main.d.ts +5 -5
- package/dist/src/services/appconfig/main.js +5 -5
- package/dist/src/services/appconfig/types.d.ts +11 -1
- package/dist/src/services/certificate-manager/types.d.ts +8 -0
- package/dist/src/services/cloudfront/main.d.ts +28 -28
- package/dist/src/services/cloudfront/main.js +28 -28
- package/dist/src/services/cloudfront/types.d.ts +8 -0
- package/dist/src/services/cloudwatch/logs.d.ts +4 -4
- package/dist/src/services/cloudwatch/logs.js +4 -4
- package/dist/src/services/cloudwatch/main.d.ts +24 -24
- package/dist/src/services/cloudwatch/main.js +25 -24
- package/dist/src/services/cloudwatch/types.d.ts +66 -0
- package/dist/src/services/dynamodb/main.d.ts +2 -2
- package/dist/src/services/dynamodb/main.js +2 -2
- package/dist/src/services/dynamodb/types.d.ts +8 -0
- package/dist/src/services/elastic-container-registry/main.d.ts +1 -1
- package/dist/src/services/elastic-container-registry/main.js +1 -1
- package/dist/src/services/elastic-container-service/main.d.ts +13 -13
- package/dist/src/services/elastic-container-service/main.js +16 -13
- package/dist/src/services/elastic-container-service/types.d.ts +30 -1
- package/dist/src/services/elastic-file-system/types.d.ts +9 -0
- package/dist/src/services/elastic-kubernetes-service/main.d.ts +3 -3
- package/dist/src/services/elastic-kubernetes-service/main.js +7 -3
- package/dist/src/services/elastic-kubernetes-service/types.d.ts +4 -0
- package/dist/src/services/elasticache/main.d.ts +14 -14
- package/dist/src/services/elasticache/main.js +18 -14
- package/dist/src/services/elasticache/types.d.ts +4 -0
- package/dist/src/services/eventbridge/main.d.ts +11 -11
- package/dist/src/services/eventbridge/main.js +19 -11
- package/dist/src/services/eventbridge/target.d.ts +5 -1
- package/dist/src/services/eventbridge/target.js +6 -1
- package/dist/src/services/eventbridge/types.d.ts +27 -1
- package/dist/src/services/evidently/types.d.ts +10 -0
- package/dist/src/services/identity-access-management/main.d.ts +42 -42
- package/dist/src/services/identity-access-management/main.js +42 -42
- package/dist/src/services/key-management-service/types.d.ts +2 -0
- package/dist/src/services/lambda/main.d.ts +25 -25
- package/dist/src/services/lambda/main.js +26 -25
- package/dist/src/services/lambda/types.d.ts +34 -0
- package/dist/src/services/route53/main.js +2 -0
- package/dist/src/services/route53/types.d.ts +3 -0
- package/dist/src/services/secrets-manager/main.js +2 -0
- package/dist/src/services/secrets-manager/types.d.ts +4 -0
- package/dist/src/services/simple-notification-service/types.d.ts +2 -0
- package/dist/src/services/simple-queue-service/main.js +2 -0
- package/dist/src/services/simple-queue-service/types.d.ts +11 -0
- package/dist/src/services/simple-storage-service/main.d.ts +1 -1
- package/dist/src/services/simple-storage-service/main.js +5 -1
- package/dist/src/services/simple-storage-service/types.d.ts +16 -0
- package/dist/src/services/step-function/types.d.ts +54 -0
- package/dist/src/services/systems-manager/main.d.ts +15 -4
- package/dist/src/services/systems-manager/main.js +17 -4
- package/dist/src/services/systems-manager/types.d.ts +8 -0
- package/dist/src/services/virtual-private-cloud/ipv6.d.ts +19 -1
- package/dist/src/services/virtual-private-cloud/ipv6.js +26 -1
- package/dist/src/services/virtual-private-cloud/main.js +1 -2
- package/dist/src/services/virtual-private-cloud/types.d.ts +5 -0
- package/dist/src/services/web-application-firewall/types.d.ts +4 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/utils/index.d.ts +9 -3
- package/dist/src/utils/index.js +10 -3
- package/package.json +5 -5
|
@@ -25,36 +25,36 @@ export declare class CloudWatchManager {
|
|
|
25
25
|
* @summary Method to create a cloudwatch alarm for a given expression
|
|
26
26
|
* @param id scoped id of the resource
|
|
27
27
|
* @param scope scope in which this resource is defined
|
|
28
|
-
* @param props
|
|
28
|
+
* @param props the alarm properties including the math expression and metrics
|
|
29
29
|
*/
|
|
30
30
|
createAlarmForExpression(id: string, scope: CommonConstruct, props: AlarmProps): cdk.aws_cloudwatch.Alarm;
|
|
31
31
|
/**
|
|
32
32
|
* @summary Method to create a cloudwatch alarm for a given metric
|
|
33
33
|
* @param id scoped id of the resource
|
|
34
34
|
* @param scope scope in which this resource is defined
|
|
35
|
-
* @param props
|
|
36
|
-
* @param metric
|
|
35
|
+
* @param props the alarm properties
|
|
36
|
+
* @param metric the CloudWatch metric to create the alarm for
|
|
37
37
|
*/
|
|
38
38
|
createAlarmForMetric(id: string, scope: CommonConstruct, props: AlarmProps, metric: watch.Metric): cdk.aws_cloudwatch.Alarm;
|
|
39
39
|
/**
|
|
40
40
|
* @summary Method to create a cloudwatch dashboard
|
|
41
41
|
* @param id scoped id of the resource
|
|
42
42
|
* @param scope scope in which this resource is defined
|
|
43
|
-
* @param props
|
|
44
|
-
* @param widgets
|
|
43
|
+
* @param props the dashboard properties
|
|
44
|
+
* @param widgets optional 2D array of widgets to add to the dashboard
|
|
45
45
|
*/
|
|
46
46
|
createDashboard(id: string, scope: CommonConstruct, props: DashboardProps, widgets?: watch.IWidget[][]): cdk.aws_cloudwatch.Dashboard;
|
|
47
47
|
/**
|
|
48
48
|
* @summary Method to create cloudwatch widgets
|
|
49
49
|
* @param scope scope in which this resource is defined
|
|
50
|
-
* @param props
|
|
50
|
+
* @param props array of widget properties
|
|
51
51
|
*/
|
|
52
52
|
createWidgets(scope: CommonConstruct, props: any[]): any;
|
|
53
53
|
/**
|
|
54
|
-
* @summary Method to create a cloudwatch widget
|
|
54
|
+
* @summary Method to create a cloudwatch widget based on type
|
|
55
55
|
* @param id scoped id of the resource
|
|
56
56
|
* @param scope scope in which this resource is defined
|
|
57
|
-
* @param props
|
|
57
|
+
* @param props the widget properties including the type discriminator
|
|
58
58
|
*/
|
|
59
59
|
createWidget(id: string, scope: CommonConstruct, props: any): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
|
|
60
60
|
/**
|
|
@@ -143,66 +143,66 @@ export declare class CloudWatchManager {
|
|
|
143
143
|
* @summary Method to create a cloudwatch text widget
|
|
144
144
|
* @param id scoped id of the resource
|
|
145
145
|
* @param scope scope in which this resource is defined
|
|
146
|
-
* @param props
|
|
146
|
+
* @param props the text widget properties
|
|
147
147
|
*/
|
|
148
148
|
createTextWidget(id: string, scope: CommonConstruct, props: TextWidgetProps): cdk.aws_cloudwatch.TextWidget;
|
|
149
149
|
/**
|
|
150
150
|
* @summary Method to create a cloudwatch numeric widget
|
|
151
151
|
* @param id scoped id of the resource
|
|
152
152
|
* @param scope scope in which this resource is defined
|
|
153
|
-
* @param props
|
|
154
|
-
* @param metrics
|
|
153
|
+
* @param props the numeric widget properties
|
|
154
|
+
* @param metrics the metrics to display in the widget
|
|
155
155
|
*/
|
|
156
156
|
createSingleValueWidget(id: string, scope: CommonConstruct, props: NumericWidgetProps, metrics: IMetric[]): cdk.aws_cloudwatch.SingleValueWidget;
|
|
157
157
|
/**
|
|
158
|
-
* @summary Method to create a cloudwatch
|
|
158
|
+
* @summary Method to create a cloudwatch gauge widget
|
|
159
159
|
* @param id scoped id of the resource
|
|
160
160
|
* @param scope scope in which this resource is defined
|
|
161
|
-
* @param props
|
|
162
|
-
* @param metrics
|
|
161
|
+
* @param props the gauge widget properties
|
|
162
|
+
* @param metrics the metrics to display in the widget
|
|
163
163
|
*/
|
|
164
164
|
createGuageWidget(id: string, scope: CommonConstruct, props: GuageWidgetProps, metrics: IMetric[]): cdk.aws_cloudwatch.GaugeWidget;
|
|
165
165
|
/**
|
|
166
166
|
* @summary Method to create a cloudwatch graph widget
|
|
167
167
|
* @param id scoped id of the resource
|
|
168
168
|
* @param scope scope in which this resource is defined
|
|
169
|
-
* @param props
|
|
170
|
-
* @param leftYMetrics
|
|
171
|
-
* @param rightYMetrics
|
|
169
|
+
* @param props the graph widget properties
|
|
170
|
+
* @param leftYMetrics optional metrics to display on the left Y axis
|
|
171
|
+
* @param rightYMetrics optional metrics to display on the right Y axis
|
|
172
172
|
*/
|
|
173
173
|
createGraphWidget(id: string, scope: CommonConstruct, props: GraphWidgetProps, leftYMetrics?: IMetric[], rightYMetrics?: IMetric[]): cdk.aws_cloudwatch.GraphWidget;
|
|
174
174
|
/**
|
|
175
175
|
* @summary Method to create a cloudwatch alarm status widget
|
|
176
176
|
* @param id scoped id of the resource
|
|
177
177
|
* @param scope scope in which this resource is defined
|
|
178
|
-
* @param props
|
|
179
|
-
* @param alarms
|
|
178
|
+
* @param props the alarm status widget properties
|
|
179
|
+
* @param alarms the alarms to display status for
|
|
180
180
|
*/
|
|
181
181
|
createAlarmStatusWidget(id: string, scope: CommonConstruct, props: AlarmStatusWidgetProps, alarms: watch.IAlarm[]): cdk.aws_cloudwatch.AlarmStatusWidget;
|
|
182
182
|
/**
|
|
183
183
|
* @summary Method to create a cloudwatch log query widget
|
|
184
184
|
* @param id scoped id of the resource
|
|
185
185
|
* @param scope scope in which this resource is defined
|
|
186
|
-
* @param props
|
|
187
|
-
* @param logGroupNames
|
|
186
|
+
* @param props the log query widget properties
|
|
187
|
+
* @param logGroupNames the log group names to query
|
|
188
188
|
*/
|
|
189
189
|
createLogQueryWidget(id: string, scope: CommonConstruct, props: LogQueryWidgetProps, logGroupNames: string[]): cdk.aws_cloudwatch.LogQueryWidget;
|
|
190
190
|
/**
|
|
191
191
|
* @summary Utility method to determine the metrics and dimensions
|
|
192
192
|
* @param scope scope in which this resource is defined
|
|
193
|
-
* @param metricProps
|
|
193
|
+
* @param metricProps array of metric properties to resolve into CloudWatch metrics
|
|
194
194
|
*/
|
|
195
195
|
private determineMetrics;
|
|
196
196
|
/**
|
|
197
197
|
* @summary Utility method to determine the time range
|
|
198
|
-
* @param range
|
|
198
|
+
* @param range a time range string (e.g. 'START_TODAY', 'END_TODAY') or a custom value
|
|
199
199
|
*/
|
|
200
200
|
private static determineTimeRange;
|
|
201
201
|
/**
|
|
202
202
|
* @summary Utility method to determine the configured alarms
|
|
203
203
|
* @param id scoped id of the resource
|
|
204
204
|
* @param scope scope in which this resource is defined
|
|
205
|
-
* @param alarmProps
|
|
205
|
+
* @param alarmProps array of alarm properties to resolve into alarm references
|
|
206
206
|
*/
|
|
207
207
|
private determineAlarms;
|
|
208
208
|
}
|
|
@@ -3,6 +3,7 @@ import * as watch from 'aws-cdk-lib/aws-cloudwatch';
|
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import * as utils from '../../utils/index.js';
|
|
5
5
|
/**
|
|
6
|
+
* Supported CloudWatch dashboard widget types.
|
|
6
7
|
*/
|
|
7
8
|
var CloudWatchWidgetType;
|
|
8
9
|
(function (CloudWatchWidgetType) {
|
|
@@ -35,7 +36,7 @@ export class CloudWatchManager {
|
|
|
35
36
|
* @summary Method to create a cloudwatch alarm for a given expression
|
|
36
37
|
* @param id scoped id of the resource
|
|
37
38
|
* @param scope scope in which this resource is defined
|
|
38
|
-
* @param props
|
|
39
|
+
* @param props the alarm properties including the math expression and metrics
|
|
39
40
|
*/
|
|
40
41
|
createAlarmForExpression(id, scope, props) {
|
|
41
42
|
if (!props)
|
|
@@ -67,8 +68,8 @@ export class CloudWatchManager {
|
|
|
67
68
|
* @summary Method to create a cloudwatch alarm for a given metric
|
|
68
69
|
* @param id scoped id of the resource
|
|
69
70
|
* @param scope scope in which this resource is defined
|
|
70
|
-
* @param props
|
|
71
|
-
* @param metric
|
|
71
|
+
* @param props the alarm properties
|
|
72
|
+
* @param metric the CloudWatch metric to create the alarm for
|
|
72
73
|
*/
|
|
73
74
|
createAlarmForMetric(id, scope, props, metric) {
|
|
74
75
|
if (!props)
|
|
@@ -84,8 +85,8 @@ export class CloudWatchManager {
|
|
|
84
85
|
* @summary Method to create a cloudwatch dashboard
|
|
85
86
|
* @param id scoped id of the resource
|
|
86
87
|
* @param scope scope in which this resource is defined
|
|
87
|
-
* @param props
|
|
88
|
-
* @param widgets
|
|
88
|
+
* @param props the dashboard properties
|
|
89
|
+
* @param widgets optional 2D array of widgets to add to the dashboard
|
|
89
90
|
*/
|
|
90
91
|
createDashboard(id, scope, props, widgets) {
|
|
91
92
|
if (!props)
|
|
@@ -105,7 +106,7 @@ export class CloudWatchManager {
|
|
|
105
106
|
/**
|
|
106
107
|
* @summary Method to create cloudwatch widgets
|
|
107
108
|
* @param scope scope in which this resource is defined
|
|
108
|
-
* @param props
|
|
109
|
+
* @param props array of widget properties
|
|
109
110
|
*/
|
|
110
111
|
createWidgets(scope, props) {
|
|
111
112
|
if (!props || props.length === 0)
|
|
@@ -117,10 +118,10 @@ export class CloudWatchManager {
|
|
|
117
118
|
return widgets;
|
|
118
119
|
}
|
|
119
120
|
/**
|
|
120
|
-
* @summary Method to create a cloudwatch widget
|
|
121
|
+
* @summary Method to create a cloudwatch widget based on type
|
|
121
122
|
* @param id scoped id of the resource
|
|
122
123
|
* @param scope scope in which this resource is defined
|
|
123
|
-
* @param props
|
|
124
|
+
* @param props the widget properties including the type discriminator
|
|
124
125
|
*/
|
|
125
126
|
createWidget(id, scope, props) {
|
|
126
127
|
if (!props)
|
|
@@ -312,7 +313,7 @@ export class CloudWatchManager {
|
|
|
312
313
|
* @summary Method to create a cloudwatch text widget
|
|
313
314
|
* @param id scoped id of the resource
|
|
314
315
|
* @param scope scope in which this resource is defined
|
|
315
|
-
* @param props
|
|
316
|
+
* @param props the text widget properties
|
|
316
317
|
*/
|
|
317
318
|
createTextWidget(id, scope, props) {
|
|
318
319
|
if (!props)
|
|
@@ -328,8 +329,8 @@ export class CloudWatchManager {
|
|
|
328
329
|
* @summary Method to create a cloudwatch numeric widget
|
|
329
330
|
* @param id scoped id of the resource
|
|
330
331
|
* @param scope scope in which this resource is defined
|
|
331
|
-
* @param props
|
|
332
|
-
* @param metrics
|
|
332
|
+
* @param props the numeric widget properties
|
|
333
|
+
* @param metrics the metrics to display in the widget
|
|
333
334
|
*/
|
|
334
335
|
createSingleValueWidget(id, scope, props, metrics) {
|
|
335
336
|
if (!props)
|
|
@@ -344,11 +345,11 @@ export class CloudWatchManager {
|
|
|
344
345
|
return widget;
|
|
345
346
|
}
|
|
346
347
|
/**
|
|
347
|
-
* @summary Method to create a cloudwatch
|
|
348
|
+
* @summary Method to create a cloudwatch gauge widget
|
|
348
349
|
* @param id scoped id of the resource
|
|
349
350
|
* @param scope scope in which this resource is defined
|
|
350
|
-
* @param props
|
|
351
|
-
* @param metrics
|
|
351
|
+
* @param props the gauge widget properties
|
|
352
|
+
* @param metrics the metrics to display in the widget
|
|
352
353
|
*/
|
|
353
354
|
createGuageWidget(id, scope, props, metrics) {
|
|
354
355
|
if (!props)
|
|
@@ -366,9 +367,9 @@ export class CloudWatchManager {
|
|
|
366
367
|
* @summary Method to create a cloudwatch graph widget
|
|
367
368
|
* @param id scoped id of the resource
|
|
368
369
|
* @param scope scope in which this resource is defined
|
|
369
|
-
* @param props
|
|
370
|
-
* @param leftYMetrics
|
|
371
|
-
* @param rightYMetrics
|
|
370
|
+
* @param props the graph widget properties
|
|
371
|
+
* @param leftYMetrics optional metrics to display on the left Y axis
|
|
372
|
+
* @param rightYMetrics optional metrics to display on the right Y axis
|
|
372
373
|
*/
|
|
373
374
|
createGraphWidget(id, scope, props, leftYMetrics, rightYMetrics) {
|
|
374
375
|
if (!props)
|
|
@@ -387,8 +388,8 @@ export class CloudWatchManager {
|
|
|
387
388
|
* @summary Method to create a cloudwatch alarm status widget
|
|
388
389
|
* @param id scoped id of the resource
|
|
389
390
|
* @param scope scope in which this resource is defined
|
|
390
|
-
* @param props
|
|
391
|
-
* @param alarms
|
|
391
|
+
* @param props the alarm status widget properties
|
|
392
|
+
* @param alarms the alarms to display status for
|
|
392
393
|
*/
|
|
393
394
|
createAlarmStatusWidget(id, scope, props, alarms) {
|
|
394
395
|
if (!props)
|
|
@@ -405,8 +406,8 @@ export class CloudWatchManager {
|
|
|
405
406
|
* @summary Method to create a cloudwatch log query widget
|
|
406
407
|
* @param id scoped id of the resource
|
|
407
408
|
* @param scope scope in which this resource is defined
|
|
408
|
-
* @param props
|
|
409
|
-
* @param logGroupNames
|
|
409
|
+
* @param props the log query widget properties
|
|
410
|
+
* @param logGroupNames the log group names to query
|
|
410
411
|
*/
|
|
411
412
|
createLogQueryWidget(id, scope, props, logGroupNames) {
|
|
412
413
|
if (!props)
|
|
@@ -423,7 +424,7 @@ export class CloudWatchManager {
|
|
|
423
424
|
/**
|
|
424
425
|
* @summary Utility method to determine the metrics and dimensions
|
|
425
426
|
* @param scope scope in which this resource is defined
|
|
426
|
-
* @param metricProps
|
|
427
|
+
* @param metricProps array of metric properties to resolve into CloudWatch metrics
|
|
427
428
|
*/
|
|
428
429
|
determineMetrics(scope, metricProps) {
|
|
429
430
|
const metrics = [];
|
|
@@ -527,7 +528,7 @@ export class CloudWatchManager {
|
|
|
527
528
|
}
|
|
528
529
|
/**
|
|
529
530
|
* @summary Utility method to determine the time range
|
|
530
|
-
* @param range
|
|
531
|
+
* @param range a time range string (e.g. 'START_TODAY', 'END_TODAY') or a custom value
|
|
531
532
|
*/
|
|
532
533
|
static determineTimeRange(range) {
|
|
533
534
|
const moment = require('moment');
|
|
@@ -544,7 +545,7 @@ export class CloudWatchManager {
|
|
|
544
545
|
* @summary Utility method to determine the configured alarms
|
|
545
546
|
* @param id scoped id of the resource
|
|
546
547
|
* @param scope scope in which this resource is defined
|
|
547
|
-
* @param alarmProps
|
|
548
|
+
* @param alarmProps array of alarm properties to resolve into alarm references
|
|
548
549
|
*/
|
|
549
550
|
determineAlarms(id, scope, alarmProps) {
|
|
550
551
|
const alarms = [];
|
|
@@ -2,99 +2,165 @@ 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/index.js';
|
|
4
4
|
/**
|
|
5
|
+
* Props for creating a CloudWatch alarm, supporting both metric-based and math-expression-based alarms.
|
|
6
|
+
* @see {@link CloudWatchManager.createAlarmForMetric}
|
|
7
|
+
* @see {@link CloudWatchManager.createAlarmForExpression}
|
|
5
8
|
*/
|
|
6
9
|
/** @category Interface */
|
|
7
10
|
export interface AlarmProps extends watch.AlarmProps {
|
|
11
|
+
/** A math expression string referencing metrics (e.g. "m0 + m1") */
|
|
8
12
|
expression?: string;
|
|
13
|
+
/** Array of metric properties used in a math expression alarm */
|
|
9
14
|
metricProps?: MetricProps[];
|
|
15
|
+
/** The evaluation period in seconds (defaults to 5 minutes) */
|
|
10
16
|
periodInSecs?: number;
|
|
11
17
|
}
|
|
12
18
|
/**
|
|
19
|
+
* Props for creating a CloudWatch dashboard.
|
|
20
|
+
* @see {@link CloudWatchManager.createDashboard}
|
|
13
21
|
*/
|
|
14
22
|
/** @category Interface */
|
|
15
23
|
export interface DashboardProps extends watch.DashboardProps {
|
|
16
24
|
}
|
|
17
25
|
/**
|
|
26
|
+
* Props for defining a CloudWatch metric with service-specific dimension support.
|
|
27
|
+
* @see {@link CloudWatchManager}
|
|
18
28
|
*/
|
|
19
29
|
/** @category Interface */
|
|
20
30
|
export interface MetricProps extends watch.MetricProps {
|
|
31
|
+
/** The API Gateway API name dimension */
|
|
21
32
|
apiName?: string;
|
|
33
|
+
/** The ElastiCache cluster ID dimension */
|
|
22
34
|
cacheClusterId?: string;
|
|
35
|
+
/** The ECS cluster name dimension */
|
|
23
36
|
clusterName?: string;
|
|
37
|
+
/** The RDS DB cluster identifier dimension */
|
|
24
38
|
dbClusterIdentifier?: string;
|
|
39
|
+
/** The CloudFront distribution ID dimension */
|
|
25
40
|
distributionId?: string;
|
|
41
|
+
/** The EventBridge event bus name dimension */
|
|
26
42
|
eventBusName?: string;
|
|
43
|
+
/** The Lambda function name dimension */
|
|
27
44
|
functionName?: string;
|
|
45
|
+
/** The ELB load balancer reference dimension */
|
|
28
46
|
loadBalancer?: string;
|
|
47
|
+
/** The metric period in seconds (defaults to 5 minutes) */
|
|
29
48
|
periodInSecs?: number;
|
|
49
|
+
/** The EventBridge rule name dimension */
|
|
30
50
|
ruleName?: string;
|
|
51
|
+
/** A custom service identifier dimension */
|
|
31
52
|
service?: string;
|
|
53
|
+
/** The ECS service name dimension */
|
|
32
54
|
serviceName?: string;
|
|
55
|
+
/** Whether to append the deployment stage to the metric name and namespace */
|
|
33
56
|
stageSuffix: boolean;
|
|
57
|
+
/** The Step Functions state machine ARN dimension */
|
|
34
58
|
stateMachineArn?: string;
|
|
35
59
|
}
|
|
36
60
|
/**
|
|
61
|
+
* Props for creating a CloudWatch text widget with positioning.
|
|
62
|
+
* @see {@link CloudWatchManager.createTextWidget}
|
|
37
63
|
*/
|
|
38
64
|
/** @category Interface */
|
|
39
65
|
export interface TextWidgetProps extends watch.TextWidgetProps {
|
|
66
|
+
/** The X position of the widget on the dashboard grid */
|
|
40
67
|
positionX: number;
|
|
68
|
+
/** The Y position of the widget on the dashboard grid */
|
|
41
69
|
positionY: number;
|
|
70
|
+
/** The widget type identifier */
|
|
42
71
|
type: string;
|
|
43
72
|
}
|
|
44
73
|
/**
|
|
74
|
+
* Props for creating a CloudWatch single-value numeric widget with positioning.
|
|
75
|
+
* @see {@link CloudWatchManager.createSingleValueWidget}
|
|
45
76
|
*/
|
|
46
77
|
/** @category Interface */
|
|
47
78
|
export interface NumericWidgetProps extends watch.SingleValueWidgetProps {
|
|
79
|
+
/** Array of metric properties to display in the widget */
|
|
48
80
|
metricProps: watch.MetricProps[];
|
|
81
|
+
/** The X position of the widget on the dashboard grid */
|
|
49
82
|
positionX: number;
|
|
83
|
+
/** The Y position of the widget on the dashboard grid */
|
|
50
84
|
positionY: number;
|
|
85
|
+
/** The widget type identifier */
|
|
51
86
|
type: string;
|
|
52
87
|
}
|
|
53
88
|
/**
|
|
89
|
+
* Props for creating a CloudWatch gauge widget with positioning.
|
|
90
|
+
* @see {@link CloudWatchManager.createGuageWidget}
|
|
54
91
|
*/
|
|
55
92
|
/** @category Interface */
|
|
56
93
|
export interface GuageWidgetProps extends watch.GaugeWidgetProps {
|
|
94
|
+
/** Array of metric properties to display in the widget */
|
|
57
95
|
metricProps: watch.MetricProps[];
|
|
96
|
+
/** The X position of the widget on the dashboard grid */
|
|
58
97
|
positionX: number;
|
|
98
|
+
/** The Y position of the widget on the dashboard grid */
|
|
59
99
|
positionY: number;
|
|
100
|
+
/** The widget type identifier */
|
|
60
101
|
type: string;
|
|
61
102
|
}
|
|
62
103
|
/**
|
|
104
|
+
* Props for creating a CloudWatch graph widget with positioning.
|
|
105
|
+
* @see {@link CloudWatchManager.createGraphWidget}
|
|
63
106
|
*/
|
|
64
107
|
/** @category Interface */
|
|
65
108
|
export interface GraphWidgetProps extends watch.GraphWidgetProps {
|
|
109
|
+
/** Array of metric properties to plot on the graph */
|
|
66
110
|
metricProps: MetricProps[];
|
|
111
|
+
/** The X position of the widget on the dashboard grid */
|
|
67
112
|
positionX: number;
|
|
113
|
+
/** The Y position of the widget on the dashboard grid */
|
|
68
114
|
positionY: number;
|
|
115
|
+
/** The widget type identifier */
|
|
69
116
|
type: string;
|
|
70
117
|
}
|
|
71
118
|
/**
|
|
119
|
+
* Props for creating a CloudWatch alarm status widget with positioning.
|
|
120
|
+
* @see {@link CloudWatchManager.createAlarmStatusWidget}
|
|
72
121
|
*/
|
|
73
122
|
/** @category Interface */
|
|
74
123
|
export interface AlarmStatusWidgetProps extends watch.AlarmStatusWidgetProps {
|
|
124
|
+
/** Array of alarm properties to display in the widget */
|
|
75
125
|
alarmProps: watch.AlarmProps[];
|
|
126
|
+
/** The X position of the widget on the dashboard grid */
|
|
76
127
|
positionX: number;
|
|
128
|
+
/** The Y position of the widget on the dashboard grid */
|
|
77
129
|
positionY: number;
|
|
130
|
+
/** The widget type identifier */
|
|
78
131
|
type: string;
|
|
79
132
|
}
|
|
80
133
|
/**
|
|
134
|
+
* Props for creating a CloudWatch log query widget with positioning.
|
|
135
|
+
* @see {@link CloudWatchManager.createLogQueryWidget}
|
|
81
136
|
*/
|
|
82
137
|
/** @category Interface */
|
|
83
138
|
export interface LogQueryWidgetProps extends watch.LogQueryWidgetProps {
|
|
139
|
+
/** The X position of the widget on the dashboard grid */
|
|
84
140
|
positionX: number;
|
|
141
|
+
/** The Y position of the widget on the dashboard grid */
|
|
85
142
|
positionY: number;
|
|
143
|
+
/** The widget type identifier */
|
|
86
144
|
type: string;
|
|
87
145
|
}
|
|
88
146
|
/**
|
|
147
|
+
* Props for creating a CloudWatch metric filter with metric options.
|
|
148
|
+
* @see {@link LogManager.createMetricFilter}
|
|
89
149
|
*/
|
|
90
150
|
/** @category Interface */
|
|
91
151
|
export interface MetricFilterProps extends logs.MetricFilterProps {
|
|
152
|
+
/** The metric options applied when retrieving the metric from the filter */
|
|
92
153
|
options: watch.MetricOptions;
|
|
154
|
+
/** The metric period in seconds (defaults to 5 minutes) */
|
|
93
155
|
periodInSecs: number;
|
|
94
156
|
}
|
|
95
157
|
/**
|
|
158
|
+
* Props for creating a CloudWatch log group with optional tags.
|
|
159
|
+
* @see {@link LogManager.createLogGroup}
|
|
160
|
+
* @see {@link LogManager.createCfnLogGroup}
|
|
96
161
|
*/
|
|
97
162
|
/** @category Interface */
|
|
98
163
|
export interface LogProps extends logs.LogGroupProps {
|
|
164
|
+
/** Optional tags to apply to the log group */
|
|
99
165
|
tags?: TagProps[];
|
|
100
166
|
}
|
|
@@ -15,7 +15,7 @@ import { TableProps, TablePropsV2 } from './types.js';
|
|
|
15
15
|
* this.dynamodbManager.createTable('MyTable', this, tableProps)
|
|
16
16
|
* }
|
|
17
17
|
* }
|
|
18
|
-
* @see [CDK
|
|
18
|
+
* @see [CDK DynamoDB Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb-readme.html}
|
|
19
19
|
* @category Service
|
|
20
20
|
*/
|
|
21
21
|
export declare class DynamodbManager {
|
|
@@ -27,7 +27,7 @@ export declare class DynamodbManager {
|
|
|
27
27
|
*/
|
|
28
28
|
createTable(id: string, scope: CommonConstruct, props: TableProps): Table;
|
|
29
29
|
/**
|
|
30
|
-
* @summary Method to create a table
|
|
30
|
+
* @summary Method to create a table (v2) using the TableV2 construct
|
|
31
31
|
* @param id scoped id of the resource
|
|
32
32
|
* @param scope scope in which this resource is defined
|
|
33
33
|
* @param props table props
|
|
@@ -16,7 +16,7 @@ import { createCfnOutput } from '../../utils/index.js';
|
|
|
16
16
|
* this.dynamodbManager.createTable('MyTable', this, tableProps)
|
|
17
17
|
* }
|
|
18
18
|
* }
|
|
19
|
-
* @see [CDK
|
|
19
|
+
* @see [CDK DynamoDB Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb-readme.html}
|
|
20
20
|
* @category Service
|
|
21
21
|
*/
|
|
22
22
|
export class DynamodbManager {
|
|
@@ -47,7 +47,7 @@ export class DynamodbManager {
|
|
|
47
47
|
return table;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* @summary Method to create a table
|
|
50
|
+
* @summary Method to create a table (v2) using the TableV2 construct
|
|
51
51
|
* @param id scoped id of the resource
|
|
52
52
|
* @param scope scope in which this resource is defined
|
|
53
53
|
* @param props table props
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
|
|
2
2
|
import { TagProps } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
|
+
* Props for creating a DynamoDB table (v1) with optional tags.
|
|
5
|
+
* @see {@link DynamodbManager.createTable}
|
|
4
6
|
*/
|
|
5
7
|
/** @category Interface */
|
|
6
8
|
export interface TableProps extends dynamodb.TableProps {
|
|
9
|
+
/** Optional tags to apply to the table */
|
|
7
10
|
tags?: TagProps[];
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Props for creating a DynamoDB table (v2) with optional tags.
|
|
14
|
+
* @see {@link DynamodbManager.createTableV2}
|
|
15
|
+
*/
|
|
9
16
|
/** @category Interface */
|
|
10
17
|
export interface TablePropsV2 extends dynamodb.TablePropsV2 {
|
|
18
|
+
/** Optional tags to apply to the table */
|
|
11
19
|
tags?: TagProps[];
|
|
12
20
|
}
|
|
@@ -22,7 +22,7 @@ export declare class EcrManager {
|
|
|
22
22
|
* @summary Method to create a docker image in ecr
|
|
23
23
|
* @param id scoped id of the resource
|
|
24
24
|
* @param scope scope in which this resource is defined
|
|
25
|
-
* @param dockerfilePath
|
|
25
|
+
* @param dockerfilePath the path to the directory containing the Dockerfile
|
|
26
26
|
*/
|
|
27
27
|
createDockerImage(id: string, scope: CommonConstruct, dockerfilePath: string): DockerImageAsset;
|
|
28
28
|
}
|
|
@@ -22,7 +22,7 @@ export class EcrManager {
|
|
|
22
22
|
* @summary Method to create a docker image in ecr
|
|
23
23
|
* @param id scoped id of the resource
|
|
24
24
|
* @param scope scope in which this resource is defined
|
|
25
|
-
* @param dockerfilePath
|
|
25
|
+
* @param dockerfilePath the path to the directory containing the Dockerfile
|
|
26
26
|
*/
|
|
27
27
|
createDockerImage(id, scope, dockerfilePath) {
|
|
28
28
|
const asset = new DockerImageAsset(scope, `${id}`, {
|
|
@@ -27,31 +27,31 @@ export declare class EcsManager {
|
|
|
27
27
|
* @summary Method to create an ecs cluster
|
|
28
28
|
* @param id scoped id of the resource
|
|
29
29
|
* @param scope scope in which this resource is defined
|
|
30
|
-
* @param props
|
|
31
|
-
* @param vpc
|
|
30
|
+
* @param props the ECS cluster properties
|
|
31
|
+
* @param vpc the VPC in which the cluster will be created
|
|
32
32
|
*/
|
|
33
33
|
createEcsCluster(id: string, scope: CommonConstruct, props: EcsClusterProps, vpc: IVpc): Cluster;
|
|
34
34
|
/**
|
|
35
35
|
* @summary Method to create an ecs fargate task
|
|
36
36
|
* @param id scoped id of the resource
|
|
37
37
|
* @param scope scope in which this resource is defined
|
|
38
|
-
* @param props
|
|
39
|
-
* @param cluster
|
|
40
|
-
* @param role
|
|
41
|
-
* @param logGroup
|
|
42
|
-
* @param containerImage
|
|
43
|
-
* @param environment
|
|
44
|
-
* @param secrets
|
|
45
|
-
* @param command
|
|
38
|
+
* @param props the ECS task definition properties
|
|
39
|
+
* @param cluster the ECS cluster to associate with the task
|
|
40
|
+
* @param role the IAM role for task execution and task role
|
|
41
|
+
* @param logGroup the CloudWatch log group for container logging
|
|
42
|
+
* @param containerImage the container image to use for the task
|
|
43
|
+
* @param environment optional environment variables for the container
|
|
44
|
+
* @param secrets optional secret values to inject into the container
|
|
45
|
+
* @param command optional command to override the container entrypoint
|
|
46
46
|
*/
|
|
47
47
|
createEcsFargateTask(id: string, scope: CommonConstruct, props: EcsTaskProps, cluster: ICluster, role: Role, logGroup: ILogGroup, containerImage: ContainerImage, environment?: any, secrets?: any, command?: string[]): TaskDefinition;
|
|
48
48
|
/**
|
|
49
49
|
* @summary Method to create an application load balanced ecs fargate task
|
|
50
50
|
* @param id scoped id of the resource
|
|
51
51
|
* @param scope scope in which this resource is defined
|
|
52
|
-
* @param props
|
|
53
|
-
* @param cluster
|
|
54
|
-
* @param logGroup
|
|
52
|
+
* @param props the Application Load Balanced Fargate service properties
|
|
53
|
+
* @param cluster the ECS cluster to deploy the service into
|
|
54
|
+
* @param logGroup the CloudWatch log group for container logging
|
|
55
55
|
*/
|
|
56
56
|
createLoadBalancedFargateService(id: string, scope: CommonConstruct, props: EcsApplicationLoadBalancedFargateServiceProps, cluster: ICluster, logGroup: ILogGroup): ApplicationLoadBalancedFargateService;
|
|
57
57
|
}
|
|
@@ -25,8 +25,8 @@ export class EcsManager {
|
|
|
25
25
|
* @summary Method to create an ecs cluster
|
|
26
26
|
* @param id scoped id of the resource
|
|
27
27
|
* @param scope scope in which this resource is defined
|
|
28
|
-
* @param props
|
|
29
|
-
* @param vpc
|
|
28
|
+
* @param props the ECS cluster properties
|
|
29
|
+
* @param vpc the VPC in which the cluster will be created
|
|
30
30
|
*/
|
|
31
31
|
createEcsCluster(id, scope, props, vpc) {
|
|
32
32
|
if (!props)
|
|
@@ -49,18 +49,19 @@ export class EcsManager {
|
|
|
49
49
|
* @summary Method to create an ecs fargate task
|
|
50
50
|
* @param id scoped id of the resource
|
|
51
51
|
* @param scope scope in which this resource is defined
|
|
52
|
-
* @param props
|
|
53
|
-
* @param cluster
|
|
54
|
-
* @param role
|
|
55
|
-
* @param logGroup
|
|
56
|
-
* @param containerImage
|
|
57
|
-
* @param environment
|
|
58
|
-
* @param secrets
|
|
59
|
-
* @param command
|
|
52
|
+
* @param props the ECS task definition properties
|
|
53
|
+
* @param cluster the ECS cluster to associate with the task
|
|
54
|
+
* @param role the IAM role for task execution and task role
|
|
55
|
+
* @param logGroup the CloudWatch log group for container logging
|
|
56
|
+
* @param containerImage the container image to use for the task
|
|
57
|
+
* @param environment optional environment variables for the container
|
|
58
|
+
* @param secrets optional secret values to inject into the container
|
|
59
|
+
* @param command optional command to override the container entrypoint
|
|
60
60
|
*/
|
|
61
61
|
createEcsFargateTask(id, scope, props, cluster, role, logGroup, containerImage, environment, secrets, command) {
|
|
62
62
|
if (!props)
|
|
63
63
|
throw new Error(`EcsTask props undefined for ${id}`);
|
|
64
|
+
/* Create a Fargate-compatible task definition with AWS VPC networking */
|
|
64
65
|
const ecsTask = new TaskDefinition(scope, `${id}`, {
|
|
65
66
|
...props,
|
|
66
67
|
compatibility: Compatibility.FARGATE,
|
|
@@ -73,6 +74,7 @@ export class EcsManager {
|
|
|
73
74
|
},
|
|
74
75
|
taskRole: role,
|
|
75
76
|
});
|
|
77
|
+
/* Add the primary container to the task definition with logging and resource limits */
|
|
76
78
|
ecsTask.addContainer('EcsContainer', {
|
|
77
79
|
command,
|
|
78
80
|
cpu: props.cpu ? parseInt(props.cpu) : undefined,
|
|
@@ -101,9 +103,9 @@ export class EcsManager {
|
|
|
101
103
|
* @summary Method to create an application load balanced ecs fargate task
|
|
102
104
|
* @param id scoped id of the resource
|
|
103
105
|
* @param scope scope in which this resource is defined
|
|
104
|
-
* @param props
|
|
105
|
-
* @param cluster
|
|
106
|
-
* @param logGroup
|
|
106
|
+
* @param props the Application Load Balanced Fargate service properties
|
|
107
|
+
* @param cluster the ECS cluster to deploy the service into
|
|
108
|
+
* @param logGroup the CloudWatch log group for container logging
|
|
107
109
|
*/
|
|
108
110
|
createLoadBalancedFargateService(id, scope, props, cluster, logGroup) {
|
|
109
111
|
if (!props)
|
|
@@ -138,6 +140,7 @@ export class EcsManager {
|
|
|
138
140
|
}),
|
|
139
141
|
},
|
|
140
142
|
});
|
|
143
|
+
/* Configure target group health check if specified, converting seconds to Duration */
|
|
141
144
|
if (props.healthCheck) {
|
|
142
145
|
fargateService.targetGroup.configureHealthCheck({
|
|
143
146
|
...props.healthCheck,
|