@go-to-k/cdkd 0.4.1 → 0.5.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/README.md +11 -0
- package/dist/cli.js +264 -121
- package/dist/cli.js.map +4 -4
- package/dist/go-to-k-cdkd-0.5.1.tgz +0 -0
- package/dist/index.js +53 -27
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/dist/go-to-k-cdkd-0.4.1.tgz +0 -0
package/README.md
CHANGED
|
@@ -342,6 +342,9 @@ alias cdkd="node $(pwd)/dist/cli.js"
|
|
|
342
342
|
# Bootstrap (creates S3 state bucket - only needed once per account/region)
|
|
343
343
|
cdkd bootstrap
|
|
344
344
|
|
|
345
|
+
# List stacks in the CDK app
|
|
346
|
+
cdkd list
|
|
347
|
+
|
|
345
348
|
# Deploy your CDK app
|
|
346
349
|
cdkd deploy
|
|
347
350
|
|
|
@@ -367,6 +370,14 @@ cdkd bootstrap \
|
|
|
367
370
|
# Synthesize only
|
|
368
371
|
cdkd synth --app "npx ts-node app.ts"
|
|
369
372
|
|
|
373
|
+
# List all stacks in the CDK app (alias: ls)
|
|
374
|
+
cdkd list
|
|
375
|
+
cdkd ls
|
|
376
|
+
cdkd list --long # YAML records with id/name/environment
|
|
377
|
+
cdkd list --long --json # same, but JSON
|
|
378
|
+
cdkd list --show-dependencies # id + dependency list per stack
|
|
379
|
+
cdkd list 'MyStage/*' # filter by display path (CDK CLI parity)
|
|
380
|
+
|
|
370
381
|
# Deploy from a pre-synthesized cloud assembly directory
|
|
371
382
|
cdkd deploy --app cdk.out
|
|
372
383
|
|
package/dist/cli.js
CHANGED
|
@@ -447,7 +447,7 @@ var init_aws_clients = __esm({
|
|
|
447
447
|
});
|
|
448
448
|
|
|
449
449
|
// src/cli/index.ts
|
|
450
|
-
import { Command as
|
|
450
|
+
import { Command as Command9 } from "commander";
|
|
451
451
|
|
|
452
452
|
// src/cli/commands/bootstrap.ts
|
|
453
453
|
import { Command } from "commander";
|
|
@@ -2357,6 +2357,62 @@ function setsEqual(a, b) {
|
|
|
2357
2357
|
return true;
|
|
2358
2358
|
}
|
|
2359
2359
|
|
|
2360
|
+
// src/utils/yaml.ts
|
|
2361
|
+
function toYaml(obj, indent = 0) {
|
|
2362
|
+
const prefix = " ".repeat(indent);
|
|
2363
|
+
if (obj === null || obj === void 0)
|
|
2364
|
+
return "null\n";
|
|
2365
|
+
if (typeof obj === "boolean")
|
|
2366
|
+
return `${obj}
|
|
2367
|
+
`;
|
|
2368
|
+
if (typeof obj === "number")
|
|
2369
|
+
return `"${obj}"
|
|
2370
|
+
`;
|
|
2371
|
+
if (typeof obj === "string") {
|
|
2372
|
+
if (obj.includes("\n")) {
|
|
2373
|
+
return `'${obj.replace(/'/g, "''")}'
|
|
2374
|
+
`;
|
|
2375
|
+
}
|
|
2376
|
+
if (obj.startsWith("{") || obj.startsWith("[") || obj.startsWith('"')) {
|
|
2377
|
+
return `'${obj.replace(/'/g, "''")}'
|
|
2378
|
+
`;
|
|
2379
|
+
}
|
|
2380
|
+
if (obj.includes("#") || obj === "" || obj === "true" || obj === "false" || obj === "null") {
|
|
2381
|
+
return `"${obj}"
|
|
2382
|
+
`;
|
|
2383
|
+
}
|
|
2384
|
+
return `${obj}
|
|
2385
|
+
`;
|
|
2386
|
+
}
|
|
2387
|
+
if (Array.isArray(obj)) {
|
|
2388
|
+
if (obj.length === 0)
|
|
2389
|
+
return "[]\n";
|
|
2390
|
+
let result = "\n";
|
|
2391
|
+
for (const item of obj) {
|
|
2392
|
+
const value = toYaml(item, indent + 1).trimStart();
|
|
2393
|
+
result += `${prefix}- ${value}`;
|
|
2394
|
+
}
|
|
2395
|
+
return result;
|
|
2396
|
+
}
|
|
2397
|
+
if (typeof obj === "object") {
|
|
2398
|
+
const entries = Object.entries(obj);
|
|
2399
|
+
if (entries.length === 0)
|
|
2400
|
+
return "{}\n";
|
|
2401
|
+
let result = "\n";
|
|
2402
|
+
for (const [key, value] of entries) {
|
|
2403
|
+
const safeKey = key.includes(" ") ? `"${key}"` : key;
|
|
2404
|
+
if (typeof value === "object" && value !== null) {
|
|
2405
|
+
result += `${prefix}${safeKey}:${toYaml(value, indent + 1)}`;
|
|
2406
|
+
} else {
|
|
2407
|
+
result += `${prefix}${safeKey}: ${toYaml(value, indent + 1).trimStart()}`;
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
return result;
|
|
2411
|
+
}
|
|
2412
|
+
return `${String(obj)}
|
|
2413
|
+
`;
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2360
2416
|
// src/cli/commands/synth.ts
|
|
2361
2417
|
async function synthCommand(options) {
|
|
2362
2418
|
const logger = getLogger();
|
|
@@ -2407,68 +2463,158 @@ async function synthCommand(options) {
|
|
|
2407
2463
|
logger.info(`
|
|
2408
2464
|
Output: ${assemblyDir}`);
|
|
2409
2465
|
}
|
|
2410
|
-
function
|
|
2411
|
-
const
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
return `"${obj}"
|
|
2431
|
-
`;
|
|
2466
|
+
function createSynthCommand() {
|
|
2467
|
+
const cmd = new Command2("synth").description("Synthesize CDK app to CloudFormation template").action(withErrorHandling(synthCommand));
|
|
2468
|
+
[...commonOptions, ...appOptions, ...contextOptions].forEach((opt) => cmd.addOption(opt));
|
|
2469
|
+
return cmd;
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
// src/cli/commands/list.ts
|
|
2473
|
+
import { Command as Command3 } from "commander";
|
|
2474
|
+
|
|
2475
|
+
// src/cli/stack-matcher.ts
|
|
2476
|
+
function matchStacks(stacks, patterns) {
|
|
2477
|
+
if (patterns.length === 0)
|
|
2478
|
+
return [];
|
|
2479
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2480
|
+
const result = [];
|
|
2481
|
+
for (const stack of stacks) {
|
|
2482
|
+
const matched = patterns.some((pattern) => stackMatchesPattern(stack, pattern));
|
|
2483
|
+
if (matched && !seen.has(stack.stackName)) {
|
|
2484
|
+
seen.add(stack.stackName);
|
|
2485
|
+
result.push(stack);
|
|
2432
2486
|
}
|
|
2433
|
-
return `${obj}
|
|
2434
|
-
`;
|
|
2435
2487
|
}
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2488
|
+
return result;
|
|
2489
|
+
}
|
|
2490
|
+
function describeStack(stack) {
|
|
2491
|
+
if (stack.displayName && stack.displayName !== stack.stackName) {
|
|
2492
|
+
return `${stack.stackName} (${stack.displayName})`;
|
|
2493
|
+
}
|
|
2494
|
+
return stack.stackName;
|
|
2495
|
+
}
|
|
2496
|
+
function stackMatchesPattern(stack, pattern) {
|
|
2497
|
+
const target = pattern.includes("/") ? stack.displayName ?? stack.stackName : stack.stackName;
|
|
2498
|
+
if (pattern.includes("*")) {
|
|
2499
|
+
const regex = new RegExp("^" + pattern.replace(/\*/g, ".*") + "$");
|
|
2500
|
+
return regex.test(target);
|
|
2501
|
+
}
|
|
2502
|
+
return target === pattern;
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
// src/cli/commands/list.ts
|
|
2506
|
+
function sortByDependency(stacks) {
|
|
2507
|
+
const byName = new Map(stacks.map((s) => [s.stackName, s]));
|
|
2508
|
+
const visited = /* @__PURE__ */ new Set();
|
|
2509
|
+
const result = [];
|
|
2510
|
+
const visit = (stack, ancestors) => {
|
|
2511
|
+
if (visited.has(stack.stackName))
|
|
2512
|
+
return;
|
|
2513
|
+
if (ancestors.has(stack.stackName))
|
|
2514
|
+
return;
|
|
2515
|
+
ancestors.add(stack.stackName);
|
|
2516
|
+
for (const depName of stack.dependencyNames) {
|
|
2517
|
+
const dep = byName.get(depName);
|
|
2518
|
+
if (dep)
|
|
2519
|
+
visit(dep, ancestors);
|
|
2520
|
+
}
|
|
2521
|
+
ancestors.delete(stack.stackName);
|
|
2522
|
+
if (!visited.has(stack.stackName)) {
|
|
2523
|
+
visited.add(stack.stackName);
|
|
2524
|
+
result.push(stack);
|
|
2443
2525
|
}
|
|
2444
|
-
|
|
2526
|
+
};
|
|
2527
|
+
for (const stack of stacks) {
|
|
2528
|
+
visit(stack, /* @__PURE__ */ new Set());
|
|
2445
2529
|
}
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
} else {
|
|
2456
|
-
result += `${prefix}${safeKey}: ${toYaml(value, indent + 1).trimStart()}`;
|
|
2457
|
-
}
|
|
2530
|
+
return result;
|
|
2531
|
+
}
|
|
2532
|
+
function toLongRecord(stack, includeDeps) {
|
|
2533
|
+
const record = {
|
|
2534
|
+
id: stack.displayName,
|
|
2535
|
+
name: stack.stackName,
|
|
2536
|
+
environment: {
|
|
2537
|
+
account: stack.account ?? "unknown-account",
|
|
2538
|
+
region: stack.region ?? "unknown-region"
|
|
2458
2539
|
}
|
|
2459
|
-
|
|
2540
|
+
};
|
|
2541
|
+
if (includeDeps) {
|
|
2542
|
+
record.dependencies = [...stack.dependencyNames];
|
|
2460
2543
|
}
|
|
2461
|
-
return
|
|
2462
|
-
`;
|
|
2544
|
+
return record;
|
|
2463
2545
|
}
|
|
2464
|
-
function
|
|
2465
|
-
const
|
|
2546
|
+
async function listCommand(patterns, options) {
|
|
2547
|
+
const logger = getLogger();
|
|
2548
|
+
if (options.verbose) {
|
|
2549
|
+
logger.setLevel("debug");
|
|
2550
|
+
}
|
|
2551
|
+
const app = resolveApp(options.app);
|
|
2552
|
+
if (!app) {
|
|
2553
|
+
throw new Error(
|
|
2554
|
+
'No app command specified. Use --app, set CDKD_APP env var, or add "app" to cdk.json'
|
|
2555
|
+
);
|
|
2556
|
+
}
|
|
2557
|
+
logger.debug("Listing stacks...");
|
|
2558
|
+
logger.debug("App command:", app);
|
|
2559
|
+
const synthesizer = new Synthesizer();
|
|
2560
|
+
const context = parseContextOptions(options.context);
|
|
2561
|
+
const synthOptions = {
|
|
2562
|
+
app,
|
|
2563
|
+
output: options.output,
|
|
2564
|
+
...options.region && { region: options.region },
|
|
2565
|
+
...options.profile && { profile: options.profile },
|
|
2566
|
+
...Object.keys(context).length > 0 && { context }
|
|
2567
|
+
};
|
|
2568
|
+
const result = await synthesizer.synthesize(synthOptions);
|
|
2569
|
+
const allStacks = result.stacks;
|
|
2570
|
+
if (allStacks.length === 0) {
|
|
2571
|
+
throw new Error("No stacks found in assembly");
|
|
2572
|
+
}
|
|
2573
|
+
const selected = patterns.length > 0 ? matchStacks(allStacks, patterns) : allStacks;
|
|
2574
|
+
if (selected.length === 0) {
|
|
2575
|
+
throw new Error(
|
|
2576
|
+
`No stacks matching ${patterns.join(", ")} found in assembly. Available: ${allStacks.map(describeStack).join(", ")}`
|
|
2577
|
+
);
|
|
2578
|
+
}
|
|
2579
|
+
const sorted = sortByDependency(selected);
|
|
2580
|
+
if (options.long) {
|
|
2581
|
+
const records = sorted.map((s) => toLongRecord(s, options.showDependencies));
|
|
2582
|
+
emitStructured(records, options.json);
|
|
2583
|
+
return;
|
|
2584
|
+
}
|
|
2585
|
+
if (options.showDependencies) {
|
|
2586
|
+
const records = sorted.map((s) => ({
|
|
2587
|
+
id: s.displayName,
|
|
2588
|
+
dependencies: [...s.dependencyNames]
|
|
2589
|
+
}));
|
|
2590
|
+
emitStructured(records, options.json);
|
|
2591
|
+
return;
|
|
2592
|
+
}
|
|
2593
|
+
for (const stack of sorted) {
|
|
2594
|
+
process.stdout.write(`${stack.displayName}
|
|
2595
|
+
`);
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
function emitStructured(payload, asJson) {
|
|
2599
|
+
if (asJson) {
|
|
2600
|
+
process.stdout.write(`${JSON.stringify(payload, null, 2)}
|
|
2601
|
+
`);
|
|
2602
|
+
return;
|
|
2603
|
+
}
|
|
2604
|
+
const yaml = toYaml(payload).replace(/^\n/, "");
|
|
2605
|
+
process.stdout.write(yaml);
|
|
2606
|
+
}
|
|
2607
|
+
function createListCommand() {
|
|
2608
|
+
const cmd = new Command3("list").alias("ls").description("List all stacks in the CDK app").argument(
|
|
2609
|
+
"[stacks...]",
|
|
2610
|
+
"Stack name pattern(s). Accepts physical CloudFormation names (e.g. 'MyStage-Api') or CDK display paths (e.g. 'MyStage/Api'). Supports wildcards (e.g. 'MyStage/*')."
|
|
2611
|
+
).option("-l, --long", "Display environment information for each stack", false).option("-d, --show-dependencies", "Display stack dependency information for each stack", false).option("--json", "Output as JSON instead of YAML for --long / --show-dependencies", false).action(withErrorHandling(listCommand));
|
|
2466
2612
|
[...commonOptions, ...appOptions, ...contextOptions].forEach((opt) => cmd.addOption(opt));
|
|
2467
2613
|
return cmd;
|
|
2468
2614
|
}
|
|
2469
2615
|
|
|
2470
2616
|
// src/cli/commands/deploy.ts
|
|
2471
|
-
import { Command as
|
|
2617
|
+
import { Command as Command4 } from "commander";
|
|
2472
2618
|
|
|
2473
2619
|
// src/assets/asset-publisher.ts
|
|
2474
2620
|
import { readFileSync as readFileSync4 } from "node:fs";
|
|
@@ -26015,7 +26161,12 @@ var RETRYABLE_ERROR_MESSAGE_PATTERNS = [
|
|
|
26015
26161
|
// or SubscriptionFilter role propagation. CW Logs probes the destination
|
|
26016
26162
|
// by delivering a test message; if the stream is freshly ACTIVE or the
|
|
26017
26163
|
// assumed role hasn't propagated, the probe fails with "Invalid request".
|
|
26018
|
-
"Could not deliver test message"
|
|
26164
|
+
"Could not deliver test message",
|
|
26165
|
+
// SQS: same-name queue can't be re-created until 60s after a delete.
|
|
26166
|
+
// Hits when a stack is destroyed and re-deployed in quick succession
|
|
26167
|
+
// (a common dev / iteration loop). Retry recovers within ~60s instead
|
|
26168
|
+
// of failing the whole deploy.
|
|
26169
|
+
"wait 60 seconds"
|
|
26019
26170
|
];
|
|
26020
26171
|
var RETRYABLE_HTTP_STATUS_CODES = /* @__PURE__ */ new Set([429, 503]);
|
|
26021
26172
|
function isRetryableTransientError(error, message) {
|
|
@@ -26030,6 +26181,39 @@ function isRetryableTransientError(error, message) {
|
|
|
26030
26181
|
return RETRYABLE_ERROR_MESSAGE_PATTERNS.some((p) => message.includes(p));
|
|
26031
26182
|
}
|
|
26032
26183
|
|
|
26184
|
+
// src/deployment/retry.ts
|
|
26185
|
+
var defaultSleep = (ms) => new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
26186
|
+
async function withRetry(operation, logicalId, opts = {}) {
|
|
26187
|
+
const maxRetries = opts.maxRetries ?? 8;
|
|
26188
|
+
const initialDelayMs = opts.initialDelayMs ?? 1e3;
|
|
26189
|
+
const maxDelayMs = opts.maxDelayMs ?? 8e3;
|
|
26190
|
+
const sleep = opts.sleep ?? defaultSleep;
|
|
26191
|
+
let lastError;
|
|
26192
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
26193
|
+
try {
|
|
26194
|
+
return await operation();
|
|
26195
|
+
} catch (error) {
|
|
26196
|
+
lastError = error;
|
|
26197
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
26198
|
+
const retryable = isRetryableTransientError(error, message);
|
|
26199
|
+
if (!retryable || attempt >= maxRetries) {
|
|
26200
|
+
throw error;
|
|
26201
|
+
}
|
|
26202
|
+
const delay = Math.min(initialDelayMs * Math.pow(2, attempt), maxDelayMs);
|
|
26203
|
+
opts.logger?.debug(
|
|
26204
|
+
` \u23F3 Retrying ${logicalId} in ${delay / 1e3}s (attempt ${attempt + 1}/${maxRetries}) - ${message}`
|
|
26205
|
+
);
|
|
26206
|
+
for (let waited = 0; waited < delay; waited += 1e3) {
|
|
26207
|
+
if (opts.isInterrupted?.()) {
|
|
26208
|
+
throw opts.onInterrupted ? opts.onInterrupted() : new Error("Interrupted");
|
|
26209
|
+
}
|
|
26210
|
+
await sleep(Math.min(1e3, delay - waited));
|
|
26211
|
+
}
|
|
26212
|
+
}
|
|
26213
|
+
}
|
|
26214
|
+
throw lastError;
|
|
26215
|
+
}
|
|
26216
|
+
|
|
26033
26217
|
// src/deployment/deploy-engine.ts
|
|
26034
26218
|
var InterruptedError = class extends Error {
|
|
26035
26219
|
constructor() {
|
|
@@ -27016,32 +27200,20 @@ var DeployEngine = class {
|
|
|
27016
27200
|
);
|
|
27017
27201
|
}
|
|
27018
27202
|
/**
|
|
27019
|
-
* Execute an operation with retry for transient IAM propagation errors
|
|
27020
|
-
|
|
27021
|
-
|
|
27022
|
-
|
|
27023
|
-
|
|
27024
|
-
|
|
27025
|
-
|
|
27026
|
-
|
|
27027
|
-
|
|
27028
|
-
|
|
27029
|
-
|
|
27030
|
-
|
|
27031
|
-
|
|
27032
|
-
|
|
27033
|
-
const delay = initialDelayMs * Math.pow(2, attempt);
|
|
27034
|
-
this.logger.debug(
|
|
27035
|
-
` \u23F3 Retrying ${logicalId} in ${delay / 1e3}s (attempt ${attempt + 1}/${maxRetries}) - ${message}`
|
|
27036
|
-
);
|
|
27037
|
-
for (let waited = 0; waited < delay; waited += 1e3) {
|
|
27038
|
-
if (this.interrupted)
|
|
27039
|
-
throw new InterruptedError();
|
|
27040
|
-
await new Promise((resolve4) => setTimeout(resolve4, Math.min(1e3, delay - waited)));
|
|
27041
|
-
}
|
|
27042
|
-
}
|
|
27043
|
-
}
|
|
27044
|
-
throw lastError;
|
|
27203
|
+
* Execute an operation with retry for transient IAM propagation errors.
|
|
27204
|
+
*
|
|
27205
|
+
* Thin wrapper over `withRetry` from ./retry.js that injects this engine's
|
|
27206
|
+
* SIGINT-aware interrupt check and logger. The actual backoff schedule
|
|
27207
|
+
* lives there.
|
|
27208
|
+
*/
|
|
27209
|
+
async withRetry(operation, logicalId, maxRetries, initialDelayMs) {
|
|
27210
|
+
return withRetry(operation, logicalId, {
|
|
27211
|
+
...maxRetries !== void 0 && { maxRetries },
|
|
27212
|
+
...initialDelayMs !== void 0 && { initialDelayMs },
|
|
27213
|
+
logger: this.logger,
|
|
27214
|
+
isInterrupted: () => this.interrupted,
|
|
27215
|
+
onInterrupted: () => new InterruptedError()
|
|
27216
|
+
});
|
|
27045
27217
|
}
|
|
27046
27218
|
/**
|
|
27047
27219
|
* Resolve stack outputs from template and resource attributes
|
|
@@ -27082,38 +27254,6 @@ var DeployEngine = class {
|
|
|
27082
27254
|
|
|
27083
27255
|
// src/cli/commands/deploy.ts
|
|
27084
27256
|
init_aws_clients();
|
|
27085
|
-
|
|
27086
|
-
// src/cli/stack-matcher.ts
|
|
27087
|
-
function matchStacks(stacks, patterns) {
|
|
27088
|
-
if (patterns.length === 0)
|
|
27089
|
-
return [];
|
|
27090
|
-
const seen = /* @__PURE__ */ new Set();
|
|
27091
|
-
const result = [];
|
|
27092
|
-
for (const stack of stacks) {
|
|
27093
|
-
const matched = patterns.some((pattern) => stackMatchesPattern(stack, pattern));
|
|
27094
|
-
if (matched && !seen.has(stack.stackName)) {
|
|
27095
|
-
seen.add(stack.stackName);
|
|
27096
|
-
result.push(stack);
|
|
27097
|
-
}
|
|
27098
|
-
}
|
|
27099
|
-
return result;
|
|
27100
|
-
}
|
|
27101
|
-
function describeStack(stack) {
|
|
27102
|
-
if (stack.displayName && stack.displayName !== stack.stackName) {
|
|
27103
|
-
return `${stack.stackName} (${stack.displayName})`;
|
|
27104
|
-
}
|
|
27105
|
-
return stack.stackName;
|
|
27106
|
-
}
|
|
27107
|
-
function stackMatchesPattern(stack, pattern) {
|
|
27108
|
-
const target = pattern.includes("/") ? stack.displayName ?? stack.stackName : stack.stackName;
|
|
27109
|
-
if (pattern.includes("*")) {
|
|
27110
|
-
const regex = new RegExp("^" + pattern.replace(/\*/g, ".*") + "$");
|
|
27111
|
-
return regex.test(target);
|
|
27112
|
-
}
|
|
27113
|
-
return target === pattern;
|
|
27114
|
-
}
|
|
27115
|
-
|
|
27116
|
-
// src/cli/commands/deploy.ts
|
|
27117
27257
|
async function deployCommand(stacks, options) {
|
|
27118
27258
|
const logger = getLogger();
|
|
27119
27259
|
if (options.verbose) {
|
|
@@ -27347,7 +27487,7 @@ Deploying stack: ${stackInfo.stackName}${stackRegion !== baseRegion ? ` (region:
|
|
|
27347
27487
|
}
|
|
27348
27488
|
}
|
|
27349
27489
|
function createDeployCommand() {
|
|
27350
|
-
const cmd = new
|
|
27490
|
+
const cmd = new Command4("deploy").description("Deploy CDK app using SDK/Cloud Control API").argument(
|
|
27351
27491
|
"[stacks...]",
|
|
27352
27492
|
"Stack name(s) to deploy. Accepts physical CloudFormation names (e.g. 'MyStage-Api') or CDK display paths (e.g. 'MyStage/Api'). Supports wildcards (e.g. 'MyStage/*')."
|
|
27353
27493
|
).option("--all", "Deploy all stacks", false).action(withErrorHandling(deployCommand));
|
|
@@ -27363,7 +27503,7 @@ function createDeployCommand() {
|
|
|
27363
27503
|
}
|
|
27364
27504
|
|
|
27365
27505
|
// src/cli/commands/diff.ts
|
|
27366
|
-
import { Command as
|
|
27506
|
+
import { Command as Command5 } from "commander";
|
|
27367
27507
|
init_aws_clients();
|
|
27368
27508
|
var INTRINSIC_KEYS = /* @__PURE__ */ new Set([
|
|
27369
27509
|
"Ref",
|
|
@@ -27561,7 +27701,7 @@ ${createCount} to create, ${updateCount} to update, ${deleteCount} to delete`);
|
|
|
27561
27701
|
}
|
|
27562
27702
|
}
|
|
27563
27703
|
function createDiffCommand() {
|
|
27564
|
-
const cmd = new
|
|
27704
|
+
const cmd = new Command5("diff").description("Show difference between current state and desired state").argument(
|
|
27565
27705
|
"[stacks...]",
|
|
27566
27706
|
"Stack name(s) to diff. Accepts physical CloudFormation names (e.g. 'MyStage-Api') or CDK display paths (e.g. 'MyStage/Api'). Supports wildcards (e.g. 'MyStage/*')."
|
|
27567
27707
|
).option("--all", "Diff all stacks", false).action(withErrorHandling(diffCommand));
|
|
@@ -27572,7 +27712,7 @@ function createDiffCommand() {
|
|
|
27572
27712
|
}
|
|
27573
27713
|
|
|
27574
27714
|
// src/cli/commands/destroy.ts
|
|
27575
|
-
import { Command as
|
|
27715
|
+
import { Command as Command6 } from "commander";
|
|
27576
27716
|
init_aws_clients();
|
|
27577
27717
|
import * as readline from "node:readline/promises";
|
|
27578
27718
|
async function destroyCommand(stackArgs, options) {
|
|
@@ -27854,7 +27994,7 @@ Acquiring lock for stack ${stackName}...`);
|
|
|
27854
27994
|
}
|
|
27855
27995
|
}
|
|
27856
27996
|
function createDestroyCommand() {
|
|
27857
|
-
const cmd = new
|
|
27997
|
+
const cmd = new Command6("destroy").description("Destroy all resources in the stack").argument(
|
|
27858
27998
|
"[stacks...]",
|
|
27859
27999
|
"Stack name(s) to destroy. Accepts physical CloudFormation names (e.g. 'MyStage-Api') or CDK display paths (e.g. 'MyStage/Api'). Supports wildcards (e.g. 'MyStage/*')."
|
|
27860
28000
|
).option("--all", "Destroy all stacks", false).action(withErrorHandling(destroyCommand));
|
|
@@ -27870,7 +28010,7 @@ function createDestroyCommand() {
|
|
|
27870
28010
|
}
|
|
27871
28011
|
|
|
27872
28012
|
// src/cli/commands/publish-assets.ts
|
|
27873
|
-
import { Option as Option2, Command as
|
|
28013
|
+
import { Option as Option2, Command as Command7 } from "commander";
|
|
27874
28014
|
async function publishAssetsCommand(options) {
|
|
27875
28015
|
const logger = getLogger();
|
|
27876
28016
|
if (options.verbose) {
|
|
@@ -27888,7 +28028,7 @@ async function publishAssetsCommand(options) {
|
|
|
27888
28028
|
logger.info("\u2705 Asset publishing complete");
|
|
27889
28029
|
}
|
|
27890
28030
|
function createPublishAssetsCommand() {
|
|
27891
|
-
const cmd = new
|
|
28031
|
+
const cmd = new Command7("publish-assets").description("Publish assets to S3/ECR from asset manifest").requiredOption("--path <path>", "Path to asset manifest file or directory").addOption(
|
|
27892
28032
|
new Option2(
|
|
27893
28033
|
"--asset-publish-concurrency <number>",
|
|
27894
28034
|
"Maximum concurrent asset publish operations"
|
|
@@ -27901,7 +28041,7 @@ function createPublishAssetsCommand() {
|
|
|
27901
28041
|
}
|
|
27902
28042
|
|
|
27903
28043
|
// src/cli/commands/force-unlock.ts
|
|
27904
|
-
import { Command as
|
|
28044
|
+
import { Command as Command8 } from "commander";
|
|
27905
28045
|
init_aws_clients();
|
|
27906
28046
|
async function forceUnlockCommand(stackArgs, options) {
|
|
27907
28047
|
const logger = getLogger();
|
|
@@ -27944,7 +28084,7 @@ async function forceUnlockCommand(stackArgs, options) {
|
|
|
27944
28084
|
}
|
|
27945
28085
|
}
|
|
27946
28086
|
function createForceUnlockCommand() {
|
|
27947
|
-
const cmd = new
|
|
28087
|
+
const cmd = new Command8("force-unlock").description("Force-release a stale lock on a stack").argument("[stacks...]", "Stack name(s) to unlock").action(withErrorHandling(forceUnlockCommand));
|
|
27948
28088
|
[...commonOptions, ...stateOptions, ...stackOptions].forEach((opt) => cmd.addOption(opt));
|
|
27949
28089
|
return cmd;
|
|
27950
28090
|
}
|
|
@@ -27953,6 +28093,8 @@ function createForceUnlockCommand() {
|
|
|
27953
28093
|
var SUBCOMMANDS = /* @__PURE__ */ new Set([
|
|
27954
28094
|
"bootstrap",
|
|
27955
28095
|
"synth",
|
|
28096
|
+
"list",
|
|
28097
|
+
"ls",
|
|
27956
28098
|
"deploy",
|
|
27957
28099
|
"diff",
|
|
27958
28100
|
"destroy",
|
|
@@ -27970,10 +28112,11 @@ function reorderArgs(argv) {
|
|
|
27970
28112
|
return [...prefix, ...cmdAndAfter, ...beforeCmd];
|
|
27971
28113
|
}
|
|
27972
28114
|
async function main() {
|
|
27973
|
-
const program = new
|
|
27974
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
28115
|
+
const program = new Command9();
|
|
28116
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.5.1");
|
|
27975
28117
|
program.addCommand(createBootstrapCommand());
|
|
27976
28118
|
program.addCommand(createSynthCommand());
|
|
28119
|
+
program.addCommand(createListCommand());
|
|
27977
28120
|
program.addCommand(createDeployCommand());
|
|
27978
28121
|
program.addCommand(createDiffCommand());
|
|
27979
28122
|
program.addCommand(createDestroyCommand());
|