@go-to-k/cdkd 0.202.0 → 0.203.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/README.md +12 -2
- package/dist/cli.js +8 -5
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -296,18 +296,25 @@ with the AWS-published ECS metadata sidecar.
|
|
|
296
296
|
```bash
|
|
297
297
|
cdkd local start-service MyStack/Orders MyStack/Web # multiple services in one invocation
|
|
298
298
|
cdkd local start-service MyStack/Orders --from-state # OR --from-cfn-stack
|
|
299
|
+
cdkd local start-service MyStack/Web --watch # hot reload (sub-second on interpreted handlers)
|
|
299
300
|
```
|
|
300
301
|
|
|
301
302
|
Long-running ECS Service emulator: `DesiredCount` replicas with
|
|
302
303
|
restart-on-exit, cross-service Service Connect / Cloud Map DNS
|
|
303
304
|
discovery (peer containers reach each other by `<discoveryName>.<namespace>`).
|
|
304
|
-
No local load-balancer in v1.
|
|
305
|
+
No local load-balancer in v1. `--watch` re-synths on every CDK source edit
|
|
306
|
+
and reloads one replica at a time — source-only edits on
|
|
307
|
+
interpreted-language handlers (Node / Python / Ruby / shell) take a
|
|
308
|
+
bind-mount fast path (`docker cp` + `docker restart`; no rebuild);
|
|
309
|
+
Dockerfile / dependency manifest / compiled-language source edits fall
|
|
310
|
+
through to a full rebuild + shadow boot + atomic swap.
|
|
305
311
|
|
|
306
312
|
### `local start-alb`
|
|
307
313
|
|
|
308
314
|
```bash
|
|
309
315
|
cdkd local start-alb MyStack/MyAlb --lb-port 80=8080 # remap privileged listener port
|
|
310
316
|
cdkd local start-alb MyStack/MyAlb --from-state # OR --from-cfn-stack
|
|
317
|
+
cdkd local start-alb MyStack/MyAlb --watch # hot reload (sub-second on interpreted handlers)
|
|
311
318
|
```
|
|
312
319
|
|
|
313
320
|
Long-running local ALB front-door: names an `AWS::ElasticLoadBalancingV2::LoadBalancer`,
|
|
@@ -316,7 +323,10 @@ HTTP / HTTPS front-door on each listener port that round-robins across
|
|
|
316
323
|
the running replicas and routes its listener rules across the backing
|
|
317
324
|
services. Forward / redirect / fixed-response actions; ECS or Lambda
|
|
318
325
|
targets; authenticate-cognito / authenticate-oidc via a local Bearer-JWT
|
|
319
|
-
check.
|
|
326
|
+
check. `--watch` reloads one backing-replica at a time across edits —
|
|
327
|
+
interpreted-handler source edits go through the bind-mount fast path
|
|
328
|
+
(no rebuild); Dockerfile / dependency / compiled-source edits fall
|
|
329
|
+
through to a rebuild + atomic front-door pool swap.
|
|
320
330
|
|
|
321
331
|
See **[docs/local-emulation.md](docs/local-emulation.md)** for the
|
|
322
332
|
full reference — runtimes, target resolution, every flag, integration
|
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 { 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, albStrategy, architectureToPlatform, attachAuthorizers, attachStageContext, availableApiIdentifiers, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildStageMap, createAuthorizerCache, createFileWatcher, createJwksCache, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, discoverRoutes, discoverWebSocketApis, downloadAndExtractS3Bundle, filterRoutesByApiIdentifier, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, materializeLayerFromArn, mcpInvokeOnce, parseConnectionsPath, parseSelectionExpressionPath, pickAgentCoreCandidateStack, 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, createAuthorizerCache, createFileWatcher, createJwksCache, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, discoverRoutes, discoverWebSocketApis, downloadAndExtractS3Bundle, filterRoutesByApiIdentifier, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, materializeLayerFromArn, mcpInvokeOnce, parseConnectionsPath, parseSelectionExpressionPath, pickAgentCoreCandidateStack, probeHostGatewaySupport, readMtlsMaterialsFromDisk, resolveAgentCoreTarget, resolveEnvVars, 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";
|
|
@@ -49165,7 +49165,8 @@ function serviceStrategy(_options) {
|
|
|
49165
49165
|
boots: chosenTargets.map((target) => ({ target })),
|
|
49166
49166
|
warnings: []
|
|
49167
49167
|
}),
|
|
49168
|
-
lbPortOverrides: {}
|
|
49168
|
+
lbPortOverrides: {},
|
|
49169
|
+
supportsWatch: true
|
|
49169
49170
|
};
|
|
49170
49171
|
}
|
|
49171
49172
|
/**
|
|
@@ -49180,9 +49181,11 @@ function serviceStrategy(_options) {
|
|
|
49180
49181
|
* --add-host overlay (Issue #460).
|
|
49181
49182
|
*/
|
|
49182
49183
|
function createLocalStartServiceCommand() {
|
|
49183
|
-
|
|
49184
|
+
const cmd = new Command("start-service").description("Run one or more AWS::ECS::Service resources locally as a long-running emulator. Spins up DesiredCount task replicas per service (clamped by --max-tasks) using the same per-task docker network + metadata sidecar pattern as `cdkd local run-task`, then keeps each replica running and restarts it on exit per --restart-policy. ^C tears every replica + sidecar + network down. Each <target> accepts a CDK display path (MyStack/MyService) or stack-qualified logical ID (MyStack:MyServiceXYZ); single-stack apps may omit the stack prefix. When two or more <target>s are supplied, every service is booted into a shared Cloud Map / Service Connect registry so peer services discover each other via docker --add-host overlay (Issue #460). Omit <targets> in an interactive terminal to multi-select the ECS services from a list.").argument("[targets...]", "One or more CDK display paths or stack-qualified logical IDs of the AWS::ECS::Service resources to run (omit to multi-select interactively in a TTY)").addOption(new Option("--from-state", "Read cdkd's S3 state for the target stack and substitute Ref / Fn::GetAtt / Fn::Sub / Fn::ImportValue / Fn::GetStackOutput intrinsics in container images, environment variables, secrets, role ARNs, and volumes. Mutually exclusive with --from-cfn-stack.").default(false)).addOption(new Option("--state-bucket <bucket>", "S3 bucket for --from-state. Falls back to CDKD_STATE_BUCKET env or cdk.json context.cdkd.stateBucket.")).addOption(new Option("--state-prefix <prefix>", "S3 key prefix for --from-state state files.").default("cdkd")).action(withErrorHandling(async (targets, options) => {
|
|
49184
49185
|
await runEcsServiceEmulator(targets, options, serviceStrategy(options), cdkdExtraStateProviders);
|
|
49185
|
-
}))
|
|
49186
|
+
}));
|
|
49187
|
+
addStartServiceSpecificOptions(cmd);
|
|
49188
|
+
return addCommonEcsServiceOptions(cmd);
|
|
49186
49189
|
}
|
|
49187
49190
|
|
|
49188
49191
|
//#endregion
|
|
@@ -51924,7 +51927,7 @@ function reorderArgs(argv) {
|
|
|
51924
51927
|
*/
|
|
51925
51928
|
async function main() {
|
|
51926
51929
|
const program = new Command();
|
|
51927
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
51930
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.203.0");
|
|
51928
51931
|
program.addCommand(createBootstrapCommand());
|
|
51929
51932
|
program.addCommand(createSynthCommand());
|
|
51930
51933
|
program.addCommand(createListCommand());
|