cdk-local 0.166.2 → 0.166.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{aws-proxy-D9ll_XO6.js → aws-proxy-Cml7xM3y.js} +34 -2
- package/dist/{aws-proxy-D9ll_XO6.js.map → aws-proxy-Cml7xM3y.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +7 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +3 -3
- package/dist/{local-studio-B42CkNWX.d.ts → local-studio-D6Qd0GIc.d.ts} +10 -3
- package/dist/{local-studio-B42CkNWX.d.ts.map → local-studio-D6Qd0GIc.d.ts.map} +1 -1
- package/dist/{local-studio-BK2wPCoQ.js → local-studio-DC3gGXhH.js} +346 -38
- package/dist/local-studio-DC3gGXhH.js.map +1 -0
- package/package.json +1 -1
- package/dist/local-studio-BK2wPCoQ.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
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-pRhBzMui.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as formatAuthority, B as describeAwsFailureForWarn, C as isLegacyAwsEmulatorSentinel, D as realAwsEndpointFor, E as readAwsEmulatorEnvVarsFile, F as isPasteableCommandArg, G as stringifyThrown, H as flattenToOneLine, I as namesTheSameDirectory, J as readEnvVarsFileText, L as renderAssemblyPathEscape, M as absoluteAssemblyPathEscape, N as assemblyPathEscape, P as displayUntrustedValue, Q as isWildcardHostname, R as resolveAssemblyPath, T as legacyAwsEmulatorSentinelMessage, U as isAwsServiceException, V as describeCredentialLoadFailure, W as sanitizeServiceExceptionMessage, X as defineOwnKey, Y as resolveEnvVars$1, Z as isLoopbackHostname, _ as MIXED_MODE_RESIGN_PORT, a as buildProxyRequestHandler, b as describeRealAwsExceptions, c as getAwsEmulatorServiceRouting, et as formatHostForAuthority, h as setAwsEndpointOverride, i as buildProxyClientConfig, j as validateAwsEmulatorEnvVars, k as realAwsServicesOf, l as getAwsEndpointOverride, m as setAwsEmulatorServiceRouting, n as awsEmulatorRealServices, o as deployArtifactClientConfig, p as proxyAwareFetch, q as applyEnvOverrideMap, r as awsEndpointOverrideClientConfig, s as deployArtifactsReadEmulator, tt as hostFromAuthority, u as isAwsServiceRoutedToEmulator, v as REAL_AWS_SENTINEL, w as isRealAwsSentinel, y as createMixedModeStateProvider, z as clampErrorName } from "./aws-proxy-Cml7xM3y.js";
|
|
3
3
|
import { chmodSync, cpSync, createWriteStream, existsSync, lstatSync, mkdirSync, mkdtempSync, promises, readFileSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { Command, InvalidArgumentError, Option } from "commander";
|
|
5
5
|
import { AssumeRoleCommand, GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
@@ -293,6 +293,116 @@ function buildJavaTrustStore(pems, aliasPrefix = "cdk-local") {
|
|
|
293
293
|
return seq(integer(Buffer.from([3])), seq(oid(OID_PKCS7_DATA), explicit(0, octets(authSafe))));
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
// src/local/aws-emulator-sqs-routing.ts
|
|
297
|
+
const REAL_SQS_QUEUE_URL = /^https?:\/\/(?:sqs\.[a-z0-9-]+|[a-z0-9-]+\.queue|queue)\.amazonaws\.com(?:\.cn)?\/([0-9]{12}\/[A-Za-z0-9_-]{1,80}(?:\.fifo)?)$/;
|
|
298
|
+
const SQS_BLOCKED_REGIONS = [
|
|
299
|
+
"af-south-1",
|
|
300
|
+
"ap-east-1",
|
|
301
|
+
"ap-east-2",
|
|
302
|
+
"ap-northeast-1",
|
|
303
|
+
"ap-northeast-2",
|
|
304
|
+
"ap-northeast-3",
|
|
305
|
+
"ap-south-1",
|
|
306
|
+
"ap-south-2",
|
|
307
|
+
"ap-southeast-1",
|
|
308
|
+
"ap-southeast-2",
|
|
309
|
+
"ap-southeast-3",
|
|
310
|
+
"ap-southeast-4",
|
|
311
|
+
"ap-southeast-5",
|
|
312
|
+
"ap-southeast-6",
|
|
313
|
+
"ap-southeast-7",
|
|
314
|
+
"ca-central-1",
|
|
315
|
+
"ca-west-1",
|
|
316
|
+
"cn-north-1",
|
|
317
|
+
"cn-northwest-1",
|
|
318
|
+
"eu-central-1",
|
|
319
|
+
"eu-central-2",
|
|
320
|
+
"eu-north-1",
|
|
321
|
+
"eu-south-1",
|
|
322
|
+
"eu-south-2",
|
|
323
|
+
"eu-west-1",
|
|
324
|
+
"eu-west-2",
|
|
325
|
+
"eu-west-3",
|
|
326
|
+
"il-central-1",
|
|
327
|
+
"me-central-1",
|
|
328
|
+
"me-south-1",
|
|
329
|
+
"mx-central-1",
|
|
330
|
+
"sa-east-1",
|
|
331
|
+
"us-east-1",
|
|
332
|
+
"us-east-2",
|
|
333
|
+
"us-gov-east-1",
|
|
334
|
+
"us-gov-west-1",
|
|
335
|
+
"us-west-1",
|
|
336
|
+
"us-west-2"
|
|
337
|
+
];
|
|
338
|
+
const REGION_SHAPE$1 = /^[a-z]{2}(-[a-z]+)+-\d+$/;
|
|
339
|
+
function isRealAwsHost(hostname) {
|
|
340
|
+
const h = hostname.toLowerCase().replace(/\.$/, "");
|
|
341
|
+
return /(^|\.)amazonaws\.com(\.cn)?$/.test(h) || /(^|\.)api\.aws$/.test(h);
|
|
342
|
+
}
|
|
343
|
+
function sqsEmulatorOriginOf(env) {
|
|
344
|
+
const endpoint = env["AWS_ENDPOINT_URL_SQS"] || env["AWS_ENDPOINT_URL"];
|
|
345
|
+
if (!endpoint) return void 0;
|
|
346
|
+
let url;
|
|
347
|
+
try {
|
|
348
|
+
url = new URL(endpoint.trim());
|
|
349
|
+
} catch {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
if (url.protocol !== "https:" && url.protocol !== "http:") return void 0;
|
|
353
|
+
if (isRealAwsHost(url.hostname)) return void 0;
|
|
354
|
+
return url.origin;
|
|
355
|
+
}
|
|
356
|
+
function rewriteSqsQueueUrlsInEnv(env, origin) {
|
|
357
|
+
const keys = [];
|
|
358
|
+
for (const [k, v] of Object.entries(env)) {
|
|
359
|
+
if (typeof v !== "string") continue;
|
|
360
|
+
const m = REAL_SQS_QUEUE_URL.exec(v.trim());
|
|
361
|
+
if (!m) continue;
|
|
362
|
+
env[k] = `${origin}/${m[1]}`;
|
|
363
|
+
keys.push(k);
|
|
364
|
+
}
|
|
365
|
+
return keys;
|
|
366
|
+
}
|
|
367
|
+
function repointLocalSqsQueueUrlsInEnv(env, fromOrigin, toOrigin) {
|
|
368
|
+
const from = new URL(fromOrigin).origin;
|
|
369
|
+
for (const [k, v] of Object.entries(env)) {
|
|
370
|
+
if (typeof v !== "string" || !v.startsWith(`${from}/`)) continue;
|
|
371
|
+
const rest = v.slice(from.length + 1);
|
|
372
|
+
if (/^[0-9]{12}\/[A-Za-z0-9_-]{1,80}(?:\.fifo)?$/.test(rest)) env[k] = `${toOrigin}/${rest}`;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function regionOfSqsHost(hostname) {
|
|
376
|
+
const m = /^(?:sqs\.([a-z0-9-]+)|([a-z0-9-]+)\.queue)\.amazonaws\.com(?:\.cn)?$/.exec(hostname);
|
|
377
|
+
const region = m?.[1] ?? m?.[2];
|
|
378
|
+
return region && REGION_SHAPE$1.test(region) ? region : void 0;
|
|
379
|
+
}
|
|
380
|
+
function realSqsHostnames(regions) {
|
|
381
|
+
const out = /* @__PURE__ */ new Set(["queue.amazonaws.com"]);
|
|
382
|
+
for (const r of regions) {
|
|
383
|
+
if (!REGION_SHAPE$1.test(r)) continue;
|
|
384
|
+
const suffix = r.startsWith("cn-") ? "amazonaws.com.cn" : "amazonaws.com";
|
|
385
|
+
out.add(`sqs.${r}.${suffix}`);
|
|
386
|
+
out.add(`${r}.queue.${suffix}`);
|
|
387
|
+
}
|
|
388
|
+
return [...out].sort();
|
|
389
|
+
}
|
|
390
|
+
function sqsBlockedRegionsFor(env) {
|
|
391
|
+
const regions = new Set(SQS_BLOCKED_REGIONS);
|
|
392
|
+
for (const k of ["AWS_REGION", "AWS_DEFAULT_REGION"]) {
|
|
393
|
+
const r = env[k]?.trim();
|
|
394
|
+
if (r && REGION_SHAPE$1.test(r)) regions.add(r);
|
|
395
|
+
}
|
|
396
|
+
for (const v of Object.values(env)) {
|
|
397
|
+
if (typeof v !== "string") continue;
|
|
398
|
+
for (const m of v.matchAll(/https?:\/\/([a-z0-9.-]+)\//gi)) {
|
|
399
|
+
const r = regionOfSqsHost(m[1].toLowerCase());
|
|
400
|
+
if (r) regions.add(r);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return [...regions];
|
|
404
|
+
}
|
|
405
|
+
|
|
296
406
|
// src/local/emulator-resign-sidecar.ts
|
|
297
407
|
const MIXED_MODE_RESIGN_BODY_CAP_BYTES = 104857600;
|
|
298
408
|
const RESIGN_SIDECAR_CORE = String.raw`
|
|
@@ -458,7 +568,7 @@ function passthroughHeaders(incoming){
|
|
|
458
568
|
// Only a real SQS queue URL is rewritten: an AWS SQS host (either form, any
|
|
459
569
|
// partition suffix), no port, user info, query or fragment, and a path of a
|
|
460
570
|
// 12-digit account and a queue name.
|
|
461
|
-
var SQS_QUEUE_URL
|
|
571
|
+
var SQS_QUEUE_URL=/${REAL_SQS_QUEUE_URL.source}/;
|
|
462
572
|
function localQueueUrl(u,origin){var m=SQS_QUEUE_URL.exec(String(u));return m?origin+'/'+m[1]:u;}
|
|
463
573
|
var SQS_QUEUE_URL_OPERATIONS=new Set(['CreateQueue','GetQueueUrl','ListQueues','ListDeadLetterSourceQueues']);
|
|
464
574
|
// An unsigned request (an emulator run with --auth off and an SDK that signs
|
|
@@ -1239,7 +1349,7 @@ function applyWorkloadAwsWiringToEnv(env, wiring, defaultCredentials) {
|
|
|
1239
1349
|
if (ownSqsEndpoint !== void 0) out["AWS_ENDPOINT_URL_SQS"] = ownSqsEndpoint;
|
|
1240
1350
|
const javaToolOptions = wiring.env["JAVA_TOOL_OPTIONS"];
|
|
1241
1351
|
if (javaToolOptions !== void 0) out["JAVA_TOOL_OPTIONS"] = mergeJavaToolOptions(ownJavaToolOptions, javaToolOptions);
|
|
1242
|
-
setCreds(wiring.emulatorCredentials);
|
|
1352
|
+
setCreds(emulatorIssuedCredentialsIn(env) ?? wiring.emulatorCredentials);
|
|
1243
1353
|
} else if (wiring.mixed && !keepsException) {
|
|
1244
1354
|
for (const k of EMULATOR_SCRUBBED_ENV_KEYS) delete out[k];
|
|
1245
1355
|
delete out["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"];
|
|
@@ -1252,8 +1362,24 @@ function applyWorkloadAwsWiringToEnv(env, wiring, defaultCredentials) {
|
|
|
1252
1362
|
if (defaultCredentials && !out["AWS_ACCESS_KEY_ID"]) setCreds(defaultCredentials);
|
|
1253
1363
|
}
|
|
1254
1364
|
if (out["AWS_REGION"] && !out["AWS_DEFAULT_REGION"]) out["AWS_DEFAULT_REGION"] = out["AWS_REGION"];
|
|
1365
|
+
const sqsOrigin = awsEmulatorSqsOriginFor(out, wiring);
|
|
1366
|
+
if (sqsOrigin !== void 0) {
|
|
1367
|
+
const keys = rewriteSqsQueueUrlsInEnv(out, sqsOrigin);
|
|
1368
|
+
if (keys.length > 0) getLogger().debug(`--aws-emulator: SQS queue URLs in ${keys.join(", ")} now point at ${sqsOrigin} (SQS is on AWS Emulator).`);
|
|
1369
|
+
}
|
|
1255
1370
|
return out;
|
|
1256
1371
|
}
|
|
1372
|
+
function awsEmulatorSqsOriginFor(env, wiring) {
|
|
1373
|
+
if (wiring.mode !== "emulator" && !wiring.mixed) return void 0;
|
|
1374
|
+
return sqsEmulatorOriginOf(env);
|
|
1375
|
+
}
|
|
1376
|
+
function awsEmulatorSqsHostBlocks(finalEnv, wiring) {
|
|
1377
|
+
if (!wiring || awsEmulatorSqsOriginFor(finalEnv, wiring) === void 0) return [];
|
|
1378
|
+
return realSqsHostnames(sqsBlockedRegionsFor(finalEnv)).map((host) => ({
|
|
1379
|
+
host,
|
|
1380
|
+
ip: "127.0.0.1"
|
|
1381
|
+
}));
|
|
1382
|
+
}
|
|
1257
1383
|
function envKeepsRealAwsException(env) {
|
|
1258
1384
|
return Object.entries(env).some(([k, v]) => k !== "AWS_ENDPOINT_URL" && isRealAwsSentinel(k, v));
|
|
1259
1385
|
}
|
|
@@ -1306,6 +1432,35 @@ function setActiveWorkloadAwsWiring(wiring) {
|
|
|
1306
1432
|
process.once("exit", () => active?.dispose());
|
|
1307
1433
|
}
|
|
1308
1434
|
}
|
|
1435
|
+
const emulatorIssued = /* @__PURE__ */ new Map();
|
|
1436
|
+
function roleHopsGoToAwsEmulator() {
|
|
1437
|
+
return active?.mode === "emulator" && getAwsEndpointOverride() !== void 0;
|
|
1438
|
+
}
|
|
1439
|
+
function keepEmulatorIssuedCredentials(creds) {
|
|
1440
|
+
if (roleHopsGoToAwsEmulator()) emulatorIssued.set(creds.accessKeyId, {
|
|
1441
|
+
accessKeyId: creds.accessKeyId,
|
|
1442
|
+
secretAccessKey: creds.secretAccessKey,
|
|
1443
|
+
sessionToken: creds.sessionToken
|
|
1444
|
+
});
|
|
1445
|
+
return creds;
|
|
1446
|
+
}
|
|
1447
|
+
function emulatorIssuedCredentials(creds) {
|
|
1448
|
+
const id = creds?.accessKeyId;
|
|
1449
|
+
const recorded = id === void 0 ? void 0 : emulatorIssued.get(id);
|
|
1450
|
+
return recorded && recorded.secretAccessKey === creds?.secretAccessKey && recorded.sessionToken === creds.sessionToken ? recorded : void 0;
|
|
1451
|
+
}
|
|
1452
|
+
function emulatorIssuedCredentialsIn(env) {
|
|
1453
|
+
const accessKeyId = env["AWS_ACCESS_KEY_ID"];
|
|
1454
|
+
if (accessKeyId === void 0) return void 0;
|
|
1455
|
+
return emulatorIssuedCredentials({
|
|
1456
|
+
accessKeyId,
|
|
1457
|
+
secretAccessKey: env["AWS_SECRET_ACCESS_KEY"] ?? "",
|
|
1458
|
+
sessionToken: env["AWS_SESSION_TOKEN"] ?? ""
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1461
|
+
function stateRoleRecordIsEmulatorSide() {
|
|
1462
|
+
return active?.mixed !== void 0 && isAwsServiceRoutedToEmulator("IAM");
|
|
1463
|
+
}
|
|
1309
1464
|
function awsEmulatorEnvName() {
|
|
1310
1465
|
const { envPrefix } = getEmbedConfig();
|
|
1311
1466
|
return envPrefix === "CDKL" ? "CDK_LOCAL_AWS_EMULATOR" : `${envPrefix}_AWS_EMULATOR`;
|
|
@@ -1337,7 +1492,7 @@ async function activateWorkloadAwsWiring(options) {
|
|
|
1337
1492
|
override: wiring.mixed.emulatorClientOverride,
|
|
1338
1493
|
envOverrides: overrides
|
|
1339
1494
|
});
|
|
1340
|
-
getLogger().info(`Mixed mode: every AWS call goes to AWS Emulator at ${wiring.mixed.emulatorEndpoint.url} (signed with its keys) except ${
|
|
1495
|
+
if (!options.singleWorkload) getLogger().info(`Mixed mode: every AWS call goes to AWS Emulator at ${wiring.mixed.emulatorEndpoint.url} (signed with its keys), except the services --env-vars marks "${REAL_AWS_SENTINEL}" for a workload, which go to real AWS with your real credentials, for that workload and for ${getEmbedConfig().productName}'s own calls for it: ${describeRealAwsExceptions(scan.exceptions)}. A workload with no exception gets AWS Emulator's keys only.`);
|
|
1341
1496
|
} else if (wiring.mode === "emulator" && wiring.emulatorEndpoint) {
|
|
1342
1497
|
setAwsEmulatorServiceRouting(void 0);
|
|
1343
1498
|
setAwsEndpointOverride({
|
|
@@ -1352,6 +1507,17 @@ async function activateWorkloadAwsWiring(options) {
|
|
|
1352
1507
|
}
|
|
1353
1508
|
return wiring;
|
|
1354
1509
|
}
|
|
1510
|
+
function logMixedModeForWorkload(workload, label) {
|
|
1511
|
+
const mixed = active?.mixed;
|
|
1512
|
+
if (!mixed) return;
|
|
1513
|
+
const services = awsEmulatorRealServices(workload) ?? [];
|
|
1514
|
+
const at = `AWS Emulator at ${mixed.emulatorEndpoint.url}`;
|
|
1515
|
+
if (services.length === 0) {
|
|
1516
|
+
getLogger().info(`Mixed mode: ${label} keeps no "${REAL_AWS_SENTINEL}" exception in --env-vars, so every AWS call it makes goes to ${at}, with its keys only.`);
|
|
1517
|
+
return;
|
|
1518
|
+
}
|
|
1519
|
+
getLogger().info(`Mixed mode: every AWS call of ${label} goes to ${at} (signed with its keys) except ${services.join(", ")}, which go to real AWS with your real credentials, for the workload and for ${getEmbedConfig().productName}'s own calls for it.`);
|
|
1520
|
+
}
|
|
1355
1521
|
let stateSourceHintShown = false;
|
|
1356
1522
|
function takeAwsEmulatorStateSourceHint() {
|
|
1357
1523
|
const wiring = active;
|
|
@@ -1599,6 +1765,7 @@ async function emulate(args) {
|
|
|
1599
1765
|
failedRoles.add(key);
|
|
1600
1766
|
logger.warn(`${args.flag}: AssumeRole(${shownRole}) was refused, and the role's permissions cannot be emulated instead: ${reason}.`);
|
|
1601
1767
|
};
|
|
1768
|
+
if (args.emulateRoleVia === void 0 && getAwsEndpointOverride() !== void 0) return cannot("in AWS Emulator a sts:GetFederationToken session is allowed nothing (the emulator's own user has no IAM policies). Let the role's trust policy allow the emulator's identity, for example the account root (arn:aws:iam::000000000000:root), and redeploy, or pass --emulate-role-via <arn> naming an emulator role you can assume");
|
|
1602
1769
|
const { STSClient, GetCallerIdentityCommand, GetFederationTokenCommand, AssumeRoleCommand } = await import("@aws-sdk/client-sts");
|
|
1603
1770
|
const sts = new STSClient(workloadStsClientConfig({
|
|
1604
1771
|
region: args.region,
|
|
@@ -1785,7 +1952,7 @@ async function assumeRoleCredentials(opts) {
|
|
|
1785
1952
|
flag: opts.roleFlag ?? "--assume-role",
|
|
1786
1953
|
sessionNameSuffix: opts.sessionNameSuffix
|
|
1787
1954
|
});
|
|
1788
|
-
if (emulated !== void 0) return emulated;
|
|
1955
|
+
if (emulated !== void 0) return keepEmulatorIssuedCredentials(emulated);
|
|
1789
1956
|
const detail = describeAwsFailureForWarn(refused.err, "STS AssumeRole");
|
|
1790
1957
|
const message = `AssumeRole(${shownArn}) failed: ${detail}`;
|
|
1791
1958
|
throw opts.makeError ? opts.makeError(message) : new AssumeRoleFailure(message, detail);
|
|
@@ -1795,11 +1962,11 @@ async function assumeRoleCredentials(opts) {
|
|
|
1795
1962
|
const message = `AssumeRole(${shownArn}) returned no usable credentials.`;
|
|
1796
1963
|
throw opts.makeError ? opts.makeError(message) : new AssumeRoleFailure(message, "the response carried no usable credentials");
|
|
1797
1964
|
}
|
|
1798
|
-
return {
|
|
1965
|
+
return keepEmulatorIssuedCredentials({
|
|
1799
1966
|
accessKeyId: creds.AccessKeyId,
|
|
1800
1967
|
secretAccessKey: creds.SecretAccessKey,
|
|
1801
1968
|
sessionToken: creds.SessionToken
|
|
1802
|
-
};
|
|
1969
|
+
});
|
|
1803
1970
|
}
|
|
1804
1971
|
async function applyRoleArnIfSet(opts) {
|
|
1805
1972
|
const roleArn = opts.roleArn || process.env[`${getEmbedConfig().envPrefix}_ROLE_ARN`];
|
|
@@ -8889,7 +9056,13 @@ async function runDetached(opts) {
|
|
|
8889
9056
|
async function withWorkloadAwsWiring(opts, wiring) {
|
|
8890
9057
|
const defaults = wiring.mode === "forward" && !opts.env["AWS_ACCESS_KEY_ID"] ? await resolveHostDefaultCredentials() : void 0;
|
|
8891
9058
|
const env = applyWorkloadAwsWiringToEnv(opts.env, wiring, defaults);
|
|
8892
|
-
if (opts.network === "host" && wiring.sidecar?.passthrough && env["AWS_ENDPOINT_URL_SQS"] === wiring.sidecar.endpoint)
|
|
9059
|
+
if (opts.network === "host" && wiring.sidecar?.passthrough && env["AWS_ENDPOINT_URL_SQS"] === wiring.sidecar.endpoint) {
|
|
9060
|
+
delete env["AWS_ENDPOINT_URL_SQS"];
|
|
9061
|
+
const emulator = sqsEmulatorOriginOf(env);
|
|
9062
|
+
if (emulator) repointLocalSqsQueueUrlsInEnv(env, wiring.sidecar.endpoint, emulator);
|
|
9063
|
+
}
|
|
9064
|
+
const sqsBlocks = awsEmulatorSqsHostBlocks(env, wiring);
|
|
9065
|
+
const extraHosts = sqsBlocks.length > 0 ? [...opts.extraHosts ?? [], ...sqsBlocks] : opts.extraHosts;
|
|
8893
9066
|
const credsPath = `${getEmbedConfig().awsBindMountPath}/credentials`;
|
|
8894
9067
|
const emulatorOnly = workloadGetsEmulatorKeysOnly(opts.env, wiring);
|
|
8895
9068
|
const extra = (opts.extraMounts ?? []).filter((m) => !emulatorOnly || m.containerPath !== credsPath);
|
|
@@ -8901,7 +9074,8 @@ async function withWorkloadAwsWiring(opts, wiring) {
|
|
|
8901
9074
|
return {
|
|
8902
9075
|
...opts,
|
|
8903
9076
|
env,
|
|
8904
|
-
extraMounts: extra
|
|
9077
|
+
extraMounts: extra,
|
|
9078
|
+
...extraHosts ? { extraHosts } : {}
|
|
8905
9079
|
};
|
|
8906
9080
|
}
|
|
8907
9081
|
async function prepareLoopbackForwarder(wiring) {
|
|
@@ -9265,6 +9439,19 @@ function execEnvForSecrets(passthrough) {
|
|
|
9265
9439
|
return { env };
|
|
9266
9440
|
}
|
|
9267
9441
|
|
|
9442
|
+
// src/local/debug-timeout.ts
|
|
9443
|
+
const DEBUG_FUNCTION_TIMEOUT_SEC = 36e3;
|
|
9444
|
+
function applyDebuggerEnv(dockerEnv, debugPort) {
|
|
9445
|
+
dockerEnv["NODE_OPTIONS"] = `--inspect-brk=0.0.0.0:${debugPort}`;
|
|
9446
|
+
dockerEnv["AWS_LAMBDA_FUNCTION_TIMEOUT"] = String(DEBUG_FUNCTION_TIMEOUT_SEC);
|
|
9447
|
+
}
|
|
9448
|
+
function rieInvokeTimeoutMs(timeoutSec, debugging) {
|
|
9449
|
+
return Math.max(3e4, (debugging ? Math.max(timeoutSec, DEBUG_FUNCTION_TIMEOUT_SEC) : timeoutSec) * 2 * 1e3);
|
|
9450
|
+
}
|
|
9451
|
+
function debugTimeoutNotice(flag) {
|
|
9452
|
+
return `${flag}: the function Timeout is lifted to ${DEBUG_FUNCTION_TIMEOUT_SEC} seconds while debugging, so the handler waits for a debugger to attach.`;
|
|
9453
|
+
}
|
|
9454
|
+
|
|
9268
9455
|
// src/local/docker-version.ts
|
|
9269
9456
|
const HOST_GATEWAY_MIN_VERSION = {
|
|
9270
9457
|
major: 20,
|
|
@@ -9372,7 +9559,7 @@ async function invokeRie(host, port, event, timeoutMs) {
|
|
|
9372
9559
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
9373
9560
|
let response;
|
|
9374
9561
|
try {
|
|
9375
|
-
response = await fetchWithStartupRetry(url, body, controller.signal);
|
|
9562
|
+
response = await fetchWithStartupRetry(url, body, controller.signal, void 0, timeoutMs);
|
|
9376
9563
|
} catch (err) {
|
|
9377
9564
|
if (err.name === "AbortError") throw new Error(`RIE invoke at ${url} timed out after ${timeoutMs}ms. The handler may be hung; check container logs.`);
|
|
9378
9565
|
throw err;
|
|
@@ -9390,16 +9577,19 @@ async function invokeRie(host, port, event, timeoutMs) {
|
|
|
9390
9577
|
raw
|
|
9391
9578
|
};
|
|
9392
9579
|
}
|
|
9393
|
-
async function fetchWithStartupRetry(url, body, signal, extraHeaders) {
|
|
9580
|
+
async function fetchWithStartupRetry(url, body, signal, extraHeaders, timeoutMs) {
|
|
9394
9581
|
const maxAttempts = 3;
|
|
9582
|
+
const headers = {
|
|
9583
|
+
"Content-Type": "application/json",
|
|
9584
|
+
...extraHeaders
|
|
9585
|
+
};
|
|
9586
|
+
const longWait = timeoutMs !== void 0 && timeoutMs > UNDICI_DEFAULT_TIMEOUT_MS;
|
|
9395
9587
|
let lastError;
|
|
9396
9588
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) try {
|
|
9589
|
+
if (longWait) return await postWithoutClientTimeout(url, body, headers, signal);
|
|
9397
9590
|
return await fetch(url, {
|
|
9398
9591
|
method: "POST",
|
|
9399
|
-
headers
|
|
9400
|
-
"Content-Type": "application/json",
|
|
9401
|
-
...extraHeaders
|
|
9402
|
-
},
|
|
9592
|
+
headers,
|
|
9403
9593
|
body,
|
|
9404
9594
|
signal
|
|
9405
9595
|
});
|
|
@@ -9411,6 +9601,34 @@ async function fetchWithStartupRetry(url, body, signal, extraHeaders) {
|
|
|
9411
9601
|
}
|
|
9412
9602
|
throw lastError;
|
|
9413
9603
|
}
|
|
9604
|
+
const UNDICI_DEFAULT_TIMEOUT_MS = 3e5;
|
|
9605
|
+
function postWithoutClientTimeout(url, body, headers, signal) {
|
|
9606
|
+
return new Promise((resolve, reject) => {
|
|
9607
|
+
const req = request(url, {
|
|
9608
|
+
method: "POST",
|
|
9609
|
+
headers: {
|
|
9610
|
+
...headers,
|
|
9611
|
+
"Content-Length": String(Buffer.byteLength(body))
|
|
9612
|
+
},
|
|
9613
|
+
signal
|
|
9614
|
+
}, (res) => {
|
|
9615
|
+
const responseHeaders = new Headers();
|
|
9616
|
+
for (const [k, v] of Object.entries(res.headers)) {
|
|
9617
|
+
if (v === void 0) continue;
|
|
9618
|
+
for (const one of Array.isArray(v) ? v : [v]) responseHeaders.append(k, one);
|
|
9619
|
+
}
|
|
9620
|
+
const status = res.statusCode ?? 502;
|
|
9621
|
+
const nullBody = status === 204 || status === 205 || status === 304;
|
|
9622
|
+
if (nullBody) res.resume();
|
|
9623
|
+
resolve(new Response(nullBody ? null : Readable.toWeb(res), {
|
|
9624
|
+
status,
|
|
9625
|
+
headers: responseHeaders
|
|
9626
|
+
}));
|
|
9627
|
+
});
|
|
9628
|
+
req.on("error", reject);
|
|
9629
|
+
req.end(body);
|
|
9630
|
+
});
|
|
9631
|
+
}
|
|
9414
9632
|
var StreamingPreludeLimitError = class StreamingPreludeLimitError extends Error {
|
|
9415
9633
|
constructor(message) {
|
|
9416
9634
|
super(message);
|
|
@@ -9438,7 +9656,7 @@ async function invokeRieStreaming(host, port, event, timeoutMs, options = {}) {
|
|
|
9438
9656
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
9439
9657
|
let response;
|
|
9440
9658
|
try {
|
|
9441
|
-
response = await fetchWithStartupRetry(url, body, controller.signal, { "Lambda-Runtime-Function-Response-Mode": "streaming" });
|
|
9659
|
+
response = await fetchWithStartupRetry(url, body, controller.signal, { "Lambda-Runtime-Function-Response-Mode": "streaming" }, timeoutMs);
|
|
9442
9660
|
} catch (err) {
|
|
9443
9661
|
clearTimeout(timer);
|
|
9444
9662
|
if (err.name === "AbortError") throw new Error(`RIE streaming invoke at ${url} timed out after ${timeoutMs}ms. The handler may be hung; check container logs.`);
|
|
@@ -9844,12 +10062,60 @@ function getDockerImageBySourceHash(manifest, imageUri) {
|
|
|
9844
10062
|
}
|
|
9845
10063
|
if (entries.length === 1) {
|
|
9846
10064
|
const [singleHash, singleAsset] = entries[0];
|
|
9847
|
-
return {
|
|
10065
|
+
if (imageUriTargetsAssetRepository(imageUri, singleAsset)) return {
|
|
9848
10066
|
hash: singleHash,
|
|
9849
10067
|
asset: singleAsset
|
|
9850
10068
|
};
|
|
9851
10069
|
}
|
|
9852
10070
|
}
|
|
10071
|
+
function imageUriTargetsAssetRepository(imageUri, asset) {
|
|
10072
|
+
const repo = extractRepositoryFromImageUri(imageUri);
|
|
10073
|
+
if (repo === void 0) return false;
|
|
10074
|
+
for (const dest of Object.values(asset.destinations ?? {})) {
|
|
10075
|
+
const name = dest?.repositoryName;
|
|
10076
|
+
if (typeof name !== "string" || name.length === 0) continue;
|
|
10077
|
+
if (pseudoParameterPatternsOverlap(name, repo)) return true;
|
|
10078
|
+
}
|
|
10079
|
+
return false;
|
|
10080
|
+
}
|
|
10081
|
+
function extractRepositoryFromImageUri(imageUri) {
|
|
10082
|
+
const slash = imageUri.indexOf("/");
|
|
10083
|
+
if (slash < 0) return void 0;
|
|
10084
|
+
let path = imageUri.slice(slash + 1);
|
|
10085
|
+
const at = path.indexOf("@");
|
|
10086
|
+
if (at >= 0) path = path.slice(0, at);
|
|
10087
|
+
const lastSlash = path.lastIndexOf("/");
|
|
10088
|
+
const colon = path.lastIndexOf(":");
|
|
10089
|
+
if (colon > lastSlash && !path.slice(colon).includes("}")) path = path.slice(0, colon);
|
|
10090
|
+
return path.length > 0 ? path : void 0;
|
|
10091
|
+
}
|
|
10092
|
+
const PSEUDO_PARAMETER = Symbol("pseudo-parameter");
|
|
10093
|
+
function pseudoParameterPatternsOverlap(a, b) {
|
|
10094
|
+
const ta = tokenizePseudoParameters(a);
|
|
10095
|
+
const tb = tokenizePseudoParameters(b);
|
|
10096
|
+
const memo = /* @__PURE__ */ new Map();
|
|
10097
|
+
const match = (i, j) => {
|
|
10098
|
+
if (i === ta.length || j === tb.length) return i === ta.length && j === tb.length;
|
|
10099
|
+
const key = i * (tb.length + 1) + j;
|
|
10100
|
+
const cached = memo.get(key);
|
|
10101
|
+
if (cached !== void 0) return cached;
|
|
10102
|
+
let result = false;
|
|
10103
|
+
if (ta[i] === PSEUDO_PARAMETER) for (let k = j; k < tb.length && tb[k] !== "/" && !result; k++) result = match(i + 1, k + 1);
|
|
10104
|
+
else if (tb[j] === PSEUDO_PARAMETER) for (let k = i; k < ta.length && ta[k] !== "/" && !result; k++) result = match(k + 1, j + 1);
|
|
10105
|
+
else result = ta[i] === tb[j] && match(i + 1, j + 1);
|
|
10106
|
+
memo.set(key, result);
|
|
10107
|
+
return result;
|
|
10108
|
+
};
|
|
10109
|
+
return match(0, 0);
|
|
10110
|
+
}
|
|
10111
|
+
function tokenizePseudoParameters(value) {
|
|
10112
|
+
const tokens = [];
|
|
10113
|
+
value.split(/\$\{AWS::[^}]*\}/).forEach((part, index) => {
|
|
10114
|
+
if (index > 0) tokens.push(PSEUDO_PARAMETER);
|
|
10115
|
+
tokens.push(...Array.from(part));
|
|
10116
|
+
});
|
|
10117
|
+
return tokens;
|
|
10118
|
+
}
|
|
9853
10119
|
function extractHashFromImageUri(imageUri) {
|
|
9854
10120
|
if (imageUri.includes("@sha256:")) return void 0;
|
|
9855
10121
|
return /:([a-f0-9]{8,})$/.exec(imageUri)?.[1];
|
|
@@ -9960,7 +10226,10 @@ async function localInvokeCommand(target, options, extraStateProviders) {
|
|
|
9960
10226
|
getLogger().debug(`cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
9961
10227
|
});
|
|
9962
10228
|
try {
|
|
9963
|
-
await activateWorkloadAwsWiring(
|
|
10229
|
+
await activateWorkloadAwsWiring({
|
|
10230
|
+
...options,
|
|
10231
|
+
singleWorkload: true
|
|
10232
|
+
});
|
|
9964
10233
|
warnIfEmulateRoleViaUnused(options.emulateRoleVia, {
|
|
9965
10234
|
roleFlag: "--assume-role",
|
|
9966
10235
|
roleRequested: options.assumeRole !== void 0 && options.assumeRole !== false
|
|
@@ -9995,10 +10264,11 @@ async function localInvokeCommand(target, options, extraStateProviders) {
|
|
|
9995
10264
|
const lambda = resolveLambdaTarget(resolvedTarget, stacks);
|
|
9996
10265
|
const targetLabel = lambda.kind === "zip" ? lambda.runtime : "container image";
|
|
9997
10266
|
logger.info(`Target: ${displayStackName(`${lambda.stack.stackName}/${lambda.logicalId}`)} (${targetLabel})`);
|
|
10267
|
+
logMixedModeForWorkload(lambdaWorkload(lambda), `Lambda ${displayStackName(`${lambda.stack.stackName}/${lambda.logicalId}`)}`);
|
|
9998
10268
|
imagePlan = await resolveImagePlan(lambda, options);
|
|
9999
10269
|
const containerEnv = await resolveLambdaContainerEnv(lambda, options, profileCredentials, extraStateProviders);
|
|
10000
10270
|
const dockerEnv = containerEnv.env;
|
|
10001
|
-
if (options.assumeRole === void 0 && containerEnv.stateForRoleHint) suggestAssumeRoleFromState(containerEnv.stateForRoleHint, lambda.logicalId);
|
|
10271
|
+
if (options.assumeRole === void 0 && containerEnv.stateForRoleHint && !stateRoleRecordIsEmulatorSide()) suggestAssumeRoleFromState(containerEnv.stateForRoleHint, lambda.logicalId);
|
|
10002
10272
|
if (!containerEnv.assumeRoleApplied && profileCredsFile) {
|
|
10003
10273
|
dockerEnv["AWS_SHARED_CREDENTIALS_FILE"] = profileCredsFile.containerPath;
|
|
10004
10274
|
dockerEnv["AWS_PROFILE"] = profileCredsFile.profileName;
|
|
@@ -10008,7 +10278,8 @@ async function localInvokeCommand(target, options, extraStateProviders) {
|
|
|
10008
10278
|
if (options.debugPort) {
|
|
10009
10279
|
debugPort = Number(options.debugPort);
|
|
10010
10280
|
if (!Number.isInteger(debugPort) || debugPort <= 0 || debugPort > 65535) throw new Error(`--debug-port must be an integer in 1..65535, got '${options.debugPort}'`);
|
|
10011
|
-
dockerEnv
|
|
10281
|
+
applyDebuggerEnv(dockerEnv, debugPort);
|
|
10282
|
+
logger.info(debugTimeoutNotice("--debug-port"));
|
|
10012
10283
|
if (lambda.kind === "image") logger.warn("--debug-port sets NODE_OPTIONS unconditionally on container Lambdas. If the image's runtime is not Node.js, this flag is a no-op.");
|
|
10013
10284
|
}
|
|
10014
10285
|
const hostPort = await pickFreePort();
|
|
@@ -10045,7 +10316,7 @@ async function localInvokeCommand(target, options, extraStateProviders) {
|
|
|
10045
10316
|
};
|
|
10046
10317
|
process.on("SIGINT", sigintHandler);
|
|
10047
10318
|
await waitForRieReady(containerHost, hostPort, 5e3);
|
|
10048
|
-
const invokeTimeoutMs =
|
|
10319
|
+
const invokeTimeoutMs = rieInvokeTimeoutMs(lambda.timeoutSec, debugPort !== void 0);
|
|
10049
10320
|
const result = await invokeRie(containerHost, hostPort, event, invokeTimeoutMs);
|
|
10050
10321
|
await new Promise((resolveDelay) => setTimeout(resolveDelay, 250));
|
|
10051
10322
|
process.stdout.write(`${result.raw}\n`);
|
|
@@ -10441,7 +10712,7 @@ async function resolveLambdaContainerEnvWith(lambda, options, profileCredentials
|
|
|
10441
10712
|
});
|
|
10442
10713
|
let resolvedAssumeRoleArn;
|
|
10443
10714
|
try {
|
|
10444
|
-
const fromTemplate = options.assumeRole === true && options.deployedFunctionLookups === false && stateForRoleHint ? await resolveTemplateRoleArnFromState(lambda.resource.Properties?.["Role"], stateForRoleHint, lambda.stack.template, () => resolvePseudoParametersForInvoke(lambda.stack.region, options)) : void 0;
|
|
10715
|
+
const fromTemplate = options.assumeRole === true && options.deployedFunctionLookups === false && stateForRoleHint && !stateRoleRecordIsEmulatorSide() ? await resolveTemplateRoleArnFromState(lambda.resource.Properties?.["Role"], stateForRoleHint, lambda.stack.template, () => resolvePseudoParametersForInvoke(lambda.stack.region, options)) : void 0;
|
|
10445
10716
|
if (fromTemplate !== void 0) logger.info(`--assume-role: auto-resolved execution role from state: ${flattenToOneLine(fromTemplate)}`);
|
|
10446
10717
|
resolvedAssumeRoleArn = fromTemplate ?? await resolveAssumeRoleArnForLambda(options.assumeRole, stateForRoleHint, options.deployedFunctionLookups === false ? void 0 : stateProvider, lambda.logicalId);
|
|
10447
10718
|
} finally {
|
|
@@ -10479,7 +10750,7 @@ async function resolveLambdaContainerEnvWith(lambda, options, profileCredentials
|
|
|
10479
10750
|
assumeSucceeded = true;
|
|
10480
10751
|
} catch (err) {
|
|
10481
10752
|
const reason = assumeRoleDetail(err, "STS AssumeRole");
|
|
10482
|
-
logger.warn(`--assume-role: STS AssumeRole(${flattenToOneLine(resolvedAssumeRoleArn)}) failed: ${reason}. Falling back to the developer's shell credentials
|
|
10753
|
+
logger.warn(`--assume-role: STS AssumeRole(${flattenToOneLine(resolvedAssumeRoleArn)}) failed: ${reason}. ` + (roleHopsGoToAwsEmulator() ? "The function runs with the emulator's own keys." : "Falling back to the developer's shell credentials."));
|
|
10483
10754
|
}
|
|
10484
10755
|
}
|
|
10485
10756
|
if (!assumeSucceeded) {
|
|
@@ -10510,6 +10781,9 @@ function suggestAssumeRoleFromState(state, logicalId) {
|
|
|
10510
10781
|
const roleArn = resolveExecutionRoleArnFromState(state, logicalId);
|
|
10511
10782
|
if (roleArn) logger.info(`Hint: the deployed function uses execution role ${flattenToOneLine(roleArn)}. Re-run with --assume-role to invoke under the deployed function's narrow permissions.`);
|
|
10512
10783
|
}
|
|
10784
|
+
function mixedModeEmulatorRoleWarning(pin) {
|
|
10785
|
+
return `--assume-role: in AWS Emulator mixed mode the execution role is assumed in real AWS, but the state record's IAM roles are the emulator's, so the role is not read from it. Mark IAM as a "real-aws" exception under Parameters (AWS_ENDPOINT_URL_IAM), or pass the ARN explicitly: ${pin}. Falling back to the developer's shell credentials.`;
|
|
10786
|
+
}
|
|
10513
10787
|
async function resolveAssumeRoleArnForLambda(assumeRole, stateForRoleHint, stateProvider, lambdaLogicalId) {
|
|
10514
10788
|
const logger = getLogger();
|
|
10515
10789
|
if (typeof assumeRole === "string") return assumeRole;
|
|
@@ -10518,7 +10792,8 @@ async function resolveAssumeRoleArnForLambda(assumeRole, stateForRoleHint, state
|
|
|
10518
10792
|
logger.warn("--assume-role passed without an ARN, but no state was loaded. Pair it with a state-source flag, or pass the ARN explicitly: --assume-role <arn>. Falling back to the developer's shell credentials.");
|
|
10519
10793
|
return;
|
|
10520
10794
|
}
|
|
10521
|
-
const
|
|
10795
|
+
const recordIsEmulatorSide = stateRoleRecordIsEmulatorSide();
|
|
10796
|
+
const fromState = recordIsEmulatorSide ? void 0 : resolveExecutionRoleArnFromState(stateForRoleHint, lambdaLogicalId);
|
|
10522
10797
|
if (fromState) {
|
|
10523
10798
|
logger.info(`--assume-role: auto-resolved execution role from state: ${flattenToOneLine(fromState)}`);
|
|
10524
10799
|
return fromState;
|
|
@@ -10532,6 +10807,10 @@ async function resolveAssumeRoleArnForLambda(assumeRole, stateForRoleHint, state
|
|
|
10532
10807
|
return liveArn;
|
|
10533
10808
|
}
|
|
10534
10809
|
}
|
|
10810
|
+
if (recordIsEmulatorSide) {
|
|
10811
|
+
logger.warn(mixedModeEmulatorRoleWarning("--assume-role <arn>"));
|
|
10812
|
+
return;
|
|
10813
|
+
}
|
|
10535
10814
|
logger.warn(`--assume-role: could not resolve the execution role ARN for ${displayIdent(lambdaLogicalId)}. Pass the ARN explicitly: --assume-role <arn>. Falling back to the developer's shell credentials.`);
|
|
10536
10815
|
}
|
|
10537
10816
|
function resolveExecutionRoleArnFromState(state, logicalId, roleProperty = "Role") {
|
|
@@ -15925,7 +16204,8 @@ async function localStartApiCommand(targets, options, extraStateProviders) {
|
|
|
15925
16204
|
warnIamRoutes(initialMaterial.routes);
|
|
15926
16205
|
let maxTimeoutSec = 0;
|
|
15927
16206
|
for (const spec of initialMaterial.specs.values()) if (spec.lambda.timeoutSec > maxTimeoutSec) maxTimeoutSec = spec.lambda.timeoutSec;
|
|
15928
|
-
const rieTimeoutMs =
|
|
16207
|
+
const rieTimeoutMs = rieInvokeTimeoutMs(maxTimeoutSec, debugPortBase !== void 0);
|
|
16208
|
+
if (debugPortBase !== void 0) logger.info(debugTimeoutNotice("--debug-port-base"));
|
|
15929
16209
|
const basePort = parseInt(options.port, 10);
|
|
15930
16210
|
if (!Number.isFinite(basePort) || basePort < 0 || basePort > 65535) throw new Error(`--port must be 0..65535 (got ${options.port}).`);
|
|
15931
16211
|
const mtlsConfig = resolveMtlsConfig(options);
|
|
@@ -16407,6 +16687,10 @@ function resolveStartApiAssumeRoleArn(args) {
|
|
|
16407
16687
|
if (isIamRoleArn(roleProp)) return roleProp;
|
|
16408
16688
|
getLogger().warn(`--assume-role: the template Role for ${displayIdent(logicalId)} is not a well-formed IAM role ARN: ${describeRejectedRoleArn(roleProp)}. Ignoring it.`);
|
|
16409
16689
|
}
|
|
16690
|
+
if (stateBundle && stateRoleRecordIsEmulatorSide()) {
|
|
16691
|
+
getLogger().warn(mixedModeEmulatorRoleWarning(`--assume-role ${logicalId}=<arn>`));
|
|
16692
|
+
return;
|
|
16693
|
+
}
|
|
16410
16694
|
if (stateBundle) {
|
|
16411
16695
|
const fromState = resolveExecutionRoleArnFromState(stateBundle.state, logicalId);
|
|
16412
16696
|
if (fromState) {
|
|
@@ -16540,7 +16824,7 @@ async function buildContainerSpec(args) {
|
|
|
16540
16824
|
}
|
|
16541
16825
|
}
|
|
16542
16826
|
setContainerRegion(dockerEnv, containerRegion);
|
|
16543
|
-
if (debugPort !== void 0) dockerEnv
|
|
16827
|
+
if (debugPort !== void 0) applyDebuggerEnv(dockerEnv, debugPort);
|
|
16544
16828
|
const tmpfs = lambda.ephemeralStorageMb !== void 0 ? {
|
|
16545
16829
|
target: "/tmp",
|
|
16546
16830
|
sizeMb: lambda.ephemeralStorageMb
|
|
@@ -17897,7 +18181,10 @@ async function localInvokeAgentCoreCommand(target, options, extraStateProviders)
|
|
|
17897
18181
|
getLogger().debug(`cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
17898
18182
|
});
|
|
17899
18183
|
try {
|
|
17900
|
-
await activateWorkloadAwsWiring(
|
|
18184
|
+
await activateWorkloadAwsWiring({
|
|
18185
|
+
...options,
|
|
18186
|
+
singleWorkload: true
|
|
18187
|
+
});
|
|
17901
18188
|
warnIfEmulateRoleViaUnused(options.emulateRoleVia, {
|
|
17902
18189
|
roleFlag: "--assume-role",
|
|
17903
18190
|
roleRequested: options.assumeRole !== void 0 && options.assumeRole !== false
|
|
@@ -17937,6 +18224,10 @@ async function localInvokeAgentCoreCommand(target, options, extraStateProviders)
|
|
|
17937
18224
|
};
|
|
17938
18225
|
const resolved = resolveAgentCoreTarget(resolvedTarget, stacks, imageContext);
|
|
17939
18226
|
logger.info(`Target: ${displayStackName(`${resolved.stack.stackName}/${resolved.logicalId}`)} (${resolved.protocol})`);
|
|
18227
|
+
logMixedModeForWorkload({
|
|
18228
|
+
logicalId: resolved.logicalId,
|
|
18229
|
+
cdkPath: readCdkPathOrUndefined(resolved.resource)
|
|
18230
|
+
}, `AgentCore runtime ${displayStackName(`${resolved.stack.stackName}/${resolved.logicalId}`)}`);
|
|
17940
18231
|
const isMcp = resolved.protocol === "MCP";
|
|
17941
18232
|
const isA2a = resolved.protocol === "A2A";
|
|
17942
18233
|
if (resolved.protocol === "AGUI") logger.info("AGUI runtime: routing through the HTTP /invocations + /ws path (AG-UI wire is SSE / WebSocket on port 8080).");
|
|
@@ -18493,7 +18784,8 @@ async function resolveAssumeRoleArn(options, resolved, loaded, stateProvider) {
|
|
|
18493
18784
|
getLogger().warn(`--assume-role: the template RoleArn for ${displayIdent(resolved.logicalId)} is not a well-formed IAM role ARN: ${describeRejectedRoleArn(resolved.roleArn)}. Ignoring it.`);
|
|
18494
18785
|
}
|
|
18495
18786
|
if (loaded) {
|
|
18496
|
-
const
|
|
18787
|
+
const recordIsEmulatorSide = stateRoleRecordIsEmulatorSide();
|
|
18788
|
+
const fromState = recordIsEmulatorSide ? void 0 : resolveExecutionRoleArnFromState(loaded, resolved.logicalId, "RoleArn");
|
|
18497
18789
|
if (fromState) {
|
|
18498
18790
|
getLogger().debug(`--assume-role: resolved RoleArn from state: ${flattenToOneLine(fromState)}`);
|
|
18499
18791
|
return fromState;
|
|
@@ -18507,6 +18799,10 @@ async function resolveAssumeRoleArn(options, resolved, loaded, stateProvider) {
|
|
|
18507
18799
|
return liveArn;
|
|
18508
18800
|
}
|
|
18509
18801
|
}
|
|
18802
|
+
if (recordIsEmulatorSide) {
|
|
18803
|
+
getLogger().warn(mixedModeEmulatorRoleWarning("--assume-role <arn>"));
|
|
18804
|
+
return;
|
|
18805
|
+
}
|
|
18510
18806
|
}
|
|
18511
18807
|
getLogger().warn("--assume-role passed without an ARN, but the runtime's RoleArn is not a literal ARN in the template " + (loaded ? "and could not be resolved from the deployed stack state. " : "and no --from-cfn-stack state is available to resolve it. ") + "Pass the ARN explicitly: --assume-role <arn>. Falling back to the developer's shell credentials.");
|
|
18512
18808
|
}
|
|
@@ -18614,16 +18910,16 @@ async function assumeAgentCoreExecutionRole(roleArn, region, profile, emulateRol
|
|
|
18614
18910
|
flag: "--assume-role",
|
|
18615
18911
|
sessionNameSuffix: "invoke-agentcore"
|
|
18616
18912
|
});
|
|
18617
|
-
if (emulated !== void 0) return emulated;
|
|
18913
|
+
if (emulated !== void 0) return keepEmulatorIssuedCredentials(emulated);
|
|
18618
18914
|
throw err;
|
|
18619
18915
|
}
|
|
18620
18916
|
const creds = response.Credentials;
|
|
18621
18917
|
if (!creds?.AccessKeyId || !creds.SecretAccessKey || !creds.SessionToken) throw new AssumeRoleFailure(`AssumeRole(${flattenToOneLine(roleArn)}) returned no usable credentials.`, "the response carried no usable credentials");
|
|
18622
|
-
return {
|
|
18918
|
+
return keepEmulatorIssuedCredentials({
|
|
18623
18919
|
accessKeyId: creds.AccessKeyId,
|
|
18624
18920
|
secretAccessKey: creds.SecretAccessKey,
|
|
18625
18921
|
sessionToken: creds.SessionToken
|
|
18626
|
-
};
|
|
18922
|
+
});
|
|
18627
18923
|
} finally {
|
|
18628
18924
|
sts.destroy();
|
|
18629
18925
|
}
|
|
@@ -19683,6 +19979,7 @@ async function runEcsTask(task, options, state) {
|
|
|
19683
19979
|
region: containerRegion,
|
|
19684
19980
|
sidecarIp: state.network.sidecarIp,
|
|
19685
19981
|
...options.mixedModeRoleCredentials && { mixedModeRoleCredentials: options.mixedModeRoleCredentials },
|
|
19982
|
+
...options.taskCredentials && { taskCredentials: options.taskCredentials },
|
|
19686
19983
|
...options.skipHostPortPublish ? { skipHostPortPublish: true } : {},
|
|
19687
19984
|
...effectiveHostPortOverrides ? { hostPortOverrides: effectiveHostPortOverrides } : {},
|
|
19688
19985
|
...autoRemappedContainerPorts ? { autoRemappedContainerPorts } : {},
|
|
@@ -20167,10 +20464,21 @@ function buildDockerRunArgs(opts) {
|
|
|
20167
20464
|
finalEnv["AWS_SECRET_ACCESS_KEY"] = defaultCredentials.secretAccessKey;
|
|
20168
20465
|
if (defaultCredentials.sessionToken) finalEnv["AWS_SESSION_TOKEN"] = defaultCredentials.sessionToken;
|
|
20169
20466
|
}
|
|
20170
|
-
if (wiring)
|
|
20171
|
-
|
|
20172
|
-
|
|
20173
|
-
|
|
20467
|
+
if (wiring) {
|
|
20468
|
+
const emulatorRole = wiring.mode === "emulator" ? emulatorIssuedCredentials(opts.taskCredentials) : void 0;
|
|
20469
|
+
finalEnv = applyWorkloadAwsWiringToEnv(finalEnv, wiring.mode === "emulator" ? emulatorRole ? {
|
|
20470
|
+
...wiring,
|
|
20471
|
+
emulatorCredentials: emulatorRole
|
|
20472
|
+
} : wiring : {
|
|
20473
|
+
...wiring,
|
|
20474
|
+
env: {}
|
|
20475
|
+
});
|
|
20476
|
+
for (const h of awsEmulatorSqsHostBlocks(finalEnv, wiring)) {
|
|
20477
|
+
const mapping = `${h.host}:${h.ip}`;
|
|
20478
|
+
args.push("--add-host", mapping);
|
|
20479
|
+
ownerAddHosts.push(mapping);
|
|
20480
|
+
}
|
|
20481
|
+
}
|
|
20174
20482
|
const sensitiveEnvKeys = new Set(SENSITIVE_ENV_KEYS);
|
|
20175
20483
|
for (const s of secrets) sensitiveEnvKeys.add(s.name);
|
|
20176
20484
|
for (const s of container.secrets) sensitiveEnvKeys.add(s.name);
|
|
@@ -25080,7 +25388,7 @@ function readEnvOverridesFile(filePath) {
|
|
|
25080
25388
|
}
|
|
25081
25389
|
async function resolveSidecarCredentials(options, assumedCredentials) {
|
|
25082
25390
|
const wiring = getActiveWorkloadAwsWiring();
|
|
25083
|
-
if (wiring?.mode === "emulator") return wiring.emulatorCredentials;
|
|
25391
|
+
if (wiring?.mode === "emulator") return emulatorIssuedCredentials(assumedCredentials) ?? wiring.emulatorCredentials;
|
|
25084
25392
|
if (assumedCredentials) return assumedCredentials;
|
|
25085
25393
|
if (options.profile) return resolveProfileCredentials(options.profile);
|
|
25086
25394
|
return resolveHostDefaultCredentials();
|
|
@@ -36484,5 +36792,5 @@ function addStudioSpecificOptions(cmd) {
|
|
|
36484
36792
|
return cmd;
|
|
36485
36793
|
}
|
|
36486
36794
|
|
|
36487
|
-
export { postHook as $, AGENTCORE_HTTP_PROTOCOL as $a, probeHostGatewaySupport as $i, addImageOverrideOptions as $n, resolveHostDefaultCredentials as $o, resolveApiTargetSubset as $r, classifyS3Error as $t, microvmFidelityWarnings as A, isCfnFlagPresent as Aa, translateLambdaResponse as Ai, stripCloudFrontImport as An, AUTH_OFF_PLACEHOLDER_CREDENTIALS as Ao, A2A_CONTAINER_PORT as Ar, readContainerLogTail as At, MICROVM_WS_BASE_PROTOCOL as B, countTargets as Ba, ConnectionRegistry as Bi, createLocalStartAlbCommand as Bn, displayEndpointValue as Bo, AGENTCORE_SESSION_ID_HEADER as Br, parseWebFunctionBuildConfig as Bt, addListSpecificOptions as C, substituteEnvVarsFromState as Ca, attachAuthorizers as Ci, WEB_FUNCTION_REVISION_TYPE as Cn, assumedRoleRecorded as Co, setShadowReadyTimeoutMs as Cr, parseKvsFileOverrides as Ct, buildMicrovmLambdaView as D, UNNAMED_WORKLOAD as Da, isFunctionUrlOacFronted as Di, compileCloudFrontFunction as Dn, resetWorkloadIdentity as Do, createLocalInvokeAgentCoreCommand as Dr, WEB_FUNCTION_CONTAINER_PORT as Dt, addStartMicrovmSpecificOptions as E, LocalStateSourceError as Ea, buildCorsConfigFromCloudFrontChain as Ei, resolveWebFunctionTarget as En, recordAssumedRole as Eo, addInvokeAgentCoreSpecificOptions as Er, RecentOutput as Et, microvmImageTag as F, CfnLocalStateProvider as Fa, pickResponseTemplate as Fi, findFileAssetForObjectKey as Fn, HOST_DEFAULT_CREDENTIALS_MISS_TTL_MS as Fo, MCP_PROTOCOL_VERSION as Fr, buildNodeEntryFileStart as Ft, startMicrovmFrontDoor as G, filterWebSocketApisByIdentifiers as Ga, buildDisconnectEvent as Gi, addStartServiceSpecificOptions as Gn, javaTruststoreToolOptions as Go, SUPPORTED_CODE_RUNTIMES as Gr, readWebFunctionServiceConfig as Gt, PROXY_PORT_HEADER as H, availableWebSocketApiIdentifiers as Ha, handleConnectionsRequest as Hi, resolveAlbTarget as Hn, getActiveWorkloadAwsWiring as Ho, waitForAgentCoreHttpReady as Hr, WEB_FUNCTION_HTTP_ENDPOINT_ENV as Ht, planMicrovmPorts as I, collectSsmParameterRefs as Ia, selectIntegrationResponse as Ii, isBucketDeploymentResource as In, activateWorkloadAwsWiring as Io, mcpInvokeOnce as Ir, defaultWebFunctionPlatform as It, MICROVM_HOOK_PATH_PREFIX as J, discoverRoutes as Ja, createFileWatcher as Ji, addRunTaskSpecificOptions as Jn, parseAwsEndpoint as Jo, renderCodeDockerfile as Jr, idFromArn as Jt, stripMicrovmProxyHeaders as K, parseSelectionExpressionPath as Ka, buildMessageEvent as Ki, createLocalStartServiceCommand as Kn, loopbackForwarderPlan as Ko, buildAgentCoreCodeImage as Kr, webFunctionAssumeRole as Kt, readExposedPorts as L, resolveSsmParameters as La, tryParseStatus as Li, resolveBucketDeploymentObjectKey as Ln, applyWorkloadAwsWiringToEnv as Lo, parseSseForJsonRpc as Lr, resolveWebFunctionRuntime as Lt, DEFAULT_TERMINATE_HOOK_TIMEOUT_MS as M, resolveCfnFallbackRegion as Ma, buildHttpApiV2Event as Mi, createLocalFileKvsDataSource as Mn, DEFAULT_AWS_EMULATOR_URL as Mo, a2aInvokeOnce as Mr, waitForWebFunctionReady as Mt, LocalMicrovm as N, resolveCfnRegion as Na, buildRestV1Event as Ni, createUnboundCloudFrontModule as Nn, EMULATOR_SCRUBBED_ENV_KEYS as No, MCP_CONTAINER_PORT as Nr, watchContainerExit as Nt, createLocalStartMicrovmCommand as O, createLocalStateProvider as Oa, matchPreflight as Oi, runViewerRequest as On, workloadClientConfig as Oo, bridgeAgentCoreWs as Or, containerFailure as Ot, buildMicrovmImage as P, resolveCfnStackName as Pa, evaluateResponseParameters as Pi, bucketDeploymentSourceObjectKeys as Pn, HOST_CA_TRUST_ENV_KEYS as Po, MCP_PATH as Pr, WEB_FUNCTION_RUNTIMES as Pt, pollBuildHook as Q, AGENTCORE_AGUI_PROTOCOL as Qa, HOST_GATEWAY_MIN_VERSION as Qi, addEcsAssumeRoleOptions as Qn, resolveAwsEmulatorOption as Qo, createWatchPredicates as Qr, resolveDeployedOriginBucket as Qt, setContainerPaused as R, resolveWatchConfig as Ra, VtlEvaluationError as Ri, addAlbSpecificOptions as Rn, awsEmulatorEnvName as Ro, AGENTCORE_SIGV4_SERVICE as Rr, supportedWebFunctionRuntimes as Rt, StudioEventBus as S, substituteAgainstStateAsync as Sa, invokeTokenAuthorizer as Si, WEB_FUNCTION_ENDPOINT_TYPE as Sn, SECOND_ASSUME_MESSAGE as So, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as Sr, normalizeKvsFileKeys as St, formatTargetListing as T, materializeLayerFromArn as Ta, buildCorsConfigByApiId as Ti, WebFunctionResolutionError as Tn, readEnvCallerCredentials as To, attachContainerLogStreamer as Tr, resolveCloudFrontTarget as Tt, rewriteUpgradeResponseHead as U, discoverWebSocketApis as Ua, parseConnectionsPath as Ui, isApplicationLoadBalancer as Un, getContainerCaBundlePath as Uo, waitForAgentCorePing as Ur, buildWebFunctionLambdaView as Ut, MicrovmStateError as V, listTargets as Va, buildMgmtEndpointEnvUrl as Vi, parseLbPortOverrides as Vn, effectiveLoopbackPorts as Vo, invokeAgentCore as Vr, resolveWebFunctionArtifact as Vt, selectTargetPort as W, discoverWebSocketApisOrThrow as Wa, buildConnectEvent as Wi, resolveAlbFrontDoor as Wn, getContainerJavaTruststorePath as Wo, downloadAndExtractS3Bundle as Wr, finalizeWebFunctionEnv as Wt, callRuntimeHook as X, resolveLambdaArnIntrinsic as Xa, createLocalInvokeCommand as Xi, MAX_TASKS_SUBNET_RANGE_CAP as Xn, readEmulatorRunFiles as Xo, addStartApiSpecificOptions as Xr, createDeployedKvsDataSource as Xt, MicrovmHookError as Y, pickRefLogicalId as Ya, addInvokeSpecificOptions as Yi, createLocalRunTaskCommand as Yn, probeAwsEmulatorHealth as Yo, toCmdArgv as Yr, resolveKvsModulesForDistribution as Yt, generateMicrovmId as Z, AGENTCORE_A2A_PROTOCOL as Za, HOST_DOCKER_INTERNAL_GATEWAY as Zi, addCommonEcsServiceOptions as Zn, readProfileEndpointSettings as Zo, createLocalStartApiCommand as Zr, resolveDeployedKvsArnByName as Zt, filterStudioTargetGroups as _, resolveRuntimeFileExtension as _a, verifyJwtViaDiscovery as _i, pickKvsLogicalIdFromArn as _n, parseDynamicReference as _o, isLocalCdkAssetImage as _r, attachAgentCoreWsBridge as _t, createLocalStudioCommand as a, buildLoopbackForwarderDockerArgs as aa, filterRoutesByApiIdentifiers as ai, serveLambdaUrlOrigin as an, derivePseudoParametersFromRegion as ao, resolveSharedSidecarCredentials as ar, buildJavaTrustStore as as, disposeMicrovmCodeArtifact as at, renderStudioHtml as b, assertEcsTaskImagesResolvable as ba, evaluateCachedLambdaPolicy as bi, pickWebFunctionEndpointLogicalIdFromOrigin as bn, addAwsEndpointOptions as bo, CloudMapRegistry as br, addStartCloudFrontSpecificOptions as bt, startStudioProxy as c, ensureForwarderImage as ca, startApiServer as ci, buildEdgeRequestEvent as cn, tryResolveImageFnJoin as co, buildImageOverrideTag as cr, resolveProfileCredentials as cs, resolveMicrovmImageTarget as ct, createStudioDispatcher as d, buildContainerImage as da, defaultCredentialsLoader as di, httpHeadersToEdge as dn, DynamicReferenceResolver as do, mergeForService as dr, createLocalStartWebFunctionCommand as dt, resolveHostGatewayExtraHosts as ea, createAuthorizerCache as ei, createS3OriginReader as en, AGENTCORE_MCP_PROTOCOL as eo, buildEcsImageResolutionContext$1 as er, resolveWorkloadAwsWiring as es, runHookBody as et, filterStudioCustomResources as f, dockerRegistryEnv as fa, buildCognitoJwksUrl as fi, CLOUDFRONT_DISTRIBUTION_TYPE as fn, containsDynamicReference as fo, parseImageOverrideFlags as fr, addStartAgentCoreSpecificOptions as ft, annotatePinnedEcsTargets as g, resolveRuntimeCodeMountPath as ga, verifyJwtAuthorizer as gi, pickFunctionUrlLogicalIdFromOrigin as gn, keysOverriddenBy as go, imageOverrideKeyAliases as gr, startAgentCoreHttpServer as gt, annotateEcsTaskPinnedTargets as h, stripEcrCredentials as ha, verifyCognitoJwt as hi, isCloudFrontDistribution as hn, keysNotFromTemplate as ho, describePinnedImageUri as hr, selectServeInboundAuth as ht, coerceStopRequest as i, awaitLoopbackForwarderStatus as ia, filterRoutesByApiIdentifier as ii, serveFromStaticOrigin as in, resolveAgentCoreTarget as io, resolveEcsAssumeRoleOption as ir, MIXED_MODE_RESIGN_BODY_CAP_BYTES as is, MicrovmResolutionError as it, readRunHookPayload as j, rejectExplicitCfnStackWithMultipleStacks as ja, applyAuthorizerOverlay as ji, createCloudFrontModule as jn, CA_TRUST_ENV_KEYS as jo, A2A_PATH as jr, startWebFunctionContainer as jt, finalizeMicrovmEnv as k, groupWorkloadsRoutedApart as ka, matchRoute as ki, runViewerResponse as kn, workloadStsClientConfig as ko, invokeAgentCoreWs as kr, planWebFunctionContainer as kt, relayServeRequest as l, startLoopbackForwarder as la, resolveSelectionExpression as li, buildEdgeResponseEvent as ln, LocalInvokeBuildError as lo, canonicalizeImageOverrideKeys as lr, s3KeyOfUri as lt, annotateAlbPinnedBackingServices as m, noImplicitEcrPullArgs as ma, createJwksCache as mi, extractKvsAssociations as mn, firstUsableRegion as mo, runImageOverrideBuilds as mr, buildAgentCoreServeAuthCheck as mt, coerceRunRequest as n, withWorkloadAwsWiring as na, buildStageMap as ni, startCloudFrontServer as nn, AgentCoreResolutionError as no, parseMaxTasks as nr, takeAwsEmulatorStateSourceHint as ns, MICROVM_DEFAULT_INGRESS_PORT as nt, resolveServeBaseUrl as o, buildNamespaceOwnerForwarderDockerArgs as oa, groupRoutesByServer as oi, applyEdgeRequestResult as on, formatStateRemedy as oo, runEcsServiceEmulator as or, createMixedModeTlsMaterials as os, readMicrovmImageConfig as ot, isCustomResourceLambdaTarget as p, isEcrRegistryConfigKey as pa, buildJwksUrlFromIssuer as pi, describeS3OriginDomain as pn, deployedFillMayBeSecret as po, resolveImageOverrides as pr, createLocalStartAgentCoreCommand as pt, MAX_RUN_HOOK_PAYLOAD_BYTES as q, webSocketApiMatchesIdentifier as qa, classifySourceChange as qi, serviceStrategy as qn, mergeJavaToolOptions as qo, computeCodeImageTag as qr, webFunctionFidelityWarnings as qt, coerceServeRequest as r, LOOPBACK_FORWARDER_IMAGE as ra, availableApiIdentifiers as ri, resolveErrorResponseCandidates as rn, pickAgentCoreCandidateStack as ro, parseRestartPolicy as rr, writeCaBundleFile as rs, MICROVM_IMAGE_TYPE as rt, createStudioServeManager as s, describeForwarderFailure as sa, readMtlsMaterialsFromDisk as si, applyEdgeResponseResult as sn, substituteImagePlaceholders as so, ImageOverrideError as sr, buildStsClientConfig as ss, resolveMicrovmCodeArtifact as st, addStudioSpecificOptions as t, attachLoopbackForwarder as ta, attachStageContext as ti, matchBehavior as tn, AGENTCORE_RUNTIME_TYPE as to, ecsClusterOption as tr, setActiveWorkloadAwsWiring as ts, waitForAppAnswer as tt, reinvoke as u, architectureToPlatform as ua, resolveServiceIntegrationParameters as ui, edgeHeadersToHttp as un, DynamicReferenceResolutionError as uo, enforceImageOverrideOrphans as ur, addStartWebFunctionSpecificOptions as ut, startStudioServer as v, resolveRuntimeImage as va, buildMethodArn as vi, pickLambdaEdgeFunctionLogicalId as vn, resolveDynamicReferencesInEnv as vo, listPinnedTargets as vr, startAgentCoreWsBridge as vt, createLocalListCommand as w, substituteEnvVarsFromStateAsync as wa, applyCorsResponseHeaders as wi, WEB_FUNCTION_TYPE as wn, deployAccountStsClientConfig as wo, getContainerNetworkIp as wr, parseOriginOverrides as wt, createStudioStore as x, substituteAgainstState as xa, invokeRequestAuthorizer as xi, resolveCloudFrontDistribution as xn, awsEndpointOptions as xo, DEFAULT_SHADOW_READY_TIMEOUT_MS as xr, createLocalStartCloudFrontCommand as xt, toStudioTargetGroups as y, EcsTaskResolutionError as ya, computeRequestIdentityHash as yi, pickTargetFunctionLogicalId as yn, withoutKeys as yo, buildCloudMapIndex as yr, LocalStartCloudFrontError as yt, MICROVM_CONTROL_PATH as z, resolveSingleTarget as za, bufferToBody as zi, albStrategy as zn, collectHostEndpointOverrides as zo, signAgentCoreInvocation as zr, disposeWebFunctionArtifact as zt };
|
|
36488
|
-
//# sourceMappingURL=local-studio-
|
|
36795
|
+
export { postHook as $, AGENTCORE_HTTP_PROTOCOL as $a, probeHostGatewaySupport as $i, addImageOverrideOptions as $n, readProfileEndpointSettings as $o, resolveApiTargetSubset as $r, classifyS3Error as $t, microvmFidelityWarnings as A, isCfnFlagPresent as Aa, translateLambdaResponse as Ai, stripCloudFrontImport as An, AUTH_OFF_PLACEHOLDER_CREDENTIALS as Ao, A2A_CONTAINER_PORT as Ar, readContainerLogTail as At, MICROVM_WS_BASE_PROTOCOL as B, countTargets as Ba, ConnectionRegistry as Bi, createLocalStartAlbCommand as Bn, collectHostEndpointOverrides as Bo, AGENTCORE_SESSION_ID_HEADER as Br, parseWebFunctionBuildConfig as Bt, addListSpecificOptions as C, substituteEnvVarsFromState as Ca, attachAuthorizers as Ci, WEB_FUNCTION_REVISION_TYPE as Cn, assumedRoleRecorded as Co, setShadowReadyTimeoutMs as Cr, parseKvsFileOverrides as Ct, buildMicrovmLambdaView as D, UNNAMED_WORKLOAD as Da, isFunctionUrlOacFronted as Di, compileCloudFrontFunction as Dn, resetWorkloadIdentity as Do, createLocalInvokeAgentCoreCommand as Dr, WEB_FUNCTION_CONTAINER_PORT as Dt, addStartMicrovmSpecificOptions as E, LocalStateSourceError as Ea, buildCorsConfigFromCloudFrontChain as Ei, resolveWebFunctionTarget as En, recordAssumedRole as Eo, addInvokeAgentCoreSpecificOptions as Er, RecentOutput as Et, microvmImageTag as F, CfnLocalStateProvider as Fa, pickResponseTemplate as Fi, findFileAssetForObjectKey as Fn, HOST_DEFAULT_CREDENTIALS_MISS_TTL_MS as Fo, MCP_PROTOCOL_VERSION as Fr, buildNodeEntryFileStart as Ft, startMicrovmFrontDoor as G, filterWebSocketApisByIdentifiers as Ga, buildDisconnectEvent as Gi, addStartServiceSpecificOptions as Gn, getContainerJavaTruststorePath as Go, SUPPORTED_CODE_RUNTIMES as Gr, readWebFunctionServiceConfig as Gt, PROXY_PORT_HEADER as H, availableWebSocketApiIdentifiers as Ha, handleConnectionsRequest as Hi, resolveAlbTarget as Hn, effectiveLoopbackPorts as Ho, waitForAgentCoreHttpReady as Hr, WEB_FUNCTION_HTTP_ENDPOINT_ENV as Ht, planMicrovmPorts as I, collectSsmParameterRefs as Ia, selectIntegrationResponse as Ii, isBucketDeploymentResource as In, activateWorkloadAwsWiring as Io, mcpInvokeOnce as Ir, defaultWebFunctionPlatform as It, MICROVM_HOOK_PATH_PREFIX as J, discoverRoutes as Ja, createFileWatcher as Ji, addRunTaskSpecificOptions as Jn, loopbackForwarderPlan as Jo, renderCodeDockerfile as Jr, idFromArn as Jt, stripMicrovmProxyHeaders as K, parseSelectionExpressionPath as Ka, buildMessageEvent as Ki, createLocalStartServiceCommand as Kn, javaTruststoreToolOptions as Ko, buildAgentCoreCodeImage as Kr, webFunctionAssumeRole as Kt, readExposedPorts as L, resolveSsmParameters as La, tryParseStatus as Li, resolveBucketDeploymentObjectKey as Ln, applyWorkloadAwsWiringToEnv as Lo, parseSseForJsonRpc as Lr, resolveWebFunctionRuntime as Lt, DEFAULT_TERMINATE_HOOK_TIMEOUT_MS as M, resolveCfnFallbackRegion as Ma, buildHttpApiV2Event as Mi, createLocalFileKvsDataSource as Mn, DEFAULT_AWS_EMULATOR_URL as Mo, a2aInvokeOnce as Mr, waitForWebFunctionReady as Mt, LocalMicrovm as N, resolveCfnRegion as Na, buildRestV1Event as Ni, createUnboundCloudFrontModule as Nn, EMULATOR_SCRUBBED_ENV_KEYS as No, MCP_CONTAINER_PORT as Nr, watchContainerExit as Nt, createLocalStartMicrovmCommand as O, createLocalStateProvider as Oa, matchPreflight as Oi, runViewerRequest as On, workloadClientConfig as Oo, bridgeAgentCoreWs as Or, containerFailure as Ot, buildMicrovmImage as P, resolveCfnStackName as Pa, evaluateResponseParameters as Pi, bucketDeploymentSourceObjectKeys as Pn, HOST_CA_TRUST_ENV_KEYS as Po, MCP_PATH as Pr, WEB_FUNCTION_RUNTIMES as Pt, pollBuildHook as Q, AGENTCORE_AGUI_PROTOCOL as Qa, HOST_GATEWAY_MIN_VERSION as Qi, addEcsAssumeRoleOptions as Qn, readEmulatorRunFiles as Qo, createWatchPredicates as Qr, resolveDeployedOriginBucket as Qt, setContainerPaused as R, resolveWatchConfig as Ra, VtlEvaluationError as Ri, addAlbSpecificOptions as Rn, awsEmulatorEnvName as Ro, AGENTCORE_SIGV4_SERVICE as Rr, supportedWebFunctionRuntimes as Rt, StudioEventBus as S, substituteAgainstStateAsync as Sa, invokeTokenAuthorizer as Si, WEB_FUNCTION_ENDPOINT_TYPE as Sn, SECOND_ASSUME_MESSAGE as So, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as Sr, normalizeKvsFileKeys as St, formatTargetListing as T, materializeLayerFromArn as Ta, buildCorsConfigByApiId as Ti, WebFunctionResolutionError as Tn, readEnvCallerCredentials as To, attachContainerLogStreamer as Tr, resolveCloudFrontTarget as Tt, rewriteUpgradeResponseHead as U, discoverWebSocketApis as Ua, parseConnectionsPath as Ui, isApplicationLoadBalancer as Un, getActiveWorkloadAwsWiring as Uo, waitForAgentCorePing as Ur, buildWebFunctionLambdaView as Ut, MicrovmStateError as V, listTargets as Va, buildMgmtEndpointEnvUrl as Vi, parseLbPortOverrides as Vn, displayEndpointValue as Vo, invokeAgentCore as Vr, resolveWebFunctionArtifact as Vt, selectTargetPort as W, discoverWebSocketApisOrThrow as Wa, buildConnectEvent as Wi, resolveAlbFrontDoor as Wn, getContainerCaBundlePath as Wo, downloadAndExtractS3Bundle as Wr, finalizeWebFunctionEnv as Wt, callRuntimeHook as X, resolveLambdaArnIntrinsic as Xa, createLocalInvokeCommand as Xi, MAX_TASKS_SUBNET_RANGE_CAP as Xn, parseAwsEndpoint as Xo, addStartApiSpecificOptions as Xr, createDeployedKvsDataSource as Xt, MicrovmHookError as Y, pickRefLogicalId as Ya, addInvokeSpecificOptions as Yi, createLocalRunTaskCommand as Yn, mergeJavaToolOptions as Yo, toCmdArgv as Yr, resolveKvsModulesForDistribution as Yt, generateMicrovmId as Z, AGENTCORE_A2A_PROTOCOL as Za, HOST_DOCKER_INTERNAL_GATEWAY as Zi, addCommonEcsServiceOptions as Zn, probeAwsEmulatorHealth as Zo, createLocalStartApiCommand as Zr, resolveDeployedKvsArnByName as Zt, filterStudioTargetGroups as _, resolveRuntimeFileExtension as _a, verifyJwtViaDiscovery as _i, pickKvsLogicalIdFromArn as _n, parseDynamicReference as _o, isLocalCdkAssetImage as _r, attachAgentCoreWsBridge as _t, createLocalStudioCommand as a, buildLoopbackForwarderDockerArgs as aa, filterRoutesByApiIdentifiers as ai, serveLambdaUrlOrigin as an, derivePseudoParametersFromRegion as ao, resolveSharedSidecarCredentials as ar, writeCaBundleFile as as, disposeMicrovmCodeArtifact as at, renderStudioHtml as b, assertEcsTaskImagesResolvable as ba, evaluateCachedLambdaPolicy as bi, pickWebFunctionEndpointLogicalIdFromOrigin as bn, addAwsEndpointOptions as bo, CloudMapRegistry as br, addStartCloudFrontSpecificOptions as bt, startStudioProxy as c, ensureForwarderImage as ca, startApiServer as ci, buildEdgeRequestEvent as cn, tryResolveImageFnJoin as co, buildImageOverrideTag as cr, isRealAwsHost as cs, resolveMicrovmImageTarget as ct, createStudioDispatcher as d, buildContainerImage as da, defaultCredentialsLoader as di, httpHeadersToEdge as dn, DynamicReferenceResolver as do, mergeForService as dr, sqsEmulatorOriginOf as ds, createLocalStartWebFunctionCommand as dt, resolveHostGatewayExtraHosts as ea, createAuthorizerCache as ei, createS3OriginReader as en, AGENTCORE_MCP_PROTOCOL as eo, buildEcsImageResolutionContext$1 as er, resolveAwsEmulatorOption as es, runHookBody as et, filterStudioCustomResources as f, dockerRegistryEnv as fa, buildCognitoJwksUrl as fi, CLOUDFRONT_DISTRIBUTION_TYPE as fn, containsDynamicReference as fo, parseImageOverrideFlags as fr, buildJavaTrustStore as fs, addStartAgentCoreSpecificOptions as ft, annotatePinnedEcsTargets as g, resolveRuntimeCodeMountPath as ga, verifyJwtAuthorizer as gi, pickFunctionUrlLogicalIdFromOrigin as gn, keysOverriddenBy as go, imageOverrideKeyAliases as gr, startAgentCoreHttpServer as gt, annotateEcsTaskPinnedTargets as h, stripEcrCredentials as ha, verifyCognitoJwt as hi, isCloudFrontDistribution as hn, keysNotFromTemplate as ho, describePinnedImageUri as hr, resolveProfileCredentials as hs, selectServeInboundAuth as ht, coerceStopRequest as i, awaitLoopbackForwarderStatus as ia, filterRoutesByApiIdentifier as ii, serveFromStaticOrigin as in, resolveAgentCoreTarget as io, resolveEcsAssumeRoleOption as ir, takeAwsEmulatorStateSourceHint as is, MicrovmResolutionError as it, readRunHookPayload as j, rejectExplicitCfnStackWithMultipleStacks as ja, applyAuthorizerOverlay as ji, createCloudFrontModule as jn, CA_TRUST_ENV_KEYS as jo, A2A_PATH as jr, startWebFunctionContainer as jt, finalizeMicrovmEnv as k, groupWorkloadsRoutedApart as ka, matchRoute as ki, runViewerResponse as kn, workloadStsClientConfig as ko, invokeAgentCoreWs as kr, planWebFunctionContainer as kt, relayServeRequest as l, startLoopbackForwarder as la, resolveSelectionExpression as li, buildEdgeResponseEvent as ln, LocalInvokeBuildError as lo, canonicalizeImageOverrideKeys as lr, realSqsHostnames as ls, s3KeyOfUri as lt, annotateAlbPinnedBackingServices as m, noImplicitEcrPullArgs as ma, createJwksCache as mi, extractKvsAssociations as mn, firstUsableRegion as mo, runImageOverrideBuilds as mr, buildStsClientConfig as ms, buildAgentCoreServeAuthCheck as mt, coerceRunRequest as n, withWorkloadAwsWiring as na, buildStageMap as ni, startCloudFrontServer as nn, AgentCoreResolutionError as no, parseMaxTasks as nr, resolveWorkloadAwsWiring as ns, MICROVM_DEFAULT_INGRESS_PORT as nt, resolveServeBaseUrl as o, buildNamespaceOwnerForwarderDockerArgs as oa, groupRoutesByServer as oi, applyEdgeRequestResult as on, formatStateRemedy as oo, runEcsServiceEmulator as or, MIXED_MODE_RESIGN_BODY_CAP_BYTES as os, readMicrovmImageConfig as ot, isCustomResourceLambdaTarget as p, isEcrRegistryConfigKey as pa, buildJwksUrlFromIssuer as pi, describeS3OriginDomain as pn, deployedFillMayBeSecret as po, resolveImageOverrides as pr, createMixedModeTlsMaterials as ps, createLocalStartAgentCoreCommand as pt, MAX_RUN_HOOK_PAYLOAD_BYTES as q, webSocketApiMatchesIdentifier as qa, classifySourceChange as qi, serviceStrategy as qn, logMixedModeForWorkload as qo, computeCodeImageTag as qr, webFunctionFidelityWarnings as qt, coerceServeRequest as r, LOOPBACK_FORWARDER_IMAGE as ra, availableApiIdentifiers as ri, resolveErrorResponseCandidates as rn, pickAgentCoreCandidateStack as ro, parseRestartPolicy as rr, setActiveWorkloadAwsWiring as rs, MICROVM_IMAGE_TYPE as rt, createStudioServeManager as s, describeForwarderFailure as sa, readMtlsMaterialsFromDisk as si, applyEdgeResponseResult as sn, substituteImagePlaceholders as so, ImageOverrideError as sr, REAL_SQS_QUEUE_URL as ss, resolveMicrovmCodeArtifact as st, addStudioSpecificOptions as t, attachLoopbackForwarder as ta, attachStageContext as ti, matchBehavior as tn, AGENTCORE_RUNTIME_TYPE as to, ecsClusterOption as tr, resolveHostDefaultCredentials as ts, waitForAppAnswer as tt, reinvoke as u, architectureToPlatform as ua, resolveServiceIntegrationParameters as ui, edgeHeadersToHttp as un, DynamicReferenceResolutionError as uo, enforceImageOverrideOrphans as ur, rewriteSqsQueueUrlsInEnv as us, addStartWebFunctionSpecificOptions as ut, startStudioServer as v, resolveRuntimeImage as va, buildMethodArn as vi, pickLambdaEdgeFunctionLogicalId as vn, resolveDynamicReferencesInEnv as vo, listPinnedTargets as vr, startAgentCoreWsBridge as vt, createLocalListCommand as w, substituteEnvVarsFromStateAsync as wa, applyCorsResponseHeaders as wi, WEB_FUNCTION_TYPE as wn, deployAccountStsClientConfig as wo, getContainerNetworkIp as wr, parseOriginOverrides as wt, createStudioStore as x, substituteAgainstState as xa, invokeRequestAuthorizer as xi, resolveCloudFrontDistribution as xn, awsEndpointOptions as xo, DEFAULT_SHADOW_READY_TIMEOUT_MS as xr, createLocalStartCloudFrontCommand as xt, toStudioTargetGroups as y, EcsTaskResolutionError as ya, computeRequestIdentityHash as yi, pickTargetFunctionLogicalId as yn, withoutKeys as yo, buildCloudMapIndex as yr, LocalStartCloudFrontError as yt, MICROVM_CONTROL_PATH as z, resolveSingleTarget as za, bufferToBody as zi, albStrategy as zn, awsEmulatorSqsHostBlocks as zo, signAgentCoreInvocation as zr, disposeWebFunctionArtifact as zt };
|
|
36796
|
+
//# sourceMappingURL=local-studio-DC3gGXhH.js.map
|