cdk-local 0.122.0 → 0.123.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +19 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -2
- package/dist/{local-studio-4yNaXX55.d.ts → local-studio-DWBWmuG-.d.ts} +8 -2
- package/dist/{local-studio-4yNaXX55.d.ts.map → local-studio-DWBWmuG-.d.ts.map} +1 -1
- package/dist/{local-studio-B08qyJZz.js → local-studio-Dk9H7QVO.js} +195 -18
- package/dist/local-studio-Dk9H7QVO.js.map +1 -0
- package/package.json +1 -1
- package/dist/local-studio-B08qyJZz.js.map +0 -1
|
@@ -5,6 +5,7 @@ import * as path$1 from "node:path";
|
|
|
5
5
|
import path, { dirname, isAbsolute, join, normalize, relative, resolve, sep } from "node:path";
|
|
6
6
|
import { Command, Option } from "commander";
|
|
7
7
|
import { AssumeRoleCommand, GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
8
|
+
import { unzipSync } from "fflate";
|
|
8
9
|
import { MultiSelectPrompt } from "@clack/core";
|
|
9
10
|
import { S_BAR, S_BAR_END, S_BAR_START, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, confirm, isCancel, multiselect, select, text } from "@clack/prompts";
|
|
10
11
|
import { AssetManifestArtifact } from "@aws-cdk/cloud-assembly-api";
|
|
@@ -29,7 +30,6 @@ import { createServer as createServer$2 } from "node:https";
|
|
|
29
30
|
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
30
31
|
import { pipeline } from "node:stream/promises";
|
|
31
32
|
import * as chokidar from "chokidar";
|
|
32
|
-
import { unzipSync } from "fflate";
|
|
33
33
|
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
34
34
|
import { SignatureV4 } from "@smithy/signature-v4";
|
|
35
35
|
import graphlib from "graphlib";
|
|
@@ -1011,7 +1011,7 @@ function extractLambdaProperties(stack, logicalId, resource, resources) {
|
|
|
1011
1011
|
if (!handler) throw new LocalInvokeResolutionError(`Lambda '${logicalId}' has no Handler property.`);
|
|
1012
1012
|
const inlineCode = typeof code["ZipFile"] === "string" ? code["ZipFile"] : void 0;
|
|
1013
1013
|
let codePath = null;
|
|
1014
|
-
if (!inlineCode) codePath = resolveAssetCodePath$1(stack, logicalId, resource);
|
|
1014
|
+
if (!inlineCode) codePath = resolveAssetCodePath$1(stack, logicalId, resource, { allowZip: true });
|
|
1015
1015
|
const layers = resolveLambdaLayers(stack, logicalId, props);
|
|
1016
1016
|
return {
|
|
1017
1017
|
kind: "zip",
|
|
@@ -1155,13 +1155,63 @@ function extractImageLambdaProperties(args) {
|
|
|
1155
1155
|
* Lambdas; absence usually means the user pre-synthesized with a different
|
|
1156
1156
|
* cdk.out and pointed `--output` at a stale one).
|
|
1157
1157
|
*/
|
|
1158
|
-
function resolveAssetCodePath$1(stack, logicalId, resource) {
|
|
1158
|
+
function resolveAssetCodePath$1(stack, logicalId, resource, options = {}) {
|
|
1159
1159
|
const assetPath = resource.Metadata?.["aws:asset:path"];
|
|
1160
1160
|
if (typeof assetPath !== "string" || assetPath.length === 0) throw new LocalInvokeResolutionError(`Lambda '${logicalId}' has no Metadata['aws:asset:path']. ${getEmbedConfig().cliName} invoke needs this hint to find the local asset directory. Re-synthesize the app (without \`--output <stale-dir>\`) and retry.`);
|
|
1161
1161
|
const cdkOutDir = stack.assetManifestPath ? dirname(stack.assetManifestPath) : process.cwd();
|
|
1162
1162
|
const abs = isAbsolute(assetPath) ? assetPath : resolve(cdkOutDir, assetPath);
|
|
1163
|
-
if (!existsSync(abs)
|
|
1164
|
-
|
|
1163
|
+
if (!existsSync(abs)) throw new LocalInvokeResolutionError(`Lambda '${logicalId}' asset path '${abs}' does not exist. Re-synthesize the app and retry.`);
|
|
1164
|
+
const stat = statSync(abs);
|
|
1165
|
+
if (stat.isDirectory()) return abs;
|
|
1166
|
+
if (options.allowZip && stat.isFile() && abs.toLowerCase().endsWith(".zip")) return abs;
|
|
1167
|
+
throw new LocalInvokeResolutionError(`Lambda '${logicalId}' asset path '${abs}' is not a directory` + (options.allowZip ? " or a .zip archive" : "") + ". Re-synthesize the app and retry.");
|
|
1168
|
+
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Turn a resolved function-code asset path into a directory ready to
|
|
1171
|
+
* bind-mount into the Lambda container.
|
|
1172
|
+
*
|
|
1173
|
+
* Most CDK Lambda assets are already-unzipped directories (`asset.<hash>/`)
|
|
1174
|
+
* that bind-mount directly — those pass through untouched. But a
|
|
1175
|
+
* ZIP-packaged asset (`Code.fromAsset('bundle.zip')`, or a bundling that
|
|
1176
|
+
* emits a zip) is staged as `asset.<hash>.zip` and `aws:asset:path` points at
|
|
1177
|
+
* the zip FILE. Docker cannot bind-mount a zip file as a directory, so we
|
|
1178
|
+
* extract it to a fresh temp dir on demand and return that for the mount.
|
|
1179
|
+
*
|
|
1180
|
+
* Used by `cdkl invoke`, `cdkl start-api`, and the front-door Lambda runner —
|
|
1181
|
+
* the three places that bind-mount a ZIP Lambda's code — so all agree on the
|
|
1182
|
+
* zip handling. The returned `tmpDir` (when set) is threaded into the caller's
|
|
1183
|
+
* existing tmpdir cleanup.
|
|
1184
|
+
*/
|
|
1185
|
+
function materializeAssetCodeDir(codePath) {
|
|
1186
|
+
if (!existsSync(codePath)) throw new LocalInvokeResolutionError(`Lambda asset path '${codePath}' does not exist. Re-synthesize the app and retry.`);
|
|
1187
|
+
if (statSync(codePath).isDirectory()) return { dir: codePath };
|
|
1188
|
+
let files;
|
|
1189
|
+
try {
|
|
1190
|
+
files = unzipSync(readFileSync(codePath));
|
|
1191
|
+
} catch (err) {
|
|
1192
|
+
throw new LocalInvokeResolutionError(`Lambda asset '${codePath}' is a file but could not be read as a ZIP archive: ${err instanceof Error ? err.message : String(err)}. Re-synthesize the app and retry.`);
|
|
1193
|
+
}
|
|
1194
|
+
const dir = mkdtempSync(join(tmpdir(), `${getEmbedConfig().resourceNamePrefix}-lambda-zip-`));
|
|
1195
|
+
for (const [name, content] of Object.entries(files)) {
|
|
1196
|
+
if (name.endsWith("/")) continue;
|
|
1197
|
+
const dest = resolveSafeZipEntryPath(dir, name);
|
|
1198
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
1199
|
+
writeFileSync(dest, content);
|
|
1200
|
+
}
|
|
1201
|
+
return {
|
|
1202
|
+
dir,
|
|
1203
|
+
tmpDir: dir
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* Guard against zip-slip: reject an entry whose normalized path escapes the
|
|
1208
|
+
* extraction root (e.g. `../../etc/passwd`).
|
|
1209
|
+
*/
|
|
1210
|
+
function resolveSafeZipEntryPath(root, entry) {
|
|
1211
|
+
const dest = normalize(join(root, entry));
|
|
1212
|
+
const rootWithSep = root.endsWith(sep) ? root : root + sep;
|
|
1213
|
+
if (dest !== root && !dest.startsWith(rootWithSep)) throw new LocalInvokeResolutionError(`Refusing to extract a Lambda ZIP asset entry that escapes the target dir: '${entry}'.`);
|
|
1214
|
+
return dest;
|
|
1165
1215
|
}
|
|
1166
1216
|
/**
|
|
1167
1217
|
* Resolve a Lambda's `Properties.Layers` references to local asset
|
|
@@ -16269,7 +16319,11 @@ async function buildContainerSpec(args) {
|
|
|
16269
16319
|
let imageRef;
|
|
16270
16320
|
let platform;
|
|
16271
16321
|
if (lambda.kind === "zip") {
|
|
16272
|
-
|
|
16322
|
+
if (lambda.codePath) {
|
|
16323
|
+
const materialized = materializeAssetCodeDir(lambda.codePath);
|
|
16324
|
+
codeDir = materialized.dir;
|
|
16325
|
+
if (materialized.tmpDir) inlineTmpDirs.add(materialized.tmpDir);
|
|
16326
|
+
} else codeDir = materializeInlineCode$2(lambda.handler, lambda.inlineCode ?? "", resolveRuntimeFileExtension(lambda.runtime), inlineTmpDirs);
|
|
16273
16327
|
optDir = await materializeLambdaLayers$1(lambda.layers, layerTmpDirs, layerRoleArn);
|
|
16274
16328
|
} else {
|
|
16275
16329
|
imageRef = (await resolveContainerImageForStartApi(lambda, skipPull, args.profile, {
|
|
@@ -17205,6 +17259,14 @@ async function localInvokeCommand(target, options, extraStateProviders) {
|
|
|
17205
17259
|
} catch (err) {
|
|
17206
17260
|
getLogger().debug(`Failed to remove inline-code tmpdir ${imagePlan.inlineTmpDir}: ${err instanceof Error ? err.message : String(err)}`);
|
|
17207
17261
|
}
|
|
17262
|
+
if (imagePlan?.assetTmpDir) try {
|
|
17263
|
+
rmSync(imagePlan.assetTmpDir, {
|
|
17264
|
+
recursive: true,
|
|
17265
|
+
force: true
|
|
17266
|
+
});
|
|
17267
|
+
} catch (err) {
|
|
17268
|
+
getLogger().debug(`Failed to remove zip-asset tmpdir ${imagePlan.assetTmpDir}: ${err instanceof Error ? err.message : String(err)}`);
|
|
17269
|
+
}
|
|
17208
17270
|
if (imagePlan?.layersTmpDir) try {
|
|
17209
17271
|
rmSync(imagePlan.layersTmpDir, {
|
|
17210
17272
|
recursive: true,
|
|
@@ -17322,10 +17384,15 @@ async function resolveImagePlan(lambda, options) {
|
|
|
17322
17384
|
}
|
|
17323
17385
|
async function resolveZipImagePlan$1(lambda, options) {
|
|
17324
17386
|
let inlineTmpDir;
|
|
17387
|
+
let assetTmpDir;
|
|
17325
17388
|
let codeDir = lambda.codePath;
|
|
17326
17389
|
if (codeDir === null) {
|
|
17327
17390
|
inlineTmpDir = materializeInlineCode$1(lambda.handler, lambda.inlineCode ?? "", resolveRuntimeFileExtension(lambda.runtime));
|
|
17328
17391
|
codeDir = inlineTmpDir;
|
|
17392
|
+
} else {
|
|
17393
|
+
const materialized = materializeAssetCodeDir(codeDir);
|
|
17394
|
+
codeDir = materialized.dir;
|
|
17395
|
+
assetTmpDir = materialized.tmpDir;
|
|
17329
17396
|
}
|
|
17330
17397
|
const image = resolveRuntimeImage(lambda.runtime);
|
|
17331
17398
|
await pullImage(image, options.pull === false);
|
|
@@ -17342,6 +17409,7 @@ async function resolveZipImagePlan$1(lambda, options) {
|
|
|
17342
17409
|
extraMounts: layerPlan.mount ? [layerPlan.mount] : [],
|
|
17343
17410
|
cmd: [lambda.handler],
|
|
17344
17411
|
...inlineTmpDir !== void 0 && { inlineTmpDir },
|
|
17412
|
+
...assetTmpDir !== void 0 && { assetTmpDir },
|
|
17345
17413
|
...layerPlan.tmpDir !== void 0 && { layersTmpDir: layerPlan.tmpDir },
|
|
17346
17414
|
...layerPlan.extraTmpDirs.length > 0 && { layerArnTmpDirs: layerPlan.extraTmpDirs },
|
|
17347
17415
|
...tmpfs !== void 0 && { tmpfs }
|
|
@@ -24449,10 +24517,15 @@ function materializeInlineCode(handler, source, fileExtension) {
|
|
|
24449
24517
|
}
|
|
24450
24518
|
async function resolveZipImagePlan(lambda, opts) {
|
|
24451
24519
|
let inlineTmpDir;
|
|
24520
|
+
let assetTmpDir;
|
|
24452
24521
|
let codeDir = lambda.codePath;
|
|
24453
24522
|
if (codeDir === null) {
|
|
24454
24523
|
inlineTmpDir = materializeInlineCode(lambda.handler, lambda.inlineCode ?? "", resolveRuntimeFileExtension(lambda.runtime));
|
|
24455
24524
|
codeDir = inlineTmpDir;
|
|
24525
|
+
} else {
|
|
24526
|
+
const materialized = materializeAssetCodeDir(codeDir);
|
|
24527
|
+
codeDir = materialized.dir;
|
|
24528
|
+
assetTmpDir = materialized.tmpDir;
|
|
24456
24529
|
}
|
|
24457
24530
|
const image = resolveRuntimeImage(lambda.runtime);
|
|
24458
24531
|
await pullImage(image, opts.skipPull === true);
|
|
@@ -24465,7 +24538,8 @@ async function resolveZipImagePlan(lambda, opts) {
|
|
|
24465
24538
|
readOnly: true
|
|
24466
24539
|
}],
|
|
24467
24540
|
cmd: [lambda.handler],
|
|
24468
|
-
...inlineTmpDir !== void 0 && { inlineTmpDir }
|
|
24541
|
+
...inlineTmpDir !== void 0 && { inlineTmpDir },
|
|
24542
|
+
...assetTmpDir !== void 0 && { assetTmpDir }
|
|
24469
24543
|
};
|
|
24470
24544
|
}
|
|
24471
24545
|
async function resolveContainerImagePlan(lambda, opts) {
|
|
@@ -24592,6 +24666,14 @@ function createFrontDoorLambdaRunner(lambda, opts) {
|
|
|
24592
24666
|
} catch (err) {
|
|
24593
24667
|
logger.debug(`Failed to remove inline-code tmpdir ${plan.inlineTmpDir}: ${err instanceof Error ? err.message : String(err)}`);
|
|
24594
24668
|
}
|
|
24669
|
+
if (plan?.assetTmpDir) try {
|
|
24670
|
+
rmSync(plan.assetTmpDir, {
|
|
24671
|
+
recursive: true,
|
|
24672
|
+
force: true
|
|
24673
|
+
});
|
|
24674
|
+
} catch (err) {
|
|
24675
|
+
logger.debug(`Failed to remove zip-asset tmpdir ${plan.assetTmpDir}: ${err instanceof Error ? err.message : String(err)}`);
|
|
24676
|
+
}
|
|
24595
24677
|
}
|
|
24596
24678
|
};
|
|
24597
24679
|
}
|
|
@@ -28722,7 +28804,8 @@ function resolveOrigins(dc, template, stack, overrides) {
|
|
|
28722
28804
|
continue;
|
|
28723
28805
|
}
|
|
28724
28806
|
const bucketLogicalId = pickBucketLogicalIdFromOrigin(origin, template);
|
|
28725
|
-
|
|
28807
|
+
const s3Domain = describeS3OriginDomain(origin["DomainName"]);
|
|
28808
|
+
if (!(origin["S3OriginConfig"] !== void 0 || bucketLogicalId !== void 0 || s3Domain.isS3)) {
|
|
28726
28809
|
const lambdaUrl = resolveLambdaUrlOrigin(origin, template, originId);
|
|
28727
28810
|
if (lambdaUrl) {
|
|
28728
28811
|
out.set(originId, lambdaUrl);
|
|
@@ -28741,15 +28824,59 @@ function resolveOrigins(dc, template, stack, overrides) {
|
|
|
28741
28824
|
originId,
|
|
28742
28825
|
localDirs
|
|
28743
28826
|
});
|
|
28744
|
-
else
|
|
28745
|
-
|
|
28746
|
-
originId,
|
|
28747
|
-
|
|
28748
|
-
|
|
28827
|
+
else {
|
|
28828
|
+
const literalBucket = bucketLogicalId === void 0 ? s3Domain.bucketName : void 0;
|
|
28829
|
+
out.set(originId, {
|
|
28830
|
+
kind: "s3-unresolved",
|
|
28831
|
+
originId,
|
|
28832
|
+
...bucketLogicalId !== void 0 && { bucketLogicalId },
|
|
28833
|
+
...literalBucket !== void 0 && { bucketName: literalBucket },
|
|
28834
|
+
...bucketLogicalId === void 0 && literalBucket === void 0 && s3Domain.isS3 ? { deployedConfigOnly: true } : {}
|
|
28835
|
+
});
|
|
28836
|
+
}
|
|
28749
28837
|
}
|
|
28750
28838
|
return out;
|
|
28751
28839
|
}
|
|
28752
28840
|
/**
|
|
28841
|
+
* Describe an S3 origin's `DomainName`: whether it is an S3-bucket domain and,
|
|
28842
|
+
* if so, the literal bucket name when it is statically derivable from the
|
|
28843
|
+
* template (issue #405 follow-up). Handles a literal string, an `Fn::Sub`
|
|
28844
|
+
* template, and an `Fn::Join('', [...])`. The bucket label is the part before
|
|
28845
|
+
* `.s3` / `.s3-website`; when that label is a pure intrinsic (`${Ref}`), the
|
|
28846
|
+
* name is left undefined (the command resolves it via GetDistributionConfig).
|
|
28847
|
+
* The region segment (`${AWS::Region}` etc.) does NOT affect the bucket name,
|
|
28848
|
+
* so it is normalized away just to validate the S3 shape.
|
|
28849
|
+
*/
|
|
28850
|
+
function describeS3OriginDomain(value) {
|
|
28851
|
+
const flat = flattenDomainTemplate(value);
|
|
28852
|
+
if (flat === void 0) return { isS3: false };
|
|
28853
|
+
const normalized = flat.replace(/\$\{AWS::Region\}/g, "region").replace(/\$\{AWS::URLSuffix\}/g, "amazonaws.com").replace(/\$\{AWS::Partition\}/g, "aws");
|
|
28854
|
+
const match = /^(.+?)\.s3(?:[.-][A-Za-z0-9$.{}_-]+)*\.amazonaws\.com$/.exec(normalized);
|
|
28855
|
+
if (!match) return { isS3: false };
|
|
28856
|
+
const label = match[1];
|
|
28857
|
+
if (label.includes("${") || label.includes("{Fn")) return { isS3: true };
|
|
28858
|
+
return {
|
|
28859
|
+
isS3: true,
|
|
28860
|
+
bucketName: label
|
|
28861
|
+
};
|
|
28862
|
+
}
|
|
28863
|
+
/**
|
|
28864
|
+
* Flatten an origin `DomainName` to a single string for S3-shape matching:
|
|
28865
|
+
* a literal string verbatim; an `Fn::Sub` template's string; an
|
|
28866
|
+
* `Fn::Join('', parts)` with literal parts verbatim and intrinsic parts as a
|
|
28867
|
+
* `${...}` marker. Returns `undefined` for any other shape.
|
|
28868
|
+
*/
|
|
28869
|
+
function flattenDomainTemplate(value) {
|
|
28870
|
+
if (typeof value === "string") return value;
|
|
28871
|
+
if (!value || typeof value !== "object") return void 0;
|
|
28872
|
+
const obj = value;
|
|
28873
|
+
const sub = obj["Fn::Sub"];
|
|
28874
|
+
if (typeof sub === "string") return sub;
|
|
28875
|
+
if (Array.isArray(sub) && typeof sub[0] === "string") return sub[0];
|
|
28876
|
+
const join = obj["Fn::Join"];
|
|
28877
|
+
if (Array.isArray(join) && join[0] === "" && Array.isArray(join[1])) return join[1].map((part) => typeof part === "string" ? part : "${x}").join("");
|
|
28878
|
+
}
|
|
28879
|
+
/**
|
|
28753
28880
|
* Read a stack's asset manifest, or `undefined` when it ships no assets / is
|
|
28754
28881
|
* unreadable. We already hold the absolute manifest path on {@link StackInfo},
|
|
28755
28882
|
* so we read + parse it directly rather than going through the by-stack-name
|
|
@@ -29870,6 +29997,40 @@ function classifyS3Error(err) {
|
|
|
29870
29997
|
};
|
|
29871
29998
|
}
|
|
29872
29999
|
|
|
30000
|
+
//#endregion
|
|
30001
|
+
//#region src/local/cloudfront-distribution-config.ts
|
|
30002
|
+
/**
|
|
30003
|
+
* Returns the resolved bucket name, or `undefined` when the distribution /
|
|
30004
|
+
* origin cannot be read or its `DomainName` is not an S3 domain. Never throws —
|
|
30005
|
+
* a failure (no permission, wrong id, throttle) resolves to `undefined` so the
|
|
30006
|
+
* caller can fall back to its actionable `--origin` guidance.
|
|
30007
|
+
*/
|
|
30008
|
+
async function resolveDeployedOriginBucket(options) {
|
|
30009
|
+
try {
|
|
30010
|
+
const origin = (await (options.getOrigins ? options.getOrigins(options.distributionId) : defaultGetOrigins(options))).find((o) => o.Id === options.originId);
|
|
30011
|
+
if (!origin || typeof origin.DomainName !== "string") return void 0;
|
|
30012
|
+
return describeS3OriginDomain(origin.DomainName).bucketName;
|
|
30013
|
+
} catch {
|
|
30014
|
+
return;
|
|
30015
|
+
}
|
|
30016
|
+
}
|
|
30017
|
+
async function defaultGetOrigins(options) {
|
|
30018
|
+
const { CloudFrontClient, GetDistributionConfigCommand } = await import("@aws-sdk/client-cloudfront");
|
|
30019
|
+
const client = new CloudFrontClient({
|
|
30020
|
+
region: "us-east-1",
|
|
30021
|
+
...options.credentials && { credentials: {
|
|
30022
|
+
accessKeyId: options.credentials.accessKeyId,
|
|
30023
|
+
secretAccessKey: options.credentials.secretAccessKey,
|
|
30024
|
+
...options.credentials.sessionToken && { sessionToken: options.credentials.sessionToken }
|
|
30025
|
+
} }
|
|
30026
|
+
});
|
|
30027
|
+
try {
|
|
30028
|
+
return (await client.send(new GetDistributionConfigCommand({ Id: options.distributionId }))).DistributionConfig?.Origins?.Items ?? [];
|
|
30029
|
+
} finally {
|
|
30030
|
+
client.destroy();
|
|
30031
|
+
}
|
|
30032
|
+
}
|
|
30033
|
+
|
|
29873
30034
|
//#endregion
|
|
29874
30035
|
//#region src/local/cloudfront-kvs-client.ts
|
|
29875
30036
|
/**
|
|
@@ -30231,9 +30392,25 @@ async function resolveDeployedS3Origins(distribution, stacks, options, profileCr
|
|
|
30231
30392
|
const region = options.stackRegion ?? options.region ?? synthRegion;
|
|
30232
30393
|
const provider = createLocalStateProvider(options, distribution.stackName, synthRegion);
|
|
30233
30394
|
const record = provider ? await provider.load(distribution.stackName, synthRegion) : void 0;
|
|
30395
|
+
const distributionId = record?.resources[distribution.logicalId]?.physicalId;
|
|
30234
30396
|
for (const origin of [...distribution.origins.values()]) {
|
|
30235
|
-
if (origin.kind !== "s3-unresolved"
|
|
30236
|
-
|
|
30397
|
+
if (origin.kind !== "s3-unresolved") continue;
|
|
30398
|
+
let bucketName;
|
|
30399
|
+
let via;
|
|
30400
|
+
if (origin.bucketLogicalId !== void 0) {
|
|
30401
|
+
bucketName = record?.resources[origin.bucketLogicalId]?.physicalId;
|
|
30402
|
+
via = "deployed state";
|
|
30403
|
+
} else if (origin.bucketName !== void 0) {
|
|
30404
|
+
bucketName = origin.bucketName;
|
|
30405
|
+
via = "the origin's DomainName";
|
|
30406
|
+
} else if (origin.deployedConfigOnly && distributionId) {
|
|
30407
|
+
bucketName = await resolveDeployedOriginBucket({
|
|
30408
|
+
distributionId,
|
|
30409
|
+
originId: origin.originId,
|
|
30410
|
+
...profileCredentials !== void 0 && { credentials: profileCredentials }
|
|
30411
|
+
});
|
|
30412
|
+
via = "GetDistributionConfig";
|
|
30413
|
+
} else continue;
|
|
30237
30414
|
if (!bucketName) continue;
|
|
30238
30415
|
readers.set(origin.originId, createS3OriginReader(bucketName, {
|
|
30239
30416
|
...region !== void 0 && { region },
|
|
@@ -30246,7 +30423,7 @@ async function resolveDeployedS3Origins(distribution, stacks, options, profileCr
|
|
|
30246
30423
|
originId: origin.originId,
|
|
30247
30424
|
bucketName
|
|
30248
30425
|
});
|
|
30249
|
-
logger.info(`Origin '${origin.originId}': no local BucketDeployment source; serving from deployed S3 (bucket=${bucketName}) on demand under --from-cfn-stack.`);
|
|
30426
|
+
logger.info(`Origin '${origin.originId}': no local BucketDeployment source; serving from deployed S3 (bucket=${bucketName}, resolved via ${via}) on demand under --from-cfn-stack.`);
|
|
30250
30427
|
}
|
|
30251
30428
|
return {
|
|
30252
30429
|
readers,
|
|
@@ -35466,5 +35643,5 @@ function addStudioSpecificOptions(cmd) {
|
|
|
35466
35643
|
}
|
|
35467
35644
|
|
|
35468
35645
|
//#endregion
|
|
35469
|
-
export {
|
|
35470
|
-
//# sourceMappingURL=local-studio-
|
|
35646
|
+
export { isCloudFrontDistribution as $, attachAuthorizers as $n, parseSelectionExpressionPath as $r, createLocalInvokeAgentCoreCommand as $t, parseOriginOverrides as A, buildStageMap as An, EcsTaskResolutionError as Ar, parseMaxTasks as At, startCloudFrontServer as B, resolveServiceIntegrationParameters as Bn, resolveCfnRegion as Br, resolveImageOverrides as Bt, addListSpecificOptions as C, addStartApiSpecificOptions as Cn, buildDisconnectEvent as Cr, createLocalRunTaskCommand as Ct, addStartCloudFrontSpecificOptions as D, createAuthorizerCache as Dn, resolveRuntimeCodeMountPath as Dr, addImageOverrideOptions as Dt, LocalStartCloudFrontError as E, resolveApiTargetSubset as En, buildContainerImage as Er, addEcsAssumeRoleOptions as Et, resolveDeployedKvsArnByName as F, filterRoutesByApiIdentifiers as Fn, LocalStateSourceError as Fr, ImageOverrideError as Ft, applyEdgeResponseResult as G, verifyCognitoJwt as Gn, resolveWatchConfig as Gr, buildCloudMapIndex as Gt, serveFromStaticOrigin as H, buildCognitoJwksUrl as Hn, CfnLocalStateProvider as Hr, describePinnedImageUri as Ht, resolveDeployedOriginBucket as I, groupRoutesByServer as In, createLocalStateProvider as Ir, buildImageOverrideTag as It, edgeHeadersToHttp as J, buildMethodArn as Jn, listTargets as Jr, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as Jt, buildEdgeRequestEvent as K, verifyJwtAuthorizer as Kn, resolveSingleTarget as Kr, CloudMapRegistry as Kt, classifyS3Error as L, readMtlsMaterialsFromDisk as Ln, isCfnFlagPresent as Lr, enforceImageOverrideOrphans as Lt, idFromArn as M, resolveEnvVars$1 as Mn, substituteAgainstStateAsync as Mr, resolveEcsAssumeRoleOption as Mt, resolveKvsModulesForDistribution as N, availableApiIdentifiers as Nn, substituteEnvVarsFromState as Nr, resolveSharedSidecarCredentials as Nt, createLocalStartCloudFrontCommand as O, createFileWatcher as On, resolveRuntimeFileExtension as Or, buildEcsImageResolutionContext$1 as Ot, createDeployedKvsDataSource as P, filterRoutesByApiIdentifier as Pn, substituteEnvVarsFromStateAsync as Pr, runEcsServiceEmulator as Pt, extractKvsAssociations as Q, invokeTokenAuthorizer as Qn, filterWebSocketApisByIdentifiers as Qr, addInvokeAgentCoreSpecificOptions as Qt, createS3OriginReader as R, startApiServer as Rn, rejectExplicitCfnStackWithMultipleStacks as Rr, mergeForService as Rt, StudioEventBus as S, createLocalInvokeCommand as Sn, buildConnectEvent as Sr, addRunTaskSpecificOptions as St, formatTargetListing as T, createWatchPredicates as Tn, architectureToPlatform as Tr, addCommonEcsServiceOptions as Tt, serveLambdaUrlOrigin as U, buildJwksUrlFromIssuer as Un, collectSsmParameterRefs as Ur, isLocalCdkAssetImage as Ut, resolveErrorResponseCandidates as V, defaultCredentialsLoader as Vn, resolveCfnStackName as Vr, runImageOverrideBuilds as Vt, applyEdgeRequestResult as W, createJwksCache as Wn, resolveSsmParameters as Wr, listPinnedTargets as Wt, CLOUDFRONT_DISTRIBUTION_TYPE as X, evaluateCachedLambdaPolicy as Xn, discoverWebSocketApis as Xr, getContainerNetworkIp as Xt, httpHeadersToEdge as Y, computeRequestIdentityHash as Yn, availableWebSocketApiIdentifiers as Yr, setShadowReadyTimeoutMs as Yt, describeS3OriginDomain as Z, invokeRequestAuthorizer as Zn, discoverWebSocketApisOrThrow as Zr, attachContainerLogStreamer as Zt, filterStudioTargetGroups as _, buildStsClientConfig as _i, computeCodeImageTag as _n, bufferToBody as _r, isApplicationLoadBalancer as _t, createLocalStudioCommand as a, AGENTCORE_AGUI_PROTOCOL as ai, MCP_PATH as an, matchRoute as ar, compileCloudFrontFunction as at, renderStudioHtml as b, classifySourceChange as bn, handleConnectionsRequest as br, createLocalStartServiceCommand as bt, startStudioProxy as c, AGENTCORE_RUNTIME_TYPE as ci, parseSseForJsonRpc as cn, buildHttpApiV2Event as cr, stripCloudFrontImport as ct, createStudioDispatcher as d, resolveAgentCoreTarget as di, AGENTCORE_SESSION_ID_HEADER as dn, pickResponseTemplate as dr, createUnboundCloudFrontModule as dt, webSocketApiMatchesIdentifier as ei, invokeAgentCoreWs as en, applyCorsResponseHeaders as er, pickFunctionUrlLogicalIdFromOrigin as et, filterStudioCustomResources as f, derivePseudoParametersFromRegion as fi, invokeAgentCore as fn, selectIntegrationResponse as fr, addAlbSpecificOptions as ft, annotatePinnedEcsTargets as g, LocalInvokeBuildError as gi, buildAgentCoreCodeImage as gn, probeHostGatewaySupport as gr, resolveAlbTarget as gt, annotateEcsTaskPinnedTargets as h, tryResolveImageFnJoin as hi, SUPPORTED_CODE_RUNTIMES as hn, HOST_GATEWAY_MIN_VERSION as hr, parseLbPortOverrides as ht, coerceStopRequest as i, AGENTCORE_A2A_PROTOCOL as ii, MCP_CONTAINER_PORT as in, matchPreflight as ir, resolveCloudFrontDistribution as it, resolveCloudFrontTarget as j, materializeLayerFromArn as jn, substituteAgainstState as jr, parseRestartPolicy as jt, parseKvsFileOverrides as k, attachStageContext as kn, resolveRuntimeImage as kr, ecsClusterOption as kt, relayServeRequest as l, AgentCoreResolutionError as li, AGENTCORE_SIGV4_SERVICE as ln, buildRestV1Event as lr, createCloudFrontModule as lt, annotateAlbPinnedBackingServices as m, substituteImagePlaceholders as mi, downloadAndExtractS3Bundle as mn, VtlEvaluationError as mr, createLocalStartAlbCommand as mt, coerceRunRequest as n, pickRefLogicalId as ni, A2A_PATH as nn, buildCorsConfigFromCloudFrontChain as nr, pickLambdaEdgeFunctionLogicalId as nt, resolveServeBaseUrl as o, AGENTCORE_HTTP_PROTOCOL as oi, MCP_PROTOCOL_VERSION as on, translateLambdaResponse as or, runViewerRequest as ot, isCustomResourceLambdaTarget as p, formatStateRemedy as pi, waitForAgentCorePing as pn, tryParseStatus as pr, albStrategy as pt, buildEdgeResponseEvent as q, verifyJwtViaDiscovery as qn, countTargets as qr, DEFAULT_SHADOW_READY_TIMEOUT_MS as qt, coerceServeRequest as r, resolveLambdaArnIntrinsic as ri, a2aInvokeOnce as rn, isFunctionUrlOacFronted as rr, pickTargetFunctionLogicalId as rt, createStudioServeManager as s, AGENTCORE_MCP_PROTOCOL as si, mcpInvokeOnce as sn, applyAuthorizerOverlay as sr, runViewerResponse as st, addStudioSpecificOptions as t, discoverRoutes as ti, A2A_CONTAINER_PORT as tn, buildCorsConfigByApiId as tr, pickKvsLogicalIdFromArn as tt, reinvoke as u, pickAgentCoreCandidateStack as ui, signAgentCoreInvocation as un, evaluateResponseParameters as ur, createLocalFileKvsDataSource as ut, startStudioServer as v, resolveProfileCredentials as vi, renderCodeDockerfile as vn, ConnectionRegistry as vr, resolveAlbFrontDoor as vt, createLocalListCommand as w, createLocalStartApiCommand as wn, buildMessageEvent as wr, MAX_TASKS_SUBNET_RANGE_CAP as wt, createStudioStore as x, addInvokeSpecificOptions as xn, parseConnectionsPath as xr, serviceStrategy as xt, toStudioTargetGroups as y, toCmdArgv as yn, buildMgmtEndpointEnvUrl as yr, addStartServiceSpecificOptions as yt, matchBehavior as z, resolveSelectionExpression as zn, resolveCfnFallbackRegion as zr, parseImageOverrideFlags as zt };
|
|
35647
|
+
//# sourceMappingURL=local-studio-Dk9H7QVO.js.map
|