@go-to-k/cdkd 0.70.0 → 0.72.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
 
@@ -611,6 +613,11 @@ cdkd local invoke MyStack/Handler --env-vars env.json
611
613
  # Skip docker pull when iterating
612
614
  cdkd local invoke MyStack/Handler --no-pull
613
615
 
616
+ # Skip the local docker build for container Lambdas (Code.ImageUri).
617
+ # Reuses the deterministic cdkd-local-invoke-<hash> tag from a prior
618
+ # build. Errors clearly when the tag is missing.
619
+ cdkd local invoke MyStack/ContainerHandler --no-build
620
+
614
621
  # Run with the deployed function's narrow execution role (otherwise the
615
622
  # developer's shell credentials are forwarded — SAM-compatible default)
616
623
  cdkd local invoke MyStack/Handler --assume-role arn:aws:iam::123456789012:role/MyApi-handler-role
@@ -630,6 +637,39 @@ cdkd local invoke MyStack/Handler --from-state
630
637
  See [docs/cli-reference.md](docs/cli-reference.md#local-invoke-run-lambda-functions-locally)
631
638
  for the full surface, target-resolution rules, and v1 scope notes.
632
639
 
640
+ ## `local start-api`: long-running local API server
641
+
642
+ `cdkd local start-api` stands up a long-running local HTTP server that
643
+ maps the synthesized API Gateway routes (REST v1, HTTP API, Function
644
+ URL) to local Lambda invocations against the same RIE-backed Docker
645
+ containers `cdkd local invoke` uses. Modeled on `sam local start-api`
646
+ but reusing cdkd's synthesis / route-discovery plumbing.
647
+
648
+ ```bash
649
+ # Auto-allocate a port (printed at startup) and serve every discovered route
650
+ cdkd local start-api
651
+
652
+ # Pin to port 3000 (SAM-parity / curl muscle memory)
653
+ cdkd local start-api --port 3000
654
+
655
+ # Pre-warm one container per Lambda at server boot — eliminates first-request cold start
656
+ cdkd local start-api --warm
657
+
658
+ # Override env vars per-Lambda (SAM-shape file)
659
+ cdkd local start-api --env-vars env.json
660
+
661
+ # Pin the deployed execution role per Lambda (or globally with a bare ARN)
662
+ cdkd local start-api --assume-role MyApiHandler=arn:aws:iam::123:role/handler-role
663
+ ```
664
+
665
+ v1 scope (PR 8a): REST v1 + HTTP API + Function URL with AWS_PROXY
666
+ integrations only. Authorizers, CORS preflight, hot reload, stage
667
+ variables, and WebSocket APIs are deferred to follow-up PRs.
668
+
669
+ See [docs/cli-reference.md](docs/cli-reference.md#local-start-api-long-running-local-api-server)
670
+ for the full route-discovery rules, container-pool semantics, and exit
671
+ codes.
672
+
633
673
  ## State Management
634
674
 
635
675
  State is stored in S3 with optimistic locking via S3 Conditional Writes