Skip to content

fix(sdk): default Workflow Insight example auto-invoke schedule to off#721

Merged
ParidelPooya merged 1 commit into
mainfrom
fix/insight-example-autoinvoke-off
Jul 15, 2026
Merged

fix(sdk): default Workflow Insight example auto-invoke schedule to off#721
ParidelPooya merged 1 commit into
mainfrom
fix/insight-example-autoinvoke-off

Conversation

@ParidelPooya

Copy link
Copy Markdown
Contributor

The example/demo CDK stack (packages/aws-durable-execution-sdk-js-insight/cdk) defaulted lambda.autoInvoke.enabled to true, which provisions a dispatcher Lambda + an EventBridge rule that re-invokes the example durable function every few minutes. That keeps generating billable Lambda invocations (and downstream destination writes) indefinitely until the stack is torn down — an easy way to incur cost without realizing it.

  • Flip lambda.autoInvoke.enabled to false so auto-invocation is strictly opt-in. Deploying the example function itself stays on (it's free at rest); only the recurring scheduled invocation is now off by default.
  • Document the cost rationale in the config so it's clear before enabling.

Also makes cdk/config.json self-documenting: JSON has no comments, so following the file's existing _comment convention, every field now has a sibling <field>Comment description (plus a per-section _comment), and the top-level _comment notes that auto-invoke is off by default. These keys are ignored by the CDK code, which reads config values by explicit key (no key enumeration), so behavior is unchanged and the stack still typechecks.

Adds a stack test asserting no EventBridge rule is synthesized with the default config. CDK typecheck + stack tests (11) pass.

The example/demo CDK stack (packages/aws-durable-execution-sdk-js-insight/cdk)
defaulted lambda.autoInvoke.enabled to true, which provisions a dispatcher
Lambda + an EventBridge rule that re-invokes the example durable function every
few minutes. That keeps generating billable Lambda invocations (and downstream
destination writes) indefinitely until the stack is torn down — an easy way to
incur cost without realizing it.

- Flip lambda.autoInvoke.enabled to false so auto-invocation is strictly opt-in.
  Deploying the example function itself stays on (it's free at rest); only the
  recurring scheduled invocation is now off by default.
- Document the cost rationale in the config so it's clear before enabling.

Also makes cdk/config.json self-documenting: JSON has no comments, so following
the file's existing `_comment` convention, every field now has a sibling
`<field>Comment` description (plus a per-section `_comment`), and the top-level
`_comment` notes that auto-invoke is off by default. These keys are ignored by
the CDK code, which reads config values by explicit key (no key enumeration),
so behavior is unchanged and the stack still typechecks.

Adds a stack test asserting no EventBridge rule is synthesized with the default
config. CDK typecheck + stack tests (11) pass.

@yaythomas yaythomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ParidelPooya
ParidelPooya marked this pull request as ready for review July 15, 2026 17:50
@ParidelPooya
ParidelPooya merged commit 46ffaad into main Jul 15, 2026
16 of 17 checks passed
@ParidelPooya
ParidelPooya deleted the fix/insight-example-autoinvoke-off branch July 15, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants