@go-to-k/cdkd 0.212.0 → 0.214.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 +21 -3
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -62,7 +62,7 @@ import { CreateNamespaceCommand, CreateTableBucketCommand, CreateTableCommand as
|
|
|
62
62
|
import { AttachLoadBalancerTargetGroupsCommand, AttachLoadBalancersCommand, AttachTrafficSourcesCommand, AutoScalingClient, CreateAutoScalingGroupCommand, CreateOrUpdateTagsCommand, DeleteAutoScalingGroupCommand, DeleteLifecycleHookCommand, DeleteNotificationConfigurationCommand, DeleteTagsCommand as DeleteTagsCommand$1, DescribeAutoScalingGroupsCommand, DescribeLifecycleHooksCommand, DescribeNotificationConfigurationsCommand, DescribeTrafficSourcesCommand, DetachLoadBalancerTargetGroupsCommand, DetachLoadBalancersCommand, DetachTrafficSourcesCommand, DisableMetricsCollectionCommand, EnableMetricsCollectionCommand, PutLifecycleHookCommand, PutNotificationConfigurationCommand, UpdateAutoScalingGroupCommand } from "@aws-sdk/client-auto-scaling";
|
|
63
63
|
import { Document, Pair, Scalar, YAMLMap, YAMLSeq, parse as parse$1, stringify } from "yaml";
|
|
64
64
|
import { createLocalStartAgentCoreCommand, createLocalStartCloudFrontCommand, createLocalStateProvider, getEmbedConfig, isCfnFlagPresent, listTargets, rejectExplicitCfnStackWithMultipleStacks, resolveCfnFallbackRegion, setEmbedConfig, substituteAgainstState, substituteAgainstStateAsync, substituteEnvVarsFromState, substituteEnvVarsFromStateAsync } from "cdk-local";
|
|
65
|
-
import { A2A_CONTAINER_PORT, A2A_PATH, AGENTCORE_A2A_PROTOCOL, AGENTCORE_AGUI_PROTOCOL, AGENTCORE_MCP_PROTOCOL, ConnectionRegistry, EcsTaskResolutionError, HOST_GATEWAY_MIN_VERSION, LocalInvokeBuildError, MCP_CONTAINER_PORT, MCP_PATH, a2aInvokeOnce, addAlbSpecificOptions, addCommonEcsServiceOptions, addStartServiceSpecificOptions, albStrategy, architectureToPlatform, attachAuthorizers, attachStageContext, availableApiIdentifiers, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildStageMap, classifySourceChange, createAuthorizerCache, createFileWatcher, createFileWatcher as createFileWatcher$1, createJwksCache, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, discoverRoutes, discoverWebSocketApis, downloadAndExtractS3Bundle, filterRoutesByApiIdentifier, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, materializeLayerFromArn, mcpInvokeOnce, parseConnectionsPath, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, probeHostGatewaySupport, readMtlsMaterialsFromDisk, resolveAgentCoreTarget, resolveEnvVars, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSingleTarget, resolveWatchConfig, runEcsServiceEmulator, signAgentCoreInvocation, startApiServer, substituteImagePlaceholders, tryResolveImageFnJoin, verifyJwtViaDiscovery, waitForAgentCorePing } from "cdk-local/internal";
|
|
65
|
+
import { A2A_CONTAINER_PORT, A2A_PATH, AGENTCORE_A2A_PROTOCOL, AGENTCORE_AGUI_PROTOCOL, AGENTCORE_MCP_PROTOCOL, ConnectionRegistry, EcsTaskResolutionError, HOST_GATEWAY_MIN_VERSION, LocalInvokeBuildError, MCP_CONTAINER_PORT, MCP_PATH, a2aInvokeOnce, addAlbSpecificOptions, addCommonEcsServiceOptions, addStartServiceSpecificOptions, albStrategy, architectureToPlatform, attachAuthorizers, attachStageContext, availableApiIdentifiers, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildStageMap, classifySourceChange, createAuthorizerCache, createFileWatcher, createFileWatcher as createFileWatcher$1, createJwksCache, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, discoverRoutes, discoverWebSocketApis, downloadAndExtractS3Bundle, filterRoutesByApiIdentifier, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, materializeLayerFromArn, mcpInvokeOnce, parseConnectionsPath, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, probeHostGatewaySupport, readMtlsMaterialsFromDisk, resolveAgentCoreTarget, resolveEnvVars, resolveHostGatewayExtraHosts, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSingleTarget, resolveWatchConfig, runEcsServiceEmulator, signAgentCoreInvocation, startApiServer, substituteImagePlaceholders, tryResolveImageFnJoin, verifyJwtViaDiscovery, waitForAgentCorePing } from "cdk-local/internal";
|
|
66
66
|
import { createServer } from "node:net";
|
|
67
67
|
import { promisify } from "node:util";
|
|
68
68
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
@@ -48672,6 +48672,19 @@ async function cleanupEcsRun(state, options) {
|
|
|
48672
48672
|
state.dockerVolumeNames = [];
|
|
48673
48673
|
}
|
|
48674
48674
|
/**
|
|
48675
|
+
* Merge the Cloud Map peer-discovery `--add-host` flag pairs
|
|
48676
|
+
* ({@link RunEcsTaskOptions.addHostFlags}) with the boot-resolved
|
|
48677
|
+
* `host.docker.internal` host-gateway mapping(s)
|
|
48678
|
+
* ({@link RunEcsTaskOptions.hostGatewayExtraHosts}) into one verbatim
|
|
48679
|
+
* `['--add-host', 'name:ip', ...]` list for `docker run`. The host-gateway
|
|
48680
|
+
* entry uses a distinct name, so its position relative to the peer entries is
|
|
48681
|
+
* irrelevant (docker's resolver matches by name). Pure — exported for the
|
|
48682
|
+
* site-level merge test. Mirrors cdk-local #483.
|
|
48683
|
+
*/
|
|
48684
|
+
function mergeHostGatewayAddHostFlags(addHostFlags, hostGatewayExtraHosts) {
|
|
48685
|
+
return [...addHostFlags ?? [], ...(hostGatewayExtraHosts ?? []).flatMap((h) => ["--add-host", `${h.host}:${h.ip}`])];
|
|
48686
|
+
}
|
|
48687
|
+
/**
|
|
48675
48688
|
* Top-level entry point. Mutates `state` as it makes progress so the
|
|
48676
48689
|
* caller's `cleanup(state)` can roll back partial side effects on any
|
|
48677
48690
|
* thrown error.
|
|
@@ -48705,6 +48718,7 @@ async function runEcsTask(task, options, state) {
|
|
|
48705
48718
|
state.network = await createTaskNetwork(netCreateOpts);
|
|
48706
48719
|
}
|
|
48707
48720
|
const volumeByName = await realizeDockerVolumes(task.volumes, state);
|
|
48721
|
+
const mergedAddHostFlags = mergeHostGatewayAddHostFlags(options.addHostFlags, options.hostGatewayExtraHosts);
|
|
48708
48722
|
const dockerCmds = /* @__PURE__ */ new Map();
|
|
48709
48723
|
for (const container of task.containers) {
|
|
48710
48724
|
const image = imagePlan.get(container.name);
|
|
@@ -48723,7 +48737,7 @@ async function runEcsTask(task, options, state) {
|
|
|
48723
48737
|
region: options.region,
|
|
48724
48738
|
sidecarIp: state.network.sidecarIp,
|
|
48725
48739
|
...options.skipHostPortPublish ? { skipHostPortPublish: true } : {},
|
|
48726
|
-
...
|
|
48740
|
+
...mergedAddHostFlags.length > 0 ? { addHostFlags: mergedAddHostFlags } : {},
|
|
48727
48741
|
...(options.networkAliasesByContainer?.get(container.name)?.length ?? 0) > 0 ? { networkAliases: options.networkAliasesByContainer.get(container.name) } : {},
|
|
48728
48742
|
...options.profileCredentialsFile && { profileCredentialsFile: options.profileCredentialsFile }
|
|
48729
48743
|
}));
|
|
@@ -49247,6 +49261,8 @@ async function localRunTaskCommand(target, options) {
|
|
|
49247
49261
|
containerPath: profileCredsFile.containerPath,
|
|
49248
49262
|
profileName: profileCredsFile.profileName
|
|
49249
49263
|
};
|
|
49264
|
+
const hostGatewayExtraHosts = await resolveHostGatewayExtraHosts();
|
|
49265
|
+
if (hostGatewayExtraHosts.length > 0) runOpts.hostGatewayExtraHosts = hostGatewayExtraHosts;
|
|
49250
49266
|
const result = await runEcsTask(task, runOpts, state);
|
|
49251
49267
|
if (options.detach) {
|
|
49252
49268
|
logger.info("Task containers started in detached mode; cdkd is exiting.");
|
|
@@ -51173,11 +51189,13 @@ async function localInvokeCommand(target, options) {
|
|
|
51173
51189
|
containerPath: profileCredsFile.containerPath,
|
|
51174
51190
|
readOnly: true
|
|
51175
51191
|
}] : imagePlan.extraMounts;
|
|
51192
|
+
const hostGatewayExtraHosts = await resolveHostGatewayExtraHosts();
|
|
51176
51193
|
containerId = await runDetached({
|
|
51177
51194
|
image: imagePlan.image,
|
|
51178
51195
|
mounts: imagePlan.mounts,
|
|
51179
51196
|
extraMounts: extraMountsWithProfile,
|
|
51180
51197
|
env: dockerEnv,
|
|
51198
|
+
...hostGatewayExtraHosts.length > 0 && { extraHosts: hostGatewayExtraHosts },
|
|
51181
51199
|
cmd: imagePlan.cmd,
|
|
51182
51200
|
hostPort,
|
|
51183
51201
|
host: containerHost,
|
|
@@ -52887,7 +52905,7 @@ function reorderArgs(argv) {
|
|
|
52887
52905
|
async function main() {
|
|
52888
52906
|
installPipeCloseHandler();
|
|
52889
52907
|
const program = new Command();
|
|
52890
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
52908
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.214.0");
|
|
52891
52909
|
program.addCommand(createBootstrapCommand());
|
|
52892
52910
|
program.addCommand(createSynthCommand());
|
|
52893
52911
|
program.addCommand(createListCommand());
|