cdk-local 0.113.0 → 0.114.0
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 +2 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -2
- package/dist/{local-studio-BXe9E0Q0.d.ts → local-studio-A0ZCH8Nu.d.ts} +3 -2
- package/dist/{local-studio-BXe9E0Q0.d.ts.map → local-studio-A0ZCH8Nu.d.ts.map} +1 -1
- package/dist/{local-studio-DqmMvzg4.js → local-studio-DGQ8RG82.js} +77 -14
- package/dist/{local-studio-DqmMvzg4.js.map → local-studio-DGQ8RG82.js.map} +1 -1
- package/package.json +1 -1
|
@@ -30882,11 +30882,13 @@ const STUDIO_SCRIPT = `
|
|
|
30882
30882
|
ws.appendChild(head);
|
|
30883
30883
|
|
|
30884
30884
|
if (!running && !starting && !failed) {
|
|
30885
|
-
// A pinned ECS service (deployed-registry image) does
|
|
30886
|
-
// source edits — offer an image-override Dockerfile
|
|
30887
|
-
// rebuilt locally (issue #301
|
|
30888
|
-
//
|
|
30889
|
-
|
|
30885
|
+
// A pinned ECS service / task definition (deployed-registry image) does
|
|
30886
|
+
// not pick up local source edits — offer an image-override Dockerfile
|
|
30887
|
+
// picker so it can be rebuilt locally (issue #301 for ecs, #388 for
|
|
30888
|
+
// ecs-task). The ecs composer threads --image-override to start-service;
|
|
30889
|
+
// the ecs-task composer threads it to run-task. Local-asset targets
|
|
30890
|
+
// rebuild locally already and get no picker.
|
|
30891
|
+
if (meta && (meta.kind === 'ecs' || meta.kind === 'ecs-task') && meta.pinned) {
|
|
30890
30892
|
const io = buildImageOverridePicker();
|
|
30891
30893
|
ws.appendChild(io.node);
|
|
30892
30894
|
collectImageOverride = io.collect;
|
|
@@ -32103,6 +32105,33 @@ function annotatePinnedEcsTargets(groups, classify) {
|
|
|
32103
32105
|
return anyPinned;
|
|
32104
32106
|
}
|
|
32105
32107
|
/**
|
|
32108
|
+
* Annotate the `ecs-task` task-definition entries of `groups` with
|
|
32109
|
+
* `pinned: true` when `classify(targetId)` returns true (issue #388). The
|
|
32110
|
+
* counterpart of {@link annotatePinnedEcsTargets} for the `ecs-task` kind: a
|
|
32111
|
+
* task definition whose representative container image is a deployed-registry
|
|
32112
|
+
* pin gets the same image-override Dockerfile picker (the `ecs-task` composer
|
|
32113
|
+
* spawns `cdkl run-task`, which now accepts `--image-override`). `classify`
|
|
32114
|
+
* decides pinned vs local CDK asset for one task-def id (studio's boot resolves
|
|
32115
|
+
* the task via `resolveEcsTaskTarget` and checks the representative container's
|
|
32116
|
+
* image kind). Unlike the `ecs` group there is no `servable` gate — every
|
|
32117
|
+
* task-def entry is run via run-task. Mutates the entries in place and returns
|
|
32118
|
+
* whether ANY task definition was pinned, so the caller can include the
|
|
32119
|
+
* Dockerfile scan even when no standalone `ecs` service was pinned. Non-ecs-task
|
|
32120
|
+
* groups are left untouched. Exported so a host CLI can reuse it + so the boot
|
|
32121
|
+
* logic is unit-testable without a real synth.
|
|
32122
|
+
*/
|
|
32123
|
+
function annotateEcsTaskPinnedTargets(groups, classify) {
|
|
32124
|
+
let anyPinned = false;
|
|
32125
|
+
for (const group of groups) {
|
|
32126
|
+
if (group.kind !== "ecs-task") continue;
|
|
32127
|
+
for (const entry of group.entries) if (classify(entry.id)) {
|
|
32128
|
+
entry.pinned = true;
|
|
32129
|
+
anyPinned = true;
|
|
32130
|
+
}
|
|
32131
|
+
}
|
|
32132
|
+
return anyPinned;
|
|
32133
|
+
}
|
|
32134
|
+
/**
|
|
32106
32135
|
* Annotate each `alb` entry of `groups` with the deployed-registry-pinned ECS
|
|
32107
32136
|
* services that ALB fronts (issue #384), so the alb composer can offer a
|
|
32108
32137
|
* per-service image-override Dockerfile picker. `resolveBackingPinned` maps one
|
|
@@ -33811,6 +33840,33 @@ function makePinClassifier(args) {
|
|
|
33811
33840
|
};
|
|
33812
33841
|
}
|
|
33813
33842
|
/**
|
|
33843
|
+
* Build the boot-time pin classifier {@link annotateEcsTaskPinnedTargets} calls
|
|
33844
|
+
* per `ecs-task` task definition (issue #388) — the counterpart of
|
|
33845
|
+
* {@link makePinClassifier} for task defs. Resolves the task via
|
|
33846
|
+
* {@link resolveEcsTaskTarget} (threading the owning stack's
|
|
33847
|
+
* {@link EcsImageResolutionContext} so an INTRINSIC-ECR image resolves under
|
|
33848
|
+
* `--from-cfn-stack`, same as the service path) and classifies its
|
|
33849
|
+
* representative container (first essential, else first) as a deployed-registry
|
|
33850
|
+
* pin when the image kind is not `cdk-asset`. A task def that cannot be
|
|
33851
|
+
* classified is WARN-logged (not silently swallowed) and left unmarked.
|
|
33852
|
+
*
|
|
33853
|
+
* Returns a `(id) => boolean` callback (true = pinned). Exported for testing.
|
|
33854
|
+
*/
|
|
33855
|
+
function makeTaskPinClassifier(args) {
|
|
33856
|
+
const { stacks, contextByStack, logger } = args;
|
|
33857
|
+
return (id) => {
|
|
33858
|
+
try {
|
|
33859
|
+
const stack = resolveEcsServiceStack(id, stacks);
|
|
33860
|
+
const task = resolveEcsTaskTarget(id, stacks, stack ? contextByStack.get(stack.stackName) : void 0);
|
|
33861
|
+
const representative = task.containers.find((c) => c.essential) ?? task.containers[0];
|
|
33862
|
+
return representative !== void 0 && representative.image.kind !== "cdk-asset";
|
|
33863
|
+
} catch (err) {
|
|
33864
|
+
logger.warn(`studio: could not classify image-pin status for ECS task definition '${id}'; leaving it unmarked (the image-override picker will not be offered). ${err instanceof Error ? err.message : String(err)}`);
|
|
33865
|
+
return false;
|
|
33866
|
+
}
|
|
33867
|
+
};
|
|
33868
|
+
}
|
|
33869
|
+
/**
|
|
33814
33870
|
* Build the boot-time resolver `annotateAlbPinnedBackingServices` calls per
|
|
33815
33871
|
* `alb` entry (issue #384). It resolves the ALB to its backing ECS services
|
|
33816
33872
|
* (`resolveAlbFrontDoor`, template-only) and returns the subset that is in
|
|
@@ -33876,14 +33932,21 @@ async function classifyStudioTargets(args) {
|
|
|
33876
33932
|
...options,
|
|
33877
33933
|
fromCfnStack
|
|
33878
33934
|
};
|
|
33935
|
+
const taskDefIds = (baseGroups.find((g) => g.kind === "ecs-task")?.entries ?? []).map((e) => e.id);
|
|
33936
|
+
const contextByStack = await prepareEcsImageContexts({
|
|
33937
|
+
serviceIds: [...servableEcs, ...taskDefIds],
|
|
33938
|
+
stacks,
|
|
33939
|
+
options: classifyOptions,
|
|
33940
|
+
logger
|
|
33941
|
+
});
|
|
33879
33942
|
const anyPinned = annotatePinnedEcsTargets(groups, makePinClassifier({
|
|
33880
33943
|
stacks,
|
|
33881
|
-
contextByStack
|
|
33882
|
-
|
|
33883
|
-
|
|
33884
|
-
|
|
33885
|
-
|
|
33886
|
-
|
|
33944
|
+
contextByStack,
|
|
33945
|
+
logger
|
|
33946
|
+
}));
|
|
33947
|
+
const anyTaskPinned = annotateEcsTaskPinnedTargets(groups, makeTaskPinClassifier({
|
|
33948
|
+
stacks,
|
|
33949
|
+
contextByStack,
|
|
33887
33950
|
logger
|
|
33888
33951
|
}));
|
|
33889
33952
|
const pinnedEcsByQualifiedId = /* @__PURE__ */ new Map();
|
|
@@ -33898,7 +33961,7 @@ async function classifyStudioTargets(args) {
|
|
|
33898
33961
|
}));
|
|
33899
33962
|
return {
|
|
33900
33963
|
groups,
|
|
33901
|
-
dockerfiles: anyPinned || anyAlbBackingPinned ? discoverDockerfiles(process.cwd()) : []
|
|
33964
|
+
dockerfiles: anyPinned || anyTaskPinned || anyAlbBackingPinned ? discoverDockerfiles(process.cwd()) : []
|
|
33902
33965
|
};
|
|
33903
33966
|
}
|
|
33904
33967
|
/**
|
|
@@ -34171,5 +34234,5 @@ function addStudioSpecificOptions(cmd) {
|
|
|
34171
34234
|
}
|
|
34172
34235
|
|
|
34173
34236
|
//#endregion
|
|
34174
|
-
export {
|
|
34175
|
-
//# sourceMappingURL=local-studio-
|
|
34237
|
+
export { addRunTaskSpecificOptions as $, buildConnectEvent as $n, createLocalInvokeCommand as $t, resolveCloudFrontTarget as A, attachAuthorizers as An, parseSelectionExpressionPath as Ar, createLocalInvokeAgentCoreCommand as At, compileCloudFrontFunction as B, buildRestV1Event as Bn, AgentCoreResolutionError as Br, AGENTCORE_SIGV4_SERVICE as Bt, addListSpecificOptions as C, verifyJwtAuthorizer as Cn, resolveSingleTarget as Cr, CloudMapRegistry as Ct, addStartCloudFrontSpecificOptions as D, evaluateCachedLambdaPolicy as Dn, discoverWebSocketApis as Dr, getContainerNetworkIp as Dt, LocalStartCloudFrontError as E, computeRequestIdentityHash as En, availableWebSocketApiIdentifiers as Er, setShadowReadyTimeoutMs as Et, CLOUDFRONT_DISTRIBUTION_TYPE as F, matchPreflight as Fn, AGENTCORE_A2A_PROTOCOL as Fr, MCP_CONTAINER_PORT as Ft, createLocalStartAlbCommand as G, VtlEvaluationError as Gn, substituteImagePlaceholders as Gr, downloadAndExtractS3Bundle as Gt, runViewerResponse as H, pickResponseTemplate as Hn, resolveAgentCoreTarget as Hr, AGENTCORE_SESSION_ID_HEADER as Ht, isCloudFrontDistribution as I, matchRoute as In, AGENTCORE_AGUI_PROTOCOL as Ir, MCP_PATH as It, isApplicationLoadBalancer as J, bufferToBody as Jn, buildStsClientConfig as Jr, computeCodeImageTag as Jt, parseLbPortOverrides as K, HOST_GATEWAY_MIN_VERSION as Kn, tryResolveImageFnJoin as Kr, SUPPORTED_CODE_RUNTIMES as Kt, pickFunctionUrlLogicalIdFromOrigin as L, translateLambdaResponse as Ln, AGENTCORE_HTTP_PROTOCOL as Lr, MCP_PROTOCOL_VERSION as Lt, startCloudFrontServer as M, buildCorsConfigByApiId as Mn, discoverRoutes as Mr, A2A_CONTAINER_PORT as Mt, serveFromStaticOrigin as N, buildCorsConfigFromCloudFrontChain as Nn, pickRefLogicalId as Nr, A2A_PATH as Nt, createLocalStartCloudFrontCommand as O, invokeRequestAuthorizer as On, discoverWebSocketApisOrThrow as Or, attachContainerLogStreamer as Ot, serveLambdaUrlOrigin as P, isFunctionUrlOacFronted as Pn, resolveLambdaArnIntrinsic as Pr, a2aInvokeOnce as Pt, serviceStrategy as Q, parseConnectionsPath as Qn, addInvokeSpecificOptions as Qt, pickTargetFunctionLogicalId as R, applyAuthorizerOverlay as Rn, AGENTCORE_MCP_PROTOCOL as Rr, mcpInvokeOnce as Rt, StudioEventBus as S, verifyCognitoJwt as Sn, resolveWatchConfig as Sr, buildCloudMapIndex as St, formatTargetListing as T, buildMethodArn as Tn, listTargets as Tr, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as Tt, addAlbSpecificOptions as U, selectIntegrationResponse as Un, derivePseudoParametersFromRegion as Ur, invokeAgentCore as Ut, runViewerRequest as V, evaluateResponseParameters as Vn, pickAgentCoreCandidateStack as Vr, signAgentCoreInvocation as Vt, albStrategy as W, tryParseStatus as Wn, formatStateRemedy as Wr, waitForAgentCorePing as Wt, addStartServiceSpecificOptions as X, buildMgmtEndpointEnvUrl as Xn, toCmdArgv as Xt, resolveAlbFrontDoor as Y, ConnectionRegistry as Yn, resolveProfileCredentials as Yr, renderCodeDockerfile as Yt, createLocalStartServiceCommand as Z, handleConnectionsRequest as Zn, classifySourceChange as Zt, filterStudioTargetGroups as _, resolveServiceIntegrationParameters as _n, resolveCfnRegion as _r, resolveImageOverrides as _t, createLocalStudioCommand as a, createFileWatcher as an, resolveRuntimeFileExtension as ar, buildEcsImageResolutionContext$1 as at, renderStudioHtml as b, buildJwksUrlFromIssuer as bn, collectSsmParameterRefs as br, isLocalCdkAssetImage as bt, startStudioProxy as c, materializeLayerFromArn as cn, substituteAgainstState as cr, parseRestartPolicy as ct, createStudioDispatcher as d, filterRoutesByApiIdentifier as dn, substituteEnvVarsFromStateAsync as dr, runEcsServiceEmulator as dt, addStartApiSpecificOptions as en, buildDisconnectEvent as er, createLocalRunTaskCommand as et, filterStudioCustomResources as f, filterRoutesByApiIdentifiers as fn, LocalStateSourceError as fr, ImageOverrideError as ft, annotatePinnedEcsTargets as g, resolveSelectionExpression as gn, resolveCfnFallbackRegion as gr, parseImageOverrideFlags as gt, annotateEcsTaskPinnedTargets as h, startApiServer as hn, rejectExplicitCfnStackWithMultipleStacks as hr, mergeForService as ht, coerceStopRequest as i, createAuthorizerCache as in, resolveRuntimeCodeMountPath as ir, addImageOverrideOptions as it, matchBehavior as j, applyCorsResponseHeaders as jn, webSocketApiMatchesIdentifier as jr, invokeAgentCoreWs as jt, parseOriginOverrides as k, invokeTokenAuthorizer as kn, filterWebSocketApisByIdentifiers as kr, addInvokeAgentCoreSpecificOptions as kt, relayServeRequest as l, resolveEnvVars$1 as ln, substituteAgainstStateAsync as lr, resolveEcsAssumeRoleOption as lt, annotateAlbPinnedBackingServices as m, readMtlsMaterialsFromDisk as mn, isCfnFlagPresent as mr, enforceImageOverrideOrphans as mt, coerceRunRequest as n, createWatchPredicates as nn, architectureToPlatform as nr, addCommonEcsServiceOptions as nt, resolveServeBaseUrl as o, attachStageContext as on, resolveRuntimeImage as or, ecsClusterOption as ot, isCustomResourceLambdaTarget as p, groupRoutesByServer as pn, createLocalStateProvider as pr, buildImageOverrideTag as pt, resolveAlbTarget as q, probeHostGatewaySupport as qn, LocalInvokeBuildError as qr, buildAgentCoreCodeImage as qt, coerceServeRequest as r, resolveApiTargetSubset as rn, buildContainerImage as rr, addEcsAssumeRoleOptions as rt, createStudioServeManager as s, buildStageMap as sn, EcsTaskResolutionError as sr, parseMaxTasks as st, addStudioSpecificOptions as t, createLocalStartApiCommand as tn, buildMessageEvent as tr, MAX_TASKS_SUBNET_RANGE_CAP as tt, reinvoke as u, availableApiIdentifiers as un, substituteEnvVarsFromState as ur, resolveSharedSidecarCredentials as ut, startStudioServer as v, defaultCredentialsLoader as vn, resolveCfnStackName as vr, runImageOverrideBuilds as vt, createLocalListCommand as w, verifyJwtViaDiscovery as wn, countTargets as wr, DEFAULT_SHADOW_READY_TIMEOUT_MS as wt, createStudioStore as x, createJwksCache as xn, resolveSsmParameters as xr, listPinnedTargets as xt, toStudioTargetGroups as y, buildCognitoJwksUrl as yn, CfnLocalStateProvider as yr, describePinnedImageUri as yt, resolveCloudFrontDistribution as z, buildHttpApiV2Event as zn, AGENTCORE_RUNTIME_TYPE as zr, parseSseForJsonRpc as zt };
|
|
34238
|
+
//# sourceMappingURL=local-studio-DGQ8RG82.js.map
|