@go-to-k/cdkd 0.284.65 → 0.284.66

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.
@@ -1,7 +1,7 @@
1
- import { $ as maskerOrIdentity, $n as findLargeInlineResources, $t as TemplateParser, A as renderStatefulReason, An as formatDockerLoginError, Ar as StackHasActiveImportsError, At as STATE_SOURCED_READBACK_RULES, B as exportAliasCollisionScrubWarning, Bn as getLegacyStateBucketName, Br as isThrottlingError, Bt as classifyReplaySecretRegion, C as isFinalSnapshotError, Cn as parseBootstrapMarker, Ct as configStringRefusal, D as extractDeploymentEventError, Dn as buildDenyExternalAccessPolicy, Dr as ProvisioningError, Dt as requireConfigObject, E as makeCanonicalizePropertiesFn, En as validateContainerRepoName, Er as PartialFailureError, Et as requireConfigArray, F as green, Fn as AssetManifestLoader, Ft as isSingleDynamicReferenceToken, G as IAMRoleProvider, Gn as resolveStateBucketWithDefault, Gt as s3BucketRegionalDomainName, H as secretBearingStateKeyWarning, Hn as resolveAutoAssetStorage, Ht as s3BucketArn, I as red, In as getDockerImageBySourceHash, Ir as normalizeAwsError, It as maskSecretsInError, J as ProviderRegistry, Jn as stateBucketExistenceConfirmed, Jt as DiffCalculator, K as collectInlinePolicyNamesManagedBySiblings, Kn as resolveStateBucketWithDefaultAndSource, Kt as s3BucketWebsiteUrl, L as yellow, Ln as Synthesizer, Lr as withErrorHandling, Lt as maskSecretsInText, M as bold, Mn as partitionSensitiveEnv, Mt as createSecretMasker, N as cyan, Nn as runDockerForeground, Nt as dynamicReferenceTokens, O as MULTI_REGION_RECREATE_BLOCKED_TYPES, On as buildDockerImage, Or as ResourceTimeoutError, Ot as requireConfigString, P as gray, Pn as runDockerStreaming, Pt as errorCauseChain, Q as maskDeep, Qn as MIGRATE_TMP_PREFIX, Qt as DagBuilder, R as collectDeclaredOutputNames, Rn as synthesisStatusMessage, Rr as isMarkedNonRetryable, Rt as redactSecretsForState, S as createPreDeleteFinalSnapshot, Sn as isCrossRegionRedirect, Sr as LocalStartServiceError, St as configBooleanRefusal, T as unsupportedFinalSnapshotError, Tn as validateAssetBucketName, Tr as NestedStackChildDirectDestroyError, Tt as replayWarn, U as stateKeySecretExposure, Un as resolveCaptureObservedState, Ut as s3BucketDomainName, V as isExportAliasCollision, Vn as resolveApp, Vr as markNonRetryable, Vt as producerRegionsFromState, W as getCurrentResourceSecrets, Wn as resolveSkipPrefix, Wt as s3BucketDualStackDomainName, X as findSilentDropProperties, Xn as CFN_TEMPLATE_BODY_LIMIT, Xt as describeTypeWithThrottleRetry, Y as findActionableSilentDrops, Yn as warnDeprecatedNoPrefixCliFlag, Yt as INTRINSIC_KEYS, Z as createMaskedRetryLogger, Zn as CFN_TEMPLATE_URL_LIMIT, Zt as withRetry, _ as computeImplicitDeleteEdges, _n as AssetModeResolver, _t as WAFv2WebACLProvider, a as DeploymentEventsStore, an as importableOutputKeys, ar as AssemblyReader, at as isInterruptedWaitError, b as buildFinalSnapshotIdentifier, bn as ensureAssetStorage, br as LocalInvokeBuildError$1, bt as assertRegionMatch, c as replayFailedOperations, cn as AssetPublisher, cr as resolveBucketRegion, ct as slowCcOperationTimeoutMs, d as updatePartialReason, dn as buildAssetRedirectMap, dr as resetAwsClients, dt as IntrinsicFunctionResolver, en as LockManager, er as uploadCfnTemplate, et as CUSTOM_RESOURCE_RESPONSE_PREFIX, f as UNSPECIFIED_SKIP_REASON, fn as createAssetRedirectResolver, fr as setAwsClients, ft as carriesDynamicReference, g as IMPLICIT_DELETE_DEPENDENCIES, gn as stripControlChars, gr as CrossAccountSecretRefusalError, gt as refStateLookupFromResource, h as maskingRetryLogger, hn as escapeRegExp, ht as parameterTypeMayLoseSecretIdentity, i as DeploymentEventsReader, in as exportNamesCarriedFrom, ir as derivePartitionAndUrlSuffix, it as interruptWatchListenerCount, j as formatResourceLine, jn as getDockerCmd, jr as StackTerminationProtectionError, jt as TEMPLATE_SOURCED_RULES, k as isStatefulRecreateTargetSync, kn as dockerSpawnEnvWithSensitive, kr as ResourceUpdateNotSupportedError, kt as STATE_SOURCED_CROSS_GENERATION_RULES, l as replayRollback, ln as stringifyValue, lr as AwsClients, lt as disableInstanceApiTermination, m as withResourceDeadline, mn as rewriteTemplateAssetReferences, mr as CdkdError, mt as getAccountInfo, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as S3StateBackend, nr as PARTITION_TABLE, nt as beginCommandInterruptScope, o as planFailedOps, on as importableOutputs, or as processStackMessages, ot as startInterruptWatch, p as deleteSkipReason, pn as loadPublishableAssetManifest, pt as cfnRefValueFromPhysicalId, q as clearOnUpdateRemoval, qn as resolveUseCdkBootstrapAssets, qt as applyRoleArnIfSet, r as DeployEngine, rn as rebuildClientForBucketRegion, rr as canonicalizeRegion, rt as endCommandInterruptScope, s as planRollback, sn as shouldRetainResource, st as CloudControlProvider, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as displaySafe, tr as expectedOwnerParam, tt as DEFAULT_STATE_PREFIX, u as updatePartialMessage, un as WorkGraph, ur as getAwsClients, ut as isTerminationProtectionPropagationError, v as ATOMIC_FINAL_SNAPSHOT_TYPES, vn as BOOTSTRAP_MARKER_PREFIX, vr as DeployCancelledError, vt as normalizeAwsTagsToCfn, w as refusesFinalSnapshot, wn as readBootstrapMarkerBody, wr as MissingCdkCliError, wt as readConfigString, x as ccRoutedFinalSnapshotError, xn as getBootstrapMarkerKey, xr as LocalMigrateError, xt as coerceCfnBoolean, y as PRE_DELETE_SNAPSHOT_TYPES, yn as assertAssetBucketRegion, yr as DynamicReferenceRegionAmbiguousError, yt as resolveExplicitPhysicalId, z as collectPublishedOutputNames, zn as getDefaultStateBucketName, zr as isRetryableTransientError, zt as scrubResourceRecord } from "./deploy-engine-52VBVCWI.js";
2
- import { a as getLiveRenderer, c as PATTERN_B_RESOURCE_TYPES, d as generateResourceNameWithFallback, f as getCurrentStackName, h as withStackName, i as runStackBuffered, m as withSkipPrefix, n as getLogger, o as PATTERN_B_NAME_OPTIONS, s as PATTERN_B_NAME_PROPERTIES, u as generateResourceName } from "./logger-zRrlbaQt.js";
3
- import { t as getCdkdVersion } from "./version-BtkYYOb6.js";
4
- import { t as ASGProvider } from "./asg-provider-CNwOmQGg.js";
1
+ import { $ as maskerOrIdentity, $n as findLargeInlineResources, $t as TemplateParser, A as renderStatefulReason, An as formatDockerLoginError, Ar as StackHasActiveImportsError, At as STATE_SOURCED_READBACK_RULES, B as exportAliasCollisionScrubWarning, Bn as getLegacyStateBucketName, Br as isThrottlingError, Bt as classifyReplaySecretRegion, C as isFinalSnapshotError, Cn as parseBootstrapMarker, Ct as configStringRefusal, D as extractDeploymentEventError, Dn as buildDenyExternalAccessPolicy, Dr as ProvisioningError, Dt as requireConfigObject, E as makeCanonicalizePropertiesFn, En as validateContainerRepoName, Er as PartialFailureError, Et as requireConfigArray, F as green, Fn as AssetManifestLoader, Ft as isSingleDynamicReferenceToken, G as IAMRoleProvider, Gn as resolveStateBucketWithDefault, Gt as s3BucketRegionalDomainName, H as secretBearingStateKeyWarning, Hn as resolveAutoAssetStorage, Ht as s3BucketArn, I as red, In as getDockerImageBySourceHash, Ir as normalizeAwsError, It as maskSecretsInError, J as ProviderRegistry, Jn as stateBucketExistenceConfirmed, Jt as DiffCalculator, K as collectInlinePolicyNamesManagedBySiblings, Kn as resolveStateBucketWithDefaultAndSource, Kt as s3BucketWebsiteUrl, L as yellow, Ln as Synthesizer, Lr as withErrorHandling, Lt as maskSecretsInText, M as bold, Mn as partitionSensitiveEnv, Mt as createSecretMasker, N as cyan, Nn as runDockerForeground, Nt as dynamicReferenceTokens, O as MULTI_REGION_RECREATE_BLOCKED_TYPES, On as buildDockerImage, Or as ResourceTimeoutError, Ot as requireConfigString, P as gray, Pn as runDockerStreaming, Pt as errorCauseChain, Q as maskDeep, Qn as MIGRATE_TMP_PREFIX, Qt as DagBuilder, R as collectDeclaredOutputNames, Rn as synthesisStatusMessage, Rr as isMarkedNonRetryable, Rt as redactSecretsForState, S as createPreDeleteFinalSnapshot, Sn as isCrossRegionRedirect, Sr as LocalStartServiceError, St as configBooleanRefusal, T as unsupportedFinalSnapshotError, Tn as validateAssetBucketName, Tr as NestedStackChildDirectDestroyError, Tt as replayWarn, U as stateKeySecretExposure, Un as resolveCaptureObservedState, Ut as s3BucketDomainName, V as isExportAliasCollision, Vn as resolveApp, Vr as markNonRetryable, Vt as producerRegionsFromState, W as getCurrentResourceSecrets, Wn as resolveSkipPrefix, Wt as s3BucketDualStackDomainName, X as findSilentDropProperties, Xn as CFN_TEMPLATE_BODY_LIMIT, Xt as describeTypeWithThrottleRetry, Y as findActionableSilentDrops, Yn as warnDeprecatedNoPrefixCliFlag, Yt as INTRINSIC_KEYS, Z as createMaskedRetryLogger, Zn as CFN_TEMPLATE_URL_LIMIT, Zt as withRetry, _ as computeImplicitDeleteEdges, _n as AssetModeResolver, _t as WAFv2WebACLProvider, a as DeploymentEventsStore, an as importableOutputKeys, ar as AssemblyReader, at as isInterruptedWaitError, b as buildFinalSnapshotIdentifier, bn as ensureAssetStorage, br as LocalInvokeBuildError$1, bt as assertRegionMatch, c as replayFailedOperations, cn as AssetPublisher, cr as resolveBucketRegion, ct as slowCcOperationTimeoutMs, d as updatePartialReason, dn as buildAssetRedirectMap, dr as resetAwsClients, dt as IntrinsicFunctionResolver, en as LockManager, er as uploadCfnTemplate, et as CUSTOM_RESOURCE_RESPONSE_PREFIX, f as UNSPECIFIED_SKIP_REASON, fn as createAssetRedirectResolver, fr as setAwsClients, ft as carriesDynamicReference, g as IMPLICIT_DELETE_DEPENDENCIES, gn as stripControlChars, gr as CrossAccountSecretRefusalError, gt as refStateLookupFromResource, h as maskingRetryLogger, hn as escapeRegExp, ht as parameterTypeMayLoseSecretIdentity, i as DeploymentEventsReader, in as exportNamesCarriedFrom, ir as derivePartitionAndUrlSuffix, it as interruptWatchListenerCount, j as formatResourceLine, jn as getDockerCmd, jr as StackTerminationProtectionError, jt as TEMPLATE_SOURCED_RULES, k as isStatefulRecreateTargetSync, kn as dockerSpawnEnvWithSensitive, kr as ResourceUpdateNotSupportedError, kt as STATE_SOURCED_CROSS_GENERATION_RULES, l as replayRollback, ln as stringifyValue, lr as AwsClients, lt as disableInstanceApiTermination, m as withResourceDeadline, mn as rewriteTemplateAssetReferences, mr as CdkdError, mt as getAccountInfo, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as S3StateBackend, nr as PARTITION_TABLE, nt as beginCommandInterruptScope, o as planFailedOps, on as importableOutputs, or as processStackMessages, ot as startInterruptWatch, p as deleteSkipReason, pn as loadPublishableAssetManifest, pt as cfnRefValueFromPhysicalId, q as clearOnUpdateRemoval, qn as resolveUseCdkBootstrapAssets, qt as applyRoleArnIfSet, r as DeployEngine, rn as rebuildClientForBucketRegion, rr as canonicalizeRegion, rt as endCommandInterruptScope, s as planRollback, sn as shouldRetainResource, st as CloudControlProvider, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as displaySafe, tr as expectedOwnerParam, tt as DEFAULT_STATE_PREFIX, u as updatePartialMessage, un as WorkGraph, ur as getAwsClients, ut as isTerminationProtectionPropagationError, v as ATOMIC_FINAL_SNAPSHOT_TYPES, vn as BOOTSTRAP_MARKER_PREFIX, vr as DeployCancelledError, vt as normalizeAwsTagsToCfn, w as refusesFinalSnapshot, wn as readBootstrapMarkerBody, wr as MissingCdkCliError, wt as readConfigString, x as ccRoutedFinalSnapshotError, xn as getBootstrapMarkerKey, xr as LocalMigrateError, xt as coerceCfnBoolean, y as PRE_DELETE_SNAPSHOT_TYPES, yn as assertAssetBucketRegion, yr as DynamicReferenceRegionAmbiguousError, yt as resolveExplicitPhysicalId, z as collectPublishedOutputNames, zn as getDefaultStateBucketName, zr as isRetryableTransientError, zt as scrubResourceRecord } from "./deploy-engine-CgAjJmth.js";
2
+ import { a as runStackBuffered, c as PATTERN_B_NAME_PROPERTIES, d as generateResourceName, f as generateResourceNameWithFallback, g as withStackName, h as withSkipPrefix, l as PATTERN_B_RESOURCE_TYPES, n as getLogger, o as getLiveRenderer, p as getCurrentStackName, r as reserveStdoutForPayload, s as PATTERN_B_NAME_OPTIONS } from "./logger-C9-E73FI.js";
3
+ import { t as getCdkdVersion } from "./version-B2nyZsKC.js";
4
+ import { t as ASGProvider } from "./asg-provider-CIhU7iyC.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { createHash, randomBytes, randomUUID } from "node:crypto";
7
7
  import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
