cdk-local 0.163.2 → 0.163.3
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/dist/cli.js +2 -2
- package/dist/{docker-runner-DzPTb4Ai.js → docker-runner-C15ixW5k.js} +30 -3
- package/dist/docker-runner-C15ixW5k.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -2
- package/dist/{local-studio-BsnTY1vH.d.ts → local-studio-C7-FMMpT.d.ts} +2 -1
- package/dist/{local-studio-BsnTY1vH.d.ts.map → local-studio-C7-FMMpT.d.ts.map} +1 -1
- package/dist/{local-studio-LTgy7a7a.js → local-studio-CjZkQNy5.js} +49 -54
- package/dist/local-studio-CjZkQNy5.js.map +1 -0
- package/package.json +1 -1
- package/dist/docker-runner-DzPTb4Ai.js.map +0 -1
- package/dist/local-studio-LTgy7a7a.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as displayIdent, c as getEmbedConfig, i as STACK_REF_MAX_CODE_POINTS, o as displayStackName, s as displayToolOutput, t as getLogger, u as setEmbedConfig } from "./logger-Co5XVwco.js";
|
|
2
2
|
import { $ as buildProxyClientConfig, C as effectiveLoopbackPorts, F as resolveHostDefaultCredentials, G as createMixedModeStateProvider, Q as awsEndpointOverrideClientConfig, at as isWildcardHostname, b as awsEmulatorEnvName, ct as hostFromAuthority, d as workloadStsClientConfig, it as isLoopbackHostname, l as warnWorkloadCredentialsStripped, n as accountLookupStsClientConfig, nt as proxyAwareFetch, ot as formatAuthority, r as applyWorkloadEnvCredentials, st as formatHostForAuthority, u as workloadClientConfig, v as activateWorkloadAwsWiring, w as getActiveWorkloadAwsWiring, y as applyWorkloadAwsWiringToEnv } from "./workload-identity-D5zkhVcF.js";
|
|
3
3
|
import { c as clampErrorName, d as flattenToOneLine, f as isAwsServiceException, l as describeAwsFailureForWarn, m as stringifyThrown, o as renderAssemblyPathEscape, p as sanitizeServiceExceptionMessage, r as displayUntrustedValue, s as resolveAssemblyPath, t as absoluteAssemblyPathEscape, u as describeCredentialLoadFailure } from "./assembly-path-R96uhMm1.js";
|
|
4
|
-
import { $ as
|
|
4
|
+
import { $ as isIamRoleArn, A as buildDockerImage, B as tryResolveImageFnJoin, D as isImageInLocalCache, E as warnIfEmulatedPlatform, F as parseEcrRegistryHost, G as RouteDiscoveryError, H as InteractiveTtyRequiredError, I as derivePartitionAndUrlSuffix, J as defineOwnKey, K as TargetSelectionCancelledError, L as derivePseudoParametersFromRegion, M as createShutdownSignalHandler, N as signalExitCode, O as parseEcrUri, P as describeExitWithoutArgv, Q as describeRejectedRoleArn, R as formatStateRemedy, T as buildContainerImage, U as LocalInvokeBuildError, V as CdkLocalError, W as LocalStartServiceError, X as applyRoleArnIfSet, Y as AssumeRoleFailure, Z as assumeRoleCredentials, a as describeRefusedSensitiveEnvKeys, c as execEnvForSecrets, d as rememberForwardedPorts, et as refusedRoleArnMessage, f as removeContainer, h as streamLogs, i as attachLoopbackForwarder, j as resolveAssetSourcePath, k as pullEcrImage, l as pickFreePort, m as startNamespaceOwnerForwarder, n as SENSITIVE_ENV_KEYS, nt as resolveProfileCredentials, p as runDetached, q as withErrorHandling, r as appendEnvFlags, s as ensureDockerAvailable, t as DockerRunnerError, tt as buildStsClientConfig, u as pullImage, w as architectureToPlatform, z as substituteImagePlaceholders } from "./docker-runner-C15ixW5k.js";
|
|
5
5
|
import { a as isDockerClientEnvKey, c as runDockerStreaming, i as getDockerCmd, n as finchSecretArgvRefusal, o as isMalformedEnvKey, u as warnFinchArgvExposure } from "./docker-cmd-Cjg3jGYF.js";
|
|
6
6
|
import { chmodSync, cpSync, createWriteStream, existsSync, lstatSync, mkdirSync, mkdtempSync, promises, readFileSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { Command, InvalidArgumentError, Option } from "commander";
|
|
@@ -10573,28 +10573,6 @@ function createReloadQueue(options) {
|
|
|
10573
10573
|
};
|
|
10574
10574
|
}
|
|
10575
10575
|
|
|
10576
|
-
//#endregion
|
|
10577
|
-
//#region src/utils/shutdown-signal.ts
|
|
10578
|
-
function createShutdownSignalHandler(options) {
|
|
10579
|
-
const exit = options.exit ?? ((code) => process.exit(code));
|
|
10580
|
-
const writeStderr = options.writeStderr ?? ((text) => void process.stderr.write(text));
|
|
10581
|
-
let count = 0;
|
|
10582
|
-
return (signal, exitCode) => {
|
|
10583
|
-
count += 1;
|
|
10584
|
-
if (count === 1) {
|
|
10585
|
-
options.info(options.stoppingMessage(signal));
|
|
10586
|
-
options.cleanup().then(() => exit(exitCode));
|
|
10587
|
-
return;
|
|
10588
|
-
}
|
|
10589
|
-
if (count === 2) {
|
|
10590
|
-
options.warn(`Received ${signal} again; still shutting down — waiting for the cleanup to remove the containers and networks. Send it once more to force-exit (that skips the cleanup).`);
|
|
10591
|
-
return;
|
|
10592
|
-
}
|
|
10593
|
-
writeStderr(`Force-exit on repeated ${signal}; container cleanup skipped. ${options.forceExitHint}\n`);
|
|
10594
|
-
exit(130);
|
|
10595
|
-
};
|
|
10596
|
-
}
|
|
10597
|
-
|
|
10598
10576
|
//#endregion
|
|
10599
10577
|
//#region src/local/authorizer-cache.ts
|
|
10600
10578
|
function createAuthorizerCache(opts = {}) {
|
|
@@ -11088,10 +11066,10 @@ async function localStartApiCommand(targets, options, extraStateProviders) {
|
|
|
11088
11066
|
warn: (m) => logger.warn(m)
|
|
11089
11067
|
});
|
|
11090
11068
|
process.on("SIGINT", () => {
|
|
11091
|
-
shutdown("SIGINT"
|
|
11069
|
+
shutdown("SIGINT");
|
|
11092
11070
|
});
|
|
11093
11071
|
process.on("SIGTERM", () => {
|
|
11094
|
-
shutdown("SIGTERM"
|
|
11072
|
+
shutdown("SIGTERM");
|
|
11095
11073
|
});
|
|
11096
11074
|
process.on("uncaughtException", (err) => {
|
|
11097
11075
|
logger.error(`Uncaught exception: ${err instanceof Error ? err.stack ?? err.message : String(err)}`);
|
|
@@ -11107,13 +11085,22 @@ function createWatchPredicates(args) {
|
|
|
11107
11085
|
const { watchRoot, output, watchConfig } = args;
|
|
11108
11086
|
const toRel = (abs) => nodePath.relative(watchRoot, abs).split(nodePath.sep).join("/");
|
|
11109
11087
|
const outputRel = toRel(nodePath.resolve(watchRoot, output));
|
|
11088
|
+
const underRoot = (rel) => rel !== "" && !rel.startsWith("..");
|
|
11089
|
+
const tmpRel = toRel(nodePath.resolve(args.tmpDir ?? tmpdir()));
|
|
11090
|
+
const mandatoryExcludes = [
|
|
11091
|
+
...underRoot(outputRel) ? [outputRel] : [],
|
|
11092
|
+
...underRoot(tmpRel) ? [tmpRel] : [],
|
|
11093
|
+
"cdk.context.json"
|
|
11094
|
+
];
|
|
11110
11095
|
const excludePatterns = [
|
|
11111
|
-
...
|
|
11096
|
+
...mandatoryExcludes,
|
|
11112
11097
|
"node_modules",
|
|
11113
11098
|
".git",
|
|
11114
11099
|
...watchConfig.exclude
|
|
11115
11100
|
];
|
|
11116
|
-
const
|
|
11101
|
+
const globMatcher = createGlobMatcher([...excludePatterns.filter((p) => !mandatoryExcludes.includes(p))]);
|
|
11102
|
+
const isOwn = (rel) => mandatoryExcludes.some((own) => rel === own || rel.startsWith(`${own}/`));
|
|
11103
|
+
const excludeMatcher = (rel) => isOwn(rel) || globMatcher(rel);
|
|
11117
11104
|
const includeMatcher = createGlobMatcher(watchConfig.include);
|
|
11118
11105
|
const ignored = (absPath) => {
|
|
11119
11106
|
const rel = toRel(absPath);
|
|
@@ -11991,7 +11978,7 @@ function createLocalStartApiCommand(opts = {}) {
|
|
|
11991
11978
|
}
|
|
11992
11979
|
function addStartApiSpecificOptions(cmd) {
|
|
11993
11980
|
addAwsEndpointOptions(cmd);
|
|
11994
|
-
return cmd.addOption(new Option("--port <port>", "HTTP server port (default: auto-allocate)").default("0")).addOption(new Option("--host <host>", "Bind address").default("127.0.0.1")).addOption(new Option("--stack <name>", "Stack to start (single-stack apps auto-detect)")).addOption(new Option("--all-stacks", "Serve every stack's API in a multi-stack app (each API on its own port) instead of erroring out. Mutually exclusive with a positional target subset, --stack, and an explicit --from-cfn-stack <name>; the bare --from-cfn-stack flag stays compatible (binds each routed stack to its own CFn stack).").default(false)).addOption(new Option("--warm", "Pre-start one container per Lambda at server boot").default(false)).addOption(new Option("--per-lambda-concurrency <n>", "Pool size cap per Lambda (default 2, max 4)").default("2")).addOption(new Option("--no-pull", "Skip docker pull (cached image)")).addOption(new Option("--no-build", "Skip docker build on every container Lambda local-asset build (use the previously-built tag). Requires the deterministic tag to already be in the local registry; errors with an actionable message when missing. No-op for ZIP Lambdas and the IMAGE ECR-pull path. Compatible with --no-pull.")).addOption(new Option("--container-host <host>", "IP the host uses to bind/probe the RIE port (must be a numeric IP — `docker run -p <ip>:<port>:8080` rejects hostnames). Defaults to 127.0.0.1.").default("127.0.0.1")).addOption(new Option("--debug-port-base <port>", "Reserve a contiguous --debug-port range (one per Lambda)")).addOption(new Option("--debug-port <port>", "Alias of --debug-port-base for parity with `cdkl invoke --debug-port`. Reserves a contiguous --debug-port range (one per Lambda) starting at <port>.")).addOption(new Option("--ecr-role-arn <arn>", "Role ARN to assume before authenticating against ECR for cross-account / centralized registries on the container-Lambda ECR-pull fallback. Issues sts:AssumeRole via the default credential chain and uses the temporary credentials for ecr:GetAuthorizationToken + docker pull. Required when the caller does not have direct cross-account access to the target repository. Same-account / same-region pulls do not need this flag.")).addOption(new Option("--env-vars <file>", "JSON env-var overrides (SAM-compatible: {\"LogicalId\":{\"KEY\":\"VALUE\"}, \"Parameters\": {...}})")).addOption(new Option("--assume-role <arn-or-pair>", "Assume the Lambda's execution role and forward STS-issued temp creds. Two forms: (1) `--assume-role <arn>` sets a single global default ARN used for every routed Lambda; (2) `--assume-role <LogicalId>=<arn>` (repeatable) is a per-Lambda override (wins over the global default and over --assume-role-auto for the named Lambda). Pair with --assume-role-auto to auto-resolve every other Lambda. Precedence: per-Lambda > (--assume-role-auto OR global default) > unset (developer creds passed through).").argParser((raw, prev) => parseAssumeRoleToken(raw, prev))).addOption(new Option("--assume-role-auto", "Auto-resolve EACH routed Lambda's own execution role per-Lambda (literal ARN / Fn::GetAtt against template / --from-cfn-stack state). Slower boot — one STS call per Lambda — but the right shape when each Lambda's deployed role differs. Mutually exclusive with `--assume-role <arn>` (global default); errors at boot. Compatible with `--assume-role <LogicalId>=<arn>` per-Lambda overrides — the map wins for named Lambdas, auto-resolve handles the rest.").default(false)).addOption(new Option("--watch", "Hot-reload: re-synth + re-discover routes when the CDK app's source changes (honors cdk.json watch.include/exclude; cdk.out, node_modules, .git are always excluded). Off by default; the server keeps the previous version serving when synth fails mid-reload.").default(false)).addOption(new Option("--stage <name>", "Select an API Gateway Stage by its 'StageName'. Default: the first Stage attached to each API. Drives event.stageVariables for both REST v1 and HTTP API v2. NOTE: For HTTP API v2 routes, requestContext.stage is always '$default' regardless of this flag (AWS-side limitation — HTTP API only exposes one stage to the integration event); only event.stageVariables is affected for v2 routes. For REST v1 routes the selected StageName is also threaded into requestContext.stage.")).addOption(new Option("--api <id>", "DEPRECATED — use the positional <targets...> argument instead. Accepts a SINGLE identifier; for a subset pass multiple positional targets. Same accepted forms (bare logical id, stack-qualified, Construct path, ancestor prefix). Will be removed in a future major release.")).addOption(new Option("--layer-role-arn <arn>", "Role to sts:AssumeRole before calling lambda:GetLayerVersion on every literal-ARN entry in Properties.Layers (issue #448). Use only when the dev credentials cannot read the layer — typically cross-account layers. AWS-published public layers (e.g. Lambda Powertools) are readable from every account and need no role.")).addOption(new Option("--from-cfn-stack [cfn-stack-name]", "Read a deployed CloudFormation stack via ListStackResources and substitute Ref / Fn::ImportValue in Lambda env vars with the deployed physical IDs / exports. Use for CDK apps deployed via the upstream CDK CLI (`cdk deploy`). Bare form uses the resolved stack name per routed stack; pass an explicit value when a single CFn stack should serve every routed stack. Fn::GetAtt is warn-and-dropped in v1 (CFn ListStackResources does not return per-attribute values).")).addOption(new Option("--stack-region <region>", "Region of the state record to read. Used with --from-cfn-stack as the CFn client region.")).addOption(new Option("--mtls-truststore <path>", `PEM-encoded CA bundle for client-certificate verification (mutual TLS). When set, the local server switches from HTTP to HTTPS and the TLS handshake rejects clients whose certificate doesn't chain to one of these CAs. Verified certs are surfaced on the Lambda event under requestContext.identity.clientCert (REST v1) / requestContext.authentication.clientCert (HTTP API v2). Must be set together with --mtls-cert + --mtls-key; partial flag sets are rejected. Generate a CA + server + client cert for local dev: openssl req -x509 -newkey rsa:2048 -nodes -keyout ca-key.pem -out ca.pem -subj "/CN=${getEmbedConfig().resourceNamePrefix}-ca" -days 365; openssl req -newkey rsa:2048 -nodes -keyout server-key.pem -out server-csr.pem -subj "/CN=localhost"; openssl x509 -req -in server-csr.pem -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out server-cert.pem -days 365; openssl req -newkey rsa:2048 -nodes -keyout client-key.pem -out client-csr.pem -subj "/CN=client"; openssl x509 -req -in client-csr.pem -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out client-cert.pem -days 365; curl --cacert ca.pem --cert client-cert.pem --key client-key.pem https://localhost:<port>/...`)).addOption(new Option("--mtls-cert <path>", "PEM-encoded server certificate for mutual TLS. Self-signed is fine for local dev. Must be set together with --mtls-truststore + --mtls-key.")).addOption(new Option("--mtls-key <path>", "PEM-encoded server private key matching --mtls-cert. Must be set together with --mtls-truststore + --mtls-cert.")).addOption(new Option("--strict-sigv4", "Opt-in: DENY AWS_IAM SigV4 requests that cannot be cryptographically verified (foreign access-key-id — e.g. a federated / Cognito Identity Pool / cross-account signer — OR no local AWS credentials configured) instead of the default warn-and-pass. DEFAULT off: cdk-local warn-and-passes unverifiable IAM requests with a placeholder principalId so local dev exercises app logic without reproducing an auth boundary it cannot fully emulate. OAC-fronted Function URLs always warn-and-pass regardless.").default(false));
|
|
11981
|
+
return cmd.addOption(new Option("--port <port>", "HTTP server port (default: auto-allocate)").default("0")).addOption(new Option("--host <host>", "Bind address").default("127.0.0.1")).addOption(new Option("--stack <name>", "Stack to start (single-stack apps auto-detect)")).addOption(new Option("--all-stacks", "Serve every stack's API in a multi-stack app (each API on its own port) instead of erroring out. Mutually exclusive with a positional target subset, --stack, and an explicit --from-cfn-stack <name>; the bare --from-cfn-stack flag stays compatible (binds each routed stack to its own CFn stack).").default(false)).addOption(new Option("--warm", "Pre-start one container per Lambda at server boot").default(false)).addOption(new Option("--per-lambda-concurrency <n>", "Pool size cap per Lambda (default 2, max 4)").default("2")).addOption(new Option("--no-pull", "Skip docker pull (cached image)")).addOption(new Option("--no-build", "Skip docker build on every container Lambda local-asset build (use the previously-built tag). Requires the deterministic tag to already be in the local registry; errors with an actionable message when missing. No-op for ZIP Lambdas and the IMAGE ECR-pull path. Compatible with --no-pull.")).addOption(new Option("--container-host <host>", "IP the host uses to bind/probe the RIE port (must be a numeric IP — `docker run -p <ip>:<port>:8080` rejects hostnames). Defaults to 127.0.0.1.").default("127.0.0.1")).addOption(new Option("--debug-port-base <port>", "Reserve a contiguous --debug-port range (one per Lambda)")).addOption(new Option("--debug-port <port>", "Alias of --debug-port-base for parity with `cdkl invoke --debug-port`. Reserves a contiguous --debug-port range (one per Lambda) starting at <port>.")).addOption(new Option("--ecr-role-arn <arn>", "Role ARN to assume before authenticating against ECR for cross-account / centralized registries on the container-Lambda ECR-pull fallback. Issues sts:AssumeRole via the default credential chain and uses the temporary credentials for ecr:GetAuthorizationToken + docker pull. Required when the caller does not have direct cross-account access to the target repository. Same-account / same-region pulls do not need this flag.")).addOption(new Option("--env-vars <file>", "JSON env-var overrides (SAM-compatible: {\"LogicalId\":{\"KEY\":\"VALUE\"}, \"Parameters\": {...}})")).addOption(new Option("--assume-role <arn-or-pair>", "Assume the Lambda's execution role and forward STS-issued temp creds. Two forms: (1) `--assume-role <arn>` sets a single global default ARN used for every routed Lambda; (2) `--assume-role <LogicalId>=<arn>` (repeatable) is a per-Lambda override (wins over the global default and over --assume-role-auto for the named Lambda). Pair with --assume-role-auto to auto-resolve every other Lambda. Precedence: per-Lambda > (--assume-role-auto OR global default) > unset (developer creds passed through).").argParser((raw, prev) => parseAssumeRoleToken(raw, prev))).addOption(new Option("--assume-role-auto", "Auto-resolve EACH routed Lambda's own execution role per-Lambda (literal ARN / Fn::GetAtt against template / --from-cfn-stack state). Slower boot — one STS call per Lambda — but the right shape when each Lambda's deployed role differs. Mutually exclusive with `--assume-role <arn>` (global default); errors at boot. Compatible with `--assume-role <LogicalId>=<arn>` per-Lambda overrides — the map wins for named Lambdas, auto-resolve handles the rest.").default(false)).addOption(new Option("--watch", "Hot-reload: re-synth + re-discover routes when the CDK app's source changes (honors cdk.json watch.include/exclude; cdk.out, cdk.context.json, node_modules, .git are always excluded). Off by default; the server keeps the previous version serving when synth fails mid-reload.").default(false)).addOption(new Option("--stage <name>", "Select an API Gateway Stage by its 'StageName'. Default: the first Stage attached to each API. Drives event.stageVariables for both REST v1 and HTTP API v2. NOTE: For HTTP API v2 routes, requestContext.stage is always '$default' regardless of this flag (AWS-side limitation — HTTP API only exposes one stage to the integration event); only event.stageVariables is affected for v2 routes. For REST v1 routes the selected StageName is also threaded into requestContext.stage.")).addOption(new Option("--api <id>", "DEPRECATED — use the positional <targets...> argument instead. Accepts a SINGLE identifier; for a subset pass multiple positional targets. Same accepted forms (bare logical id, stack-qualified, Construct path, ancestor prefix). Will be removed in a future major release.")).addOption(new Option("--layer-role-arn <arn>", "Role to sts:AssumeRole before calling lambda:GetLayerVersion on every literal-ARN entry in Properties.Layers (issue #448). Use only when the dev credentials cannot read the layer — typically cross-account layers. AWS-published public layers (e.g. Lambda Powertools) are readable from every account and need no role.")).addOption(new Option("--from-cfn-stack [cfn-stack-name]", "Read a deployed CloudFormation stack via ListStackResources and substitute Ref / Fn::ImportValue in Lambda env vars with the deployed physical IDs / exports. Use for CDK apps deployed via the upstream CDK CLI (`cdk deploy`). Bare form uses the resolved stack name per routed stack; pass an explicit value when a single CFn stack should serve every routed stack. Fn::GetAtt is warn-and-dropped in v1 (CFn ListStackResources does not return per-attribute values).")).addOption(new Option("--stack-region <region>", "Region of the state record to read. Used with --from-cfn-stack as the CFn client region.")).addOption(new Option("--mtls-truststore <path>", `PEM-encoded CA bundle for client-certificate verification (mutual TLS). When set, the local server switches from HTTP to HTTPS and the TLS handshake rejects clients whose certificate doesn't chain to one of these CAs. Verified certs are surfaced on the Lambda event under requestContext.identity.clientCert (REST v1) / requestContext.authentication.clientCert (HTTP API v2). Must be set together with --mtls-cert + --mtls-key; partial flag sets are rejected. Generate a CA + server + client cert for local dev: openssl req -x509 -newkey rsa:2048 -nodes -keyout ca-key.pem -out ca.pem -subj "/CN=${getEmbedConfig().resourceNamePrefix}-ca" -days 365; openssl req -newkey rsa:2048 -nodes -keyout server-key.pem -out server-csr.pem -subj "/CN=localhost"; openssl x509 -req -in server-csr.pem -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out server-cert.pem -days 365; openssl req -newkey rsa:2048 -nodes -keyout client-key.pem -out client-csr.pem -subj "/CN=client"; openssl x509 -req -in client-csr.pem -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out client-cert.pem -days 365; curl --cacert ca.pem --cert client-cert.pem --key client-key.pem https://localhost:<port>/...`)).addOption(new Option("--mtls-cert <path>", "PEM-encoded server certificate for mutual TLS. Self-signed is fine for local dev. Must be set together with --mtls-truststore + --mtls-key.")).addOption(new Option("--mtls-key <path>", "PEM-encoded server private key matching --mtls-cert. Must be set together with --mtls-truststore + --mtls-cert.")).addOption(new Option("--strict-sigv4", "Opt-in: DENY AWS_IAM SigV4 requests that cannot be cryptographically verified (foreign access-key-id — e.g. a federated / Cognito Identity Pool / cross-account signer — OR no local AWS credentials configured) instead of the default warn-and-pass. DEFAULT off: cdk-local warn-and-passes unverifiable IAM requests with a placeholder principalId so local dev exercises app logic without reproducing an auth boundary it cannot fully emulate. OAC-fronted Function URLs always warn-and-pass regardless.").default(false));
|
|
11995
11982
|
}
|
|
11996
11983
|
|
|
11997
11984
|
//#endregion
|
|
@@ -13627,8 +13614,8 @@ async function localInvokeAgentCoreCommand(target, options, extraStateProviders)
|
|
|
13627
13614
|
info: (m) => logger.info(m),
|
|
13628
13615
|
warn: (m) => logger.warn(m)
|
|
13629
13616
|
});
|
|
13630
|
-
sigintHandler = () => onSignal("SIGINT"
|
|
13631
|
-
sigtermHandler = () => onSignal("SIGTERM"
|
|
13617
|
+
sigintHandler = () => onSignal("SIGINT");
|
|
13618
|
+
sigtermHandler = () => onSignal("SIGTERM");
|
|
13632
13619
|
process.on("SIGINT", sigintHandler);
|
|
13633
13620
|
process.on("SIGTERM", sigtermHandler);
|
|
13634
13621
|
if (isMcp && mcpRequest) {
|
|
@@ -16623,7 +16610,7 @@ const defaultDockerStartImpl = async (containerId, opts = {}) => {
|
|
|
16623
16610
|
const { getActiveWorkloadAwsWiring } = await import("./workload-identity-D5zkhVcF.js").then((n) => n.R);
|
|
16624
16611
|
const wiring = getActiveWorkloadAwsWiring();
|
|
16625
16612
|
if (wiring) {
|
|
16626
|
-
const { attachLoopbackForwarder } = await import("./docker-runner-
|
|
16613
|
+
const { attachLoopbackForwarder } = await import("./docker-runner-C15ixW5k.js").then((n) => n.o);
|
|
16627
16614
|
await attachLoopbackForwarder(containerId, wiring);
|
|
16628
16615
|
}
|
|
16629
16616
|
};
|
|
@@ -19263,8 +19250,8 @@ async function runEcsServiceEmulator(targets, options, strategy, extraStateProvi
|
|
|
19263
19250
|
info: (m) => logger.info(m),
|
|
19264
19251
|
warn: (m) => logger.warn(m)
|
|
19265
19252
|
});
|
|
19266
|
-
sigintHandler = () => onSignal("SIGINT"
|
|
19267
|
-
sigtermHandler = () => onSignal("SIGTERM"
|
|
19253
|
+
sigintHandler = () => onSignal("SIGINT");
|
|
19254
|
+
sigtermHandler = () => onSignal("SIGTERM");
|
|
19268
19255
|
process.on("SIGINT", sigintHandler);
|
|
19269
19256
|
process.on("SIGTERM", sigtermHandler);
|
|
19270
19257
|
const { tags: imageOverrideTags, overrides: imageOverrideMap } = await resolveAndBuildImageOverrides({
|
|
@@ -19650,6 +19637,8 @@ async function resolveServiceAndRunnerOpts(boot, stacks, options, discovery, ski
|
|
|
19650
19637
|
containerPath: profileCredsFile.containerPath,
|
|
19651
19638
|
profileName: profileCredsFile.profileName
|
|
19652
19639
|
};
|
|
19640
|
+
const defaultCredentials = await resolveServiceDefaultCredentials(options, assumedCredentials);
|
|
19641
|
+
if (defaultCredentials) taskOpts.defaultCredentials = defaultCredentials;
|
|
19653
19642
|
const hostGatewayExtraHosts = await resolveHostGatewayExtraHosts();
|
|
19654
19643
|
if (hostGatewayExtraHosts.length > 0) taskOpts.hostGatewayExtraHosts = hostGatewayExtraHosts;
|
|
19655
19644
|
if (opts.imageOverrideTag !== void 0) {
|
|
@@ -20113,6 +20102,11 @@ function resolveShadowReadyTimeoutMs(options, envPrefix, env = process.env) {
|
|
|
20113
20102
|
}
|
|
20114
20103
|
return DEFAULT_SHADOW_READY_TIMEOUT_MS;
|
|
20115
20104
|
}
|
|
20105
|
+
async function resolveServiceDefaultCredentials(options, assumedCredentials) {
|
|
20106
|
+
if (assumedCredentials || options.profile) return void 0;
|
|
20107
|
+
if (getActiveWorkloadAwsWiring()?.mode === "emulator") return void 0;
|
|
20108
|
+
return resolveHostDefaultCredentials();
|
|
20109
|
+
}
|
|
20116
20110
|
async function resolveSharedSidecarCredentials(options) {
|
|
20117
20111
|
const wiring = getActiveWorkloadAwsWiring();
|
|
20118
20112
|
if (wiring?.mode === "emulator") return wiring.emulatorCredentials;
|
|
@@ -20314,8 +20308,8 @@ async function localRunTaskCommand(target, options, extraStateProviders) {
|
|
|
20314
20308
|
info: (m) => logger.info(m),
|
|
20315
20309
|
warn: (m) => logger.warn(m)
|
|
20316
20310
|
});
|
|
20317
|
-
sigintHandler = () => onSignal("SIGINT"
|
|
20318
|
-
sigtermHandler = () => onSignal("SIGTERM"
|
|
20311
|
+
sigintHandler = () => onSignal("SIGINT");
|
|
20312
|
+
sigtermHandler = () => onSignal("SIGTERM");
|
|
20319
20313
|
process.on("SIGINT", sigintHandler);
|
|
20320
20314
|
process.on("SIGTERM", sigtermHandler);
|
|
20321
20315
|
const effectiveAssumeRole = resolveEcsAssumeRoleOption(options);
|
|
@@ -20617,7 +20611,7 @@ function createLocalStartServiceCommand(opts = {}) {
|
|
|
20617
20611
|
}
|
|
20618
20612
|
function addStartServiceSpecificOptions(cmd) {
|
|
20619
20613
|
addImageOverrideOptions(cmd);
|
|
20620
|
-
return cmd.addOption(new Option("--host-port <containerPort=hostPort...>", "Publish a container port on a specific host port (e.g. 80=8080); repeatable. Default: host port == container port. Use this on macOS to map a privileged container port (< 1024) to a non-privileged host port and avoid the Docker Desktop admin-password prompt. (Single-replica services only — multi-replica services do not publish host ports.)")).addOption(new Option("--watch", "Hot-reload: re-synth + per-replica reload when the CDK source changes (honors cdk.json watch.include/exclude; cdk.out, node_modules, .git are always excluded). A per-firing classifier picks the per-replica primitive: source-only edits on interpreted-language handlers (Node/Python/Ruby/shell) take a bind-mount FAST PATH (`docker cp` the new source into each replica + restart it; no rebuild). Dockerfile / dependency manifest / compiled-language source / ambiguous edits fall through to the rebuild rolling primitive — boot a shadow under a bumped generation suffix, wait for its container port to accept a TCP connection, atomically swap Service-Connect / Cloud Map registrations, then retire the old container. Either path rolls one replica at a time, so peer services see zero connection refusals across the reload even on multi-replica services. Off by default; existing replica(s) keep serving when synth fails mid-reload.").default(false));
|
|
20614
|
+
return cmd.addOption(new Option("--host-port <containerPort=hostPort...>", "Publish a container port on a specific host port (e.g. 80=8080); repeatable. Default: host port == container port. Use this on macOS to map a privileged container port (< 1024) to a non-privileged host port and avoid the Docker Desktop admin-password prompt. (Single-replica services only — multi-replica services do not publish host ports.)")).addOption(new Option("--watch", "Hot-reload: re-synth + per-replica reload when the CDK source changes (honors cdk.json watch.include/exclude; cdk.out, cdk.context.json, node_modules, .git are always excluded). A per-firing classifier picks the per-replica primitive: source-only edits on interpreted-language handlers (Node/Python/Ruby/shell) take a bind-mount FAST PATH (`docker cp` the new source into each replica + restart it; no rebuild). Dockerfile / dependency manifest / compiled-language source / ambiguous edits fall through to the rebuild rolling primitive — boot a shadow under a bumped generation suffix, wait for its container port to accept a TCP connection, atomically swap Service-Connect / Cloud Map registrations, then retire the old container. Either path rolls one replica at a time, so peer services see zero connection refusals across the reload even on multi-replica services. Off by default; existing replica(s) keep serving when synth fails mid-reload.").default(false));
|
|
20621
20615
|
}
|
|
20622
20616
|
|
|
20623
20617
|
//#endregion
|
|
@@ -21346,7 +21340,7 @@ function createLocalStartAlbCommand(opts = {}) {
|
|
|
21346
21340
|
}
|
|
21347
21341
|
function addAlbSpecificOptions(cmd) {
|
|
21348
21342
|
addImageOverrideOptions(cmd);
|
|
21349
|
-
return cmd.addOption(new Option("--lb-port <listenerPort=hostPort...>", "Bind the local front-door on a specific host port (e.g. 80=8080); repeatable. Default: host port == ALB listener port. Use this on macOS to remap a privileged listener port (< 1024) to a non-privileged host port.")).addOption(new Option("--assume-host <host>", "Treat every inbound request as if it carried this Host: host-header rule conditions see <host>, and the target (ECS replica or Lambda) receives it as the Host header, as behind the deployed ALB on its own domain name. Use it to reach a listener rule that matches only a production host name (host-header: api.example.com) from a browser or a client that sends Host: localhost. <listenerPort>=<host> (e.g. 443=api.example.com) applies to one listener and wins over a bare <host>; repeatable. Other rule conditions are unaffected, and a redirect action keeps the request Host so the browser stays on the local front-door. Default: the request Host is used as sent.").argParser((value, prev) => [...prev ?? [], value])).addOption(new Option("--tls", "Terminate TLS locally for cloud-HTTPS listeners. Default: a cloud-HTTPS listener is served over plain HTTP locally (X-Forwarded-Proto: https is preserved so the upstream app still sees the deployed listener protocol). Implied by --tls-cert / --tls-key. Use this when local-dev cookies need Secure / SameSite=None, when the upstream app inspects TLS metadata, or for mTLS / SNI testing — otherwise plain HTTP is friendlier (no self-signed cert warnings in curl / browser).")).addOption(new Option("--tls-cert <path>", "PEM-encoded server certificate for HTTPS front-door listeners. Implies --tls. Must be set together with --tls-key. Pass --tls alone (without --tls-cert / --tls-key) to auto-generate a self-signed cert (cached under $XDG_CACHE_HOME/cdk-local/alb-https/, default ~/.cache/cdk-local/alb-https/); requires openssl on PATH. The deployed Listener Certificates[] are NOT fetched (ACM private keys are not retrievable by design). The auto-generated cert lists DNS:localhost,IP:127.0.0.1 as SubjectAltName, so a client validating a non-loopback --container-host will fail the SAN check — pass --tls-cert / --tls-key with a SAN covering that host instead.")).addOption(new Option("--tls-key <path>", "PEM-encoded server private key matching --tls-cert. Implies --tls. Must be set together with --tls-cert.")).addOption(new Option("--no-verify-auth", "Disable local enforcement of authenticate-cognito / authenticate-oidc actions. Every request is served as if the auth check passed. Useful for local dev where you do not want to mint a Bearer token at all.")).addOption(new Option("--bearer-token <jwt>", "Default Bearer JWT this command INJECTS only when an inbound request has none (the default-when-missing role) — `cdkl start-alb` is the local ALB front-door RECEIVING outside-in requests, so this token is the fallback the front-door slots in as Authorization: Bearer <jwt> if the caller did not already supply one. Verified against the same JWKS / OIDC discovery URL the deployed ALB would (signature + iss + aud + exp). Cookie pass-through (AWSELBAuthSessionCookie-*) also bypasses the guard. Contrast with `cdkl invoke-agentcore --bearer-token`, where the role is reversed — that command is the outbound client and ALWAYS presents this token (the supplier).")).addOption(new Option("--watch", "Hot-reload: re-synth + per-replica reload of every ECS service behind the ALB when the CDK source changes (honors cdk.json watch.include/exclude; cdk.out, node_modules, .git are always excluded). A per-firing classifier picks the per-replica primitive: source-only edits on interpreted-language handlers (Node/Python/Ruby/shell) take a bind-mount FAST PATH (`docker cp` the new source into each replica + restart it; no rebuild, its front-door pool entry is drained and re-published once it listens again). Dockerfile / dependency manifest / compiled-language source / ambiguous edits fall through to the rebuild rolling primitive — boot a shadow under a bumped generation suffix, wait for its container port to accept a TCP connection, atomically register it in the front-door pool, then drop the old entry and retire the old container. Either path rolls one replica at a time, so a continuous external request stream against the listener port sees zero connection refusals across the reload. The host front-door (TLS, JWKS cache, Lambda-target containers, listener sockets) stays up across the reload. Lambda target groups behind the ALB are a no-op on reload (the warm RIE container keeps its boot-time image). Off by default; existing replica(s) keep serving when synth fails mid-reload.").default(false));
|
|
21343
|
+
return cmd.addOption(new Option("--lb-port <listenerPort=hostPort...>", "Bind the local front-door on a specific host port (e.g. 80=8080); repeatable. Default: host port == ALB listener port. Use this on macOS to remap a privileged listener port (< 1024) to a non-privileged host port.")).addOption(new Option("--assume-host <host>", "Treat every inbound request as if it carried this Host: host-header rule conditions see <host>, and the target (ECS replica or Lambda) receives it as the Host header, as behind the deployed ALB on its own domain name. Use it to reach a listener rule that matches only a production host name (host-header: api.example.com) from a browser or a client that sends Host: localhost. <listenerPort>=<host> (e.g. 443=api.example.com) applies to one listener and wins over a bare <host>; repeatable. Other rule conditions are unaffected, and a redirect action keeps the request Host so the browser stays on the local front-door. Default: the request Host is used as sent.").argParser((value, prev) => [...prev ?? [], value])).addOption(new Option("--tls", "Terminate TLS locally for cloud-HTTPS listeners. Default: a cloud-HTTPS listener is served over plain HTTP locally (X-Forwarded-Proto: https is preserved so the upstream app still sees the deployed listener protocol). Implied by --tls-cert / --tls-key. Use this when local-dev cookies need Secure / SameSite=None, when the upstream app inspects TLS metadata, or for mTLS / SNI testing — otherwise plain HTTP is friendlier (no self-signed cert warnings in curl / browser).")).addOption(new Option("--tls-cert <path>", "PEM-encoded server certificate for HTTPS front-door listeners. Implies --tls. Must be set together with --tls-key. Pass --tls alone (without --tls-cert / --tls-key) to auto-generate a self-signed cert (cached under $XDG_CACHE_HOME/cdk-local/alb-https/, default ~/.cache/cdk-local/alb-https/); requires openssl on PATH. The deployed Listener Certificates[] are NOT fetched (ACM private keys are not retrievable by design). The auto-generated cert lists DNS:localhost,IP:127.0.0.1 as SubjectAltName, so a client validating a non-loopback --container-host will fail the SAN check — pass --tls-cert / --tls-key with a SAN covering that host instead.")).addOption(new Option("--tls-key <path>", "PEM-encoded server private key matching --tls-cert. Implies --tls. Must be set together with --tls-cert.")).addOption(new Option("--no-verify-auth", "Disable local enforcement of authenticate-cognito / authenticate-oidc actions. Every request is served as if the auth check passed. Useful for local dev where you do not want to mint a Bearer token at all.")).addOption(new Option("--bearer-token <jwt>", "Default Bearer JWT this command INJECTS only when an inbound request has none (the default-when-missing role) — `cdkl start-alb` is the local ALB front-door RECEIVING outside-in requests, so this token is the fallback the front-door slots in as Authorization: Bearer <jwt> if the caller did not already supply one. Verified against the same JWKS / OIDC discovery URL the deployed ALB would (signature + iss + aud + exp). Cookie pass-through (AWSELBAuthSessionCookie-*) also bypasses the guard. Contrast with `cdkl invoke-agentcore --bearer-token`, where the role is reversed — that command is the outbound client and ALWAYS presents this token (the supplier).")).addOption(new Option("--watch", "Hot-reload: re-synth + per-replica reload of every ECS service behind the ALB when the CDK source changes (honors cdk.json watch.include/exclude; cdk.out, cdk.context.json, node_modules, .git are always excluded). A per-firing classifier picks the per-replica primitive: source-only edits on interpreted-language handlers (Node/Python/Ruby/shell) take a bind-mount FAST PATH (`docker cp` the new source into each replica + restart it; no rebuild, its front-door pool entry is drained and re-published once it listens again). Dockerfile / dependency manifest / compiled-language source / ambiguous edits fall through to the rebuild rolling primitive — boot a shadow under a bumped generation suffix, wait for its container port to accept a TCP connection, atomically register it in the front-door pool, then drop the old entry and retire the old container. Either path rolls one replica at a time, so a continuous external request stream against the listener port sees zero connection refusals across the reload. The host front-door (TLS, JWKS cache, Lambda-target containers, listener sockets) stays up across the reload. Lambda target groups behind the ALB are a no-op on reload (the warm RIE container keeps its boot-time image). Off by default; existing replica(s) keep serving when synth fails mid-reload.").default(false));
|
|
21350
21344
|
}
|
|
21351
21345
|
|
|
21352
21346
|
//#endregion
|
|
@@ -24524,7 +24518,7 @@ async function localStartCloudFrontCommand(target, options, extraStateProviders,
|
|
|
24524
24518
|
if (bootAborted) return;
|
|
24525
24519
|
bootAborted = true;
|
|
24526
24520
|
logger.info(`Received ${signal} during start-up; removing the web function containers...`);
|
|
24527
|
-
drainWebFunctionServes(webFunctionServes).then(() => process.exit(signal
|
|
24521
|
+
drainWebFunctionServes(webFunctionServes).then(() => process.exit(signalExitCode(signal)));
|
|
24528
24522
|
};
|
|
24529
24523
|
const bootSigint = () => onBootSignal("SIGINT");
|
|
24530
24524
|
const bootSigterm = () => onBootSignal("SIGTERM");
|
|
@@ -24626,8 +24620,8 @@ async function localStartCloudFrontCommand(target, options, extraStateProviders,
|
|
|
24626
24620
|
info: (m) => logger.info(m),
|
|
24627
24621
|
warn: (m) => logger.warn(m)
|
|
24628
24622
|
});
|
|
24629
|
-
process.on("SIGINT", () => shutdown("SIGINT"
|
|
24630
|
-
process.on("SIGTERM", () => shutdown("SIGTERM"
|
|
24623
|
+
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
24624
|
+
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
24631
24625
|
await new Promise(() => void 0);
|
|
24632
24626
|
}
|
|
24633
24627
|
function createLocalStartCloudFrontCommand(opts = {}) {
|
|
@@ -24646,7 +24640,7 @@ function createLocalStartCloudFrontCommand(opts = {}) {
|
|
|
24646
24640
|
}
|
|
24647
24641
|
function addStartCloudFrontSpecificOptions(cmd) {
|
|
24648
24642
|
addAwsEndpointOptions(cmd);
|
|
24649
|
-
return cmd.addOption(new Option("--port <port>", "HTTP server port (default: auto-allocate)").default("0")).addOption(new Option("--host <host>", "Bind address").default("127.0.0.1")).addOption(new Option("--origin <originId=dir>", "Point a distribution origin at a local directory (repeatable). Use when cdk-local cannot resolve the origin's BucketDeployment source automatically (content uploaded out of band, or a non-CDK bucket).").argParser((value, prev) => [...prev ?? [], value])).addOption(new Option("--kvs-file <key=file.json>", "Back a CloudFront Function's KeyValueStore reads (cf.kvs().get()) with a local JSON map (repeatable). The key is a KeyValueStore handle — its AWS::CloudFront::KeyValueStore resource logical id, its construct path, or its bare construct id; the file is a flat { \"key\": \"value\" } object. The AWS-free alternative to --from-cfn-stack, which instead reads the deployed store via the GetKey API.").argParser((value, prev) => [...prev ?? [], value])).addOption(new Option("--tls", "Terminate real TLS (HTTPS). Uses --tls-cert / --tls-key when supplied, else an auto-generated self-signed cert.").default(false)).addOption(new Option("--tls-cert <path>", "PEM server certificate for --tls (implies --tls).")).addOption(new Option("--tls-key <path>", "PEM server private key for --tls (implies --tls).")).addOption(new Option("--no-pull", "Skip 'docker pull' for a Lambda Function URL / Web Function origin's base image (use the locally cached image).")).addOption(new Option("--from-cfn-stack [cfn-stack-name]", "Bind to a deployed CloudFormation stack (ListStackResources). Resolves an S3 origin that has no local BucketDeployment source to its deployed bucket and serves it from real S3 on demand (the front/back-split case: files uploaded out of band), and resolves a Lambda Function URL / Lambda@Edge function's or a Web Function origin revision's env vars to the deployed physical IDs / exports. Use for CDK apps deployed via the upstream CDK CLI (`cdk deploy`). Bare form uses the resolved stack name; pass a value when the CFn stack name differs.")).addOption(new Option("--cache-origin", "For a deployed-S3 origin (served from real S3 under --from-cfn-stack): keep fetched objects in memory for the session instead of re-reading on every request. Faster repeat reads / fewer S3 GETs, but an out-of-band S3 content change is not reflected until a --watch reload (which clears the cache) or a restart. Off by default (every request re-reads, always current). Not CloudFront CDN caching.").default(false)).addOption(new Option("--stack-region <region>", "Region of the state record to read. Used with --from-cfn-stack as the CFn client region.")).addOption(new Option("--assume-role [arn]", "Assume a Lambda Function URL origin's (or a Web Function origin revision's) execution role and forward STS-issued temp credentials into its container so the handler runs with the deployed permissions. Three forms: `--assume-role <arn>` (explicit ARN); `--assume-role` (bare, auto-resolves from state — requires --from-cfn-stack); `--no-assume-role` (opt out). Off by default (the dev shell credentials are forwarded).")).addOption(new Option("--env-vars <file>", "JSON env-var overrides for the Lambda Function URL and Lambda Web Function endpoint origins (SAM-compatible, the same file as the other commands: {\"Parameters\": {...}} for every origin, {\"<LogicalId or construct path>\": {\"KEY\": \"VALUE\"}} for one — the backing function, or the Web Function revision the endpoint serves; a null value removes the variable). Not applied to Lambda@Edge functions, which cannot carry environment variables in AWS.")).addOption(new Option("--watch", "Hot-reload: re-synth + re-resolve the distribution when the CDK app's source changes (honors cdk.json watch.include/exclude; cdk.out, node_modules, .git are always excluded). The server keeps the previous version serving when synth fails mid-reload.").default(false));
|
|
24643
|
+
return cmd.addOption(new Option("--port <port>", "HTTP server port (default: auto-allocate)").default("0")).addOption(new Option("--host <host>", "Bind address").default("127.0.0.1")).addOption(new Option("--origin <originId=dir>", "Point a distribution origin at a local directory (repeatable). Use when cdk-local cannot resolve the origin's BucketDeployment source automatically (content uploaded out of band, or a non-CDK bucket).").argParser((value, prev) => [...prev ?? [], value])).addOption(new Option("--kvs-file <key=file.json>", "Back a CloudFront Function's KeyValueStore reads (cf.kvs().get()) with a local JSON map (repeatable). The key is a KeyValueStore handle — its AWS::CloudFront::KeyValueStore resource logical id, its construct path, or its bare construct id; the file is a flat { \"key\": \"value\" } object. The AWS-free alternative to --from-cfn-stack, which instead reads the deployed store via the GetKey API.").argParser((value, prev) => [...prev ?? [], value])).addOption(new Option("--tls", "Terminate real TLS (HTTPS). Uses --tls-cert / --tls-key when supplied, else an auto-generated self-signed cert.").default(false)).addOption(new Option("--tls-cert <path>", "PEM server certificate for --tls (implies --tls).")).addOption(new Option("--tls-key <path>", "PEM server private key for --tls (implies --tls).")).addOption(new Option("--no-pull", "Skip 'docker pull' for a Lambda Function URL / Web Function origin's base image (use the locally cached image).")).addOption(new Option("--from-cfn-stack [cfn-stack-name]", "Bind to a deployed CloudFormation stack (ListStackResources). Resolves an S3 origin that has no local BucketDeployment source to its deployed bucket and serves it from real S3 on demand (the front/back-split case: files uploaded out of band), and resolves a Lambda Function URL / Lambda@Edge function's or a Web Function origin revision's env vars to the deployed physical IDs / exports. Use for CDK apps deployed via the upstream CDK CLI (`cdk deploy`). Bare form uses the resolved stack name; pass a value when the CFn stack name differs.")).addOption(new Option("--cache-origin", "For a deployed-S3 origin (served from real S3 under --from-cfn-stack): keep fetched objects in memory for the session instead of re-reading on every request. Faster repeat reads / fewer S3 GETs, but an out-of-band S3 content change is not reflected until a --watch reload (which clears the cache) or a restart. Off by default (every request re-reads, always current). Not CloudFront CDN caching.").default(false)).addOption(new Option("--stack-region <region>", "Region of the state record to read. Used with --from-cfn-stack as the CFn client region.")).addOption(new Option("--assume-role [arn]", "Assume a Lambda Function URL origin's (or a Web Function origin revision's) execution role and forward STS-issued temp credentials into its container so the handler runs with the deployed permissions. Three forms: `--assume-role <arn>` (explicit ARN); `--assume-role` (bare, auto-resolves from state — requires --from-cfn-stack); `--no-assume-role` (opt out). Off by default (the dev shell credentials are forwarded).")).addOption(new Option("--env-vars <file>", "JSON env-var overrides for the Lambda Function URL and Lambda Web Function endpoint origins (SAM-compatible, the same file as the other commands: {\"Parameters\": {...}} for every origin, {\"<LogicalId or construct path>\": {\"KEY\": \"VALUE\"}} for one — the backing function, or the Web Function revision the endpoint serves; a null value removes the variable). Not applied to Lambda@Edge functions, which cannot carry environment variables in AWS.")).addOption(new Option("--watch", "Hot-reload: re-synth + re-resolve the distribution when the CDK app's source changes (honors cdk.json watch.include/exclude; cdk.out, cdk.context.json, node_modules, .git are always excluded). The server keeps the previous version serving when synth fails mid-reload.").default(false));
|
|
24650
24644
|
}
|
|
24651
24645
|
|
|
24652
24646
|
//#endregion
|
|
@@ -25103,8 +25097,8 @@ async function localStartAgentCoreCommand(target, options, extraStateProviders,
|
|
|
25103
25097
|
info: (m) => logger.info(m),
|
|
25104
25098
|
warn: (m) => logger.warn(m)
|
|
25105
25099
|
});
|
|
25106
|
-
process.on("SIGINT", () => shutdown("SIGINT"
|
|
25107
|
-
process.on("SIGTERM", () => shutdown("SIGTERM"
|
|
25100
|
+
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
25101
|
+
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
25108
25102
|
try {
|
|
25109
25103
|
if (plan.readyPath === void 0) await waitForAgentCorePing(containerHost, containerHostPort, options.timeout);
|
|
25110
25104
|
else await waitForAgentCoreHttpReady(containerHost, containerHostPort, plan.readyPath, options.timeout);
|
|
@@ -25349,7 +25343,7 @@ async function localStartWebFunctionCommand(target, options, extraStateProviders
|
|
|
25349
25343
|
timeoutMs: options.timeout
|
|
25350
25344
|
});
|
|
25351
25345
|
let shuttingDown = false;
|
|
25352
|
-
const shutdown = async (signal
|
|
25346
|
+
const shutdown = async (signal) => {
|
|
25353
25347
|
if (shuttingDown) {
|
|
25354
25348
|
if (!serve.waitingOnRun) {
|
|
25355
25349
|
logger.info(`Received ${signal} again; still removing the container, please wait...`);
|
|
@@ -25357,16 +25351,16 @@ async function localStartWebFunctionCommand(target, options, extraStateProviders
|
|
|
25357
25351
|
}
|
|
25358
25352
|
serve.disposeArtifactNow();
|
|
25359
25353
|
logger.warn(`Received ${signal} again; exiting without waiting for docker run to return. The container may still be starting, and its environment holds the forwarded AWS credentials. Remove it by its name (this works even if it is created after this exit): docker rm -f ${serve.containerName ?? "<name>"}`);
|
|
25360
|
-
process.exit(signal
|
|
25354
|
+
process.exit(signalExitCode(signal));
|
|
25361
25355
|
return;
|
|
25362
25356
|
}
|
|
25363
25357
|
shuttingDown = true;
|
|
25364
25358
|
logger.info(`Received ${signal}, shutting down...`);
|
|
25365
25359
|
await serve.teardown();
|
|
25366
|
-
process.exit(
|
|
25360
|
+
process.exit(signalExitCode(signal));
|
|
25367
25361
|
};
|
|
25368
|
-
process.on("SIGINT", () => void shutdown("SIGINT"
|
|
25369
|
-
process.on("SIGTERM", () => void shutdown("SIGTERM"
|
|
25362
|
+
process.on("SIGINT", () => void shutdown("SIGINT"));
|
|
25363
|
+
process.on("SIGTERM", () => void shutdown("SIGTERM"));
|
|
25370
25364
|
try {
|
|
25371
25365
|
const address = await serve.start();
|
|
25372
25366
|
if (!address) return await forever();
|
|
@@ -26444,7 +26438,7 @@ async function localStartMicrovmCommand(target, options, extraStateProviders, ho
|
|
|
26444
26438
|
logger.info(`Target: ${displayStackName(`${resolved.stack.stackName}/${resolved.logicalId}`)} (MicroVM image ${displayIdent(config.name)}; hooks: ${Object.keys(config.hooks).join(", ") || "none"}${platform ? `; ${platform}` : ""})`);
|
|
26445
26439
|
for (const line of microvmFidelityWarnings(config)) logger.warn(line);
|
|
26446
26440
|
artifact = await resolveMicrovmCodeArtifact(resolved.stack, config);
|
|
26447
|
-
const shutdown = async (signal
|
|
26441
|
+
const shutdown = async (signal) => {
|
|
26448
26442
|
if (shuttingDown) {
|
|
26449
26443
|
if (!waitingOnRun) {
|
|
26450
26444
|
logger.info(`Received ${signal} again; still terminating the MicroVMs, please wait...`);
|
|
@@ -26452,16 +26446,16 @@ async function localStartMicrovmCommand(target, options, extraStateProviders, ho
|
|
|
26452
26446
|
}
|
|
26453
26447
|
disposeMicrovmCodeArtifact(artifact);
|
|
26454
26448
|
logger.warn(`Received ${signal} again; exiting without waiting for docker run to return. The container may still be starting, and its environment holds the forwarded AWS credentials. Remove it by its name (this works even if it is created after this exit): docker rm -f ${containerName ?? "<name>"}`);
|
|
26455
|
-
process.exit(signal
|
|
26449
|
+
process.exit(signalExitCode(signal));
|
|
26456
26450
|
return;
|
|
26457
26451
|
}
|
|
26458
26452
|
shuttingDown = true;
|
|
26459
26453
|
logger.info(`Received ${signal}, terminating ${vms.length} MicroVM(s)...`);
|
|
26460
26454
|
await teardown();
|
|
26461
|
-
process.exit(
|
|
26455
|
+
process.exit(signalExitCode(signal));
|
|
26462
26456
|
};
|
|
26463
|
-
process.on("SIGINT", () => void shutdown("SIGINT"
|
|
26464
|
-
process.on("SIGTERM", () => void shutdown("SIGTERM"
|
|
26457
|
+
process.on("SIGINT", () => void shutdown("SIGINT"));
|
|
26458
|
+
process.on("SIGTERM", () => void shutdown("SIGTERM"));
|
|
26465
26459
|
const recents = /* @__PURE__ */ new Map();
|
|
26466
26460
|
let allTerminated;
|
|
26467
26461
|
const everyVmTerminated = new Promise((r) => allTerminated = r);
|
|
@@ -31903,6 +31897,7 @@ function blockUntilShutdown(server, serveManager, store, cliName) {
|
|
|
31903
31897
|
const shutdown = (signal) => {
|
|
31904
31898
|
if (shuttingDown) return;
|
|
31905
31899
|
shuttingDown = true;
|
|
31900
|
+
process.exitCode = signalExitCode(signal);
|
|
31906
31901
|
getLogger().info(`Received ${signal}; stopping ${cliName} studio...`);
|
|
31907
31902
|
store.dispose();
|
|
31908
31903
|
serveManager.stopAll().catch((err) => getLogger().warn(`Error stopping serve targets: ${String(err)}`)).then(() => server.close()).catch((err) => getLogger().warn(`Error stopping studio server: ${String(err)}`)).finally(() => resolveShutdown());
|
|
@@ -31939,4 +31934,4 @@ function addStudioSpecificOptions(cmd) {
|
|
|
31939
31934
|
|
|
31940
31935
|
//#endregion
|
|
31941
31936
|
export { postHook as $, addAwsEndpointOptions as $a, parseConnectionsPath as $i, addImageOverrideOptions as $n, addStartApiSpecificOptions as $r, classifyS3Error as $t, microvmFidelityWarnings as A, parseSelectionExpressionPath as Aa, applyCorsResponseHeaders as Ai, stripCloudFrontImport as An, A2A_CONTAINER_PORT as Ar, readContainerLogTail as At, MICROVM_WS_BASE_PROTOCOL as B, AgentCoreResolutionError as Ba, evaluateResponseParameters as Bi, createLocalStartAlbCommand as Bn, AGENTCORE_SESSION_ID_HEADER as Br, parseWebFunctionBuildConfig as Bt, addListSpecificOptions as C, resolveSingleTarget as Ca, verifyJwtViaDiscovery as Ci, WEB_FUNCTION_REVISION_TYPE as Cn, setShadowReadyTimeoutMs as Cr, parseKvsFileOverrides as Ct, buildMicrovmLambdaView as D, discoverWebSocketApis as Da, invokeRequestAuthorizer as Di, compileCloudFrontFunction as Dn, createLocalInvokeAgentCoreCommand as Dr, WEB_FUNCTION_CONTAINER_PORT as Dt, addStartMicrovmSpecificOptions as E, availableWebSocketApiIdentifiers as Ea, evaluateCachedLambdaPolicy as Ei, resolveWebFunctionTarget as En, addInvokeAgentCoreSpecificOptions as Er, RecentOutput as Et, microvmImageTag as F, AGENTCORE_A2A_PROTOCOL as Fa, matchRoute as Fi, findFileAssetForObjectKey as Fn, MCP_PROTOCOL_VERSION as Fr, buildNodeEntryFileStart as Ft, startMicrovmFrontDoor as G, containsDynamicReference as Ga, HOST_DOCKER_INTERNAL_GATEWAY as Gi, addStartServiceSpecificOptions as Gn, SUPPORTED_CODE_RUNTIMES as Gr, readWebFunctionServiceConfig as Gt, PROXY_PORT_HEADER as H, resolveAgentCoreTarget as Ha, selectIntegrationResponse as Hi, resolveAlbTarget as Hn, waitForAgentCoreHttpReady as Hr, WEB_FUNCTION_HTTP_ENDPOINT_ENV as Ht, planMicrovmPorts as I, AGENTCORE_AGUI_PROTOCOL as Ia, translateLambdaResponse as Ii, isBucketDeploymentResource as In, mcpInvokeOnce as Ir, defaultWebFunctionPlatform as It, MICROVM_HOOK_PATH_PREFIX as J, keysNotFromTemplate as Ja, resolveHostGatewayExtraHosts as Ji, addRunTaskSpecificOptions as Jn, renderCodeDockerfile as Jr, idFromArn as Jt, stripMicrovmProxyHeaders as K, deployedFillMayBeSecret as Ka, HOST_GATEWAY_MIN_VERSION as Ki, createLocalStartServiceCommand as Kn, buildAgentCoreCodeImage as Kr, webFunctionAssumeRole as Kt, readExposedPorts as L, AGENTCORE_HTTP_PROTOCOL as La, applyAuthorizerOverlay as Li, resolveBucketDeploymentObjectKey as Ln, parseSseForJsonRpc as Lr, resolveWebFunctionRuntime as Lt, DEFAULT_TERMINATE_HOOK_TIMEOUT_MS as M, discoverRoutes as Ma, buildCorsConfigFromCloudFrontChain as Mi, createLocalFileKvsDataSource as Mn, a2aInvokeOnce as Mr, waitForWebFunctionReady as Mt, LocalMicrovm as N, pickRefLogicalId as Na, isFunctionUrlOacFronted as Ni, createUnboundCloudFrontModule as Nn, MCP_CONTAINER_PORT as Nr, watchContainerExit as Nt, createLocalStartMicrovmCommand as O, discoverWebSocketApisOrThrow as Oa, invokeTokenAuthorizer as Oi, runViewerRequest as On, bridgeAgentCoreWs as Or, containerFailure as Ot, buildMicrovmImage as P, resolveLambdaArnIntrinsic as Pa, matchPreflight as Pi, bucketDeploymentSourceObjectKeys as Pn, MCP_PATH as Pr, WEB_FUNCTION_RUNTIMES as Pt, pollBuildHook as Q, withoutKeys as Qa, handleConnectionsRequest as Qi, addEcsAssumeRoleOptions as Qn, createLocalInvokeCommand as Qr, resolveDeployedOriginBucket as Qt, setContainerPaused as R, AGENTCORE_MCP_PROTOCOL as Ra, buildHttpApiV2Event as Ri, addAlbSpecificOptions as Rn, AGENTCORE_SIGV4_SERVICE as Rr, supportedWebFunctionRuntimes as Rt, StudioEventBus as S, resolveWatchConfig as Sa, verifyJwtAuthorizer as Si, WEB_FUNCTION_ENDPOINT_TYPE as Sn, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as Sr, normalizeKvsFileKeys as St, formatTargetListing as T, listTargets as Ta, computeRequestIdentityHash as Ti, WebFunctionResolutionError as Tn, attachContainerLogStreamer as Tr, resolveCloudFrontTarget as Tt, rewriteUpgradeResponseHead as U, DynamicReferenceResolutionError as Ua, tryParseStatus as Ui, isApplicationLoadBalancer as Un, waitForAgentCorePing as Ur, buildWebFunctionLambdaView as Ut, MicrovmStateError as V, pickAgentCoreCandidateStack as Va, pickResponseTemplate as Vi, parseLbPortOverrides as Vn, invokeAgentCore as Vr, resolveWebFunctionArtifact as Vt, selectTargetPort as W, DynamicReferenceResolver as Wa, VtlEvaluationError as Wi, resolveAlbFrontDoor as Wn, downloadAndExtractS3Bundle as Wr, finalizeWebFunctionEnv as Wt, callRuntimeHook as X, parseDynamicReference as Xa, ConnectionRegistry as Xi, MAX_TASKS_SUBNET_RANGE_CAP as Xn, classifySourceChange as Xr, createDeployedKvsDataSource as Xt, MicrovmHookError as Y, keysOverriddenBy as Ya, bufferToBody as Yi, createLocalRunTaskCommand as Yn, toCmdArgv as Yr, resolveKvsModulesForDistribution as Yt, generateMicrovmId as Z, resolveDynamicReferencesInEnv as Za, buildMgmtEndpointEnvUrl as Zi, addCommonEcsServiceOptions as Zn, addInvokeSpecificOptions as Zr, resolveDeployedKvsArnByName as Zt, filterStudioTargetGroups as _, resolveCfnRegion as _a, defaultCredentialsLoader as _i, pickKvsLogicalIdFromArn as _n, isLocalCdkAssetImage as _r, attachAgentCoreWsBridge as _t, createLocalStudioCommand as a, resolveRuntimeImage as aa, attachStageContext as ai, serveLambdaUrlOrigin as an, resolveSharedSidecarCredentials as ar, disposeMicrovmCodeArtifact as at, renderStudioHtml as b, collectSsmParameterRefs as ba, createJwksCache as bi, pickWebFunctionEndpointLogicalIdFromOrigin as bn, CloudMapRegistry as br, addStartCloudFrontSpecificOptions as bt, startStudioProxy as c, substituteAgainstState as ca, resolveEnvVars$1 as ci, buildEdgeRequestEvent as cn, buildImageOverrideTag as cr, resolveMicrovmImageTarget as ct, createStudioDispatcher as d, substituteEnvVarsFromStateAsync as da, filterRoutesByApiIdentifiers as di, httpHeadersToEdge as dn, mergeForService as dr, createLocalStartWebFunctionCommand as dt, buildConnectEvent as ea, createLocalStartApiCommand as ei, createS3OriginReader as en, awsEndpointOptions as eo, buildEcsImageResolutionContext$1 as er, runHookBody as et, filterStudioCustomResources as f, LocalStateSourceError as fa, groupRoutesByServer as fi, CLOUDFRONT_DISTRIBUTION_TYPE as fn, parseImageOverrideFlags as fr, addStartAgentCoreSpecificOptions as ft, annotatePinnedEcsTargets as g, resolveCfnFallbackRegion as ga, resolveServiceIntegrationParameters as gi, pickFunctionUrlLogicalIdFromOrigin as gn, imageOverrideKeyAliases as gr, startAgentCoreHttpServer as gt, annotateEcsTaskPinnedTargets as h, rejectExplicitCfnStackWithMultipleStacks as ha, resolveSelectionExpression as hi, isCloudFrontDistribution as hn, describePinnedImageUri as hr, selectServeInboundAuth as ht, coerceStopRequest as i, resolveRuntimeFileExtension as ia, createFileWatcher as ii, serveFromStaticOrigin as in, resolveEcsAssumeRoleOption as ir, MicrovmResolutionError as it, readRunHookPayload as j, webSocketApiMatchesIdentifier as ja, buildCorsConfigByApiId as ji, createCloudFrontModule as jn, A2A_PATH as jr, startWebFunctionContainer as jt, finalizeMicrovmEnv as k, filterWebSocketApisByIdentifiers as ka, attachAuthorizers as ki, runViewerResponse as kn, invokeAgentCoreWs as kr, planWebFunctionContainer as kt, relayServeRequest as l, substituteAgainstStateAsync as la, availableApiIdentifiers as li, buildEdgeResponseEvent as ln, canonicalizeImageOverrideKeys as lr, s3KeyOfUri as lt, annotateAlbPinnedBackingServices as m, isCfnFlagPresent as ma, startApiServer as mi, extractKvsAssociations as mn, runImageOverrideBuilds as mr, buildAgentCoreServeAuthCheck as mt, coerceRunRequest as n, buildMessageEvent as na, resolveApiTargetSubset as ni, startCloudFrontServer as nn, parseMaxTasks as nr, MICROVM_DEFAULT_INGRESS_PORT as nt, resolveServeBaseUrl as o, EcsTaskResolutionError as oa, buildStageMap as oi, applyEdgeRequestResult as on, runEcsServiceEmulator as or, readMicrovmImageConfig as ot, isCustomResourceLambdaTarget as p, createLocalStateProvider as pa, readMtlsMaterialsFromDisk as pi, describeS3OriginDomain as pn, resolveImageOverrides as pr, createLocalStartAgentCoreCommand as pt, MAX_RUN_HOOK_PAYLOAD_BYTES as q, firstUsableRegion as qa, probeHostGatewaySupport as qi, serviceStrategy as qn, computeCodeImageTag as qr, webFunctionFidelityWarnings as qt, coerceServeRequest as r, resolveRuntimeCodeMountPath as ra, createAuthorizerCache as ri, resolveErrorResponseCandidates as rn, parseRestartPolicy as rr, MICROVM_IMAGE_TYPE as rt, createStudioServeManager as s, assertEcsTaskImagesResolvable as sa, materializeLayerFromArn as si, applyEdgeResponseResult as sn, ImageOverrideError as sr, resolveMicrovmCodeArtifact as st, addStudioSpecificOptions as t, buildDisconnectEvent as ta, createWatchPredicates as ti, matchBehavior as tn, ecsClusterOption as tr, waitForAppAnswer as tt, reinvoke as u, substituteEnvVarsFromState as ua, filterRoutesByApiIdentifier as ui, edgeHeadersToHttp as un, enforceImageOverrideOrphans as ur, addStartWebFunctionSpecificOptions as ut, startStudioServer as v, resolveCfnStackName as va, buildCognitoJwksUrl as vi, pickLambdaEdgeFunctionLogicalId as vn, listPinnedTargets as vr, startAgentCoreWsBridge as vt, createLocalListCommand as w, countTargets as wa, buildMethodArn as wi, WEB_FUNCTION_TYPE as wn, getContainerNetworkIp as wr, parseOriginOverrides as wt, createStudioStore as x, resolveSsmParameters as xa, verifyCognitoJwt as xi, resolveCloudFrontDistribution as xn, DEFAULT_SHADOW_READY_TIMEOUT_MS as xr, createLocalStartCloudFrontCommand as xt, toStudioTargetGroups as y, CfnLocalStateProvider as ya, buildJwksUrlFromIssuer as yi, pickTargetFunctionLogicalId as yn, buildCloudMapIndex as yr, LocalStartCloudFrontError as yt, MICROVM_CONTROL_PATH as z, AGENTCORE_RUNTIME_TYPE as za, buildRestV1Event as zi, albStrategy as zn, signAgentCoreInvocation as zr, disposeWebFunctionArtifact as zt };
|
|
31942
|
-
//# sourceMappingURL=local-studio-
|
|
31937
|
+
//# sourceMappingURL=local-studio-CjZkQNy5.js.map
|