cdk-local 0.150.0 → 0.151.1
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/{cdkl-io-host-DYuHWzAS.js → cdkl-io-host-9lPKscRA.js} +2 -2
- package/dist/{cdkl-io-host-DYuHWzAS.js.map → cdkl-io-host-9lPKscRA.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{docker-cmd-C2kvSLVs.js → docker-cmd-GME6jkl9.js} +13 -37
- package/dist/docker-cmd-GME6jkl9.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- 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-C_uqWIxQ.d.ts → local-studio-Cd0XxG0p.d.ts} +12 -2
- package/dist/local-studio-Cd0XxG0p.d.ts.map +1 -0
- package/dist/{local-studio-BhqhdhZ5.js → local-studio-a7HMFLOC.js} +261 -80
- package/dist/local-studio-a7HMFLOC.js.map +1 -0
- package/dist/{logger-CuUAMAnt.js → logger-CGhtqHg0.js} +67 -4
- package/dist/logger-CGhtqHg0.js.map +1 -0
- package/package.json +1 -1
- package/dist/docker-cmd-C2kvSLVs.js.map +0 -1
- package/dist/local-studio-BhqhdhZ5.js.map +0 -1
- package/dist/local-studio-C_uqWIxQ.d.ts.map +0 -1
- package/dist/logger-CuUAMAnt.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { t as getLogger } from "./logger-
|
|
1
|
+
import { C as sanitizeServiceExceptionMessage, S as isAwsServiceException, _ as resolveAssemblyPath, a as isDockerClientEnvKey, b as describeCredentialLoadFailure, c as runDockerStreaming, d as absoluteAssemblyPathEscape, f as assemblyPathEscape, g as renderAssemblyPathEscape, h as namesTheSameDirectory, i as getDockerCmd, l as spawnStreaming, m as isPasteableCommandArg, n as finchSecretArgvRefusal, o as isMalformedEnvKey, p as displayUntrustedValue, r as formatDockerLoginError, s as runDockerForeground, u as warnFinchArgvExposure, v as clampErrorName, w as stringifyThrown, x as flattenToOneLine, y as describeAwsFailureForWarn } from "./docker-cmd-GME6jkl9.js";
|
|
2
|
+
import { a as setEmbedConfig, r as getEmbedConfig, t as getLogger } from "./logger-CGhtqHg0.js";
|
|
3
3
|
import { chmodSync, cpSync, createWriteStream, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { homedir, tmpdir } from "node:os";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
@@ -326,7 +326,10 @@ async function resolveProfileCredentials(profile) {
|
|
|
326
326
|
try {
|
|
327
327
|
const credsProvider = sts.config.credentials;
|
|
328
328
|
const creds = typeof credsProvider === "function" ? await credsProvider() : credsProvider;
|
|
329
|
-
if (!creds || !creds.accessKeyId || !creds.secretAccessKey)
|
|
329
|
+
if (!creds || !creds.accessKeyId || !creds.secretAccessKey) {
|
|
330
|
+
const ssoHint = isPasteableCommandArg(profile) ? "Check `aws sso login --profile " + profile + "` for SSO profiles" : "For an SSO profile, run `aws sso login` for that profile (the command is not written out because the name as rendered may not be the one your shell would act on)";
|
|
331
|
+
throw new Error(`--profile ${displayUntrustedValue(profile)}: credential provider chain resolved without usable credentials. ${ssoHint}, or check \`~/.aws/credentials\` / \`~/.aws/config\` for regular profiles.`);
|
|
332
|
+
}
|
|
330
333
|
let region;
|
|
331
334
|
try {
|
|
332
335
|
const regionProvider = sts.config.region;
|
|
@@ -3389,7 +3392,7 @@ async function resolveMultiTarget(provided, params) {
|
|
|
3389
3392
|
async function loadSynthDeps() {
|
|
3390
3393
|
const [toolkitLib, { CdklIoHost }, { AssetManifestArtifact }] = await Promise.all([
|
|
3391
3394
|
import("@aws-cdk/toolkit-lib"),
|
|
3392
|
-
import("./cdkl-io-host-
|
|
3395
|
+
import("./cdkl-io-host-9lPKscRA.js"),
|
|
3393
3396
|
import("@aws-cdk/cloud-assembly-api")
|
|
3394
3397
|
]);
|
|
3395
3398
|
return {
|
|
@@ -3916,6 +3919,28 @@ function isCfnFlagPresent(opts) {
|
|
|
3916
3919
|
const v = opts.fromCfnStack;
|
|
3917
3920
|
return v !== void 0 && v !== false;
|
|
3918
3921
|
}
|
|
3922
|
+
function hasExtraStateProviderActive(options, extraStateProviders) {
|
|
3923
|
+
if (!extraStateProviders) return false;
|
|
3924
|
+
const bag = options;
|
|
3925
|
+
return Object.keys(extraStateProviders).some((key) => Boolean(bag[key]));
|
|
3926
|
+
}
|
|
3927
|
+
function isStateSourceActive(options, extraStateProviders) {
|
|
3928
|
+
return isCfnFlagPresent(options) || hasExtraStateProviderActive(options, extraStateProviders);
|
|
3929
|
+
}
|
|
3930
|
+
function activeStateSourceFlag(options, extraStateProviders) {
|
|
3931
|
+
if (isCfnFlagPresent(options)) return "--from-cfn-stack";
|
|
3932
|
+
if (!extraStateProviders) return void 0;
|
|
3933
|
+
const bag = options;
|
|
3934
|
+
const key = Object.keys(extraStateProviders).find((k) => Boolean(bag[k]));
|
|
3935
|
+
return key === void 0 ? void 0 : toFlagName(key);
|
|
3936
|
+
}
|
|
3937
|
+
function stateSourceFlagNames(extraStateProviders) {
|
|
3938
|
+
return ["--from-cfn-stack", ...Object.keys(extraStateProviders ?? {}).map(toFlagName)];
|
|
3939
|
+
}
|
|
3940
|
+
function hostStateSourceFields(options, extraStateProviders) {
|
|
3941
|
+
if (!extraStateProviders || Object.keys(extraStateProviders).length === 0) return {};
|
|
3942
|
+
return { ...options };
|
|
3943
|
+
}
|
|
3919
3944
|
function resolveCfnRegion(options, synthRegion) {
|
|
3920
3945
|
const region = options.stackRegion ?? options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? synthRegion;
|
|
3921
3946
|
if (region === void 0) throw new LocalStateSourceError("--from-cfn-stack requires a region to query CloudFormation. Set one of: --stack-region <region>, --region <region>, AWS_REGION env var, AWS_DEFAULT_REGION env var, or an env.region on the target CDK stack.");
|
|
@@ -5443,6 +5468,166 @@ function resolveRuntimeCodeMountPath(runtime) {
|
|
|
5443
5468
|
return "/var/task";
|
|
5444
5469
|
}
|
|
5445
5470
|
|
|
5471
|
+
//#endregion
|
|
5472
|
+
//#region src/utils/docker-argv-redaction.ts
|
|
5473
|
+
const REDACTED_ARGV_VALUE = "***";
|
|
5474
|
+
const ARGV_VALUE_BEARING_FLAGS = /* @__PURE__ */ new Set([
|
|
5475
|
+
"-e",
|
|
5476
|
+
"--env",
|
|
5477
|
+
"--opt",
|
|
5478
|
+
"--label",
|
|
5479
|
+
"--build-arg"
|
|
5480
|
+
]);
|
|
5481
|
+
const ARGV_PARAM_LIST_FLAGS = /* @__PURE__ */ new Set(["--cache-from", "--cache-to"]);
|
|
5482
|
+
const ARGV_PARAM_LIST_LOCATOR_PARAMS = /* @__PURE__ */ new Set([
|
|
5483
|
+
"type",
|
|
5484
|
+
"mode",
|
|
5485
|
+
"compression",
|
|
5486
|
+
"compression-level",
|
|
5487
|
+
"force-compression",
|
|
5488
|
+
"ignore-error",
|
|
5489
|
+
"image-manifest",
|
|
5490
|
+
"oci-mediatypes",
|
|
5491
|
+
"timeout",
|
|
5492
|
+
"ref",
|
|
5493
|
+
"dest",
|
|
5494
|
+
"src",
|
|
5495
|
+
"digest",
|
|
5496
|
+
"tag",
|
|
5497
|
+
"region",
|
|
5498
|
+
"bucket",
|
|
5499
|
+
"name",
|
|
5500
|
+
"prefix",
|
|
5501
|
+
"manifests_prefix",
|
|
5502
|
+
"blobs_prefix",
|
|
5503
|
+
"use_path_style",
|
|
5504
|
+
"upload_parallelism",
|
|
5505
|
+
"touch_refresh",
|
|
5506
|
+
"account_name",
|
|
5507
|
+
"scope"
|
|
5508
|
+
]);
|
|
5509
|
+
const ARGV_PARAM_LIST_URL_PARAMS = /* @__PURE__ */ new Set([
|
|
5510
|
+
"account_url",
|
|
5511
|
+
"endpoint_url",
|
|
5512
|
+
"url",
|
|
5513
|
+
"url_v2"
|
|
5514
|
+
]);
|
|
5515
|
+
function redactUrlLocator(value) {
|
|
5516
|
+
if (value === "") return value;
|
|
5517
|
+
const authority = /^(?:[a-zA-Z][a-zA-Z0-9+.-]*:)?\/\//.exec(value);
|
|
5518
|
+
if (authority === null) return REDACTED_ARGV_VALUE;
|
|
5519
|
+
const prefix = authority[0];
|
|
5520
|
+
let rest = value.slice(prefix.length);
|
|
5521
|
+
const lastAt = rest.lastIndexOf("@");
|
|
5522
|
+
if (lastAt >= 0) rest = `${REDACTED_ARGV_VALUE}${rest.slice(lastAt)}`;
|
|
5523
|
+
else {
|
|
5524
|
+
const host = rest.split(/[/?#]/)[0];
|
|
5525
|
+
const ipv6 = /^\[[0-9A-Fa-f:.]+\]/.exec(host);
|
|
5526
|
+
const bare = ipv6 ? host.slice(ipv6[0].length) : host;
|
|
5527
|
+
if (/:(?!\d{1,5}$)/.test(bare)) return REDACTED_ARGV_VALUE;
|
|
5528
|
+
}
|
|
5529
|
+
for (const delimiter of ["?", "#"]) {
|
|
5530
|
+
const at = rest.indexOf(delimiter);
|
|
5531
|
+
if (at >= 0) rest = `${rest.slice(0, at)}${delimiter}${REDACTED_ARGV_VALUE}`;
|
|
5532
|
+
}
|
|
5533
|
+
return `${prefix}${rest}`;
|
|
5534
|
+
}
|
|
5535
|
+
function maskArgvFlagValue(flag, value) {
|
|
5536
|
+
if (ARGV_VALUE_BEARING_FLAGS.has(flag)) {
|
|
5537
|
+
const eqIdx = value.indexOf("=");
|
|
5538
|
+
return eqIdx >= 0 ? `${value.substring(0, eqIdx)}=${REDACTED_ARGV_VALUE}` : void 0;
|
|
5539
|
+
}
|
|
5540
|
+
if (ARGV_PARAM_LIST_FLAGS.has(flag)) {
|
|
5541
|
+
let masked = false;
|
|
5542
|
+
const rawParts = value.split(",");
|
|
5543
|
+
const parts = rawParts.map((part, index) => {
|
|
5544
|
+
if (part === "") return part;
|
|
5545
|
+
if (masked) return REDACTED_ARGV_VALUE;
|
|
5546
|
+
const eqIdx = part.indexOf("=");
|
|
5547
|
+
if (eqIdx < 0) {
|
|
5548
|
+
if (index === 0) return part;
|
|
5549
|
+
masked = true;
|
|
5550
|
+
return REDACTED_ARGV_VALUE;
|
|
5551
|
+
}
|
|
5552
|
+
const name = part.substring(0, eqIdx);
|
|
5553
|
+
const normalized = name.trim().toLowerCase();
|
|
5554
|
+
if (ARGV_PARAM_LIST_URL_PARAMS.has(normalized)) {
|
|
5555
|
+
if (rawParts.slice(index + 1).some((later) => later.includes("@"))) {
|
|
5556
|
+
masked = true;
|
|
5557
|
+
return `${name}=${REDACTED_ARGV_VALUE}`;
|
|
5558
|
+
}
|
|
5559
|
+
const rawUrl = part.substring(eqIdx + 1);
|
|
5560
|
+
const safeUrl = redactUrlLocator(rawUrl);
|
|
5561
|
+
if (safeUrl === rawUrl) return part;
|
|
5562
|
+
masked = true;
|
|
5563
|
+
return `${name}=${safeUrl}`;
|
|
5564
|
+
}
|
|
5565
|
+
if (ARGV_PARAM_LIST_LOCATOR_PARAMS.has(normalized)) return part;
|
|
5566
|
+
masked = true;
|
|
5567
|
+
return `${name}=${REDACTED_ARGV_VALUE}`;
|
|
5568
|
+
});
|
|
5569
|
+
return masked ? parts.join(",") : void 0;
|
|
5570
|
+
}
|
|
5571
|
+
}
|
|
5572
|
+
function maskAttachedShortFlag(arg) {
|
|
5573
|
+
if (arg.startsWith("--") || !arg.startsWith("-")) return void 0;
|
|
5574
|
+
let chosen;
|
|
5575
|
+
for (const flag of ARGV_VALUE_BEARING_FLAGS) {
|
|
5576
|
+
if (flag.length !== 2 || !flag.startsWith("-") || flag[1] === "-") continue;
|
|
5577
|
+
const at = arg.indexOf(flag[1], 1);
|
|
5578
|
+
if (at < 0 || at === arg.length - 1) continue;
|
|
5579
|
+
if (chosen === void 0 || at < chosen.at) chosen = {
|
|
5580
|
+
at,
|
|
5581
|
+
flag
|
|
5582
|
+
};
|
|
5583
|
+
}
|
|
5584
|
+
if (chosen === void 0) return void 0;
|
|
5585
|
+
const masked = maskArgvFlagValue(chosen.flag, arg.slice(chosen.at + 1));
|
|
5586
|
+
return masked === void 0 ? void 0 : `${arg.slice(0, chosen.at + 1)}${masked}`;
|
|
5587
|
+
}
|
|
5588
|
+
function trailingShortFlagOfCluster(arg) {
|
|
5589
|
+
if (arg.startsWith("--") || !arg.startsWith("-")) return void 0;
|
|
5590
|
+
const last = arg[arg.length - 1];
|
|
5591
|
+
for (const flag of ARGV_VALUE_BEARING_FLAGS) if (flag.length === 2 && flag.startsWith("-") && flag[1] !== "-" && flag[1] === last) return flag;
|
|
5592
|
+
}
|
|
5593
|
+
function redactDockerArgvValues(args) {
|
|
5594
|
+
const out = [];
|
|
5595
|
+
for (let i = 0; i < args.length; i++) {
|
|
5596
|
+
const cur = args[i];
|
|
5597
|
+
const joinedEq = cur.indexOf("=");
|
|
5598
|
+
if (joinedEq > 0) {
|
|
5599
|
+
const maskedJoined = maskArgvFlagValue(cur.substring(0, joinedEq), cur.substring(joinedEq + 1));
|
|
5600
|
+
if (maskedJoined !== void 0) {
|
|
5601
|
+
out.push(`${cur.substring(0, joinedEq)}=${maskedJoined}`);
|
|
5602
|
+
continue;
|
|
5603
|
+
}
|
|
5604
|
+
}
|
|
5605
|
+
const maskedAttached = maskAttachedShortFlag(cur);
|
|
5606
|
+
if (maskedAttached !== void 0) {
|
|
5607
|
+
out.push(maskedAttached);
|
|
5608
|
+
continue;
|
|
5609
|
+
}
|
|
5610
|
+
const next = args[i + 1];
|
|
5611
|
+
if (typeof next === "string") {
|
|
5612
|
+
const maskedNext = maskArgvFlagValue(ARGV_VALUE_BEARING_FLAGS.has(cur) ? cur : trailingShortFlagOfCluster(cur) ?? cur, next);
|
|
5613
|
+
if (maskedNext !== void 0) {
|
|
5614
|
+
out.push(cur, maskedNext);
|
|
5615
|
+
i++;
|
|
5616
|
+
continue;
|
|
5617
|
+
}
|
|
5618
|
+
}
|
|
5619
|
+
out.push(cur);
|
|
5620
|
+
}
|
|
5621
|
+
return out;
|
|
5622
|
+
}
|
|
5623
|
+
function describeExitWithoutArgv(err) {
|
|
5624
|
+
const e = err;
|
|
5625
|
+
if (typeof e?.signal === "string" && e.signal !== "") return `killed by ${e.signal}`;
|
|
5626
|
+
if (typeof e?.code === "number") return `exited with code ${e.code}`;
|
|
5627
|
+
if (typeof e?.code === "string" && e.code !== "") return `failed (${e.code})`;
|
|
5628
|
+
return "failed with no output";
|
|
5629
|
+
}
|
|
5630
|
+
|
|
5446
5631
|
//#endregion
|
|
5447
5632
|
//#region src/assets/asset-source-path.ts
|
|
5448
5633
|
function resolveAssetSourcePath(opts) {
|
|
@@ -5719,7 +5904,7 @@ async function buildDockerImage(asset, cdkOutDir, options) {
|
|
|
5719
5904
|
const [cmd, ...args] = source.executable;
|
|
5720
5905
|
if (!cmd) throw options.wrapError("asset source.executable[] is empty");
|
|
5721
5906
|
const cwd = source.directory ? contextDirectory(source.directory, "run this asset's source.executable with that directory as its working directory") : cdkOutDir;
|
|
5722
|
-
logger.debug(`Building Docker image via executable: ${displayUntrustedValue(source.executable.join(" "))} (cwd=${displayUntrustedValue(cwd)})`);
|
|
5907
|
+
logger.debug(`Building Docker image via executable: ${displayUntrustedValue(redactDockerArgvValues(source.executable).join(" "))} (cwd=${displayUntrustedValue(cwd)})`);
|
|
5723
5908
|
warnManifestExecutable(cmd, source.executable, cwd);
|
|
5724
5909
|
let result;
|
|
5725
5910
|
try {
|
|
@@ -5732,13 +5917,13 @@ async function buildDockerImage(asset, cdkOutDir, options) {
|
|
|
5732
5917
|
if (!tag) throw options.wrapError(`docker build executable produced no output (expected the local image tag on stdout): ${displayUntrustedValue(cmd)}`);
|
|
5733
5918
|
return tag;
|
|
5734
5919
|
}
|
|
5735
|
-
if (!source.directory) throw options.wrapError(`DockerImageAssetSource must set either 'directory' or 'executable' (
|
|
5920
|
+
if (!source.directory) throw options.wrapError(`DockerImageAssetSource must set either 'directory' or 'executable' (fields present: ${displayUntrustedValue(Object.keys(source).join(", ") || "none")})`);
|
|
5736
5921
|
if (!options.tag) throw options.wrapError("buildDockerImage(directory mode) requires options.tag");
|
|
5737
5922
|
const buildArgs = buildDockerBuildCommand(source, options.tag, options.platform);
|
|
5738
5923
|
const contextDir = contextDirectory(source.directory, `send that directory to docker build as the context of an image ${getEmbedConfig().productName} then runs locally`);
|
|
5739
5924
|
buildArgs.push(".");
|
|
5740
5925
|
warnEscapingBuildKitPaths(source, contextDir, assetOutdir);
|
|
5741
|
-
logger.debug(`${getDockerCmd()} ${buildArgs.join(" ")} (cwd=${displayUntrustedValue(contextDir)})`);
|
|
5926
|
+
logger.debug(`${getDockerCmd()} ${redactDockerArgvValues(buildArgs).join(" ")} (cwd=${displayUntrustedValue(contextDir)})`);
|
|
5742
5927
|
try {
|
|
5743
5928
|
await runDockerStreaming(buildArgs, {
|
|
5744
5929
|
cwd: contextDir,
|
|
@@ -6111,7 +6296,7 @@ async function runDetached(opts) {
|
|
|
6111
6296
|
}
|
|
6112
6297
|
args.push(opts.image, ...entryPointTail, ...opts.cmd);
|
|
6113
6298
|
const logger = getLogger().child("docker");
|
|
6114
|
-
logger.debug(`${getDockerCmd()} ${
|
|
6299
|
+
logger.debug(flattenToOneLine(`${getDockerCmd()} ${redactDockerArgvValues(args).join(" ")}`));
|
|
6115
6300
|
if (collisions.length > 0) logger.warn(describeRefusedSensitiveEnvKeys(`Container for image ${displayUntrustedValue(opts.image)}`, collisions));
|
|
6116
6301
|
const forwardedKeys = Object.keys(passthroughEnv);
|
|
6117
6302
|
const refusal = finchSecretArgvRefusal(forwardedKeys.filter((k) => opts.sensitiveEnvKeys?.has(k)), {
|
|
@@ -6127,8 +6312,7 @@ async function runDetached(opts) {
|
|
|
6127
6312
|
});
|
|
6128
6313
|
return stdout.trim();
|
|
6129
6314
|
} catch (error) {
|
|
6130
|
-
|
|
6131
|
-
throw new DockerRunnerError(`docker run failed: ${err.stderr?.trim() || err.message || String(error)}`);
|
|
6315
|
+
throw new DockerRunnerError(`docker run failed: ${error.stderr?.trim() || describeExitWithoutArgv(error)}`);
|
|
6132
6316
|
}
|
|
6133
6317
|
}
|
|
6134
6318
|
function streamLogs(containerId) {
|
|
@@ -6225,26 +6409,6 @@ function execEnvForSecrets(passthrough) {
|
|
|
6225
6409
|
for (const k of keys) defineOwnKey(env, k, passthrough[k]);
|
|
6226
6410
|
return { env };
|
|
6227
6411
|
}
|
|
6228
|
-
function redactAwsCredentialsInArgs(args) {
|
|
6229
|
-
const out = [];
|
|
6230
|
-
for (let i = 0; i < args.length; i++) {
|
|
6231
|
-
const cur = args[i];
|
|
6232
|
-
const next = args[i + 1];
|
|
6233
|
-
if (cur === "-e" && typeof next === "string") {
|
|
6234
|
-
const eqIdx = next.indexOf("=");
|
|
6235
|
-
if (eqIdx > 0) {
|
|
6236
|
-
const key = next.substring(0, eqIdx);
|
|
6237
|
-
if (SENSITIVE_ENV_KEYS.has(key)) {
|
|
6238
|
-
out.push("-e", `${key}=***`);
|
|
6239
|
-
i++;
|
|
6240
|
-
continue;
|
|
6241
|
-
}
|
|
6242
|
-
}
|
|
6243
|
-
}
|
|
6244
|
-
out.push(cur);
|
|
6245
|
-
}
|
|
6246
|
-
return out;
|
|
6247
|
-
}
|
|
6248
6412
|
|
|
6249
6413
|
//#endregion
|
|
6250
6414
|
//#region src/assets/asset-manifest-loader.ts
|
|
@@ -11811,7 +11975,7 @@ function getContainerAwsCredentialsPath() {
|
|
|
11811
11975
|
}
|
|
11812
11976
|
async function writeProfileCredentialsFile(profileName, creds) {
|
|
11813
11977
|
if (profileName === "") throw new Error("writeProfileCredentialsFile: profile name must not be empty.");
|
|
11814
|
-
if (/[\r\n[\]]/.test(profileName)) throw new Error(`writeProfileCredentialsFile: profile name
|
|
11978
|
+
if (/[\r\n[\]]/.test(profileName)) throw new Error(`writeProfileCredentialsFile: profile name ${displayUntrustedValue(profileName)} contains a forbidden character (any of CR, LF, '[', ']' would corrupt the INI file or the docker -e env var).`);
|
|
11815
11979
|
const dir = await mkdtemp(path$1.join(tmpdir(), `${getEmbedConfig().productName}-profile-creds-`));
|
|
11816
11980
|
const hostPath = path$1.join(dir, "credentials");
|
|
11817
11981
|
const lines = [
|
|
@@ -12959,11 +13123,6 @@ function envHasIntrinsicValue$1(templateEnv) {
|
|
|
12959
13123
|
}
|
|
12960
13124
|
return false;
|
|
12961
13125
|
}
|
|
12962
|
-
function hasExtraStateProviderActive(options, extraStateProviders) {
|
|
12963
|
-
if (!extraStateProviders) return false;
|
|
12964
|
-
for (const key of Object.keys(extraStateProviders)) if (options[key]) return true;
|
|
12965
|
-
return false;
|
|
12966
|
-
}
|
|
12967
13126
|
async function loadStateForRoutedStacks(stacks, routes, routesWithAuth, options, extraStateProviders) {
|
|
12968
13127
|
const logger = getLogger();
|
|
12969
13128
|
const out = /* @__PURE__ */ new Map();
|
|
@@ -14861,7 +15020,7 @@ async function resolveHostCredentialsForSigV4(options, resolved, loaded, region,
|
|
|
14861
15020
|
return await assumeAgentCoreExecutionRole(assumeRoleArn, region, options.profile);
|
|
14862
15021
|
} catch (err) {
|
|
14863
15022
|
const sigv4Detail = assumeRoleDetail(err, "STS AssumeRole (--sigv4 signing)");
|
|
14864
|
-
logger.warn(`--assume-role: STS AssumeRole(${flattenToOneLine(assumeRoleArn)}) failed for --sigv4 signing: ${sigv4Detail}. Falling back to ${options.profile ? `--profile ${options.profile}` : "shell credentials"}.`);
|
|
15023
|
+
logger.warn(`--assume-role: STS AssumeRole(${flattenToOneLine(assumeRoleArn)}) failed for --sigv4 signing: ${sigv4Detail}. Falling back to ${options.profile ? `--profile ${displayUntrustedValue(options.profile)}` : "shell credentials"}.`);
|
|
14865
15024
|
}
|
|
14866
15025
|
if (options.profile) {
|
|
14867
15026
|
const creds = await resolveProfileCredentials(options.profile);
|
|
@@ -14953,7 +15112,7 @@ async function resolveAgentCoreCodeImageFromS3(resolved, code, s3Source, options
|
|
|
14953
15112
|
credentials = await assumeAgentCoreExecutionRole(assumeRoleArn, region, options.profile);
|
|
14954
15113
|
} catch (err) {
|
|
14955
15114
|
const bundleDetail = assumeRoleDetail(err, "STS AssumeRole (fromS3 bundle download)");
|
|
14956
|
-
logger.warn(`--assume-role: STS AssumeRole(${flattenToOneLine(assumeRoleArn)}) failed for the fromS3 bundle download: ${bundleDetail}. Falling back to ${options.profile ? `--profile ${options.profile}` : "the default credentials"}.`);
|
|
15115
|
+
logger.warn(`--assume-role: STS AssumeRole(${flattenToOneLine(assumeRoleArn)}) failed for the fromS3 bundle download: ${bundleDetail}. Falling back to ${options.profile ? `--profile ${displayUntrustedValue(options.profile)}` : "the default credentials"}.`);
|
|
14957
15116
|
}
|
|
14958
15117
|
const bundle = await downloadAndExtractS3Bundle(location, {
|
|
14959
15118
|
...region !== void 0 && { region },
|
|
@@ -15784,8 +15943,7 @@ async function createNetworkAndSidecar(args) {
|
|
|
15784
15943
|
return stdout.trim();
|
|
15785
15944
|
} catch (err) {
|
|
15786
15945
|
await destroyNetworkOnly(networkName);
|
|
15787
|
-
|
|
15788
|
-
throw new DockerRunnerError(`Failed to start metadata-endpoints sidecar: ${e.stderr?.trim() || e.message || String(err)}`);
|
|
15946
|
+
throw new DockerRunnerError(`Failed to start metadata-endpoints sidecar: ${err.stderr?.trim() || describeExitWithoutArgv(err)}`);
|
|
15789
15947
|
}
|
|
15790
15948
|
}
|
|
15791
15949
|
async function createTaskNetwork(options = {}) {
|
|
@@ -16140,7 +16298,7 @@ async function runEcsTask(task, options, state) {
|
|
|
16140
16298
|
id = stdout.trim();
|
|
16141
16299
|
} catch (err) {
|
|
16142
16300
|
const e = err;
|
|
16143
|
-
throw new DockerRunnerError(`docker run failed for container '${container.name}': ${e.stderr?.trim() ||
|
|
16301
|
+
throw new DockerRunnerError(`docker run failed for container '${container.name}': ${e.stderr?.trim() || describeExitWithoutArgv(err)}`);
|
|
16144
16302
|
}
|
|
16145
16303
|
state.startedContainers.push({
|
|
16146
16304
|
name: container.name,
|
|
@@ -16358,7 +16516,7 @@ async function realizeDockerVolumes(volumes, state) {
|
|
|
16358
16516
|
logger.debug(`Created docker volume ${dockerVolumeName} for task volume '${v.name}'`);
|
|
16359
16517
|
} catch (err) {
|
|
16360
16518
|
const e = err;
|
|
16361
|
-
throw new DockerRunnerError(`docker volume create failed for '${v.name}': ${e.stderr?.trim() ||
|
|
16519
|
+
throw new DockerRunnerError(`docker volume create failed for '${v.name}': ${e.stderr?.trim() || describeExitWithoutArgv(err)}`);
|
|
16362
16520
|
}
|
|
16363
16521
|
out.set(v.name, {
|
|
16364
16522
|
...v,
|
|
@@ -17223,7 +17381,7 @@ async function softReloadReplica(args) {
|
|
|
17223
17381
|
const defaultDockerInspectWorkdirImpl = async (containerId) => {
|
|
17224
17382
|
const { execFile } = await import("node:child_process");
|
|
17225
17383
|
const { promisify } = await import("node:util");
|
|
17226
|
-
const { getDockerCmd } = await import("./docker-cmd-
|
|
17384
|
+
const { getDockerCmd } = await import("./docker-cmd-GME6jkl9.js").then((n) => n.t);
|
|
17227
17385
|
const { stdout } = await promisify(execFile)(getDockerCmd(), [
|
|
17228
17386
|
"inspect",
|
|
17229
17387
|
"--format",
|
|
@@ -17236,7 +17394,7 @@ let dockerInspectWorkdirImpl = defaultDockerInspectWorkdirImpl;
|
|
|
17236
17394
|
const defaultDockerCpImpl = async (src, dst) => {
|
|
17237
17395
|
const { execFile } = await import("node:child_process");
|
|
17238
17396
|
const { promisify } = await import("node:util");
|
|
17239
|
-
const { getDockerCmd } = await import("./docker-cmd-
|
|
17397
|
+
const { getDockerCmd } = await import("./docker-cmd-GME6jkl9.js").then((n) => n.t);
|
|
17240
17398
|
await promisify(execFile)(getDockerCmd(), [
|
|
17241
17399
|
"cp",
|
|
17242
17400
|
src,
|
|
@@ -17247,7 +17405,7 @@ let dockerCpImpl = defaultDockerCpImpl;
|
|
|
17247
17405
|
const defaultDockerRestartImpl = async (containerId) => {
|
|
17248
17406
|
const { execFile } = await import("node:child_process");
|
|
17249
17407
|
const { promisify } = await import("node:util");
|
|
17250
|
-
const { getDockerCmd } = await import("./docker-cmd-
|
|
17408
|
+
const { getDockerCmd } = await import("./docker-cmd-GME6jkl9.js").then((n) => n.t);
|
|
17251
17409
|
await promisify(execFile)(getDockerCmd(), ["restart", containerId]);
|
|
17252
17410
|
};
|
|
17253
17411
|
let dockerRestartImpl = defaultDockerRestartImpl;
|
|
@@ -17265,7 +17423,7 @@ async function disconnectOldFromSharedNetwork(oldInstance) {
|
|
|
17265
17423
|
const defaultDockerNetworkDisconnectImpl = async (networkName, containerId) => {
|
|
17266
17424
|
const { execFile } = await import("node:child_process");
|
|
17267
17425
|
const { promisify } = await import("node:util");
|
|
17268
|
-
const { getDockerCmd } = await import("./docker-cmd-
|
|
17426
|
+
const { getDockerCmd } = await import("./docker-cmd-GME6jkl9.js").then((n) => n.t);
|
|
17269
17427
|
await promisify(execFile)(getDockerCmd(), [
|
|
17270
17428
|
"network",
|
|
17271
17429
|
"disconnect",
|
|
@@ -17405,7 +17563,7 @@ function pickEssentialContainerId(instance, service) {
|
|
|
17405
17563
|
const defaultWaitForExitImpl = async (containerId) => {
|
|
17406
17564
|
const { execFile } = await import("node:child_process");
|
|
17407
17565
|
const { promisify } = await import("node:util");
|
|
17408
|
-
const { getDockerCmd } = await import("./docker-cmd-
|
|
17566
|
+
const { getDockerCmd } = await import("./docker-cmd-GME6jkl9.js").then((n) => n.t);
|
|
17409
17567
|
const { stdout } = await promisify(execFile)(getDockerCmd(), ["wait", containerId], { maxBuffer: 1024 * 1024 });
|
|
17410
17568
|
const code = parseInt(stdout.trim(), 10);
|
|
17411
17569
|
return Number.isFinite(code) ? code : -1;
|
|
@@ -17415,7 +17573,7 @@ const EXIT_LOG_TAIL_LINES = 50;
|
|
|
17415
17573
|
const defaultReadContainerLogsImpl = async (containerId) => {
|
|
17416
17574
|
const { execFile } = await import("node:child_process");
|
|
17417
17575
|
const { promisify } = await import("node:util");
|
|
17418
|
-
const { getDockerCmd } = await import("./docker-cmd-
|
|
17576
|
+
const { getDockerCmd } = await import("./docker-cmd-GME6jkl9.js").then((n) => n.t);
|
|
17419
17577
|
const { stdout, stderr } = await promisify(execFile)(getDockerCmd(), [
|
|
17420
17578
|
"logs",
|
|
17421
17579
|
"--tail",
|
|
@@ -19950,6 +20108,7 @@ async function resolveAlbLambdaTargetEnv(plan, options, extraStateProviders) {
|
|
|
19950
20108
|
if (lambdas.size === 0) return out;
|
|
19951
20109
|
const effectiveAssumeRole = resolveEcsAssumeRoleOption(options);
|
|
19952
20110
|
const envOptions = {
|
|
20111
|
+
...hostStateSourceFields(options, extraStateProviders),
|
|
19953
20112
|
...options.fromCfnStack !== void 0 && { fromCfnStack: options.fromCfnStack },
|
|
19954
20113
|
...effectiveAssumeRole !== void 0 && { assumeRole: effectiveAssumeRole },
|
|
19955
20114
|
...options.region !== void 0 && { region: options.region },
|
|
@@ -22642,7 +22801,7 @@ async function handleRequest$1(req, res, state, lambdaInvokers, edgeInvokers, s3
|
|
|
22642
22801
|
if (!assoc) continue;
|
|
22643
22802
|
const invoke = edgeInvokers.get(assoc.functionLogicalId);
|
|
22644
22803
|
if (!invoke) {
|
|
22645
|
-
logger.warn(`Lambda@Edge ${eventType} function '${assoc.functionLogicalId}' was not booted (added after start-up); skipping. Restart start-cloudfront.`);
|
|
22804
|
+
logger.warn(`Lambda@Edge ${eventType} function '${assoc.functionLogicalId}' was not booted (it failed to boot at start-up, see the boot warning, or was added after start-up); skipping. Restart start-cloudfront.`);
|
|
22646
22805
|
continue;
|
|
22647
22806
|
}
|
|
22648
22807
|
if (assoc.includeBody && edgeInput.body === void 0) edgeInput = {
|
|
@@ -22738,7 +22897,7 @@ async function handleRequest$1(req, res, state, lambdaInvokers, edgeInvokers, s3
|
|
|
22738
22897
|
async function runEdgeResponseStage(assoc, eventType, ctx, edgeInvokers, logger) {
|
|
22739
22898
|
const invoke = edgeInvokers.get(assoc.functionLogicalId);
|
|
22740
22899
|
if (!invoke) {
|
|
22741
|
-
logger.warn(`Lambda@Edge ${eventType} function '${assoc.functionLogicalId}' was not booted (added after start-up); skipping. Restart start-cloudfront.`);
|
|
22900
|
+
logger.warn(`Lambda@Edge ${eventType} function '${assoc.functionLogicalId}' was not booted (it failed to boot at start-up, see the boot warning, or was added after start-up); skipping. Restart start-cloudfront.`);
|
|
22742
22901
|
return;
|
|
22743
22902
|
}
|
|
22744
22903
|
return applyEdgeResponseResult(await invoke(buildEdgeResponseEvent({
|
|
@@ -23214,10 +23373,16 @@ async function attachKvsModules(distribution, stacks, options, profileCredential
|
|
|
23214
23373
|
const stack = stacks.find((s) => s.stackName === distribution.stackName);
|
|
23215
23374
|
const synthRegion = stack?.region;
|
|
23216
23375
|
const kvsFiles = stack ? normalizeKvsFileKeys(parseKvsFileOverrides(options.kvsFile), stack.template) : parseKvsFileOverrides(options.kvsFile);
|
|
23217
|
-
const resolveDeployedKvs =
|
|
23376
|
+
const resolveDeployedKvs = isStateSourceActive(options, extraStateProviders) ? async (kvsLogicalId) => {
|
|
23218
23377
|
const provider = createLocalStateProvider(options, distribution.stackName, synthRegion, extraStateProviders);
|
|
23219
23378
|
if (!provider) return void 0;
|
|
23220
|
-
|
|
23379
|
+
let record;
|
|
23380
|
+
try {
|
|
23381
|
+
record = await provider.load(distribution.stackName, synthRegion);
|
|
23382
|
+
} finally {
|
|
23383
|
+
provider.dispose();
|
|
23384
|
+
}
|
|
23385
|
+
const physicalId = record?.resources[kvsLogicalId]?.physicalId;
|
|
23221
23386
|
if (!physicalId) return void 0;
|
|
23222
23387
|
if (physicalId.startsWith("arn:")) {
|
|
23223
23388
|
const id = idFromArn(physicalId);
|
|
@@ -23285,7 +23450,7 @@ async function bootLambdaUrlOrigins(distribution, stacks, opts) {
|
|
|
23285
23450
|
let runner;
|
|
23286
23451
|
try {
|
|
23287
23452
|
const lambda = resolveLambdaTarget(functionLogicalId, stacks);
|
|
23288
|
-
const containerEnv = await resolveLambdaContainerEnv(lambda, opts.envOptions, opts.profileCredentials);
|
|
23453
|
+
const containerEnv = await resolveLambdaContainerEnv(lambda, opts.envOptions, opts.profileCredentials, opts.extraStateProviders);
|
|
23289
23454
|
runner = createFrontDoorLambdaRunner(lambda, {
|
|
23290
23455
|
containerHost: opts.containerHost,
|
|
23291
23456
|
skipPull: opts.skipPull,
|
|
@@ -23324,7 +23489,7 @@ async function bootLambdaEdgeFunctions(distribution, stacks, opts) {
|
|
|
23324
23489
|
}
|
|
23325
23490
|
for (const functionLogicalId of functionLogicalIds) try {
|
|
23326
23491
|
const lambda = resolveLambdaTarget(functionLogicalId, stacks);
|
|
23327
|
-
const containerEnv = await resolveLambdaContainerEnv(lambda, opts.envOptions, opts.profileCredentials);
|
|
23492
|
+
const containerEnv = await resolveLambdaContainerEnv(lambda, opts.envOptions, opts.profileCredentials, opts.extraStateProviders);
|
|
23328
23493
|
const runner = createFrontDoorLambdaRunner(lambda, {
|
|
23329
23494
|
containerHost: opts.containerHost,
|
|
23330
23495
|
skipPull: opts.skipPull,
|
|
@@ -23344,25 +23509,53 @@ async function bootLambdaEdgeFunctions(distribution, stacks, opts) {
|
|
|
23344
23509
|
runners
|
|
23345
23510
|
};
|
|
23346
23511
|
}
|
|
23347
|
-
function
|
|
23512
|
+
function buildLambdaEnvOptions(options, extraStateProviders) {
|
|
23513
|
+
return {
|
|
23514
|
+
...hostStateSourceFields(options, extraStateProviders),
|
|
23515
|
+
...options.fromCfnStack !== void 0 && { fromCfnStack: options.fromCfnStack },
|
|
23516
|
+
...options.assumeRole !== void 0 && { assumeRole: options.assumeRole },
|
|
23517
|
+
...options.region !== void 0 && { region: options.region },
|
|
23518
|
+
...options.profile !== void 0 && { profile: options.profile },
|
|
23519
|
+
...options.stackRegion !== void 0 && { stackRegion: options.stackRegion }
|
|
23520
|
+
};
|
|
23521
|
+
}
|
|
23522
|
+
function buildLambdaBootOptions(options, profileCredentials, extraStateProviders) {
|
|
23523
|
+
return {
|
|
23524
|
+
containerHost: options.host,
|
|
23525
|
+
skipPull: options.pull === false,
|
|
23526
|
+
envOptions: buildLambdaEnvOptions(options, extraStateProviders),
|
|
23527
|
+
...profileCredentials !== void 0 && { profileCredentials },
|
|
23528
|
+
...extraStateProviders !== void 0 && { extraStateProviders }
|
|
23529
|
+
};
|
|
23530
|
+
}
|
|
23531
|
+
function warnUnsupported(distribution, extraStateProviders) {
|
|
23348
23532
|
const logger = getLogger();
|
|
23349
23533
|
for (const origin of distribution.origins.values()) if (origin.kind === "custom") logger.warn(`Origin '${origin.originId}' is a custom (non-S3, non-Lambda-Function-URL) origin (${origin.domainName}); ${getEmbedConfig().cliName} start-cloudfront serves S3 origins and Lambda Function URL origins only. Requests routed to it return 502.`);
|
|
23350
|
-
else if (origin.kind === "s3-unresolved") logger.warn(`Origin '${origin.originId}' is an S3 origin with no resolvable local source (no BucketDeployment found, or its source could not be located in the cloud assembly). Pass
|
|
23534
|
+
else if (origin.kind === "s3-unresolved") logger.warn(`Origin '${origin.originId}' is an S3 origin with no resolvable local source (no BucketDeployment found, or its source could not be located in the cloud assembly). Pass ${stateSourceFlagNames(extraStateProviders).join(" or ")} to serve the deployed bucket from real S3 on demand, or point it at a local directory with --origin ${origin.originId}=<dir>. Requests routed to it return 502.`);
|
|
23351
23535
|
}
|
|
23352
|
-
function warnUnusedCacheOrigin(options) {
|
|
23353
|
-
if (options.cacheOrigin === true && !
|
|
23536
|
+
function warnUnusedCacheOrigin(options, extraStateProviders) {
|
|
23537
|
+
if (options.cacheOrigin === true && !isStateSourceActive(options, extraStateProviders)) {
|
|
23538
|
+
const flags = stateSourceFlagNames(extraStateProviders).join(" or ");
|
|
23539
|
+
getLogger().warn(`--cache-origin has no effect without ${flags}: it caches a deployed-S3 read-through origin, which is only built under a state source. A local BucketDeployment / --origin <id>=<dir> origin serves from disk and is not cached. Pass ${flags} to enable the deployed-S3 origin (then --cache-origin applies), or drop --cache-origin.`);
|
|
23540
|
+
}
|
|
23354
23541
|
}
|
|
23355
23542
|
async function resolveDeployedS3Origins(distribution, stacks, options, profileCredentials, logger, extraStateProviders) {
|
|
23356
23543
|
const readers = /* @__PURE__ */ new Map();
|
|
23357
23544
|
const buckets = /* @__PURE__ */ new Map();
|
|
23358
|
-
|
|
23545
|
+
const stateFlag = activeStateSourceFlag(options, extraStateProviders);
|
|
23546
|
+
if (stateFlag === void 0) return {
|
|
23359
23547
|
readers,
|
|
23360
23548
|
buckets
|
|
23361
23549
|
};
|
|
23362
23550
|
const synthRegion = stacks.find((s) => s.stackName === distribution.stackName)?.region;
|
|
23363
|
-
const region = options.stackRegion ?? options.region ?? synthRegion;
|
|
23364
23551
|
const provider = createLocalStateProvider(options, distribution.stackName, synthRegion, extraStateProviders);
|
|
23365
|
-
|
|
23552
|
+
let record;
|
|
23553
|
+
try {
|
|
23554
|
+
record = provider ? await provider.load(distribution.stackName, synthRegion) : void 0;
|
|
23555
|
+
} finally {
|
|
23556
|
+
provider?.dispose();
|
|
23557
|
+
}
|
|
23558
|
+
const region = options.stackRegion ?? options.region ?? synthRegion ?? record?.region;
|
|
23366
23559
|
const distributionId = record?.resources[distribution.logicalId]?.physicalId;
|
|
23367
23560
|
for (const origin of [...distribution.origins.values()]) {
|
|
23368
23561
|
if (origin.kind !== "s3-unresolved") continue;
|
|
@@ -23394,7 +23587,7 @@ async function resolveDeployedS3Origins(distribution, stacks, options, profileCr
|
|
|
23394
23587
|
originId: origin.originId,
|
|
23395
23588
|
bucketName
|
|
23396
23589
|
});
|
|
23397
|
-
logger.info(`Origin '${origin.originId}': no local BucketDeployment source; serving from deployed S3 (bucket=${bucketName}, resolved via ${via}) on demand under
|
|
23590
|
+
logger.info(`Origin '${origin.originId}': no local BucketDeployment source; serving from deployed S3 (bucket=${bucketName}, resolved via ${via}) on demand under ${stateFlag}.`);
|
|
23398
23591
|
}
|
|
23399
23592
|
return {
|
|
23400
23593
|
readers,
|
|
@@ -23457,22 +23650,10 @@ async function localStartCloudFrontCommand(target, options, extraStateProviders,
|
|
|
23457
23650
|
const initial = await synthAndResolve();
|
|
23458
23651
|
const profileCredentials = options.profile ? await resolveProfileCredentials(options.profile) : void 0;
|
|
23459
23652
|
const deployedS3 = await resolveDeployedS3Origins(initial.distribution, initial.stacks, options, profileCredentials, logger, extraStateProviders);
|
|
23460
|
-
warnUnsupported(initial.distribution);
|
|
23461
|
-
warnUnusedCacheOrigin(options);
|
|
23462
|
-
const envOptions = {
|
|
23463
|
-
...options.fromCfnStack !== void 0 && { fromCfnStack: options.fromCfnStack },
|
|
23464
|
-
...options.assumeRole !== void 0 && { assumeRole: options.assumeRole },
|
|
23465
|
-
...options.region !== void 0 && { region: options.region },
|
|
23466
|
-
...options.profile !== void 0 && { profile: options.profile },
|
|
23467
|
-
...options.stackRegion !== void 0 && { stackRegion: options.stackRegion }
|
|
23468
|
-
};
|
|
23653
|
+
warnUnsupported(initial.distribution, extraStateProviders);
|
|
23654
|
+
warnUnusedCacheOrigin(options, extraStateProviders);
|
|
23469
23655
|
await attachKvsModules(initial.distribution, initial.stacks, options, profileCredentials, logger, extraStateProviders);
|
|
23470
|
-
const bootOpts =
|
|
23471
|
-
containerHost: options.host,
|
|
23472
|
-
skipPull: options.pull === false,
|
|
23473
|
-
envOptions,
|
|
23474
|
-
...profileCredentials !== void 0 && { profileCredentials }
|
|
23475
|
-
};
|
|
23656
|
+
const bootOpts = buildLambdaBootOptions(options, profileCredentials, extraStateProviders);
|
|
23476
23657
|
const { invokers: lambdaInvokers, runners: lambdaRunners } = await bootLambdaUrlOrigins(initial.distribution, initial.stacks, bootOpts);
|
|
23477
23658
|
const { invokers: edgeInvokers, runners: edgeRunners } = await bootLambdaEdgeFunctions(initial.distribution, initial.stacks, bootOpts);
|
|
23478
23659
|
let server;
|
|
@@ -23517,7 +23698,7 @@ async function localStartCloudFrontCommand(target, options, extraStateProviders,
|
|
|
23517
23698
|
const reloaded = await synthAndResolve();
|
|
23518
23699
|
annotateDeployedS3Origins(reloaded.distribution, deployedS3.buckets);
|
|
23519
23700
|
for (const reader of deployedS3.readers.values()) reader.clearCache();
|
|
23520
|
-
warnUnsupported(reloaded.distribution);
|
|
23701
|
+
warnUnsupported(reloaded.distribution, extraStateProviders);
|
|
23521
23702
|
await attachKvsModules(reloaded.distribution, reloaded.stacks, options, profileCredentials, logger, extraStateProviders);
|
|
23522
23703
|
server.update(reloaded.distribution);
|
|
23523
23704
|
logger.info("Reload complete.");
|
|
@@ -23552,7 +23733,7 @@ async function localStartCloudFrontCommand(target, options, extraStateProviders,
|
|
|
23552
23733
|
}
|
|
23553
23734
|
function createLocalStartCloudFrontCommand(opts = {}) {
|
|
23554
23735
|
setEmbedConfig(opts.embedConfig);
|
|
23555
|
-
const cmd = new Command("start-cloudfront").description("Run a long-running local server that serves a CloudFront distribution: its S3 origin content (resolved from the BucketDeployment source in the cloud assembly) and its Lambda Function URL origins (the backing Lambda is run locally via RIE), plus its viewer-request / viewer-response CloudFront Functions, reproducing the distribution routing locally so a rewrite / routing change is verifiable in seconds. Serves S3 and Lambda Function URL origins
|
|
23736
|
+
const cmd = new Command("start-cloudfront").description("Run a long-running local server that serves a CloudFront distribution: its S3 origin content (resolved from the BucketDeployment source in the cloud assembly) and its Lambda Function URL origins (the backing Lambda is run locally via RIE), plus its viewer-request / viewer-response CloudFront Functions, reproducing the distribution routing locally so a rewrite / routing change is verifiable in seconds. Serves S3 and Lambda Function URL origins, and runs Lambda@Edge functions in local RIE containers. Both Lambda kinds need Docker: a Function URL origin that fails to boot stops start-up, while a Lambda@Edge function that fails to boot is warn-and-skipped (its stage does not run). Other custom origins are not run (warn-and-skip; requests routed to one return 502). Tip: omit the target in a terminal to pick interactively.").argument("[target]", "CloudFront distribution to serve. Accepts the CDK Construct path ('MyStack/MyDist'), an ancestor prefix, or the stack-qualified logical id ('MyStack:MyDist'). When omitted in a TTY, an interactive picker opens.").action(withErrorHandling(async (target, options) => {
|
|
23556
23737
|
await localStartCloudFrontCommand(target, options, opts.extraStateProviders, opts.synthesizer);
|
|
23557
23738
|
}));
|
|
23558
23739
|
addStartCloudFrontSpecificOptions(cmd);
|
|
@@ -29527,4 +29708,4 @@ function addStudioSpecificOptions(cmd) {
|
|
|
29527
29708
|
|
|
29528
29709
|
//#endregion
|
|
29529
29710
|
export { applyEdgeResponseResult as $, buildJwksUrlFromIssuer as $n, resolveCfnStackName as $r, buildCloudMapIndex as $t, startAgentCoreHttpServer as A, DynamicReferenceResolver as Ai, classifySourceChange as An, ConnectionRegistry as Ar, addRunTaskSpecificOptions as At, idFromArn as B, resolveProfileCredentials as Bi, buildStageMap as Bn, resolveRuntimeFileExtension as Br, resolveEcsAssumeRoleOption as Bt, addListSpecificOptions as C, resolveAgentCoreTarget as Ci, waitForAgentCorePing as Cn, tryParseStatus as Cr, parseLbPortOverrides as Ct, createLocalStartAgentCoreCommand as D, tryResolveImageFnJoin as Di, computeCodeImageTag as Dn, probeHostGatewaySupport as Dr, addStartServiceSpecificOptions as Dt, addStartAgentCoreSpecificOptions as E, substituteImagePlaceholders as Ei, buildAgentCoreCodeImage as En, HOST_GATEWAY_MIN_VERSION as Er, resolveAlbFrontDoor as Et, createLocalStartCloudFrontCommand as F, keysOverriddenBy as Fi, createWatchPredicates as Fn, buildDisconnectEvent as Fr, addImageOverrideOptions as Ft, classifyS3Error as G, filterRoutesByApiIdentifiers as Gn, substituteEnvVarsFromState as Gr, enforceImageOverrideOrphans as Gt, createDeployedKvsDataSource as H, isProxyEnvConfigured as Hi, resolveEnvVars$1 as Hn, EcsTaskResolutionError as Hr, runEcsServiceEmulator as Ht, normalizeKvsFileKeys as I, parseDynamicReference as Ii, resolveApiTargetSubset as In, buildMessageEvent as Ir, buildEcsImageResolutionContext$1 as It, startCloudFrontServer as J, startApiServer as Jn, createLocalStateProvider as Jr, resolveImageOverrides as Jt, createS3OriginReader as K, groupRoutesByServer as Kn, substituteEnvVarsFromStateAsync as Kr, mergeForService as Kt, parseKvsFileOverrides as L, resolveDynamicReferencesInEnv as Li, createAuthorizerCache as Ln, architectureToPlatform as Lr, ecsClusterOption as Lt, startAgentCoreWsBridge as M, deployedFillMayBeSecret as Mi, createLocalInvokeCommand as Mn, handleConnectionsRequest as Mr, MAX_TASKS_SUBNET_RANGE_CAP as Mt, LocalStartCloudFrontError as N, firstUsableRegion as Ni, addStartApiSpecificOptions as Nn, parseConnectionsPath as Nr, addCommonEcsServiceOptions as Nt, buildAgentCoreServeAuthCheck as O, LocalInvokeBuildError as Oi, renderCodeDockerfile as On, resolveHostGatewayExtraHosts as Or, createLocalStartServiceCommand as Ot, addStartCloudFrontSpecificOptions as P, keysNotFromTemplate as Pi, createLocalStartApiCommand as Pn, buildConnectEvent as Pr, addEcsAssumeRoleOptions as Pt, applyEdgeRequestResult as Q, buildCognitoJwksUrl as Qn, resolveCfnRegion as Qr, listPinnedTargets as Qt, parseOriginOverrides as R, withoutKeys as Ri, createFileWatcher as Rn, buildContainerImage as Rr, parseMaxTasks as Rt, StudioEventBus as S, pickAgentCoreCandidateStack as Si, waitForAgentCoreHttpReady as Sn, selectIntegrationResponse as Sr, createLocalStartAlbCommand as St, formatTargetListing as T, formatStateRemedy as Ti, SUPPORTED_CODE_RUNTIMES as Tn, HOST_DOCKER_INTERNAL_GATEWAY as Tr, isApplicationLoadBalancer as Tt, resolveDeployedKvsArnByName as U, availableApiIdentifiers as Un, substituteAgainstState as Ur, ImageOverrideError as Ut, resolveKvsModulesForDistribution as V, buildProxyClientConfig as Vi, materializeLayerFromArn as Vn, resolveRuntimeImage as Vr, resolveSharedSidecarCredentials as Vt, resolveDeployedOriginBucket as W, filterRoutesByApiIdentifier as Wn, substituteAgainstStateAsync as Wr, buildImageOverrideTag as Wt, serveFromStaticOrigin as X, resolveServiceIntegrationParameters as Xn, rejectExplicitCfnStackWithMultipleStacks as Xr, describePinnedImageUri as Xt, resolveErrorResponseCandidates as Y, resolveSelectionExpression as Yn, isCfnFlagPresent as Yr, runImageOverrideBuilds as Yt, serveLambdaUrlOrigin as Z, defaultCredentialsLoader as Zn, resolveCfnFallbackRegion as Zr, isLocalCdkAssetImage as Zt, filterStudioTargetGroups as _, AGENTCORE_AGUI_PROTOCOL as _i, parseSseForJsonRpc as _n, applyAuthorizerOverlay as _r, createCloudFrontModule as _t, createLocalStudioCommand as a, countTargets as ai, attachContainerLogStreamer as an, computeRequestIdentityHash as ar, describeS3OriginDomain as at, renderStudioHtml as b, AGENTCORE_RUNTIME_TYPE as bi, AGENTCORE_SESSION_ID_HEADER as bn, evaluateResponseParameters as br, addAlbSpecificOptions as bt, startStudioProxy as c, discoverWebSocketApis as ci, bridgeAgentCoreWs as cn, invokeTokenAuthorizer as cr, pickFunctionUrlLogicalIdFromOrigin as ct, createStudioDispatcher as d, parseSelectionExpressionPath as di, A2A_PATH as dn, buildCorsConfigByApiId as dr, pickTargetFunctionLogicalId as dt, CfnLocalStateProvider as ei, CloudMapRegistry as en, createJwksCache as er, buildEdgeRequestEvent as et, filterStudioCustomResources as f, webSocketApiMatchesIdentifier as fi, a2aInvokeOnce as fn, buildCorsConfigFromCloudFrontChain as fr, resolveCloudFrontDistribution as ft, annotatePinnedEcsTargets as g, AGENTCORE_A2A_PROTOCOL as gi, mcpInvokeOnce as gn, translateLambdaResponse as gr, stripCloudFrontImport as gt, annotateEcsTaskPinnedTargets as h, resolveLambdaArnIntrinsic as hi, MCP_PROTOCOL_VERSION as hn, matchRoute as hr, runViewerResponse as ht, coerceStopRequest as i, resolveSingleTarget as ii, getContainerNetworkIp as in, buildMethodArn as ir, CLOUDFRONT_DISTRIBUTION_TYPE as it, attachAgentCoreWsBridge as j, containsDynamicReference as ji, addInvokeSpecificOptions as jn, buildMgmtEndpointEnvUrl as jr, createLocalRunTaskCommand as jt, selectServeInboundAuth as k, DynamicReferenceResolutionError as ki, toCmdArgv as kn, bufferToBody as kr, serviceStrategy as kt, relayServeRequest as l, discoverWebSocketApisOrThrow as li, invokeAgentCoreWs as ln, attachAuthorizers as lr, pickKvsLogicalIdFromArn as lt, annotateAlbPinnedBackingServices as m, pickRefLogicalId as mi, MCP_PATH as mn, matchPreflight as mr, runViewerRequest as mt, coerceRunRequest as n, resolveSsmParameters as ni, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as nn, verifyJwtAuthorizer as nr, edgeHeadersToHttp as nt, resolveServeBaseUrl as o, listTargets as oi, addInvokeAgentCoreSpecificOptions as on, evaluateCachedLambdaPolicy as or, extractKvsAssociations as ot, isCustomResourceLambdaTarget as p, discoverRoutes as pi, MCP_CONTAINER_PORT as pn, isFunctionUrlOacFronted as pr, compileCloudFrontFunction as pt, matchBehavior as q, readMtlsMaterialsFromDisk as qn, LocalStateSourceError as qr, parseImageOverrideFlags as qt, coerceServeRequest as r, resolveWatchConfig as ri, setShadowReadyTimeoutMs as rn, verifyJwtViaDiscovery as rr, httpHeadersToEdge as rt, createStudioServeManager as s, availableWebSocketApiIdentifiers as si, createLocalInvokeAgentCoreCommand as sn, invokeRequestAuthorizer as sr, isCloudFrontDistribution as st, addStudioSpecificOptions as t, collectSsmParameterRefs as ti, DEFAULT_SHADOW_READY_TIMEOUT_MS as tn, verifyCognitoJwt as tr, buildEdgeResponseEvent as tt, reinvoke as u, filterWebSocketApisByIdentifiers as ui, A2A_CONTAINER_PORT as un, applyCorsResponseHeaders as ur, pickLambdaEdgeFunctionLogicalId as ut, startStudioServer as v, AGENTCORE_HTTP_PROTOCOL as vi, AGENTCORE_SIGV4_SERVICE as vn, buildHttpApiV2Event as vr, createLocalFileKvsDataSource as vt, createLocalListCommand as w, derivePseudoParametersFromRegion as wi, downloadAndExtractS3Bundle as wn, VtlEvaluationError as wr, resolveAlbTarget as wt, createStudioStore as x, AgentCoreResolutionError as xi, invokeAgentCore as xn, pickResponseTemplate as xr, albStrategy as xt, toStudioTargetGroups as y, AGENTCORE_MCP_PROTOCOL as yi, signAgentCoreInvocation as yn, buildRestV1Event as yr, createUnboundCloudFrontModule as yt, resolveCloudFrontTarget as z, buildStsClientConfig as zi, attachStageContext as zn, resolveRuntimeCodeMountPath as zr, parseRestartPolicy as zt };
|
|
29530
|
-
//# sourceMappingURL=local-studio-
|
|
29711
|
+
//# sourceMappingURL=local-studio-a7HMFLOC.js.map
|