@go-to-k/cdkd 0.91.5 → 0.93.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 +43 -2
- package/dist/cli.js +201 -63
- package/dist/cli.js.map +4 -4
- package/dist/go-to-k-cdkd-0.93.0.tgz +0 -0
- package/dist/index.js +24 -6
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/go-to-k-cdkd-0.91.5.tgz +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# cdkd
|
|
1
|
+
# cdkd (CDK Direct)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Drop-in CDK CLI for existing CDK apps — faster deploys via AWS SDK instead of CloudFormation, with local emulation for Lambda, API Gateway, and ECS.
|
|
4
4
|
|
|
5
5
|
- **Drop-in CDK compatible** — your existing CDK app code runs as-is.
|
|
6
6
|
- **Up to 15x faster deploys than the AWS CDK CLI (CloudFormation)**
|
|
@@ -453,6 +453,47 @@ Two `orphan` variants at different granularities:
|
|
|
453
453
|
Both `cdkd destroy` (synth-driven) and `cdkd state destroy`
|
|
454
454
|
(state-driven, no synth) delete AWS resources + state.
|
|
455
455
|
|
|
456
|
+
## Stack-name prefix on physical names
|
|
457
|
+
|
|
458
|
+
cdkd prepends the **stack name** to physical names you declare in CDK
|
|
459
|
+
code: `new iam.Role(this, 'CRRole', { roleName: 'my-role' })` in stack
|
|
460
|
+
`MyStack` is created in AWS as `MyStack-my-role`. The prefix protects
|
|
461
|
+
cross-stack uniqueness (two stacks declaring `roleName: 'my-role'`
|
|
462
|
+
otherwise collide on a single AWS account). Pre-PR this behavior was
|
|
463
|
+
**inconsistent**: only IAM Role / User / Group / InstanceProfile and
|
|
464
|
+
ELBv2 LoadBalancer / TargetGroup actually got the prefix; Lambda, S3,
|
|
465
|
+
SNS, SQS, DynamoDB, etc. used the user's declared name as-is.
|
|
466
|
+
|
|
467
|
+
`cdkd deploy --no-prefix-user-supplied-names` opts in to skipping
|
|
468
|
+
the prefix on user-declared physical names, making cdkd consistent
|
|
469
|
+
across all resource types. Off by default for backward compatibility.
|
|
470
|
+
|
|
471
|
+
| | Default (no flag) | `--no-prefix-user-supplied-names` |
|
|
472
|
+
| --- | --- | --- |
|
|
473
|
+
| `new iam.Role({ roleName: 'my-role' })` | `MyStack-my-role` | `my-role` |
|
|
474
|
+
| `new s3.Bucket({ bucketName: 'my-bucket' })` | `my-bucket` (already no prefix — Pattern A) | `my-bucket` (unchanged) |
|
|
475
|
+
| `new iam.Role(...)` (no `roleName`) | `MyStack-CRRole-<hash>` (auto-generated, prefix kept for uniqueness) | `MyStack-CRRole-<hash>` (unchanged) |
|
|
476
|
+
|
|
477
|
+
Resolution chain (highest wins): `--no-prefix-user-supplied-names`
|
|
478
|
+
CLI flag → `CDKD_NO_PREFIX_USER_SUPPLIED_NAMES=true` env var →
|
|
479
|
+
`cdk.json` `context.cdkd.noPrefixUserSuppliedNames: true` → default
|
|
480
|
+
`false`.
|
|
481
|
+
|
|
482
|
+
Affects `cdkd deploy` only. Already-deployed stacks deployed under
|
|
483
|
+
the legacy prefixed-name scheme keep working — the flag only controls
|
|
484
|
+
what AWS resource cdkd creates on **future** deploys. Switching the
|
|
485
|
+
flag mid-flight on an existing stack would propose REPLACEMENT on
|
|
486
|
+
every Pattern B resource (the existing AWS resource has the prefixed
|
|
487
|
+
name; the new template intent has the un-prefixed name).
|
|
488
|
+
|
|
489
|
+
Surfaced by [PR #285 `cdkd export`](https://github.com/go-to-k/cdkd/pull/285)
|
|
490
|
+
where the CFn IMPORT changeset's identifier check would fail on a
|
|
491
|
+
synth `RoleName: 'my-role'` vs the AWS-deployed `MyStack-my-role`;
|
|
492
|
+
the export command currently overlays `ResourceIdentifier` onto
|
|
493
|
+
`Properties` to bridge the gap. A future major-version PR will flip
|
|
494
|
+
the default of `--no-prefix-user-supplied-names` to `true`, after
|
|
495
|
+
which the overlay can be dropped.
|
|
496
|
+
|
|
456
497
|
## `--remove-protection`: one-shot bypass for protected resources
|
|
457
498
|
|
|
458
499
|
CDK's `new Stack(app, 'X', { terminationProtection: true })` is honored
|
package/dist/cli.js
CHANGED
|
@@ -17823,10 +17823,31 @@ function withStackName(stackName, fn) {
|
|
|
17823
17823
|
function getCurrentStackName() {
|
|
17824
17824
|
return stackNameStore.getStore();
|
|
17825
17825
|
}
|
|
17826
|
+
var skipPrefixStore = new AsyncLocalStorage();
|
|
17827
|
+
function withSkipPrefix(skip, fn) {
|
|
17828
|
+
return skipPrefixStore.run(skip, fn);
|
|
17829
|
+
}
|
|
17830
|
+
function getCurrentSkipPrefix() {
|
|
17831
|
+
return skipPrefixStore.getStore() ?? false;
|
|
17832
|
+
}
|
|
17833
|
+
var PATTERN_B_RESOURCE_TYPES = [
|
|
17834
|
+
"AWS::IAM::Role",
|
|
17835
|
+
"AWS::IAM::User",
|
|
17836
|
+
"AWS::IAM::Group",
|
|
17837
|
+
"AWS::IAM::InstanceProfile",
|
|
17838
|
+
"AWS::ElasticLoadBalancingV2::LoadBalancer",
|
|
17839
|
+
"AWS::ElasticLoadBalancingV2::TargetGroup"
|
|
17840
|
+
];
|
|
17826
17841
|
function generateResourceName(name, options) {
|
|
17827
|
-
const {
|
|
17842
|
+
const {
|
|
17843
|
+
maxLength,
|
|
17844
|
+
lowercase = false,
|
|
17845
|
+
allowedPattern = /[^a-zA-Z0-9-]/g,
|
|
17846
|
+
userSupplied = false
|
|
17847
|
+
} = options;
|
|
17828
17848
|
const currentStackName = stackNameStore.getStore();
|
|
17829
|
-
const
|
|
17849
|
+
const shouldPrefix = currentStackName && !(userSupplied && getCurrentSkipPrefix());
|
|
17850
|
+
const fullName = shouldPrefix ? `${currentStackName}-${name}` : name;
|
|
17830
17851
|
let sanitized = lowercase ? fullName.toLowerCase() : fullName;
|
|
17831
17852
|
sanitized = sanitized.replace(allowedPattern, "-");
|
|
17832
17853
|
sanitized = sanitized.replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -17838,6 +17859,12 @@ function generateResourceName(name, options) {
|
|
|
17838
17859
|
const prefix = sanitized.substring(0, maxPrefixLength).replace(/-+$/, "");
|
|
17839
17860
|
return `${prefix}-${hash}`;
|
|
17840
17861
|
}
|
|
17862
|
+
function generateResourceNameWithFallback(userSuppliedName, logicalId, options) {
|
|
17863
|
+
if (userSuppliedName !== void 0 && userSuppliedName !== "") {
|
|
17864
|
+
return generateResourceName(userSuppliedName, { ...options, userSupplied: true });
|
|
17865
|
+
}
|
|
17866
|
+
return generateResourceName(logicalId, { ...options, userSupplied: false });
|
|
17867
|
+
}
|
|
17841
17868
|
var FALLBACK_NAME_RULES = {
|
|
17842
17869
|
"AWS::S3::Bucket": { nameProperty: "BucketName", options: { maxLength: 63, lowercase: true } },
|
|
17843
17870
|
"AWS::SQS::Queue": { nameProperty: "QueueName", options: { maxLength: 80 } },
|
|
@@ -23368,6 +23395,10 @@ var deployOptions = [
|
|
|
23368
23395
|
"--no-capture-observed-state",
|
|
23369
23396
|
"Skip capturing AWS-current properties after each create/update (adds a fire-and-forget readCurrentState per resource so cdkd drift can compare against the real deploy-time AWS snapshot instead of the template). On by default. Disable when deploy speed matters more than rich drift detection \u2014 falls back to comparing against template properties (the pre-v3 behavior)."
|
|
23370
23397
|
),
|
|
23398
|
+
new Option(
|
|
23399
|
+
"--no-prefix-user-supplied-names",
|
|
23400
|
+
'Do NOT prepend the stack name to physical names the user explicitly supplied in their CDK code (e.g. `new iam.Role(this, "X", { roleName: "my-role" })` \u2192 AWS resource named `my-role` instead of `MyStack-my-role`). Auto-generated-name resources (where the user did not declare a physical name) keep the prefix unchanged. Off by default for backward compatibility; enable via this flag, CDKD_NO_PREFIX_USER_SUPPLIED_NAMES=true, or cdk.json context.cdkd.noPrefixUserSuppliedNames=true. Applies to `cdkd deploy` only.'
|
|
23401
|
+
),
|
|
23371
23402
|
noWaitOption,
|
|
23372
23403
|
aggressiveVpcParallelOption,
|
|
23373
23404
|
new Option(
|
|
@@ -23512,6 +23543,19 @@ function resolveCaptureObservedState(cliValue) {
|
|
|
23512
23543
|
return v;
|
|
23513
23544
|
return true;
|
|
23514
23545
|
}
|
|
23546
|
+
function resolveSkipPrefix(cliValue) {
|
|
23547
|
+
if (cliValue === false)
|
|
23548
|
+
return true;
|
|
23549
|
+
const envValue = process.env["CDKD_NO_PREFIX_USER_SUPPLIED_NAMES"];
|
|
23550
|
+
if (envValue === "true")
|
|
23551
|
+
return true;
|
|
23552
|
+
const cdkJson = loadCdkJson();
|
|
23553
|
+
const cdkdContext = cdkJson?.context?.["cdkd"];
|
|
23554
|
+
const v = cdkdContext?.["noPrefixUserSuppliedNames"];
|
|
23555
|
+
if (typeof v === "boolean" && v === true)
|
|
23556
|
+
return true;
|
|
23557
|
+
return false;
|
|
23558
|
+
}
|
|
23515
23559
|
function resolveStateBucketWithSource(cliBucket) {
|
|
23516
23560
|
if (cliBucket)
|
|
23517
23561
|
return { bucket: cliBucket, source: "cli-flag" };
|
|
@@ -27789,8 +27833,9 @@ var IAMRoleProvider = class {
|
|
|
27789
27833
|
*/
|
|
27790
27834
|
async create(logicalId, resourceType, properties) {
|
|
27791
27835
|
this.logger.debug(`Creating IAM role ${logicalId}`);
|
|
27792
|
-
const roleName =
|
|
27793
|
-
properties["RoleName"]
|
|
27836
|
+
const roleName = generateResourceNameWithFallback(
|
|
27837
|
+
properties["RoleName"],
|
|
27838
|
+
logicalId,
|
|
27794
27839
|
{ maxLength: 64 }
|
|
27795
27840
|
);
|
|
27796
27841
|
const assumeRolePolicyDocument = properties["AssumeRolePolicyDocument"];
|
|
@@ -27882,8 +27927,9 @@ var IAMRoleProvider = class {
|
|
|
27882
27927
|
*/
|
|
27883
27928
|
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
27884
27929
|
this.logger.debug(`Updating IAM role ${logicalId}: ${physicalId}`);
|
|
27885
|
-
const newRoleName =
|
|
27886
|
-
properties["RoleName"]
|
|
27930
|
+
const newRoleName = generateResourceNameWithFallback(
|
|
27931
|
+
properties["RoleName"],
|
|
27932
|
+
logicalId,
|
|
27887
27933
|
{ maxLength: 64 }
|
|
27888
27934
|
);
|
|
27889
27935
|
const newPath = properties["Path"] || "/";
|
|
@@ -29004,8 +29050,9 @@ var IAMInstanceProfileProvider = class {
|
|
|
29004
29050
|
*/
|
|
29005
29051
|
async create(logicalId, resourceType, properties) {
|
|
29006
29052
|
this.logger.debug(`Creating IAM instance profile ${logicalId}`);
|
|
29007
|
-
const instanceProfileName =
|
|
29008
|
-
properties["InstanceProfileName"]
|
|
29053
|
+
const instanceProfileName = generateResourceNameWithFallback(
|
|
29054
|
+
properties["InstanceProfileName"],
|
|
29055
|
+
logicalId,
|
|
29009
29056
|
{ maxLength: 128 }
|
|
29010
29057
|
);
|
|
29011
29058
|
const path3 = properties["Path"] || "/";
|
|
@@ -29399,8 +29446,9 @@ var IAMUserGroupProvider = class {
|
|
|
29399
29446
|
// ─── AWS::IAM::User ──────────────────────────────────────────────
|
|
29400
29447
|
async createUser(logicalId, resourceType, properties) {
|
|
29401
29448
|
this.logger.debug(`Creating IAM user ${logicalId}`);
|
|
29402
|
-
const userName =
|
|
29403
|
-
properties["UserName"]
|
|
29449
|
+
const userName = generateResourceNameWithFallback(
|
|
29450
|
+
properties["UserName"],
|
|
29451
|
+
logicalId,
|
|
29404
29452
|
{ maxLength: 64 }
|
|
29405
29453
|
);
|
|
29406
29454
|
try {
|
|
@@ -29883,8 +29931,9 @@ var IAMUserGroupProvider = class {
|
|
|
29883
29931
|
// ─── AWS::IAM::Group ─────────────────────────────────────────────
|
|
29884
29932
|
async createGroup(logicalId, resourceType, properties) {
|
|
29885
29933
|
this.logger.debug(`Creating IAM group ${logicalId}`);
|
|
29886
|
-
const groupName =
|
|
29887
|
-
properties["GroupName"]
|
|
29934
|
+
const groupName = generateResourceNameWithFallback(
|
|
29935
|
+
properties["GroupName"],
|
|
29936
|
+
logicalId,
|
|
29888
29937
|
{ maxLength: 128 }
|
|
29889
29938
|
);
|
|
29890
29939
|
try {
|
|
@@ -48542,9 +48591,11 @@ var ELBv2Provider = class {
|
|
|
48542
48591
|
this.logger.debug(`Creating LoadBalancer ${logicalId}`);
|
|
48543
48592
|
try {
|
|
48544
48593
|
const tags = this.extractTags(properties);
|
|
48545
|
-
const lbName =
|
|
48546
|
-
|
|
48547
|
-
|
|
48594
|
+
const lbName = generateResourceNameWithFallback(
|
|
48595
|
+
properties["Name"],
|
|
48596
|
+
logicalId,
|
|
48597
|
+
{ maxLength: 32 }
|
|
48598
|
+
);
|
|
48548
48599
|
const response = await this.getClient().send(
|
|
48549
48600
|
new CreateLoadBalancerCommand({
|
|
48550
48601
|
Name: lbName,
|
|
@@ -48743,9 +48794,11 @@ var ELBv2Provider = class {
|
|
|
48743
48794
|
try {
|
|
48744
48795
|
const tags = this.extractTags(properties);
|
|
48745
48796
|
const matcher = properties["Matcher"];
|
|
48746
|
-
const tgName =
|
|
48747
|
-
|
|
48748
|
-
|
|
48797
|
+
const tgName = generateResourceNameWithFallback(
|
|
48798
|
+
properties["Name"],
|
|
48799
|
+
logicalId,
|
|
48800
|
+
{ maxLength: 32 }
|
|
48801
|
+
);
|
|
48749
48802
|
const response = await this.getClient().send(
|
|
48750
48803
|
new CreateTargetGroupCommand({
|
|
48751
48804
|
Name: tgName,
|
|
@@ -65426,6 +65479,72 @@ function registerAllProviders(registry) {
|
|
|
65426
65479
|
|
|
65427
65480
|
// src/cli/commands/deploy.ts
|
|
65428
65481
|
init_aws_clients();
|
|
65482
|
+
|
|
65483
|
+
// src/cli/commands/prefix-migration-check.ts
|
|
65484
|
+
import * as readline from "node:readline/promises";
|
|
65485
|
+
function findPendingPrefixRenames(stackName, state) {
|
|
65486
|
+
if (!state)
|
|
65487
|
+
return [];
|
|
65488
|
+
const patternB = new Set(PATTERN_B_RESOURCE_TYPES);
|
|
65489
|
+
const prefix = `${stackName}-`;
|
|
65490
|
+
const out = [];
|
|
65491
|
+
for (const [logicalId, resource] of Object.entries(state.resources)) {
|
|
65492
|
+
if (!patternB.has(resource.resourceType))
|
|
65493
|
+
continue;
|
|
65494
|
+
if (typeof resource.physicalId !== "string")
|
|
65495
|
+
continue;
|
|
65496
|
+
if (!resource.physicalId.startsWith(prefix))
|
|
65497
|
+
continue;
|
|
65498
|
+
const newPhysicalId = resource.physicalId.slice(prefix.length);
|
|
65499
|
+
if (newPhysicalId.length === 0)
|
|
65500
|
+
continue;
|
|
65501
|
+
out.push({
|
|
65502
|
+
logicalId,
|
|
65503
|
+
resourceType: resource.resourceType,
|
|
65504
|
+
oldPhysicalId: resource.physicalId,
|
|
65505
|
+
newPhysicalId
|
|
65506
|
+
});
|
|
65507
|
+
}
|
|
65508
|
+
return out;
|
|
65509
|
+
}
|
|
65510
|
+
async function promptMigrationConfirm(renames, opts) {
|
|
65511
|
+
if (renames.length === 0)
|
|
65512
|
+
return true;
|
|
65513
|
+
const logger = getLogger();
|
|
65514
|
+
logger.warn("");
|
|
65515
|
+
logger.warn(
|
|
65516
|
+
`WARNING: --no-prefix-user-supplied-names will REPLACE ${renames.length} resource(s) whose AWS physical name is still prefixed with the stack name:`
|
|
65517
|
+
);
|
|
65518
|
+
for (const r of renames) {
|
|
65519
|
+
logger.warn(` - ${r.logicalId} (${r.resourceType}): ${r.oldPhysicalId} -> ${r.newPhysicalId}`);
|
|
65520
|
+
}
|
|
65521
|
+
logger.warn(
|
|
65522
|
+
"These resources will be REPLACED because the new naming convention drops the stack-name prefix."
|
|
65523
|
+
);
|
|
65524
|
+
if (opts.yes)
|
|
65525
|
+
return true;
|
|
65526
|
+
if (process.stdin.isTTY !== true) {
|
|
65527
|
+
throw new Error(
|
|
65528
|
+
"--no-prefix-user-supplied-names migration confirm prompt cannot run in a non-interactive environment. Pass --yes / -y to confirm the REPLACEMENT, or run the deploy from a real terminal."
|
|
65529
|
+
);
|
|
65530
|
+
}
|
|
65531
|
+
const rl = readline.createInterface({
|
|
65532
|
+
input: process.stdin,
|
|
65533
|
+
output: process.stdout
|
|
65534
|
+
});
|
|
65535
|
+
try {
|
|
65536
|
+
const answer = await rl.question("\nContinue? (y/N): ");
|
|
65537
|
+
const trimmed = answer.trim().toLowerCase();
|
|
65538
|
+
if (trimmed === "y" || trimmed === "yes")
|
|
65539
|
+
return true;
|
|
65540
|
+
logger.info("Deploy cancelled \u2014 no resources modified.");
|
|
65541
|
+
return false;
|
|
65542
|
+
} finally {
|
|
65543
|
+
rl.close();
|
|
65544
|
+
}
|
|
65545
|
+
}
|
|
65546
|
+
|
|
65547
|
+
// src/cli/commands/deploy.ts
|
|
65429
65548
|
async function deployCommand(stacks, options) {
|
|
65430
65549
|
const logger = getLogger();
|
|
65431
65550
|
if (options.verbose) {
|
|
@@ -65438,6 +65557,12 @@ async function deployCommand(stacks, options) {
|
|
|
65438
65557
|
if (!options.wait) {
|
|
65439
65558
|
process.env["CDKD_NO_WAIT"] = "true";
|
|
65440
65559
|
}
|
|
65560
|
+
const skipPrefix = resolveSkipPrefix(options.prefixUserSuppliedNames);
|
|
65561
|
+
if (skipPrefix) {
|
|
65562
|
+
logger.debug(
|
|
65563
|
+
"Skipping stack-name prefix on user-supplied physical names (--no-prefix-user-supplied-names / CDKD_NO_PREFIX_USER_SUPPLIED_NAMES / cdk.json context.cdkd.noPrefixUserSuppliedNames)"
|
|
65564
|
+
);
|
|
65565
|
+
}
|
|
65441
65566
|
const app = resolveApp(options.app);
|
|
65442
65567
|
if (!app) {
|
|
65443
65568
|
throw new Error(
|
|
@@ -65597,6 +65722,9 @@ async function deployCommand(stacks, options) {
|
|
|
65597
65722
|
logger.debug(`Work graph: ${summary["asset-publish"]} asset(s), ${summary["stack"]} stack(s)`);
|
|
65598
65723
|
const bufferStackOutput = targetStacks.length > 1;
|
|
65599
65724
|
const runStack = async (stackInfo) => {
|
|
65725
|
+
return withSkipPrefix(skipPrefix, () => runStackInner(stackInfo));
|
|
65726
|
+
};
|
|
65727
|
+
const runStackInner = async (stackInfo) => {
|
|
65600
65728
|
const stackRegion = stackInfo.region || baseRegion;
|
|
65601
65729
|
logger.info(
|
|
65602
65730
|
`
|
|
@@ -65620,33 +65748,43 @@ Deploying stack: ${stackInfo.stackName}${stackRegion !== baseRegion ? ` (region:
|
|
|
65620
65748
|
const stackProviderRegistry = new ProviderRegistry();
|
|
65621
65749
|
registerAllProviders(stackProviderRegistry);
|
|
65622
65750
|
stackProviderRegistry.setCustomResourceResponseBucket(stateBucket, baseRegion);
|
|
65623
|
-
const stackDeployEngine = new DeployEngine(
|
|
65624
|
-
stackStateBackend,
|
|
65625
|
-
stackLockManager,
|
|
65626
|
-
dagBuilder,
|
|
65627
|
-
diffCalculator,
|
|
65628
|
-
stackProviderRegistry,
|
|
65629
|
-
{
|
|
65630
|
-
concurrency: options.concurrency,
|
|
65631
|
-
dryRun: options.dryRun,
|
|
65632
|
-
noRollback: !options.rollback,
|
|
65633
|
-
captureObservedState: resolveCaptureObservedState(options.captureObservedState),
|
|
65634
|
-
...options.resourceWarnAfter?.globalMs !== void 0 && {
|
|
65635
|
-
resourceWarnAfterMs: options.resourceWarnAfter.globalMs
|
|
65636
|
-
},
|
|
65637
|
-
...options.resourceTimeout?.globalMs !== void 0 && {
|
|
65638
|
-
resourceTimeoutMs: options.resourceTimeout.globalMs
|
|
65639
|
-
},
|
|
65640
|
-
...options.resourceWarnAfter?.perTypeMs && {
|
|
65641
|
-
resourceWarnAfterByType: options.resourceWarnAfter.perTypeMs
|
|
65642
|
-
},
|
|
65643
|
-
...options.resourceTimeout?.perTypeMs && {
|
|
65644
|
-
resourceTimeoutByType: options.resourceTimeout.perTypeMs
|
|
65645
|
-
}
|
|
65646
|
-
},
|
|
65647
|
-
stackRegion
|
|
65648
|
-
);
|
|
65649
65751
|
try {
|
|
65752
|
+
if (skipPrefix) {
|
|
65753
|
+
const existing = await stackStateBackend.getState(stackInfo.stackName, stackRegion);
|
|
65754
|
+
const pending = findPendingPrefixRenames(stackInfo.stackName, existing?.state);
|
|
65755
|
+
if (pending.length > 0) {
|
|
65756
|
+
const proceed = await promptMigrationConfirm(pending, { yes: options.yes });
|
|
65757
|
+
if (!proceed) {
|
|
65758
|
+
return;
|
|
65759
|
+
}
|
|
65760
|
+
}
|
|
65761
|
+
}
|
|
65762
|
+
const stackDeployEngine = new DeployEngine(
|
|
65763
|
+
stackStateBackend,
|
|
65764
|
+
stackLockManager,
|
|
65765
|
+
dagBuilder,
|
|
65766
|
+
diffCalculator,
|
|
65767
|
+
stackProviderRegistry,
|
|
65768
|
+
{
|
|
65769
|
+
concurrency: options.concurrency,
|
|
65770
|
+
dryRun: options.dryRun,
|
|
65771
|
+
noRollback: !options.rollback,
|
|
65772
|
+
captureObservedState: resolveCaptureObservedState(options.captureObservedState),
|
|
65773
|
+
...options.resourceWarnAfter?.globalMs !== void 0 && {
|
|
65774
|
+
resourceWarnAfterMs: options.resourceWarnAfter.globalMs
|
|
65775
|
+
},
|
|
65776
|
+
...options.resourceTimeout?.globalMs !== void 0 && {
|
|
65777
|
+
resourceTimeoutMs: options.resourceTimeout.globalMs
|
|
65778
|
+
},
|
|
65779
|
+
...options.resourceWarnAfter?.perTypeMs && {
|
|
65780
|
+
resourceWarnAfterByType: options.resourceWarnAfter.perTypeMs
|
|
65781
|
+
},
|
|
65782
|
+
...options.resourceTimeout?.perTypeMs && {
|
|
65783
|
+
resourceTimeoutByType: options.resourceTimeout.perTypeMs
|
|
65784
|
+
}
|
|
65785
|
+
},
|
|
65786
|
+
stackRegion
|
|
65787
|
+
);
|
|
65650
65788
|
const deployResult = await stackDeployEngine.deploy(
|
|
65651
65789
|
stackInfo.stackName,
|
|
65652
65790
|
stackInfo.template
|
|
@@ -65931,7 +66069,7 @@ function createDiffCommand() {
|
|
|
65931
66069
|
}
|
|
65932
66070
|
|
|
65933
66071
|
// src/cli/commands/drift.ts
|
|
65934
|
-
import * as
|
|
66072
|
+
import * as readline2 from "node:readline/promises";
|
|
65935
66073
|
import { Command as Command6, Option as Option3 } from "commander";
|
|
65936
66074
|
init_aws_clients();
|
|
65937
66075
|
|
|
@@ -66640,7 +66778,7 @@ async function runWithConcurrency(tasks, concurrency) {
|
|
|
66640
66778
|
await Promise.all(workers);
|
|
66641
66779
|
}
|
|
66642
66780
|
async function confirmPrompt(prompt) {
|
|
66643
|
-
const rl =
|
|
66781
|
+
const rl = readline2.createInterface({ input: process.stdin, output: process.stdout });
|
|
66644
66782
|
try {
|
|
66645
66783
|
const ans = await rl.question(`${prompt} [y/N] `);
|
|
66646
66784
|
return /^y(es)?$/i.test(ans.trim());
|
|
@@ -66753,7 +66891,7 @@ import { Command as Command7 } from "commander";
|
|
|
66753
66891
|
init_aws_clients();
|
|
66754
66892
|
|
|
66755
66893
|
// src/cli/commands/destroy-runner.ts
|
|
66756
|
-
import * as
|
|
66894
|
+
import * as readline3 from "node:readline/promises";
|
|
66757
66895
|
init_aws_clients();
|
|
66758
66896
|
var PROTECTION_PROPERTY_BY_TYPE = {
|
|
66759
66897
|
"AWS::Logs::LogGroup": "DeletionProtectionEnabled",
|
|
@@ -66825,7 +66963,7 @@ Resources to be deleted (${resourceCount}):`);
|
|
|
66825
66963
|
}
|
|
66826
66964
|
const protectedCount = ctx.removeProtection ? countProtectedResources(state) : 0;
|
|
66827
66965
|
if (!ctx.skipConfirmation) {
|
|
66828
|
-
const rl =
|
|
66966
|
+
const rl = readline3.createInterface({
|
|
66829
66967
|
input: process.stdin,
|
|
66830
66968
|
output: process.stdout
|
|
66831
66969
|
});
|
|
@@ -67259,7 +67397,7 @@ function createDestroyCommand() {
|
|
|
67259
67397
|
}
|
|
67260
67398
|
|
|
67261
67399
|
// src/cli/commands/orphan.ts
|
|
67262
|
-
import * as
|
|
67400
|
+
import * as readline4 from "node:readline/promises";
|
|
67263
67401
|
import { Command as Command8 } from "commander";
|
|
67264
67402
|
init_aws_clients();
|
|
67265
67403
|
|
|
@@ -67932,7 +68070,7 @@ function stringifyForAudit(value) {
|
|
|
67932
68070
|
return JSON.stringify(value);
|
|
67933
68071
|
}
|
|
67934
68072
|
async function confirmPrompt2(prompt) {
|
|
67935
|
-
const rl =
|
|
68073
|
+
const rl = readline4.createInterface({ input: process.stdin, output: process.stdout });
|
|
67936
68074
|
try {
|
|
67937
68075
|
const ans = await rl.question(`${prompt} [y/N] `);
|
|
67938
68076
|
return /^y(es)?$/i.test(ans.trim());
|
|
@@ -68207,7 +68345,7 @@ function createForceUnlockCommand() {
|
|
|
68207
68345
|
}
|
|
68208
68346
|
|
|
68209
68347
|
// src/cli/commands/state.ts
|
|
68210
|
-
import * as
|
|
68348
|
+
import * as readline6 from "node:readline/promises";
|
|
68211
68349
|
import { Command as Command12, Option as Option6 } from "commander";
|
|
68212
68350
|
import {
|
|
68213
68351
|
GetBucketLocationCommand as GetBucketLocationCommand2,
|
|
@@ -68217,7 +68355,7 @@ import {
|
|
|
68217
68355
|
init_aws_clients();
|
|
68218
68356
|
|
|
68219
68357
|
// src/cli/commands/state-migrate.ts
|
|
68220
|
-
import * as
|
|
68358
|
+
import * as readline5 from "node:readline/promises";
|
|
68221
68359
|
import { Command as Command11 } from "commander";
|
|
68222
68360
|
import {
|
|
68223
68361
|
CopyObjectCommand,
|
|
@@ -68493,7 +68631,7 @@ async function emptyBucketAllVersions(s3, bucket) {
|
|
|
68493
68631
|
} while (keyMarker || versionIdMarker);
|
|
68494
68632
|
}
|
|
68495
68633
|
async function confirmPrompt3(prompt) {
|
|
68496
|
-
const rl =
|
|
68634
|
+
const rl = readline5.createInterface({ input: process.stdin, output: process.stdout });
|
|
68497
68635
|
try {
|
|
68498
68636
|
const ans = await rl.question(`${prompt} [y/N] `);
|
|
68499
68637
|
return /^y(es)?$/i.test(ans.trim());
|
|
@@ -68901,7 +69039,7 @@ Use 'cdkd destroy ${stackName}' if you want to delete the actual resources.
|
|
|
68901
69039
|
|
|
68902
69040
|
`
|
|
68903
69041
|
);
|
|
68904
|
-
const rl =
|
|
69042
|
+
const rl = readline6.createInterface({
|
|
68905
69043
|
input: process.stdin,
|
|
68906
69044
|
output: process.stdout
|
|
68907
69045
|
});
|
|
@@ -68989,7 +69127,7 @@ WARNING: This destroys ${stackNames.length} stack(s) and removes their state rec
|
|
|
68989
69127
|
`);
|
|
68990
69128
|
}
|
|
68991
69129
|
process.stdout.write("\n");
|
|
68992
|
-
const rl =
|
|
69130
|
+
const rl = readline6.createInterface({
|
|
68993
69131
|
input: process.stdin,
|
|
68994
69132
|
output: process.stdout
|
|
68995
69133
|
});
|
|
@@ -69415,7 +69553,7 @@ async function refreshObservedForStack(stackName, region, stateBackend, lockMana
|
|
|
69415
69553
|
}
|
|
69416
69554
|
}
|
|
69417
69555
|
async function confirmRefresh(prompt) {
|
|
69418
|
-
const rl =
|
|
69556
|
+
const rl = readline6.createInterface({ input: process.stdin, output: process.stdout });
|
|
69419
69557
|
try {
|
|
69420
69558
|
const ans = await rl.question(`${prompt} [y/N] `);
|
|
69421
69559
|
return /^y(es)?$/i.test(ans.trim());
|
|
@@ -69446,12 +69584,12 @@ function createStateCommand() {
|
|
|
69446
69584
|
|
|
69447
69585
|
// src/cli/commands/import.ts
|
|
69448
69586
|
import { readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "node:fs";
|
|
69449
|
-
import * as
|
|
69587
|
+
import * as readline8 from "node:readline/promises";
|
|
69450
69588
|
import { Command as Command13 } from "commander";
|
|
69451
69589
|
init_aws_clients();
|
|
69452
69590
|
|
|
69453
69591
|
// src/cli/commands/retire-cfn-stack.ts
|
|
69454
|
-
import * as
|
|
69592
|
+
import * as readline7 from "node:readline/promises";
|
|
69455
69593
|
import {
|
|
69456
69594
|
DescribeStacksCommand,
|
|
69457
69595
|
DescribeStackResourcesCommand,
|
|
@@ -69657,7 +69795,7 @@ async function getCloudFormationResourceMapping(cfnStackName, cfnClient) {
|
|
|
69657
69795
|
return map;
|
|
69658
69796
|
}
|
|
69659
69797
|
async function confirmPrompt4(prompt) {
|
|
69660
|
-
const rl =
|
|
69798
|
+
const rl = readline7.createInterface({ input: process.stdin, output: process.stdout });
|
|
69661
69799
|
try {
|
|
69662
69800
|
const ans = await rl.question(`${prompt} [y/N] `);
|
|
69663
69801
|
return /^y(es)?$/i.test(ans.trim());
|
|
@@ -70119,7 +70257,7 @@ function formatOutcome(outcome) {
|
|
|
70119
70257
|
}
|
|
70120
70258
|
}
|
|
70121
70259
|
async function confirmPrompt5(prompt) {
|
|
70122
|
-
const rl =
|
|
70260
|
+
const rl = readline8.createInterface({ input: process.stdin, output: process.stdout });
|
|
70123
70261
|
try {
|
|
70124
70262
|
const ans = await rl.question(`${prompt} [y/N] `);
|
|
70125
70263
|
return /^y(es)?$/i.test(ans.trim());
|
|
@@ -79782,7 +79920,7 @@ function createLocalCommand() {
|
|
|
79782
79920
|
}
|
|
79783
79921
|
|
|
79784
79922
|
// src/cli/commands/export.ts
|
|
79785
|
-
import * as
|
|
79923
|
+
import * as readline9 from "node:readline/promises";
|
|
79786
79924
|
import { readFileSync as readFileSync9 } from "node:fs";
|
|
79787
79925
|
import { Command as Command17 } from "commander";
|
|
79788
79926
|
import {
|
|
@@ -80727,7 +80865,7 @@ function printNextSteps(args) {
|
|
|
80727
80865
|
logger.info("");
|
|
80728
80866
|
}
|
|
80729
80867
|
async function confirmPrompt6(prompt) {
|
|
80730
|
-
const rl =
|
|
80868
|
+
const rl = readline9.createInterface({ input: process.stdin, output: process.stdout });
|
|
80731
80869
|
try {
|
|
80732
80870
|
const ans = await rl.question(`${prompt} [y/N] `);
|
|
80733
80871
|
return /^y(es)?$/i.test(ans.trim());
|
|
@@ -80800,7 +80938,7 @@ function reorderArgs(argv) {
|
|
|
80800
80938
|
}
|
|
80801
80939
|
async function main() {
|
|
80802
80940
|
const program = new Command18();
|
|
80803
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
80941
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.93.0");
|
|
80804
80942
|
program.addCommand(createBootstrapCommand());
|
|
80805
80943
|
program.addCommand(createSynthCommand());
|
|
80806
80944
|
program.addCommand(createListCommand());
|