ec2-instance-running-scheduler 0.4.6 → 0.5.1
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/.editorconfig +12 -0
- package/.jsii +562 -118
- package/API.md +613 -54
- package/README.md +46 -64
- package/assets/funcs/running-scheduler.lambda/index.js +668 -335
- package/assets/funcs/running-scheduler.lambda/index.js.map +4 -4
- package/lib/constructs/ec2-instance-running-scheduler.d.ts +5 -4
- package/lib/constructs/ec2-instance-running-scheduler.js +8 -4
- package/lib/constructs/lambda-failure-detector/lambda-failure-detection.d.ts +26 -0
- package/lib/constructs/lambda-failure-detector/lambda-failure-detection.js +9 -0
- package/lib/constructs/lambda-failure-detector/lambda-failure-detector.d.ts +99 -0
- package/lib/constructs/lambda-failure-detector/lambda-failure-detector.js +172 -0
- package/lib/constructs/lambda-failure-detector/log-failure-filter.d.ts +22 -0
- package/lib/constructs/lambda-failure-detector/log-failure-filter.js +3 -0
- package/lib/constructs/running-scheduler-failure-detection.d.ts +21 -36
- package/lib/constructs/running-scheduler-failure-detection.js +54 -132
- package/lib/funcs/running-scheduler-wait-env.js +5 -5
- package/lib/funcs/running-scheduler.lambda.js +4 -3
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -2
- package/lib/stacks/ec2-instance-running-schedule-stack.d.ts +3 -3
- package/lib/stacks/ec2-instance-running-schedule-stack.js +3 -3
- package/package.json +7 -6
package/API.md
CHANGED
|
@@ -29,7 +29,7 @@ new EC2InstanceRunningScheduler(scope: Construct, id: string, props: EC2Instance
|
|
|
29
29
|
| --- | --- | --- |
|
|
30
30
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | - Parent construct. |
|
|
31
31
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.id">id</a></code> | <code>string</code> | - Construct id. |
|
|
32
|
-
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.props">props</a></code> | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps">EC2InstanceRunningSchedulerProps</a></code> | - Target tags, schedules, Slack secret, schedule enable flag, optional {@link ResourceWaitLimits}, {@link RunningSchedulerRuntimeProps}, {@link RunningSchedulerDurableProps}, {@link RunningSchedulerLogGroupProps}, and optional {@link
|
|
32
|
+
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.props">props</a></code> | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps">EC2InstanceRunningSchedulerProps</a></code> | - Target tags, schedules, Slack secret, schedule enable flag, optional {@link ResourceWaitLimits}, {@link RunningSchedulerRuntimeProps}, {@link RunningSchedulerDurableProps}, {@link RunningSchedulerLogGroupProps}, and optional {@link RunningSchedulerFailureDetectionProps}. |
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
@@ -53,7 +53,7 @@ Construct id.
|
|
|
53
53
|
|
|
54
54
|
- *Type:* <a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps">EC2InstanceRunningSchedulerProps</a>
|
|
55
55
|
|
|
56
|
-
Target tags, schedules, Slack secret, schedule enable flag, optional {@link ResourceWaitLimits}, {@link RunningSchedulerRuntimeProps}, {@link RunningSchedulerDurableProps}, {@link RunningSchedulerLogGroupProps}, and optional {@link
|
|
56
|
+
Target tags, schedules, Slack secret, schedule enable flag, optional {@link ResourceWaitLimits}, {@link RunningSchedulerRuntimeProps}, {@link RunningSchedulerDurableProps}, {@link RunningSchedulerLogGroupProps}, and optional {@link RunningSchedulerFailureDetectionProps}.
|
|
57
57
|
|
|
58
58
|
---
|
|
59
59
|
|
|
@@ -174,7 +174,7 @@ Failure detection alarms, when {@link EC2InstanceRunningSchedulerProps.failureDe
|
|
|
174
174
|
CDK stack that deploys the EC2 instance running scheduler (EventBridge Scheduler + Durable Lambda).
|
|
175
175
|
|
|
176
176
|
Wires {@link EC2InstanceRunningScheduler} with targeting, schedules, secrets, scheduling toggle,
|
|
177
|
-
and optional {@link
|
|
177
|
+
and optional {@link RunningSchedulerFailureDetectionProps}. Does not expose {@link ResourceWaitLimits },
|
|
178
178
|
{@link RunningSchedulerRuntimeProps }, {@link RunningSchedulerDurableProps }, or
|
|
179
179
|
{@link RunningSchedulerLogGroupProps }; use the construct directly when custom runtime,
|
|
180
180
|
wait, durable, or log group settings are required.
|
|
@@ -1132,11 +1132,216 @@ Whether termination protection is enabled for this stack.
|
|
|
1132
1132
|
---
|
|
1133
1133
|
|
|
1134
1134
|
|
|
1135
|
+
### LambdaFailureDetector <a name="LambdaFailureDetector" id="ec2-instance-running-scheduler.LambdaFailureDetector"></a>
|
|
1136
|
+
|
|
1137
|
+
CloudWatch failure detection for a Lambda function.
|
|
1138
|
+
|
|
1139
|
+
Always creates a platform `AWS/Lambda` `Errors` alarm. Optionally creates one
|
|
1140
|
+
metric filter + alarm per {@link LogFailureFilter}. Does not create an SNS topic;
|
|
1141
|
+
pass {@link LambdaFailureDetectorProps.alarmTopic} to attach notifications.
|
|
1142
|
+
|
|
1143
|
+
Entry module for `lambda-failure-detector/`: import types and helpers from this file only.
|
|
1144
|
+
|
|
1145
|
+
#### Initializers <a name="Initializers" id="ec2-instance-running-scheduler.LambdaFailureDetector.Initializer"></a>
|
|
1146
|
+
|
|
1147
|
+
```typescript
|
|
1148
|
+
import { LambdaFailureDetector } from 'ec2-instance-running-scheduler'
|
|
1149
|
+
|
|
1150
|
+
new LambdaFailureDetector(scope: Construct, id: string, props: LambdaFailureDetectorProps)
|
|
1151
|
+
```
|
|
1152
|
+
|
|
1153
|
+
| **Name** | **Type** | **Description** |
|
|
1154
|
+
| --- | --- | --- |
|
|
1155
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | - Parent construct. |
|
|
1156
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.Initializer.parameter.id">id</a></code> | <code>string</code> | - Construct id. |
|
|
1157
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.Initializer.parameter.props">props</a></code> | <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetectorProps">LambdaFailureDetectorProps</a></code> | - Lambda, log group, optional topic, and log filters. |
|
|
1158
|
+
|
|
1159
|
+
---
|
|
1160
|
+
|
|
1161
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="ec2-instance-running-scheduler.LambdaFailureDetector.Initializer.parameter.scope"></a>
|
|
1162
|
+
|
|
1163
|
+
- *Type:* constructs.Construct
|
|
1164
|
+
|
|
1165
|
+
Parent construct.
|
|
1166
|
+
|
|
1167
|
+
---
|
|
1168
|
+
|
|
1169
|
+
##### `id`<sup>Required</sup> <a name="id" id="ec2-instance-running-scheduler.LambdaFailureDetector.Initializer.parameter.id"></a>
|
|
1170
|
+
|
|
1171
|
+
- *Type:* string
|
|
1172
|
+
|
|
1173
|
+
Construct id.
|
|
1174
|
+
|
|
1175
|
+
---
|
|
1176
|
+
|
|
1177
|
+
##### `props`<sup>Required</sup> <a name="props" id="ec2-instance-running-scheduler.LambdaFailureDetector.Initializer.parameter.props"></a>
|
|
1178
|
+
|
|
1179
|
+
- *Type:* <a href="#ec2-instance-running-scheduler.LambdaFailureDetectorProps">LambdaFailureDetectorProps</a>
|
|
1180
|
+
|
|
1181
|
+
Lambda, log group, optional topic, and log filters.
|
|
1182
|
+
|
|
1183
|
+
---
|
|
1184
|
+
|
|
1185
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
1186
|
+
|
|
1187
|
+
| **Name** | **Description** |
|
|
1188
|
+
| --- | --- |
|
|
1189
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
1190
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.with">with</a></code> | Applies one or more mixins to this construct. |
|
|
1191
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.findLogFilterAlarm">findLogFilterAlarm</a></code> | Returns the log-filter alarm for the given filter id, or undefined when missing. |
|
|
1192
|
+
|
|
1193
|
+
---
|
|
1194
|
+
|
|
1195
|
+
##### `toString` <a name="toString" id="ec2-instance-running-scheduler.LambdaFailureDetector.toString"></a>
|
|
1196
|
+
|
|
1197
|
+
```typescript
|
|
1198
|
+
public toString(): string
|
|
1199
|
+
```
|
|
1200
|
+
|
|
1201
|
+
Returns a string representation of this construct.
|
|
1202
|
+
|
|
1203
|
+
##### `with` <a name="with" id="ec2-instance-running-scheduler.LambdaFailureDetector.with"></a>
|
|
1204
|
+
|
|
1205
|
+
```typescript
|
|
1206
|
+
public with(mixins: ...IMixin[]): IConstruct
|
|
1207
|
+
```
|
|
1208
|
+
|
|
1209
|
+
Applies one or more mixins to this construct.
|
|
1210
|
+
|
|
1211
|
+
Mixins are applied in order. The list of constructs is captured at the
|
|
1212
|
+
start of the call, so constructs added by a mixin will not be visited.
|
|
1213
|
+
Use multiple `with()` calls if subsequent mixins should apply to added
|
|
1214
|
+
constructs.
|
|
1215
|
+
|
|
1216
|
+
###### `mixins`<sup>Required</sup> <a name="mixins" id="ec2-instance-running-scheduler.LambdaFailureDetector.with.parameter.mixins"></a>
|
|
1217
|
+
|
|
1218
|
+
- *Type:* ...constructs.IMixin[]
|
|
1219
|
+
|
|
1220
|
+
The mixins to apply.
|
|
1221
|
+
|
|
1222
|
+
---
|
|
1223
|
+
|
|
1224
|
+
##### `findLogFilterAlarm` <a name="findLogFilterAlarm" id="ec2-instance-running-scheduler.LambdaFailureDetector.findLogFilterAlarm"></a>
|
|
1225
|
+
|
|
1226
|
+
```typescript
|
|
1227
|
+
public findLogFilterAlarm(id: string): Alarm
|
|
1228
|
+
```
|
|
1229
|
+
|
|
1230
|
+
Returns the log-filter alarm for the given filter id, or undefined when missing.
|
|
1231
|
+
|
|
1232
|
+
###### `id`<sup>Required</sup> <a name="id" id="ec2-instance-running-scheduler.LambdaFailureDetector.findLogFilterAlarm.parameter.id"></a>
|
|
1233
|
+
|
|
1234
|
+
- *Type:* string
|
|
1235
|
+
|
|
1236
|
+
Same as {@link LogFailureFilter.id}.
|
|
1237
|
+
|
|
1238
|
+
---
|
|
1239
|
+
|
|
1240
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
1241
|
+
|
|
1242
|
+
| **Name** | **Description** |
|
|
1243
|
+
| --- | --- |
|
|
1244
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
1245
|
+
|
|
1246
|
+
---
|
|
1247
|
+
|
|
1248
|
+
##### `isConstruct` <a name="isConstruct" id="ec2-instance-running-scheduler.LambdaFailureDetector.isConstruct"></a>
|
|
1249
|
+
|
|
1250
|
+
```typescript
|
|
1251
|
+
import { LambdaFailureDetector } from 'ec2-instance-running-scheduler'
|
|
1252
|
+
|
|
1253
|
+
LambdaFailureDetector.isConstruct(x: any)
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
Checks if `x` is a construct.
|
|
1257
|
+
|
|
1258
|
+
Use this method instead of `instanceof` to properly detect `Construct`
|
|
1259
|
+
instances, even when the construct library is symlinked.
|
|
1260
|
+
|
|
1261
|
+
Explanation: in JavaScript, multiple copies of the `constructs` library on
|
|
1262
|
+
disk are seen as independent, completely different libraries. As a
|
|
1263
|
+
consequence, the class `Construct` in each copy of the `constructs` library
|
|
1264
|
+
is seen as a different class, and an instance of one class will not test as
|
|
1265
|
+
`instanceof` the other class. `npm install` will not create installations
|
|
1266
|
+
like this, but users may manually symlink construct libraries together or
|
|
1267
|
+
use a monorepo tool: in those cases, multiple copies of the `constructs`
|
|
1268
|
+
library can be accidentally installed, and `instanceof` will behave
|
|
1269
|
+
unpredictably. It is safest to avoid using `instanceof`, and using
|
|
1270
|
+
this type-testing method instead.
|
|
1271
|
+
|
|
1272
|
+
###### `x`<sup>Required</sup> <a name="x" id="ec2-instance-running-scheduler.LambdaFailureDetector.isConstruct.parameter.x"></a>
|
|
1273
|
+
|
|
1274
|
+
- *Type:* any
|
|
1275
|
+
|
|
1276
|
+
Any object.
|
|
1277
|
+
|
|
1278
|
+
---
|
|
1279
|
+
|
|
1280
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
1281
|
+
|
|
1282
|
+
| **Name** | **Type** | **Description** |
|
|
1283
|
+
| --- | --- | --- |
|
|
1284
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
1285
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.property.lambdaErrorsAlarm">lambdaErrorsAlarm</a></code> | <code>aws-cdk-lib.aws_cloudwatch.Alarm</code> | Fires when the Lambda `Errors` metric is non-zero. |
|
|
1286
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.property.logFilterAlarms">logFilterAlarms</a></code> | <code><a href="#ec2-instance-running-scheduler.LogFailureAlarm">LogFailureAlarm</a>[]</code> | Alarms for each log filter, in the same order as {@link LambdaFailureDetectorProps.logFilters}. |
|
|
1287
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetector.property.alarmTopic">alarmTopic</a></code> | <code>aws-cdk-lib.aws_sns.ITopic</code> | SNS topic used for alarm actions, when configured. |
|
|
1288
|
+
|
|
1289
|
+
---
|
|
1290
|
+
|
|
1291
|
+
##### `node`<sup>Required</sup> <a name="node" id="ec2-instance-running-scheduler.LambdaFailureDetector.property.node"></a>
|
|
1292
|
+
|
|
1293
|
+
```typescript
|
|
1294
|
+
public readonly node: Node;
|
|
1295
|
+
```
|
|
1296
|
+
|
|
1297
|
+
- *Type:* constructs.Node
|
|
1298
|
+
|
|
1299
|
+
The tree node.
|
|
1300
|
+
|
|
1301
|
+
---
|
|
1302
|
+
|
|
1303
|
+
##### `lambdaErrorsAlarm`<sup>Required</sup> <a name="lambdaErrorsAlarm" id="ec2-instance-running-scheduler.LambdaFailureDetector.property.lambdaErrorsAlarm"></a>
|
|
1304
|
+
|
|
1305
|
+
```typescript
|
|
1306
|
+
public readonly lambdaErrorsAlarm: Alarm;
|
|
1307
|
+
```
|
|
1308
|
+
|
|
1309
|
+
- *Type:* aws-cdk-lib.aws_cloudwatch.Alarm
|
|
1310
|
+
|
|
1311
|
+
Fires when the Lambda `Errors` metric is non-zero.
|
|
1312
|
+
|
|
1313
|
+
---
|
|
1314
|
+
|
|
1315
|
+
##### `logFilterAlarms`<sup>Required</sup> <a name="logFilterAlarms" id="ec2-instance-running-scheduler.LambdaFailureDetector.property.logFilterAlarms"></a>
|
|
1316
|
+
|
|
1317
|
+
```typescript
|
|
1318
|
+
public readonly logFilterAlarms: LogFailureAlarm[];
|
|
1319
|
+
```
|
|
1320
|
+
|
|
1321
|
+
- *Type:* <a href="#ec2-instance-running-scheduler.LogFailureAlarm">LogFailureAlarm</a>[]
|
|
1322
|
+
|
|
1323
|
+
Alarms for each log filter, in the same order as {@link LambdaFailureDetectorProps.logFilters}.
|
|
1324
|
+
|
|
1325
|
+
---
|
|
1326
|
+
|
|
1327
|
+
##### `alarmTopic`<sup>Optional</sup> <a name="alarmTopic" id="ec2-instance-running-scheduler.LambdaFailureDetector.property.alarmTopic"></a>
|
|
1328
|
+
|
|
1329
|
+
```typescript
|
|
1330
|
+
public readonly alarmTopic: ITopic;
|
|
1331
|
+
```
|
|
1332
|
+
|
|
1333
|
+
- *Type:* aws-cdk-lib.aws_sns.ITopic
|
|
1334
|
+
|
|
1335
|
+
SNS topic used for alarm actions, when configured.
|
|
1336
|
+
|
|
1337
|
+
---
|
|
1338
|
+
|
|
1339
|
+
|
|
1135
1340
|
### RunningSchedulerFailureDetection <a name="RunningSchedulerFailureDetection" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetection"></a>
|
|
1136
1341
|
|
|
1137
|
-
CloudWatch alarms and log-based metrics for the running scheduler
|
|
1342
|
+
CloudWatch alarms and log-based metrics for the EC2 instance running scheduler.
|
|
1138
1343
|
|
|
1139
|
-
|
|
1344
|
+
Extends {@link LambdaFailureDetector} with scheduler-specific log filters:
|
|
1140
1345
|
- `lambdaErrorsAlarm` – `AWS/Lambda` `Errors` metric.
|
|
1141
1346
|
- `instanceStatusFailureAlarm` – log filter for `ResourceWaitFailed:*`.
|
|
1142
1347
|
- `slackPostFailureAlarm` – log filter for `running-scheduler: Slack post failed`.
|
|
@@ -1149,14 +1354,14 @@ Custom metrics are published under the `EC2InstanceRunningScheduler` namespace.
|
|
|
1149
1354
|
```typescript
|
|
1150
1355
|
import { RunningSchedulerFailureDetection } from 'ec2-instance-running-scheduler'
|
|
1151
1356
|
|
|
1152
|
-
new RunningSchedulerFailureDetection(scope: Construct, id: string, props:
|
|
1357
|
+
new RunningSchedulerFailureDetection(scope: Construct, id: string, props: RunningSchedulerFailureDetectionResourcesProps)
|
|
1153
1358
|
```
|
|
1154
1359
|
|
|
1155
1360
|
| **Name** | **Type** | **Description** |
|
|
1156
1361
|
| --- | --- | --- |
|
|
1157
1362
|
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | - Parent construct. |
|
|
1158
1363
|
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.Initializer.parameter.id">id</a></code> | <code>string</code> | - Construct id. |
|
|
1159
|
-
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.Initializer.parameter.props">props</a></code> | <code><a href="#ec2-instance-running-scheduler.
|
|
1364
|
+
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.Initializer.parameter.props">props</a></code> | <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps">RunningSchedulerFailureDetectionResourcesProps</a></code> | - Lambda, log group, and optional alarm notification topic. |
|
|
1160
1365
|
|
|
1161
1366
|
---
|
|
1162
1367
|
|
|
@@ -1178,9 +1383,9 @@ Construct id.
|
|
|
1178
1383
|
|
|
1179
1384
|
##### `props`<sup>Required</sup> <a name="props" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetection.Initializer.parameter.props"></a>
|
|
1180
1385
|
|
|
1181
|
-
- *Type:* <a href="#ec2-instance-running-scheduler.
|
|
1386
|
+
- *Type:* <a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps">RunningSchedulerFailureDetectionResourcesProps</a>
|
|
1182
1387
|
|
|
1183
|
-
Lambda, log group, and
|
|
1388
|
+
Lambda, log group, and optional alarm notification topic.
|
|
1184
1389
|
|
|
1185
1390
|
---
|
|
1186
1391
|
|
|
@@ -1190,6 +1395,7 @@ Lambda, log group, and {@link FailureDetectionAlarms} (must have `enabled: true`
|
|
|
1190
1395
|
| --- | --- |
|
|
1191
1396
|
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
1192
1397
|
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.with">with</a></code> | Applies one or more mixins to this construct. |
|
|
1398
|
+
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.findLogFilterAlarm">findLogFilterAlarm</a></code> | Returns the log-filter alarm for the given filter id, or undefined when missing. |
|
|
1193
1399
|
|
|
1194
1400
|
---
|
|
1195
1401
|
|
|
@@ -1222,6 +1428,22 @@ The mixins to apply.
|
|
|
1222
1428
|
|
|
1223
1429
|
---
|
|
1224
1430
|
|
|
1431
|
+
##### `findLogFilterAlarm` <a name="findLogFilterAlarm" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetection.findLogFilterAlarm"></a>
|
|
1432
|
+
|
|
1433
|
+
```typescript
|
|
1434
|
+
public findLogFilterAlarm(id: string): Alarm
|
|
1435
|
+
```
|
|
1436
|
+
|
|
1437
|
+
Returns the log-filter alarm for the given filter id, or undefined when missing.
|
|
1438
|
+
|
|
1439
|
+
###### `id`<sup>Required</sup> <a name="id" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetection.findLogFilterAlarm.parameter.id"></a>
|
|
1440
|
+
|
|
1441
|
+
- *Type:* string
|
|
1442
|
+
|
|
1443
|
+
Same as {@link LogFailureFilter.id}.
|
|
1444
|
+
|
|
1445
|
+
---
|
|
1446
|
+
|
|
1225
1447
|
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
1226
1448
|
|
|
1227
1449
|
| **Name** | **Description** |
|
|
@@ -1267,11 +1489,12 @@ Any object.
|
|
|
1267
1489
|
| **Name** | **Type** | **Description** |
|
|
1268
1490
|
| --- | --- | --- |
|
|
1269
1491
|
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
1492
|
+
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.lambdaErrorsAlarm">lambdaErrorsAlarm</a></code> | <code>aws-cdk-lib.aws_cloudwatch.Alarm</code> | Fires when the Lambda `Errors` metric is non-zero. |
|
|
1493
|
+
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.logFilterAlarms">logFilterAlarms</a></code> | <code><a href="#ec2-instance-running-scheduler.LogFailureAlarm">LogFailureAlarm</a>[]</code> | Alarms for each log filter, in the same order as {@link LambdaFailureDetectorProps.logFilters}. |
|
|
1494
|
+
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.alarmTopic">alarmTopic</a></code> | <code>aws-cdk-lib.aws_sns.ITopic</code> | SNS topic used for alarm actions, when configured. |
|
|
1270
1495
|
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.durableExecutionFailureAlarm">durableExecutionFailureAlarm</a></code> | <code>aws-cdk-lib.aws_cloudwatch.Alarm</code> | Fires on handler-level ERROR logs outside instance waiting and Slack post failures. |
|
|
1271
1496
|
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.instanceStatusFailureAlarm">instanceStatusFailureAlarm</a></code> | <code>aws-cdk-lib.aws_cloudwatch.Alarm</code> | Fires when instance stable-state waiting fails (`ResourceWaitFailed:*`). |
|
|
1272
|
-
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.lambdaErrorsAlarm">lambdaErrorsAlarm</a></code> | <code>aws-cdk-lib.aws_cloudwatch.Alarm</code> | Fires when the Lambda `Errors` metric is non-zero. |
|
|
1273
1497
|
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.slackPostFailureAlarm">slackPostFailureAlarm</a></code> | <code>aws-cdk-lib.aws_cloudwatch.Alarm</code> | Fires when Slack `chat.postMessage` fails. |
|
|
1274
|
-
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.alarmTopic">alarmTopic</a></code> | <code>aws-cdk-lib.aws_sns.ITopic</code> | SNS topic used for alarm actions, when configured. |
|
|
1275
1498
|
|
|
1276
1499
|
---
|
|
1277
1500
|
|
|
@@ -1287,6 +1510,42 @@ The tree node.
|
|
|
1287
1510
|
|
|
1288
1511
|
---
|
|
1289
1512
|
|
|
1513
|
+
##### `lambdaErrorsAlarm`<sup>Required</sup> <a name="lambdaErrorsAlarm" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.lambdaErrorsAlarm"></a>
|
|
1514
|
+
|
|
1515
|
+
```typescript
|
|
1516
|
+
public readonly lambdaErrorsAlarm: Alarm;
|
|
1517
|
+
```
|
|
1518
|
+
|
|
1519
|
+
- *Type:* aws-cdk-lib.aws_cloudwatch.Alarm
|
|
1520
|
+
|
|
1521
|
+
Fires when the Lambda `Errors` metric is non-zero.
|
|
1522
|
+
|
|
1523
|
+
---
|
|
1524
|
+
|
|
1525
|
+
##### `logFilterAlarms`<sup>Required</sup> <a name="logFilterAlarms" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.logFilterAlarms"></a>
|
|
1526
|
+
|
|
1527
|
+
```typescript
|
|
1528
|
+
public readonly logFilterAlarms: LogFailureAlarm[];
|
|
1529
|
+
```
|
|
1530
|
+
|
|
1531
|
+
- *Type:* <a href="#ec2-instance-running-scheduler.LogFailureAlarm">LogFailureAlarm</a>[]
|
|
1532
|
+
|
|
1533
|
+
Alarms for each log filter, in the same order as {@link LambdaFailureDetectorProps.logFilters}.
|
|
1534
|
+
|
|
1535
|
+
---
|
|
1536
|
+
|
|
1537
|
+
##### `alarmTopic`<sup>Optional</sup> <a name="alarmTopic" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.alarmTopic"></a>
|
|
1538
|
+
|
|
1539
|
+
```typescript
|
|
1540
|
+
public readonly alarmTopic: ITopic;
|
|
1541
|
+
```
|
|
1542
|
+
|
|
1543
|
+
- *Type:* aws-cdk-lib.aws_sns.ITopic
|
|
1544
|
+
|
|
1545
|
+
SNS topic used for alarm actions, when configured.
|
|
1546
|
+
|
|
1547
|
+
---
|
|
1548
|
+
|
|
1290
1549
|
##### `durableExecutionFailureAlarm`<sup>Required</sup> <a name="durableExecutionFailureAlarm" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.durableExecutionFailureAlarm"></a>
|
|
1291
1550
|
|
|
1292
1551
|
```typescript
|
|
@@ -1311,44 +1570,94 @@ Fires when instance stable-state waiting fails (`ResourceWaitFailed:*`).
|
|
|
1311
1570
|
|
|
1312
1571
|
---
|
|
1313
1572
|
|
|
1314
|
-
##### `
|
|
1573
|
+
##### `slackPostFailureAlarm`<sup>Required</sup> <a name="slackPostFailureAlarm" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetection.property.slackPostFailureAlarm"></a>
|
|
1315
1574
|
|
|
1316
1575
|
```typescript
|
|
1317
|
-
public readonly
|
|
1576
|
+
public readonly slackPostFailureAlarm: Alarm;
|
|
1318
1577
|
```
|
|
1319
1578
|
|
|
1320
1579
|
- *Type:* aws-cdk-lib.aws_cloudwatch.Alarm
|
|
1321
1580
|
|
|
1322
|
-
Fires when
|
|
1581
|
+
Fires when Slack `chat.postMessage` fails.
|
|
1323
1582
|
|
|
1324
1583
|
---
|
|
1325
1584
|
|
|
1326
|
-
|
|
1585
|
+
|
|
1586
|
+
## Structs <a name="Structs" id="Structs"></a>
|
|
1587
|
+
|
|
1588
|
+
### CreateLambdaFailureDetectorProps <a name="CreateLambdaFailureDetectorProps" id="ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps"></a>
|
|
1589
|
+
|
|
1590
|
+
Props accepted by {@link createLambdaFailureDetector}.
|
|
1591
|
+
|
|
1592
|
+
#### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps.Initializer"></a>
|
|
1327
1593
|
|
|
1328
1594
|
```typescript
|
|
1329
|
-
|
|
1595
|
+
import { CreateLambdaFailureDetectorProps } from 'ec2-instance-running-scheduler'
|
|
1596
|
+
|
|
1597
|
+
const createLambdaFailureDetectorProps: CreateLambdaFailureDetectorProps = { ... }
|
|
1330
1598
|
```
|
|
1331
1599
|
|
|
1332
|
-
|
|
1600
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
1333
1601
|
|
|
1334
|
-
|
|
1602
|
+
| **Name** | **Type** | **Description** |
|
|
1603
|
+
| --- | --- | --- |
|
|
1604
|
+
| <code><a href="#ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps.property.lambdaFunction">lambdaFunction</a></code> | <code>aws-cdk-lib.aws_lambda.IFunction</code> | Lambda function to monitor. |
|
|
1605
|
+
| <code><a href="#ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps.property.logGroup">logGroup</a></code> | <code>aws-cdk-lib.aws_logs.ILogGroup</code> | Application log group for log-based filters. |
|
|
1606
|
+
| <code><a href="#ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps.property.failureDetection">failureDetection</a></code> | <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetection">LambdaFailureDetection</a></code> | Opt-in options; |
|
|
1607
|
+
| <code><a href="#ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps.property.logFilters">logFilters</a></code> | <code><a href="#ec2-instance-running-scheduler.LogFailureFilter">LogFailureFilter</a>[]</code> | Log-based failure filters. |
|
|
1335
1608
|
|
|
1336
1609
|
---
|
|
1337
1610
|
|
|
1338
|
-
##### `
|
|
1611
|
+
##### `lambdaFunction`<sup>Required</sup> <a name="lambdaFunction" id="ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps.property.lambdaFunction"></a>
|
|
1339
1612
|
|
|
1340
1613
|
```typescript
|
|
1341
|
-
public readonly
|
|
1614
|
+
public readonly lambdaFunction: IFunction;
|
|
1342
1615
|
```
|
|
1343
1616
|
|
|
1344
|
-
- *Type:* aws-cdk-lib.
|
|
1617
|
+
- *Type:* aws-cdk-lib.aws_lambda.IFunction
|
|
1345
1618
|
|
|
1346
|
-
|
|
1619
|
+
Lambda function to monitor.
|
|
1347
1620
|
|
|
1348
1621
|
---
|
|
1349
1622
|
|
|
1623
|
+
##### `logGroup`<sup>Required</sup> <a name="logGroup" id="ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps.property.logGroup"></a>
|
|
1350
1624
|
|
|
1351
|
-
|
|
1625
|
+
```typescript
|
|
1626
|
+
public readonly logGroup: ILogGroup;
|
|
1627
|
+
```
|
|
1628
|
+
|
|
1629
|
+
- *Type:* aws-cdk-lib.aws_logs.ILogGroup
|
|
1630
|
+
|
|
1631
|
+
Application log group for log-based filters.
|
|
1632
|
+
|
|
1633
|
+
---
|
|
1634
|
+
|
|
1635
|
+
##### `failureDetection`<sup>Optional</sup> <a name="failureDetection" id="ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps.property.failureDetection"></a>
|
|
1636
|
+
|
|
1637
|
+
```typescript
|
|
1638
|
+
public readonly failureDetection: LambdaFailureDetection;
|
|
1639
|
+
```
|
|
1640
|
+
|
|
1641
|
+
- *Type:* <a href="#ec2-instance-running-scheduler.LambdaFailureDetection">LambdaFailureDetection</a>
|
|
1642
|
+
|
|
1643
|
+
Opt-in options;
|
|
1644
|
+
|
|
1645
|
+
alarms are created only when {@link LambdaFailureDetection.enabled} is true.
|
|
1646
|
+
|
|
1647
|
+
---
|
|
1648
|
+
|
|
1649
|
+
##### `logFilters`<sup>Optional</sup> <a name="logFilters" id="ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps.property.logFilters"></a>
|
|
1650
|
+
|
|
1651
|
+
```typescript
|
|
1652
|
+
public readonly logFilters: LogFailureFilter[];
|
|
1653
|
+
```
|
|
1654
|
+
|
|
1655
|
+
- *Type:* <a href="#ec2-instance-running-scheduler.LogFailureFilter">LogFailureFilter</a>[]
|
|
1656
|
+
- *Default:* no log-based alarms
|
|
1657
|
+
|
|
1658
|
+
Log-based failure filters.
|
|
1659
|
+
|
|
1660
|
+
---
|
|
1352
1661
|
|
|
1353
1662
|
### EC2InstanceRunningSchedulerProps <a name="EC2InstanceRunningSchedulerProps" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps"></a>
|
|
1354
1663
|
|
|
@@ -1370,7 +1679,7 @@ const eC2InstanceRunningSchedulerProps: EC2InstanceRunningSchedulerProps = { ...
|
|
|
1370
1679
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.targetResource">targetResource</a></code> | <code><a href="#ec2-instance-running-scheduler.TargetResource">TargetResource</a></code> | Tag-based targeting for EC2 instances to start/stop. |
|
|
1371
1680
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.durable">durable</a></code> | <code><a href="#ec2-instance-running-scheduler.RunningSchedulerDurableProps">RunningSchedulerDurableProps</a></code> | Durable Execution timeout and history retention. |
|
|
1372
1681
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.enableScheduling">enableScheduling</a></code> | <code>boolean</code> | Whether EventBridge Scheduler rules are enabled. |
|
|
1373
|
-
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.failureDetection">failureDetection</a></code> | <code><a href="#ec2-instance-running-scheduler.
|
|
1682
|
+
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.failureDetection">failureDetection</a></code> | <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps">RunningSchedulerFailureDetectionProps</a></code> | Optional CloudWatch alarms and log-based metrics for failure detection. |
|
|
1374
1683
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.logGroup">logGroup</a></code> | <code><a href="#ec2-instance-running-scheduler.RunningSchedulerLogGroupProps">RunningSchedulerLogGroupProps</a></code> | CloudWatch Logs retention and removal policy for the function log group. |
|
|
1375
1684
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.resourceWait">resourceWait</a></code> | <code><a href="#ec2-instance-running-scheduler.ResourceWaitLimits">ResourceWaitLimits</a></code> | Per-instance wait limits for the running scheduler Lambda. |
|
|
1376
1685
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.runtime">runtime</a></code> | <code><a href="#ec2-instance-running-scheduler.RunningSchedulerRuntimeProps">RunningSchedulerRuntimeProps</a></code> | Lambda memory, invoke timeout, and per-invocation instance concurrency. |
|
|
@@ -1433,10 +1742,10 @@ Defaults to true if omitted.
|
|
|
1433
1742
|
##### `failureDetection`<sup>Optional</sup> <a name="failureDetection" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.failureDetection"></a>
|
|
1434
1743
|
|
|
1435
1744
|
```typescript
|
|
1436
|
-
public readonly failureDetection:
|
|
1745
|
+
public readonly failureDetection: RunningSchedulerFailureDetectionProps;
|
|
1437
1746
|
```
|
|
1438
1747
|
|
|
1439
|
-
- *Type:* <a href="#ec2-instance-running-scheduler.
|
|
1748
|
+
- *Type:* <a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps">RunningSchedulerFailureDetectionProps</a>
|
|
1440
1749
|
- *Default:* disabled when omitted
|
|
1441
1750
|
|
|
1442
1751
|
Optional CloudWatch alarms and log-based metrics for failure detection.
|
|
@@ -1543,7 +1852,7 @@ const eC2InstanceRunningScheduleStackProps: EC2InstanceRunningScheduleStackProps
|
|
|
1543
1852
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.secrets">secrets</a></code> | <code><a href="#ec2-instance-running-scheduler.Secrets">Secrets</a></code> | Secrets (e.g. Slack) for the scheduler. |
|
|
1544
1853
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.targetResource">targetResource</a></code> | <code><a href="#ec2-instance-running-scheduler.TargetResource">TargetResource</a></code> | Tag-based target resource for EC2 instances to start/stop. |
|
|
1545
1854
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.enableScheduling">enableScheduling</a></code> | <code>boolean</code> | Whether scheduling is enabled. |
|
|
1546
|
-
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.failureDetection">failureDetection</a></code> | <code><a href="#ec2-instance-running-scheduler.
|
|
1855
|
+
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.failureDetection">failureDetection</a></code> | <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps">RunningSchedulerFailureDetectionProps</a></code> | Optional CloudWatch failure detection alarms and log-based metrics. |
|
|
1547
1856
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.startSchedule">startSchedule</a></code> | <code><a href="#ec2-instance-running-scheduler.Schedule">Schedule</a></code> | Cron schedule for starting instances. |
|
|
1548
1857
|
| <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.stopSchedule">stopSchedule</a></code> | <code><a href="#ec2-instance-running-scheduler.Schedule">Schedule</a></code> | Cron schedule for stopping instances. |
|
|
1549
1858
|
|
|
@@ -1834,10 +2143,10 @@ Defaults to true if omitted.
|
|
|
1834
2143
|
##### `failureDetection`<sup>Optional</sup> <a name="failureDetection" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.failureDetection"></a>
|
|
1835
2144
|
|
|
1836
2145
|
```typescript
|
|
1837
|
-
public readonly failureDetection:
|
|
2146
|
+
public readonly failureDetection: RunningSchedulerFailureDetectionProps;
|
|
1838
2147
|
```
|
|
1839
2148
|
|
|
1840
|
-
- *Type:* <a href="#ec2-instance-running-scheduler.
|
|
2149
|
+
- *Type:* <a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps">RunningSchedulerFailureDetectionProps</a>
|
|
1841
2150
|
|
|
1842
2151
|
Optional CloudWatch failure detection alarms and log-based metrics.
|
|
1843
2152
|
|
|
@@ -1867,32 +2176,32 @@ Cron schedule for stopping instances.
|
|
|
1867
2176
|
|
|
1868
2177
|
---
|
|
1869
2178
|
|
|
1870
|
-
###
|
|
2179
|
+
### LambdaFailureDetection <a name="LambdaFailureDetection" id="ec2-instance-running-scheduler.LambdaFailureDetection"></a>
|
|
1871
2180
|
|
|
1872
|
-
|
|
2181
|
+
Opt-in options for {@link LambdaFailureDetector }.
|
|
1873
2182
|
|
|
1874
|
-
When {@link
|
|
1875
|
-
|
|
1876
|
-
|
|
2183
|
+
When {@link LambdaFailureDetection.enabled} is true, alarms are created.
|
|
2184
|
+
{@link LambdaFailureDetection.alarmTopic} is optional; when omitted, alarms have no SNS actions.
|
|
2185
|
+
The construct never creates an SNS topic.
|
|
1877
2186
|
|
|
1878
|
-
#### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.
|
|
2187
|
+
#### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.LambdaFailureDetection.Initializer"></a>
|
|
1879
2188
|
|
|
1880
2189
|
```typescript
|
|
1881
|
-
import {
|
|
2190
|
+
import { LambdaFailureDetection } from 'ec2-instance-running-scheduler'
|
|
1882
2191
|
|
|
1883
|
-
const
|
|
2192
|
+
const lambdaFailureDetection: LambdaFailureDetection = { ... }
|
|
1884
2193
|
```
|
|
1885
2194
|
|
|
1886
2195
|
#### Properties <a name="Properties" id="Properties"></a>
|
|
1887
2196
|
|
|
1888
2197
|
| **Name** | **Type** | **Description** |
|
|
1889
2198
|
| --- | --- | --- |
|
|
1890
|
-
| <code><a href="#ec2-instance-running-scheduler.
|
|
1891
|
-
| <code><a href="#ec2-instance-running-scheduler.
|
|
2199
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetection.property.alarmTopic">alarmTopic</a></code> | <code>aws-cdk-lib.aws_sns.ITopic</code> | SNS topic for alarm notifications. |
|
|
2200
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetection.property.enabled">enabled</a></code> | <code>boolean</code> | When true, creates failure detection alarms and log-based metrics. |
|
|
1892
2201
|
|
|
1893
2202
|
---
|
|
1894
2203
|
|
|
1895
|
-
##### `alarmTopic`<sup>Optional</sup> <a name="alarmTopic" id="ec2-instance-running-scheduler.
|
|
2204
|
+
##### `alarmTopic`<sup>Optional</sup> <a name="alarmTopic" id="ec2-instance-running-scheduler.LambdaFailureDetection.property.alarmTopic"></a>
|
|
1896
2205
|
|
|
1897
2206
|
```typescript
|
|
1898
2207
|
public readonly alarmTopic: ITopic;
|
|
@@ -1906,7 +2215,7 @@ When omitted, alarms are created without SNS actions.
|
|
|
1906
2215
|
|
|
1907
2216
|
---
|
|
1908
2217
|
|
|
1909
|
-
##### `enabled`<sup>Optional</sup> <a name="enabled" id="ec2-instance-running-scheduler.
|
|
2218
|
+
##### `enabled`<sup>Optional</sup> <a name="enabled" id="ec2-instance-running-scheduler.LambdaFailureDetection.property.enabled"></a>
|
|
1910
2219
|
|
|
1911
2220
|
```typescript
|
|
1912
2221
|
public readonly enabled: boolean;
|
|
@@ -1919,6 +2228,207 @@ When true, creates failure detection alarms and log-based metrics.
|
|
|
1919
2228
|
|
|
1920
2229
|
---
|
|
1921
2230
|
|
|
2231
|
+
### LambdaFailureDetectorProps <a name="LambdaFailureDetectorProps" id="ec2-instance-running-scheduler.LambdaFailureDetectorProps"></a>
|
|
2232
|
+
|
|
2233
|
+
Props for {@link LambdaFailureDetector}.
|
|
2234
|
+
|
|
2235
|
+
#### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.LambdaFailureDetectorProps.Initializer"></a>
|
|
2236
|
+
|
|
2237
|
+
```typescript
|
|
2238
|
+
import { LambdaFailureDetectorProps } from 'ec2-instance-running-scheduler'
|
|
2239
|
+
|
|
2240
|
+
const lambdaFailureDetectorProps: LambdaFailureDetectorProps = { ... }
|
|
2241
|
+
```
|
|
2242
|
+
|
|
2243
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
2244
|
+
|
|
2245
|
+
| **Name** | **Type** | **Description** |
|
|
2246
|
+
| --- | --- | --- |
|
|
2247
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetectorProps.property.lambdaFunction">lambdaFunction</a></code> | <code>aws-cdk-lib.aws_lambda.IFunction</code> | Lambda function whose platform `Errors` metric is alarmed. |
|
|
2248
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetectorProps.property.logGroup">logGroup</a></code> | <code>aws-cdk-lib.aws_logs.ILogGroup</code> | Log group used for {@link LogFailureFilter} metric filters. |
|
|
2249
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetectorProps.property.alarmTopic">alarmTopic</a></code> | <code>aws-cdk-lib.aws_sns.ITopic</code> | Optional SNS topic for all alarm actions. |
|
|
2250
|
+
| <code><a href="#ec2-instance-running-scheduler.LambdaFailureDetectorProps.property.logFilters">logFilters</a></code> | <code><a href="#ec2-instance-running-scheduler.LogFailureFilter">LogFailureFilter</a>[]</code> | Log-based failure filters. |
|
|
2251
|
+
|
|
2252
|
+
---
|
|
2253
|
+
|
|
2254
|
+
##### `lambdaFunction`<sup>Required</sup> <a name="lambdaFunction" id="ec2-instance-running-scheduler.LambdaFailureDetectorProps.property.lambdaFunction"></a>
|
|
2255
|
+
|
|
2256
|
+
```typescript
|
|
2257
|
+
public readonly lambdaFunction: IFunction;
|
|
2258
|
+
```
|
|
2259
|
+
|
|
2260
|
+
- *Type:* aws-cdk-lib.aws_lambda.IFunction
|
|
2261
|
+
|
|
2262
|
+
Lambda function whose platform `Errors` metric is alarmed.
|
|
2263
|
+
|
|
2264
|
+
---
|
|
2265
|
+
|
|
2266
|
+
##### `logGroup`<sup>Required</sup> <a name="logGroup" id="ec2-instance-running-scheduler.LambdaFailureDetectorProps.property.logGroup"></a>
|
|
2267
|
+
|
|
2268
|
+
```typescript
|
|
2269
|
+
public readonly logGroup: ILogGroup;
|
|
2270
|
+
```
|
|
2271
|
+
|
|
2272
|
+
- *Type:* aws-cdk-lib.aws_logs.ILogGroup
|
|
2273
|
+
|
|
2274
|
+
Log group used for {@link LogFailureFilter} metric filters.
|
|
2275
|
+
|
|
2276
|
+
---
|
|
2277
|
+
|
|
2278
|
+
##### `alarmTopic`<sup>Optional</sup> <a name="alarmTopic" id="ec2-instance-running-scheduler.LambdaFailureDetectorProps.property.alarmTopic"></a>
|
|
2279
|
+
|
|
2280
|
+
```typescript
|
|
2281
|
+
public readonly alarmTopic: ITopic;
|
|
2282
|
+
```
|
|
2283
|
+
|
|
2284
|
+
- *Type:* aws-cdk-lib.aws_sns.ITopic
|
|
2285
|
+
|
|
2286
|
+
Optional SNS topic for all alarm actions.
|
|
2287
|
+
|
|
2288
|
+
When omitted, alarms are created without SNS actions.
|
|
2289
|
+
|
|
2290
|
+
---
|
|
2291
|
+
|
|
2292
|
+
##### `logFilters`<sup>Optional</sup> <a name="logFilters" id="ec2-instance-running-scheduler.LambdaFailureDetectorProps.property.logFilters"></a>
|
|
2293
|
+
|
|
2294
|
+
```typescript
|
|
2295
|
+
public readonly logFilters: LogFailureFilter[];
|
|
2296
|
+
```
|
|
2297
|
+
|
|
2298
|
+
- *Type:* <a href="#ec2-instance-running-scheduler.LogFailureFilter">LogFailureFilter</a>[]
|
|
2299
|
+
- *Default:* no log-based alarms
|
|
2300
|
+
|
|
2301
|
+
Log-based failure filters.
|
|
2302
|
+
|
|
2303
|
+
Each entry creates a metric filter and alarm.
|
|
2304
|
+
|
|
2305
|
+
---
|
|
2306
|
+
|
|
2307
|
+
### LogFailureAlarm <a name="LogFailureAlarm" id="ec2-instance-running-scheduler.LogFailureAlarm"></a>
|
|
2308
|
+
|
|
2309
|
+
Alarm created for one {@link LogFailureFilter}.
|
|
2310
|
+
|
|
2311
|
+
#### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.LogFailureAlarm.Initializer"></a>
|
|
2312
|
+
|
|
2313
|
+
```typescript
|
|
2314
|
+
import { LogFailureAlarm } from 'ec2-instance-running-scheduler'
|
|
2315
|
+
|
|
2316
|
+
const logFailureAlarm: LogFailureAlarm = { ... }
|
|
2317
|
+
```
|
|
2318
|
+
|
|
2319
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
2320
|
+
|
|
2321
|
+
| **Name** | **Type** | **Description** |
|
|
2322
|
+
| --- | --- | --- |
|
|
2323
|
+
| <code><a href="#ec2-instance-running-scheduler.LogFailureAlarm.property.alarm">alarm</a></code> | <code>aws-cdk-lib.aws_cloudwatch.Alarm</code> | Alarm on the log metric filter sum. |
|
|
2324
|
+
| <code><a href="#ec2-instance-running-scheduler.LogFailureAlarm.property.id">id</a></code> | <code>string</code> | Same as {@link LogFailureFilter.id}. |
|
|
2325
|
+
|
|
2326
|
+
---
|
|
2327
|
+
|
|
2328
|
+
##### `alarm`<sup>Required</sup> <a name="alarm" id="ec2-instance-running-scheduler.LogFailureAlarm.property.alarm"></a>
|
|
2329
|
+
|
|
2330
|
+
```typescript
|
|
2331
|
+
public readonly alarm: Alarm;
|
|
2332
|
+
```
|
|
2333
|
+
|
|
2334
|
+
- *Type:* aws-cdk-lib.aws_cloudwatch.Alarm
|
|
2335
|
+
|
|
2336
|
+
Alarm on the log metric filter sum.
|
|
2337
|
+
|
|
2338
|
+
---
|
|
2339
|
+
|
|
2340
|
+
##### `id`<sup>Required</sup> <a name="id" id="ec2-instance-running-scheduler.LogFailureAlarm.property.id"></a>
|
|
2341
|
+
|
|
2342
|
+
```typescript
|
|
2343
|
+
public readonly id: string;
|
|
2344
|
+
```
|
|
2345
|
+
|
|
2346
|
+
- *Type:* string
|
|
2347
|
+
|
|
2348
|
+
Same as {@link LogFailureFilter.id}.
|
|
2349
|
+
|
|
2350
|
+
---
|
|
2351
|
+
|
|
2352
|
+
### LogFailureFilter <a name="LogFailureFilter" id="ec2-instance-running-scheduler.LogFailureFilter"></a>
|
|
2353
|
+
|
|
2354
|
+
One log-based failure signal for {@link LambdaFailureDetector }.
|
|
2355
|
+
|
|
2356
|
+
Creates a CloudWatch Logs metric filter and an alarm on the resulting sum metric.
|
|
2357
|
+
|
|
2358
|
+
#### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.LogFailureFilter.Initializer"></a>
|
|
2359
|
+
|
|
2360
|
+
```typescript
|
|
2361
|
+
import { LogFailureFilter } from 'ec2-instance-running-scheduler'
|
|
2362
|
+
|
|
2363
|
+
const logFailureFilter: LogFailureFilter = { ... }
|
|
2364
|
+
```
|
|
2365
|
+
|
|
2366
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
2367
|
+
|
|
2368
|
+
| **Name** | **Type** | **Description** |
|
|
2369
|
+
| --- | --- | --- |
|
|
2370
|
+
| <code><a href="#ec2-instance-running-scheduler.LogFailureFilter.property.filterPattern">filterPattern</a></code> | <code>string</code> | CloudWatch Logs filter pattern string passed to `FilterPattern.literal`. |
|
|
2371
|
+
| <code><a href="#ec2-instance-running-scheduler.LogFailureFilter.property.id">id</a></code> | <code>string</code> | Stable id used as the MetricFilter / Alarm construct id prefix (e.g. `InstanceStatusFailure` → `InstanceStatusFailureMetric`). |
|
|
2372
|
+
| <code><a href="#ec2-instance-running-scheduler.LogFailureFilter.property.metricName">metricName</a></code> | <code>string</code> | Custom metric name for the metric filter. |
|
|
2373
|
+
| <code><a href="#ec2-instance-running-scheduler.LogFailureFilter.property.metricNamespace">metricNamespace</a></code> | <code>string</code> | Custom metric namespace for the metric filter. |
|
|
2374
|
+
|
|
2375
|
+
---
|
|
2376
|
+
|
|
2377
|
+
##### `filterPattern`<sup>Required</sup> <a name="filterPattern" id="ec2-instance-running-scheduler.LogFailureFilter.property.filterPattern"></a>
|
|
2378
|
+
|
|
2379
|
+
```typescript
|
|
2380
|
+
public readonly filterPattern: string;
|
|
2381
|
+
```
|
|
2382
|
+
|
|
2383
|
+
- *Type:* string
|
|
2384
|
+
|
|
2385
|
+
CloudWatch Logs filter pattern string passed to `FilterPattern.literal`.
|
|
2386
|
+
|
|
2387
|
+
---
|
|
2388
|
+
|
|
2389
|
+
*Example*
|
|
2390
|
+
|
|
2391
|
+
```typescript
|
|
2392
|
+
'"ResourceWaitFailed"'
|
|
2393
|
+
```
|
|
2394
|
+
|
|
2395
|
+
|
|
2396
|
+
##### `id`<sup>Required</sup> <a name="id" id="ec2-instance-running-scheduler.LogFailureFilter.property.id"></a>
|
|
2397
|
+
|
|
2398
|
+
```typescript
|
|
2399
|
+
public readonly id: string;
|
|
2400
|
+
```
|
|
2401
|
+
|
|
2402
|
+
- *Type:* string
|
|
2403
|
+
|
|
2404
|
+
Stable id used as the MetricFilter / Alarm construct id prefix (e.g. `InstanceStatusFailure` → `InstanceStatusFailureMetric`).
|
|
2405
|
+
|
|
2406
|
+
---
|
|
2407
|
+
|
|
2408
|
+
##### `metricName`<sup>Required</sup> <a name="metricName" id="ec2-instance-running-scheduler.LogFailureFilter.property.metricName"></a>
|
|
2409
|
+
|
|
2410
|
+
```typescript
|
|
2411
|
+
public readonly metricName: string;
|
|
2412
|
+
```
|
|
2413
|
+
|
|
2414
|
+
- *Type:* string
|
|
2415
|
+
|
|
2416
|
+
Custom metric name for the metric filter.
|
|
2417
|
+
|
|
2418
|
+
---
|
|
2419
|
+
|
|
2420
|
+
##### `metricNamespace`<sup>Required</sup> <a name="metricNamespace" id="ec2-instance-running-scheduler.LogFailureFilter.property.metricNamespace"></a>
|
|
2421
|
+
|
|
2422
|
+
```typescript
|
|
2423
|
+
public readonly metricNamespace: string;
|
|
2424
|
+
```
|
|
2425
|
+
|
|
2426
|
+
- *Type:* string
|
|
2427
|
+
|
|
2428
|
+
Custom metric namespace for the metric filter.
|
|
2429
|
+
|
|
2430
|
+
---
|
|
2431
|
+
|
|
1922
2432
|
### ResourceWaitLimits <a name="ResourceWaitLimits" id="ec2-instance-running-scheduler.ResourceWaitLimits"></a>
|
|
1923
2433
|
|
|
1924
2434
|
CDK-side limits for per-instance stable-state waiting in the Durable Lambda handler.
|
|
@@ -2039,7 +2549,11 @@ How long to retain durable execution history.
|
|
|
2039
2549
|
|
|
2040
2550
|
### RunningSchedulerFailureDetectionProps <a name="RunningSchedulerFailureDetectionProps" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps"></a>
|
|
2041
2551
|
|
|
2042
|
-
|
|
2552
|
+
Opt-in failure detection for `EC2InstanceRunningScheduler`.
|
|
2553
|
+
|
|
2554
|
+
Pass as `EC2InstanceRunningSchedulerProps.failureDetection`. Extends
|
|
2555
|
+
{@link LambdaFailureDetection} (`enabled` / `alarmTopic`). Which log failures are
|
|
2556
|
+
monitored is defined in this module and applied by {@link RunningSchedulerFailureDetection}.
|
|
2043
2557
|
|
|
2044
2558
|
#### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps.Initializer"></a>
|
|
2045
2559
|
|
|
@@ -2053,25 +2567,64 @@ const runningSchedulerFailureDetectionProps: RunningSchedulerFailureDetectionPro
|
|
|
2053
2567
|
|
|
2054
2568
|
| **Name** | **Type** | **Description** |
|
|
2055
2569
|
| --- | --- | --- |
|
|
2056
|
-
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps.property.
|
|
2057
|
-
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps.property.
|
|
2058
|
-
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps.property.runningScheduleFunction">runningScheduleFunction</a></code> | <code>aws-cdk-lib.aws_lambda.IFunction</code> | Running scheduler Lambda to monitor. |
|
|
2570
|
+
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps.property.alarmTopic">alarmTopic</a></code> | <code>aws-cdk-lib.aws_sns.ITopic</code> | SNS topic for alarm notifications. |
|
|
2571
|
+
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps.property.enabled">enabled</a></code> | <code>boolean</code> | When true, creates failure detection alarms and log-based metrics. |
|
|
2059
2572
|
|
|
2060
2573
|
---
|
|
2061
2574
|
|
|
2062
|
-
##### `
|
|
2575
|
+
##### `alarmTopic`<sup>Optional</sup> <a name="alarmTopic" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps.property.alarmTopic"></a>
|
|
2063
2576
|
|
|
2064
2577
|
```typescript
|
|
2065
|
-
public readonly
|
|
2578
|
+
public readonly alarmTopic: ITopic;
|
|
2066
2579
|
```
|
|
2067
2580
|
|
|
2068
|
-
- *Type:*
|
|
2581
|
+
- *Type:* aws-cdk-lib.aws_sns.ITopic
|
|
2069
2582
|
|
|
2070
|
-
|
|
2583
|
+
SNS topic for alarm notifications.
|
|
2584
|
+
|
|
2585
|
+
When omitted, alarms are created without SNS actions.
|
|
2071
2586
|
|
|
2072
2587
|
---
|
|
2073
2588
|
|
|
2074
|
-
##### `
|
|
2589
|
+
##### `enabled`<sup>Optional</sup> <a name="enabled" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps.property.enabled"></a>
|
|
2590
|
+
|
|
2591
|
+
```typescript
|
|
2592
|
+
public readonly enabled: boolean;
|
|
2593
|
+
```
|
|
2594
|
+
|
|
2595
|
+
- *Type:* boolean
|
|
2596
|
+
- *Default:* false when omitted
|
|
2597
|
+
|
|
2598
|
+
When true, creates failure detection alarms and log-based metrics.
|
|
2599
|
+
|
|
2600
|
+
---
|
|
2601
|
+
|
|
2602
|
+
### RunningSchedulerFailureDetectionResourcesProps <a name="RunningSchedulerFailureDetectionResourcesProps" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps"></a>
|
|
2603
|
+
|
|
2604
|
+
Lambda and log group monitored by {@link RunningSchedulerFailureDetection}.
|
|
2605
|
+
|
|
2606
|
+
Normally `EC2InstanceRunningScheduler` creates this binding. Use directly only when
|
|
2607
|
+
composing failure detection outside the scheduler construct.
|
|
2608
|
+
|
|
2609
|
+
#### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps.Initializer"></a>
|
|
2610
|
+
|
|
2611
|
+
```typescript
|
|
2612
|
+
import { RunningSchedulerFailureDetectionResourcesProps } from 'ec2-instance-running-scheduler'
|
|
2613
|
+
|
|
2614
|
+
const runningSchedulerFailureDetectionResourcesProps: RunningSchedulerFailureDetectionResourcesProps = { ... }
|
|
2615
|
+
```
|
|
2616
|
+
|
|
2617
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
2618
|
+
|
|
2619
|
+
| **Name** | **Type** | **Description** |
|
|
2620
|
+
| --- | --- | --- |
|
|
2621
|
+
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps.property.logGroup">logGroup</a></code> | <code>aws-cdk-lib.aws_logs.ILogGroup</code> | *No description.* |
|
|
2622
|
+
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps.property.runningScheduleFunction">runningScheduleFunction</a></code> | <code>aws-cdk-lib.aws_lambda.IFunction</code> | *No description.* |
|
|
2623
|
+
| <code><a href="#ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps.property.alarmTopic">alarmTopic</a></code> | <code>aws-cdk-lib.aws_sns.ITopic</code> | *No description.* |
|
|
2624
|
+
|
|
2625
|
+
---
|
|
2626
|
+
|
|
2627
|
+
##### `logGroup`<sup>Required</sup> <a name="logGroup" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps.property.logGroup"></a>
|
|
2075
2628
|
|
|
2076
2629
|
```typescript
|
|
2077
2630
|
public readonly logGroup: ILogGroup;
|
|
@@ -2079,11 +2632,9 @@ public readonly logGroup: ILogGroup;
|
|
|
2079
2632
|
|
|
2080
2633
|
- *Type:* aws-cdk-lib.aws_logs.ILogGroup
|
|
2081
2634
|
|
|
2082
|
-
Application log group for the running scheduler Lambda.
|
|
2083
|
-
|
|
2084
2635
|
---
|
|
2085
2636
|
|
|
2086
|
-
##### `runningScheduleFunction`<sup>Required</sup> <a name="runningScheduleFunction" id="ec2-instance-running-scheduler.
|
|
2637
|
+
##### `runningScheduleFunction`<sup>Required</sup> <a name="runningScheduleFunction" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps.property.runningScheduleFunction"></a>
|
|
2087
2638
|
|
|
2088
2639
|
```typescript
|
|
2089
2640
|
public readonly runningScheduleFunction: IFunction;
|
|
@@ -2091,7 +2642,15 @@ public readonly runningScheduleFunction: IFunction;
|
|
|
2091
2642
|
|
|
2092
2643
|
- *Type:* aws-cdk-lib.aws_lambda.IFunction
|
|
2093
2644
|
|
|
2094
|
-
|
|
2645
|
+
---
|
|
2646
|
+
|
|
2647
|
+
##### `alarmTopic`<sup>Optional</sup> <a name="alarmTopic" id="ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps.property.alarmTopic"></a>
|
|
2648
|
+
|
|
2649
|
+
```typescript
|
|
2650
|
+
public readonly alarmTopic: ITopic;
|
|
2651
|
+
```
|
|
2652
|
+
|
|
2653
|
+
- *Type:* aws-cdk-lib.aws_sns.ITopic
|
|
2095
2654
|
|
|
2096
2655
|
---
|
|
2097
2656
|
|