@go-to-k/cdkd 0.69.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 +49 -4
- package/dist/cli.js +2497 -317
- package/dist/cli.js.map +4 -4
- package/dist/go-to-k-cdkd-0.71.0.tgz +0 -0
- package/dist/index.js +56 -34
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/dist/go-to-k-cdkd-0.69.0.tgz +0 -0
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`)
|
|
252
|
-
Lambda
|
|
253
|
-
AWS Lambda Runtime Interface Emulator (RIE).
|
|
254
|
-
|
|
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
|
|
|
@@ -585,6 +587,16 @@ Requires Docker. v1 supports Node.js and Python runtimes (`nodejs18.x` /
|
|
|
585
587
|
`nodejs20.x` / `nodejs22.x` / `python3.11` / `python3.12` / `python3.13`);
|
|
586
588
|
other runtimes follow in subsequent PRs.
|
|
587
589
|
|
|
590
|
+
**Container Lambdas (PR 5 of #224)** — `lambda.DockerImageFunction(...)` /
|
|
591
|
+
`Code.ImageUri` is supported alongside ZIP Lambdas. cdkd reads the
|
|
592
|
+
function's local `Dockerfile` from `cdk.out` and runs `docker build`
|
|
593
|
+
locally before invoking. When no asset matches (typically: invoking a
|
|
594
|
+
stack deployed elsewhere), cdkd falls back to `docker pull` from
|
|
595
|
+
ECR — same-account / same-region only in v1; cross-account /
|
|
596
|
+
cross-region is deferred to a follow-up PR. `Architectures: [x86_64]` /
|
|
597
|
+
`[arm64]` are honored via `--platform` so an arm64 host running an
|
|
598
|
+
x86_64 Lambda doesn't hit emulation.
|
|
599
|
+
|
|
588
600
|
```bash
|
|
589
601
|
# Invoke by CDK display path (single-stack apps may omit the prefix)
|
|
590
602
|
cdkd local invoke MyStack/MyApi/Handler
|
|
@@ -620,6 +632,39 @@ cdkd local invoke MyStack/Handler --from-state
|
|
|
620
632
|
See [docs/cli-reference.md](docs/cli-reference.md#local-invoke-run-lambda-functions-locally)
|
|
621
633
|
for the full surface, target-resolution rules, and v1 scope notes.
|
|
622
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
|
+
|
|
623
668
|
## State Management
|
|
624
669
|
|
|
625
670
|
State is stored in S3 with optimistic locking via S3 Conditional Writes
|