cdk-local 0.35.0 → 0.36.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 +63 -37
- package/dist/cli.js +3 -2
- package/dist/cli.js.map +1 -1
- package/dist/{docker-cmd--8TRSn9z.js → docker-cmd-voNPrcRh.js} +2 -2
- package/dist/docker-cmd-voNPrcRh.js.map +1 -0
- package/dist/index.d.ts +91 -44
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/{local-list-BvDCmBir.js → local-list-BUgCsVoM.js} +3928 -3246
- package/dist/local-list-BUgCsVoM.js.map +1 -0
- package/package.json +1 -1
- package/dist/docker-cmd--8TRSn9z.js.map +0 -1
- package/dist/local-list-BvDCmBir.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,15 +1,45 @@
|
|
|
1
1
|
# cdk-local
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/cdk-local)
|
|
4
|
+
[](https://github.com/go-to-k/cdk-local/actions/workflows/ci.yml)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
|
|
7
|
+
Run your CDK app's Lambda functions, API Gateway, and ECS tasks/services on your own machine — with **no AWS account**, or bound to your **deployed stack to hit real AWS resources and data**. A native, CDK-first alternative to `sam local`.
|
|
4
8
|
|
|
5
9
|

|
|
6
10
|
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
Requires **Docker** (running) and **Node.js 20+**.
|
|
14
|
+
|
|
15
|
+
### 1. Run locally — no AWS account
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g cdk-local # installs the `cdkl` command
|
|
19
|
+
|
|
20
|
+
cd your-cdk-app # the directory holding cdk.json
|
|
21
|
+
cdkl invoke # pick a Lambda from the list, then run it locally
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`cdkl` synths your CDK app and runs the real handler inside a real `public.ecr.aws/lambda/*` container. Run any command with no target and it opens an arrow-key picker — you rarely need to type a CDK path.
|
|
25
|
+
|
|
26
|
+
### 2. Bind to real AWS data — add `--from-cfn-stack`
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cdkl start-api --from-cfn-stack # pick an API → real AWS data + real Cognito JWT
|
|
30
|
+
cdkl start-api MyStack/MyApi --from-cfn-stack # or name the API explicitly
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
cdk-local reads the deployed CloudFormation stack and injects its real ARNs, Secret values, and IAM credentials into the container — your local handler reads and writes the exact same data the deployed app does, with no `.env` to wire up and no test data to seed. Point a frontend at it and you're debugging end-to-end against production-shaped state.
|
|
34
|
+
|
|
7
35
|
## Why cdk-local
|
|
8
36
|
|
|
9
37
|
Two pains, one tool:
|
|
10
38
|
|
|
11
39
|
- **Zero-friction local execution.** No AWS account, no IAM access, no deploy — just Docker and your CDK app. Onboard new engineers, review a PR by actually running its code, or work on an OSS CDK sample without owning the maintainer's AWS account.
|
|
12
|
-
- **Iterate against your real deployed stack — including its data.** `--from-cfn-stack` injects real ARNs, Secret values, and IAM credentials straight from CloudFormation into the local container — no `.env` file to maintain, no manual ARN copy-paste. Your local Lambda hits the same DynamoDB rows, S3 objects, Cognito users, Secret values, and anything else your IAM credentials reach
|
|
40
|
+
- **Iterate against your real deployed stack — including its data.** `--from-cfn-stack` injects real ARNs, Secret values, and IAM credentials straight from CloudFormation into the local container — no `.env` file to maintain, no manual ARN copy-paste. Your local Lambda hits the same DynamoDB rows, S3 objects, Cognito users, Secret values, and anything else your IAM credentials reach that the deployed app sees.
|
|
41
|
+
|
|
42
|
+
An offline emulator can fake the API surface, but you'd still own the cost of seeding it:
|
|
13
43
|
- dumping production data into a local DB
|
|
14
44
|
- mirroring Secret values into local Secrets Manager
|
|
15
45
|
- anonymizing fixtures across schema changes
|
|
@@ -17,38 +47,29 @@ Two pains, one tool:
|
|
|
17
47
|
|
|
18
48
|
cdk-local skips all of that by keeping you on the real thing.
|
|
19
49
|
|
|
20
|
-
cdk-local deliberately does NOT emulate AWS managed services. The bet is: keep dependencies real, swap only the compute layer.
|
|
21
|
-
|
|
22
50
|
It also picks up where `sam local` leaves off:
|
|
23
51
|
|
|
24
52
|
- **CDK-native** — point it at your CDK app's `cdk.json`. No SAM templates, no extra config files.
|
|
25
|
-
- **Wider coverage** — Lambda (ZIP + container image
|
|
26
|
-
- **Real container images** — Lambda code runs in the real `public.ecr.aws/lambda/*` base image via Lambda Runtime Interface Emulator (RIE)
|
|
53
|
+
- **Wider coverage** — Lambda (ZIP + container image + Function URL), API Gateway REST v1 / HTTP v2 / WebSocket, ECS run-task, ECS service with Service Connect + Cloud Map, and Bedrock AgentCore Runtime agents.
|
|
54
|
+
- **Real container images** — Lambda code runs in the real `public.ecr.aws/lambda/*` base image via the Lambda Runtime Interface Emulator (RIE); ECS tasks run as real Docker containers. The only dependency is Docker.
|
|
27
55
|
|
|
28
56
|
## What runs locally, what doesn't
|
|
29
57
|
|
|
30
|
-
cdk-local runs your **application compute** locally in Docker, using your CDK app as the source of truth. It does NOT emulate AWS managed services.
|
|
58
|
+
cdk-local runs your **application compute** locally in Docker, using your CDK app as the source of truth. It deliberately does NOT emulate AWS managed services — the bet is: keep dependencies real, swap only the compute layer.
|
|
31
59
|
|
|
32
60
|
**Runs locally (application compute):**
|
|
33
61
|
|
|
34
62
|
- **Lambda functions** — your code in a real `public.ecr.aws/lambda/*` container via the Lambda Runtime Interface Emulator
|
|
35
63
|
- **HTTP APIs & Function URLs** — API Gateway REST v1 / HTTP v2 / WebSocket and Lambda Function URLs served by a local HTTP server
|
|
36
64
|
- **ECS** — tasks and services as real Docker containers (awsvpc / Service Connect / Cloud Map registry)
|
|
65
|
+
- **Bedrock AgentCore Runtime** — your agent container served over the AgentCore HTTP contract (`POST /invocations` + `GET /ping` on 8080), invoked once locally before deploy
|
|
37
66
|
- **Authorizers** — Lambda authorizers, Cognito User Pool JWT verification, IAM SigV4 verification
|
|
38
67
|
|
|
39
68
|
**Calls real AWS (managed services):**
|
|
40
69
|
|
|
41
70
|
- DynamoDB / S3 / Secrets Manager / SSM / SNS / SQS / Kinesis / EventBridge / Step Functions / etc.
|
|
42
|
-
- Your Lambda code talks to real AWS via your IAM credentials (`--assume-role
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
## Install
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm install -g cdk-local
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
This installs the `cdkl` command.
|
|
71
|
+
- Your Lambda code talks to real AWS via your IAM credentials (`--assume-role`, or `--from-cfn-stack` to bind to a deployed stack)
|
|
72
|
+
- Want offline emulation of managed services too? Pair cdk-local with a service emulator like LocalStack — cdk-local does not bundle one.
|
|
52
73
|
|
|
53
74
|
## Two ways to use it
|
|
54
75
|
|
|
@@ -65,13 +86,12 @@ cdkl invoke # pick a Lambda, then invoke it
|
|
|
65
86
|
cdkl run-task # pick an ECS task definition, then run it
|
|
66
87
|
cdkl start-service # multi-select one or more ECS services
|
|
67
88
|
cdkl start-api # multi-select APIs to serve (→ selects all)
|
|
89
|
+
cdkl invoke-agentcore # pick a Bedrock AgentCore Runtime, then invoke it
|
|
68
90
|
```
|
|
69
91
|
|
|
70
92
|

|
|
71
93
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Outside a TTY — CI, pipes, redirected stdin — the picker can't run. `invoke` / `run-task` / `start-service` fall back to a "target required" error; pass the target explicitly there (see [below](#passing-a-target-explicitly)). `start-api` is the exception: bare in a non-TTY it serves **every** API (its serve-all default needs no prompt), so scripts keep working unchanged.
|
|
94
|
+
`invoke` / `run-task` pick one target; `start-service` / `start-api` open a multi-select (space toggles, → selects all, ← clears, enter confirms). Outside a TTY — CI, pipes, redirected stdin — the picker can't run: `invoke` / `run-task` / `start-service` need the target passed explicitly (see [below](#passing-a-target-explicitly)), while a bare `start-api` serves **every** API so scripts keep working. Full picker + non-TTY behavior: [docs/cli-reference.md](docs/cli-reference.md#interactive-target-selection).
|
|
75
95
|
|
|
76
96
|
#### See what's available — `list` (alias `ls`)
|
|
77
97
|
|
|
@@ -94,6 +114,9 @@ ECS Services -> cdkl start-service <target...>
|
|
|
94
114
|
|
|
95
115
|
ECS Task Definitions -> cdkl run-task <target>
|
|
96
116
|
MyStack/WebTask
|
|
117
|
+
|
|
118
|
+
AgentCore Runtimes -> cdkl invoke-agentcore <target>
|
|
119
|
+
MyStack/ChatAgent
|
|
97
120
|
```
|
|
98
121
|
|
|
99
122
|
#### Passing a target explicitly
|
|
@@ -112,21 +135,24 @@ cdkl start-service MyStack/OrdersService MyStack/Frontend
|
|
|
112
135
|
# API Gateway / Function URLs — one API, or every API in the stack
|
|
113
136
|
cdkl start-api MyStack/MyApi
|
|
114
137
|
cdkl start-api
|
|
138
|
+
|
|
139
|
+
# Bedrock AgentCore Runtime — run the agent container, POST one event
|
|
140
|
+
cdkl invoke-agentcore MyStack/ChatAgent --event ./event.json
|
|
115
141
|
```
|
|
116
142
|
|
|
117
|
-
`start-api` serves your app's HTTP surface (API Gateway REST v1 / HTTP v2 / WebSocket + Lambda Function URLs) on a local HTTP server, one server per API. In a multi-stack app a bare `cdkl start-api` errors rather than serving every stack's API at once
|
|
143
|
+
`start-api` serves your app's HTTP surface (API Gateway REST v1 / HTTP v2 / WebSocket + Lambda Function URLs) on a local HTTP server, one server per API. In a multi-stack app a bare `cdkl start-api` errors rather than serving every stack's API at once; serve them all with `--all-stacks`, or select one with `--stack <name>`, `--from-cfn-stack <name>`, or a stack-qualified target. See [docs/cli-reference.md](docs/cli-reference.md) for the full precedence rules.
|
|
118
144
|
|
|
119
|
-
For ECS there is no cluster command — locally, Docker is the placement target a cluster abstracts away. Both `run-task` and `start-service` accept an optional `--cluster <name
|
|
145
|
+
For ECS there is no cluster command — locally, Docker is the placement target a cluster abstracts away. Both `run-task` and `start-service` accept an optional `--cluster <name>`; `start-service` also wires Service Connect / Cloud Map registry. See [docs/cli-reference.md](docs/cli-reference.md) for the full ECS option list.
|
|
120
146
|
|
|
121
|
-
|
|
147
|
+
`invoke-agentcore` runs a Bedrock AgentCore Runtime's container locally, waits for `GET /ping`, then POSTs your `--event` (or `{}`) to `POST /invocations` and prints the response — the same request/response loop AgentCore runs in the cloud, without a deploy. v1 covers container-artifact runtimes on the HTTP protocol; the agent's own calls to Bedrock models / memory / other managed services go to real AWS.
|
|
122
148
|
|
|
123
|
-
|
|
149
|
+
Use this for fast iteration on Lambda code, API routing checks, container task smoke tests, and agent request/response checks.
|
|
124
150
|
|
|
125
|
-
|
|
151
|
+
### 2. Bound to a deployed stack
|
|
126
152
|
|
|
127
|
-
|
|
153
|
+
Once your stack is deployed to AWS (via the AWS CDK CLI or any other tool), pass `--from-cfn-stack <StackName>` and cdk-local reads the deployed CloudFormation stack to inject real ARNs, Secret values, and IAM credentials (resolved from your current AWS profile) into the local execution. Env vars that reference deploy-time CloudFormation intrinsics or SSM-backed parameters are resolved too, so a Lambda or container that depends on a sibling resource's ARN or an SSM parameter runs locally without a manual `--env-vars` entry. See [docs/local-emulation.md](docs/local-emulation.md#cloudformation-driven-env-recovery---from-cfn-stack) for the full resolution model.
|
|
128
154
|
|
|
129
|
-
|
|
155
|
+
> SSM `SecureString` parameters are decrypted and injected like any other resolved value, but passed via docker's value-from-process-env form so the decrypted value never appears on the `docker run` argv.
|
|
130
156
|
|
|
131
157
|
#### HTTP APIs & Function URLs — `start-api` (the headline use case)
|
|
132
158
|
|
|
@@ -143,7 +169,7 @@ cdkl start-api MyStack/MyApi --from-cfn-stack
|
|
|
143
169
|
|
|
144
170
|
#### Lambda — `invoke`
|
|
145
171
|
|
|
146
|
-
Single-function debugging against real upstreams (DynamoDB rows, S3 objects,
|
|
172
|
+
Single-function debugging against real upstreams (DynamoDB rows, S3 objects, Secret values).
|
|
147
173
|
|
|
148
174
|
```bash
|
|
149
175
|
cdkl invoke MyStack/MyFunction --event ./event.json --from-cfn-stack MyStack
|
|
@@ -168,11 +194,9 @@ Pass `--watch` to `cdkl start-api` and the server re-synths and hot-reloads when
|
|
|
168
194
|
cdkl start-api MyStack/MyApi --watch
|
|
169
195
|
```
|
|
170
196
|
|
|
171
|
-
- 500 ms debounced [chokidar](https://github.com/paulmillr/chokidar) file watcher on your CDK app's source tree
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
- Synth failures keep the previous version serving (warn-and-continue, never crashes the server).
|
|
175
|
-
- Compatible with `--from-cfn-stack`: each reload re-reads the deployed CloudFormation stack so newly-deployed ARNs are picked up on your next source save without restarting the server.
|
|
197
|
+
- 500 ms debounced [chokidar](https://github.com/paulmillr/chokidar) file watcher on your CDK app's source tree, honoring `cdk.json`'s `watch.include` / `watch.exclude` globs exactly like `cdk watch`. `cdk.out/`, `node_modules`, and `.git` are always excluded, so the reload's own re-synth never re-triggers the watcher.
|
|
198
|
+
- Re-synths and re-discovers routes on each firing — adding a new route to your CDK app shows up locally on save, with no separate `cdk watch` / `cdk synth` process. Synth failures keep the previous version serving (warn-and-continue, never crashes the server).
|
|
199
|
+
- Compatible with `--from-cfn-stack`: each reload re-reads the deployed stack so newly-deployed ARNs are picked up on your next source save without restarting the server.
|
|
176
200
|
|
|
177
201
|
See [docs/local-emulation.md](docs/local-emulation.md#hot-reload---watch) for the full lifecycle, `watch.include` / `watch.exclude` semantics, and known limitations.
|
|
178
202
|
|
|
@@ -195,10 +219,9 @@ cdkl invoke MyStack/MyFunction --event ./event.json --env-vars ./env.json
|
|
|
195
219
|
```
|
|
196
220
|
|
|
197
221
|
- `Parameters` applies to every function / container; function-specific blocks override it.
|
|
198
|
-
- For Lambda (`invoke`, `start-api`), function-specific keys can be
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
- Composes with `--from-cfn-stack`: the state source resolves env vars first, then `--env-vars` overrides only the keys you list (unnamed keys keep their state-resolved value). Full precedence in [docs/cli-reference.md](docs/cli-reference.md).
|
|
222
|
+
- For Lambda (`invoke`, `start-api`), function-specific keys can be a **CDK display path** (`MyStack/MyFunction` — same form `cdkl invoke` accepts) or a **CloudFormation logical ID** (`MyFunctionLogicalId1234ABCD`, the SAM-compatible form). For ECS (`run-task`, `start-service`), keys are container names from the task definition.
|
|
223
|
+
- The file format matches `sam local invoke --env-vars`, so an existing SAM env-vars file works unchanged.
|
|
224
|
+
- Composes with `--from-cfn-stack`: the state source resolves env vars first, then `--env-vars` overrides only the keys you list. Full precedence in [docs/cli-reference.md](docs/cli-reference.md).
|
|
202
225
|
|
|
203
226
|
## Supported resources
|
|
204
227
|
|
|
@@ -212,6 +235,9 @@ cdkl invoke MyStack/MyFunction --event ./event.json --env-vars ./env.json
|
|
|
212
235
|
| `AWS::ECS::TaskDefinition` (run-task) | ✓ |
|
|
213
236
|
| `AWS::ECS::Service` (start-service) | ✓ |
|
|
214
237
|
| `AWS::ServiceDiscovery::*` (Cloud Map / Service Connect) | ✓ |
|
|
238
|
+
| `AWS::BedrockAgentCore::Runtime` (invoke-agentcore, container artifact + HTTP) | ✓ |
|
|
239
|
+
|
|
240
|
+
Lambda runs on every current AWS Lambda runtime — Node.js (18/20/22/24), Python (3.11–3.14), Ruby (3.2/3.3), Java (8.al2/11/17/21), .NET (6/8), and the OS-only `provided.al2` / `provided.al2023`. The retired `go1.x` runtime is rejected with a pointer to migrate to `provided.al2023`.
|
|
215
241
|
|
|
216
242
|
## Programmatic use
|
|
217
243
|
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as createLocalInvokeAgentCoreCommand, l as createLocalStartApiCommand, r as createLocalStartServiceCommand, s as createLocalRunTaskCommand, t as createLocalListCommand, ut as createLocalInvokeCommand } from "./local-list-BUgCsVoM.js";
|
|
3
3
|
import { Command } from "commander";
|
|
4
4
|
|
|
5
5
|
//#region src/cli/index.ts
|
|
6
6
|
const program = new Command();
|
|
7
|
-
program.name("cdkl").description("Run AWS CDK stacks locally with Docker.").version("0.
|
|
7
|
+
program.name("cdkl").description("Run AWS CDK stacks locally with Docker.").version("0.36.0");
|
|
8
8
|
program.addCommand(createLocalInvokeCommand());
|
|
9
|
+
program.addCommand(createLocalInvokeAgentCoreCommand());
|
|
9
10
|
program.addCommand(createLocalStartApiCommand());
|
|
10
11
|
program.addCommand(createLocalRunTaskCommand());
|
|
11
12
|
program.addCommand(createLocalStartServiceCommand());
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander';\nimport { createLocalInvokeCommand } from './commands/local-invoke.js';\nimport { createLocalStartApiCommand } from './commands/local-start-api.js';\nimport { createLocalRunTaskCommand } from './commands/local-run-task.js';\nimport { createLocalStartServiceCommand } from './commands/local-start-service.js';\nimport { createLocalListCommand } from './commands/local-list.js';\n\ndeclare const __CDK_LOCAL_VERSION__: string;\n\nconst program = new Command();\nprogram\n .name('cdkl')\n .description('Run AWS CDK stacks locally with Docker.')\n .version(__CDK_LOCAL_VERSION__);\n\nprogram.addCommand(createLocalInvokeCommand());\nprogram.addCommand(createLocalStartApiCommand());\nprogram.addCommand(createLocalRunTaskCommand());\nprogram.addCommand(createLocalStartServiceCommand());\nprogram.addCommand(createLocalListCommand());\n\nvoid program.parseAsync(process.argv);\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander';\nimport { createLocalInvokeCommand } from './commands/local-invoke.js';\nimport { createLocalInvokeAgentCoreCommand } from './commands/local-invoke-agentcore.js';\nimport { createLocalStartApiCommand } from './commands/local-start-api.js';\nimport { createLocalRunTaskCommand } from './commands/local-run-task.js';\nimport { createLocalStartServiceCommand } from './commands/local-start-service.js';\nimport { createLocalListCommand } from './commands/local-list.js';\n\ndeclare const __CDK_LOCAL_VERSION__: string;\n\nconst program = new Command();\nprogram\n .name('cdkl')\n .description('Run AWS CDK stacks locally with Docker.')\n .version(__CDK_LOCAL_VERSION__);\n\nprogram.addCommand(createLocalInvokeCommand());\nprogram.addCommand(createLocalInvokeAgentCoreCommand());\nprogram.addCommand(createLocalStartApiCommand());\nprogram.addCommand(createLocalRunTaskCommand());\nprogram.addCommand(createLocalStartServiceCommand());\nprogram.addCommand(createLocalListCommand());\n\nvoid program.parseAsync(process.argv);\n"],"mappings":";;;;;AAYA,MAAM,UAAU,IAAI,SAAS;AAC7B,QACG,KAAK,OAAO,CACZ,YAAY,0CAA0C,CACtD,iBAA8B;AAEjC,QAAQ,WAAW,0BAA0B,CAAC;AAC9C,QAAQ,WAAW,mCAAmC,CAAC;AACvD,QAAQ,WAAW,4BAA4B,CAAC;AAChD,QAAQ,WAAW,2BAA2B,CAAC;AAC/C,QAAQ,WAAW,gCAAgC,CAAC;AACpD,QAAQ,WAAW,wBAAwB,CAAC;AAEvC,QAAQ,WAAW,QAAQ,KAAK"}
|
|
@@ -206,7 +206,7 @@ var docker_cmd_exports = /* @__PURE__ */ __exportAll({
|
|
|
206
206
|
*
|
|
207
207
|
* Two parity decisions with `aws-cdk-cli`'s `cdk-assets-lib`:
|
|
208
208
|
* 1. `CDK_DOCKER` env var swaps the binary so podman / finch users can
|
|
209
|
-
* run cdk-local without code changes (`CDK_DOCKER=podman
|
|
209
|
+
* run cdk-local without code changes (`CDK_DOCKER=podman cdkl invoke`).
|
|
210
210
|
* 2. `runDockerStreaming` uses streaming spawn rather than `execFile`'s
|
|
211
211
|
* buffered `maxBuffer` ceiling. BuildKit's progress output can run to
|
|
212
212
|
* tens of MB on multi-stage builds with `# syntax=docker/dockerfile:1`
|
|
@@ -390,4 +390,4 @@ function mergeEnv(overrides) {
|
|
|
390
390
|
|
|
391
391
|
//#endregion
|
|
392
392
|
export { runDockerStreaming as a, getEmbedConfig as c, runDockerForeground as i, resetEmbedConfig as l, formatDockerLoginError as n, spawnStreaming as o, getDockerCmd as r, getLogger as s, docker_cmd_exports as t, setEmbedConfig as u };
|
|
393
|
-
//# sourceMappingURL=docker-cmd
|
|
393
|
+
//# sourceMappingURL=docker-cmd-voNPrcRh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docker-cmd-voNPrcRh.js","names":[],"sources":["../src/local/embed-config.ts","../src/utils/logger.ts","../src/utils/docker-cmd.ts"],"sourcesContent":["/**\n * Embed-time branding configuration.\n *\n * cdk-local hardcodes its own branding (`cdkl` binary, `cdk-local`\n * product name, `cdkl-*` Docker / AWS resource names, `/cdk-local-aws`\n * credential bind-mount) into user-visible error messages and resource\n * identifiers. A host that embeds cdk-local's Commander factories (e.g.\n * cdkd, whose binary is `cdkd` and whose subcommand group is\n * `cdkd local`) passes a {@link CdkLocalEmbedConfig} so those strings\n * read in the host's own branding instead.\n *\n * The four command factories call {@link setEmbedConfig} before building\n * their Commander option tree, so both construction-time strings (option\n * descriptions / defaults) and action-time strings (errors, resource\n * names) read the resolved config via {@link getEmbedConfig}. When no\n * config is supplied every field falls back to cdk-local's own defaults,\n * leaving native `cdkl` behavior byte-identical.\n */\nexport interface CdkLocalEmbedConfig {\n /**\n * Command prefix for subcommand references in user-facing strings, e.g.\n * `${cliName} invoke` / `${cliName} start-api`. Default `'cdkl'`; cdkd\n * passes `'cdkd local'`.\n */\n cliName?: string;\n /**\n * Bare executable / process name for standalone references, e.g.\n * `${binaryName} is exiting` / `${binaryName} could not determine ...`,\n * the local request id, and the hyphen-free Cognito user-pool\n * placeholder id. Default `'cdkl'`; cdkd passes `'cdkd'`.\n */\n binaryName?: string;\n /**\n * Product name for prose references, e.g. `${productName} supports ...`.\n * Also seeds the profile-credentials tmpdir prefix. Default\n * `'cdk-local'`; cdkd passes `'cdkd'`.\n */\n productName?: string;\n /**\n * Prefix for generated Docker / AWS resource identifiers — container,\n * volume, network, image-tag, tmpdir names, STS `RoleSessionName`s, and\n * the example Cloud Map namespace. Default `'cdkl'`; cdkd passes\n * `'cdkd-local'`.\n */\n resourceNamePrefix?: string;\n /**\n * Container directory the host AWS shared-credentials file is\n * bind-mounted under. Default `'/cdk-local-aws'`; cdkd passes\n * `'/cdkd-aws'`.\n */\n awsBindMountPath?: string;\n /**\n * Prefix for the environment variables this CLI reads — `${envPrefix}_APP`\n * (the `--app` fallback) and `${envPrefix}_ROLE_ARN` (the `--role-arn`\n * fallback). Default `'CDKL'`; cdkd passes `'CDKD'`.\n */\n envPrefix?: string;\n /**\n * Whether this host fails-closed by default on unverifiable AWS_IAM SigV4\n * requests. cdk-local's default is warn-and-pass (`false`); a host like\n * cdkd that ships fail-closed-by-default passes `true`. Drives the polarity\n * of the SigV4 warn-message advice (whether the strictness flag reads as an\n * opt-IN or opt-OUT). Default `false`.\n */\n sigV4StrictByDefault?: boolean;\n /**\n * The CLI flag a user toggles to change SigV4 strictness. With\n * `sigV4StrictByDefault: false` it is an opt-IN flag (`'--strict-sigv4'`,\n * the default); with `sigV4StrictByDefault: true` it is the host's opt-OUT\n * flag (cdkd passes `'--allow-unverified-sigv4'`). Default `'--strict-sigv4'`.\n */\n sigV4OptFlag?: string;\n}\n\nexport interface ResolvedEmbedConfig {\n cliName: string;\n binaryName: string;\n productName: string;\n resourceNamePrefix: string;\n awsBindMountPath: string;\n envPrefix: string;\n sigV4StrictByDefault: boolean;\n sigV4OptFlag: string;\n}\n\nconst DEFAULTS: ResolvedEmbedConfig = {\n cliName: 'cdkl',\n binaryName: 'cdkl',\n productName: 'cdk-local',\n resourceNamePrefix: 'cdkl',\n awsBindMountPath: '/cdk-local-aws',\n envPrefix: 'CDKL',\n sigV4StrictByDefault: false,\n sigV4OptFlag: '--strict-sigv4',\n};\n\nlet current: ResolvedEmbedConfig = DEFAULTS;\n\n/**\n * Resolve and install the active embed config. Called once per command\n * factory with the host's overrides (or `undefined` for native cdkl\n * behavior). Idempotent: re-calling with the same overrides is a no-op,\n * which is why all four factories may safely set the same config.\n */\nexport function setEmbedConfig(config?: CdkLocalEmbedConfig): void {\n current = {\n cliName: config?.cliName ?? DEFAULTS.cliName,\n binaryName: config?.binaryName ?? DEFAULTS.binaryName,\n productName: config?.productName ?? DEFAULTS.productName,\n resourceNamePrefix: config?.resourceNamePrefix ?? DEFAULTS.resourceNamePrefix,\n awsBindMountPath: config?.awsBindMountPath ?? DEFAULTS.awsBindMountPath,\n envPrefix: config?.envPrefix ?? DEFAULTS.envPrefix,\n sigV4StrictByDefault: config?.sigV4StrictByDefault ?? DEFAULTS.sigV4StrictByDefault,\n sigV4OptFlag: config?.sigV4OptFlag ?? DEFAULTS.sigV4OptFlag,\n };\n}\n\n/** The active resolved embed config. */\nexport function getEmbedConfig(): ResolvedEmbedConfig {\n return current;\n}\n\n/** Restore cdk-local defaults. Primarily a test-isolation helper. */\nexport function resetEmbedConfig(): void {\n current = DEFAULTS;\n}\n","/**\n * Logger interface and console implementation for cdk-local.\n *\n * A minimal `Logger` / `LogLevel` interface with a `ConsoleLogger`\n * (`getLogger()` / `setLogger()` exports, `child(prefix)` for prefixed\n * sub-loggers). cdk-local invokes a single Lambda / API / task at a time,\n * so there is no parallel multi-stack output to interleave — a plain\n * console logger with no output buffer or live progress renderer suffices.\n */\n\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error';\n\nexport interface Logger {\n debug(message: string, ...args: unknown[]): void;\n info(message: string, ...args: unknown[]): void;\n warn(message: string, ...args: unknown[]): void;\n error(message: string, ...args: unknown[]): void;\n setLevel(level: LogLevel): void;\n getLevel(): LogLevel;\n child(prefix: string): Logger;\n}\n\n/**\n * ANSI color codes\n *\n * Kept internal — `ConsoleLogger.formatMessage` references these for the\n * verbose/compact mode level prefixes.\n */\nconst colors = {\n reset: '\\x1b[0m',\n bright: '\\x1b[1m',\n dim: '\\x1b[2m',\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n cyan: '\\x1b[36m',\n gray: '\\x1b[90m',\n} as const;\n\nfunction formatTimestamp(): string {\n const now = new Date();\n return now.toISOString();\n}\n\n/**\n * Console logger implementation\n *\n * Supports two output modes:\n * - verbose (debug level): timestamps, module prefixes, all details\n * - compact (info level): clean output without timestamps or prefixes\n */\nexport class ConsoleLogger implements Logger {\n private level: LogLevel;\n private useColors: boolean;\n\n constructor(level: LogLevel = 'info', useColors: boolean = true) {\n this.level = level;\n this.useColors = useColors;\n }\n\n private shouldLog(level: LogLevel): boolean {\n const levels: LogLevel[] = ['debug', 'info', 'warn', 'error'];\n const currentLevelIndex = levels.indexOf(this.level);\n const messageLevelIndex = levels.indexOf(level);\n return messageLevelIndex >= currentLevelIndex;\n }\n\n private formatMessage(level: LogLevel, message: string, ...args: unknown[]): string {\n const formattedArgs = args.length > 0 ? ' ' + args.map((a) => JSON.stringify(a)).join(' ') : '';\n\n if (this.level === 'debug') {\n const timestamp = formatTimestamp();\n const levelStr = level.toUpperCase().padEnd(5);\n\n if (this.useColors) {\n const levelColorMap: Record<LogLevel, string> = {\n debug: colors.gray,\n info: colors.blue,\n warn: colors.yellow,\n error: colors.red,\n };\n const levelColor = levelColorMap[level];\n\n return `${colors.dim}${timestamp}${colors.reset} ${levelColor}${levelStr}${colors.reset} ${message}${formattedArgs}`;\n }\n\n return `${timestamp} ${levelStr} ${message}${formattedArgs}`;\n }\n\n if (this.useColors) {\n if (level === 'error') {\n return `${colors.red}${message}${formattedArgs}${colors.reset}`;\n }\n if (level === 'warn') {\n return `${colors.yellow}${message}${formattedArgs}${colors.reset}`;\n }\n return `${message}${formattedArgs}`;\n }\n\n return `${message}${formattedArgs}`;\n }\n\n private emit(level: LogLevel, formatted: string): void {\n if (level === 'error') console.error(formatted);\n else if (level === 'warn') console.warn(formatted);\n else if (level === 'info') console.info(formatted);\n else console.debug(formatted);\n }\n\n debug(message: string, ...args: unknown[]): void {\n if (this.shouldLog('debug')) {\n this.emit('debug', this.formatMessage('debug', message, ...args));\n }\n }\n\n info(message: string, ...args: unknown[]): void {\n if (this.shouldLog('info')) {\n this.emit('info', this.formatMessage('info', message, ...args));\n }\n }\n\n warn(message: string, ...args: unknown[]): void {\n if (this.shouldLog('warn')) {\n this.emit('warn', this.formatMessage('warn', message, ...args));\n }\n }\n\n error(message: string, ...args: unknown[]): void {\n if (this.shouldLog('error')) {\n this.emit('error', this.formatMessage('error', message, ...args));\n }\n }\n\n setLevel(level: LogLevel): void {\n this.level = level;\n }\n\n getLevel(): LogLevel {\n return this.level;\n }\n\n child(prefix: string): ChildLogger {\n return new ChildLogger(prefix, this.useColors);\n }\n}\n\n/**\n * Child logger that always syncs level from global logger\n */\nclass ChildLogger extends ConsoleLogger {\n private readonly prefix: string;\n\n constructor(prefix: string, useColors: boolean) {\n super('info', useColors);\n this.prefix = prefix;\n }\n\n private syncLevel(): void {\n if (globalLogger) {\n this.setLevel(globalLogger.getLevel());\n }\n }\n\n override debug(message: string, ...args: unknown[]): void {\n this.syncLevel();\n super.debug(`[${this.prefix}] ${message}`, ...args);\n }\n\n override info(message: string, ...args: unknown[]): void {\n this.syncLevel();\n const msg = this.getLevel() === 'debug' ? `[${this.prefix}] ${message}` : message;\n super.info(msg, ...args);\n }\n\n override warn(message: string, ...args: unknown[]): void {\n this.syncLevel();\n const msg = this.getLevel() === 'debug' ? `[${this.prefix}] ${message}` : message;\n super.warn(msg, ...args);\n }\n\n override error(message: string, ...args: unknown[]): void {\n this.syncLevel();\n const msg = this.getLevel() === 'debug' ? `[${this.prefix}] ${message}` : message;\n super.error(msg, ...args);\n }\n}\n\nlet globalLogger: ConsoleLogger | null = null;\n\nexport function getLogger(): ConsoleLogger {\n if (!globalLogger) {\n globalLogger = new ConsoleLogger();\n }\n return globalLogger;\n}\n\nexport function setLogger(logger: ConsoleLogger): void {\n globalLogger = logger;\n}\n","import { spawn } from 'node:child_process';\nimport { getLogger } from './logger.js';\nimport { getEmbedConfig } from '../local/embed-config.js';\n\n/**\n * Shared helpers for invoking the docker-compatible CLI binary across cdk-local.\n *\n * Two parity decisions with `aws-cdk-cli`'s `cdk-assets-lib`:\n * 1. `CDK_DOCKER` env var swaps the binary so podman / finch users can\n * run cdk-local without code changes (`CDK_DOCKER=podman cdkl invoke`).\n * 2. `runDockerStreaming` uses streaming spawn rather than `execFile`'s\n * buffered `maxBuffer` ceiling. BuildKit's progress output can run to\n * tens of MB on multi-stage builds with `# syntax=docker/dockerfile:1`\n * frontend downloads + heredoc / `RUN --mount=...` features; the 50 MB\n * `execFile` ceiling cdk-local used to set silently killed those builds\n * with `ERR_CHILD_PROCESS_STDIO_MAXBUFFER`.\n *\n * Output handling: stdout/stderr are collected in memory unconditionally so\n * `runDockerStreaming` can return them to the caller for error wrapping.\n * When the logger is at debug level (i.e. the user passed `--verbose`),\n * the chunks are ALSO mirrored to `process.stdout` / `process.stderr` so\n * the user sees live build progress.\n */\n\n/**\n * Return the docker-compatible CLI binary to invoke. Matches CDK CLI:\n * `CDK_DOCKER` env var overrides the default `docker` so users on\n * podman / finch / nerdctl can swap without changing cdk-local code.\n */\nexport function getDockerCmd(): string {\n const override = process.env['CDK_DOCKER'];\n return override && override.length > 0 ? override : 'docker';\n}\n\nexport interface SpawnResult {\n stdout: string;\n stderr: string;\n}\n\nexport interface SpawnError extends Error {\n /** Captured stderr at the time of failure. */\n stderr: string;\n /** Captured stdout at the time of failure. */\n stdout: string;\n /** Process exit code (null when the process was killed by signal). */\n exitCode: number | null;\n}\n\nexport interface RunDockerOptions {\n /** Optional working directory for the subprocess. */\n cwd?: string;\n /**\n * Additional environment variables to set. Merged on top of `process.env`\n * (so the user's `DOCKER_BUILDKIT=1` and friends propagate through).\n */\n env?: Record<string, string | undefined>;\n /** When set, written to stdin (used by `docker login --password-stdin`). */\n input?: string;\n /**\n * When true, mirror stdout/stderr chunks to `process.stdout` / `process.stderr`\n * as they arrive. Useful for `docker pull` / `docker build` where live\n * progress is desirable. Defaults to \"true when the logger is at debug\n * level\" — matches the existing `--verbose` UX.\n */\n streamLive?: boolean;\n}\n\n/**\n * Spawn a docker-compatible CLI binary (resolved via `getDockerCmd`) with\n * streaming I/O. Collects stdout/stderr in memory and resolves with both\n * on exit code 0; rejects with a `SpawnError` carrying both streams on any\n * non-zero exit so the caller can wrap with its own error class without\n * losing the upstream output.\n *\n * No `maxBuffer` ceiling: BuildKit progress output frequently exceeds the\n * `child_process.execFile` default of 1 MB (cdk-local previously bumped to 50 MB\n * but BuildKit + frontend pulls can still exceed that on first-time builds).\n */\nexport async function runDockerStreaming(\n args: string[],\n options: RunDockerOptions = {}\n): Promise<SpawnResult> {\n return spawnStreaming(getDockerCmd(), args, options);\n}\n\n/**\n * Generic streaming spawn — used by `runDockerStreaming` AND by the\n * `executable` source mode in `docker-build.ts` (which runs an arbitrary\n * user-supplied build command, not docker).\n */\nexport async function spawnStreaming(\n cmd: string,\n args: string[],\n options: RunDockerOptions = {}\n): Promise<SpawnResult> {\n const streamLive = options.streamLive ?? getLogger().getLevel() === 'debug';\n const env = options.env ? mergeEnv(options.env) : undefined;\n\n return new Promise<SpawnResult>((resolve, reject) => {\n const child = spawn(cmd, args, {\n cwd: options.cwd,\n env,\n stdio: [options.input ? 'pipe' : 'ignore', 'pipe', 'pipe'],\n });\n\n const stdoutChunks: Buffer[] = [];\n const stderrChunks: Buffer[] = [];\n\n child.stdout!.on('data', (chunk: Buffer) => {\n stdoutChunks.push(chunk);\n if (streamLive) process.stdout.write(chunk);\n });\n child.stderr!.on('data', (chunk: Buffer) => {\n stderrChunks.push(chunk);\n if (streamLive) process.stderr.write(chunk);\n });\n\n child.once('error', (err: NodeJS.ErrnoException) => {\n if (err.code === 'ENOENT') {\n const usingOverride = process.env['CDK_DOCKER'] === cmd && cmd !== 'docker';\n reject(\n new Error(\n usingOverride\n ? `Failed to find and execute '${cmd}' (resolved via CDK_DOCKER). ` +\n `Install '${cmd}' or unset CDK_DOCKER to fall back to 'docker'.`\n : `Failed to find and execute '${cmd}'. Install Docker (or set the ` +\n `'CDK_DOCKER' environment variable to a compatible binary such as podman / finch).`\n )\n );\n } else {\n reject(err);\n }\n });\n\n child.once('close', (code) => {\n const stdout = Buffer.concat(stdoutChunks).toString('utf-8');\n const stderr = Buffer.concat(stderrChunks).toString('utf-8');\n if (code === 0) {\n resolve({ stdout, stderr });\n } else {\n const message =\n stderr.trim() || stdout.trim() || `${cmd} ${args[0] ?? ''} exited with code ${code}`;\n const err = new Error(message) as SpawnError;\n err.stderr = stderr;\n err.stdout = stdout;\n err.exitCode = code;\n reject(err);\n }\n });\n\n if (options.input !== undefined) {\n // Defensive: when spawn() fails (e.g. ENOENT race), the synchronous\n // write below could emit a stream 'error' event before the close /\n // error handlers above fire. Without a listener, Node escalates that\n // to \"Unhandled 'error' event\" on some versions. cdk-local's only `input`\n // call site is `docker login --password-stdin` with short payloads\n // that complete well within the syscall, so this is unlikely to fire\n // in practice — but the no-op listener is free.\n child.stdin!.on('error', () => {\n /* surfaced via the outer error/close handlers above */\n });\n child.stdin!.write(options.input);\n child.stdin!.end();\n }\n });\n}\n\n/**\n * Spawn a docker-compatible CLI binary (resolved via `getDockerCmd`) attached\n * to the parent process's stdio so the user sees live output (`docker pull`\n * layer progress, `docker login` interactive prompts that should never fire\n * with `--password-stdin` but still safe to inherit, etc.). Resolves on exit\n * code 0; rejects with a plain `Error` carrying the exit code on any non-zero\n * exit, so the caller can wrap with its own error class.\n *\n * Differs from {@link runDockerStreaming} in two ways:\n * 1. `stdio: 'inherit'` — output is NOT captured, so terminal control codes\n * (color, progress bar overwrites) flow through unchanged. This is the\n * load-bearing reason for the split: `docker pull`'s progress bars only\n * animate properly when stdout is a real TTY connected to the parent.\n * 2. No `input` / `streamLive` options — inherit-mode has nothing to\n * capture and nothing to mirror.\n *\n * Used by the `--verbose`-mode `docker pull` plumbing in `docker-runner.ts`\n * and `ecr-puller.ts` (visible layer progress). Non-verbose pulls go through\n * {@link runDockerStreaming} so stderr can be folded into the error message.\n */\nexport async function runDockerForeground(\n args: string[],\n options: ForegroundOptions = {}\n): Promise<void> {\n return spawnForeground(getDockerCmd(), args, options);\n}\n\nexport interface ForegroundOptions {\n /** Optional working directory for the subprocess. */\n cwd?: string;\n /**\n * Additional environment variables to set. Merged on top of `process.env`\n * (same semantics as {@link RunDockerOptions.env}).\n */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Foreground (stdio-inherit) spawn — the inherit-mode counterpart to\n * {@link spawnStreaming}. Used by {@link runDockerForeground} for docker-CLI\n * subprocesses.\n *\n * The ENOENT branch crafts a docker-specific install hint (\"Install Docker\n * (or set CDK_DOCKER ...)\"), so non-docker callers reusing this helper\n * would see a misleading error on missing-binary failures. Keep the binary\n * docker-shaped, or update the ENOENT message before adding a non-docker\n * call site.\n */\nexport async function spawnForeground(\n cmd: string,\n args: string[],\n options: ForegroundOptions = {}\n): Promise<void> {\n const env = options.env ? mergeEnv(options.env) : undefined;\n return new Promise<void>((resolve, reject) => {\n const child = spawn(cmd, args, {\n cwd: options.cwd,\n env,\n stdio: 'inherit',\n });\n child.once('error', (err: NodeJS.ErrnoException) => {\n if (err.code === 'ENOENT') {\n const usingOverride = process.env['CDK_DOCKER'] === cmd && cmd !== 'docker';\n reject(\n new Error(\n usingOverride\n ? `Failed to find and execute '${cmd}' (resolved via CDK_DOCKER). ` +\n `Install '${cmd}' or unset CDK_DOCKER to fall back to 'docker'.`\n : `Failed to find and execute '${cmd}'. Install Docker (or set the ` +\n `'CDK_DOCKER' environment variable to a compatible binary such as podman / finch).`\n )\n );\n } else {\n reject(new Error(`${cmd} failed: ${err.message}`));\n }\n });\n child.once('close', (code) => {\n if (code === 0) {\n resolve();\n } else {\n reject(new Error(`${cmd} exited with code ${code}`));\n }\n });\n });\n}\n\n/**\n * Format the stderr from a failed `docker login` so the surfaced cdk-local\n * error gives the user an actionable workaround when the underlying\n * failure is a credential-helper persistence bug (which has nothing to\n * do with cdk-local, AWS, or IAM perms — the docker CLI itself fails to\n * save the auth token to the platform's credential store). The most\n * common shape is `osxkeychain` on macOS rejecting an overwrite for\n * an existing entry, but `wincred` (Windows), `pass` (Linux), and\n * `secretservice` (Linux) hit the same class of `Error saving\n * credentials` failure, so the rewritten message stays platform-\n * agnostic — `docker logout <endpoint>` is the correct recovery on\n * every backend.\n *\n * Detected docker / docker-credential-* output patterns:\n * - `error storing credentials - err: exit status 1, out: \\`The\n * specified item already exists in the keychain.\\`` (osxkeychain)\n * - `Error saving credentials: ...` (any backend)\n *\n * Non-matching failures (genuine IAM / network / endpoint problems)\n * pass through with just the stderr trimmed — the original message\n * stays load-bearing for diagnosis.\n */\nexport function formatDockerLoginError(stderr: string, endpoint: string): string {\n const trimmed = stderr.trim();\n const isCredentialHelperFailure =\n trimmed.includes('already exists in the keychain') ||\n trimmed.includes('Error saving credentials');\n if (isCredentialHelperFailure) {\n return (\n `docker's credential helper (osxkeychain on macOS / wincred on Windows / pass / secretservice on Linux) ` +\n `failed to persist the ECR auth token. The \"already exists in the keychain\" / \"Error saving credentials\" ` +\n `output is a known docker-credential-helpers issue — unrelated to ${getEmbedConfig().productName}, AWS credentials, or IAM perms. ` +\n `Quick fix: run \\`docker logout ${endpoint}\\` to clear the stale entry, then retry the ${getEmbedConfig().productName} command. ` +\n `Permanent fix: edit ~/.docker/config.json and remove (or empty) the platform-specific \"credsStore\" entry ` +\n `(e.g. \"osxkeychain\" → \"\" or \"desktop\" on macOS Docker Desktop). ` +\n `Original docker stderr: ${trimmed}`\n );\n }\n return trimmed;\n}\n\nfunction mergeEnv(overrides: Record<string, string | undefined>): NodeJS.ProcessEnv {\n const merged: NodeJS.ProcessEnv = { ...process.env };\n for (const [k, v] of Object.entries(overrides)) {\n if (v === undefined) {\n delete merged[k];\n } else {\n merged[k] = v;\n }\n }\n return merged;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqFA,MAAM,WAAgC;CACpC,SAAS;CACT,YAAY;CACZ,aAAa;CACb,oBAAoB;CACpB,kBAAkB;CAClB,WAAW;CACX,sBAAsB;CACtB,cAAc;CACf;AAED,IAAI,UAA+B;;;;;;;AAQnC,SAAgB,eAAe,QAAoC;CACjE,UAAU;EACR,SAAS,QAAQ,WAAW,SAAS;EACrC,YAAY,QAAQ,cA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OAAO,OAAO;MAEd,OAAO,KAAK;CAGhB,OAAO"}
|
package/dist/index.d.ts
CHANGED
|
@@ -78,6 +78,8 @@ interface CrossStackResolver {
|
|
|
78
78
|
interface SubstitutionContext {
|
|
79
79
|
resources: Record<string, ResourceState>;
|
|
80
80
|
parameters?: Record<string, string>;
|
|
81
|
+
sensitiveParameters?: ReadonlySet<string>;
|
|
82
|
+
onSensitiveParameterConsumed?: (logicalId: string) => void;
|
|
81
83
|
pseudoParameters?: PseudoParameters;
|
|
82
84
|
crossStackResolver?: CrossStackResolver;
|
|
83
85
|
consumerRegion?: string;
|
|
@@ -90,6 +92,7 @@ interface StateEnvSubstitutionAudit {
|
|
|
90
92
|
key: string;
|
|
91
93
|
reason: string;
|
|
92
94
|
}>;
|
|
95
|
+
sensitiveKeys: string[];
|
|
93
96
|
}
|
|
94
97
|
declare function substituteEnvVarsFromState(templateEnv: Record<string, unknown> | undefined, contextOrResources: SubstitutionContext | Record<string, ResourceState>): {
|
|
95
98
|
env: Record<string, unknown>;
|
|
@@ -100,6 +103,19 @@ declare function substituteEnvVarsFromStateAsync(templateEnv: Record<string, unk
|
|
|
100
103
|
audit: StateEnvSubstitutionAudit;
|
|
101
104
|
}>;
|
|
102
105
|
//#endregion
|
|
106
|
+
//#region src/local/ssm-parameter-resolver.d.ts
|
|
107
|
+
interface SsmParameterRef {
|
|
108
|
+
logicalId: string;
|
|
109
|
+
ssmName: string;
|
|
110
|
+
isList: boolean;
|
|
111
|
+
}
|
|
112
|
+
interface ResolvedSsmParameters {
|
|
113
|
+
values: Record<string, string>;
|
|
114
|
+
secureStringLogicalIds: string[];
|
|
115
|
+
}
|
|
116
|
+
declare function collectSsmParameterRefs(template: Pick<CloudFormationTemplate, 'Parameters'> | undefined): SsmParameterRef[];
|
|
117
|
+
declare function resolveSsmParameters(client: SSMClient, refs: readonly SsmParameterRef[], label: string): Promise<ResolvedSsmParameters>;
|
|
118
|
+
//#endregion
|
|
103
119
|
//#region src/local/local-state-provider.d.ts
|
|
104
120
|
interface LocalStateRecord {
|
|
105
121
|
resources: Record<string, ResourceState>;
|
|
@@ -111,7 +127,7 @@ interface LocalStateProvider {
|
|
|
111
127
|
load(stackName: string, synthRegion: string | undefined): Promise<LocalStateRecord | undefined>;
|
|
112
128
|
buildCrossStackResolver(consumerRegion: string): Promise<CrossStackResolver | undefined>;
|
|
113
129
|
resolveDeployedFunctionEnv?(functionPhysicalId: string): Promise<Record<string, string> | undefined>;
|
|
114
|
-
resolveTemplateSsmParameters?(template: CloudFormationTemplate): Promise<
|
|
130
|
+
resolveTemplateSsmParameters?(template: CloudFormationTemplate): Promise<ResolvedSsmParameters>;
|
|
115
131
|
dispose(): void;
|
|
116
132
|
}
|
|
117
133
|
//#endregion
|
|
@@ -192,6 +208,77 @@ interface CreateLocalInvokeCommandOptions {
|
|
|
192
208
|
}
|
|
193
209
|
declare function createLocalInvokeCommand(opts?: CreateLocalInvokeCommandOptions): Command;
|
|
194
210
|
//#endregion
|
|
211
|
+
//#region src/local/intrinsic-image.d.ts
|
|
212
|
+
interface ImageResolutionContext {
|
|
213
|
+
pseudoParameters?: {
|
|
214
|
+
accountId?: string;
|
|
215
|
+
region?: string;
|
|
216
|
+
partition?: string;
|
|
217
|
+
urlSuffix?: string;
|
|
218
|
+
};
|
|
219
|
+
stateResources?: Record<string, ResourceState>;
|
|
220
|
+
stateParameters?: Record<string, string>;
|
|
221
|
+
stateSensitiveParameters?: readonly string[];
|
|
222
|
+
}
|
|
223
|
+
declare function derivePseudoParametersFromRegion(region: string | undefined, accountId?: string): {
|
|
224
|
+
accountId?: string;
|
|
225
|
+
region: string;
|
|
226
|
+
partition: string;
|
|
227
|
+
urlSuffix: string;
|
|
228
|
+
} | undefined;
|
|
229
|
+
type FnJoinResolveOutcome = {
|
|
230
|
+
kind: 'not-applicable';
|
|
231
|
+
} | {
|
|
232
|
+
kind: 'resolved';
|
|
233
|
+
uri: string;
|
|
234
|
+
} | {
|
|
235
|
+
kind: 'needs-state';
|
|
236
|
+
repoLogicalId: string;
|
|
237
|
+
} | {
|
|
238
|
+
kind: 'unsupported-join';
|
|
239
|
+
reason: string;
|
|
240
|
+
};
|
|
241
|
+
declare function tryResolveImageFnJoin(raw: unknown, resources: Record<string, TemplateResource>, context: ImageResolutionContext | undefined): FnJoinResolveOutcome;
|
|
242
|
+
declare function substituteImagePlaceholders(flat: string, resources: Record<string, TemplateResource>, context: ImageResolutionContext | undefined): string;
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/local/agentcore-resolver.d.ts
|
|
245
|
+
declare const AGENTCORE_RUNTIME_TYPE = "AWS::BedrockAgentCore::Runtime";
|
|
246
|
+
declare const AGENTCORE_HTTP_PROTOCOL = "HTTP";
|
|
247
|
+
interface ResolvedAgentCoreRuntime {
|
|
248
|
+
stack: StackInfo;
|
|
249
|
+
logicalId: string;
|
|
250
|
+
resource: TemplateResource;
|
|
251
|
+
containerUri: string;
|
|
252
|
+
environmentVariables: Record<string, unknown>;
|
|
253
|
+
roleArn?: string;
|
|
254
|
+
protocol: string;
|
|
255
|
+
}
|
|
256
|
+
declare class AgentCoreResolutionError extends Error {
|
|
257
|
+
constructor(message: string);
|
|
258
|
+
}
|
|
259
|
+
declare function resolveAgentCoreTarget(target: string, stacks: StackInfo[], imageContext?: ImageResolutionContext): ResolvedAgentCoreRuntime;
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/local/agentcore-client.d.ts
|
|
262
|
+
declare const AGENTCORE_SESSION_ID_HEADER = "X-Amzn-Bedrock-AgentCore-Runtime-Session-Id";
|
|
263
|
+
interface AgentCoreInvokeResult {
|
|
264
|
+
status: number;
|
|
265
|
+
contentType: string | null;
|
|
266
|
+
raw: string;
|
|
267
|
+
}
|
|
268
|
+
declare function waitForAgentCorePing(host: string, port: number, timeoutMs?: number): Promise<void>;
|
|
269
|
+
interface InvokeAgentCoreOptions {
|
|
270
|
+
sessionId: string;
|
|
271
|
+
timeoutMs: number;
|
|
272
|
+
}
|
|
273
|
+
declare function invokeAgentCore(host: string, port: number, event: unknown, options: InvokeAgentCoreOptions): Promise<AgentCoreInvokeResult>;
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/cli/commands/local-invoke-agentcore.d.ts
|
|
276
|
+
interface CreateLocalInvokeAgentCoreCommandOptions {
|
|
277
|
+
extraStateProviders?: ExtraStateProviders;
|
|
278
|
+
embedConfig?: CdkLocalEmbedConfig;
|
|
279
|
+
}
|
|
280
|
+
declare function createLocalInvokeAgentCoreCommand(opts?: CreateLocalInvokeAgentCoreCommandOptions): Command;
|
|
281
|
+
//#endregion
|
|
195
282
|
//#region src/cli/config-loader.d.ts
|
|
196
283
|
interface CdkWatchConfig {
|
|
197
284
|
include: string[];
|
|
@@ -528,38 +615,6 @@ interface ApiTargetSubset {
|
|
|
528
615
|
declare function resolveApiTargetSubset(routes: readonly RouteWithAuth[], identifiers: readonly string[], stackNames: readonly string[]): ApiTargetSubset;
|
|
529
616
|
declare function createLocalStartApiCommand(opts?: CreateLocalStartApiCommandOptions): Command;
|
|
530
617
|
//#endregion
|
|
531
|
-
//#region src/local/intrinsic-image.d.ts
|
|
532
|
-
interface ImageResolutionContext {
|
|
533
|
-
pseudoParameters?: {
|
|
534
|
-
accountId?: string;
|
|
535
|
-
region?: string;
|
|
536
|
-
partition?: string;
|
|
537
|
-
urlSuffix?: string;
|
|
538
|
-
};
|
|
539
|
-
stateResources?: Record<string, ResourceState>;
|
|
540
|
-
stateParameters?: Record<string, string>;
|
|
541
|
-
}
|
|
542
|
-
declare function derivePseudoParametersFromRegion(region: string | undefined, accountId?: string): {
|
|
543
|
-
accountId?: string;
|
|
544
|
-
region: string;
|
|
545
|
-
partition: string;
|
|
546
|
-
urlSuffix: string;
|
|
547
|
-
} | undefined;
|
|
548
|
-
type FnJoinResolveOutcome = {
|
|
549
|
-
kind: 'not-applicable';
|
|
550
|
-
} | {
|
|
551
|
-
kind: 'resolved';
|
|
552
|
-
uri: string;
|
|
553
|
-
} | {
|
|
554
|
-
kind: 'needs-state';
|
|
555
|
-
repoLogicalId: string;
|
|
556
|
-
} | {
|
|
557
|
-
kind: 'unsupported-join';
|
|
558
|
-
reason: string;
|
|
559
|
-
};
|
|
560
|
-
declare function tryResolveImageFnJoin(raw: unknown, resources: Record<string, TemplateResource>, context: ImageResolutionContext | undefined): FnJoinResolveOutcome;
|
|
561
|
-
declare function substituteImagePlaceholders(flat: string, resources: Record<string, TemplateResource>, context: ImageResolutionContext | undefined): string;
|
|
562
|
-
//#endregion
|
|
563
618
|
//#region src/local/ecs-task-resolver.d.ts
|
|
564
619
|
declare class EcsTaskResolutionError extends Error {
|
|
565
620
|
constructor(message: string);
|
|
@@ -592,6 +647,7 @@ interface TargetListing {
|
|
|
592
647
|
apis: TargetEntry[];
|
|
593
648
|
ecsServices: TargetEntry[];
|
|
594
649
|
ecsTaskDefinitions: TargetEntry[];
|
|
650
|
+
agentCoreRuntimes: TargetEntry[];
|
|
595
651
|
}
|
|
596
652
|
declare function listTargets(stacks: readonly StackInfo[]): TargetListing;
|
|
597
653
|
declare function countTargets(listing: TargetListing): number;
|
|
@@ -625,22 +681,13 @@ declare class CfnLocalStateProvider implements LocalStateProvider {
|
|
|
625
681
|
private getClient;
|
|
626
682
|
private getLambdaClient;
|
|
627
683
|
private getSsmClient;
|
|
628
|
-
resolveTemplateSsmParameters(template: CloudFormationTemplate): Promise<
|
|
684
|
+
resolveTemplateSsmParameters(template: CloudFormationTemplate): Promise<ResolvedSsmParameters>;
|
|
629
685
|
resolveDeployedFunctionEnv(functionPhysicalId: string): Promise<Record<string, string> | undefined>;
|
|
630
686
|
load(_stackName: string, _synthRegion: string | undefined): Promise<LocalStateRecord | undefined>;
|
|
631
687
|
buildCrossStackResolver(_consumerRegion: string): Promise<CrossStackResolver | undefined>;
|
|
632
688
|
dispose(): void;
|
|
633
689
|
}
|
|
634
690
|
//#endregion
|
|
635
|
-
//#region src/local/ssm-parameter-resolver.d.ts
|
|
636
|
-
interface SsmParameterRef {
|
|
637
|
-
logicalId: string;
|
|
638
|
-
ssmName: string;
|
|
639
|
-
isList: boolean;
|
|
640
|
-
}
|
|
641
|
-
declare function collectSsmParameterRefs(template: Pick<CloudFormationTemplate, 'Parameters'> | undefined): SsmParameterRef[];
|
|
642
|
-
declare function resolveSsmParameters(client: SSMClient, refs: readonly SsmParameterRef[], label: string): Promise<Record<string, string>>;
|
|
643
|
-
//#endregion
|
|
644
691
|
//#region src/local/intrinsic-utils.d.ts
|
|
645
692
|
declare function pickRefLogicalId(value: unknown): string | null;
|
|
646
693
|
//#endregion
|
|
@@ -1084,5 +1131,5 @@ interface FileWatcherOptions {
|
|
|
1084
1131
|
}
|
|
1085
1132
|
declare function createFileWatcher(options: FileWatcherOptions): FileWatcher;
|
|
1086
1133
|
//#endregion
|
|
1087
|
-
export { type ApiServerGroup, type ApiTargetSubset, type AuthorizerCache, type AuthorizerEventOverlay, type AuthorizerInfo, type BuildContainerImageOptions, type CachedAuthorizerResult, type CdkLocalEmbedConfig, type CdkWatchConfig, CfnLocalStateProvider, type CfnLocalStateProviderOptions, type CloudMapIndex, CloudMapRegistry, ConnectionRegistry, type ConnectionRegistryEntry, type CorsConfig, type CreateLocalInvokeCommandOptions, type CreateLocalListCommandOptions, type CreateLocalRunTaskCommandOptions, type CreateLocalStartApiCommandOptions, type CreateLocalStartServiceCommandOptions, type CredentialsLoader, type CrossStackResolver, type DiscoveredRoute, type DiscoveredWebSocketApi, EcsTaskResolutionError, type EnvOverrideFile, type ExtraStateProviders, type FileWatcher, type FileWatcherOptions, type FormatTargetListingOptions, HOST_GATEWAY_MIN_VERSION, type HttpRequestSnapshot, type ImageResolutionContext, type IntegrationResponseEntry, type JwksCache, type LambdaArnResolveOutcome, LocalInvokeBuildError, type LocalStateProvider, type LocalStateProviderFactory, type LocalStateRecord, LocalStateSourceError, type LocalStateSourceOptions, type MatchedRouteContext, type MtlsServerConfig, type PseudoParameters, type RegistrationHandle, type RequestParameterContext, type ResolveParametersOutcome, type ResolvedStage, type RestV1IntegrationConfig, type RouteMatchResult, type RouteWithAuth, type ServerState, type SsmParameterRef, type StartedApiServer, type StateEnvSubstitutionAudit, type SubstitutionContext, type TargetEntry, type TargetListing, type TranslatedHttpResponse, VtlEvaluationError, type WatchPredicates, type WebSocketHandshakeSnapshot, type WebSocketLambdaEvent, type WebSocketRouteEntry, applyAuthorizerOverlay, applyCorsResponseHeaders, architectureToPlatform, attachAuthorizers, attachStageContext, availableApiIdentifiers, bufferToBody, buildCloudMapIndex, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildHttpApiV2Event, buildJwksUrlFromIssuer, buildMessageEvent, buildMethodArn, buildMgmtEndpointEnvUrl, buildRestV1Event, buildStageMap, collectSsmParameterRefs, computeRequestIdentityHash, countTargets, createAuthorizerCache, createFileWatcher, createJwksCache, createLocalInvokeCommand, createLocalListCommand, createLocalRunTaskCommand, createLocalStartApiCommand, createLocalStartServiceCommand, createLocalStateProvider, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, discoverRoutes, discoverWebSocketApis, discoverWebSocketApisOrThrow, evaluateCachedLambdaPolicy, evaluateResponseParameters, filterRoutesByApiIdentifier, filterRoutesByApiIdentifiers, formatTargetListing, getContainerNetworkIp, getEmbedConfig, groupRoutesByServer, handleConnectionsRequest, invokeRequestAuthorizer, invokeTokenAuthorizer, isCfnFlagPresent, isFunctionUrlOacFronted, listTargets, matchPreflight, matchRoute, materializeLayerFromArn, parseConnectionsPath, parseSelectionExpressionPath, pickRefLogicalId, pickResponseTemplate, probeHostGatewaySupport, readMtlsMaterialsFromDisk, rejectExplicitCfnStackWithMultipleStacks, resetEmbedConfig, resolveApiTargetSubset, resolveCfnFallbackRegion, resolveCfnRegion, resolveCfnStackName, resolveEnvVars, resolveLambdaArnIntrinsic, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSelectionExpression, resolveServiceIntegrationParameters, resolveSsmParameters, resolveWatchConfig, selectIntegrationResponse, setEmbedConfig, startApiServer, substituteAgainstState, substituteAgainstStateAsync, substituteEnvVarsFromState, substituteEnvVarsFromStateAsync, substituteImagePlaceholders, translateLambdaResponse, tryParseStatus, tryResolveImageFnJoin, verifyCognitoJwt, verifyJwtAuthorizer };
|
|
1134
|
+
export { AGENTCORE_HTTP_PROTOCOL, AGENTCORE_RUNTIME_TYPE, AGENTCORE_SESSION_ID_HEADER, type AgentCoreInvokeResult, AgentCoreResolutionError, type ApiServerGroup, type ApiTargetSubset, type AuthorizerCache, type AuthorizerEventOverlay, type AuthorizerInfo, type BuildContainerImageOptions, type CachedAuthorizerResult, type CdkLocalEmbedConfig, type CdkWatchConfig, CfnLocalStateProvider, type CfnLocalStateProviderOptions, type CloudMapIndex, CloudMapRegistry, ConnectionRegistry, type ConnectionRegistryEntry, type CorsConfig, type CreateLocalInvokeAgentCoreCommandOptions, type CreateLocalInvokeCommandOptions, type CreateLocalListCommandOptions, type CreateLocalRunTaskCommandOptions, type CreateLocalStartApiCommandOptions, type CreateLocalStartServiceCommandOptions, type CredentialsLoader, type CrossStackResolver, type DiscoveredRoute, type DiscoveredWebSocketApi, EcsTaskResolutionError, type EnvOverrideFile, type ExtraStateProviders, type FileWatcher, type FileWatcherOptions, type FormatTargetListingOptions, HOST_GATEWAY_MIN_VERSION, type HttpRequestSnapshot, type ImageResolutionContext, type IntegrationResponseEntry, type InvokeAgentCoreOptions, type JwksCache, type LambdaArnResolveOutcome, LocalInvokeBuildError, type LocalStateProvider, type LocalStateProviderFactory, type LocalStateRecord, LocalStateSourceError, type LocalStateSourceOptions, type MatchedRouteContext, type MtlsServerConfig, type PseudoParameters, type RegistrationHandle, type RequestParameterContext, type ResolveParametersOutcome, type ResolvedAgentCoreRuntime, type ResolvedSsmParameters, type ResolvedStage, type RestV1IntegrationConfig, type RouteMatchResult, type RouteWithAuth, type ServerState, type SsmParameterRef, type StartedApiServer, type StateEnvSubstitutionAudit, type SubstitutionContext, type TargetEntry, type TargetListing, type TranslatedHttpResponse, VtlEvaluationError, type WatchPredicates, type WebSocketHandshakeSnapshot, type WebSocketLambdaEvent, type WebSocketRouteEntry, applyAuthorizerOverlay, applyCorsResponseHeaders, architectureToPlatform, attachAuthorizers, attachStageContext, availableApiIdentifiers, bufferToBody, buildCloudMapIndex, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildHttpApiV2Event, buildJwksUrlFromIssuer, buildMessageEvent, buildMethodArn, buildMgmtEndpointEnvUrl, buildRestV1Event, buildStageMap, collectSsmParameterRefs, computeRequestIdentityHash, countTargets, createAuthorizerCache, createFileWatcher, createJwksCache, createLocalInvokeAgentCoreCommand, createLocalInvokeCommand, createLocalListCommand, createLocalRunTaskCommand, createLocalStartApiCommand, createLocalStartServiceCommand, createLocalStateProvider, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, discoverRoutes, discoverWebSocketApis, discoverWebSocketApisOrThrow, evaluateCachedLambdaPolicy, evaluateResponseParameters, filterRoutesByApiIdentifier, filterRoutesByApiIdentifiers, formatTargetListing, getContainerNetworkIp, getEmbedConfig, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeRequestAuthorizer, invokeTokenAuthorizer, isCfnFlagPresent, isFunctionUrlOacFronted, listTargets, matchPreflight, matchRoute, materializeLayerFromArn, parseConnectionsPath, parseSelectionExpressionPath, pickRefLogicalId, pickResponseTemplate, probeHostGatewaySupport, readMtlsMaterialsFromDisk, rejectExplicitCfnStackWithMultipleStacks, resetEmbedConfig, resolveAgentCoreTarget, resolveApiTargetSubset, resolveCfnFallbackRegion, resolveCfnRegion, resolveCfnStackName, resolveEnvVars, resolveLambdaArnIntrinsic, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSelectionExpression, resolveServiceIntegrationParameters, resolveSsmParameters, resolveWatchConfig, selectIntegrationResponse, setEmbedConfig, startApiServer, substituteAgainstState, substituteAgainstStateAsync, substituteEnvVarsFromState, substituteEnvVarsFromStateAsync, substituteImagePlaceholders, translateLambdaResponse, tryParseStatus, tryResolveImageFnJoin, verifyCognitoJwt, verifyJwtAuthorizer, waitForAgentCorePing };
|
|
1088
1135
|
//# sourceMappingURL=index.d.ts.map
|