ec2-instance-running-scheduler 0.4.5 → 0.5.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/.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/.jsii
CHANGED
|
@@ -8435,12 +8435,12 @@
|
|
|
8435
8435
|
}
|
|
8436
8436
|
}
|
|
8437
8437
|
},
|
|
8438
|
-
"description": "AWS CDK construct library that starts and stops EC2 instances on a cron schedule using EventBridge Scheduler and a Durable Execution Lambda.
|
|
8438
|
+
"description": "AWS CDK construct library that starts and stops EC2 instances on a cron schedule using EventBridge Scheduler and a Durable Execution Lambda. Tagged instances are discovered account-wide, started or stopped in parallel, waited until stable, and reported to Slack via Secrets Manager.",
|
|
8439
8439
|
"docs": {
|
|
8440
8440
|
"stability": "stable"
|
|
8441
8441
|
},
|
|
8442
8442
|
"homepage": "https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler.git",
|
|
8443
|
-
"jsiiVersion": "6.0.
|
|
8443
|
+
"jsiiVersion": "6.0.16 (build 15002ec)",
|
|
8444
8444
|
"keywords": [
|
|
8445
8445
|
"cdk",
|
|
8446
8446
|
"durable",
|
|
@@ -8462,7 +8462,7 @@
|
|
|
8462
8462
|
},
|
|
8463
8463
|
"name": "ec2-instance-running-scheduler",
|
|
8464
8464
|
"readme": {
|
|
8465
|
-
"markdown": "# EC2 Instance Running Scheduler (AWS CDK v2)\n\n[](https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/blob/main/LICENSE)\n[](https://www.npmjs.com/package/ec2-instance-running-scheduler)\n[](https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/actions/workflows/release.yml)\n[](https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/releases)\n\n[](https://constructs.dev/packages/ec2-instance-running-scheduler)\n\nAWS CDK construct library that starts and stops EC2 instances on a cron schedule using **EventBridge Scheduler** and a **Durable Execution Lambda**. The handler discovers instances with the **Resource Groups Tagging API**, issues start/stop, **waits until each instance reaches a stable target state** (durable `step` / `wait`), processes **multiple instances in parallel** (bounded concurrency), and posts **Slack** summary and per-instance thread messages using a secret from **Secrets Manager**. The Lambda emits **structured application logs** alongside JSON platform logs.\n\n## Features\n\n- **Tag-based targeting** – Select EC2 instances by tag key and values (e.g. `Schedule` / `YES`) via `tag:GetResources`.\n- **EventBridge Scheduler** – Separate cron rules for start and stop, with per-rule timezone (`aws-cdk-lib` `TimeZone`).\n- **Durable Lambda** – One Lambda with AWS Lambda Durable Execution (`step`, `wait`, `map`, child contexts per instance) for long-running workflows without Step Functions.\n- **Stable-state waiting** – After start/stop, the function waits (`resourceWait.statusChangeWaitSeconds`, default **20** seconds between attempts) and re-describes instances until `running` (start mode) or `stopped` (stop mode).\n- **Configurable wait limits** – Per-instance **max loop count**, **max elapsed time**, and **status-change wait interval** via `resourceWait` (default: 90 loops / 1800 seconds / 20 seconds). Failures use explicit `ResourceWaitFailed:*` messages instead of running until the Durable execution timeout (construct default: 2 hours; override with `durable.executionTimeout`).\n- **Configurable Lambda runtime** – Memory, invoke timeout, and bounded instance concurrency via `runtime` (default: **512 MB** / **15 minutes** / **maxConcurrency 10**). Durable execution timeout and history retention via `durable` (default: **2 hours** / **1 day**).\n- **Configurable logs** – Log group retention and removal policy via `logGroup` (default: **3 months**, `RemovalPolicy.DESTROY`).\n- **Validated environment variables** – The bundled handler parses env vars with **strict-env-resolver** (`StrictEnvResolver`). `SLACK_SECRET_NAME` is required; wait limits and `maxConcurrency` must be **positive integers** (`>= 1`).\n- **Slack notifications** – Parent message plus threaded updates per instance; credentials from Secrets Manager JSON (`token`, `channel`). The construct sets **`SLACK_SECRET_NAME`** on the function.\n- **Structured logging** – Durable execution **`ctx.logger`** for traceable JSON application logs (invocation, describe/start/stop/wait loops, wait limit errors, Slack steps, completion).\n- **Optional failure detection** – CloudWatch alarms and log-based metrics for Lambda errors, instance wait failures (`ResourceWaitFailed`), Slack post failures, and other handler `ERROR` logs. Optional SNS notifications via a caller-supplied topic (`failureDetection.alarmTopic`).\n- **Scheduling toggle** – Enable or disable both schedules without removing the stack (`enableScheduling`).\n- **Configurable schedules** – Optional cron overrides for start and stop (`minute`, `hour`, `week`, `timezone`); sensible defaults if omitted.\n- **IAM and observability** – Start/stop is limited to EC2 instances in the stack account/region whose tags match `targetResource`. Slack secret read grant, **Parameters and Secrets Lambda Extension**, JSON logging, and a dedicated log group (override retention and removal policy via `logGroup`).\n\n## Installation\n\n**npm**\n\n```bash\nnpm install ec2-instance-running-scheduler\n```\n\n**yarn**\n\n```bash\nyarn add ec2-instance-running-scheduler\n```\n\n**pnpm**\n\n```bash\npnpm add ec2-instance-running-scheduler\n```\n\n## Usage\n\nUse the **construct** `EC2InstanceRunningScheduler` when embedding the scheduler in an existing stack or other CDK scope.\n\n```typescript\nimport * as cdk from 'aws-cdk-lib';\nimport { TimeZone } from 'aws-cdk-lib';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport * as sns from 'aws-cdk-lib/aws-sns';\nimport { EC2InstanceRunningScheduler } from 'ec2-instance-running-scheduler';\n\nconst app = new cdk.App();\nconst stack = new cdk.Stack(app, 'MyStack');\n\nconst alarmTopic = new sns.Topic(stack, 'OpsAlerts');\n\nnew EC2InstanceRunningScheduler(stack, 'EC2InstanceRunningScheduler', {\n targetResource: {\n tagKey: 'Schedule',\n tagValues: ['YES'],\n },\n secrets: {\n slackSecretName: 'my-slack-secret',\n },\n startSchedule: {\n timezone: TimeZone.ASIA_TOKYO,\n minute: '55',\n hour: '8',\n week: 'MON-FRI',\n },\n stopSchedule: {\n timezone: TimeZone.ASIA_TOKYO,\n minute: '5',\n hour: '19',\n week: 'MON-FRI',\n },\n enableScheduling: true,\n resourceWait: {\n maxLoopCount: 120,\n maxElapsedSeconds: 3600,\n statusChangeWaitSeconds: 15,\n },\n runtime: {\n memorySize: 1024,\n timeout: cdk.Duration.minutes(15),\n maxConcurrency: 20,\n },\n durable: {\n executionTimeout: cdk.Duration.hours(4),\n retentionPeriod: cdk.Duration.days(7),\n },\n logGroup: {\n retention: logs.RetentionDays.ONE_YEAR,\n removalPolicy: cdk.RemovalPolicy.RETAIN,\n },\n failureDetection: {\n enabled: true,\n alarmTopic,\n },\n});\n```\n\nUse the **stack** `EC2InstanceRunningScheduleStack` when deploying the scheduler as its own stack. It accepts the same **targeting, schedules, secrets, enable flag, and failure detection** as the construct (plus standard `StackProps` such as `env`). For **`resourceWait`**, **`runtime`**, **`durable`**, and **`logGroup`**, use the construct directly or extend the stack in your app.\n\n```typescript\nimport * as cdk from 'aws-cdk-lib';\nimport { TimeZone } from 'aws-cdk-lib';\nimport * as sns from 'aws-cdk-lib/aws-sns';\nimport { EC2InstanceRunningScheduleStack } from 'ec2-instance-running-scheduler';\n\nconst app = new cdk.App();\n\nconst alarmTopic = sns.Topic.fromTopicArn(\n app,\n 'OpsAlerts',\n 'arn:aws:sns:ap-northeast-1:123456789012:ops-alerts',\n);\n\nnew EC2InstanceRunningScheduleStack(app, 'EC2InstanceRunningScheduleStack', {\n targetResource: {\n tagKey: 'Schedule',\n tagValues: ['YES'],\n },\n secrets: {\n slackSecretName: 'my-slack-secret',\n },\n startSchedule: {\n timezone: TimeZone.ASIA_TOKYO,\n minute: '55',\n hour: '8',\n week: 'MON-FRI',\n },\n stopSchedule: {\n timezone: TimeZone.ASIA_TOKYO,\n minute: '5',\n hour: '19',\n week: 'MON-FRI',\n },\n enableScheduling: true,\n failureDetection: {\n enabled: true,\n alarmTopic,\n },\n});\n```\n\n## Tag instances before scheduling\n\nThe scheduler only starts and stops EC2 instances that **already** have the tag key and one of the tag values in `targetResource`. Tag instances in the same account and region as the stack **before** enabling schedules.\n\n**AWS CLI**\n\n```bash\naws ec2 create-tags \\\n --resources i-0123456789abcdef0 \\\n --tags Key=Schedule,Value=YES\n```\n\n**Console** – EC2 → Instances → select the instance → Tags → Add `Schedule` = `YES` (or your `tagKey` / `tagValues`).\n\nIAM for `ec2:StartInstances` and `ec2:StopInstances` is limited to:\n\n- instance ARNs in the stack **account** and **region** (`arn:...:ec2:<region>:<account>:instance/*`)\n- instances whose `aws:ResourceTag/<tagKey>` matches one of `tagValues`\n\nAn instance without the tag is not discovered by `tag:GetResources`, and start/stop is denied even if an instance ID is known. `tag:GetResources` and `ec2:DescribeInstances` still use `Resource: *` because those APIs do not support resource-level permissions or resource-tag conditions.\n\nEventBridge Scheduler invokes the Lambda with `Params.TagKey`, `Params.TagValues`, and `Params.Mode` (`Start` or `Stop`); the construct wires this for you. The function environment includes:\n\n| Variable | Source | Purpose |\n|----------|--------|---------|\n| `SLACK_SECRET_NAME` | `secrets.slackSecretName` | Secrets Manager secret for Slack (required) |\n| `PROCESS_RESOURCE_MAX_LOOP_COUNT` | `resourceWait.maxLoopCount` (default `90`) | Max describe/wait iterations per instance |\n| `PROCESS_RESOURCE_MAX_ELAPSED_SECONDS` | `resourceWait.maxElapsedSeconds` (default `1800`) | Max wall-clock seconds waiting for one instance |\n| `PROCESS_RESOURCE_STATUS_CHANGE_WAIT_SECONDS` | `resourceWait.statusChangeWaitSeconds` (default `20`) | Seconds between describe/wait iterations |\n| `PROCESS_RESOURCES_MAX_CONCURRENCY` | `runtime.maxConcurrency` (default `10`) | Max instances processed in parallel |\n\nWhen you set wait limits via `resourceWait` or concurrency via `runtime.maxConcurrency`, the construct writes them as decimal integer strings. At invocation the handler parses them with **strict-env-resolver**; each value must be a **positive integer** (`>= 1`). Missing `SLACK_SECRET_NAME` or invalid env values cause `StrictEnvValidationError` at the start of an invocation.\n\n## Options\n\n### EC2InstanceRunningScheduler\n\n| Option | Type | Required | Description |\n|--------|------|----------|-------------|\n| `targetResource` | `TargetResource` | Yes | Tag key and values used to select EC2 instances. |\n| `secrets` | `Secrets` | Yes | Secrets Manager secret for Slack (`slackSecretName`). |\n| `startSchedule` | `Schedule` | No | Cron for starting instances (default: `50 7 ? * MON-FRI *` in `Etc/UTC`). |\n| `stopSchedule` | `Schedule` | No | Cron for stopping instances (default: `5 19 ? * MON-FRI *` in `Etc/UTC`). |\n| `enableScheduling` | `boolean` | No | Whether both scheduler rules are enabled (default: `true`). |\n| `resourceWait` | `ResourceWaitLimits` | No | Per-instance wait caps (see below). |\n| `runtime` | `RunningSchedulerRuntimeProps` | No | Lambda memory, invoke timeout, and map concurrency. |\n| `durable` | `RunningSchedulerDurableProps` | No | Durable execution timeout and history retention. |\n| `logGroup` | `RunningSchedulerLogGroupProps` | No | Function log group retention and removal policy. |\n| `failureDetection` | `FailureDetectionAlarms` | No | Optional CloudWatch alarms and log-based metrics (see below). |\n\n### EC2InstanceRunningScheduleStack\n\nIncludes `targetResource`, `secrets`, `startSchedule`, `stopSchedule`, `enableScheduling`, `failureDetection`, and standard `StackProps`. Does **not** expose `resourceWait`, `runtime`, `durable`, or `logGroup`; use `EC2InstanceRunningScheduler` when you need custom wait, Lambda, Durable, or log settings.\n\n### TargetResource\n\n- `tagKey` – Tag key used to select instances (e.g. `Schedule`). Required on each target instance before schedules run.\n- `tagValues` – Tag values that must match (e.g. `['YES']`). At least one value is required.\n\nSee [Tag instances before scheduling](#tag-instances-before-scheduling).\n\n### Schedule\n\n- `timezone` – `TimeZone` from `aws-cdk-lib` (e.g. `TimeZone.ASIA_TOKYO`, `TimeZone.ETC_UTC`).\n- `minute` – Cron minute (`0`–`59`).\n- `hour` – Cron hour (`0`–`23`).\n- `week` – Cron day-of-week field (e.g. `MON-FRI`).\n\n### Secrets\n\n- `slackSecretName` – Name of the AWS Secrets Manager secret. The Lambda expects JSON with **`token`** (Slack bot token) and **`channel`** (channel ID or name for `chat.postMessage`).\n\n### ResourceWaitLimits\n\nWritten to `PROCESS_RESOURCE_MAX_LOOP_COUNT`, `PROCESS_RESOURCE_MAX_ELAPSED_SECONDS`, and `PROCESS_RESOURCE_STATUS_CHANGE_WAIT_SECONDS` on the running scheduler Lambda.\n\n- `maxLoopCount` – Maximum describe/wait loop iterations per instance (default: **90**). Must be a positive integer when set.\n- `maxElapsedSeconds` – Maximum wall-clock seconds spent waiting for one instance to stabilize (default: **1800**, 30 minutes). Must be a positive integer when set.\n- `statusChangeWaitSeconds` – Seconds between describe iterations after start/stop or while transitioning (default: **20**). Must be a positive integer when set.\n\nWhen a limit is exceeded during waiting, the handler throws an error with prefix `ResourceWaitFailed:` (`MaxLoopCountExceeded`, `MaxElapsedTimeExceeded`, or `UnexpectedInstanceState` for unknown EC2 states).\n\n### RunningSchedulerRuntimeProps\n\nLambda invoke settings. Written `maxConcurrency` to `PROCESS_RESOURCES_MAX_CONCURRENCY`.\n\n- `memorySize` – Memory in MB (default: **512**). Must be a positive integer when set.\n- `timeout` – Lambda invoke timeout (default: **15 minutes**). AWS maximum is 15 minutes; durable waits continue under `durable.executionTimeout`.\n- `maxConcurrency` – Max instances processed in parallel (default: **10**). Must be a positive integer when set. Increase with instance count.\n\n### RunningSchedulerDurableProps\n\n- `executionTimeout` – Maximum durable execution duration (default: **2 hours**). Increase when many instances wait in sequence of batches.\n- `retentionPeriod` – Durable execution history retention (default: **1 day**).\n\n### RunningSchedulerLogGroupProps\n\n- `retention` – CloudWatch Logs retention (default: **`RetentionDays.THREE_MONTHS`**).\n- `removalPolicy` – Log group removal policy (default: **`RemovalPolicy.DESTROY`**).\n\n### FailureDetectionAlarms\n\nOptional operational failure detection. Alarms are created only when `enabled` is `true`.\n\n- `enabled` – When `true`, creates four CloudWatch alarms and three log metric filters (default: disabled when omitted).\n- `alarmTopic` – Optional `sns.ITopic` for alarm actions. The construct does **not** create an SNS topic; pass an existing or imported topic. When omitted, alarms are created without SNS actions.\n\nWhen enabled, the construct creates:\n\n| Alarm | Trigger |\n|-------|---------|\n| Lambda errors | `AWS/Lambda` `Errors` metric |\n| Instance status failure | Log filter: `ResourceWaitFailed` |\n| Slack post failure | Log filter: `running-scheduler: Slack post failed` |\n| Durable execution failure | Other handler `ERROR` logs (excluding the above) |\n\nCustom metrics are published under the `EC2InstanceRunningScheduler` namespace. Access the created alarms via `EC2InstanceRunningScheduler.failureDetection` when enabled.\n\n## Requirements\n\n- **Node.js** ≥ 20.0.0 (for developing or synthesizing CDK apps that depend on this package).\n- **aws-cdk-lib** ^2.232.0 and **constructs** ^10.5.1 (peer dependencies).\n- **AWS** – EventBridge Scheduler; Lambda with **Durable Execution** (Node.js **24.x** runtime in the construct; Durable Execution requires a supported Node.js runtime in your region), a **live alias**, **Parameters and Secrets Lambda Extension**; EC2 (`DescribeInstances`, `StartInstances`, `StopInstances`); Resource Groups Tagging API (`tag:GetResources`); Secrets Manager. The deployed function uses **arm64**, Durable Execution IAM policies, a 2-hour Durable execution timeout (construct default), and a bundled handler that loads secrets via **aws-lambda-secret-fetcher** (^0.7) and parses env vars via **strict-env-resolver** (^0.6). Secret fetch runs only inside Lambda (requires runtime `AWS_SESSION_TOKEN` and the extension layer); the library retries transient extension errors including cold-start \"not ready\" responses.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n"
|
|
8465
|
+
"markdown": "# EC2 Instance Running Scheduler (CDK v2)\n\n[](https://www.npmjs.com/package/ec2-instance-running-scheduler)\n[](https://www.npmjs.com/package/ec2-instance-running-scheduler)\n[](https://www.npmjs.com/package/ec2-instance-running-scheduler)\n[](https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/actions/workflows/build.yml)\n\n[](https://constructs.dev/packages/ec2-instance-running-scheduler)\n\nAWS CDK construct library that starts and stops EC2 instances on a cron schedule using EventBridge Scheduler and a Durable Execution Lambda. Tagged instances are discovered account-wide, started or stopped in parallel, waited until stable, and reported to Slack via Secrets Manager.\n\n## Features\n\n- **Tag-based targeting** – Select EC2 instances by tag key and values (e.g. `Schedule` / `YES`) via `tag:GetResources`.\n- **EventBridge Scheduler** – Separate cron rules for start and stop, with per-rule timezone (`aws-cdk-lib` `TimeZone`).\n- **Durable Lambda** – One Lambda with AWS Lambda Durable Execution (`step`, `wait`, `map`, child contexts per instance) for long-running workflows without Step Functions.\n- **Stable-state waiting** – After start/stop, waits and re-describes until `running` or `stopped`, with configurable wait limits (`resourceWait`).\n- **Configurable Lambda runtime** – Memory, invoke timeout, and bounded concurrency via `runtime`; Durable timeout and retention via `durable`.\n- **Slack notifications** – Parent message plus threaded updates per instance; credentials from Secrets Manager JSON (`token`, `channel`).\n- **Optional failure detection** – Opt-in CloudWatch alarms via `failureDetection` (`enabled` / optional `alarmTopic`). Uses `LambdaFailureDetector` for platform Lambda `Errors` plus scheduler-specific log filters (`ResourceWaitFailed`, Slack post failures, other handler `ERROR` logs). The construct never creates an SNS topic.\n- **Scheduling toggle** – Enable or disable both schedules without removing the stack (`enableScheduling`).\n\n## How it works\n\n1. Tag EC2 instances in the same account and region with the `targetResource` tag key and one of the tag values **before** enabling schedules.\n2. EventBridge Scheduler invokes the Lambda alias on the start/stop cron with `Params.TagKey`, `Params.TagValues`, and `Params.Mode` (`Start` or `Stop`).\n3. The Durable handler discovers matching instances via the Resource Groups Tagging API, then starts or stops them in parallel (bounded by `runtime.maxConcurrency`).\n4. For each instance it waits (`resourceWait`) until the desired stable state, or fails with a `ResourceWaitFailed:*` error.\n5. Slack receives a summary and per-instance thread updates when the secret is configured.\n6. When `failureDetection.enabled` is `true`, CloudWatch alarms cover Lambda platform errors and the scheduler log filters above. Pass `failureDetection.alarmTopic` to attach SNS actions to an existing topic.\n\n**Tag an instance (AWS CLI)**\n\n```bash\naws ec2 create-tags \\\n --resources i-0123456789abcdef0 \\\n --tags Key=Schedule,Value=YES\n```\n\nStart/stop IAM is limited to instance ARNs in the stack account and region whose `aws:ResourceTag/<tagKey>` matches `tagValues`. `tag:GetResources` and `ec2:DescribeInstances` still use `Resource: *` because those APIs do not support resource-level permissions or resource-tag conditions.\n\n## Installation\n\n### npm\n\n```bash\nnpm install ec2-instance-running-scheduler\n```\n\n### yarn\n\n```bash\nyarn add ec2-instance-running-scheduler\n```\n\n### pnpm\n\n```bash\npnpm add ec2-instance-running-scheduler\n```\n\n## Usage\n\nUse the **construct** `EC2InstanceRunningScheduler` when embedding the scheduler in an existing stack or other CDK scope.\n\n```typescript\nimport * as cdk from 'aws-cdk-lib';\nimport { TimeZone } from 'aws-cdk-lib';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport * as sns from 'aws-cdk-lib/aws-sns';\nimport { EC2InstanceRunningScheduler } from 'ec2-instance-running-scheduler';\n\nconst app = new cdk.App();\nconst stack = new cdk.Stack(app, 'MyStack');\n\nconst alarmTopic = new sns.Topic(stack, 'OpsAlerts');\n\nnew EC2InstanceRunningScheduler(stack, 'EC2InstanceRunningScheduler', {\n targetResource: {\n tagKey: 'Schedule',\n tagValues: ['YES'],\n },\n secrets: {\n slackSecretName: 'my-slack-secret',\n },\n startSchedule: {\n timezone: TimeZone.ASIA_TOKYO,\n minute: '55',\n hour: '8',\n week: 'MON-FRI',\n },\n stopSchedule: {\n timezone: TimeZone.ASIA_TOKYO,\n minute: '5',\n hour: '19',\n week: 'MON-FRI',\n },\n enableScheduling: true,\n resourceWait: {\n maxLoopCount: 120,\n maxElapsedSeconds: 3600,\n statusChangeWaitSeconds: 15,\n },\n runtime: {\n memorySize: 1024,\n timeout: cdk.Duration.minutes(15),\n maxConcurrency: 20,\n },\n durable: {\n executionTimeout: cdk.Duration.hours(4),\n retentionPeriod: cdk.Duration.days(7),\n },\n logGroup: {\n retention: logs.RetentionDays.ONE_YEAR,\n removalPolicy: cdk.RemovalPolicy.RETAIN,\n },\n failureDetection: {\n enabled: true,\n alarmTopic,\n },\n});\n```\n\nUse the **stack** `EC2InstanceRunningScheduleStack` when deploying the scheduler as its own stack. It accepts the same targeting, schedules, secrets, enable flag, and failure detection as the construct (plus standard `StackProps`). For `resourceWait`, `runtime`, `durable`, and `logGroup`, use the construct directly.\n\n```typescript\nimport * as cdk from 'aws-cdk-lib';\nimport { TimeZone } from 'aws-cdk-lib';\nimport * as sns from 'aws-cdk-lib/aws-sns';\nimport { EC2InstanceRunningScheduleStack } from 'ec2-instance-running-scheduler';\n\nconst app = new cdk.App();\n\nconst alarmTopic = sns.Topic.fromTopicArn(\n app,\n 'OpsAlerts',\n 'arn:aws:sns:ap-northeast-1:123456789012:ops-alerts',\n);\n\nnew EC2InstanceRunningScheduleStack(app, 'EC2InstanceRunningScheduleStack', {\n targetResource: {\n tagKey: 'Schedule',\n tagValues: ['YES'],\n },\n secrets: {\n slackSecretName: 'my-slack-secret',\n },\n startSchedule: {\n timezone: TimeZone.ASIA_TOKYO,\n minute: '55',\n hour: '8',\n week: 'MON-FRI',\n },\n stopSchedule: {\n timezone: TimeZone.ASIA_TOKYO,\n minute: '5',\n hour: '19',\n week: 'MON-FRI',\n },\n enableScheduling: true,\n failureDetection: {\n enabled: true,\n alarmTopic,\n },\n});\n```\n\n## Options\n\n### EC2InstanceRunningScheduler\n\n| Option | Type | Required | Description |\n|--------|------|----------|-------------|\n| `targetResource` | `TargetResource` | Yes | Tag key and values used to select EC2 instances. |\n| `secrets` | `Secrets` | Yes | Secrets Manager secret for Slack (`slackSecretName`). |\n| `startSchedule` | `Schedule` | No | Cron for starting instances (default: `50 7 ? * MON-FRI *` in `Etc/UTC`). |\n| `stopSchedule` | `Schedule` | No | Cron for stopping instances (default: `5 19 ? * MON-FRI *` in `Etc/UTC`). |\n| `enableScheduling` | `boolean` | No | Whether both scheduler rules are enabled (default: `true`). |\n| `resourceWait` | `ResourceWaitLimits` | No | Per-instance wait caps (see below). |\n| `runtime` | `RunningSchedulerRuntimeProps` | No | Lambda memory, invoke timeout, and map concurrency. |\n| `durable` | `RunningSchedulerDurableProps` | No | Durable execution timeout and history retention. |\n| `logGroup` | `RunningSchedulerLogGroupProps` | No | Function log group retention and removal policy. |\n| `failureDetection` | `RunningSchedulerFailureDetectionProps` | No | Optional CloudWatch alarms and log-based metrics (see below). |\n\n### EC2InstanceRunningScheduleStack\n\nIncludes `targetResource`, `secrets`, `startSchedule`, `stopSchedule`, `enableScheduling`, `failureDetection`, and standard `StackProps`. Does **not** expose `resourceWait`, `runtime`, `durable`, or `logGroup`; use `EC2InstanceRunningScheduler` when you need custom wait, Lambda, Durable, or log settings.\n\n### TargetResource\n\n- `tagKey` – Tag key used to select instances (e.g. `Schedule`). Required on each target instance before schedules run.\n- `tagValues` – Tag values that must match (e.g. `['YES']`). At least one value is required.\n\n### Schedule\n\n- `timezone` – `TimeZone` from `aws-cdk-lib` (e.g. `TimeZone.ASIA_TOKYO`, `TimeZone.ETC_UTC`).\n- `minute` – Cron minute (`0`–`59`).\n- `hour` – Cron hour (`0`–`23`).\n- `week` – Cron day-of-week field (e.g. `MON-FRI`).\n\n### Secrets\n\n- `slackSecretName` – Name of the AWS Secrets Manager secret. The Lambda expects JSON with **`token`** (Slack bot token) and **`channel`** (channel ID or name for `chat.postMessage`).\n\n### ResourceWaitLimits\n\nWritten to `PROCESS_RESOURCE_MAX_LOOP_COUNT`, `PROCESS_RESOURCE_MAX_ELAPSED_SECONDS`, and `PROCESS_RESOURCE_STATUS_CHANGE_WAIT_SECONDS` on the running scheduler Lambda.\n\n- `maxLoopCount` – Maximum describe/wait loop iterations per instance (default: **90**). Must be a positive integer when set.\n- `maxElapsedSeconds` – Maximum wall-clock seconds spent waiting for one instance to stabilize (default: **1800**, 30 minutes). Must be a positive integer when set.\n- `statusChangeWaitSeconds` – Seconds between describe iterations after start/stop or while transitioning (default: **20**). Must be a positive integer when set.\n\nWhen a limit is exceeded during waiting, the handler throws an error with prefix `ResourceWaitFailed:` (`MaxLoopCountExceeded`, `MaxElapsedTimeExceeded`, or `UnexpectedInstanceState` for unknown EC2 states).\n\n### RunningSchedulerRuntimeProps\n\nLambda invoke settings. Written `maxConcurrency` to `PROCESS_RESOURCES_MAX_CONCURRENCY`.\n\n- `memorySize` – Memory in MB (default: **512**). Must be a positive integer when set.\n- `timeout` – Lambda invoke timeout (default: **15 minutes**). AWS maximum is 15 minutes; durable waits continue under `durable.executionTimeout`.\n- `maxConcurrency` – Max instances processed in parallel (default: **10**). Must be a positive integer when set. Increase with instance count.\n\n### RunningSchedulerDurableProps\n\n- `executionTimeout` – Maximum durable execution duration (default: **2 hours**). Increase when many instances wait in sequence of batches.\n- `retentionPeriod` – Durable execution history retention (default: **1 day**).\n\n### RunningSchedulerLogGroupProps\n\n- `retention` – CloudWatch Logs retention (default: **`RetentionDays.THREE_MONTHS`**).\n- `removalPolicy` – Log group removal policy (default: **`RemovalPolicy.DESTROY`**).\n\n### RunningSchedulerFailureDetectionProps\n\nExtends `LambdaFailureDetection` (`enabled` / `alarmTopic`). Alarms are created only when `enabled` is `true`. Internally uses `LambdaFailureDetector` with scheduler-specific log filters. The construct does **not** create an SNS topic.\n\n- `enabled` – When `true`, creates four CloudWatch alarms and three log metric filters (default: disabled when omitted).\n- `alarmTopic` – Optional `sns.ITopic` for alarm actions. When omitted, alarms are created without SNS actions.\n\nWhen enabled:\n\n| Alarm | Trigger |\n|-------|---------|\n| Lambda errors | `AWS/Lambda` `Errors` metric (platform) |\n| Instance status failure | Log filter: `ResourceWaitFailed` |\n| Slack post failure | Log filter: `running-scheduler: Slack post failed` |\n| Durable execution failure | Other handler `ERROR` logs (excluding the above) |\n\nCustom metrics use the `EC2InstanceRunningScheduler` namespace. Access created alarms via `EC2InstanceRunningScheduler.failureDetection` when enabled.\n\n## API\n\nSee [API.md](./API.md).\n\n## Requirements\n\n- **Node.js** ≥ 20.0.0 (for developing or synthesizing CDK apps that depend on this package).\n- **aws-cdk-lib** ^2.232.0 and **constructs** ^10.5.1 (peer dependencies).\n- **AWS** – EventBridge Scheduler; Lambda with Durable Execution (Node.js **24.x** runtime in the construct); Parameters and Secrets Lambda Extension; EC2 (`DescribeInstances`, `StartInstances`, `StopInstances`); Resource Groups Tagging API (`tag:GetResources`); Secrets Manager.\n\n## License\n\nThis project is licensed under the (Apache-2.0) License.\n"
|
|
8466
8466
|
},
|
|
8467
8467
|
"repository": {
|
|
8468
8468
|
"type": "git",
|
|
@@ -8475,11 +8475,102 @@
|
|
|
8475
8475
|
}
|
|
8476
8476
|
},
|
|
8477
8477
|
"types": {
|
|
8478
|
+
"ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps": {
|
|
8479
|
+
"assembly": "ec2-instance-running-scheduler",
|
|
8480
|
+
"datatype": true,
|
|
8481
|
+
"docs": {
|
|
8482
|
+
"stability": "stable",
|
|
8483
|
+
"summary": "Props accepted by {@link createLambdaFailureDetector}."
|
|
8484
|
+
},
|
|
8485
|
+
"fqn": "ec2-instance-running-scheduler.CreateLambdaFailureDetectorProps",
|
|
8486
|
+
"kind": "interface",
|
|
8487
|
+
"locationInModule": {
|
|
8488
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
8489
|
+
"line": 62
|
|
8490
|
+
},
|
|
8491
|
+
"name": "CreateLambdaFailureDetectorProps",
|
|
8492
|
+
"properties": [
|
|
8493
|
+
{
|
|
8494
|
+
"abstract": true,
|
|
8495
|
+
"docs": {
|
|
8496
|
+
"stability": "stable",
|
|
8497
|
+
"summary": "Lambda function to monitor."
|
|
8498
|
+
},
|
|
8499
|
+
"immutable": true,
|
|
8500
|
+
"locationInModule": {
|
|
8501
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
8502
|
+
"line": 66
|
|
8503
|
+
},
|
|
8504
|
+
"name": "lambdaFunction",
|
|
8505
|
+
"type": {
|
|
8506
|
+
"fqn": "aws-cdk-lib.aws_lambda.IFunction"
|
|
8507
|
+
}
|
|
8508
|
+
},
|
|
8509
|
+
{
|
|
8510
|
+
"abstract": true,
|
|
8511
|
+
"docs": {
|
|
8512
|
+
"stability": "stable",
|
|
8513
|
+
"summary": "Application log group for log-based filters."
|
|
8514
|
+
},
|
|
8515
|
+
"immutable": true,
|
|
8516
|
+
"locationInModule": {
|
|
8517
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
8518
|
+
"line": 68
|
|
8519
|
+
},
|
|
8520
|
+
"name": "logGroup",
|
|
8521
|
+
"type": {
|
|
8522
|
+
"fqn": "aws-cdk-lib.aws_logs.ILogGroup"
|
|
8523
|
+
}
|
|
8524
|
+
},
|
|
8525
|
+
{
|
|
8526
|
+
"abstract": true,
|
|
8527
|
+
"docs": {
|
|
8528
|
+
"remarks": "alarms are created only when {@link LambdaFailureDetection.enabled} is true.",
|
|
8529
|
+
"stability": "stable",
|
|
8530
|
+
"summary": "Opt-in options;"
|
|
8531
|
+
},
|
|
8532
|
+
"immutable": true,
|
|
8533
|
+
"locationInModule": {
|
|
8534
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
8535
|
+
"line": 64
|
|
8536
|
+
},
|
|
8537
|
+
"name": "failureDetection",
|
|
8538
|
+
"optional": true,
|
|
8539
|
+
"type": {
|
|
8540
|
+
"fqn": "ec2-instance-running-scheduler.LambdaFailureDetection"
|
|
8541
|
+
}
|
|
8542
|
+
},
|
|
8543
|
+
{
|
|
8544
|
+
"abstract": true,
|
|
8545
|
+
"docs": {
|
|
8546
|
+
"default": "no log-based alarms",
|
|
8547
|
+
"stability": "stable",
|
|
8548
|
+
"summary": "Log-based failure filters."
|
|
8549
|
+
},
|
|
8550
|
+
"immutable": true,
|
|
8551
|
+
"locationInModule": {
|
|
8552
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
8553
|
+
"line": 74
|
|
8554
|
+
},
|
|
8555
|
+
"name": "logFilters",
|
|
8556
|
+
"optional": true,
|
|
8557
|
+
"type": {
|
|
8558
|
+
"collection": {
|
|
8559
|
+
"elementtype": {
|
|
8560
|
+
"fqn": "ec2-instance-running-scheduler.LogFailureFilter"
|
|
8561
|
+
},
|
|
8562
|
+
"kind": "array"
|
|
8563
|
+
}
|
|
8564
|
+
}
|
|
8565
|
+
}
|
|
8566
|
+
],
|
|
8567
|
+
"symbolId": "src/constructs/lambda-failure-detector/lambda-failure-detector:CreateLambdaFailureDetectorProps"
|
|
8568
|
+
},
|
|
8478
8569
|
"ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack": {
|
|
8479
8570
|
"assembly": "ec2-instance-running-scheduler",
|
|
8480
8571
|
"base": "aws-cdk-lib.Stack",
|
|
8481
8572
|
"docs": {
|
|
8482
|
-
"remarks": "Wires {@link EC2InstanceRunningScheduler} with targeting, schedules, secrets, scheduling toggle,\nand optional {@link
|
|
8573
|
+
"remarks": "Wires {@link EC2InstanceRunningScheduler} with targeting, schedules, secrets, scheduling toggle,\nand optional {@link RunningSchedulerFailureDetectionProps}. Does not expose {@link ResourceWaitLimits },\n{@link RunningSchedulerRuntimeProps }, {@link RunningSchedulerDurableProps }, or\n{@link RunningSchedulerLogGroupProps }; use the construct directly when custom runtime,\nwait, durable, or log group settings are required.",
|
|
8483
8574
|
"stability": "stable",
|
|
8484
8575
|
"summary": "CDK stack that deploys the EC2 instance running scheduler (EventBridge Scheduler + Durable Lambda)."
|
|
8485
8576
|
},
|
|
@@ -8614,7 +8705,7 @@
|
|
|
8614
8705
|
"name": "failureDetection",
|
|
8615
8706
|
"optional": true,
|
|
8616
8707
|
"type": {
|
|
8617
|
-
"fqn": "ec2-instance-running-scheduler.
|
|
8708
|
+
"fqn": "ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps"
|
|
8618
8709
|
}
|
|
8619
8710
|
},
|
|
8620
8711
|
{
|
|
@@ -8670,7 +8761,7 @@
|
|
|
8670
8761
|
},
|
|
8671
8762
|
"locationInModule": {
|
|
8672
8763
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8673
|
-
"line":
|
|
8764
|
+
"line": 333
|
|
8674
8765
|
},
|
|
8675
8766
|
"parameters": [
|
|
8676
8767
|
{
|
|
@@ -8693,7 +8784,7 @@
|
|
|
8693
8784
|
},
|
|
8694
8785
|
{
|
|
8695
8786
|
"docs": {
|
|
8696
|
-
"summary": "- Target tags, schedules, Slack secret, schedule enable flag, optional {@link ResourceWaitLimits}, {@link RunningSchedulerRuntimeProps}, {@link RunningSchedulerDurableProps}, {@link RunningSchedulerLogGroupProps}, and optional {@link
|
|
8787
|
+
"summary": "- Target tags, schedules, Slack secret, schedule enable flag, optional {@link ResourceWaitLimits}, {@link RunningSchedulerRuntimeProps}, {@link RunningSchedulerDurableProps}, {@link RunningSchedulerLogGroupProps}, and optional {@link RunningSchedulerFailureDetectionProps}."
|
|
8697
8788
|
},
|
|
8698
8789
|
"name": "props",
|
|
8699
8790
|
"type": {
|
|
@@ -8705,7 +8796,7 @@
|
|
|
8705
8796
|
"kind": "class",
|
|
8706
8797
|
"locationInModule": {
|
|
8707
8798
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8708
|
-
"line":
|
|
8799
|
+
"line": 318
|
|
8709
8800
|
},
|
|
8710
8801
|
"name": "EC2InstanceRunningScheduler",
|
|
8711
8802
|
"properties": [
|
|
@@ -8717,7 +8808,7 @@
|
|
|
8717
8808
|
"immutable": true,
|
|
8718
8809
|
"locationInModule": {
|
|
8719
8810
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8720
|
-
"line":
|
|
8811
|
+
"line": 320
|
|
8721
8812
|
},
|
|
8722
8813
|
"name": "failureDetection",
|
|
8723
8814
|
"optional": true,
|
|
@@ -8739,7 +8830,7 @@
|
|
|
8739
8830
|
"kind": "interface",
|
|
8740
8831
|
"locationInModule": {
|
|
8741
8832
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8742
|
-
"line":
|
|
8833
|
+
"line": 181
|
|
8743
8834
|
},
|
|
8744
8835
|
"name": "EC2InstanceRunningSchedulerProps",
|
|
8745
8836
|
"properties": [
|
|
@@ -8752,7 +8843,7 @@
|
|
|
8752
8843
|
"immutable": true,
|
|
8753
8844
|
"locationInModule": {
|
|
8754
8845
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8755
|
-
"line":
|
|
8846
|
+
"line": 187
|
|
8756
8847
|
},
|
|
8757
8848
|
"name": "secrets",
|
|
8758
8849
|
"type": {
|
|
@@ -8768,7 +8859,7 @@
|
|
|
8768
8859
|
"immutable": true,
|
|
8769
8860
|
"locationInModule": {
|
|
8770
8861
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8771
|
-
"line":
|
|
8862
|
+
"line": 183
|
|
8772
8863
|
},
|
|
8773
8864
|
"name": "targetResource",
|
|
8774
8865
|
"type": {
|
|
@@ -8785,7 +8876,7 @@
|
|
|
8785
8876
|
"immutable": true,
|
|
8786
8877
|
"locationInModule": {
|
|
8787
8878
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8788
|
-
"line":
|
|
8879
|
+
"line": 209
|
|
8789
8880
|
},
|
|
8790
8881
|
"name": "durable",
|
|
8791
8882
|
"optional": true,
|
|
@@ -8803,7 +8894,7 @@
|
|
|
8803
8894
|
"immutable": true,
|
|
8804
8895
|
"locationInModule": {
|
|
8805
8896
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8806
|
-
"line":
|
|
8897
|
+
"line": 185
|
|
8807
8898
|
},
|
|
8808
8899
|
"name": "enableScheduling",
|
|
8809
8900
|
"optional": true,
|
|
@@ -8822,12 +8913,12 @@
|
|
|
8822
8913
|
"immutable": true,
|
|
8823
8914
|
"locationInModule": {
|
|
8824
8915
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8825
|
-
"line":
|
|
8916
|
+
"line": 223
|
|
8826
8917
|
},
|
|
8827
8918
|
"name": "failureDetection",
|
|
8828
8919
|
"optional": true,
|
|
8829
8920
|
"type": {
|
|
8830
|
-
"fqn": "ec2-instance-running-scheduler.
|
|
8921
|
+
"fqn": "ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps"
|
|
8831
8922
|
}
|
|
8832
8923
|
},
|
|
8833
8924
|
{
|
|
@@ -8840,7 +8931,7 @@
|
|
|
8840
8931
|
"immutable": true,
|
|
8841
8932
|
"locationInModule": {
|
|
8842
8933
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8843
|
-
"line":
|
|
8934
|
+
"line": 215
|
|
8844
8935
|
},
|
|
8845
8936
|
"name": "logGroup",
|
|
8846
8937
|
"optional": true,
|
|
@@ -8858,7 +8949,7 @@
|
|
|
8858
8949
|
"immutable": true,
|
|
8859
8950
|
"locationInModule": {
|
|
8860
8951
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8861
|
-
"line":
|
|
8952
|
+
"line": 197
|
|
8862
8953
|
},
|
|
8863
8954
|
"name": "resourceWait",
|
|
8864
8955
|
"optional": true,
|
|
@@ -8876,7 +8967,7 @@
|
|
|
8876
8967
|
"immutable": true,
|
|
8877
8968
|
"locationInModule": {
|
|
8878
8969
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8879
|
-
"line":
|
|
8970
|
+
"line": 203
|
|
8880
8971
|
},
|
|
8881
8972
|
"name": "runtime",
|
|
8882
8973
|
"optional": true,
|
|
@@ -8893,7 +8984,7 @@
|
|
|
8893
8984
|
"immutable": true,
|
|
8894
8985
|
"locationInModule": {
|
|
8895
8986
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8896
|
-
"line":
|
|
8987
|
+
"line": 191
|
|
8897
8988
|
},
|
|
8898
8989
|
"name": "startSchedule",
|
|
8899
8990
|
"optional": true,
|
|
@@ -8910,7 +9001,7 @@
|
|
|
8910
9001
|
"immutable": true,
|
|
8911
9002
|
"locationInModule": {
|
|
8912
9003
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8913
|
-
"line":
|
|
9004
|
+
"line": 189
|
|
8914
9005
|
},
|
|
8915
9006
|
"name": "stopSchedule",
|
|
8916
9007
|
"optional": true,
|
|
@@ -8921,21 +9012,21 @@
|
|
|
8921
9012
|
],
|
|
8922
9013
|
"symbolId": "src/constructs/ec2-instance-running-scheduler:EC2InstanceRunningSchedulerProps"
|
|
8923
9014
|
},
|
|
8924
|
-
"ec2-instance-running-scheduler.
|
|
9015
|
+
"ec2-instance-running-scheduler.LambdaFailureDetection": {
|
|
8925
9016
|
"assembly": "ec2-instance-running-scheduler",
|
|
8926
9017
|
"datatype": true,
|
|
8927
9018
|
"docs": {
|
|
8928
|
-
"remarks": "When {@link
|
|
9019
|
+
"remarks": "When {@link LambdaFailureDetection.enabled} is true, alarms are created.\n{@link LambdaFailureDetection.alarmTopic} is optional; when omitted, alarms have no SNS actions.\nThe construct never creates an SNS topic.",
|
|
8929
9020
|
"stability": "stable",
|
|
8930
|
-
"summary": "
|
|
9021
|
+
"summary": "Opt-in options for {@link LambdaFailureDetector }."
|
|
8931
9022
|
},
|
|
8932
|
-
"fqn": "ec2-instance-running-scheduler.
|
|
9023
|
+
"fqn": "ec2-instance-running-scheduler.LambdaFailureDetection",
|
|
8933
9024
|
"kind": "interface",
|
|
8934
9025
|
"locationInModule": {
|
|
8935
|
-
"filename": "src/constructs/
|
|
8936
|
-
"line":
|
|
9026
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detection.ts",
|
|
9027
|
+
"line": 10
|
|
8937
9028
|
},
|
|
8938
|
-
"name": "
|
|
9029
|
+
"name": "LambdaFailureDetection",
|
|
8939
9030
|
"properties": [
|
|
8940
9031
|
{
|
|
8941
9032
|
"abstract": true,
|
|
@@ -8946,8 +9037,8 @@
|
|
|
8946
9037
|
},
|
|
8947
9038
|
"immutable": true,
|
|
8948
9039
|
"locationInModule": {
|
|
8949
|
-
"filename": "src/constructs/
|
|
8950
|
-
"line":
|
|
9040
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detection.ts",
|
|
9041
|
+
"line": 22
|
|
8951
9042
|
},
|
|
8952
9043
|
"name": "alarmTopic",
|
|
8953
9044
|
"optional": true,
|
|
@@ -8964,8 +9055,8 @@
|
|
|
8964
9055
|
},
|
|
8965
9056
|
"immutable": true,
|
|
8966
9057
|
"locationInModule": {
|
|
8967
|
-
"filename": "src/constructs/
|
|
8968
|
-
"line":
|
|
9058
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detection.ts",
|
|
9059
|
+
"line": 16
|
|
8969
9060
|
},
|
|
8970
9061
|
"name": "enabled",
|
|
8971
9062
|
"optional": true,
|
|
@@ -8974,7 +9065,372 @@
|
|
|
8974
9065
|
}
|
|
8975
9066
|
}
|
|
8976
9067
|
],
|
|
8977
|
-
"symbolId": "src/constructs/
|
|
9068
|
+
"symbolId": "src/constructs/lambda-failure-detector/lambda-failure-detection:LambdaFailureDetection"
|
|
9069
|
+
},
|
|
9070
|
+
"ec2-instance-running-scheduler.LambdaFailureDetector": {
|
|
9071
|
+
"assembly": "ec2-instance-running-scheduler",
|
|
9072
|
+
"base": "constructs.Construct",
|
|
9073
|
+
"docs": {
|
|
9074
|
+
"remarks": "Always creates a platform `AWS/Lambda` `Errors` alarm. Optionally creates one\nmetric filter + alarm per {@link LogFailureFilter}. Does not create an SNS topic;\npass {@link LambdaFailureDetectorProps.alarmTopic} to attach notifications.\n\nEntry module for `lambda-failure-detector/`: import types and helpers from this file only.",
|
|
9075
|
+
"stability": "stable",
|
|
9076
|
+
"summary": "CloudWatch failure detection for a Lambda function."
|
|
9077
|
+
},
|
|
9078
|
+
"fqn": "ec2-instance-running-scheduler.LambdaFailureDetector",
|
|
9079
|
+
"initializer": {
|
|
9080
|
+
"docs": {
|
|
9081
|
+
"stability": "stable"
|
|
9082
|
+
},
|
|
9083
|
+
"locationInModule": {
|
|
9084
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9085
|
+
"line": 139
|
|
9086
|
+
},
|
|
9087
|
+
"parameters": [
|
|
9088
|
+
{
|
|
9089
|
+
"docs": {
|
|
9090
|
+
"summary": "- Parent construct."
|
|
9091
|
+
},
|
|
9092
|
+
"name": "scope",
|
|
9093
|
+
"type": {
|
|
9094
|
+
"fqn": "constructs.Construct"
|
|
9095
|
+
}
|
|
9096
|
+
},
|
|
9097
|
+
{
|
|
9098
|
+
"docs": {
|
|
9099
|
+
"summary": "- Construct id."
|
|
9100
|
+
},
|
|
9101
|
+
"name": "id",
|
|
9102
|
+
"type": {
|
|
9103
|
+
"primitive": "string"
|
|
9104
|
+
}
|
|
9105
|
+
},
|
|
9106
|
+
{
|
|
9107
|
+
"docs": {
|
|
9108
|
+
"summary": "- Lambda, log group, optional topic, and log filters."
|
|
9109
|
+
},
|
|
9110
|
+
"name": "props",
|
|
9111
|
+
"type": {
|
|
9112
|
+
"fqn": "ec2-instance-running-scheduler.LambdaFailureDetectorProps"
|
|
9113
|
+
}
|
|
9114
|
+
}
|
|
9115
|
+
]
|
|
9116
|
+
},
|
|
9117
|
+
"kind": "class",
|
|
9118
|
+
"locationInModule": {
|
|
9119
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9120
|
+
"line": 123
|
|
9121
|
+
},
|
|
9122
|
+
"methods": [
|
|
9123
|
+
{
|
|
9124
|
+
"docs": {
|
|
9125
|
+
"returns": "Matching alarm, or undefined when the id was not in `logFilters`.",
|
|
9126
|
+
"stability": "stable",
|
|
9127
|
+
"summary": "Returns the log-filter alarm for the given filter id, or undefined when missing."
|
|
9128
|
+
},
|
|
9129
|
+
"locationInModule": {
|
|
9130
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9131
|
+
"line": 180
|
|
9132
|
+
},
|
|
9133
|
+
"name": "findLogFilterAlarm",
|
|
9134
|
+
"parameters": [
|
|
9135
|
+
{
|
|
9136
|
+
"docs": {
|
|
9137
|
+
"summary": "- Same as {@link LogFailureFilter.id}."
|
|
9138
|
+
},
|
|
9139
|
+
"name": "id",
|
|
9140
|
+
"type": {
|
|
9141
|
+
"primitive": "string"
|
|
9142
|
+
}
|
|
9143
|
+
}
|
|
9144
|
+
],
|
|
9145
|
+
"returns": {
|
|
9146
|
+
"optional": true,
|
|
9147
|
+
"type": {
|
|
9148
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Alarm"
|
|
9149
|
+
}
|
|
9150
|
+
}
|
|
9151
|
+
}
|
|
9152
|
+
],
|
|
9153
|
+
"name": "LambdaFailureDetector",
|
|
9154
|
+
"properties": [
|
|
9155
|
+
{
|
|
9156
|
+
"docs": {
|
|
9157
|
+
"stability": "stable",
|
|
9158
|
+
"summary": "Fires when the Lambda `Errors` metric is non-zero."
|
|
9159
|
+
},
|
|
9160
|
+
"immutable": true,
|
|
9161
|
+
"locationInModule": {
|
|
9162
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9163
|
+
"line": 127
|
|
9164
|
+
},
|
|
9165
|
+
"name": "lambdaErrorsAlarm",
|
|
9166
|
+
"type": {
|
|
9167
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Alarm"
|
|
9168
|
+
}
|
|
9169
|
+
},
|
|
9170
|
+
{
|
|
9171
|
+
"docs": {
|
|
9172
|
+
"stability": "stable",
|
|
9173
|
+
"summary": "Alarms for each log filter, in the same order as {@link LambdaFailureDetectorProps.logFilters}."
|
|
9174
|
+
},
|
|
9175
|
+
"immutable": true,
|
|
9176
|
+
"locationInModule": {
|
|
9177
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9178
|
+
"line": 132
|
|
9179
|
+
},
|
|
9180
|
+
"name": "logFilterAlarms",
|
|
9181
|
+
"type": {
|
|
9182
|
+
"collection": {
|
|
9183
|
+
"elementtype": {
|
|
9184
|
+
"fqn": "ec2-instance-running-scheduler.LogFailureAlarm"
|
|
9185
|
+
},
|
|
9186
|
+
"kind": "array"
|
|
9187
|
+
}
|
|
9188
|
+
}
|
|
9189
|
+
},
|
|
9190
|
+
{
|
|
9191
|
+
"docs": {
|
|
9192
|
+
"stability": "stable",
|
|
9193
|
+
"summary": "SNS topic used for alarm actions, when configured."
|
|
9194
|
+
},
|
|
9195
|
+
"immutable": true,
|
|
9196
|
+
"locationInModule": {
|
|
9197
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9198
|
+
"line": 125
|
|
9199
|
+
},
|
|
9200
|
+
"name": "alarmTopic",
|
|
9201
|
+
"optional": true,
|
|
9202
|
+
"type": {
|
|
9203
|
+
"fqn": "aws-cdk-lib.aws_sns.ITopic"
|
|
9204
|
+
}
|
|
9205
|
+
}
|
|
9206
|
+
],
|
|
9207
|
+
"symbolId": "src/constructs/lambda-failure-detector/lambda-failure-detector:LambdaFailureDetector"
|
|
9208
|
+
},
|
|
9209
|
+
"ec2-instance-running-scheduler.LambdaFailureDetectorProps": {
|
|
9210
|
+
"assembly": "ec2-instance-running-scheduler",
|
|
9211
|
+
"datatype": true,
|
|
9212
|
+
"docs": {
|
|
9213
|
+
"stability": "stable",
|
|
9214
|
+
"summary": "Props for {@link LambdaFailureDetector}."
|
|
9215
|
+
},
|
|
9216
|
+
"fqn": "ec2-instance-running-scheduler.LambdaFailureDetectorProps",
|
|
9217
|
+
"kind": "interface",
|
|
9218
|
+
"locationInModule": {
|
|
9219
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9220
|
+
"line": 40
|
|
9221
|
+
},
|
|
9222
|
+
"name": "LambdaFailureDetectorProps",
|
|
9223
|
+
"properties": [
|
|
9224
|
+
{
|
|
9225
|
+
"abstract": true,
|
|
9226
|
+
"docs": {
|
|
9227
|
+
"stability": "stable",
|
|
9228
|
+
"summary": "Lambda function whose platform `Errors` metric is alarmed."
|
|
9229
|
+
},
|
|
9230
|
+
"immutable": true,
|
|
9231
|
+
"locationInModule": {
|
|
9232
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9233
|
+
"line": 42
|
|
9234
|
+
},
|
|
9235
|
+
"name": "lambdaFunction",
|
|
9236
|
+
"type": {
|
|
9237
|
+
"fqn": "aws-cdk-lib.aws_lambda.IFunction"
|
|
9238
|
+
}
|
|
9239
|
+
},
|
|
9240
|
+
{
|
|
9241
|
+
"abstract": true,
|
|
9242
|
+
"docs": {
|
|
9243
|
+
"stability": "stable",
|
|
9244
|
+
"summary": "Log group used for {@link LogFailureFilter} metric filters."
|
|
9245
|
+
},
|
|
9246
|
+
"immutable": true,
|
|
9247
|
+
"locationInModule": {
|
|
9248
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9249
|
+
"line": 44
|
|
9250
|
+
},
|
|
9251
|
+
"name": "logGroup",
|
|
9252
|
+
"type": {
|
|
9253
|
+
"fqn": "aws-cdk-lib.aws_logs.ILogGroup"
|
|
9254
|
+
}
|
|
9255
|
+
},
|
|
9256
|
+
{
|
|
9257
|
+
"abstract": true,
|
|
9258
|
+
"docs": {
|
|
9259
|
+
"remarks": "When omitted, alarms are created without SNS actions.",
|
|
9260
|
+
"stability": "stable",
|
|
9261
|
+
"summary": "Optional SNS topic for all alarm actions."
|
|
9262
|
+
},
|
|
9263
|
+
"immutable": true,
|
|
9264
|
+
"locationInModule": {
|
|
9265
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9266
|
+
"line": 50
|
|
9267
|
+
},
|
|
9268
|
+
"name": "alarmTopic",
|
|
9269
|
+
"optional": true,
|
|
9270
|
+
"type": {
|
|
9271
|
+
"fqn": "aws-cdk-lib.aws_sns.ITopic"
|
|
9272
|
+
}
|
|
9273
|
+
},
|
|
9274
|
+
{
|
|
9275
|
+
"abstract": true,
|
|
9276
|
+
"docs": {
|
|
9277
|
+
"default": "no log-based alarms",
|
|
9278
|
+
"remarks": "Each entry creates a metric filter and alarm.",
|
|
9279
|
+
"stability": "stable",
|
|
9280
|
+
"summary": "Log-based failure filters."
|
|
9281
|
+
},
|
|
9282
|
+
"immutable": true,
|
|
9283
|
+
"locationInModule": {
|
|
9284
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9285
|
+
"line": 56
|
|
9286
|
+
},
|
|
9287
|
+
"name": "logFilters",
|
|
9288
|
+
"optional": true,
|
|
9289
|
+
"type": {
|
|
9290
|
+
"collection": {
|
|
9291
|
+
"elementtype": {
|
|
9292
|
+
"fqn": "ec2-instance-running-scheduler.LogFailureFilter"
|
|
9293
|
+
},
|
|
9294
|
+
"kind": "array"
|
|
9295
|
+
}
|
|
9296
|
+
}
|
|
9297
|
+
}
|
|
9298
|
+
],
|
|
9299
|
+
"symbolId": "src/constructs/lambda-failure-detector/lambda-failure-detector:LambdaFailureDetectorProps"
|
|
9300
|
+
},
|
|
9301
|
+
"ec2-instance-running-scheduler.LogFailureAlarm": {
|
|
9302
|
+
"assembly": "ec2-instance-running-scheduler",
|
|
9303
|
+
"datatype": true,
|
|
9304
|
+
"docs": {
|
|
9305
|
+
"stability": "stable",
|
|
9306
|
+
"summary": "Alarm created for one {@link LogFailureFilter}."
|
|
9307
|
+
},
|
|
9308
|
+
"fqn": "ec2-instance-running-scheduler.LogFailureAlarm",
|
|
9309
|
+
"kind": "interface",
|
|
9310
|
+
"locationInModule": {
|
|
9311
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9312
|
+
"line": 30
|
|
9313
|
+
},
|
|
9314
|
+
"name": "LogFailureAlarm",
|
|
9315
|
+
"properties": [
|
|
9316
|
+
{
|
|
9317
|
+
"abstract": true,
|
|
9318
|
+
"docs": {
|
|
9319
|
+
"stability": "stable",
|
|
9320
|
+
"summary": "Alarm on the log metric filter sum."
|
|
9321
|
+
},
|
|
9322
|
+
"immutable": true,
|
|
9323
|
+
"locationInModule": {
|
|
9324
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9325
|
+
"line": 34
|
|
9326
|
+
},
|
|
9327
|
+
"name": "alarm",
|
|
9328
|
+
"type": {
|
|
9329
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Alarm"
|
|
9330
|
+
}
|
|
9331
|
+
},
|
|
9332
|
+
{
|
|
9333
|
+
"abstract": true,
|
|
9334
|
+
"docs": {
|
|
9335
|
+
"stability": "stable",
|
|
9336
|
+
"summary": "Same as {@link LogFailureFilter.id}."
|
|
9337
|
+
},
|
|
9338
|
+
"immutable": true,
|
|
9339
|
+
"locationInModule": {
|
|
9340
|
+
"filename": "src/constructs/lambda-failure-detector/lambda-failure-detector.ts",
|
|
9341
|
+
"line": 32
|
|
9342
|
+
},
|
|
9343
|
+
"name": "id",
|
|
9344
|
+
"type": {
|
|
9345
|
+
"primitive": "string"
|
|
9346
|
+
}
|
|
9347
|
+
}
|
|
9348
|
+
],
|
|
9349
|
+
"symbolId": "src/constructs/lambda-failure-detector/lambda-failure-detector:LogFailureAlarm"
|
|
9350
|
+
},
|
|
9351
|
+
"ec2-instance-running-scheduler.LogFailureFilter": {
|
|
9352
|
+
"assembly": "ec2-instance-running-scheduler",
|
|
9353
|
+
"datatype": true,
|
|
9354
|
+
"docs": {
|
|
9355
|
+
"remarks": "Creates a CloudWatch Logs metric filter and an alarm on the resulting sum metric.",
|
|
9356
|
+
"stability": "stable",
|
|
9357
|
+
"summary": "One log-based failure signal for {@link LambdaFailureDetector }."
|
|
9358
|
+
},
|
|
9359
|
+
"fqn": "ec2-instance-running-scheduler.LogFailureFilter",
|
|
9360
|
+
"kind": "interface",
|
|
9361
|
+
"locationInModule": {
|
|
9362
|
+
"filename": "src/constructs/lambda-failure-detector/log-failure-filter.ts",
|
|
9363
|
+
"line": 6
|
|
9364
|
+
},
|
|
9365
|
+
"name": "LogFailureFilter",
|
|
9366
|
+
"properties": [
|
|
9367
|
+
{
|
|
9368
|
+
"abstract": true,
|
|
9369
|
+
"docs": {
|
|
9370
|
+
"example": "'\"ResourceWaitFailed\"'",
|
|
9371
|
+
"stability": "stable",
|
|
9372
|
+
"summary": "CloudWatch Logs filter pattern string passed to `FilterPattern.literal`."
|
|
9373
|
+
},
|
|
9374
|
+
"immutable": true,
|
|
9375
|
+
"locationInModule": {
|
|
9376
|
+
"filename": "src/constructs/lambda-failure-detector/log-failure-filter.ts",
|
|
9377
|
+
"line": 17
|
|
9378
|
+
},
|
|
9379
|
+
"name": "filterPattern",
|
|
9380
|
+
"type": {
|
|
9381
|
+
"primitive": "string"
|
|
9382
|
+
}
|
|
9383
|
+
},
|
|
9384
|
+
{
|
|
9385
|
+
"abstract": true,
|
|
9386
|
+
"docs": {
|
|
9387
|
+
"stability": "stable",
|
|
9388
|
+
"summary": "Stable id used as the MetricFilter / Alarm construct id prefix (e.g. `InstanceStatusFailure` → `InstanceStatusFailureMetric`)."
|
|
9389
|
+
},
|
|
9390
|
+
"immutable": true,
|
|
9391
|
+
"locationInModule": {
|
|
9392
|
+
"filename": "src/constructs/lambda-failure-detector/log-failure-filter.ts",
|
|
9393
|
+
"line": 11
|
|
9394
|
+
},
|
|
9395
|
+
"name": "id",
|
|
9396
|
+
"type": {
|
|
9397
|
+
"primitive": "string"
|
|
9398
|
+
}
|
|
9399
|
+
},
|
|
9400
|
+
{
|
|
9401
|
+
"abstract": true,
|
|
9402
|
+
"docs": {
|
|
9403
|
+
"stability": "stable",
|
|
9404
|
+
"summary": "Custom metric name for the metric filter."
|
|
9405
|
+
},
|
|
9406
|
+
"immutable": true,
|
|
9407
|
+
"locationInModule": {
|
|
9408
|
+
"filename": "src/constructs/lambda-failure-detector/log-failure-filter.ts",
|
|
9409
|
+
"line": 21
|
|
9410
|
+
},
|
|
9411
|
+
"name": "metricName",
|
|
9412
|
+
"type": {
|
|
9413
|
+
"primitive": "string"
|
|
9414
|
+
}
|
|
9415
|
+
},
|
|
9416
|
+
{
|
|
9417
|
+
"abstract": true,
|
|
9418
|
+
"docs": {
|
|
9419
|
+
"stability": "stable",
|
|
9420
|
+
"summary": "Custom metric namespace for the metric filter."
|
|
9421
|
+
},
|
|
9422
|
+
"immutable": true,
|
|
9423
|
+
"locationInModule": {
|
|
9424
|
+
"filename": "src/constructs/lambda-failure-detector/log-failure-filter.ts",
|
|
9425
|
+
"line": 19
|
|
9426
|
+
},
|
|
9427
|
+
"name": "metricNamespace",
|
|
9428
|
+
"type": {
|
|
9429
|
+
"primitive": "string"
|
|
9430
|
+
}
|
|
9431
|
+
}
|
|
9432
|
+
],
|
|
9433
|
+
"symbolId": "src/constructs/lambda-failure-detector/log-failure-filter:LogFailureFilter"
|
|
8978
9434
|
},
|
|
8979
9435
|
"ec2-instance-running-scheduler.ResourceWaitLimits": {
|
|
8980
9436
|
"assembly": "ec2-instance-running-scheduler",
|
|
@@ -8989,7 +9445,7 @@
|
|
|
8989
9445
|
"kind": "interface",
|
|
8990
9446
|
"locationInModule": {
|
|
8991
9447
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
8992
|
-
"line":
|
|
9448
|
+
"line": 87
|
|
8993
9449
|
},
|
|
8994
9450
|
"name": "ResourceWaitLimits",
|
|
8995
9451
|
"properties": [
|
|
@@ -9003,7 +9459,7 @@
|
|
|
9003
9459
|
"immutable": true,
|
|
9004
9460
|
"locationInModule": {
|
|
9005
9461
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9006
|
-
"line":
|
|
9462
|
+
"line": 99
|
|
9007
9463
|
},
|
|
9008
9464
|
"name": "maxElapsedSeconds",
|
|
9009
9465
|
"optional": true,
|
|
@@ -9021,7 +9477,7 @@
|
|
|
9021
9477
|
"immutable": true,
|
|
9022
9478
|
"locationInModule": {
|
|
9023
9479
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9024
|
-
"line":
|
|
9480
|
+
"line": 93
|
|
9025
9481
|
},
|
|
9026
9482
|
"name": "maxLoopCount",
|
|
9027
9483
|
"optional": true,
|
|
@@ -9040,7 +9496,7 @@
|
|
|
9040
9496
|
"immutable": true,
|
|
9041
9497
|
"locationInModule": {
|
|
9042
9498
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9043
|
-
"line":
|
|
9499
|
+
"line": 107
|
|
9044
9500
|
},
|
|
9045
9501
|
"name": "statusChangeWaitSeconds",
|
|
9046
9502
|
"optional": true,
|
|
@@ -9062,7 +9518,7 @@
|
|
|
9062
9518
|
"kind": "interface",
|
|
9063
9519
|
"locationInModule": {
|
|
9064
9520
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9065
|
-
"line":
|
|
9521
|
+
"line": 143
|
|
9066
9522
|
},
|
|
9067
9523
|
"name": "RunningSchedulerDurableProps",
|
|
9068
9524
|
"properties": [
|
|
@@ -9077,7 +9533,7 @@
|
|
|
9077
9533
|
"immutable": true,
|
|
9078
9534
|
"locationInModule": {
|
|
9079
9535
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9080
|
-
"line":
|
|
9536
|
+
"line": 151
|
|
9081
9537
|
},
|
|
9082
9538
|
"name": "executionTimeout",
|
|
9083
9539
|
"optional": true,
|
|
@@ -9095,7 +9551,7 @@
|
|
|
9095
9551
|
"immutable": true,
|
|
9096
9552
|
"locationInModule": {
|
|
9097
9553
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9098
|
-
"line":
|
|
9554
|
+
"line": 157
|
|
9099
9555
|
},
|
|
9100
9556
|
"name": "retentionPeriod",
|
|
9101
9557
|
"optional": true,
|
|
@@ -9108,11 +9564,11 @@
|
|
|
9108
9564
|
},
|
|
9109
9565
|
"ec2-instance-running-scheduler.RunningSchedulerFailureDetection": {
|
|
9110
9566
|
"assembly": "ec2-instance-running-scheduler",
|
|
9111
|
-
"base": "
|
|
9567
|
+
"base": "ec2-instance-running-scheduler.LambdaFailureDetector",
|
|
9112
9568
|
"docs": {
|
|
9113
|
-
"remarks": "
|
|
9569
|
+
"remarks": "Extends {@link LambdaFailureDetector} with scheduler-specific log filters:\n- `lambdaErrorsAlarm` – `AWS/Lambda` `Errors` metric.\n- `instanceStatusFailureAlarm` – log filter for `ResourceWaitFailed:*`.\n- `slackPostFailureAlarm` – log filter for `running-scheduler: Slack post failed`.\n- `durableExecutionFailureAlarm` – other handler-level `ERROR` logs (excluding the above).\n\nCustom metrics are published under the `EC2InstanceRunningScheduler` namespace.",
|
|
9114
9570
|
"stability": "stable",
|
|
9115
|
-
"summary": "CloudWatch alarms and log-based metrics for the running scheduler
|
|
9571
|
+
"summary": "CloudWatch alarms and log-based metrics for the EC2 instance running scheduler."
|
|
9116
9572
|
},
|
|
9117
9573
|
"fqn": "ec2-instance-running-scheduler.RunningSchedulerFailureDetection",
|
|
9118
9574
|
"initializer": {
|
|
@@ -9121,7 +9577,7 @@
|
|
|
9121
9577
|
},
|
|
9122
9578
|
"locationInModule": {
|
|
9123
9579
|
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9124
|
-
"line":
|
|
9580
|
+
"line": 123
|
|
9125
9581
|
},
|
|
9126
9582
|
"parameters": [
|
|
9127
9583
|
{
|
|
@@ -9144,11 +9600,11 @@
|
|
|
9144
9600
|
},
|
|
9145
9601
|
{
|
|
9146
9602
|
"docs": {
|
|
9147
|
-
"summary": "- Lambda, log group, and
|
|
9603
|
+
"summary": "- Lambda, log group, and optional alarm notification topic."
|
|
9148
9604
|
},
|
|
9149
9605
|
"name": "props",
|
|
9150
9606
|
"type": {
|
|
9151
|
-
"fqn": "ec2-instance-running-scheduler.
|
|
9607
|
+
"fqn": "ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps"
|
|
9152
9608
|
}
|
|
9153
9609
|
}
|
|
9154
9610
|
]
|
|
@@ -9156,7 +9612,7 @@
|
|
|
9156
9612
|
"kind": "class",
|
|
9157
9613
|
"locationInModule": {
|
|
9158
9614
|
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9159
|
-
"line":
|
|
9615
|
+
"line": 110
|
|
9160
9616
|
},
|
|
9161
9617
|
"name": "RunningSchedulerFailureDetection",
|
|
9162
9618
|
"properties": [
|
|
@@ -9168,7 +9624,7 @@
|
|
|
9168
9624
|
"immutable": true,
|
|
9169
9625
|
"locationInModule": {
|
|
9170
9626
|
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9171
|
-
"line":
|
|
9627
|
+
"line": 116
|
|
9172
9628
|
},
|
|
9173
9629
|
"name": "durableExecutionFailureAlarm",
|
|
9174
9630
|
"type": {
|
|
@@ -9183,28 +9639,13 @@
|
|
|
9183
9639
|
"immutable": true,
|
|
9184
9640
|
"locationInModule": {
|
|
9185
9641
|
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9186
|
-
"line":
|
|
9642
|
+
"line": 112
|
|
9187
9643
|
},
|
|
9188
9644
|
"name": "instanceStatusFailureAlarm",
|
|
9189
9645
|
"type": {
|
|
9190
9646
|
"fqn": "aws-cdk-lib.aws_cloudwatch.Alarm"
|
|
9191
9647
|
}
|
|
9192
9648
|
},
|
|
9193
|
-
{
|
|
9194
|
-
"docs": {
|
|
9195
|
-
"stability": "stable",
|
|
9196
|
-
"summary": "Fires when the Lambda `Errors` metric is non-zero."
|
|
9197
|
-
},
|
|
9198
|
-
"immutable": true,
|
|
9199
|
-
"locationInModule": {
|
|
9200
|
-
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9201
|
-
"line": 119
|
|
9202
|
-
},
|
|
9203
|
-
"name": "lambdaErrorsAlarm",
|
|
9204
|
-
"type": {
|
|
9205
|
-
"fqn": "aws-cdk-lib.aws_cloudwatch.Alarm"
|
|
9206
|
-
}
|
|
9207
|
-
},
|
|
9208
9649
|
{
|
|
9209
9650
|
"docs": {
|
|
9210
9651
|
"stability": "stable",
|
|
@@ -9213,28 +9654,12 @@
|
|
|
9213
9654
|
"immutable": true,
|
|
9214
9655
|
"locationInModule": {
|
|
9215
9656
|
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9216
|
-
"line":
|
|
9657
|
+
"line": 114
|
|
9217
9658
|
},
|
|
9218
9659
|
"name": "slackPostFailureAlarm",
|
|
9219
9660
|
"type": {
|
|
9220
9661
|
"fqn": "aws-cdk-lib.aws_cloudwatch.Alarm"
|
|
9221
9662
|
}
|
|
9222
|
-
},
|
|
9223
|
-
{
|
|
9224
|
-
"docs": {
|
|
9225
|
-
"stability": "stable",
|
|
9226
|
-
"summary": "SNS topic used for alarm actions, when configured."
|
|
9227
|
-
},
|
|
9228
|
-
"immutable": true,
|
|
9229
|
-
"locationInModule": {
|
|
9230
|
-
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9231
|
-
"line": 117
|
|
9232
|
-
},
|
|
9233
|
-
"name": "alarmTopic",
|
|
9234
|
-
"optional": true,
|
|
9235
|
-
"type": {
|
|
9236
|
-
"fqn": "aws-cdk-lib.aws_sns.ITopic"
|
|
9237
|
-
}
|
|
9238
9663
|
}
|
|
9239
9664
|
],
|
|
9240
9665
|
"symbolId": "src/constructs/running-scheduler-failure-detection:RunningSchedulerFailureDetection"
|
|
@@ -9243,67 +9668,86 @@
|
|
|
9243
9668
|
"assembly": "ec2-instance-running-scheduler",
|
|
9244
9669
|
"datatype": true,
|
|
9245
9670
|
"docs": {
|
|
9671
|
+
"remarks": "Pass as `EC2InstanceRunningSchedulerProps.failureDetection`. Extends\n{@link LambdaFailureDetection} (`enabled` / `alarmTopic`). Which log failures are\nmonitored is defined in this module and applied by {@link RunningSchedulerFailureDetection}.",
|
|
9246
9672
|
"stability": "stable",
|
|
9247
|
-
"summary": "
|
|
9673
|
+
"summary": "Opt-in failure detection for `EC2InstanceRunningScheduler`."
|
|
9248
9674
|
},
|
|
9249
9675
|
"fqn": "ec2-instance-running-scheduler.RunningSchedulerFailureDetectionProps",
|
|
9676
|
+
"interfaces": [
|
|
9677
|
+
"ec2-instance-running-scheduler.LambdaFailureDetection"
|
|
9678
|
+
],
|
|
9250
9679
|
"kind": "interface",
|
|
9251
9680
|
"locationInModule": {
|
|
9252
9681
|
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9253
|
-
"line":
|
|
9682
|
+
"line": 65
|
|
9254
9683
|
},
|
|
9255
9684
|
"name": "RunningSchedulerFailureDetectionProps",
|
|
9685
|
+
"symbolId": "src/constructs/running-scheduler-failure-detection:RunningSchedulerFailureDetectionProps"
|
|
9686
|
+
},
|
|
9687
|
+
"ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps": {
|
|
9688
|
+
"assembly": "ec2-instance-running-scheduler",
|
|
9689
|
+
"datatype": true,
|
|
9690
|
+
"docs": {
|
|
9691
|
+
"remarks": "Normally `EC2InstanceRunningScheduler` creates this binding. Use directly only when\ncomposing failure detection outside the scheduler construct.",
|
|
9692
|
+
"stability": "stable",
|
|
9693
|
+
"summary": "Lambda and log group monitored by {@link RunningSchedulerFailureDetection}."
|
|
9694
|
+
},
|
|
9695
|
+
"fqn": "ec2-instance-running-scheduler.RunningSchedulerFailureDetectionResourcesProps",
|
|
9696
|
+
"kind": "interface",
|
|
9697
|
+
"locationInModule": {
|
|
9698
|
+
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9699
|
+
"line": 73
|
|
9700
|
+
},
|
|
9701
|
+
"name": "RunningSchedulerFailureDetectionResourcesProps",
|
|
9256
9702
|
"properties": [
|
|
9257
9703
|
{
|
|
9258
9704
|
"abstract": true,
|
|
9259
9705
|
"docs": {
|
|
9260
|
-
"stability": "stable"
|
|
9261
|
-
"summary": "Alarm configuration (must have {@link FailureDetectionAlarms.enabled} true)."
|
|
9706
|
+
"stability": "stable"
|
|
9262
9707
|
},
|
|
9263
9708
|
"immutable": true,
|
|
9264
9709
|
"locationInModule": {
|
|
9265
9710
|
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9266
|
-
"line":
|
|
9711
|
+
"line": 76
|
|
9267
9712
|
},
|
|
9268
|
-
"name": "
|
|
9713
|
+
"name": "logGroup",
|
|
9269
9714
|
"type": {
|
|
9270
|
-
"fqn": "
|
|
9715
|
+
"fqn": "aws-cdk-lib.aws_logs.ILogGroup"
|
|
9271
9716
|
}
|
|
9272
9717
|
},
|
|
9273
9718
|
{
|
|
9274
9719
|
"abstract": true,
|
|
9275
9720
|
"docs": {
|
|
9276
|
-
"stability": "stable"
|
|
9277
|
-
"summary": "Application log group for the running scheduler Lambda."
|
|
9721
|
+
"stability": "stable"
|
|
9278
9722
|
},
|
|
9279
9723
|
"immutable": true,
|
|
9280
9724
|
"locationInModule": {
|
|
9281
9725
|
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9282
|
-
"line":
|
|
9726
|
+
"line": 75
|
|
9283
9727
|
},
|
|
9284
|
-
"name": "
|
|
9728
|
+
"name": "runningScheduleFunction",
|
|
9285
9729
|
"type": {
|
|
9286
|
-
"fqn": "aws-cdk-lib.
|
|
9730
|
+
"fqn": "aws-cdk-lib.aws_lambda.IFunction"
|
|
9287
9731
|
}
|
|
9288
9732
|
},
|
|
9289
9733
|
{
|
|
9290
9734
|
"abstract": true,
|
|
9291
9735
|
"docs": {
|
|
9292
|
-
"stability": "stable"
|
|
9293
|
-
"summary": "Running scheduler Lambda to monitor."
|
|
9736
|
+
"stability": "stable"
|
|
9294
9737
|
},
|
|
9295
9738
|
"immutable": true,
|
|
9296
9739
|
"locationInModule": {
|
|
9297
9740
|
"filename": "src/constructs/running-scheduler-failure-detection.ts",
|
|
9298
|
-
"line":
|
|
9741
|
+
"line": 74
|
|
9299
9742
|
},
|
|
9300
|
-
"name": "
|
|
9743
|
+
"name": "alarmTopic",
|
|
9744
|
+
"optional": true,
|
|
9301
9745
|
"type": {
|
|
9302
|
-
"fqn": "aws-cdk-lib.
|
|
9746
|
+
"fqn": "aws-cdk-lib.aws_sns.ITopic"
|
|
9303
9747
|
}
|
|
9304
9748
|
}
|
|
9305
9749
|
],
|
|
9306
|
-
"symbolId": "src/constructs/running-scheduler-failure-detection:
|
|
9750
|
+
"symbolId": "src/constructs/running-scheduler-failure-detection:RunningSchedulerFailureDetectionResourcesProps"
|
|
9307
9751
|
},
|
|
9308
9752
|
"ec2-instance-running-scheduler.RunningSchedulerLogGroupProps": {
|
|
9309
9753
|
"assembly": "ec2-instance-running-scheduler",
|
|
@@ -9316,7 +9760,7 @@
|
|
|
9316
9760
|
"kind": "interface",
|
|
9317
9761
|
"locationInModule": {
|
|
9318
9762
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9319
|
-
"line":
|
|
9763
|
+
"line": 163
|
|
9320
9764
|
},
|
|
9321
9765
|
"name": "RunningSchedulerLogGroupProps",
|
|
9322
9766
|
"properties": [
|
|
@@ -9330,7 +9774,7 @@
|
|
|
9330
9774
|
"immutable": true,
|
|
9331
9775
|
"locationInModule": {
|
|
9332
9776
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9333
|
-
"line":
|
|
9777
|
+
"line": 175
|
|
9334
9778
|
},
|
|
9335
9779
|
"name": "removalPolicy",
|
|
9336
9780
|
"optional": true,
|
|
@@ -9348,7 +9792,7 @@
|
|
|
9348
9792
|
"immutable": true,
|
|
9349
9793
|
"locationInModule": {
|
|
9350
9794
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9351
|
-
"line":
|
|
9795
|
+
"line": 169
|
|
9352
9796
|
},
|
|
9353
9797
|
"name": "retention",
|
|
9354
9798
|
"optional": true,
|
|
@@ -9371,7 +9815,7 @@
|
|
|
9371
9815
|
"kind": "interface",
|
|
9372
9816
|
"locationInModule": {
|
|
9373
9817
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9374
|
-
"line":
|
|
9818
|
+
"line": 116
|
|
9375
9819
|
},
|
|
9376
9820
|
"name": "RunningSchedulerRuntimeProps",
|
|
9377
9821
|
"properties": [
|
|
@@ -9385,7 +9829,7 @@
|
|
|
9385
9829
|
"immutable": true,
|
|
9386
9830
|
"locationInModule": {
|
|
9387
9831
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9388
|
-
"line":
|
|
9832
|
+
"line": 137
|
|
9389
9833
|
},
|
|
9390
9834
|
"name": "maxConcurrency",
|
|
9391
9835
|
"optional": true,
|
|
@@ -9403,7 +9847,7 @@
|
|
|
9403
9847
|
"immutable": true,
|
|
9404
9848
|
"locationInModule": {
|
|
9405
9849
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9406
|
-
"line":
|
|
9850
|
+
"line": 122
|
|
9407
9851
|
},
|
|
9408
9852
|
"name": "memorySize",
|
|
9409
9853
|
"optional": true,
|
|
@@ -9422,7 +9866,7 @@
|
|
|
9422
9866
|
"immutable": true,
|
|
9423
9867
|
"locationInModule": {
|
|
9424
9868
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9425
|
-
"line":
|
|
9869
|
+
"line": 131
|
|
9426
9870
|
},
|
|
9427
9871
|
"name": "timeout",
|
|
9428
9872
|
"optional": true,
|
|
@@ -9444,7 +9888,7 @@
|
|
|
9444
9888
|
"kind": "interface",
|
|
9445
9889
|
"locationInModule": {
|
|
9446
9890
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9447
|
-
"line":
|
|
9891
|
+
"line": 45
|
|
9448
9892
|
},
|
|
9449
9893
|
"name": "Schedule",
|
|
9450
9894
|
"properties": [
|
|
@@ -9457,7 +9901,7 @@
|
|
|
9457
9901
|
"immutable": true,
|
|
9458
9902
|
"locationInModule": {
|
|
9459
9903
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9460
|
-
"line":
|
|
9904
|
+
"line": 47
|
|
9461
9905
|
},
|
|
9462
9906
|
"name": "timezone",
|
|
9463
9907
|
"type": {
|
|
@@ -9473,7 +9917,7 @@
|
|
|
9473
9917
|
"immutable": true,
|
|
9474
9918
|
"locationInModule": {
|
|
9475
9919
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9476
|
-
"line":
|
|
9920
|
+
"line": 51
|
|
9477
9921
|
},
|
|
9478
9922
|
"name": "hour",
|
|
9479
9923
|
"optional": true,
|
|
@@ -9490,7 +9934,7 @@
|
|
|
9490
9934
|
"immutable": true,
|
|
9491
9935
|
"locationInModule": {
|
|
9492
9936
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9493
|
-
"line":
|
|
9937
|
+
"line": 49
|
|
9494
9938
|
},
|
|
9495
9939
|
"name": "minute",
|
|
9496
9940
|
"optional": true,
|
|
@@ -9507,7 +9951,7 @@
|
|
|
9507
9951
|
"immutable": true,
|
|
9508
9952
|
"locationInModule": {
|
|
9509
9953
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9510
|
-
"line":
|
|
9954
|
+
"line": 53
|
|
9511
9955
|
},
|
|
9512
9956
|
"name": "week",
|
|
9513
9957
|
"optional": true,
|
|
@@ -9529,7 +9973,7 @@
|
|
|
9529
9973
|
"kind": "interface",
|
|
9530
9974
|
"locationInModule": {
|
|
9531
9975
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9532
|
-
"line":
|
|
9976
|
+
"line": 73
|
|
9533
9977
|
},
|
|
9534
9978
|
"name": "Secrets",
|
|
9535
9979
|
"properties": [
|
|
@@ -9542,7 +9986,7 @@
|
|
|
9542
9986
|
"immutable": true,
|
|
9543
9987
|
"locationInModule": {
|
|
9544
9988
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9545
|
-
"line":
|
|
9989
|
+
"line": 75
|
|
9546
9990
|
},
|
|
9547
9991
|
"name": "slackSecretName",
|
|
9548
9992
|
"type": {
|
|
@@ -9564,7 +10008,7 @@
|
|
|
9564
10008
|
"kind": "interface",
|
|
9565
10009
|
"locationInModule": {
|
|
9566
10010
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9567
|
-
"line":
|
|
10011
|
+
"line": 63
|
|
9568
10012
|
},
|
|
9569
10013
|
"name": "TargetResource",
|
|
9570
10014
|
"properties": [
|
|
@@ -9577,7 +10021,7 @@
|
|
|
9577
10021
|
"immutable": true,
|
|
9578
10022
|
"locationInModule": {
|
|
9579
10023
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9580
|
-
"line":
|
|
10024
|
+
"line": 65
|
|
9581
10025
|
},
|
|
9582
10026
|
"name": "tagKey",
|
|
9583
10027
|
"type": {
|
|
@@ -9593,7 +10037,7 @@
|
|
|
9593
10037
|
"immutable": true,
|
|
9594
10038
|
"locationInModule": {
|
|
9595
10039
|
"filename": "src/constructs/ec2-instance-running-scheduler.ts",
|
|
9596
|
-
"line":
|
|
10040
|
+
"line": 67
|
|
9597
10041
|
},
|
|
9598
10042
|
"name": "tagValues",
|
|
9599
10043
|
"type": {
|
|
@@ -9609,6 +10053,6 @@
|
|
|
9609
10053
|
"symbolId": "src/constructs/ec2-instance-running-scheduler:TargetResource"
|
|
9610
10054
|
}
|
|
9611
10055
|
},
|
|
9612
|
-
"version": "0.
|
|
9613
|
-
"fingerprint": "
|
|
10056
|
+
"version": "0.5.0",
|
|
10057
|
+
"fingerprint": "Y4AgVRtKrZ81hhbEaSnSXMSRTasWZAGCNvoEpY16slM="
|
|
9614
10058
|
}
|