cdk-local 0.158.0 → 0.158.2
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 +4 -3
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +6 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -2
- package/dist/{local-studio-DXVr171Y.d.ts → local-studio-B4EQOGu5.d.ts} +10 -2
- package/dist/{local-studio-DXVr171Y.d.ts.map → local-studio-B4EQOGu5.d.ts.map} +1 -1
- package/dist/{local-studio-vhvbqvPb.js → local-studio-DKhMiVll.js} +368 -79
- package/dist/local-studio-DKhMiVll.js.map +1 -0
- package/package.json +1 -1
- package/dist/local-studio-vhvbqvPb.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
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-CoZdbeos.js";
|
|
2
2
|
import { a as displayIdent, c as getEmbedConfig, i as STACK_REF_MAX_CODE_POINTS, o as displayStackName, s as displayToolOutput, t as getLogger, u as setEmbedConfig } from "./logger-Co5XVwco.js";
|
|
3
3
|
import { chmodSync, cpSync, createWriteStream, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { homedir, tmpdir } from "node:os";
|
|
4
|
+
import { homedir, hostname, tmpdir } from "node:os";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
import path, { basename, dirname, isAbsolute, join, normalize, relative, resolve, sep } from "node:path";
|
|
7
7
|
import { Command, InvalidArgumentError, Option } from "commander";
|
|
@@ -4910,6 +4910,14 @@ var EcsTaskResolutionError = class EcsTaskResolutionError extends Error {
|
|
|
4910
4910
|
Object.setPrototypeOf(this, EcsTaskResolutionError.prototype);
|
|
4911
4911
|
}
|
|
4912
4912
|
};
|
|
4913
|
+
function assertEcsTaskImagesResolvable(task, coveredContainers = /* @__PURE__ */ new Set()) {
|
|
4914
|
+
const reasons = [];
|
|
4915
|
+
for (const c of task.containers) {
|
|
4916
|
+
if (c.image.kind !== "same-stack-ecr" || coveredContainers.has(c.name)) continue;
|
|
4917
|
+
reasons.push(c.image.unresolvedReason);
|
|
4918
|
+
}
|
|
4919
|
+
if (reasons.length > 0) throw new EcsTaskResolutionError(reasons.join("\n"));
|
|
4920
|
+
}
|
|
4913
4921
|
function detectEcsImageResolutionNeeds(stack) {
|
|
4914
4922
|
const resources = stack.template.Resources ?? {};
|
|
4915
4923
|
let needsPseudoParameters = false;
|
|
@@ -5345,6 +5353,7 @@ function parseContainerDefinition(raw, idx, taskLogicalId, resources, stack, con
|
|
|
5345
5353
|
ulimits,
|
|
5346
5354
|
warnings
|
|
5347
5355
|
};
|
|
5356
|
+
if (droppedSecretKeys.length > 0) out.droppedSecretNames = droppedSecretKeys.map((d) => d.key);
|
|
5348
5357
|
if (command !== void 0) out.command = command;
|
|
5349
5358
|
if (entryPoint !== void 0) out.entryPoint = entryPoint;
|
|
5350
5359
|
if (workingDirectory !== void 0) out.workingDirectory = workingDirectory;
|
|
@@ -5364,10 +5373,11 @@ function buildSubstitutionContextFromImageContext(context) {
|
|
|
5364
5373
|
}
|
|
5365
5374
|
function parseContainerImage(raw, containerName, taskLogicalId, resources, _stack, context) {
|
|
5366
5375
|
const getAttImage = tryResolveImageGetAtt(raw, resources, context);
|
|
5367
|
-
if (getAttImage) return classifyResolvedImage(getAttImage);
|
|
5376
|
+
if (getAttImage?.kind === "resolved") return classifyResolvedImage(getAttImage.uri);
|
|
5377
|
+
if (getAttImage?.kind === "needs-state") return sameStackEcrImage(containerName, taskLogicalId, getAttImage.repoLogicalId, context);
|
|
5368
5378
|
const joinResolved = tryResolveImageFnJoin(raw, resources, context);
|
|
5369
5379
|
if (joinResolved.kind === "resolved") return classifyResolvedImage(joinResolved.uri);
|
|
5370
|
-
if (joinResolved.kind === "needs-state")
|
|
5380
|
+
if (joinResolved.kind === "needs-state") return sameStackEcrImage(containerName, taskLogicalId, joinResolved.repoLogicalId, context, " via Fn::Join");
|
|
5371
5381
|
if (joinResolved.kind === "unsupported-join") throw new EcsTaskResolutionError(`Container ${displayIdent(containerName)} in task ${displayIdent(taskLogicalId)} has an unsupported Fn::Join Image shape: ${joinResolved.reason}. ${getEmbedConfig().cliName} recognizes the canonical CDK 2.x ContainerImage.fromEcrRepository Fn::Join shape (delimiter "" with nested Fn::Select/Fn::Split over an ECR Repository Arn GetAtt + Ref to the repo).`);
|
|
5372
5382
|
const flat = extractImageString(raw);
|
|
5373
5383
|
if (!flat) throw new EcsTaskResolutionError(`Container ${displayIdent(containerName)} in task ${displayIdent(taskLogicalId)} has an unparseable Image property. ${getEmbedConfig().cliName} supports flat string images, single-key Fn::Sub bodies, and CDK-asset Image references.`);
|
|
@@ -5380,7 +5390,7 @@ function parseContainerImage(raw, containerName, taskLogicalId, resources, _stac
|
|
|
5380
5390
|
const substituted = substituteImagePlaceholders(flat, resources, context);
|
|
5381
5391
|
if (substituted.includes("${")) {
|
|
5382
5392
|
const unresolvedRepoRef = findUnresolvedEcrRepositoryRef(substituted, resources);
|
|
5383
|
-
if (unresolvedRepoRef)
|
|
5393
|
+
if (unresolvedRepoRef) return sameStackEcrImage(containerName, taskLogicalId, unresolvedRepoRef, context);
|
|
5384
5394
|
if (substituted.includes("AWS::")) throw new EcsTaskResolutionError(`Container ${displayIdent(containerName)} in task ${displayIdent(taskLogicalId)} has an Image that references AWS pseudo parameters (${displayUntrustedValue(substituted)}). ${getEmbedConfig().productName} could not resolve them: confirm AWS credentials are configured so STS GetCallerIdentity succeeds, and that --region / AWS_REGION names the target region. Workaround: build the image locally (ContainerImage.fromAsset) or pin a public image.`);
|
|
5385
5395
|
throw new EcsTaskResolutionError(`Container ${displayIdent(containerName)} in task ${displayIdent(taskLogicalId)} has an Image with unresolved \${...} placeholders (${displayUntrustedValue(substituted)}). ${getEmbedConfig().cliName} only resolves AWS pseudo parameters and same-stack AWS::ECR::Repository refs.`);
|
|
5386
5396
|
}
|
|
@@ -5396,6 +5406,13 @@ function parseContainerImage(raw, containerName, taskLogicalId, resources, _stac
|
|
|
5396
5406
|
uri: substituted
|
|
5397
5407
|
};
|
|
5398
5408
|
}
|
|
5409
|
+
function sameStackEcrImage(containerName, taskLogicalId, repoLogicalId, context, via = "") {
|
|
5410
|
+
return {
|
|
5411
|
+
kind: "same-stack-ecr",
|
|
5412
|
+
repoLogicalId,
|
|
5413
|
+
unresolvedReason: `Container ${displayIdent(containerName)} in task ${displayIdent(taskLogicalId)} references same-stack ECR repository ${displayIdent(repoLogicalId)}${via}. ${getEmbedConfig().cliName} cannot resolve the repository URI without state — ` + formatStateRemedy(context) + ", build via ContainerImage.fromAsset, pin a public image, or pass --image-override to build it from a local Dockerfile."
|
|
5414
|
+
};
|
|
5415
|
+
}
|
|
5399
5416
|
function findUnresolvedEcrRepositoryRef(substituted, resources) {
|
|
5400
5417
|
const placeholderRegex = /\$\{([^}]+)\}/g;
|
|
5401
5418
|
let m;
|
|
@@ -5446,7 +5463,14 @@ function tryResolveImageGetAtt(raw, resources, context) {
|
|
|
5446
5463
|
if (resources[logicalId]?.Type !== "AWS::ECR::Repository") return void 0;
|
|
5447
5464
|
if (attr !== "RepositoryUri" && attr !== "Arn") return void 0;
|
|
5448
5465
|
const cached = context?.stateResources?.[logicalId]?.attributes?.[attr];
|
|
5449
|
-
if (typeof cached === "string" && cached.length > 0) return
|
|
5466
|
+
if (typeof cached === "string" && cached.length > 0) return {
|
|
5467
|
+
kind: "resolved",
|
|
5468
|
+
uri: cached
|
|
5469
|
+
};
|
|
5470
|
+
if (attr === "RepositoryUri") return {
|
|
5471
|
+
kind: "needs-state",
|
|
5472
|
+
repoLogicalId: logicalId
|
|
5473
|
+
};
|
|
5450
5474
|
}
|
|
5451
5475
|
function extractImageString(value) {
|
|
5452
5476
|
if (typeof value === "string" && value.length > 0) return value;
|
|
@@ -16246,7 +16270,8 @@ function writePrefixedLines(prefix, buffer, out) {
|
|
|
16246
16270
|
const execFileAsync$5 = promisify(execFile);
|
|
16247
16271
|
const METADATA_ENDPOINT_IMAGE = "amazon/amazon-ecs-local-container-endpoints:latest-amd64";
|
|
16248
16272
|
const METADATA_ENDPOINT_IP = "169.254.170.2";
|
|
16249
|
-
const
|
|
16273
|
+
const TASK_ROLE_SUBNET_OCTET = 170;
|
|
16274
|
+
const TASK_ROLE_CREDENTIALS_PATH = "/creds";
|
|
16250
16275
|
function buildEndpointSubnet(subnetOctet) {
|
|
16251
16276
|
if (subnetOctet < 1 || subnetOctet > 254 || !Number.isInteger(subnetOctet)) throw new Error(`buildEndpointSubnet: subnetOctet must be an integer in 1..254 (got ${subnetOctet}).`);
|
|
16252
16277
|
return {
|
|
@@ -16255,25 +16280,53 @@ function buildEndpointSubnet(subnetOctet) {
|
|
|
16255
16280
|
};
|
|
16256
16281
|
}
|
|
16257
16282
|
const SHARED_SVC_SUBNET_OCTET = 171;
|
|
16283
|
+
const OWNER_PID_LABEL = "cdk-local.owner-pid";
|
|
16284
|
+
const OWNER_HOST_LABEL = "cdk-local.owner-host";
|
|
16285
|
+
function fallbackSubnetOctets(preferred) {
|
|
16286
|
+
const out = [preferred];
|
|
16287
|
+
const push = (o) => {
|
|
16288
|
+
if (o !== preferred) out.push(o);
|
|
16289
|
+
};
|
|
16290
|
+
for (let o = 171; o <= 254; o++) push(o);
|
|
16291
|
+
for (let o = 1; o <= 168; o++) push(o);
|
|
16292
|
+
return out;
|
|
16293
|
+
}
|
|
16294
|
+
function isSubnetTakenError(message) {
|
|
16295
|
+
return /pool overlaps|overlaps with|overlapping|is already used|already in use/i.test(message);
|
|
16296
|
+
}
|
|
16258
16297
|
async function createSharedSvcNetwork(options = {}) {
|
|
16259
16298
|
const prefix = options.prefix ?? getEmbedConfig().resourceNamePrefix;
|
|
16260
16299
|
await sweepOrphanedSvcNetworks(prefix);
|
|
16261
16300
|
const networkName = `${prefix}-svc-${randomBytes(4).toString("hex")}`;
|
|
16262
|
-
const {
|
|
16301
|
+
const { sidecarContainerId, sidecarIp } = await createNetworkAndSidecar({
|
|
16302
|
+
networkName,
|
|
16303
|
+
subnetOctets: options.taskRole ? [170] : fallbackSubnetOctets(171),
|
|
16304
|
+
labels: {
|
|
16305
|
+
[OWNER_PID_LABEL]: String(process.pid),
|
|
16306
|
+
[OWNER_HOST_LABEL]: hostname()
|
|
16307
|
+
},
|
|
16308
|
+
skipPull: options.skipPull ?? false,
|
|
16309
|
+
...options.credentials !== void 0 ? { credentials: options.credentials } : {},
|
|
16310
|
+
...options.cluster !== void 0 ? { cluster: options.cluster } : {}
|
|
16311
|
+
});
|
|
16263
16312
|
return {
|
|
16264
16313
|
networkName,
|
|
16265
|
-
sidecarContainerId
|
|
16266
|
-
networkName,
|
|
16267
|
-
cidr,
|
|
16268
|
-
sidecarIp,
|
|
16269
|
-
skipPull: options.skipPull ?? false,
|
|
16270
|
-
...options.credentials !== void 0 ? { credentials: options.credentials } : {},
|
|
16271
|
-
...options.cluster !== void 0 ? { cluster: options.cluster } : {}
|
|
16272
|
-
}),
|
|
16314
|
+
sidecarContainerId,
|
|
16273
16315
|
sidecarIp,
|
|
16274
16316
|
ownedByCaller: true
|
|
16275
16317
|
};
|
|
16276
16318
|
}
|
|
16319
|
+
function ownerIsAlive(pidLabel, hostLabel) {
|
|
16320
|
+
if (hostLabel !== hostname()) return true;
|
|
16321
|
+
const pid = Number(pidLabel);
|
|
16322
|
+
if (!Number.isInteger(pid) || pid <= 0) return true;
|
|
16323
|
+
try {
|
|
16324
|
+
process.kill(pid, 0);
|
|
16325
|
+
return true;
|
|
16326
|
+
} catch (err) {
|
|
16327
|
+
return err.code !== "ESRCH";
|
|
16328
|
+
}
|
|
16329
|
+
}
|
|
16277
16330
|
async function sweepOrphanedSvcNetworks(prefix) {
|
|
16278
16331
|
const logger = getLogger().child("ecs-network");
|
|
16279
16332
|
const filter = `${prefix}-svc-`;
|
|
@@ -16312,6 +16365,29 @@ async function sweepOrphanedSvcNetworks(prefix) {
|
|
|
16312
16365
|
}
|
|
16313
16366
|
const sidecarName = `${name}-metadata`;
|
|
16314
16367
|
if (attached.some((c) => c !== sidecarName)) continue;
|
|
16368
|
+
let owner;
|
|
16369
|
+
try {
|
|
16370
|
+
const { stdout } = await execFileAsync$5(getDockerCmd(), [
|
|
16371
|
+
"network",
|
|
16372
|
+
"inspect",
|
|
16373
|
+
name,
|
|
16374
|
+
"--format",
|
|
16375
|
+
`{{index .Labels "${OWNER_PID_LABEL}"}} {{index .Labels "${OWNER_HOST_LABEL}"}}`
|
|
16376
|
+
]);
|
|
16377
|
+
const [pid = "", host = ""] = stdout.trim().split(/\s+/);
|
|
16378
|
+
owner = {
|
|
16379
|
+
pid,
|
|
16380
|
+
host
|
|
16381
|
+
};
|
|
16382
|
+
} catch (err) {
|
|
16383
|
+
const e = err;
|
|
16384
|
+
logger.debug(`docker network inspect ${name} labels (sweep) failed: ${displayToolOutput(e.stderr || e.message || String(err))}`);
|
|
16385
|
+
continue;
|
|
16386
|
+
}
|
|
16387
|
+
if (owner.pid !== "" && ownerIsAlive(owner.pid, owner.host)) {
|
|
16388
|
+
if (owner.host !== hostname()) logger.info(`Keeping shared network ${name}: it was created on host ${displayToolOutput(owner.host)}, whose processes cannot be checked from here; \`docker network rm\` it if it is stale.`);
|
|
16389
|
+
continue;
|
|
16390
|
+
}
|
|
16315
16391
|
logger.info(`Reclaiming orphaned shared network ${name} (no live owner)...`);
|
|
16316
16392
|
await removeContainer(sidecarName);
|
|
16317
16393
|
await destroyNetworkOnly(name);
|
|
@@ -16321,23 +16397,66 @@ async function sweepOrphanedSvcNetworks(prefix) {
|
|
|
16321
16397
|
}
|
|
16322
16398
|
async function createNetworkAndSidecar(args) {
|
|
16323
16399
|
const logger = getLogger().child("ecs-network");
|
|
16324
|
-
const { networkName,
|
|
16400
|
+
const { networkName, subnetOctets, labels, credentials, cluster, skipPull } = args;
|
|
16325
16401
|
await pullImage(METADATA_ENDPOINT_IMAGE, skipPull);
|
|
16326
|
-
|
|
16402
|
+
const labelArgs = Object.entries(labels ?? {}).flatMap(([k, v]) => ["--label", `${k}=${v}`]);
|
|
16403
|
+
let sidecarIp;
|
|
16404
|
+
let lastCidr = "";
|
|
16405
|
+
let lastDetail = "";
|
|
16406
|
+
logger.info(`Creating docker network ${networkName}...`);
|
|
16407
|
+
for (const octet of subnetOctets) {
|
|
16408
|
+
const subnet = buildEndpointSubnet(octet);
|
|
16409
|
+
lastCidr = subnet.cidr;
|
|
16410
|
+
logger.debug(`Trying subnet ${subnet.cidr} for ${networkName}`);
|
|
16411
|
+
try {
|
|
16412
|
+
await execFileAsync$5(getDockerCmd(), [
|
|
16413
|
+
"network",
|
|
16414
|
+
"create",
|
|
16415
|
+
"--driver",
|
|
16416
|
+
"bridge",
|
|
16417
|
+
"--subnet",
|
|
16418
|
+
subnet.cidr,
|
|
16419
|
+
...labelArgs,
|
|
16420
|
+
networkName
|
|
16421
|
+
]);
|
|
16422
|
+
sidecarIp = subnet.sidecarIp;
|
|
16423
|
+
logger.info(`Created docker network ${networkName} (subnet ${subnet.cidr})`);
|
|
16424
|
+
break;
|
|
16425
|
+
} catch (err) {
|
|
16426
|
+
const e = err;
|
|
16427
|
+
lastDetail = e.stderr?.trim() || e.message || String(err);
|
|
16428
|
+
if (subnetOctets.length > 1 && isSubnetTakenError(lastDetail)) {
|
|
16429
|
+
logger.debug(`Subnet ${subnet.cidr} is taken; trying the next link-local /24`);
|
|
16430
|
+
continue;
|
|
16431
|
+
}
|
|
16432
|
+
break;
|
|
16433
|
+
}
|
|
16434
|
+
}
|
|
16435
|
+
if (sidecarIp === void 0) {
|
|
16436
|
+
let hint;
|
|
16437
|
+
if (subnetOctets.length > 1) hint = isSubnetTakenError(lastDetail) ? "Hint: every candidate link-local /24 subnet is taken; remove leftover networks with `docker network ls` + `docker network rm`." : "Hint: check that the docker daemon is running and can create bridge networks.";
|
|
16438
|
+
else if (isSubnetTakenError(lastDetail)) hint = pinnedSubnetConflictHint(lastCidr, await findNetworkHoldingSubnet(lastCidr));
|
|
16439
|
+
else hint = "Hint: check that the docker daemon is running and can create bridge networks.";
|
|
16440
|
+
throw new DockerRunnerError(`docker network create failed: ${displayToolOutput(lastDetail)}. ${hint}`);
|
|
16441
|
+
}
|
|
16327
16442
|
try {
|
|
16328
|
-
|
|
16329
|
-
|
|
16330
|
-
|
|
16331
|
-
|
|
16332
|
-
|
|
16333
|
-
|
|
16334
|
-
|
|
16335
|
-
|
|
16336
|
-
|
|
16443
|
+
return {
|
|
16444
|
+
sidecarContainerId: await startSidecar({
|
|
16445
|
+
networkName,
|
|
16446
|
+
sidecarIp,
|
|
16447
|
+
...credentials !== void 0 ? { credentials } : {},
|
|
16448
|
+
...cluster !== void 0 ? { cluster } : {}
|
|
16449
|
+
}),
|
|
16450
|
+
sidecarIp
|
|
16451
|
+
};
|
|
16337
16452
|
} catch (err) {
|
|
16338
|
-
|
|
16339
|
-
throw
|
|
16453
|
+
await destroyNetworkOnly(networkName);
|
|
16454
|
+
throw err;
|
|
16340
16455
|
}
|
|
16456
|
+
}
|
|
16457
|
+
async function startSidecar(args) {
|
|
16458
|
+
const logger = getLogger().child("ecs-network");
|
|
16459
|
+
const { networkName, sidecarIp, credentials, cluster } = args;
|
|
16341
16460
|
const sidecarArgs = [
|
|
16342
16461
|
"run",
|
|
16343
16462
|
"-d",
|
|
@@ -16368,26 +16487,21 @@ async function createNetworkAndSidecar(args) {
|
|
|
16368
16487
|
});
|
|
16369
16488
|
return stdout.trim();
|
|
16370
16489
|
} catch (err) {
|
|
16371
|
-
await destroyNetworkOnly(networkName);
|
|
16372
16490
|
throw new DockerRunnerError(`Failed to start metadata-endpoints sidecar: ${displayToolOutput(err.stderr?.trim() || describeExitWithoutArgv(err))}`);
|
|
16373
16491
|
}
|
|
16374
16492
|
}
|
|
16375
16493
|
async function createTaskNetwork(options = {}) {
|
|
16376
16494
|
const networkName = `${options.prefix ?? getEmbedConfig().resourceNamePrefix}-task-${randomBytes(4).toString("hex")}`;
|
|
16377
|
-
const {
|
|
16378
|
-
|
|
16379
|
-
|
|
16380
|
-
|
|
16495
|
+
const { sidecarContainerId, sidecarIp } = await createNetworkAndSidecar({
|
|
16496
|
+
networkName,
|
|
16497
|
+
subnetOctets: options.subnetOctet === void 0 ? [170] : fallbackSubnetOctets(options.subnetOctet),
|
|
16498
|
+
skipPull: options.skipPull ?? false,
|
|
16499
|
+
...options.credentials !== void 0 ? { credentials: options.credentials } : {},
|
|
16500
|
+
...options.cluster !== void 0 ? { cluster: options.cluster } : {}
|
|
16501
|
+
});
|
|
16381
16502
|
return {
|
|
16382
16503
|
networkName,
|
|
16383
|
-
sidecarContainerId
|
|
16384
|
-
networkName,
|
|
16385
|
-
cidr,
|
|
16386
|
-
sidecarIp,
|
|
16387
|
-
skipPull: options.skipPull ?? false,
|
|
16388
|
-
...options.credentials !== void 0 ? { credentials: options.credentials } : {},
|
|
16389
|
-
...options.cluster !== void 0 ? { cluster: options.cluster } : {}
|
|
16390
|
-
}),
|
|
16504
|
+
sidecarContainerId,
|
|
16391
16505
|
sidecarIp
|
|
16392
16506
|
};
|
|
16393
16507
|
}
|
|
@@ -16397,10 +16511,56 @@ function buildMetadataEnv(opts) {
|
|
|
16397
16511
|
ECS_CONTAINER_METADATA_URI_V4: `http://${ip}/v4/${opts.containerName}`,
|
|
16398
16512
|
ECS_CONTAINER_METADATA_URI: `http://${ip}/v3/${opts.containerName}`
|
|
16399
16513
|
};
|
|
16400
|
-
if (opts.roleArn)
|
|
16514
|
+
if (opts.roleArn) {
|
|
16515
|
+
if (ip !== "169.254.170.2") throw new DockerRunnerError(`A task role needs the metadata sidecar at ${METADATA_ENDPOINT_IP} (SDKs read task-role credentials only from there), but this task's network put it at ${ip}.`);
|
|
16516
|
+
env["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"] = TASK_ROLE_CREDENTIALS_PATH;
|
|
16517
|
+
}
|
|
16401
16518
|
if (opts.region) env["AWS_REGION"] = opts.region;
|
|
16402
16519
|
return env;
|
|
16403
16520
|
}
|
|
16521
|
+
async function serveTaskRoleFromSharedSidecar(net, args) {
|
|
16522
|
+
if (net.taskRoleArn === args.roleArn) return;
|
|
16523
|
+
if (net.taskRoleArn !== void 0) throw new DockerRunnerError(`This run's services resolve to different task roles (${displayToolOutput(net.taskRoleArn)} and ${displayToolOutput(args.roleArn)}; on a --watch reload, the task role changed since startup), but the shared metadata sidecar at ${METADATA_ENDPOINT_IP} can serve only one. Pass one role for every service with \`--assume-role <arn>\`, start the services in separate runs one at a time, or restart the run after changing the role.`);
|
|
16524
|
+
if (net.sidecarIp !== "169.254.170.2") throw new DockerRunnerError(`A task role needs the metadata sidecar at ${METADATA_ENDPOINT_IP}, but network ${net.networkName} put it at ${net.sidecarIp}.`);
|
|
16525
|
+
getLogger().child("ecs-network").info(`Restarting the metadata sidecar to serve task role ${displayToolOutput(args.roleArn)}...`);
|
|
16526
|
+
await removeContainer(net.sidecarContainerId);
|
|
16527
|
+
net.sidecarContainerId = await startSidecar({
|
|
16528
|
+
networkName: net.networkName,
|
|
16529
|
+
sidecarIp: net.sidecarIp,
|
|
16530
|
+
credentials: args.credentials,
|
|
16531
|
+
...args.cluster !== void 0 ? { cluster: args.cluster } : {}
|
|
16532
|
+
});
|
|
16533
|
+
net.taskRoleArn = args.roleArn;
|
|
16534
|
+
}
|
|
16535
|
+
async function findNetworkHoldingSubnet(cidr) {
|
|
16536
|
+
try {
|
|
16537
|
+
const { stdout: ls } = await execFileAsync$5(getDockerCmd(), [
|
|
16538
|
+
"network",
|
|
16539
|
+
"ls",
|
|
16540
|
+
"--format",
|
|
16541
|
+
"{{.Name}}"
|
|
16542
|
+
]);
|
|
16543
|
+
const names = ls.split("\n").map((n) => n.trim()).filter((n) => n.length > 0);
|
|
16544
|
+
if (names.length === 0) return void 0;
|
|
16545
|
+
const { stdout } = await execFileAsync$5(getDockerCmd(), [
|
|
16546
|
+
"network",
|
|
16547
|
+
"inspect",
|
|
16548
|
+
"--format",
|
|
16549
|
+
"{{.Name}} {{range .IPAM.Config}}{{.Subnet}} {{end}}",
|
|
16550
|
+
...names
|
|
16551
|
+
]);
|
|
16552
|
+
for (const line of stdout.split("\n")) {
|
|
16553
|
+
const [name, ...subnets] = line.trim().split(/\s+/);
|
|
16554
|
+
if (name && subnets.includes(cidr)) return name;
|
|
16555
|
+
}
|
|
16556
|
+
} catch {}
|
|
16557
|
+
}
|
|
16558
|
+
function pinnedSubnetConflictHint(cidr, holder) {
|
|
16559
|
+
const { productName, cliName } = getEmbedConfig();
|
|
16560
|
+
const who = holder !== void 0 ? `docker network ${displayToolOutput(holder)} already holds ${cidr}` : `another network already holds ${cidr}`;
|
|
16561
|
+
const remove = holder !== void 0 ? `\`docker network rm ${displayToolOutput(holder)}\`` : "`docker network ls` + `docker network rm`";
|
|
16562
|
+
return `Hint: ${who}. A task role needs that subnet: AWS SDKs read task-role credentials only from the metadata sidecar at ${METADATA_ENDPOINT_IP}, so a ${productName} run with a task role (\`${cliName} run-task\` / \`start-service\` / \`start-alb\` with \`--assume-role\`) cannot move to another subnet, and only one can be active per host. Stop the run that owns it, or remove a leftover network with ${remove}, then retry.`;
|
|
16563
|
+
}
|
|
16404
16564
|
async function destroyTaskNetwork(net) {
|
|
16405
16565
|
if (!net) return;
|
|
16406
16566
|
await removeContainer(net.sidecarContainerId);
|
|
@@ -16590,6 +16750,7 @@ async function runEcsTask(task, options, state) {
|
|
|
16590
16750
|
for (const c of task.containers) {
|
|
16591
16751
|
const refusal = finchSecretArgvRefusal([
|
|
16592
16752
|
...c.secrets.map((s) => s.name),
|
|
16753
|
+
...(c.droppedSecretNames ?? []).filter((n) => overriddenEnvKeys(options.envOverrides, c.name).includes(n)),
|
|
16593
16754
|
...c.sensitiveEnvKeys,
|
|
16594
16755
|
...dynamicReferenceEnvKeys(c, options.envOverrides)
|
|
16595
16756
|
].filter((n) => !isMalformedEnvKey(n) && !isDockerClientEnvKey(n)), {
|
|
@@ -16612,11 +16773,20 @@ async function runEcsTask(task, options, state) {
|
|
|
16612
16773
|
const imagePlan = options.imagePlanByContainer ?? /* @__PURE__ */ new Map();
|
|
16613
16774
|
if (!options.imagePlanByContainer) await prepareImages(task, imagePlan, options);
|
|
16614
16775
|
const allSecrets = [];
|
|
16615
|
-
for (const c of task.containers)
|
|
16616
|
-
|
|
16617
|
-
|
|
16618
|
-
|
|
16619
|
-
|
|
16776
|
+
for (const c of task.containers) {
|
|
16777
|
+
const overridden = new Set(overriddenEnvKeys(options.envOverrides, c.name));
|
|
16778
|
+
for (const s of c.secrets) {
|
|
16779
|
+
if (overridden.has(s.name)) {
|
|
16780
|
+
logger.debug(`Secret ${displayIdent(c.name)}.${displayIdent(s.name)} not fetched: --env-vars gives this key.`);
|
|
16781
|
+
continue;
|
|
16782
|
+
}
|
|
16783
|
+
allSecrets.push({
|
|
16784
|
+
containerName: c.name,
|
|
16785
|
+
name: s.name,
|
|
16786
|
+
valueFrom: s.valueFrom
|
|
16787
|
+
});
|
|
16788
|
+
}
|
|
16789
|
+
}
|
|
16620
16790
|
const secretsByContainer = groupSecretsByContainer(await resolveEcsSecrets(allSecrets, {
|
|
16621
16791
|
...options.region !== void 0 && { region: options.region },
|
|
16622
16792
|
...options.profile !== void 0 && { profile: options.profile }
|
|
@@ -16648,7 +16818,7 @@ async function runEcsTask(task, options, state) {
|
|
|
16648
16818
|
};
|
|
16649
16819
|
if (options.taskCredentials) netCreateOpts.credentials = options.taskCredentials;
|
|
16650
16820
|
if (options.cluster) netCreateOpts.cluster = options.cluster;
|
|
16651
|
-
if (options.
|
|
16821
|
+
if (!options.taskRoleArn) netCreateOpts.subnetOctet = options.subnetOctet ?? 171;
|
|
16652
16822
|
state.network = await createTaskNetwork(netCreateOpts);
|
|
16653
16823
|
}
|
|
16654
16824
|
const volumeByName = await realizeDockerVolumes(task.volumes, state);
|
|
@@ -16871,6 +17041,7 @@ async function prepareImages(task, out, options) {
|
|
|
16871
17041
|
async function prepareOneImage(task, container, options) {
|
|
16872
17042
|
const image = container.image;
|
|
16873
17043
|
switch (image.kind) {
|
|
17044
|
+
case "same-stack-ecr": throw new EcsTaskRunnerError(image.unresolvedReason);
|
|
16874
17045
|
case "public":
|
|
16875
17046
|
await pullImage(image.uri, options.skipPull);
|
|
16876
17047
|
return image.uri;
|
|
@@ -17092,6 +17263,8 @@ function buildDockerRunArgs(opts) {
|
|
|
17092
17263
|
}
|
|
17093
17264
|
const sensitiveEnvKeys = new Set(SENSITIVE_ENV_KEYS);
|
|
17094
17265
|
for (const s of secrets) sensitiveEnvKeys.add(s.name);
|
|
17266
|
+
for (const s of container.secrets) sensitiveEnvKeys.add(s.name);
|
|
17267
|
+
for (const n of container.droppedSecretNames ?? []) sensitiveEnvKeys.add(n);
|
|
17095
17268
|
for (const k of container.sensitiveEnvKeys) sensitiveEnvKeys.add(k);
|
|
17096
17269
|
const { passthrough: sensitiveEnv, collisions } = appendEnvFlags(args, finalEnv, sensitiveEnvKeys);
|
|
17097
17270
|
if (container.user) args.push("--user", container.user);
|
|
@@ -19927,6 +20100,7 @@ function describePinnedImageUri(service) {
|
|
|
19927
20100
|
const image = representativeImage(service);
|
|
19928
20101
|
if (!image) return void 0;
|
|
19929
20102
|
if (image.kind === "cdk-asset") return void 0;
|
|
20103
|
+
if (image.kind === "same-stack-ecr") return `same-stack ECR repository ${image.repoLogicalId}`;
|
|
19930
20104
|
return image.uri;
|
|
19931
20105
|
}
|
|
19932
20106
|
function imageOverrideKeyAliases(service) {
|
|
@@ -20069,6 +20243,20 @@ function parseImageOverrideFlags(input) {
|
|
|
20069
20243
|
if (!stage) throw new ImageOverrideError(`Invalid --image-target value "${raw}": right side (stage) is empty.`);
|
|
20070
20244
|
getPerSvc(svc).targetStage = stage;
|
|
20071
20245
|
}
|
|
20246
|
+
const imageContextList = input.imageContext === void 0 ? [] : Array.isArray(input.imageContext) ? input.imageContext : [input.imageContext];
|
|
20247
|
+
for (const raw of imageContextList) {
|
|
20248
|
+
if (!raw || !raw.trim()) throw new ImageOverrideError("Invalid --image-context value: empty string.");
|
|
20249
|
+
const eq = raw.indexOf("=");
|
|
20250
|
+
if (eq < 0) {
|
|
20251
|
+
globals.contextDir = raw.trim();
|
|
20252
|
+
continue;
|
|
20253
|
+
}
|
|
20254
|
+
const svc = raw.slice(0, eq).trim();
|
|
20255
|
+
const dir = raw.slice(eq + 1).trim();
|
|
20256
|
+
if (!svc) throw new ImageOverrideError(`Invalid --image-context value "${raw}": left side (service target) is empty.`);
|
|
20257
|
+
if (!dir) throw new ImageOverrideError(`Invalid --image-context value "${raw}": right side (build context directory) is empty.`);
|
|
20258
|
+
getPerSvc(svc).contextDir = dir;
|
|
20259
|
+
}
|
|
20072
20260
|
return {
|
|
20073
20261
|
explicit,
|
|
20074
20262
|
pickerPaths,
|
|
@@ -20114,7 +20302,8 @@ function canonicalizeImageOverrideKeys(rawFlags, pinnedAliases, knownTargets = [
|
|
|
20114
20302
|
perService.set(target, {
|
|
20115
20303
|
buildArgs: new Map(overlay.buildArgs),
|
|
20116
20304
|
buildSecrets: new Map(overlay.buildSecrets),
|
|
20117
|
-
...overlay.targetStage !== void 0 && { targetStage: overlay.targetStage }
|
|
20305
|
+
...overlay.targetStage !== void 0 && { targetStage: overlay.targetStage },
|
|
20306
|
+
...overlay.contextDir !== void 0 && { contextDir: overlay.contextDir }
|
|
20118
20307
|
});
|
|
20119
20308
|
continue;
|
|
20120
20309
|
}
|
|
@@ -20133,6 +20322,10 @@ function canonicalizeImageOverrideKeys(rawFlags, pinnedAliases, knownTargets = [
|
|
|
20133
20322
|
if (into.targetStage !== void 0 && into.targetStage !== overlay.targetStage) conflict("the target stage");
|
|
20134
20323
|
into.targetStage = overlay.targetStage;
|
|
20135
20324
|
}
|
|
20325
|
+
if (overlay.contextDir !== void 0) {
|
|
20326
|
+
if (into.contextDir !== void 0 && resolve(expandTilde(into.contextDir)) !== resolve(expandTilde(overlay.contextDir))) conflict("the build context");
|
|
20327
|
+
into.contextDir = overlay.contextDir;
|
|
20328
|
+
}
|
|
20136
20329
|
}
|
|
20137
20330
|
return {
|
|
20138
20331
|
...rawFlags,
|
|
@@ -20300,16 +20493,19 @@ function mergeForService(serviceTarget, globals, perService) {
|
|
|
20300
20493
|
const buildArgs = new Map(globals.buildArgs);
|
|
20301
20494
|
const buildSecrets = new Map(globals.buildSecrets);
|
|
20302
20495
|
let targetStage = globals.targetStage;
|
|
20496
|
+
let contextDir = globals.contextDir;
|
|
20303
20497
|
const overlay = perService.get(serviceTarget);
|
|
20304
20498
|
if (overlay) {
|
|
20305
20499
|
for (const [k, v] of overlay.buildArgs.entries()) buildArgs.set(k, v);
|
|
20306
20500
|
for (const [k, v] of overlay.buildSecrets.entries()) buildSecrets.set(k, v);
|
|
20307
20501
|
if (overlay.targetStage !== void 0) targetStage = overlay.targetStage;
|
|
20502
|
+
if (overlay.contextDir !== void 0) contextDir = overlay.contextDir;
|
|
20308
20503
|
}
|
|
20309
20504
|
return {
|
|
20310
20505
|
buildArgs,
|
|
20311
20506
|
buildSecrets,
|
|
20312
|
-
...targetStage !== void 0 && { targetStage }
|
|
20507
|
+
...targetStage !== void 0 && { targetStage },
|
|
20508
|
+
...contextDir !== void 0 && { contextDir }
|
|
20313
20509
|
};
|
|
20314
20510
|
}
|
|
20315
20511
|
function makeEntryFromPath(raw, serviceTarget, rawFlags, cwd) {
|
|
@@ -20318,9 +20514,14 @@ function makeEntryFromPath(raw, serviceTarget, rawFlags, cwd) {
|
|
|
20318
20514
|
if (!existsSync(abs)) throw new ImageOverrideError(`--image-override: Dockerfile '${raw}' does not exist (resolved to '${abs}').`);
|
|
20319
20515
|
if (!statSync(abs).isFile()) throw new ImageOverrideError(`--image-override: '${raw}' is not a regular file (resolved to '${abs}').`);
|
|
20320
20516
|
const merged = mergeForService(serviceTarget, rawFlags.globals, rawFlags.perService);
|
|
20517
|
+
let contextDir = dirname(abs);
|
|
20518
|
+
if (merged.contextDir !== void 0) {
|
|
20519
|
+
contextDir = resolve(cwd, expandTilde(merged.contextDir));
|
|
20520
|
+
if (!existsSync(contextDir) || !statSync(contextDir).isDirectory()) throw new ImageOverrideError(`--image-context: '${merged.contextDir}' is not an existing directory (resolved to '${contextDir}').`);
|
|
20521
|
+
}
|
|
20321
20522
|
return {
|
|
20322
20523
|
dockerfile: abs,
|
|
20323
|
-
contextDir
|
|
20524
|
+
contextDir,
|
|
20324
20525
|
buildArgs: merged.buildArgs,
|
|
20325
20526
|
buildSecrets: merged.buildSecrets,
|
|
20326
20527
|
...merged.targetStage !== void 0 && { targetStage: merged.targetStage }
|
|
@@ -20352,6 +20553,10 @@ function buildImageOverrideTag(serviceTarget, entry) {
|
|
|
20352
20553
|
hash.update(";");
|
|
20353
20554
|
}
|
|
20354
20555
|
hash.update("}");
|
|
20556
|
+
if (entry.contextDir !== dirname(entry.dockerfile)) {
|
|
20557
|
+
hash.update("\0context=");
|
|
20558
|
+
hash.update(entry.contextDir);
|
|
20559
|
+
}
|
|
20355
20560
|
const svcSlug = serviceTarget.replace(/[^A-Za-z0-9]+/g, "-").slice(0, 24).toLowerCase();
|
|
20356
20561
|
return `${getEmbedConfig().resourceNamePrefix}-override-${svcSlug}-${hash.digest("hex").slice(0, 16)}:local`;
|
|
20357
20562
|
}
|
|
@@ -20412,6 +20617,7 @@ function enforceImageOverrideOrphans(rawFlags, resolvedOverrides) {
|
|
|
20412
20617
|
offenders.push(`--image-build-secret ${svc}:${ids} references a service with no --image-override mapping.`);
|
|
20413
20618
|
}
|
|
20414
20619
|
if (overlay.targetStage !== void 0) offenders.push(`--image-target ${svc}=${overlay.targetStage} references a service with no --image-override mapping.`);
|
|
20620
|
+
if (overlay.contextDir !== void 0) offenders.push(`--image-context ${svc}=${overlay.contextDir} references a service with no --image-override mapping.`);
|
|
20415
20621
|
}
|
|
20416
20622
|
if (offenders.length === 0) return;
|
|
20417
20623
|
throw new LocalStartServiceError(`Per-service image-override flag(s) target a service with no --image-override coverage. Add the matching --image-override <service>=<dockerfile>, drop the per-service flag, or fix the service name:\n ${offenders.join("\n ")}`);
|
|
@@ -20514,12 +20720,14 @@ async function runEcsServiceEmulator(targets, options, strategy, extraStateProvi
|
|
|
20514
20720
|
for (const w of index.warnings) logger.warn(w);
|
|
20515
20721
|
}
|
|
20516
20722
|
const registry = new CloudMapRegistry();
|
|
20517
|
-
const
|
|
20723
|
+
const taskRoleMode = isTaskRoleInEffect(options);
|
|
20724
|
+
const sidecarCredentials = taskRoleMode ? void 0 : await resolveSharedSidecarCredentials(options);
|
|
20518
20725
|
try {
|
|
20519
20726
|
sharedNetwork = await createSharedSvcNetwork({
|
|
20520
20727
|
prefix: options.cluster,
|
|
20521
20728
|
skipPull,
|
|
20522
20729
|
cluster: options.cluster,
|
|
20730
|
+
...taskRoleMode && { taskRole: true },
|
|
20523
20731
|
...sidecarCredentials !== void 0 && { credentials: sidecarCredentials }
|
|
20524
20732
|
});
|
|
20525
20733
|
} catch (err) {
|
|
@@ -20836,8 +21044,10 @@ async function resolveServiceAndRunnerOpts(boot, stacks, options, discovery, ski
|
|
|
20836
21044
|
const logger = getLogger();
|
|
20837
21045
|
const target = boot.target;
|
|
20838
21046
|
const quiet = opts.quiet === true;
|
|
20839
|
-
const imageContext = await buildEcsImageResolutionContext$1(target, stacks, options, stateProvider);
|
|
21047
|
+
const imageContext = await buildEcsImageResolutionContext$1(target, stacks, options, stateProvider, opts.imageOverrideTag !== void 0 ? { imageOverridden: true } : {});
|
|
20840
21048
|
const service = resolveEcsServiceTarget(target, stacks, imageContext, { suppressLoadBalancerWarning });
|
|
21049
|
+
const representative = service.task.containers.find((c) => c.essential) ?? service.task.containers[0];
|
|
21050
|
+
assertEcsTaskImagesResolvable(service.task, new Set(opts.imageOverrideTag !== void 0 && representative ? [representative.name] : []));
|
|
20841
21051
|
if (!quiet) logger.info(`Target: ${displayStackName(`${service.stack.stackName}/${service.serviceLogicalId}`)} (service=${displayIdent(service.serviceName)}, desiredCount=${service.desiredCount}, task=${displayIdent(service.task.taskDefinitionLogicalId)})`);
|
|
20842
21052
|
if (!quiet && service.serviceConnect) logger.info(`Service Connect: namespace=${displayIdent(service.serviceConnect.namespaceName)}, ${service.serviceConnect.services.length} service(s) registered for peer discovery.`);
|
|
20843
21053
|
if (!quiet && service.serviceRegistries.length > 0) logger.info(`Cloud Map: ${service.serviceRegistries.length} ServiceRegistry binding(s).`);
|
|
@@ -20878,6 +21088,15 @@ async function resolveServiceAndRunnerOpts(boot, stacks, options, discovery, ski
|
|
|
20878
21088
|
resolvedRoleArn = effectiveAssumeRole;
|
|
20879
21089
|
assumedCredentials = await assumeTaskRole$1(resolvedRoleArn, options.region, options.profile);
|
|
20880
21090
|
}
|
|
21091
|
+
if (discovery.sharedNetwork && resolvedRoleArn !== void 0 && assumedCredentials) try {
|
|
21092
|
+
await serveTaskRoleFromSharedSidecar(discovery.sharedNetwork, {
|
|
21093
|
+
roleArn: resolvedRoleArn,
|
|
21094
|
+
credentials: assumedCredentials,
|
|
21095
|
+
...options.cluster !== void 0 && { cluster: options.cluster }
|
|
21096
|
+
});
|
|
21097
|
+
} catch (err) {
|
|
21098
|
+
throw new LocalStartServiceError(err instanceof Error ? err.message : String(err));
|
|
21099
|
+
}
|
|
20881
21100
|
const envOverrides = readEnvOverridesFile$1(options.envVars);
|
|
20882
21101
|
const taskOpts = {
|
|
20883
21102
|
cluster: options.cluster,
|
|
@@ -21265,7 +21484,7 @@ async function buildEcsImageResolutionContext$1(target, stacks, options, statePr
|
|
|
21265
21484
|
if (ssmParameters.secureStringLogicalIds.length > 0) ctx.stateSensitiveParameters = ssmParameters.secureStringLogicalIds;
|
|
21266
21485
|
}
|
|
21267
21486
|
} else if (!stateProvider && needs.needsStateResources) {
|
|
21268
|
-
if (!opts.suppressStateWarning) logger.warn("Container Image references a same-stack AWS::ECR::Repository. Pass a state-source flag (e.g. --from-cfn-stack or a host-provided extension) to substitute the deployed repository URI.");
|
|
21487
|
+
if (!opts.suppressStateWarning && !opts.imageOverridden) logger.warn("Container Image references a same-stack AWS::ECR::Repository. Pass a state-source flag (e.g. --from-cfn-stack or a host-provided extension) to substitute the deployed repository URI, or --image-override to build it from a local Dockerfile.");
|
|
21269
21488
|
} else if (!stateProvider && needs.needsEnvOrSecretSubstitution) {
|
|
21270
21489
|
if (!opts.suppressStateWarning) logger.warn("Container Environment / Secrets entries contain CloudFormation intrinsics. Pass a state-source flag (e.g. --from-cfn-stack or a host-provided extension) to substitute them against the deployed state.");
|
|
21271
21490
|
}
|
|
@@ -21393,7 +21612,8 @@ async function resolveAndBuildImageOverrides(args) {
|
|
|
21393
21612
|
...options.imageOverride && { imageOverride: options.imageOverride },
|
|
21394
21613
|
...options.imageBuildArg && { imageBuildArg: options.imageBuildArg },
|
|
21395
21614
|
...options.imageBuildSecret && { imageBuildSecret: options.imageBuildSecret },
|
|
21396
|
-
...options.imageTarget && { imageTarget: options.imageTarget }
|
|
21615
|
+
...options.imageTarget && { imageTarget: options.imageTarget },
|
|
21616
|
+
...options.imageContext && { imageContext: options.imageContext }
|
|
21397
21617
|
}), pinnedAliases, perTarget);
|
|
21398
21618
|
if (pinnedTargets.length === 0 && rawFlags.explicit.size === 0 && rawFlags.pickerPaths.length === 0 && rawFlags.perService.size === 0) return {
|
|
21399
21619
|
tags: /* @__PURE__ */ new Map(),
|
|
@@ -21429,6 +21649,10 @@ function addEcsAssumeRoleOptions(cmd) {
|
|
|
21429
21649
|
return cmd.addOption(new Option("--assume-task-role [arn]", "Assume the task definition's TaskRoleArn (or the supplied ARN) and forward STS-issued temp credentials via the metadata sidecar so containers run with the deployed task role. Bare flag uses the template's TaskRoleArn; pass an explicit ARN to override. DEPRECATED alias of `--assume-role`; both forms work, but `--assume-role` is the cross-command name and will become the only form in a future release.")).addOption(new Option("--assume-role [arn]", "Assume the task definition's TaskRoleArn (or the supplied ARN) and forward STS-issued temp credentials via the metadata sidecar so containers run with the deployed task role. Bare flag uses the template's TaskRoleArn; pass an explicit ARN to override. Cross-command alias matching the same flag on `invoke` / `invoke-agentcore` / `start-api`; supersedes the older `--assume-task-role` (which still works)."));
|
|
21430
21650
|
}
|
|
21431
21651
|
let assumeTaskRoleDeprecationWarned = false;
|
|
21652
|
+
function isTaskRoleInEffect(options) {
|
|
21653
|
+
const effective = resolveEcsAssumeRoleOption(options);
|
|
21654
|
+
return effective === true || typeof effective === "string";
|
|
21655
|
+
}
|
|
21432
21656
|
function resolveEcsAssumeRoleOption(options) {
|
|
21433
21657
|
if (options.assumeRole !== void 0) return options.assumeRole;
|
|
21434
21658
|
if (options.assumeTaskRole !== void 0) {
|
|
@@ -21452,7 +21676,7 @@ function addCommonEcsServiceOptions(cmd) {
|
|
|
21452
21676
|
return cmd;
|
|
21453
21677
|
}
|
|
21454
21678
|
function addImageOverrideOptions(cmd) {
|
|
21455
|
-
return cmd.addOption(new Option("--image-override <service=dockerfile or dockerfile...>", "Replace a service target's deployed-registry image with a local `docker build` of the supplied Dockerfile (repeatable). Two forms: <service>=<dockerfile> binds the service explicitly; a bare <dockerfile> opens a multi-select picker against the still-uncovered pinned targets (one Dockerfile across N services). Mix freely. Lets `--from-cfn-stack` still reach real AWS state while you iterate locally on the application container.")).addOption(new Option("--image-build-arg <KEY=VAL...>", "Global `docker build --build-arg KEY=VAL` pair applied to every --image-override build (repeatable). Lets a CDK Dockerfile that branches on an ARG (env target, base image tag, package mirror) honor that ARG locally without editing the Dockerfile.")).addOption(new Option("--image-build-secret <id=src...>", "Global `docker build --secret id=<id>,src=<src>` entry applied to every --image-override build (repeatable). Enables `RUN --mount=type=secret,id=<id>` in the Dockerfile — the standard private-registry / npm-token recipe (e.g. `--image-build-secret npmrc=./.npmrc`).")).addOption(new Option("--image-target <stage or svc=stage...>", "Repeatable. Bare `<stage>` is a global --target for every --image-override build; `<service>=<stage>` (issue #240) scopes the --target to one overridden target so a monorepo with different multi-stage Dockerfiles per service can stop each at its own intermediate stage. Per-service form overrides the global on the named target.")).addOption(new Option("--no-interactive-overrides", "Suppress the interactive boot prompt that walks each pinned target asking for a Dockerfile path, and the multi-select prompt fired by `--image-override <dockerfile>` (picker form). Useful for CI / scripted invocations.")).addOption(new Option("--strict-overrides", "Fail fast at boot when any pinned target remains uncovered after `--image-override` + the boot prompt resolve. Off by default; the boot WARN per uncovered pinned target still fires regardless.").default(false));
|
|
21679
|
+
return cmd.addOption(new Option("--image-override <service=dockerfile or dockerfile...>", "Replace a service target's deployed-registry image with a local `docker build` of the supplied Dockerfile (repeatable). Two forms: <service>=<dockerfile> binds the service explicitly; a bare <dockerfile> opens a multi-select picker against the still-uncovered pinned targets (one Dockerfile across N services). Mix freely. Lets `--from-cfn-stack` still reach real AWS state while you iterate locally on the application container.")).addOption(new Option("--image-build-arg <KEY=VAL...>", "Global `docker build --build-arg KEY=VAL` pair applied to every --image-override build (repeatable). Lets a CDK Dockerfile that branches on an ARG (env target, base image tag, package mirror) honor that ARG locally without editing the Dockerfile.")).addOption(new Option("--image-build-secret <id=src...>", "Global `docker build --secret id=<id>,src=<src>` entry applied to every --image-override build (repeatable). Enables `RUN --mount=type=secret,id=<id>` in the Dockerfile — the standard private-registry / npm-token recipe (e.g. `--image-build-secret npmrc=./.npmrc`).")).addOption(new Option("--image-target <stage or svc=stage...>", "Repeatable. Bare `<stage>` is a global --target for every --image-override build; `<service>=<stage>` (issue #240) scopes the --target to one overridden target so a monorepo with different multi-stage Dockerfiles per service can stop each at its own intermediate stage. Per-service form overrides the global on the named target.")).addOption(new Option("--image-context <dir or svc=dir...>", "Repeatable. The `docker build` context for --image-override builds whose Dockerfile lives below it (a monorepo whose apps share code: --image-override Svc=apps/api/Dockerfile --image-context Svc=.). Bare `<dir>` applies to every overridden target; `<service>=<dir>` scopes it to one and overrides the global. Default: the Dockerfile's directory.")).addOption(new Option("--no-interactive-overrides", "Suppress the interactive boot prompt that walks each pinned target asking for a Dockerfile path, and the multi-select prompt fired by `--image-override <dockerfile>` (picker form). Useful for CI / scripted invocations.")).addOption(new Option("--strict-overrides", "Fail fast at boot when any pinned target remains uncovered after `--image-override` + the boot prompt resolve. Off by default; the boot WARN per uncovered pinned target still fires regardless.").default(false));
|
|
21456
21680
|
}
|
|
21457
21681
|
|
|
21458
21682
|
//#endregion
|
|
@@ -21593,7 +21817,8 @@ async function localRunTaskCommand(target, options, extraStateProviders) {
|
|
|
21593
21817
|
cwd: process.cwd()
|
|
21594
21818
|
});
|
|
21595
21819
|
if (imageOverrideResult.imageOverrideByContainer) runOpts.imageOverrideByContainer = imageOverrideResult.imageOverrideByContainer;
|
|
21596
|
-
|
|
21820
|
+
assertEcsTaskImagesResolvable(task, runOpts.imageOverrideByContainer);
|
|
21821
|
+
if (!imageOverrideResult.imageOverrideByContainer && imageOverrideResult.pinnedUncovered) logger.warn("Task definition image is pinned to a deployed registry; local source edits will not take effect. Pass --image-override <dockerfile> to rebuild it from local source.");
|
|
21597
21822
|
if (!options.detach) runOpts.onReady = () => {
|
|
21598
21823
|
logger.info(`Task running (family=${task.family}); streaming container logs. Stop with Ctrl-C.`);
|
|
21599
21824
|
};
|
|
@@ -21695,8 +21920,9 @@ async function buildEcsImageResolutionContext(candidate, stateProvider, options)
|
|
|
21695
21920
|
if (Object.keys(ssmParameters.values).length > 0) ctx.stateParameters = ssmParameters.values;
|
|
21696
21921
|
if (ssmParameters.secureStringLogicalIds.length > 0) ctx.stateSensitiveParameters = ssmParameters.secureStringLogicalIds;
|
|
21697
21922
|
}
|
|
21698
|
-
} else if (!stateProvider && needs.needsStateResources)
|
|
21699
|
-
|
|
21923
|
+
} else if (!stateProvider && needs.needsStateResources) {
|
|
21924
|
+
if (!options.imageOverride?.length) logger.warn("Container Image references a same-stack AWS::ECR::Repository. Pass a state-source flag (e.g. --from-cfn-stack or a host-provided extension) to substitute the deployed repository URI, or --image-override to build it from a local Dockerfile. Otherwise the resolver will surface its existing error.");
|
|
21925
|
+
} else if (!stateProvider && needs.needsEnvOrSecretSubstitution) logger.warn("Container Environment / Secrets entries contain CloudFormation intrinsics (Ref / Fn::GetAtt / Fn::Sub / Fn::Join). Pass a state-source flag (e.g. --from-cfn-stack or a host-provided extension) to substitute them against deployed state. Without a state source these entries are dropped (per-key warnings will follow).");
|
|
21700
21926
|
return ctx;
|
|
21701
21927
|
}
|
|
21702
21928
|
function pickCandidateStack(target, stacks) {
|
|
@@ -21773,7 +21999,8 @@ async function resolveRunTaskImageOverride(args) {
|
|
|
21773
21999
|
...options.imageOverride && { imageOverride: options.imageOverride },
|
|
21774
22000
|
...options.imageBuildArg && { imageBuildArg: options.imageBuildArg },
|
|
21775
22001
|
...options.imageBuildSecret && { imageBuildSecret: options.imageBuildSecret },
|
|
21776
|
-
...options.imageTarget && { imageTarget: options.imageTarget }
|
|
22002
|
+
...options.imageTarget && { imageTarget: options.imageTarget },
|
|
22003
|
+
...options.imageContext && { imageContext: options.imageContext }
|
|
21777
22004
|
}), pinnedAliases, [target]);
|
|
21778
22005
|
if (pinnedTargets.length === 0 && rawFlags.explicit.size === 0 && rawFlags.pickerPaths.length === 0 && rawFlags.perService.size === 0) return {};
|
|
21779
22006
|
const overrides = await resolveImageOverrides({
|
|
@@ -21861,7 +22088,7 @@ function resolveAlbFrontDoor(stack, albLogicalId) {
|
|
|
21861
22088
|
for (const { ruleLogicalId, ruleProps } of rulesByListener.get(listenerLogicalId) ?? []) {
|
|
21862
22089
|
const priority = parsePriority(ruleProps["Priority"]);
|
|
21863
22090
|
const ruleLabel = `Listener rule ${displayIdent(ruleLogicalId)} (priority ${priority})`;
|
|
21864
|
-
const parsed = parseRuleConditions(ruleProps["Conditions"], ruleLabel, warnings);
|
|
22091
|
+
const parsed = parseRuleConditions(ruleProps["Conditions"], albLogicalId, ruleLabel, warnings);
|
|
21865
22092
|
if (!parsed) continue;
|
|
21866
22093
|
const { pathPatterns, hostPatterns, httpHeaderConditions, httpRequestMethods, queryStringConditions, sourceIpCidrs } = parsed;
|
|
21867
22094
|
if (!(pathPatterns.length > 0 || hostPatterns.length > 0 || httpHeaderConditions.length > 0 || httpRequestMethods.length > 0 || queryStringConditions.length > 0 || sourceIpCidrs.length > 0)) continue;
|
|
@@ -22073,7 +22300,7 @@ function indexRulesByListener(resources) {
|
|
|
22073
22300
|
}
|
|
22074
22301
|
return index;
|
|
22075
22302
|
}
|
|
22076
|
-
function parseRuleConditions(conditions, ruleLabel, warnings) {
|
|
22303
|
+
function parseRuleConditions(conditions, albLogicalId, ruleLabel, warnings) {
|
|
22077
22304
|
const out = {
|
|
22078
22305
|
pathPatterns: [],
|
|
22079
22306
|
hostPatterns: [],
|
|
@@ -22087,18 +22314,41 @@ function parseRuleConditions(conditions, ruleLabel, warnings) {
|
|
|
22087
22314
|
if (!cond || typeof cond !== "object") continue;
|
|
22088
22315
|
const c = cond;
|
|
22089
22316
|
const field = typeof c["Field"] === "string" ? c["Field"] : "(unknown)";
|
|
22090
|
-
if (field === "path-pattern")
|
|
22091
|
-
|
|
22092
|
-
|
|
22317
|
+
if (field === "path-pattern") {
|
|
22318
|
+
const values = conditionValues(c, "PathPatternConfig");
|
|
22319
|
+
if (!values) {
|
|
22320
|
+
warnings.push(unresolvableConditionWarning(ruleLabel, field));
|
|
22321
|
+
return;
|
|
22322
|
+
}
|
|
22323
|
+
out.pathPatterns.push(...values);
|
|
22324
|
+
} else if (field === "host-header") {
|
|
22325
|
+
const values = hostHeaderConditionValues(c, albLogicalId);
|
|
22326
|
+
if (!values) {
|
|
22327
|
+
warnings.push(unresolvableConditionWarning(ruleLabel, field));
|
|
22328
|
+
return;
|
|
22329
|
+
}
|
|
22330
|
+
out.hostPatterns.push(...values);
|
|
22331
|
+
} else if (field === "http-header") {
|
|
22093
22332
|
const parsed = parseHttpHeaderCondition(c);
|
|
22094
22333
|
if (!parsed) {
|
|
22095
|
-
warnings.push(`${ruleLabel} has an http-header condition with no HttpHeaderName / Values; skipping the rule.`);
|
|
22334
|
+
warnings.push(`${ruleLabel} has an http-header condition with no HttpHeaderName / Values, or a value that is not a literal string; skipping the rule.`);
|
|
22096
22335
|
return;
|
|
22097
22336
|
}
|
|
22098
22337
|
out.httpHeaderConditions.push(parsed);
|
|
22099
|
-
} else if (field === "http-request-method")
|
|
22100
|
-
|
|
22101
|
-
|
|
22338
|
+
} else if (field === "http-request-method") {
|
|
22339
|
+
const values = conditionValues(c, "HttpRequestMethodConfig");
|
|
22340
|
+
if (!values) {
|
|
22341
|
+
warnings.push(unresolvableConditionWarning(ruleLabel, field));
|
|
22342
|
+
return;
|
|
22343
|
+
}
|
|
22344
|
+
out.httpRequestMethods.push(...values);
|
|
22345
|
+
} else if (field === "query-string") {
|
|
22346
|
+
const qs = parseQueryStringConditionValues(c);
|
|
22347
|
+
if (!qs) {
|
|
22348
|
+
warnings.push(unresolvableConditionWarning(ruleLabel, field));
|
|
22349
|
+
return;
|
|
22350
|
+
}
|
|
22351
|
+
const { parsed, hadEntries } = qs;
|
|
22102
22352
|
if (hadEntries && parsed.length === 0) {
|
|
22103
22353
|
warnings.push(`${ruleLabel} query-string condition has no parseable { Key?, Value } entries; skipping the rule.`);
|
|
22104
22354
|
return;
|
|
@@ -22106,6 +22356,10 @@ function parseRuleConditions(conditions, ruleLabel, warnings) {
|
|
|
22106
22356
|
out.queryStringConditions.push(...parsed);
|
|
22107
22357
|
} else if (field === "source-ip") {
|
|
22108
22358
|
const values = conditionValues(c, "SourceIpConfig");
|
|
22359
|
+
if (!values) {
|
|
22360
|
+
warnings.push(unresolvableConditionWarning(ruleLabel, field));
|
|
22361
|
+
return;
|
|
22362
|
+
}
|
|
22109
22363
|
const invalid = values.filter((v) => !isValidCidr(v));
|
|
22110
22364
|
if (invalid.length > 0) {
|
|
22111
22365
|
warnings.push(`${ruleLabel} source-ip condition has unparseable CIDR(s): ${invalid.join(", ")}. The local ALB front-door requires valid IPv4 / IPv6 CIDRs; skipping the rule.`);
|
|
@@ -22125,24 +22379,26 @@ function parseHttpHeaderCondition(cond) {
|
|
|
22125
22379
|
const c = cfg;
|
|
22126
22380
|
const name = c["HttpHeaderName"];
|
|
22127
22381
|
if (typeof name !== "string" || name.length === 0) return void 0;
|
|
22128
|
-
const values =
|
|
22129
|
-
if (values.length === 0)
|
|
22382
|
+
const values = Array.isArray(c["Values"]) ? c["Values"] : [];
|
|
22383
|
+
if (values.length === 0 || !values.every((v) => typeof v === "string")) return;
|
|
22130
22384
|
return {
|
|
22131
22385
|
name,
|
|
22132
22386
|
values
|
|
22133
22387
|
};
|
|
22134
22388
|
}
|
|
22135
22389
|
function parseQueryStringConditionValues(cond) {
|
|
22136
|
-
const
|
|
22137
|
-
|
|
22390
|
+
const rawValues = rawConditionValues(cond, "QueryStringConfig");
|
|
22391
|
+
if (!rawValues) return void 0;
|
|
22138
22392
|
const parsed = [];
|
|
22139
22393
|
for (const v of rawValues) if (typeof v === "string") parsed.push({ value: v });
|
|
22140
22394
|
else if (v && typeof v === "object") {
|
|
22141
22395
|
const e = v;
|
|
22396
|
+
if (isIntrinsic(e)) return void 0;
|
|
22142
22397
|
const value = e["Value"];
|
|
22143
|
-
if (typeof value !== "string") continue;
|
|
22144
22398
|
const key = e["Key"];
|
|
22145
|
-
|
|
22399
|
+
if (value && typeof value === "object" || key && typeof key === "object") return;
|
|
22400
|
+
if (typeof value !== "string" || key !== void 0 && typeof key !== "string") continue;
|
|
22401
|
+
parsed.push(key !== void 0 ? {
|
|
22146
22402
|
key,
|
|
22147
22403
|
value
|
|
22148
22404
|
} : { value });
|
|
@@ -22152,6 +22408,9 @@ function parseQueryStringConditionValues(cond) {
|
|
|
22152
22408
|
hadEntries: rawValues.length > 0
|
|
22153
22409
|
};
|
|
22154
22410
|
}
|
|
22411
|
+
function isIntrinsic(obj) {
|
|
22412
|
+
return Object.keys(obj).some((k) => k === "Ref" || k.startsWith("Fn::"));
|
|
22413
|
+
}
|
|
22155
22414
|
function isValidCidr(value) {
|
|
22156
22415
|
const slash = value.indexOf("/");
|
|
22157
22416
|
if (slash === -1) return false;
|
|
@@ -22168,9 +22427,39 @@ function isValidCidr(value) {
|
|
|
22168
22427
|
if (addr.includes(":")) return prefixLen >= 0 && prefixLen <= 128;
|
|
22169
22428
|
return false;
|
|
22170
22429
|
}
|
|
22171
|
-
function
|
|
22430
|
+
function rawConditionValues(cond, configKey) {
|
|
22172
22431
|
const cfg = cond[configKey];
|
|
22173
|
-
|
|
22432
|
+
if (cfg !== void 0) {
|
|
22433
|
+
if (!cfg || typeof cfg !== "object" || Array.isArray(cfg)) return void 0;
|
|
22434
|
+
const c = cfg;
|
|
22435
|
+
if (isIntrinsic(c)) return void 0;
|
|
22436
|
+
if (Array.isArray(c["Values"])) return c["Values"];
|
|
22437
|
+
if (c["Values"] !== void 0) return void 0;
|
|
22438
|
+
}
|
|
22439
|
+
if (Array.isArray(cond["Values"])) return cond["Values"];
|
|
22440
|
+
return cond["Values"] === void 0 ? [] : void 0;
|
|
22441
|
+
}
|
|
22442
|
+
function conditionValues(cond, configKey) {
|
|
22443
|
+
const raw = rawConditionValues(cond, configKey);
|
|
22444
|
+
return raw?.every((v) => typeof v === "string") ? raw : void 0;
|
|
22445
|
+
}
|
|
22446
|
+
function hostHeaderConditionValues(cond, albLogicalId) {
|
|
22447
|
+
const raw = rawConditionValues(cond, "HostHeaderConfig");
|
|
22448
|
+
if (!raw) return void 0;
|
|
22449
|
+
const out = [];
|
|
22450
|
+
for (const v of raw) if (typeof v === "string") out.push(v);
|
|
22451
|
+
else if (isOwnDnsNameGetAtt(v, albLogicalId)) out.push("*");
|
|
22452
|
+
else return void 0;
|
|
22453
|
+
return out;
|
|
22454
|
+
}
|
|
22455
|
+
function isOwnDnsNameGetAtt(raw, albLogicalId) {
|
|
22456
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return false;
|
|
22457
|
+
const getAtt = raw["Fn::GetAtt"];
|
|
22458
|
+
const parts = typeof getAtt === "string" ? getAtt.split(".") : getAtt;
|
|
22459
|
+
return Array.isArray(parts) && parts.length === 2 && parts[0] === albLogicalId && parts[1] === "DNSName";
|
|
22460
|
+
}
|
|
22461
|
+
function unresolvableConditionWarning(ruleLabel, field) {
|
|
22462
|
+
return `${ruleLabel} has a ${field} condition value that is not a literal string (an intrinsic such as Ref / Fn::GetAtt / Fn::Join / Fn::ImportValue that cannot be resolved locally); skipping the rule.`;
|
|
22174
22463
|
}
|
|
22175
22464
|
function collectForwardTargetGroupRefs(action) {
|
|
22176
22465
|
const out = [];
|
|
@@ -32987,5 +33276,5 @@ function addStudioSpecificOptions(cmd) {
|
|
|
32987
33276
|
}
|
|
32988
33277
|
|
|
32989
33278
|
//#endregion
|
|
32990
|
-
export { postHook as $, firstUsableRegion as $a, parseConnectionsPath as $i, addImageOverrideOptions as $n, addStartApiSpecificOptions as $r, classifyS3Error as $t, microvmFidelityWarnings as A, filterWebSocketApisByIdentifiers as Aa, applyCorsResponseHeaders as Ai, stripCloudFrontImport as An, A2A_CONTAINER_PORT as Ar, readContainerLogTail as At, MICROVM_WS_BASE_PROTOCOL as B, AGENTCORE_RUNTIME_TYPE as Ba, evaluateResponseParameters as Bi, createLocalStartAlbCommand as Bn, AGENTCORE_SESSION_ID_HEADER as Br, parseWebFunctionBuildConfig as Bt, addListSpecificOptions as C, resolveWatchConfig as Ca, verifyJwtViaDiscovery as Ci, WEB_FUNCTION_REVISION_TYPE as Cn, setShadowReadyTimeoutMs as Cr, parseKvsFileOverrides as Ct, buildMicrovmLambdaView as D, availableWebSocketApiIdentifiers as Da, invokeRequestAuthorizer as Di, compileCloudFrontFunction as Dn, createLocalInvokeAgentCoreCommand as Dr, WEB_FUNCTION_CONTAINER_PORT as Dt, addStartMicrovmSpecificOptions as E, listTargets as Ea, evaluateCachedLambdaPolicy as Ei, resolveWebFunctionTarget as En, addInvokeAgentCoreSpecificOptions as Er, RecentOutput as Et, microvmImageTag as F, resolveLambdaArnIntrinsic as Fa, matchRoute as Fi, findFileAssetForObjectKey as Fn, MCP_PROTOCOL_VERSION as Fr, buildNodeEntryFileStart as Ft, startMicrovmFrontDoor as G, formatStateRemedy as Ga, HOST_DOCKER_INTERNAL_GATEWAY as Gi, addStartServiceSpecificOptions as Gn, SUPPORTED_CODE_RUNTIMES as Gr, readWebFunctionServiceConfig as Gt, PROXY_PORT_HEADER as H, pickAgentCoreCandidateStack as Ha, selectIntegrationResponse as Hi, resolveAlbTarget as Hn, waitForAgentCoreHttpReady as Hr, WEB_FUNCTION_HTTP_ENDPOINT_ENV as Ht, planMicrovmPorts as I, AGENTCORE_A2A_PROTOCOL as Ia, translateLambdaResponse as Ii, isBucketDeploymentResource as In, mcpInvokeOnce as Ir, defaultWebFunctionPlatform as It, MICROVM_HOOK_PATH_PREFIX as J, LocalInvokeBuildError as Ja, resolveHostGatewayExtraHosts as Ji, addRunTaskSpecificOptions as Jn, renderCodeDockerfile as Jr, idFromArn as Jt, stripMicrovmProxyHeaders as K, substituteImagePlaceholders as Ka, HOST_GATEWAY_MIN_VERSION as Ki, createLocalStartServiceCommand as Kn, buildAgentCoreCodeImage as Kr, webFunctionAssumeRole as Kt, readExposedPorts as L, AGENTCORE_AGUI_PROTOCOL as La, applyAuthorizerOverlay as Li, resolveBucketDeploymentObjectKey as Ln, parseSseForJsonRpc as Lr, resolveWebFunctionRuntime as Lt, DEFAULT_TERMINATE_HOOK_TIMEOUT_MS as M, webSocketApiMatchesIdentifier as Ma, buildCorsConfigFromCloudFrontChain as Mi, createLocalFileKvsDataSource as Mn, a2aInvokeOnce as Mr, waitForWebFunctionReady as Mt, LocalMicrovm as N, discoverRoutes as Na, isFunctionUrlOacFronted as Ni, createUnboundCloudFrontModule as Nn, MCP_CONTAINER_PORT as Nr, watchContainerExit as Nt, createLocalStartMicrovmCommand as O, discoverWebSocketApis as Oa, invokeTokenAuthorizer as Oi, runViewerRequest as On, bridgeAgentCoreWs as Or, containerFailure as Ot, buildMicrovmImage as P, pickRefLogicalId as Pa, matchPreflight as Pi, bucketDeploymentSourceObjectKeys as Pn, MCP_PATH as Pr, WEB_FUNCTION_RUNTIMES as Pt, pollBuildHook as Q, deployedFillMayBeSecret as Qa, handleConnectionsRequest as Qi, addEcsAssumeRoleOptions as Qn, createLocalInvokeCommand as Qr, resolveDeployedOriginBucket as Qt, setContainerPaused as R, AGENTCORE_HTTP_PROTOCOL as Ra, buildHttpApiV2Event as Ri, addAlbSpecificOptions as Rn, AGENTCORE_SIGV4_SERVICE as Rr, supportedWebFunctionRuntimes as Rt, StudioEventBus as S, resolveSsmParameters as Sa, verifyJwtAuthorizer as Si, WEB_FUNCTION_ENDPOINT_TYPE as Sn, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as Sr, normalizeKvsFileKeys as St, formatTargetListing as T, countTargets as Ta, computeRequestIdentityHash as Ti, WebFunctionResolutionError as Tn, attachContainerLogStreamer as Tr, resolveCloudFrontTarget as Tt, rewriteUpgradeResponseHead as U, resolveAgentCoreTarget as Ua, tryParseStatus as Ui, isApplicationLoadBalancer as Un, waitForAgentCorePing as Ur, buildWebFunctionLambdaView as Ut, MicrovmStateError as V, AgentCoreResolutionError as Va, pickResponseTemplate as Vi, parseLbPortOverrides as Vn, invokeAgentCore as Vr, resolveWebFunctionArtifact as Vt, selectTargetPort as W, derivePseudoParametersFromRegion as Wa, VtlEvaluationError as Wi, resolveAlbFrontDoor as Wn, downloadAndExtractS3Bundle as Wr, finalizeWebFunctionEnv as Wt, callRuntimeHook as X, DynamicReferenceResolver as Xa, ConnectionRegistry as Xi, MAX_TASKS_SUBNET_RANGE_CAP as Xn, classifySourceChange as Xr, createDeployedKvsDataSource as Xt, MicrovmHookError as Y, DynamicReferenceResolutionError as Ya, bufferToBody as Yi, createLocalRunTaskCommand as Yn, toCmdArgv as Yr, resolveKvsModulesForDistribution as Yt, generateMicrovmId as Z, containsDynamicReference as Za, buildMgmtEndpointEnvUrl as Zi, addCommonEcsServiceOptions as Zn, addInvokeSpecificOptions as Zr, resolveDeployedKvsArnByName as Zt, filterStudioTargetGroups as _, resolveCfnFallbackRegion as _a, defaultCredentialsLoader as _i, pickKvsLogicalIdFromArn as _n, isLocalCdkAssetImage as _r, attachAgentCoreWsBridge as _t, createLocalStudioCommand as a, resolveRuntimeCodeMountPath as aa, attachStageContext as ai, serveLambdaUrlOrigin as an, SECOND_ASSUME_MESSAGE as ao, resolveSharedSidecarCredentials as ar, disposeMicrovmCodeArtifact as at, renderStudioHtml as b, CfnLocalStateProvider as ba, createJwksCache as bi, pickWebFunctionEndpointLogicalIdFromOrigin as bn, CloudMapRegistry as br, addStartCloudFrontSpecificOptions as bt, startStudioProxy as c, EcsTaskResolutionError as ca, resolveEnvVars$1 as ci, buildEdgeRequestEvent as cn, readEnvCallerCredentials as co, buildImageOverrideTag as cr, resolveMicrovmImageTarget as ct, createStudioDispatcher as d, substituteEnvVarsFromState as da, filterRoutesByApiIdentifiers as di, httpHeadersToEdge as dn, workloadClientConfig as do, mergeForService as dr, createLocalStartWebFunctionCommand as dt, buildConnectEvent as ea, createLocalStartApiCommand as ei, createS3OriginReader as en, keysNotFromTemplate as eo, buildEcsImageResolutionContext$1 as er, runHookBody as et, filterStudioCustomResources as f, substituteEnvVarsFromStateAsync as fa, groupRoutesByServer as fi, CLOUDFRONT_DISTRIBUTION_TYPE as fn, workloadStsClientConfig as fo, parseImageOverrideFlags as fr, addStartAgentCoreSpecificOptions as ft, annotatePinnedEcsTargets as g, rejectExplicitCfnStackWithMultipleStacks as ga, resolveServiceIntegrationParameters as gi, pickFunctionUrlLogicalIdFromOrigin as gn, isProxyEnvConfigured as go, imageOverrideKeyAliases as gr, startAgentCoreHttpServer as gt, annotateEcsTaskPinnedTargets as h, isCfnFlagPresent as ha, resolveSelectionExpression as hi, isCloudFrontDistribution as hn, buildProxyClientConfig as ho, describePinnedImageUri as hr, selectServeInboundAuth as ht, coerceStopRequest as i, buildContainerImage as ia, createFileWatcher as ii, serveFromStaticOrigin as in, withoutKeys as io, resolveEcsAssumeRoleOption as ir, MicrovmResolutionError as it, readRunHookPayload as j, parseSelectionExpressionPath as ja, buildCorsConfigByApiId as ji, createCloudFrontModule as jn, A2A_PATH as jr, startWebFunctionContainer as jt, finalizeMicrovmEnv as k, discoverWebSocketApisOrThrow as ka, attachAuthorizers as ki, runViewerResponse as kn, invokeAgentCoreWs as kr, planWebFunctionContainer as kt, relayServeRequest as l, substituteAgainstState as la, availableApiIdentifiers as li, buildEdgeResponseEvent as ln, recordAssumedRole as lo, canonicalizeImageOverrideKeys as lr, s3KeyOfUri as lt, annotateAlbPinnedBackingServices as m, createLocalStateProvider as ma, startApiServer as mi, extractKvsAssociations as mn, resolveProfileCredentials as mo, runImageOverrideBuilds as mr, buildAgentCoreServeAuthCheck as mt, coerceRunRequest as n, buildMessageEvent as na, resolveApiTargetSubset as ni, startCloudFrontServer as nn, parseDynamicReference as no, parseMaxTasks as nr, MICROVM_DEFAULT_INGRESS_PORT as nt, resolveServeBaseUrl as o, resolveRuntimeFileExtension as oa, buildStageMap as oi, applyEdgeRequestResult as on, assumedRoleRecorded as oo, runEcsServiceEmulator as or, readMicrovmImageConfig as ot, isCustomResourceLambdaTarget as p, LocalStateSourceError as pa, readMtlsMaterialsFromDisk as pi, describeS3OriginDomain as pn, buildStsClientConfig as po, resolveImageOverrides as pr, createLocalStartAgentCoreCommand as pt, MAX_RUN_HOOK_PAYLOAD_BYTES as q, tryResolveImageFnJoin as qa, probeHostGatewaySupport as qi, serviceStrategy as qn, computeCodeImageTag as qr, webFunctionFidelityWarnings as qt, coerceServeRequest as r, architectureToPlatform as ra, createAuthorizerCache as ri, resolveErrorResponseCandidates as rn, resolveDynamicReferencesInEnv as ro, parseRestartPolicy as rr, MICROVM_IMAGE_TYPE as rt, createStudioServeManager as s, resolveRuntimeImage as sa, materializeLayerFromArn as si, applyEdgeResponseResult as sn, deployAccountStsClientConfig as so, ImageOverrideError as sr, resolveMicrovmCodeArtifact as st, addStudioSpecificOptions as t, buildDisconnectEvent as ta, createWatchPredicates as ti, matchBehavior as tn, keysOverriddenBy as to, ecsClusterOption as tr, waitForAppAnswer as tt, reinvoke as u, substituteAgainstStateAsync as ua, filterRoutesByApiIdentifier as ui, edgeHeadersToHttp as un, resetWorkloadIdentity as uo, enforceImageOverrideOrphans as ur, addStartWebFunctionSpecificOptions as ut, startStudioServer as v, resolveCfnRegion as va, buildCognitoJwksUrl as vi, pickLambdaEdgeFunctionLogicalId as vn, listPinnedTargets as vr, startAgentCoreWsBridge as vt, createLocalListCommand as w, resolveSingleTarget as wa, buildMethodArn as wi, WEB_FUNCTION_TYPE as wn, getContainerNetworkIp as wr, parseOriginOverrides as wt, createStudioStore as x, collectSsmParameterRefs as xa, verifyCognitoJwt as xi, resolveCloudFrontDistribution as xn, DEFAULT_SHADOW_READY_TIMEOUT_MS as xr, createLocalStartCloudFrontCommand as xt, toStudioTargetGroups as y, resolveCfnStackName as ya, buildJwksUrlFromIssuer as yi, pickTargetFunctionLogicalId as yn, buildCloudMapIndex as yr, LocalStartCloudFrontError as yt, MICROVM_CONTROL_PATH as z, AGENTCORE_MCP_PROTOCOL as za, buildRestV1Event as zi, albStrategy as zn, signAgentCoreInvocation as zr, disposeWebFunctionArtifact as zt };
|
|
32991
|
-
//# sourceMappingURL=local-studio-
|
|
33279
|
+
export { postHook as $, deployedFillMayBeSecret as $a, parseConnectionsPath as $i, addImageOverrideOptions as $n, addStartApiSpecificOptions as $r, classifyS3Error as $t, microvmFidelityWarnings as A, discoverWebSocketApisOrThrow as Aa, applyCorsResponseHeaders as Ai, stripCloudFrontImport as An, A2A_CONTAINER_PORT as Ar, readContainerLogTail as At, MICROVM_WS_BASE_PROTOCOL as B, AGENTCORE_MCP_PROTOCOL as Ba, evaluateResponseParameters as Bi, createLocalStartAlbCommand as Bn, AGENTCORE_SESSION_ID_HEADER as Br, parseWebFunctionBuildConfig as Bt, addListSpecificOptions as C, resolveSsmParameters as Ca, verifyJwtViaDiscovery as Ci, WEB_FUNCTION_REVISION_TYPE as Cn, setShadowReadyTimeoutMs as Cr, parseKvsFileOverrides as Ct, buildMicrovmLambdaView as D, listTargets as Da, invokeRequestAuthorizer as Di, compileCloudFrontFunction as Dn, createLocalInvokeAgentCoreCommand as Dr, WEB_FUNCTION_CONTAINER_PORT as Dt, addStartMicrovmSpecificOptions as E, countTargets as Ea, evaluateCachedLambdaPolicy as Ei, resolveWebFunctionTarget as En, addInvokeAgentCoreSpecificOptions as Er, RecentOutput as Et, microvmImageTag as F, pickRefLogicalId as Fa, matchRoute as Fi, findFileAssetForObjectKey as Fn, MCP_PROTOCOL_VERSION as Fr, buildNodeEntryFileStart as Ft, startMicrovmFrontDoor as G, derivePseudoParametersFromRegion as Ga, HOST_DOCKER_INTERNAL_GATEWAY as Gi, addStartServiceSpecificOptions as Gn, SUPPORTED_CODE_RUNTIMES as Gr, readWebFunctionServiceConfig as Gt, PROXY_PORT_HEADER as H, AgentCoreResolutionError as Ha, selectIntegrationResponse as Hi, resolveAlbTarget as Hn, waitForAgentCoreHttpReady as Hr, WEB_FUNCTION_HTTP_ENDPOINT_ENV as Ht, planMicrovmPorts as I, resolveLambdaArnIntrinsic as Ia, translateLambdaResponse as Ii, isBucketDeploymentResource as In, mcpInvokeOnce as Ir, defaultWebFunctionPlatform as It, MICROVM_HOOK_PATH_PREFIX as J, tryResolveImageFnJoin as Ja, resolveHostGatewayExtraHosts as Ji, addRunTaskSpecificOptions as Jn, renderCodeDockerfile as Jr, idFromArn as Jt, stripMicrovmProxyHeaders as K, formatStateRemedy as Ka, HOST_GATEWAY_MIN_VERSION as Ki, createLocalStartServiceCommand as Kn, buildAgentCoreCodeImage as Kr, webFunctionAssumeRole as Kt, readExposedPorts as L, AGENTCORE_A2A_PROTOCOL as La, applyAuthorizerOverlay as Li, resolveBucketDeploymentObjectKey as Ln, parseSseForJsonRpc as Lr, resolveWebFunctionRuntime as Lt, DEFAULT_TERMINATE_HOOK_TIMEOUT_MS as M, parseSelectionExpressionPath as Ma, buildCorsConfigFromCloudFrontChain as Mi, createLocalFileKvsDataSource as Mn, a2aInvokeOnce as Mr, waitForWebFunctionReady as Mt, LocalMicrovm as N, webSocketApiMatchesIdentifier as Na, isFunctionUrlOacFronted as Ni, createUnboundCloudFrontModule as Nn, MCP_CONTAINER_PORT as Nr, watchContainerExit as Nt, createLocalStartMicrovmCommand as O, availableWebSocketApiIdentifiers as Oa, invokeTokenAuthorizer as Oi, runViewerRequest as On, bridgeAgentCoreWs as Or, containerFailure as Ot, buildMicrovmImage as P, discoverRoutes as Pa, matchPreflight as Pi, bucketDeploymentSourceObjectKeys as Pn, MCP_PATH as Pr, WEB_FUNCTION_RUNTIMES as Pt, pollBuildHook as Q, containsDynamicReference as Qa, handleConnectionsRequest as Qi, addEcsAssumeRoleOptions as Qn, createLocalInvokeCommand as Qr, resolveDeployedOriginBucket as Qt, setContainerPaused as R, AGENTCORE_AGUI_PROTOCOL as Ra, buildHttpApiV2Event as Ri, addAlbSpecificOptions as Rn, AGENTCORE_SIGV4_SERVICE as Rr, supportedWebFunctionRuntimes as Rt, StudioEventBus as S, collectSsmParameterRefs as Sa, verifyJwtAuthorizer as Si, WEB_FUNCTION_ENDPOINT_TYPE as Sn, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as Sr, normalizeKvsFileKeys as St, formatTargetListing as T, resolveSingleTarget as Ta, computeRequestIdentityHash as Ti, WebFunctionResolutionError as Tn, attachContainerLogStreamer as Tr, resolveCloudFrontTarget as Tt, rewriteUpgradeResponseHead as U, pickAgentCoreCandidateStack as Ua, tryParseStatus as Ui, isApplicationLoadBalancer as Un, waitForAgentCorePing as Ur, buildWebFunctionLambdaView as Ut, MicrovmStateError as V, AGENTCORE_RUNTIME_TYPE as Va, pickResponseTemplate as Vi, parseLbPortOverrides as Vn, invokeAgentCore as Vr, resolveWebFunctionArtifact as Vt, selectTargetPort as W, resolveAgentCoreTarget as Wa, VtlEvaluationError as Wi, resolveAlbFrontDoor as Wn, downloadAndExtractS3Bundle as Wr, finalizeWebFunctionEnv as Wt, callRuntimeHook as X, DynamicReferenceResolutionError as Xa, ConnectionRegistry as Xi, MAX_TASKS_SUBNET_RANGE_CAP as Xn, classifySourceChange as Xr, createDeployedKvsDataSource as Xt, MicrovmHookError as Y, LocalInvokeBuildError as Ya, bufferToBody as Yi, createLocalRunTaskCommand as Yn, toCmdArgv as Yr, resolveKvsModulesForDistribution as Yt, generateMicrovmId as Z, DynamicReferenceResolver as Za, buildMgmtEndpointEnvUrl as Zi, addCommonEcsServiceOptions as Zn, addInvokeSpecificOptions as Zr, resolveDeployedKvsArnByName as Zt, filterStudioTargetGroups as _, rejectExplicitCfnStackWithMultipleStacks as _a, defaultCredentialsLoader as _i, pickKvsLogicalIdFromArn as _n, isProxyEnvConfigured as _o, isLocalCdkAssetImage as _r, attachAgentCoreWsBridge as _t, createLocalStudioCommand as a, resolveRuntimeCodeMountPath as aa, attachStageContext as ai, serveLambdaUrlOrigin as an, withoutKeys as ao, resolveSharedSidecarCredentials as ar, disposeMicrovmCodeArtifact as at, renderStudioHtml as b, resolveCfnStackName as ba, createJwksCache as bi, pickWebFunctionEndpointLogicalIdFromOrigin as bn, CloudMapRegistry as br, addStartCloudFrontSpecificOptions as bt, startStudioProxy as c, EcsTaskResolutionError as ca, resolveEnvVars$1 as ci, buildEdgeRequestEvent as cn, deployAccountStsClientConfig as co, buildImageOverrideTag as cr, resolveMicrovmImageTarget as ct, createStudioDispatcher as d, substituteAgainstStateAsync as da, filterRoutesByApiIdentifiers as di, httpHeadersToEdge as dn, resetWorkloadIdentity as do, mergeForService as dr, createLocalStartWebFunctionCommand as dt, buildConnectEvent as ea, createLocalStartApiCommand as ei, createS3OriginReader as en, firstUsableRegion as eo, buildEcsImageResolutionContext$1 as er, runHookBody as et, filterStudioCustomResources as f, substituteEnvVarsFromState as fa, groupRoutesByServer as fi, CLOUDFRONT_DISTRIBUTION_TYPE as fn, workloadClientConfig as fo, parseImageOverrideFlags as fr, addStartAgentCoreSpecificOptions as ft, annotatePinnedEcsTargets as g, isCfnFlagPresent as ga, resolveServiceIntegrationParameters as gi, pickFunctionUrlLogicalIdFromOrigin as gn, buildProxyClientConfig as go, imageOverrideKeyAliases as gr, startAgentCoreHttpServer as gt, annotateEcsTaskPinnedTargets as h, createLocalStateProvider as ha, resolveSelectionExpression as hi, isCloudFrontDistribution as hn, resolveProfileCredentials as ho, describePinnedImageUri as hr, selectServeInboundAuth as ht, coerceStopRequest as i, buildContainerImage as ia, createFileWatcher as ii, serveFromStaticOrigin as in, resolveDynamicReferencesInEnv as io, resolveEcsAssumeRoleOption as ir, MicrovmResolutionError as it, readRunHookPayload as j, filterWebSocketApisByIdentifiers as ja, buildCorsConfigByApiId as ji, createCloudFrontModule as jn, A2A_PATH as jr, startWebFunctionContainer as jt, finalizeMicrovmEnv as k, discoverWebSocketApis as ka, attachAuthorizers as ki, runViewerResponse as kn, invokeAgentCoreWs as kr, planWebFunctionContainer as kt, relayServeRequest as l, assertEcsTaskImagesResolvable as la, availableApiIdentifiers as li, buildEdgeResponseEvent as ln, readEnvCallerCredentials as lo, canonicalizeImageOverrideKeys as lr, s3KeyOfUri as lt, annotateAlbPinnedBackingServices as m, LocalStateSourceError as ma, startApiServer as mi, extractKvsAssociations as mn, buildStsClientConfig as mo, runImageOverrideBuilds as mr, buildAgentCoreServeAuthCheck as mt, coerceRunRequest as n, buildMessageEvent as na, resolveApiTargetSubset as ni, startCloudFrontServer as nn, keysOverriddenBy as no, parseMaxTasks as nr, MICROVM_DEFAULT_INGRESS_PORT as nt, resolveServeBaseUrl as o, resolveRuntimeFileExtension as oa, buildStageMap as oi, applyEdgeRequestResult as on, SECOND_ASSUME_MESSAGE as oo, runEcsServiceEmulator as or, readMicrovmImageConfig as ot, isCustomResourceLambdaTarget as p, substituteEnvVarsFromStateAsync as pa, readMtlsMaterialsFromDisk as pi, describeS3OriginDomain as pn, workloadStsClientConfig as po, resolveImageOverrides as pr, createLocalStartAgentCoreCommand as pt, MAX_RUN_HOOK_PAYLOAD_BYTES as q, substituteImagePlaceholders as qa, probeHostGatewaySupport as qi, serviceStrategy as qn, computeCodeImageTag as qr, webFunctionFidelityWarnings as qt, coerceServeRequest as r, architectureToPlatform as ra, createAuthorizerCache as ri, resolveErrorResponseCandidates as rn, parseDynamicReference as ro, parseRestartPolicy as rr, MICROVM_IMAGE_TYPE as rt, createStudioServeManager as s, resolveRuntimeImage as sa, materializeLayerFromArn as si, applyEdgeResponseResult as sn, assumedRoleRecorded as so, ImageOverrideError as sr, resolveMicrovmCodeArtifact as st, addStudioSpecificOptions as t, buildDisconnectEvent as ta, createWatchPredicates as ti, matchBehavior as tn, keysNotFromTemplate as to, ecsClusterOption as tr, waitForAppAnswer as tt, reinvoke as u, substituteAgainstState as ua, filterRoutesByApiIdentifier as ui, edgeHeadersToHttp as un, recordAssumedRole as uo, enforceImageOverrideOrphans as ur, addStartWebFunctionSpecificOptions as ut, startStudioServer as v, resolveCfnFallbackRegion as va, buildCognitoJwksUrl as vi, pickLambdaEdgeFunctionLogicalId as vn, listPinnedTargets as vr, startAgentCoreWsBridge as vt, createLocalListCommand as w, resolveWatchConfig as wa, buildMethodArn as wi, WEB_FUNCTION_TYPE as wn, getContainerNetworkIp as wr, parseOriginOverrides as wt, createStudioStore as x, CfnLocalStateProvider as xa, verifyCognitoJwt as xi, resolveCloudFrontDistribution as xn, DEFAULT_SHADOW_READY_TIMEOUT_MS as xr, createLocalStartCloudFrontCommand as xt, toStudioTargetGroups as y, resolveCfnRegion as ya, buildJwksUrlFromIssuer as yi, pickTargetFunctionLogicalId as yn, buildCloudMapIndex as yr, LocalStartCloudFrontError as yt, MICROVM_CONTROL_PATH as z, AGENTCORE_HTTP_PROTOCOL as za, buildRestV1Event as zi, albStrategy as zn, signAgentCoreInvocation as zr, disposeWebFunctionArtifact as zt };
|
|
33280
|
+
//# sourceMappingURL=local-studio-DKhMiVll.js.map
|