@go-to-k/cdkd 0.70.0 → 0.71.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
@@ -248,10 +248,12 @@ cdkd has three command families:
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
+ - **`cdkd local ...` subcommands** (`local invoke`, `local start-api`)
252
+ run synthesized Lambda functions locally inside Docker containers that
253
+ bundle the AWS Lambda Runtime Interface Emulator (RIE). `local invoke`
254
+ runs a single Lambda once; `local start-api` stands up a long-running
255
+ HTTP server that maps API Gateway / HTTP API / Function URL routes to
256
+ local Lambda invocations. No AWS API calls, no state bucket needed.
255
257
 
256
258
  Options like `--app`, `--state-bucket`, and `--context` can be omitted if configured via `cdk.json` or environment variables (`CDKD_APP`, `CDKD_STATE_BUCKET`).
257
259
 
@@ -630,6 +632,39 @@ cdkd local invoke MyStack/Handler --from-state
630
632
  See [docs/cli-reference.md](docs/cli-reference.md#local-invoke-run-lambda-functions-locally)
631
633
  for the full surface, target-resolution rules, and v1 scope notes.
632
634
 
635
+ ## `local start-api`: long-running local API server
636
+
637
+ `cdkd local start-api` stands up a long-running local HTTP server that
638
+ maps the synthesized API Gateway routes (REST v1, HTTP API, Function
639
+ URL) to local Lambda invocations against the same RIE-backed Docker
640
+ containers `cdkd local invoke` uses. Modeled on `sam local start-api`
641
+ but reusing cdkd's synthesis / route-discovery plumbing.
642
+
643
+ ```bash
644
+ # Auto-allocate a port (printed at startup) and serve every discovered route
645
+ cdkd local start-api
646
+
647
+ # Pin to port 3000 (SAM-parity / curl muscle memory)
648
+ cdkd local start-api --port 3000
649
+
650
+ # Pre-warm one container per Lambda at server boot — eliminates first-request cold start
651
+ cdkd local start-api --warm
652
+
653
+ # Override env vars per-Lambda (SAM-shape file)
654
+ cdkd local start-api --env-vars env.json
655
+
656
+ # Pin the deployed execution role per Lambda (or globally with a bare ARN)
657
+ cdkd local start-api --assume-role MyApiHandler=arn:aws:iam::123:role/handler-role
658
+ ```
659
+
660
+ v1 scope (PR 8a): REST v1 + HTTP API + Function URL with AWS_PROXY
661
+ integrations only. Authorizers, CORS preflight, hot reload, stage
662
+ variables, and WebSocket APIs are deferred to follow-up PRs.
663
+
664
+ See [docs/cli-reference.md](docs/cli-reference.md#local-start-api-long-running-local-api-server)
665
+ for the full route-discovery rules, container-pool semantics, and exit
666
+ codes.
667
+
633
668
  ## State Management
634
669
 
635
670
  State is stored in S3 with optimistic locking via S3 Conditional Writes