@go-to-k/cdkd 0.66.0 → 0.67.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/README.md CHANGED
@@ -237,17 +237,21 @@ That's it. cdkd reads `--app` from `cdk.json` and auto-resolves the state bucket
237
237
 
238
238
  ## Usage
239
239
 
240
- cdkd has two command families:
240
+ cdkd has three command families:
241
241
 
242
242
  - **Top-level commands** (`cdkd deploy` / `destroy` / `diff` / `synth` /
243
- `list` / `import` / `orphan`) require a CDK app — they synthesize
244
- a template to learn what they're operating on.
243
+ `list` / `import` / `orphan` / `publish-assets`) require a CDK app —
244
+ they synthesize a template to learn what they're operating on.
245
245
  - **`cdkd state ...` subcommands** (`state info` / `list` / `resources`
246
246
  / `show` / `orphan` / `destroy` / `migrate` / `refresh-observed`)
247
247
  operate on the S3 state bucket only and do NOT need the CDK app —
248
248
  use them to inspect / clean up state when the source is gone or
249
249
  you don't want to synth. `cdkd state destroy` is the CDK-app-free
250
250
  counterpart of `cdkd destroy`.
251
+ - **`cdkd local ...` subcommands** (`local invoke`) run a synthesized
252
+ Lambda function locally inside a Docker container that bundles the
253
+ AWS Lambda Runtime Interface Emulator (RIE). No AWS API calls, no
254
+ state bucket needed.
251
255
 
252
256
  Options like `--app`, `--state-bucket`, and `--context` can be omitted if configured via `cdk.json` or environment variables (`CDKD_APP`, `CDKD_STATE_BUCKET`).
253
257
 
@@ -569,6 +573,44 @@ cdkd publish-assets -a cdk.out # skip synth, use pre-synthesized assembly
569
573
  See [docs/cli-reference.md](docs/cli-reference.md#publish-assets-synth--build--publish-no-deploy)
570
574
  for stack-selection rules and concurrency knobs.
571
575
 
576
+ ## `local invoke`: run Lambda functions locally
577
+
578
+ `cdkd local invoke <target>` runs a Lambda function from a CDK app on the
579
+ developer's machine, inside a Docker container that bundles the AWS
580
+ Lambda Runtime Interface Emulator (RIE). Modeled on `sam local invoke`
581
+ but reusing cdkd's synthesis / asset / construct-path plumbing — no
582
+ `template.yaml` to maintain, no `cdk synth | sam ...` round-trip.
583
+
584
+ Requires Docker. v1 supports Node.js runtimes only (`nodejs18.x` /
585
+ `nodejs20.x` / `nodejs22.x`); other runtimes follow in subsequent PRs.
586
+
587
+ ```bash
588
+ # Invoke by CDK display path (single-stack apps may omit the prefix)
589
+ cdkd local invoke MyStack/MyApi/Handler
590
+ cdkd local invoke MyStack:MyApiHandler1234ABCD # logical-id form
591
+
592
+ # Pass an event payload
593
+ cdkd local invoke MyStack/Handler --event events/get.json
594
+ echo '{"path":"/"}' | cdkd local invoke MyStack/Handler --event-stdin
595
+
596
+ # Override env vars (SAM-compatible shape: {"LogicalId":{"KEY":"VALUE"}}
597
+ # plus an optional top-level "Parameters" block applied to every invoke)
598
+ cdkd local invoke MyStack/Handler --env-vars env.json
599
+
600
+ # Skip docker pull when iterating
601
+ cdkd local invoke MyStack/Handler --no-pull
602
+
603
+ # Run with the deployed function's narrow execution role (otherwise the
604
+ # developer's shell credentials are forwarded — SAM-compatible default)
605
+ cdkd local invoke MyStack/Handler --assume-role arn:aws:iam::123456789012:role/MyApi-handler-role
606
+
607
+ # Attach a Node debugger
608
+ cdkd local invoke MyStack/Handler --debug-port 9229
609
+ ```
610
+
611
+ See [docs/cli-reference.md](docs/cli-reference.md#local-invoke-run-lambda-functions-locally)
612
+ for the full surface, target-resolution rules, and v1 scope notes.
613
+
572
614
  ## State Management
573
615
 
574
616
  State is stored in S3 with optimistic locking via S3 Conditional Writes