ec2-instance-running-scheduler 0.1.9 → 0.2.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/.jsii CHANGED
@@ -8435,14 +8435,20 @@
8435
8435
  }
8436
8436
  }
8437
8437
  },
8438
- "description": "ec2-instance-running-scheduler",
8438
+ "description": "AWS 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, polls 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.",
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
8443
  "jsiiVersion": "5.9.44 (build 150b837)",
8444
8444
  "keywords": [
8445
- "cdk"
8445
+ "cdk",
8446
+ "durable",
8447
+ "ec2",
8448
+ "execution",
8449
+ "lambda",
8450
+ "scheduler",
8451
+ "slack"
8446
8452
  ],
8447
8453
  "license": "Apache-2.0",
8448
8454
  "metadata": {
@@ -8455,7 +8461,7 @@
8455
8461
  },
8456
8462
  "name": "ec2-instance-running-scheduler",
8457
8463
  "readme": {
8458
- "markdown": "# EC2 Instance Running Scheduler (AWS CDK v2)\n\n[![GitHub](https://img.shields.io/github/license/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler?style=flat-square)](https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/blob/main/LICENSE)\n[![npm](https://img.shields.io/npm/v/ec2-instance-running-scheduler?style=flat-square)](https://www.npmjs.com/package/ec2-instance-running-scheduler)\n[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/release.yml?branch=main&label=release&style=flat-square)](https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/actions/workflows/release.yml)\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler?sort=semver&style=flat-square)](https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/releases)\n\n[![View on Construct Hub](https://constructs.dev/badge?package=ec2-instance-running-scheduler)](https://constructs.dev/packages/ec2-instance-running-scheduler)\n\nAWS CDK construct 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**, runs start/stop and **polls until the instance reaches the 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** (invocation, EC2 transitions, Slack steps, completion) 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 polling** – After start/stop, the function waits and re-describes instances until `running` (start mode) or `stopped` (stop mode), or until a terminal error.\n- **Slack notifications** – Required for a successful run: parent message plus threaded updates per instance; credentials come from Secrets Manager (`token` and `channel` JSON). The secret name is passed as **`SLACK_SECRET_NAME`** on the function (from `secrets.slackSecretName`) and validated at runtime via **safe-env-getter**.\n- **Structured logging** – The handler uses the durable execution **`ctx.logger`** for traceable JSON application logs (e.g. invocation, describe/start/stop/wait loops, target count, Slack posts, errors before instance state failures).\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** – EC2 and tagging API permissions, Slack secret read grant, **Parameters and Secrets Lambda Extension** (configured on the function for secret access patterns), JSON logging with configurable system/application levels, and a dedicated log group (construct defaults).\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 { EC2InstanceRunningScheduler } from 'ec2-instance-running-scheduler';\n\nconst app = new cdk.App();\nconst stack = new cdk.Stack(app, 'MyStack');\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});\n```\n\nUse the **stack** `EC2InstanceRunningScheduleStack` when deploying the scheduler as its own stack. It accepts the **same scheduler options** as the construct (plus standard `StackProps` such as `env`).\n\n```typescript\nimport * as cdk from 'aws-cdk-lib';\nimport { TimeZone } from 'aws-cdk-lib';\nimport { EC2InstanceRunningScheduleStack } from 'ec2-instance-running-scheduler';\n\nconst app = new cdk.App();\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});\n```\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 **`SLACK_SECRET_NAME`** set to `secrets.slackSecretName`.\n\n## Options\n\nThese options apply to **`EC2InstanceRunningScheduler`** and to **`EC2InstanceRunningScheduleStack`** (stack props include them alongside `StackProps`).\n\n| Option | Type | Required | Description |\n|--------|------|----------|-------------|\n| `targetResource` | `TargetResource` | Yes | Tag key and values used to select EC2 instances. |\n| `secrets` | `Secrets` | Yes | Identifies the Secrets Manager secret used 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\n### TargetResource\n\n- `tagKey` – Tag key used to select instances (e.g. `Schedule`).\n- `tagValues` – Tag values that must match (e.g. `['YES']`).\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`). The construct sets **`SLACK_SECRET_NAME`** on the function to this value; the handler reads and validates it at runtime (via **safe-env-getter**).\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** (requires **Node.js 22+** in the deployment region—runtime is the latest Node.js available in the region per the construct), a **live alias**, **Parameters and Secrets Lambda Extension**; EC2 (describe/start/stop); Resource Groups Tagging API; Secrets Manager. The deployed function uses **arm64**, Durable Execution–compatible IAM and settings, and a bundled handler that loads secrets via **aws-lambda-secret-fetcher**.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n"
8464
+ "markdown": "# EC2 Instance Running Scheduler (AWS CDK v2)\n\n[![GitHub](https://img.shields.io/github/license/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler?style=flat-square)](https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/blob/main/LICENSE)\n[![npm](https://img.shields.io/npm/v/ec2-instance-running-scheduler?style=flat-square)](https://www.npmjs.com/package/ec2-instance-running-scheduler)\n[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/release.yml?branch=main&label=release&style=flat-square)](https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/actions/workflows/release.yml)\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler?sort=semver&style=flat-square)](https://github.com/gammarers-aws-cdk-constructs/ec2-instance-running-scheduler/releases)\n[![View on Construct Hub](https://constructs.dev/badge?package=ec2-instance-running-scheduler)](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, **polls 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 polling** – After start/stop, the function waits (20 seconds between attempts) and re-describes instances until `running` (start mode) or `stopped` (stop mode).\n- **Configurable polling limits** – Per-instance **max loop count** and **max elapsed time** via `resourcePolling` (default: 90 loops / 1800 seconds). Failures use explicit `ResourcePollingFailed:*` messages instead of running until the Durable execution timeout (construct default: 2 hours).\n- **Validated environment variables** – The bundled handler parses required and polling env vars at invocation using strict decimal integer rules; polling limits must be **positive integers** (`> 0`).\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, polling limit errors, Slack steps, completion).\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** – EC2 and tagging API permissions, Slack secret read grant, **Parameters and Secrets Lambda Extension**, JSON logging, and a dedicated log group (construct defaults).\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 { EC2InstanceRunningScheduler } from 'ec2-instance-running-scheduler';\n\nconst app = new cdk.App();\nconst stack = new cdk.Stack(app, 'MyStack');\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 resourcePolling: {\n maxLoopCount: 120,\n maxElapsedSeconds: 3600,\n },\n});\n```\n\nUse the **stack** `EC2InstanceRunningScheduleStack` when deploying the scheduler as its own stack. It accepts the same **targeting, schedules, secrets, and enable flag** as the construct (plus standard `StackProps` such as `env`). For **`resourcePolling`**, 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 { EC2InstanceRunningScheduleStack } from 'ec2-instance-running-scheduler';\n\nconst app = new cdk.App();\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});\n```\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` | `resourcePolling.maxLoopCount` (default `90`) | Max describe/poll iterations per instance |\n| `PROCESS_RESOURCE_MAX_ELAPSED_SECONDS` | `resourcePolling.maxElapsedSeconds` (default `1800`) | Max wall-clock seconds polling one instance |\n\nWhen you set polling limits via `resourcePolling`, the construct writes them as decimal integer strings. If you override these variables manually, each value must be a **strict decimal integer** (e.g. `\"120\"` is valid; `\"0x10\"`, `\"3.14\"`, or `\"10abc\"` are rejected) and **greater than zero**. Invalid or missing `SLACK_SECRET_NAME` causes the handler to fail 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| `resourcePolling` | `ResourcePollingLimits` | No | Per-instance polling caps (see below). |\n\n### EC2InstanceRunningScheduleStack\n\nIncludes `targetResource`, `secrets`, `startSchedule`, `stopSchedule`, `enableScheduling`, and standard `StackProps`. Does **not** expose `resourcePolling`; use `EC2InstanceRunningScheduler` when you need custom polling limits.\n\n### TargetResource\n\n- `tagKey` – Tag key used to select instances (e.g. `Schedule`).\n- `tagValues` – Tag values that must match (e.g. `['YES']`).\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### ResourcePollingLimits\n\nWritten to `PROCESS_RESOURCE_MAX_LOOP_COUNT` and `PROCESS_RESOURCE_MAX_ELAPSED_SECONDS` on the running scheduler Lambda.\n\n- `maxLoopCount` – Maximum describe/poll loop iterations per instance (default: **90**). Must be a positive integer when set.\n- `maxElapsedSeconds` – Maximum wall-clock seconds spent polling one instance (default: **1800**, 30 minutes). Must be a positive integer when set.\n\nWhen a limit is exceeded during polling, the handler throws an error with prefix `ResourcePollingFailed:` (`MaxLoopCountExceeded`, `MaxElapsedTimeExceeded`, or `UnexpectedInstanceState` for unknown EC2 states).\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**.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n"
8459
8465
  },
8460
8466
  "repository": {
8461
8467
  "type": "git",
@@ -8473,22 +8479,22 @@
8473
8479
  "base": "aws-cdk-lib.Stack",
8474
8480
  "docs": {
8475
8481
  "stability": "stable",
8476
- "summary": "CDK Stack that deploys the EC2 instance running scheduler (EventBridge Scheduler + Durable Lambda)."
8482
+ "summary": "CDK stack that deploys the EC2 instance running scheduler (EventBridge Scheduler + Durable Lambda)."
8477
8483
  },
8478
8484
  "fqn": "ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack",
8479
8485
  "initializer": {
8480
8486
  "docs": {
8481
8487
  "stability": "stable",
8482
- "summary": "Creates the stack and the EC2InstanceRunningScheduler construct."
8488
+ "summary": "Creates the stack and wires {@link EC2InstanceRunningScheduler}."
8483
8489
  },
8484
8490
  "locationInModule": {
8485
8491
  "filename": "src/stacks/ec2-instance-running-schedule-stack.ts",
8486
- "line": 32
8492
+ "line": 34
8487
8493
  },
8488
8494
  "parameters": [
8489
8495
  {
8490
8496
  "docs": {
8491
- "summary": "- Parent construct."
8497
+ "summary": "- Parent construct or app."
8492
8498
  },
8493
8499
  "name": "scope",
8494
8500
  "type": {
@@ -8506,7 +8512,7 @@
8506
8512
  },
8507
8513
  {
8508
8514
  "docs": {
8509
- "summary": "- Stack props (target resource, schedules, secrets)."
8515
+ "summary": "- Target resource, schedules, secrets, and standard stack props."
8510
8516
  },
8511
8517
  "name": "props",
8512
8518
  "type": {
@@ -8518,7 +8524,7 @@
8518
8524
  "kind": "class",
8519
8525
  "locationInModule": {
8520
8526
  "filename": "src/stacks/ec2-instance-running-schedule-stack.ts",
8521
- "line": 24
8527
+ "line": 26
8522
8528
  },
8523
8529
  "name": "EC2InstanceRunningScheduleStack",
8524
8530
  "symbolId": "src/stacks/ec2-instance-running-schedule-stack:EC2InstanceRunningScheduleStack"
@@ -8527,6 +8533,7 @@
8527
8533
  "assembly": "ec2-instance-running-scheduler",
8528
8534
  "datatype": true,
8529
8535
  "docs": {
8536
+ "see": "{@link EC2InstanceRunningSchedulerProps } for construct-level options not exposed here (e.g. `resourcePolling`).",
8530
8537
  "stability": "stable",
8531
8538
  "summary": "Props for the EC2 instance running schedule CDK stack."
8532
8539
  },
@@ -8537,7 +8544,7 @@
8537
8544
  "kind": "interface",
8538
8545
  "locationInModule": {
8539
8546
  "filename": "src/stacks/ec2-instance-running-schedule-stack.ts",
8540
- "line": 8
8547
+ "line": 10
8541
8548
  },
8542
8549
  "name": "EC2InstanceRunningScheduleStackProps",
8543
8550
  "properties": [
@@ -8550,7 +8557,7 @@
8550
8557
  "immutable": true,
8551
8558
  "locationInModule": {
8552
8559
  "filename": "src/stacks/ec2-instance-running-schedule-stack.ts",
8553
- "line": 14
8560
+ "line": 16
8554
8561
  },
8555
8562
  "name": "secrets",
8556
8563
  "type": {
@@ -8566,7 +8573,7 @@
8566
8573
  "immutable": true,
8567
8574
  "locationInModule": {
8568
8575
  "filename": "src/stacks/ec2-instance-running-schedule-stack.ts",
8569
- "line": 10
8576
+ "line": 12
8570
8577
  },
8571
8578
  "name": "targetResource",
8572
8579
  "type": {
@@ -8583,7 +8590,7 @@
8583
8590
  "immutable": true,
8584
8591
  "locationInModule": {
8585
8592
  "filename": "src/stacks/ec2-instance-running-schedule-stack.ts",
8586
- "line": 12
8593
+ "line": 14
8587
8594
  },
8588
8595
  "name": "enableScheduling",
8589
8596
  "optional": true,
@@ -8600,7 +8607,7 @@
8600
8607
  "immutable": true,
8601
8608
  "locationInModule": {
8602
8609
  "filename": "src/stacks/ec2-instance-running-schedule-stack.ts",
8603
- "line": 18
8610
+ "line": 20
8604
8611
  },
8605
8612
  "name": "startSchedule",
8606
8613
  "optional": true,
@@ -8617,7 +8624,7 @@
8617
8624
  "immutable": true,
8618
8625
  "locationInModule": {
8619
8626
  "filename": "src/stacks/ec2-instance-running-schedule-stack.ts",
8620
- "line": 16
8627
+ "line": 18
8621
8628
  },
8622
8629
  "name": "stopSchedule",
8623
8630
  "optional": true,
@@ -8632,7 +8639,7 @@
8632
8639
  "assembly": "ec2-instance-running-scheduler",
8633
8640
  "base": "constructs.Construct",
8634
8641
  "docs": {
8635
- "remarks": "Each schedule invokes the function with `Params` (`TagKey`, `TagValues`, `Mode`). The function uses\nthe Resource Groups Tagging API and EC2 APIs; Slack notifications use the secret named in {@link Secrets.slackSecretName}.",
8642
+ "remarks": "Each schedule invokes the function with `Params` (`TagKey`, `TagValues`, `Mode`). The function uses\nthe Resource Groups Tagging API and EC2 APIs; Slack notifications use the secret named in {@link Secrets.slackSecretName}.\n\nPer-instance polling timeouts are configured via {@link EC2InstanceRunningSchedulerProps.resourcePolling}\nand enforced in the handler before the Durable execution timeout.",
8636
8643
  "stability": "stable",
8637
8644
  "summary": "Provisions EventBridge Scheduler rules and a Durable Execution Lambda that start/stop tagged EC2 instances."
8638
8645
  },
@@ -8644,7 +8651,7 @@
8644
8651
  },
8645
8652
  "locationInModule": {
8646
8653
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8647
- "line": 73
8654
+ "line": 109
8648
8655
  },
8649
8656
  "parameters": [
8650
8657
  {
@@ -8667,7 +8674,7 @@
8667
8674
  },
8668
8675
  {
8669
8676
  "docs": {
8670
- "summary": "- Target tags, optional cron overrides, Slack secret name, and schedule enable flag."
8677
+ "summary": "- Target tags, schedules, Slack secret, schedule enable flag, and optional {@link ResourcePollingLimits}."
8671
8678
  },
8672
8679
  "name": "props",
8673
8680
  "type": {
@@ -8679,7 +8686,7 @@
8679
8686
  "kind": "class",
8680
8687
  "locationInModule": {
8681
8688
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8682
- "line": 65
8689
+ "line": 101
8683
8690
  },
8684
8691
  "name": "EC2InstanceRunningScheduler",
8685
8692
  "symbolId": "src/constructs/ec2-instance-running-scheduler:EC2InstanceRunningScheduler"
@@ -8695,7 +8702,7 @@
8695
8702
  "kind": "interface",
8696
8703
  "locationInModule": {
8697
8704
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8698
- "line": 46
8705
+ "line": 73
8699
8706
  },
8700
8707
  "name": "EC2InstanceRunningSchedulerProps",
8701
8708
  "properties": [
@@ -8708,7 +8715,7 @@
8708
8715
  "immutable": true,
8709
8716
  "locationInModule": {
8710
8717
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8711
- "line": 52
8718
+ "line": 79
8712
8719
  },
8713
8720
  "name": "secrets",
8714
8721
  "type": {
@@ -8724,7 +8731,7 @@
8724
8731
  "immutable": true,
8725
8732
  "locationInModule": {
8726
8733
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8727
- "line": 48
8734
+ "line": 75
8728
8735
  },
8729
8736
  "name": "targetResource",
8730
8737
  "type": {
@@ -8741,7 +8748,7 @@
8741
8748
  "immutable": true,
8742
8749
  "locationInModule": {
8743
8750
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8744
- "line": 50
8751
+ "line": 77
8745
8752
  },
8746
8753
  "name": "enableScheduling",
8747
8754
  "optional": true,
@@ -8749,6 +8756,24 @@
8749
8756
  "primitive": "boolean"
8750
8757
  }
8751
8758
  },
8759
+ {
8760
+ "abstract": true,
8761
+ "docs": {
8762
+ "default": "{@link DEFAULT_RESOURCE_POLLING_LIMITS }",
8763
+ "stability": "stable",
8764
+ "summary": "Per-instance polling limits for the running scheduler Lambda."
8765
+ },
8766
+ "immutable": true,
8767
+ "locationInModule": {
8768
+ "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8769
+ "line": 89
8770
+ },
8771
+ "name": "resourcePolling",
8772
+ "optional": true,
8773
+ "type": {
8774
+ "fqn": "ec2-instance-running-scheduler.ResourcePollingLimits"
8775
+ }
8776
+ },
8752
8777
  {
8753
8778
  "abstract": true,
8754
8779
  "docs": {
@@ -8758,7 +8783,7 @@
8758
8783
  "immutable": true,
8759
8784
  "locationInModule": {
8760
8785
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8761
- "line": 56
8786
+ "line": 83
8762
8787
  },
8763
8788
  "name": "startSchedule",
8764
8789
  "optional": true,
@@ -8775,7 +8800,7 @@
8775
8800
  "immutable": true,
8776
8801
  "locationInModule": {
8777
8802
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8778
- "line": 54
8803
+ "line": 81
8779
8804
  },
8780
8805
  "name": "stopSchedule",
8781
8806
  "optional": true,
@@ -8786,6 +8811,61 @@
8786
8811
  ],
8787
8812
  "symbolId": "src/constructs/ec2-instance-running-scheduler:EC2InstanceRunningSchedulerProps"
8788
8813
  },
8814
+ "ec2-instance-running-scheduler.ResourcePollingLimits": {
8815
+ "assembly": "ec2-instance-running-scheduler",
8816
+ "datatype": true,
8817
+ "docs": {
8818
+ "remarks": "Values are written to {@link PROCESS_RESOURCE_MAX_LOOP_COUNT_ENV} and\n{@link PROCESS_RESOURCE_MAX_ELAPSED_SECONDS_ENV} on the running scheduler function.\nPrevents abnormal or stuck transitions from running until the Durable execution timeout.",
8819
+ "stability": "stable",
8820
+ "summary": "CDK-side limits for per-instance stable-state polling in the Durable Lambda handler."
8821
+ },
8822
+ "fqn": "ec2-instance-running-scheduler.ResourcePollingLimits",
8823
+ "kind": "interface",
8824
+ "locationInModule": {
8825
+ "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8826
+ "line": 55
8827
+ },
8828
+ "name": "ResourcePollingLimits",
8829
+ "properties": [
8830
+ {
8831
+ "abstract": true,
8832
+ "docs": {
8833
+ "default": "{@link DEFAULT_RESOURCE_POLLING_LIMITS.maxElapsedSeconds } (1800, 30 minutes)",
8834
+ "stability": "stable",
8835
+ "summary": "Maximum wall-clock seconds spent polling a single instance."
8836
+ },
8837
+ "immutable": true,
8838
+ "locationInModule": {
8839
+ "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8840
+ "line": 67
8841
+ },
8842
+ "name": "maxElapsedSeconds",
8843
+ "optional": true,
8844
+ "type": {
8845
+ "primitive": "number"
8846
+ }
8847
+ },
8848
+ {
8849
+ "abstract": true,
8850
+ "docs": {
8851
+ "default": "{@link DEFAULT_RESOURCE_POLLING_LIMITS.maxLoopCount } (90)",
8852
+ "stability": "stable",
8853
+ "summary": "Maximum describe/poll loop iterations per instance."
8854
+ },
8855
+ "immutable": true,
8856
+ "locationInModule": {
8857
+ "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8858
+ "line": 61
8859
+ },
8860
+ "name": "maxLoopCount",
8861
+ "optional": true,
8862
+ "type": {
8863
+ "primitive": "number"
8864
+ }
8865
+ }
8866
+ ],
8867
+ "symbolId": "src/constructs/ec2-instance-running-scheduler:ResourcePollingLimits"
8868
+ },
8789
8869
  "ec2-instance-running-scheduler.Schedule": {
8790
8870
  "assembly": "ec2-instance-running-scheduler",
8791
8871
  "datatype": true,
@@ -8797,7 +8877,7 @@
8797
8877
  "kind": "interface",
8798
8878
  "locationInModule": {
8799
8879
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8800
- "line": 14
8880
+ "line": 19
8801
8881
  },
8802
8882
  "name": "Schedule",
8803
8883
  "properties": [
@@ -8810,7 +8890,7 @@
8810
8890
  "immutable": true,
8811
8891
  "locationInModule": {
8812
8892
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8813
- "line": 16
8893
+ "line": 21
8814
8894
  },
8815
8895
  "name": "timezone",
8816
8896
  "type": {
@@ -8826,7 +8906,7 @@
8826
8906
  "immutable": true,
8827
8907
  "locationInModule": {
8828
8908
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8829
- "line": 20
8909
+ "line": 25
8830
8910
  },
8831
8911
  "name": "hour",
8832
8912
  "optional": true,
@@ -8843,7 +8923,7 @@
8843
8923
  "immutable": true,
8844
8924
  "locationInModule": {
8845
8925
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8846
- "line": 18
8926
+ "line": 23
8847
8927
  },
8848
8928
  "name": "minute",
8849
8929
  "optional": true,
@@ -8860,7 +8940,7 @@
8860
8940
  "immutable": true,
8861
8941
  "locationInModule": {
8862
8942
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8863
- "line": 22
8943
+ "line": 27
8864
8944
  },
8865
8945
  "name": "week",
8866
8946
  "optional": true,
@@ -8882,7 +8962,7 @@
8882
8962
  "kind": "interface",
8883
8963
  "locationInModule": {
8884
8964
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8885
- "line": 38
8965
+ "line": 43
8886
8966
  },
8887
8967
  "name": "Secrets",
8888
8968
  "properties": [
@@ -8895,7 +8975,7 @@
8895
8975
  "immutable": true,
8896
8976
  "locationInModule": {
8897
8977
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8898
- "line": 40
8978
+ "line": 45
8899
8979
  },
8900
8980
  "name": "slackSecretName",
8901
8981
  "type": {
@@ -8916,7 +8996,7 @@
8916
8996
  "kind": "interface",
8917
8997
  "locationInModule": {
8918
8998
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8919
- "line": 28
8999
+ "line": 33
8920
9000
  },
8921
9001
  "name": "TargetResource",
8922
9002
  "properties": [
@@ -8929,7 +9009,7 @@
8929
9009
  "immutable": true,
8930
9010
  "locationInModule": {
8931
9011
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8932
- "line": 30
9012
+ "line": 35
8933
9013
  },
8934
9014
  "name": "tagKey",
8935
9015
  "type": {
@@ -8945,7 +9025,7 @@
8945
9025
  "immutable": true,
8946
9026
  "locationInModule": {
8947
9027
  "filename": "src/constructs/ec2-instance-running-scheduler.ts",
8948
- "line": 32
9028
+ "line": 37
8949
9029
  },
8950
9030
  "name": "tagValues",
8951
9031
  "type": {
@@ -8961,6 +9041,6 @@
8961
9041
  "symbolId": "src/constructs/ec2-instance-running-scheduler:TargetResource"
8962
9042
  }
8963
9043
  },
8964
- "version": "0.1.9",
8965
- "fingerprint": "NhbEVB4Eupkewuj9QQwAkG4aAo23KlDXBbUhUbHDvFg="
9044
+ "version": "0.2.1",
9045
+ "fingerprint": "9K/8AR/LR8ZaDeXdKmKC9w88DTanW5BE+7ejCcdUEj8="
8966
9046
  }
package/API.md CHANGED
@@ -9,6 +9,9 @@ Provisions EventBridge Scheduler rules and a Durable Execution Lambda that start
9
9
  Each schedule invokes the function with `Params` (`TagKey`, `TagValues`, `Mode`). The function uses
10
10
  the Resource Groups Tagging API and EC2 APIs; Slack notifications use the secret named in {@link Secrets.slackSecretName}.
11
11
 
12
+ Per-instance polling timeouts are configured via {@link EC2InstanceRunningSchedulerProps.resourcePolling}
13
+ and enforced in the handler before the Durable execution timeout.
14
+
12
15
  #### Initializers <a name="Initializers" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer"></a>
13
16
 
14
17
  ```typescript
@@ -21,7 +24,7 @@ new EC2InstanceRunningScheduler(scope: Construct, id: string, props: EC2Instance
21
24
  | --- | --- | --- |
22
25
  | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | - Parent construct. |
23
26
  | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.id">id</a></code> | <code>string</code> | - Construct id. |
24
- | <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, optional cron overrides, Slack secret name, and schedule enable flag. |
27
+ | <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, and optional {@link ResourcePollingLimits}. |
25
28
 
26
29
  ---
27
30
 
@@ -45,7 +48,7 @@ Construct id.
45
48
 
46
49
  - *Type:* <a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps">EC2InstanceRunningSchedulerProps</a>
47
50
 
48
- Target tags, optional cron overrides, Slack secret name, and schedule enable flag.
51
+ Target tags, schedules, Slack secret, schedule enable flag, and optional {@link ResourcePollingLimits}.
49
52
 
50
53
  ---
51
54
 
@@ -150,7 +153,7 @@ The tree node.
150
153
 
151
154
  ### EC2InstanceRunningScheduleStack <a name="EC2InstanceRunningScheduleStack" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack"></a>
152
155
 
153
- CDK Stack that deploys the EC2 instance running scheduler (EventBridge Scheduler + Durable Lambda).
156
+ CDK stack that deploys the EC2 instance running scheduler (EventBridge Scheduler + Durable Lambda).
154
157
 
155
158
  #### Initializers <a name="Initializers" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer"></a>
156
159
 
@@ -162,9 +165,9 @@ new EC2InstanceRunningScheduleStack(scope: Construct, id: string, props: EC2Inst
162
165
 
163
166
  | **Name** | **Type** | **Description** |
164
167
  | --- | --- | --- |
165
- | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | - Parent construct. |
168
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | - Parent construct or app. |
166
169
  | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.id">id</a></code> | <code>string</code> | - Stack id. |
167
- | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.props">props</a></code> | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps">EC2InstanceRunningScheduleStackProps</a></code> | - Stack props (target resource, schedules, secrets). |
170
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.props">props</a></code> | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps">EC2InstanceRunningScheduleStackProps</a></code> | - Target resource, schedules, secrets, and standard stack props. |
168
171
 
169
172
  ---
170
173
 
@@ -172,7 +175,7 @@ new EC2InstanceRunningScheduleStack(scope: Construct, id: string, props: EC2Inst
172
175
 
173
176
  - *Type:* constructs.Construct
174
177
 
175
- Parent construct.
178
+ Parent construct or app.
176
179
 
177
180
  ---
178
181
 
@@ -188,7 +191,7 @@ Stack id.
188
191
 
189
192
  - *Type:* <a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps">EC2InstanceRunningScheduleStackProps</a>
190
193
 
191
- Stack props (target resource, schedules, secrets).
194
+ Target resource, schedules, secrets, and standard stack props.
192
195
 
193
196
  ---
194
197
 
@@ -1126,6 +1129,7 @@ const eC2InstanceRunningSchedulerProps: EC2InstanceRunningSchedulerProps = { ...
1126
1129
  | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.secrets">secrets</a></code> | <code><a href="#ec2-instance-running-scheduler.Secrets">Secrets</a></code> | Secrets (e.g. Slack) used for notifications. |
1127
1130
  | <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. |
1128
1131
  | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.enableScheduling">enableScheduling</a></code> | <code>boolean</code> | Whether EventBridge Scheduler rules are enabled. |
1132
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.resourcePolling">resourcePolling</a></code> | <code><a href="#ec2-instance-running-scheduler.ResourcePollingLimits">ResourcePollingLimits</a></code> | Per-instance polling limits for the running scheduler Lambda. |
1129
1133
  | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.startSchedule">startSchedule</a></code> | <code><a href="#ec2-instance-running-scheduler.Schedule">Schedule</a></code> | Cron schedule for starting instances. |
1130
1134
  | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.stopSchedule">stopSchedule</a></code> | <code><a href="#ec2-instance-running-scheduler.Schedule">Schedule</a></code> | Cron schedule for stopping instances. |
1131
1135
 
@@ -1169,6 +1173,19 @@ Defaults to true if omitted.
1169
1173
 
1170
1174
  ---
1171
1175
 
1176
+ ##### `resourcePolling`<sup>Optional</sup> <a name="resourcePolling" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.resourcePolling"></a>
1177
+
1178
+ ```typescript
1179
+ public readonly resourcePolling: ResourcePollingLimits;
1180
+ ```
1181
+
1182
+ - *Type:* <a href="#ec2-instance-running-scheduler.ResourcePollingLimits">ResourcePollingLimits</a>
1183
+ - *Default:* {@link DEFAULT_RESOURCE_POLLING_LIMITS }
1184
+
1185
+ Per-instance polling limits for the running scheduler Lambda.
1186
+
1187
+ ---
1188
+
1172
1189
  ##### `startSchedule`<sup>Optional</sup> <a name="startSchedule" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.startSchedule"></a>
1173
1190
 
1174
1191
  ```typescript
@@ -1197,6 +1214,8 @@ Cron schedule for stopping instances.
1197
1214
 
1198
1215
  Props for the EC2 instance running schedule CDK stack.
1199
1216
 
1217
+ > [{@link EC2InstanceRunningSchedulerProps } for construct-level options not exposed here (e.g. `resourcePolling`).]({@link EC2InstanceRunningSchedulerProps } for construct-level options not exposed here (e.g. `resourcePolling`).)
1218
+
1200
1219
  #### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.Initializer"></a>
1201
1220
 
1202
1221
  ```typescript
@@ -1535,6 +1554,57 @@ Cron schedule for stopping instances.
1535
1554
 
1536
1555
  ---
1537
1556
 
1557
+ ### ResourcePollingLimits <a name="ResourcePollingLimits" id="ec2-instance-running-scheduler.ResourcePollingLimits"></a>
1558
+
1559
+ CDK-side limits for per-instance stable-state polling in the Durable Lambda handler.
1560
+
1561
+ Values are written to {@link PROCESS_RESOURCE_MAX_LOOP_COUNT_ENV} and
1562
+ {@link PROCESS_RESOURCE_MAX_ELAPSED_SECONDS_ENV} on the running scheduler function.
1563
+ Prevents abnormal or stuck transitions from running until the Durable execution timeout.
1564
+
1565
+ #### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.ResourcePollingLimits.Initializer"></a>
1566
+
1567
+ ```typescript
1568
+ import { ResourcePollingLimits } from 'ec2-instance-running-scheduler'
1569
+
1570
+ const resourcePollingLimits: ResourcePollingLimits = { ... }
1571
+ ```
1572
+
1573
+ #### Properties <a name="Properties" id="Properties"></a>
1574
+
1575
+ | **Name** | **Type** | **Description** |
1576
+ | --- | --- | --- |
1577
+ | <code><a href="#ec2-instance-running-scheduler.ResourcePollingLimits.property.maxElapsedSeconds">maxElapsedSeconds</a></code> | <code>number</code> | Maximum wall-clock seconds spent polling a single instance. |
1578
+ | <code><a href="#ec2-instance-running-scheduler.ResourcePollingLimits.property.maxLoopCount">maxLoopCount</a></code> | <code>number</code> | Maximum describe/poll loop iterations per instance. |
1579
+
1580
+ ---
1581
+
1582
+ ##### `maxElapsedSeconds`<sup>Optional</sup> <a name="maxElapsedSeconds" id="ec2-instance-running-scheduler.ResourcePollingLimits.property.maxElapsedSeconds"></a>
1583
+
1584
+ ```typescript
1585
+ public readonly maxElapsedSeconds: number;
1586
+ ```
1587
+
1588
+ - *Type:* number
1589
+ - *Default:* {@link DEFAULT_RESOURCE_POLLING_LIMITS.maxElapsedSeconds } (1800, 30 minutes)
1590
+
1591
+ Maximum wall-clock seconds spent polling a single instance.
1592
+
1593
+ ---
1594
+
1595
+ ##### `maxLoopCount`<sup>Optional</sup> <a name="maxLoopCount" id="ec2-instance-running-scheduler.ResourcePollingLimits.property.maxLoopCount"></a>
1596
+
1597
+ ```typescript
1598
+ public readonly maxLoopCount: number;
1599
+ ```
1600
+
1601
+ - *Type:* number
1602
+ - *Default:* {@link DEFAULT_RESOURCE_POLLING_LIMITS.maxLoopCount } (90)
1603
+
1604
+ Maximum describe/poll loop iterations per instance.
1605
+
1606
+ ---
1607
+
1538
1608
  ### Schedule <a name="Schedule" id="ec2-instance-running-scheduler.Schedule"></a>
1539
1609
 
1540
1610
  Cron-style schedule configuration for start/stop actions.