@@ -66661,6 +66661,7 @@ function incompleteRemediationMessage(reports, mode) {
66661
66661
  async function driftCommand(stacks, options) {
66662
66662
  const logger = getLogger();
66663
66663
  if (options.verbose) logger.setLevel("debug");
66664
+ if (options.json) reserveStdoutForPayload();
66664
66665
  warnIfDeprecatedRegion(options);
66665
66666
  if (options.accept && options.revert) throw new Error("--accept and --revert are mutually exclusive. Use --accept to update cdkd state from AWS, or --revert to push cdkd state values back into AWS.");
66666
66667
  foldRegionOption(options);
@@ -67615,18 +67616,19 @@ function setAtPath(target, path, value) {
67615
67616
  */
67616
67617
  async function runAccept(reports, stateBackend, stateConfig, awsClients, options) {
67617
67618
  const logger = getLogger();
67619
+ const out = humanTextSink(options.json);
67618
67620
  const lockRecovery = {
67619
67621
  profile: options.profile,
67620
67622
  stateBucket: stateConfig.bucket,
67621
67623
  statePrefix: stateConfig.prefix
67622
67624
  };
67623
- printAcceptPlan(reports);
67625
+ printAcceptPlan(reports, out);
67624
67626
  if (options.dryRun) {
67625
67627
  logger.info("--dry-run: state will NOT be written. Re-run without --dry-run to apply.");
67626
67628
  return;
67627
67629
  }
67628
67630
  if (!options.yes) {
67629
- if (!await confirmPrompt$5(`Update cdkd state with the AWS-current values shown above?`)) {
67631
+ if (!await confirmPrompt$5(`Update cdkd state with the AWS-current values shown above?`, out)) {
67630
67632
  logger.info("Aborted.");
67631
67633
  return;
67632
67634
  }
@@ -68249,18 +68251,19 @@ function deepEqualUnordered(a, b) {
68249
68251
  */
68250
68252
  async function runRevert(reports, providerRegistry, stateBackend, stateConfig, awsClients, options) {
68251
68253
  const logger = getLogger();
68254
+ const out = humanTextSink(options.json);
68252
68255
  const lockRecovery = {
68253
68256
  profile: options.profile,
68254
68257
  stateBucket: stateConfig.bucket,
68255
68258
  statePrefix: stateConfig.prefix
68256
68259
  };
68257
- printRevertPlan(reports);
68260
+ printRevertPlan(reports, out);
68258
68261
  if (options.dryRun) {
68259
68262
  logger.info("--dry-run: AWS will NOT be modified. Re-run without --dry-run to apply.");
68260
68263
  return;
68261
68264
  }
68262
68265
  if (!options.yes) {
68263
- if (!await confirmPrompt$5(`Push cdkd state values back into AWS for the resources shown above?`)) {
68266
+ if (!await confirmPrompt$5(`Push cdkd state values back into AWS for the resources shown above?`, out)) {
68264
68267
  logger.info("Aborted.");
68265
68268
  return;
68266
68269
  }
@@ -68427,13 +68430,26 @@ async function runRevert(reports, providerRegistry, stateBackend, stateConfig, a
68427
68430
  if (totalUnsupported > 0) logger.warn(`${totalUnsupported} resource(s) cannot be reverted in place — re-deploy the stack with cdkd deploy --replace, or destroy + redeploy to push the cdkd-state values back into AWS.`);
68428
68431
  if (totalFailed > 0 || totalUnsupported > 0 || totalUnresolvable > 0) throw new PartialFailureError(`Revert completed with ${totalFailed + totalUnsupported + totalUnresolvable} resource error(s) (${totalFailed} AWS update failure(s), ${totalUnsupported} update-not-supported, ${totalUnresolvable} whose dynamic reference(s) could not be resolved — those never reached provider.update; grant the caller secretsmanager:GetSecretValue / ssm:GetParameter, or fix the reference). Re-run 'cdkd drift <stack>' to see the remaining drift, then 'cdkd drift <stack> --revert' to retry.`);
68429
68432
  }
68433
+ function humanTextSink(json) {
68434
+ return json ? {
68435
+ write: (chunk) => {
68436
+ process.stderr.write(chunk);
68437
+ },
68438
+ stream: process.stderr
68439
+ } : {
68440
+ write: (chunk) => {
68441
+ process.stdout.write(chunk);
68442
+ },
68443
+ stream: process.stdout
68444
+ };
68445
+ }
68430
68446
  /**
68431
68447
  * Print the planned state mutations for `--accept` (no AWS calls). One
68432
68448
  * line per resource per property path, mirroring the human report's
68433
68449
  * +/- diff format but flipped: the value on disk after this command
68434
68450
  * runs is the `+` side.
68435
68451
  */
68436
- function printAcceptPlan(reports) {
68452
+ function printAcceptPlan(reports, out) {
68437
68453
  for (const report of reports) {
68438
68454
  const drifted = report.outcomes.flatMap((o) => matchOutcome(o, {
68439
68455
  drifted: (d) => [d],
@@ -68457,8 +68473,8 @@ function printAcceptPlan(reports) {
68457
68473
  lines.push(` ${change.path}: ${formatScalar(change.stateValue)} -> ${formatScalar(change.awsValue)}\n`);
68458
68474
  }
68459
68475
  }
68460
- process.stdout.write(plannedWrites === 0 ? `\nPlan (--accept): no accepted values will be written to cdkd state for ${report.stackName} (${report.region}) — every drifted change below is refused (the run still writes the positioned re-redaction):\n` : `\nPlan (--accept): update cdkd state for ${report.stackName} (${report.region}):\n`);
68461
- for (const line of lines) process.stdout.write(line);
68476
+ out.write(plannedWrites === 0 ? `\nPlan (--accept): no accepted values will be written to cdkd state for ${report.stackName} (${report.region}) — every drifted change below is refused (the run still writes the positioned re-redaction):\n` : `\nPlan (--accept): update cdkd state for ${report.stackName} (${report.region}):\n`);
68477
+ for (const line of lines) out.write(line);
68462
68478
  }
68463
68479
  }
68464
68480
  /**
@@ -68466,7 +68482,7 @@ function printAcceptPlan(reports) {
68466
68482
  * One line per resource summarising how many property paths will be
68467
68483
  * overwritten on the AWS side.
68468
68484
  */
68469
- function printRevertPlan(reports) {
68485
+ function printRevertPlan(reports, out) {
68470
68486
  for (const report of reports) {
68471
68487
  const drifted = report.outcomes.flatMap((o) => matchOutcome(o, {
68472
68488
  drifted: (d) => [d],
@@ -68476,31 +68492,31 @@ function printRevertPlan(reports) {
68476
68492
  skipped: () => []
68477
68493
  }));
68478
68494
  if (drifted.length === 0) continue;
68479
- process.stdout.write(`\nPlan (--revert): push cdkd state values back into AWS for ${report.stackName} (${report.region}):\n`);
68495
+ out.write(`\nPlan (--revert): push cdkd state values back into AWS for ${report.stackName} (${report.region}):\n`);
68480
68496
  for (const o of drifted) {
68481
68497
  const word = o.changes.length === 1 ? "property path" : "property paths";
68482
- process.stdout.write(` → provider.update on ${o.logicalId} (${o.resourceType}): revert ${o.changes.length} ${word}\n`);
68483
- for (const change of o.changes) process.stdout.write(` ${change.path}: ${formatScalar(change.awsValue)} -> ${formatScalar(change.stateValue)}\n`);
68498
+ out.write(` → provider.update on ${o.logicalId} (${o.resourceType}): revert ${o.changes.length} ${word}\n`);
68499
+ for (const change of o.changes) out.write(` ${change.path}: ${formatScalar(change.awsValue)} -> ${formatScalar(change.stateValue)}\n`);
68484
68500
  const stateResource = report.state.resources[o.logicalId];
68485
68501
  if (stateResource) {
68486
68502
  const preserved = findRevertPreservedTagKeys(o.changes, stateResource.observedProperties ?? stateResource.properties ?? {}, o.awsProperties);
68487
- if (o.notComparedCause !== void 0 && preserved.length > 0) process.stdout.write(` ! ${preserved.length} AWS-authored tag(s) will be preserved, but cdkd could not resolve this resource's dynamic reference(s), so their names are withheld — they come from the live readback and cannot be checked for secrets without them.\n`);
68503
+ if (o.notComparedCause !== void 0 && preserved.length > 0) out.write(` ! ${preserved.length} AWS-authored tag(s) will be preserved, but cdkd could not resolve this resource's dynamic reference(s), so their names are withheld — they come from the live readback and cannot be checked for secrets without them.\n`);
68488
68504
  else if (preserved.length > 0) {
68489
68505
  const tagWord = preserved.length === 1 ? "tag" : "tags";
68490
- process.stdout.write(` ! reverting this tag list KEEPS ${preserved.length} AWS-authored ${tagWord} the baseline does not carry:\n`);
68491
- for (const path of preserved) process.stdout.write(` ${maskSecretsInText(path, o.secrets)}\n`);
68506
+ out.write(` ! reverting this tag list KEEPS ${preserved.length} AWS-authored ${tagWord} the baseline does not carry:\n`);
68507
+ for (const path of preserved) out.write(` ${maskSecretsInText(path, o.secrets)}\n`);
68492
68508
  const othersRevert = stateResource.observedProperties === void 0 ? "" : `Every other tag reverts normally. `;
68493
- process.stdout.write(` ${othersRevert}A service may require these (ECS needs AmazonECSManaged for managed scaling); 'aws:'-prefixed keys are AWS-reserved and cannot be removed by hand.\n`);
68509
+ out.write(` ${othersRevert}A service may require these (ECS needs AmazonECSManaged for managed scaling); 'aws:'-prefixed keys are AWS-reserved and cannot be removed by hand.\n`);
68494
68510
  }
68495
68511
  }
68496
68512
  if (stateResource && stateResource.observedProperties === void 0) {
68497
68513
  const unbaselined = findRevertUnbaselinedAwsKeys(o.changes, stateResource.properties ?? {}, o.awsProperties);
68498
- if (o.notComparedCause !== void 0 && unbaselined.length > 0) process.stdout.write(` ! ${unbaselined.length} AWS-authored value(s) will be left untouched, but cdkd could not resolve this resource's dynamic reference(s), so their paths are withheld — they come from the live readback and cannot be checked for secrets without them.\n`);
68514
+ if (o.notComparedCause !== void 0 && unbaselined.length > 0) out.write(` ! ${unbaselined.length} AWS-authored value(s) will be left untouched, but cdkd could not resolve this resource's dynamic reference(s), so their paths are withheld — they come from the live readback and cannot be checked for secrets without them.\n`);
68499
68515
  else if (unbaselined.length > 0) {
68500
68516
  const word = unbaselined.length === 1 ? "value" : "values";
68501
- process.stdout.write(` ! this resource has no observed-capture baseline, so the revert pushes the raw TEMPLATE and LEAVES ${unbaselined.length} AWS-authored ${word} untouched:\n`);
68502
- for (const path of unbaselined) process.stdout.write(` ${maskSecretsInText(path, o.secrets)}\n`);
68503
- process.stdout.write(` The template does not declare these, so cdkd cannot tell an AWS-authored value from an out-of-band change and will not reset either (issue #1626). Run 'cdkd state refresh-observed ${report.stackName}' (or re-deploy) to populate observedProperties if you want them reverted too.\n`);
68517
+ out.write(` ! this resource has no observed-capture baseline, so the revert pushes the raw TEMPLATE and LEAVES ${unbaselined.length} AWS-authored ${word} untouched:\n`);
68518
+ for (const path of unbaselined) out.write(` ${maskSecretsInText(path, o.secrets)}\n`);
68519
+ out.write(` The template does not declare these, so cdkd cannot tell an AWS-authored value from an out-of-band change and will not reset either (issue #1626). Run 'cdkd state refresh-observed ${report.stackName}' (or re-deploy) to populate observedProperties if you want them reverted too.\n`);
68504
68520
  }
68505
68521
  }
68506
68522
  }
@@ -68523,10 +68539,18 @@ async function runWithConcurrency(tasks, concurrency) {
68523
68539
  })());
68524
68540
  await Promise.all(workers);
68525
68541
  }
68526
- async function confirmPrompt$5(prompt) {
68542
+ /**
68543
+ * Ask the operator to confirm a mutation.
68544
+ *
68545
+ * Issue #2230: the prompt is written to `out.stream`, not unconditionally to
68546
+ * `process.stdout` — under `--json` that stream carries the payload, and a
68547
+ * bare `[y/N] ` spliced into it is the same corruption as a status line.
68548
+ * The prompt is still SHOWN; only its stream changes.
68549
+ */
68550
+ async function confirmPrompt$5(prompt, out) {
68527
68551
  const rl = readline$1.createInterface({
68528
68552
  input: process.stdin,
68529
- output: process.stdout
68553
+ output: out.stream
68530
68554
  });
68531
68555
  try {
68532
68556
  const ans = await rl.question(`${prompt} [y/N] `);
@@ -77955,9 +77979,29 @@ async function captureObservedForImportedResources(stackState, providerRegistry,
77955
77979
  * than silently using a non-ARN string. The format MUST match
77956
77980
  * `NestedStackProvider.synthesizeArn` so an import-then-deploy cycle does
77957
77981
  * not surface phantom property changes on the nested-stack row.
77958
- */
77959
- function synthesizeNestedStackArn(region, accountId, parentStackName, logicalId) {
77960
- return `arn:cdkd-local:${region}:${accountId}:nested-stack/${parentStackName}/${logicalId}`;
77982
+ *
77983
+ * THE REGION SEGMENT IS READ BACK, so it must be the CHILD's region and must
77984
+ * not be collapsed with the parent's (issue
77985
+ * [#2055](https://github.com/go-to-k/cdkd/issues/2055)).
77986
+ * `nestedStackChildRegionFromLocalArn` in
77987
+ * [src/deployment/intrinsic-function-resolver.ts](../../deployment/intrinsic-function-resolver.ts)
77988
+ * parses this segment to learn which region to resolve a child's persisted
77989
+ * `{{resolve:...}}` output in — a secret NAME is regional, so resolving it in
77990
+ * the wrong region can answer with a DIFFERENT secret. Reading the child's own
77991
+ * state record instead is not an option: the region is part of that record's S3
77992
+ * key, so the lookup would be circular. That reader's doc block carries the
77993
+ * full rationale; this note exists because the value is produced HERE and the
77994
+ * next edit to the import walk would otherwise have nothing in front of it.
77995
+ *
77996
+ * Both call sites already pass a child-scoped value — the top-level walk passes
77997
+ * `targetRegion` (the stack being imported) and the recursive nested walk
77998
+ * passes `childRegion` — and parent and child region are necessarily equal
77999
+ * until cross-region nested stacks ship. The parameter is named `childRegion`
78000
+ * anyway, matching `NestedStackProvider.synthesizeArn`, so the requirement is
78001
+ * visible at the signature rather than only in prose.
78002
+ */
78003
+ function synthesizeNestedStackArn(childRegion, accountId, parentStackName, logicalId) {
78004
+ return `arn:cdkd-local:${childRegion}:${accountId}:nested-stack/${parentStackName}/${logicalId}`;
77961
78005
  }
77962
78006
  /**
77963
78007
  * Validate the parent template ↔ AWS CFn tree shape consistency before any
@@ -88015,4 +88059,4 @@ function buildProgram() {
88015
88059
 
88016
88060
  //#endregion
88017
88061
  export { buildProgram };
88018
- //# sourceMappingURL=program-BfK9a98r.js.map
88062
+ //# sourceMappingURL=program-COX2YwSA.js.map