@cdkd/cli 0.372.0 → 0.373.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.
Files changed (68) hide show
  1. package/dist/{ambient-client-defaults-B9_o60dB.js → ambient-client-defaults-1yRnA0Re.js} +3 -3
  2. package/dist/{ambient-client-defaults-B9_o60dB.js.map → ambient-client-defaults-1yRnA0Re.js.map} +1 -1
  3. package/dist/{asg-provider-D6gQPSZu.js → asg-provider-3uPCjYQK.js} +8 -8
  4. package/dist/{asg-provider-D6gQPSZu.js.map → asg-provider-3uPCjYQK.js.map} +1 -1
  5. package/dist/cli.js +3 -3
  6. package/dist/{created-resource-sink-CxezDoaQ.js → created-resource-sink-CBOr1ShX.js} +4 -4
  7. package/dist/{created-resource-sink-CxezDoaQ.js.map → created-resource-sink-CBOr1ShX.js.map} +1 -1
  8. package/dist/{custom-resource-runtime-BiP0vn3W.js → custom-resource-runtime-DURpNFOa.js} +6 -6
  9. package/dist/{custom-resource-runtime-BiP0vn3W.js.map → custom-resource-runtime-DURpNFOa.js.map} +1 -1
  10. package/dist/{db-associated-roles-BfvrD9UK.js → db-associated-roles-BbvtfXqW.js} +2 -2
  11. package/dist/{db-associated-roles-BfvrD9UK.js.map → db-associated-roles-BbvtfXqW.js.map} +1 -1
  12. package/dist/{delete-started-BtXSEHsh.js → delete-started-yz9plykR.js} +4 -4
  13. package/dist/{delete-started-BtXSEHsh.js.map → delete-started-yz9plykR.js.map} +1 -1
  14. package/dist/{deploy-engine-D6iEbD4R.js → deploy-engine-C12Ygjb-.js} +3416 -614
  15. package/dist/deploy-engine-C12Ygjb-.js.map +1 -0
  16. package/dist/{ec2-termination-protection-DXZyU3Q0.js → ec2-termination-protection-UZAZ2Hzv.js} +3 -3
  17. package/dist/{ec2-termination-protection-DXZyU3Q0.js.map → ec2-termination-protection-UZAZ2Hzv.js.map} +1 -1
  18. package/dist/{ecr-uri-C0JbYdmm.js → ecr-uri-C74u9FtL.js} +2 -2
  19. package/dist/{ecr-uri-C0JbYdmm.js.map → ecr-uri-C74u9FtL.js.map} +1 -1
  20. package/dist/{emr-cluster-provider-BCu1qq9J.js → emr-cluster-provider-2ezuxbz3.js} +10 -10
  21. package/dist/{emr-cluster-provider-BCu1qq9J.js.map → emr-cluster-provider-2ezuxbz3.js.map} +1 -1
  22. package/dist/{expected-bucket-owner-C2OXO5oD.js → expected-bucket-owner-0yx_Q4Hl.js} +2 -2
  23. package/dist/{expected-bucket-owner-C2OXO5oD.js.map → expected-bucket-owner-0yx_Q4Hl.js.map} +1 -1
  24. package/dist/{iam-role-provider-DFBJRsvA.js → iam-role-provider-CZtZQJRp.js} +12 -12
  25. package/dist/{iam-role-provider-DFBJRsvA.js.map → iam-role-provider-CZtZQJRp.js.map} +1 -1
  26. package/dist/{identity-read-denied-C17mECu-.js → identity-read-denied-DBsqwW85.js} +5 -5
  27. package/dist/{identity-read-denied-C17mECu-.js.map → identity-read-denied-DBsqwW85.js.map} +1 -1
  28. package/dist/{image-plan-sEIpoR31.js → image-plan-DW_fg6mx.js} +10 -9
  29. package/dist/image-plan-DW_fg6mx.js.map +1 -0
  30. package/dist/index.d.ts +25 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +5 -5
  33. package/dist/{logger-BoDS8cs5.js → logger-JtU7m4ph.js} +2 -2
  34. package/dist/{logger-BoDS8cs5.js.map → logger-JtU7m4ph.js.map} +1 -1
  35. package/dist/{neptune-provider-CL5WtULJ.js → neptune-provider-ClT-eveS.js} +9 -9
  36. package/dist/{neptune-provider-CL5WtULJ.js.map → neptune-provider-ClT-eveS.js.map} +1 -1
  37. package/dist/{program-BBXUa34K.js → program-BPrn1MhZ.js} +381 -1111
  38. package/dist/program-BPrn1MhZ.js.map +1 -0
  39. package/dist/{provider-classes-BiWcIBLc.js → provider-classes-Bi3D5zDS.js} +22 -22
  40. package/dist/{provider-classes-BiWcIBLc.js.map → provider-classes-Bi3D5zDS.js.map} +1 -1
  41. package/dist/{rds-provider--XBD_TS8.js → rds-provider-D610vnfB.js} +13 -13
  42. package/dist/{rds-provider--XBD_TS8.js.map → rds-provider-D610vnfB.js.map} +1 -1
  43. package/dist/{read-replica-apcXpKN9.js → read-replica-Br2tFu0d.js} +3 -3
  44. package/dist/{read-replica-apcXpKN9.js.map → read-replica-Br2tFu0d.js.map} +1 -1
  45. package/dist/{redacted-delete-address-S_A40Diz.js → redacted-delete-address-DVgNoeo4.js} +4 -4
  46. package/dist/{redacted-delete-address-S_A40Diz.js.map → redacted-delete-address-DVgNoeo4.js.map} +1 -1
  47. package/dist/{replacement-rules-BArdRPgU.js → replacement-rules-BoZMVFdK.js} +2166 -1663
  48. package/dist/replacement-rules-BoZMVFdK.js.map +1 -0
  49. package/dist/{resource-deadline-DWvjidOS.js → resource-deadline-BkQ9mJAk.js} +2 -2
  50. package/dist/{resource-deadline-DWvjidOS.js.map → resource-deadline-BkQ9mJAk.js.map} +1 -1
  51. package/dist/{restore-source-guard-k9BQAviV.js → restore-source-guard-BkS5tGr5.js} +4 -4
  52. package/dist/{restore-source-guard-k9BQAviV.js.map → restore-source-guard-BkS5tGr5.js.map} +1 -1
  53. package/dist/{run-cli-DEVVmR3v.js → run-cli-Ds9QnqnH.js} +2 -2
  54. package/dist/{run-cli-DEVVmR3v.js.map → run-cli-Ds9QnqnH.js.map} +1 -1
  55. package/dist/{secret-reference-immutable-0mb2D0J5.js → secret-reference-immutable-BC4abPuQ.js} +7 -7
  56. package/dist/{secret-reference-immutable-0mb2D0J5.js.map → secret-reference-immutable-BC4abPuQ.js.map} +1 -1
  57. package/dist/{settle-own-write-members-DPTK_vVK.js → settle-own-write-members-D6wzEt7f.js} +11 -98
  58. package/dist/settle-own-write-members-D6wzEt7f.js.map +1 -0
  59. package/dist/{tag-list-B19O4m3W.js → tag-list-UEcqQLzY.js} +4 -4
  60. package/dist/{tag-list-B19O4m3W.js.map → tag-list-UEcqQLzY.js.map} +1 -1
  61. package/dist/{version-Byf_RTiH.js → version-Dn0kzidt.js} +2 -2
  62. package/dist/{version-Byf_RTiH.js.map → version-Dn0kzidt.js.map} +1 -1
  63. package/package.json +1 -1
  64. package/dist/deploy-engine-D6iEbD4R.js.map +0 -1
  65. package/dist/image-plan-sEIpoR31.js.map +0 -1
  66. package/dist/program-BBXUa34K.js.map +0 -1
  67. package/dist/replacement-rules-BArdRPgU.js.map +0 -1
  68. package/dist/settle-own-write-members-DPTK_vVK.js.map +0 -1
@@ -1,30 +1,30 @@
1
- import { A as displayStackName, C as STACK_REF_MAX_CODE_POINTS, D as displayAwsMessage, E as cutMarker, F as stringifyJsonPayload, I as terminalSafe, L as truncateCodePoints, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, T as asIsMessage, _ as shellQuote, b as setPasteableVerbFlags, c as deployReplaceCommand, d as pasteableCommand, g as shellBoundedDisplay, h as quotedOrDescribed, i as SHELL_ACTIVE_WHY, j as isPasteableIdent, k as displaySafe, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, t as getCdkdVersion, u as isInertUnquoted, v as withheldTargetClause, w as UNRENDERABLE, x as SAFE_MSG_ALTERED_CHAR, y as setPasteableRunFlags } from "./version-Byf_RTiH.js";
2
- import { $ as renderStacksNoLongerSelected, $t as contextOptions, A as followContainerLogs, At as namedEnvAwsRegion, B as resolveRuntimeCodeMountPath, Bt as regionNeedsReconciliation, C as waitForRieReady, Cn as LOCK_FILE_SUFFIX, Ct as resolveContainerRegion, Dn as listAllLockKeys, Dt as warnAwsEmulatorStateSourceHint, E as SENSITIVE_ENV_KEYS, En as describeStateKey, Et as taskRoleAssumedInRealAws, F as removeContainer, Ft as legacyStateBucketFallbackRegion, G as nestedOwnerOfLogicalId, Gt as withOtherIndexRemoval, H as resolveRuntimeImage, Ht as resolveEffectiveRegion, It as namedCliRegion, J as renderAllLeftOutStageStacks, Jt as annotationMessageOptions, K as partitionTopLevel, Kt as strandedProfileCredentialsNotice, L as runDetached, Lt as rawCliRegion, M as killAndDrainContainerLogs, Mt as adoptRegionFlag, N as pickFreePort, Nt as exportInferredRegionForSdk, O as ensureDockerAvailable, On as listAllStateKeys, Ot as workloadGetsEmulatorKeysOnly, P as pullImage, Pt as foldRegionOption, Q as renderNotInAppWarning, Qt as commonOptions, Rt as reconcileExportIndexRegion, S as invokeRie, Sn as parsePositiveIntegerOption, St as realAwsException, T as DockerRunnerError, Tn as STATE_KEY_MAX_CODE_POINTS, Tt as stateRoleRecordIsEmulatorSide, U as describeStack, Ut as stackRegionResolver, V as resolveRuntimeFileExtension, Vt as regionShown, W as matchStacks, Wt as stateWithRegion, X as renderAmbiguousTargetStack, Xt as applyWaitFlagEnv, Y as renderAllNoTopLevelStacks, Yt as appOptions, Z as renderNoStackMatch, Zt as collectRepeated, _ as probeHostGatewaySupport, _n as allowUnsupportedTypesOption, _t as localAwsEmulatorCredentials, a as materializeLayerFromArn, an as noCfnFallbackOption, at as unmatchedPatterns, b as substituteImagePlaceholders, bn as validateResourceTimeouts, bt as prepareLocalLoopbackForwarder, cn as parseStackRegion, ct as resolveCdkPathToLogicalIds, d as resolveAssetCodeDirectory, dn as stackOptions, dt as activateLocalAwsAndRoleArn, en as deployOptions, et as renderUnmatchedPatternsWarning, f as architectureToPlatform, fn as stateOptions, ft as assertAwsEmulatorValue, g as HOST_GATEWAY_MIN_VERSION, gn as parseAssumeRoleToken, gt as localAwsEmulatorActive, h as layerAssetDirectory, hn as normalizeStartApiAssumeRole, ht as keepEmulatorIssuedCredentials, i as resolveInlineCodeFilePath, in as guardStackRegionOptions, it as stacksNoLongerSelected, jt as recordEmulatorDefaultRegion, k as flushStdio, kn as parseStateKey, kt as emulatorDefaultRegion, l as resolveLambdaLayers, ln as regionOption, lt as stackForConstructPath, m as copyLayerTreeLastWins, mn as effectiveAssumeRoleArn, mt as getActiveWorkloadAwsWiring$1, n as resolveTmpfsForLambda, nn as diffUpdatePolicyOptions, nt as stackMatchesPattern, o as resolveLambdaTarget, on as noLocalCustomResourcesOption, ot as buildCdkPathIndex, p as buildContainerImage$1, pn as useCdkBootstrapAssetsOption, pt as attachLocalLoopbackForwarder, q as refuseStackNameRegionCollisions, qt as writeProfileCredentialsFile, r as resolveZipImagePlan, rn as exclusivelyOption, rt as stacksForDependency, s as extractEphemeralStorageMb, sn as parseContextOptions, st as readCdkPathOrUndefined, t as resolveLocalBuildPlan$1, tn as destroyOptions, tt as selectTargetStack, u as assetPathDirs, un as skipFinalSnapshotOption, ut as stackForPathFormTarget, v as resolveHostGatewayExtraHosts, vn as parseDuration, vt as mixedModeActive, w as CONTAINER_LOG_DRAIN_TIMEOUT_MS, wn as STATE_FILE_SUFFIX, wt as setContainerRegion, x as tryResolveImageFnJoin, xn as cliArgParser, xt as profileCredentialsForWorkload, y as derivePseudoParametersFromRegion$1, yn as resourceTimeoutOptions, yt as mixedModeEmulatorOverride, z as streamLogs, zt as reconcileMarkerRegionWithLegacyDefault } from "./image-plan-sEIpoR31.js";
3
- import { $t as buildLockContentionMessage, At as resourceTypeShown, C as VALUE_NOT_SHOWN, It as maskDeep, M as remedyLogicalId, Ot as logicalIdShown, P as isMarkedNotGone, Q as runDeleteAttempt, Qt as buildForceUnlockCommand, St as isInterruptedWaitError, Zt as UNREPRODUCIBLE_LOCK_CLAUSE, at as isAwsCliLiteral, b as assertRegionMatch, bt as endCommandInterruptScope, cn as WAIT_CONDITION_SIGNAL_PREFIX, ct as renderDisableCommand, dn as withPasteableAwsProfile, en as forceQuitRecoveryClause, fn as injectiveKey, gt as readRecordedPrincipals, hn as producerRecordKey, ln as setPasteableAwsCaBundle, lt as IAM_PRINCIPAL_NAME, mn as producerCoordinateKey, nn as formatLockOperation, on as CUSTOM_RESOURCE_RESPONSE_PREFIX, rn as formatLockOwner, sn as DEFAULT_STATE_PREFIX, tn as formatLockExpiry, un as setPasteableAwsProfile, ut as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, v as DriftReadRefusedError, xt as interruptWatchListenerCount, y as RESOURCE_NOT_FOUND, yt as beginCommandInterruptScope } from "./created-resource-sink-CxezDoaQ.js";
1
+ import { A as displayStackName, C as STACK_REF_MAX_CODE_POINTS, D as displayAwsMessage, E as cutMarker, F as stringifyJsonPayload, I as terminalSafe, L as truncateCodePoints, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, T as asIsMessage, _ as shellQuote, b as setPasteableVerbFlags, c as deployReplaceCommand, d as pasteableCommand, g as shellBoundedDisplay, h as quotedOrDescribed, i as SHELL_ACTIVE_WHY, j as isPasteableIdent, k as displaySafe, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, t as getCdkdVersion, u as isInertUnquoted, v as withheldTargetClause, w as UNRENDERABLE, x as SAFE_MSG_ALTERED_CHAR, y as setPasteableRunFlags } from "./version-Dn0kzidt.js";
2
+ import { $ as renderStacksNoLongerSelected, $t as contextOptions, A as followContainerLogs, An as parseStateKey, At as namedEnvAwsRegion, B as resolveRuntimeCodeMountPath, Bt as regionNeedsReconciliation, C as waitForRieReady, Cn as parsePositiveIntegerOption, Ct as resolveContainerRegion, Dn as describeStateKey, Dt as warnAwsEmulatorStateSourceHint, E as SENSITIVE_ENV_KEYS, En as STATE_KEY_MAX_CODE_POINTS, Et as taskRoleAssumedInRealAws, F as removeContainer, Ft as legacyStateBucketFallbackRegion, G as nestedOwnerOfLogicalId, Gt as withOtherIndexRemoval, H as resolveRuntimeImage, Ht as resolveEffectiveRegion, It as namedCliRegion, J as renderAllLeftOutStageStacks, Jt as annotationMessageOptions, K as partitionTopLevel, Kt as strandedProfileCredentialsNotice, L as runDetached, Lt as rawCliRegion, M as killAndDrainContainerLogs, Mt as adoptRegionFlag, N as pickFreePort, Nt as exportInferredRegionForSdk, O as ensureDockerAvailable, On as listAllLockKeys, Ot as workloadGetsEmulatorKeysOnly, P as pullImage, Pt as foldRegionOption, Q as renderNotInAppWarning, Qt as commonOptions, Rt as reconcileExportIndexRegion, S as invokeRie, Sn as cliArgParser, St as realAwsException, T as DockerRunnerError, Tn as STATE_FILE_SUFFIX, Tt as stateRoleRecordIsEmulatorSide, U as describeStack, Ut as stackRegionResolver, V as resolveRuntimeFileExtension, Vt as regionShown, W as matchStacks, Wt as stateWithRegion, X as renderAmbiguousTargetStack, Xt as applyWaitFlagEnv, Y as renderAllNoTopLevelStacks, Yt as appOptions, Z as renderNoStackMatch, Zt as collectRepeated, _ as probeHostGatewaySupport, _n as allowUnsupportedTypesOption, _t as localAwsEmulatorCredentials, a as materializeLayerFromArn, an as noCfnFallbackOption, at as unmatchedPatterns, b as substituteImagePlaceholders, bn as resourceTimeoutOptions, bt as prepareLocalLoopbackForwarder, cn as parseStackRegion, ct as resolveCdkPathToLogicalIds, d as resolveAssetCodeDirectory, dn as stackOptions, dt as activateLocalAwsAndRoleArn, en as deployOptions, et as renderUnmatchedPatternsWarning, f as architectureToPlatform, fn as stateOptions, ft as assertAwsEmulatorValue, g as HOST_GATEWAY_MIN_VERSION, gn as parseAssumeRoleToken, gt as localAwsEmulatorActive, h as layerAssetDirectory, hn as normalizeStartApiAssumeRole, ht as keepEmulatorIssuedCredentials, i as resolveInlineCodeFilePath, in as guardStackRegionOptions, it as stacksNoLongerSelected, jt as recordEmulatorDefaultRegion, k as flushStdio, kn as listAllStateKeys, kt as emulatorDefaultRegion, l as resolveLambdaLayers, ln as regionOption, lt as stackForConstructPath, m as copyLayerTreeLastWins, mn as effectiveAssumeRoleArn, mt as getActiveWorkloadAwsWiring$1, n as resolveTmpfsForLambda, nn as diffUpdatePolicyOptions, nt as stackMatchesPattern, o as resolveLambdaTarget, on as noLocalCustomResourcesOption, ot as buildCdkPathIndex, p as buildContainerImage$1, pn as useCdkBootstrapAssetsOption, pt as attachLocalLoopbackForwarder, q as refuseStackNameRegionCollisions, qt as writeProfileCredentialsFile, r as resolveZipImagePlan, rn as exclusivelyOption, rt as stacksForDependency, s as extractEphemeralStorageMb, sn as parseContextOptions, st as readCdkPathOrUndefined, t as resolveLocalBuildPlan$1, tn as destroyOptions, tt as selectTargetStack, u as assetPathDirs, un as skipFinalSnapshotOption, ut as stackForPathFormTarget, v as resolveHostGatewayExtraHosts, vn as diffReplaceResourceOption, vt as mixedModeActive, w as CONTAINER_LOG_DRAIN_TIMEOUT_MS, wn as LOCK_FILE_SUFFIX, wt as setContainerRegion, x as tryResolveImageFnJoin, xn as validateResourceTimeouts, xt as profileCredentialsForWorkload, y as derivePseudoParametersFromRegion$1, yn as parseDuration, yt as mixedModeEmulatorOverride, z as streamLogs, zt as reconcileMarkerRegionWithLegacyDefault } from "./image-plan-DW_fg6mx.js";
3
+ import { $t as buildLockContentionMessage, At as resourceTypeShown, C as VALUE_NOT_SHOWN, It as maskDeep, M as remedyLogicalId, Ot as logicalIdShown, P as isMarkedNotGone, Q as runDeleteAttempt, Qt as buildForceUnlockCommand, St as isInterruptedWaitError, Zt as UNREPRODUCIBLE_LOCK_CLAUSE, at as isAwsCliLiteral, b as assertRegionMatch, bt as endCommandInterruptScope, cn as WAIT_CONDITION_SIGNAL_PREFIX, ct as renderDisableCommand, dn as withPasteableAwsProfile, en as forceQuitRecoveryClause, fn as injectiveKey, gt as readRecordedPrincipals, hn as producerRecordKey, ln as setPasteableAwsCaBundle, lt as IAM_PRINCIPAL_NAME, mn as producerCoordinateKey, nn as formatLockOperation, on as CUSTOM_RESOURCE_RESPONSE_PREFIX, rn as formatLockOwner, sn as DEFAULT_STATE_PREFIX, tn as formatLockExpiry, un as setPasteableAwsProfile, ut as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, v as DriftReadRefusedError, xt as interruptWatchListenerCount, y as RESOURCE_NOT_FOUND, yt as beginCommandInterruptScope } from "./created-resource-sink-CBOr1ShX.js";
4
4
  import { a as runWithStackAwsClients, i as resetAwsClients, l as s3ClientDefaults, o as setAwsClients, s as resolveS3ClientDefaults, t as AwsClients, u as setS3ClientDefaultsDebugLog } from "./aws-clients-DOkPjjAW.js";
5
- import { $ as withStackScope, A as configStringRefusal, B as generateResourceName, E as coerceCfnBoolean, F as requireConfigString, I as PATTERN_B_NAME_OPTIONS, L as PATTERN_B_NAME_PROPERTIES, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, Q as withSkipPrefix, R as PATTERN_B_RESOURCE_TYPES, S as explicitNamePropertyFor, X as isNameGeneration, a as reserveStdoutForPayload, f as isAwsAuthoredFailure, i as releaseStdoutForPayload, m as verboseAwareText, n as getLogger, p as safeStringify, r as isStdoutReservedForPayload, s as runStackBuffered, u as describeAwsFailure, y as getLiveRenderer, z as derivesPatternBName } from "./logger-BoDS8cs5.js";
6
- import { A as stripControlChars, B as retryClassificationText, F as isAmbiguousOutcomeError, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, Q as AccountIdUnavailableError, R as isRetryableTransientError, U as isThrottlingError, V as THROTTLING_ERROR_NAMES, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, _ as ResourceUpdateNotSupportedError, a as normalizeAwsError, at as ProvisioningError, ct as SynthesisError, et as CdkdError, g as PartialFailureError, h as NestedStackChildDirectDestroyError, i as credentialFingerprint, j as stripForDisplay, k as escapeRegExp, l as withErrorHandling, n as ambientCredentialConfig, o as formatError, ot as ResourceTimeoutError, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, rt as LocalInvokeBuildError$1, s as handleError, st as StateError, t as ambientClientDefaults, tt as DeployCancelledError, u as LocalStartServiceError, v as StackHasActiveImportsError, y as StackTerminationProtectionError, z as isTransientServerError } from "./ambient-client-defaults-B9_o60dB.js";
5
+ import { $ as withStackScope, A as configStringRefusal, B as generateResourceName, E as coerceCfnBoolean, F as requireConfigString, I as PATTERN_B_NAME_OPTIONS, L as PATTERN_B_NAME_PROPERTIES, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, Q as withSkipPrefix, R as PATTERN_B_RESOURCE_TYPES, S as explicitNamePropertyFor, X as isNameGeneration, a as reserveStdoutForPayload, f as isAwsAuthoredFailure, i as releaseStdoutForPayload, m as verboseAwareText, n as getLogger, p as safeStringify, r as isStdoutReservedForPayload, s as runStackBuffered, u as describeAwsFailure, y as getLiveRenderer, z as derivesPatternBName } from "./logger-JtU7m4ph.js";
6
+ import { A as stripControlChars, B as retryClassificationText, F as isAmbiguousOutcomeError, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, Q as AccountIdUnavailableError, R as isRetryableTransientError, U as isThrottlingError, V as THROTTLING_ERROR_NAMES, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, _ as ResourceUpdateNotSupportedError, a as normalizeAwsError, at as ProvisioningError, ct as SynthesisError, et as CdkdError, g as PartialFailureError, h as NestedStackChildDirectDestroyError, i as credentialFingerprint, j as stripForDisplay, k as escapeRegExp, l as withErrorHandling, n as ambientCredentialConfig, o as formatError, ot as ResourceTimeoutError, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, rt as LocalInvokeBuildError$1, s as handleError, st as StateError, t as ambientClientDefaults, tt as DeployCancelledError, u as LocalStartServiceError, v as StackHasActiveImportsError, y as StackTerminationProtectionError, z as isTransientServerError } from "./ambient-client-defaults-1yRnA0Re.js";
7
7
  import { a as getAssumedRoleCredentials, c as setAssumedRoleCredentials, h as formatAuthority, l as setAwsEndpointOverrideSource, m as runInStackAwsScope, n as awsClientDefaults, r as awsEndpointOverrideActive, s as runWithRealAws } from "./aws-client-defaults-DAebi99J.js";
8
- import { $ as uploadCfnTemplate, A as runDockerForeground, B as resolveCaptureObservedState, C as finchSecretArgvRefusal, D as isMalformedEnvKey, E as isDockerClientEnvKey, F as getDefaultStateBucketName, G as resolveUpdatePolicy, H as resolveStateBucketWithDefault, I as getLegacyStateBucketName, J as warnDeprecatedNoPrefixCliFlag, K as resolveUseCdkBootstrapAssets, L as loadCdkJson, M as abortInFlightMultipartUploads, N as Synthesizer, O as formatDockerLoginError, P as synthesisStatusMessage, Q as findLargeInlineResources, R as resolveApp, S as dockerSpawnEnvWithSensitive, T as warnFinchArgvExposure, U as resolveStateBucketWithDefaultAndSource, V as resolveSkipPrefix, W as resolveStateBucketWithSource, X as CFN_TEMPLATE_URL_LIMIT, Y as CFN_TEMPLATE_BODY_LIMIT, Z as MIGRATE_TMP_PREFIX, _ as describeDockerExecFailure, at as legacyPlanAssetCount, b as redactedDockerCause, ct as CdkToolkitBucketMissingError, d as isLockInfoExpired, et as refuseFailedLookups, f as AssetPublisher, h as resolveDockerContextDirectory, i as mergeDeclaredEntries, it as createLegacyAssetParameterBinder, j as runDockerStreaming, k as getDockerCmd, l as DagBuilder, lt as processStackMessages, m as buildDockerImage, n as declaredStringList, nt as StageLoadError, ot as predictedAutoCreatedAssetMode, p as WorkGraph, q as stateBucketExistenceConfirmed, r as inlinePoliciesAreDeclared, rt as bindLegacyStackAssetParameters, s as stringListIsDeclared, st as prepareLegacyStackAssets, t as declaredInlinePolicies, tt as AssemblyReader, u as LockManager, ut as setChildProcessAwsEnv, v as describeDockerFailure, w as partitionSensitiveEnv, x as redactDockerArgvValues, y as redactedCause, z as resolveAutoAssetStorage } from "./settle-own-write-members-DPTK_vVK.js";
9
- import { $a as journaledOrphanPrintingBag, $c as withSecretPhysicalIdsMaskedInState, $d as resolveAssemblyPath, $i as resourcesNamingDeclaredParameter, $l as malformedOutputsWarning, $n as recordDisplacedSkips, $o as wouldReturnToSdkProvider, $r as siblingRecordedSgRuleIds, $s as callerEnvCredentials, $u as findNestedTemplateTreeDefect, A as deferredServiceTokenWarning, Aa as withPreviousPolicies, Ac as carriesFetchableDynamicReference, Ad as ensureAssetStorage, Ai as recheckFailedPlan, Al as refuseMalformedResourceEntriesForImport, An as refuseRefactorMarker, Ao as revertStackRecordsView, Ar as findRefactorHints, As as getReadOnlyPropertyPaths, Au as providerReplacementOldDeleted, B as readProtection, Ba as bold, Bc as shownType, Bi as orphanNeedsIdentity, Bl as refuseMalformedResourcePropertiesForOrphan, Bn as macWriteOnlyKeys, Bo as lambdaPermissionMatchesDeclared, Br as looselyEqual, Bu as rebuildClientForBucketRegion, C as warnLegacySpelling, Ca as supersededHeldByOtherTypeWarning, Cc as keepHeldTokenProvenance, Cd as getDockerImageBySourceHash, Cl as malformedLocalResourcesWarning, Cn as NestedCleanupQueue, Cr as noEchoMacVerdict, Cu as findHandledUnwrittenCreateOnly, D as slashedSsmNameHealPendingNote, Dc as withoutVersionAttestation, Di as isJournaledOrphan, Dl as refuseMalformedResourceEntries, Dn as readRefactorMarkerOnce, Dr as formatChangeCounts, Ds as deleteLeftInPlace, Du as NO_CC_HANDLERS_REASON, E as slashedSsmNameHealNote, Ea as withoutSuperseded, Ec as recordedReferenceRegions, Ei as demoteSupersededOrphans, El as refuseMalformedResourceAttributesForOrphan, En as readRefactorMarker, Er as findDestructiveChanges, Es as deleteIndeterminateGuards, F as recordedProtectionEvidence, Fa as sgCidrKey, Fc as INTRINSIC_KEYS, Fd as parseBootstrapMarker, Fi as attemptUsesCompletedCreate, Fl as malformedDriftResourcePropertiesWarning, Fn as removeSignalReceiverNamed, Fr as changedReferenceInDiff, Fs as isSelectOutOfBounds, Fu as S3StateBackend, Ga as yellow, Gd as nullPrototypeRecord, Gi as retiredNameGenerationsAfter, Gl as malformedOrphansWarning, Gn as pendingRequestCount, Gr as referencedLogicalIds, Gs as assertFlagRoleArn, Gu as isAccessDenied, Ha as gray, Hc as isStatefulRecreateTargetForReplace, Hd as defineOwnKey, Hi as nameGenerationHighWaterOf, Hl as UNREADABLE_ORPHANS_CONTAINER_ROW, Ho as policyDocumentMatchesDeclared, Hr as parseMappingFile, Hs as producerLookupOver, Hu as CrossPrefixScanCache, I as recordedProtectionNote, Ia as sgProtocolKey, Ic as LEGACY_HANDLE_HEAL_REASON, Id as readBootstrapMarkerBody, Ii as readsRegeneratingSecret, Il as malformedResourcePropertiesWarning, In as settleStackTagChildRuns, Ir as changedReferencePath, Is as isAlwaysLiveAttribute, Iu as splitImportedOps, Ja as noEchoExactEchoLeavesOf, Jl as repairMalformedOrphansForReadOnly, Jn as displacedOpClause, Jr as undeclaredGrantSiblingMembers, Js as isIamRoleArn, Ju as withStackInstanceIdWithheld, Ka as noEchoAttributeNamesOf, Kd as ownValue, Ki as retiredNameGenerationsLeaving, Kl as refuseMalformedOrphans, Kn as resolvePendingCloudControlRequests, Ko as verbatimEchoDriftKeys, Kr as siblingOwnedRevertDesired, Ks as assertSendableRoleArn, Ku as isNotImplemented, L as PROTECTION_PROPERTY_BY_TYPE, Ld as validateAssetBucketName, Li as segmentCleanupOptions, Ll as refuseMalformedResourcePropertiesForDestroy, Lo as declaredMemberDocument, Lr as changedReferenceReason, Ls as poisonRenderedSpellingsCollidingIn, Lt as tagsMatchDeclared, Lu as readOnlyStateVersionOf, M as serviceTokenBlockingReason, Mc as carriesDynamicReference, Md as assertAssetBucketRegion, Mi as replacementNeverSwapped, Ml as refuseMalformedResourceEntriesForOrphan, Mn as updateRefactorMarker, Mo as withStackRecords, Mr as movedToHint, N as diffSecurity, Na as cfnIngressPortValue, Nc as keepsSecretReferenceToken, Nd as isCrossRegionRedirect, Ni as IMPLICIT_DELETE_DEPENDENCIES, Nl as repairMalformedResourceEntriesForReadOnly, Nn as deleteSignalReceiver, Nr as rollbackOrphanIds, Ns as DiffCalculator, Nt as declaredTagsReadback, O as scanActiveConsumers, Oa as snapshotSegmentSurvivors, Oc as getAccountInfo, Oi as isReplacementOrphan, Ol as refuseMalformedResourceEntriesForDeploy, On as refactorMarkerMovesOf, Oo as destroyStackRecordsView, Or as formatDestructiveChange, Os as deleteSkipReason, Ou as hasNoCloudControlHandlers, P as isScrutinizedProperty, Pa as recordedSgRuleId, Pc as withSharedDrainBudget, Pd as getBootstrapMarkerKey, Pi as computeImplicitDeleteEdges, Pl as unreadableResourceEntries, Pn as isReceiver, Po as LAMBDA_PERMISSION_STATEMENT_KEYS, Pr as withMovedTo, Ps as IntrinsicFunctionResolver, Pu as TemplateParser, Q as streamPolicyMatchesDeclared, Qa as completedReplayEntries, Qc as secretSegmentsOfState, Qd as renderAssemblyPathEscape, Qi as reachableDivergentParameters, Ql as malformedOutputsRefusalMessage, Qn as nestedChildStackName$1, Qo as isCustomResource, Qs as applyCallerIdentityCredentials, R as isProtectionValueActive, Ra as canonicalizeIpv4Cidr, Rd as validateContainerRepoName, Ri as removeProtectionTypeList, Rl as refuseMalformedResourcePropertiesForDrift, Rn as childStackTags, Ro as declaredPolicyDocument, Rr as differingRemedy, Rs as stackIdTailOf, Ru as hasReasonlessBaselineRefusal, S as refusePendingMovesOut, Sa as supersededDependentsFirst, Sd as AssetManifestLoader, Si as withCreateTokenLedger, Sl as malformedLocalResourceEntriesWarning, Sr as noEchoMacParametersOf, Ss as CloudControlProvider, Su as findActionableSdkUnwired, T as slashedSsmNameHealAdoptedNote, Ta as supersededResourcesOf, Tc as recordedOutputReferenceRegions, Ti as seedsDeleteFirstGuard, Tl as malformedScrubResourceEntriesRefusalMessage, Tn as recordRetainedForReadoption, Tr as constructPathOf$1, Ts as UNSPECIFIED_SKIP_REASON, Tu as unwrittenCreateOnlyReplacement, Ua as green, Uc as isStatefulRecreateTargetSync, Ud as hasOwnKey, Ui as nameScopeOf, Ul as hasReadableOrphans, Un as formatResourceLine, Uo as reReadUntilSettled, Ur as propertiesChangedReason, Us as refuseUnreadableCdkCrossAccountRefs, Uu as applyCrossPrefixScan, Va as cyan, Vc as MULTI_REGION_RECREATE_BLOCKED_TYPES, Vi as nameGenerationCarriedFrom, Vl as repairMalformedResourcePropertiesForReadOnly, Vn as readsOnlyNoEchoParameters, Vo as memberReadFailure, Vr as mappingPairs, Vs as resolveDynamicReferences, Vu as CrossPrefixReadError, Wa as red, Wc as renderStatefulReason, Wd as hasPlainPrototype, Wi as retiredAfterRollback, Wl as malformedOrphansRefusalMessage, Wn as startForceQuitFlushes, Wr as proposeRenames, Ws as applyRoleArnIfSet, Wu as crossPrefixDeniedWarning, Xa as withAttemptedItemsMasked, Xd as displayAssemblyPath, Xi as computeParameterTaint, Xl as malformedExportSourceWarning, Xn as dropSettledNestedJournals, Xo as ProviderRegistry, Xr as sgRuleOwnershipIdentity, Xs as sendableAssumeRoleCommand, Xu as isSensitiveAttributeName, Ya as noEchoParameterNamesOf, Yc as displayPhysicalId, Yd as describeFileReadFailure, Yi as inheritProducerRegions, Yl as malformedExportNamesWarning, Yn as displacedPhysicalIdShown, Yo as CC_BROKEN_REASON, Yr as recordedRuleIdOf, Ys as parseIamRoleArn, Yu as isSecretValuedAttribute, Za as createReadOnlyAttributeHealerFactory, Zc as secretPhysicalIdSegment, Zi as namesAnyDeclaredParameter, Zl as malformedLocalOutputsWarning, Zo as ccBrokenReason, Zr as sgSiblingDecidedById, Zs as AWS_CREDENTIAL_ENV_KEYS, _ as readRecordedConditionVerdicts, _a as maskingRetryLogger, _c as cfnRefValueFromPhysicalId, _i as findUpdatePolicyReplacementRefusals, _l as refuseMalformedOrphansForOrphan, _o as refusesFinalSnapshot, _r as DeploymentEventsStore, _s as localCustomResourceCommand, _u as STATE_RESOURCES_MALFORMED, a as mergeNoChangeOutputs, aa as secretSafeKeyDisplay, ac as withoutLapsedStaleShapeStamp, ai as earlyDeleteWhen, al as maskedInputProof, ar as withNestedStackContext, as as applyCustomResourceResponseExpiration, au as refuseDivergentRecordRegionForDestroy, b as pendingMovesOutOf, ba as isSupersededResourceRecord, bc as lacksRecordedRefArn, bi as ledgerForStack, bl as unreadableOrphanRecords, bo as buildFinalSnapshotIdentifier, br as createNoEchoValueMacs, bs as withCustomResourceStack, bu as hasReadableOutputs, c as nestedSsmNameRowNote, ca as exportNameSecretExposure, ci as recordAfterRollbackUpdate, cl as maskedPropertyFingerprint, co as stateSecretNameNeedles, cr as dropFailedHint, cs as TemplateNoEchoReresolver, cu as malformedStateRefusalMessage, d as makeCanonicalizePropertiesFn, da as collectDeclaredOutputNames, di as calculateResourceDrift, dl as malformedOrphanRecordsRefusalMessage, do as ATOMIC_FINAL_SNAPSHOT_TYPES, dr as loadJournaledOrphans, du as refuseMalformedResourcesForExport, ea as WITHHELD_NAME_DISPLAY, ec as envCredentialsAreAssumedRole, ed as isAbsoluteAssetPath, el as getSettledWriteOnlyPropertyPaths, eo as maskEventTextWithBoundBags, es as WaitConditionSignalStore, f as readDbInstanceAvailabilityZone, fa as collectPublishedOutputNames, fd as buildAssetRedirectMap, fi as equalModuloMarkedMask, fl as malformedOrphanRecordsWarning, fo as PRE_DELETE_SNAPSHOT_TYPES, fr as sameJournaledOrphans, fs as withPrintingSecrets, fu as refuseMalformedState, g as parentSuppliedValues, ga as DEFAULT_RESOURCE_WARN_AFTER_MS, gc as AWS_NO_VALUE, gi as updatePartialReason, gl as refuseMalformedOrphanRecordsForDestroy, go as isFinalSnapshotError, gr as DeploymentEventsReader, gs as customResourcesRunWithoutApp, gu as withheldAccountClause, h as conditionInputsFrom, ha as DEFAULT_RESOURCE_TIMEOUT_MS, hc as parameterTypeMayLoseSecretIdentity, hi as updatePartialMessage, hl as refuseMalformedOrphanRecords, ho as effectiveDeletionPolicy, hr as planOrphanAdoption, hs as customResourcesFailedWithoutApp, hu as accountArgs, i as keptWholeReasonText, ia as secretBearingStateKeyWarning, ic as regionLessSecretName, ii as PLANNED_EARLY_DELETE_CONSEQUENCE, il as parameterInputsFor, io as secretNamePrintingBags, ir as getCurrentNestedStackContext, is as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, iu as STATE_REGION_DIVERGED, j as findServiceTokenRefusals, ja as findNestedStackTypeChanges, jc as isNamelessDynamicReferenceError, jd as buildDenyExternalAccessPolicy, ji as recordUnderIdIsNotOwn, jl as refuseMalformedResourceEntriesForImportSave, jn as sameMove, jr as hintSidesOf, js as isWaitAbandonedError, k as inRunStackKey, ka as resolveReplacementOldType, kc as isImpossibleEmptyStoredAttribute, kd as AssetModeResolver, ki as planFailedOps, kl as refuseMalformedResourceEntriesForDestroy, kn as refactorMarkerRefusalMessage, kr as orphanedLogicalIds, ku as PROPERTY_COVERAGE_BY_TYPE, l as crossStackOutputProvenanceSource, la as isWholeDynamicReferenceValue, ld as decodeListingKey, li as settleUnsettledPrevious, ll as deployRefusesOrphanRowsReason, lo as storedSecretNameNeedles, lr as isHandledOrphan, ls as readsNoEchoDeleteValues, lu as refuseMalformedResourcesForDeploy, m as conditionFingerprint, ma as bindingSkippedOutputs, mc as isUnboundTemplateParameter, md as createLazyAssetModeContext, mi as undeclaredEmptyObservedKeys, ml as previewableOrphanRecords, mo as ccRoutedInstanceTakesNoSnapshot, mr as makeSiblingClaimReader, mu as JSON_LISTING_HOLE_VALUE, n as applyStackTagsToTemplate, na as exportAliasCollisionScrubWarning, nc as classifyReplaySecretRegion, nd as renderNestedTemplateTreeDefect, ni as replayRollback, nl as tryGetTopLevelWriteOnlyProperties, no as orphanRecordsPrintingBag, nr as withNestedRevertRun, nu as refuseMalformedOutputsForDestroy, o as checkNestedSsmNames, oa as carriedExportAliasExposure, oc as isUnexposedRecordedIdentity, od as ssmResolvedValueType, oi as earlyDeletedOld, oo as secretNamedRecordNeedles, or as deleteJournaledOrphans, os as customResourceResponseExpirationWarning, ou as malformedRenderedContainersWarning, p as healZonelessDbInstanceRecords, pa as isExportAliasCollision, pc as coerceParameterTypedValue, pd as createAssetRedirectResolver, pi as equalModuloMask, pl as malformedOrphanRowsKeptWarning, po as ccRoutedFinalSnapshotError, pr as makeForeignHolderScan, ps as NO_LOCAL_CUSTOM_RESOURCES_FLAG, pu as repairMalformedResourcesForReadOnly, q as readStreamPolicy, qa as noEchoComparisonForTemplate, qi as withNameGenerationReached, ql as refuseMalformedOrphansForDestroy, qn as NESTED_PENDING_PARENT_REASON, qr as stripSiblingOwnedParentMembers, qs as explicitRoleArnOrThrow, qu as stackInstanceIdOf, r as isSecretBearingReferenceString, ra as secretBearing, rc as producerRegionsFromState, rd as templateIdentity, ri as DELETED_RESOURCE_REMEDY, rl as maskedPropertyFingerprintsOf, ro as secretNamePrintingBag, rr as collectNestedChildUnaddressed, rs as isSignalKey, ru as repairMalformedOutputsForReadOnly, s as nestedSsmNameDeferredNote, sa as exportNameNoEchoParameters, sd as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, si as buildReadCurrentStateContext, sl as declaresNoEcho, so as stackSecretNamesMasker, sr as dropFailedCommands, su as malformedResourcesWarning, t as DeployEngine, ta as displayTextOrWithheld, tc as classifyRecordedSecretRegion, td as listNestedTemplateRows, tf as resolveBucketRegion, ti as replayFailedOperations, tl as getTopLevelKeysHoldingUnreadableCreateOnly, to as namingSecretsWithRecordedNoEcho, tr as revertedNestedRowIds, ts as classifyHandleUrl, tu as refuseMalformedOutputs, u as inheritedProvenanceForChildDiff, ua as noEchoParameterValueSeed, ui as withUnprovenUnsettled, ul as isReadableOrphanRecord, uo as extractDeploymentEventError, ur as journaledOrphanLines, us as isCustomResourceType$1, uu as refuseMalformedResourcesForDestroy, v as childTemplateLoader, va as deleteSupersededEntry, vc as isStalePlaceholderArnAttribute, vd as loadPublishableAssetManifest, vi as replacementCreateRoutesToCloudControl, vl as repairMalformedOrphanRecordsForReadOnly, vo as unsupportedFinalSnapshotError, vr as crossStackReadsForPartialSave, vu as UNREADABLE_RESOURCES_MAP_ROW, w as healSlashedSsmParameterNames, wa as supersededHolderOf, wi as planRollback, wl as malformedResourceEntriesWarning, wn as keptForRetainedRecord, wr as noEchoValueMacsOf, ws as RollbackInlinePolicyWriters, x as pendingMovesRefusalMessage, xa as supersededAfterRollback, xc as lacksRecordedTableArn, xd as rewriteTemplateAssetReferences, xl as isReadableResourceEntry, xr as noEchoMacBinding, xu as hasReadableResources, y as hasPendingMovesOut, ya as holdsSupersededResources, yc as refStateLookupFromResource, yl as unpreviewableOrphanRecords, yo as createPreDeleteFinalSnapshot, yr as NOECHO_MAC_KEY_ALIAS, ys as setLocalCustomResourceRuntimeEnabled, yu as displayLogicalId, z as perType, za as canonicalizeIpProtocolValue, zc as findReplacedReadersOfRecreateTargets, zd as BOOTSTRAP_MARKER_PREFIX, zi as removeProtectionTypes, zl as refuseMalformedResourcePropertiesForExport, zn as literalRowTags, zo as efsPolicyMatchesDeclared, zr as isPairableType, zu as hasUnverifiableParameterRefusal } from "./deploy-engine-D6iEbD4R.js";
8
+ import { $ as createLegacyAssetParameterBinder, A as runDockerForeground, B as resolveCaptureObservedState, C as finchSecretArgvRefusal, D as isMalformedEnvKey, E as isDockerClientEnvKey, F as getDefaultStateBucketName, G as resolveUpdatePolicy, H as resolveStateBucketWithDefault, I as getLegacyStateBucketName, J as warnDeprecatedNoPrefixCliFlag, K as resolveUseCdkBootstrapAssets, L as loadCdkJson, M as abortInFlightMultipartUploads, N as Synthesizer, O as formatDockerLoginError, P as synthesisStatusMessage, Q as bindLegacyStackAssetParameters, R as resolveApp, S as dockerSpawnEnvWithSensitive, T as warnFinchArgvExposure, U as resolveStateBucketWithDefaultAndSource, V as resolveSkipPrefix, W as resolveStateBucketWithSource, X as AssemblyReader, Y as refuseFailedLookups, Z as StageLoadError, _ as describeDockerExecFailure, at as setChildProcessAwsEnv, b as redactedDockerCause, d as isLockInfoExpired, et as legacyPlanAssetCount, f as AssetPublisher, h as resolveDockerContextDirectory, i as mergeDeclaredEntries, it as processStackMessages, j as runDockerStreaming, k as getDockerCmd, l as DagBuilder, m as buildDockerImage, n as declaredStringList, nt as prepareLegacyStackAssets, p as WorkGraph, q as stateBucketExistenceConfirmed, r as inlinePoliciesAreDeclared, rt as CdkToolkitBucketMissingError, s as stringListIsDeclared, t as declaredInlinePolicies, tt as predictedAutoCreatedAssetMode, u as LockManager, v as describeDockerFailure, w as partitionSensitiveEnv, x as redactDockerArgvValues, y as redactedCause, z as resolveAutoAssetStorage } from "./settle-own-write-members-D6wzEt7f.js";
9
+ import { $ as slashedSsmNameHealPendingNote, $a as supersededHolderOf, $d as loadPublishableAssetManifest, $i as seedsDeleteFirstGuard, $l as malformedLocalResourceEntriesWarning, $n as recordRetainedForReadoption, $r as hintSidesOf, $s as RollbackInlinePolicyWriters, $u as findActionableSdkUnwired, A as parseCfnTemplateWithFormat, Aa as displayTextOrWithheld, Ac as classifyRecordedSecretRegion, Ad as findNestedTemplateTreeDefect, Af as describeFileReadFailure, Ai as replayRollback, Al as getSettledWriteOnlyPropertyPaths, Ao as namingSecretsWithRecordedNoEcho, Ar as withNestedRevertRun, As as classifyHandleUrl, Au as malformedOutputsWarning, B as conditionFingerprint, Ba as collectDeclaredOutputNames, Bd as findLargeInlineResources, Bi as equalModuloMarkedMask, Bl as deployRefusesOrphanRowsReason, Bo as ATOMIC_FINAL_SNAPSHOT_TYPES, Br as sameJournaledOrphans, Bu as refuseMalformedResourcesForDeploy, C as templateMixesDynamicReference, Cc as isIamRoleArn, Cd as isNotImplemented, Cf as defineOwnKey, Ci as recordedRuleIdOf, Co as noEchoParameterNamesOf, Cr as displacedPhysicalIdShown, Cu as refuseMalformedOrphans, D as getCloudFormationResourceTree, Da as reachableDivergentParameters, Dc as applyCallerIdentityCredentials, Dd as isSensitiveAttributeName, Df as ownValue, Di as siblingRecordedSgRuleIds, Dl as secretPhysicalIdSegment, Do as completedReplayEntries, Dr as recordDisplacedSkips, Ds as isCustomResource, Du as malformedExportSourceWarning, E as findReplacedCfnResources, Ea as namesAnyDeclaredParameter, Ec as AWS_CREDENTIAL_ENV_KEYS, Ed as isSecretValuedAttribute, Ef as nullPrototypeRecord, Eo as createReadOnlyAttributeHealerFactory, Er as nestedChildStackName$1, Es as ccBrokenReason, Et as streamPolicyMatchesDeclared, Eu as malformedExportNamesWarning, F as promptYesNo, Fa as carriedExportAliasExposure, Fc as isUnexposedRecordedIdentity, Fi as buildReadCurrentStateContext, Fl as parameterInputsFor, Fo as secretNamedRecordNeedles, Fr as dropFailedCommands, Fs as customResourceResponseExpirationWarning, Fu as STATE_REGION_DIVERGED, G as hasPendingMovesOut, Ga as DEFAULT_RESOURCE_WARN_AFTER_MS, Gc as AWS_NO_VALUE, Gi as findUpdatePolicyReplacementRefusals, Gl as previewableOrphanRecords, Go as isFinalSnapshotError, Gr as DeploymentEventsStore, Gs as customResourcesRunWithoutApp, Gu as JSON_LISTING_HOLE_VALUE, H as parentSuppliedValues, Ha as isExportAliasCollision, Hc as coerceParameterTypedValue, Hd as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Hi as undeclaredEmptyObservedKeys, Hl as malformedOrphanRecordsRefusalMessage, Ho as ccRoutedFinalSnapshotError, Hr as makeSiblingClaimReader, Hs as NO_LOCAL_CUSTOM_RESOURCES_FLAG, Hu as refuseMalformedResourcesForExport, I as serializePrompt, Ia as exportNameNoEchoParameters, If as resolveBucketRegion, Ii as recordAfterRollbackUpdate, Il as maskedInputProof, Io as stackSecretNamesMasker, Ir as dropFailedHint, Iu as refuseDivergentRecordRegionForDestroy, J as refusePendingMovesOut, Ja as holdsSupersededResources, Jc as refStateLookupFromResource, Jd as createAssetRedirectResolver, Ji as ledgerForStack, Jl as refuseMalformedOrphansForOrphan, Jo as createPreDeleteFinalSnapshot, Jr as findDestructiveChanges, Js as setLocalCustomResourceRuntimeEnabled, Ju as STATE_RESOURCES_MALFORMED, K as pendingMovesOutOf, Ka as maskingRetryLogger, Kc as cfnRefValueFromPhysicalId, Ki as replacementCreateRoutesToCloudControl, Kl as refuseMalformedOrphanRecords, Ko as refusesFinalSnapshot, Kr as crossStackReadsForPartialSave, Ks as localCustomResourceCommand, Ku as accountArgs, L as NESTED_STACK_RESOURCE_TYPE$1, La as exportNameSecretExposure, Ld as ssmResolvedValueType, Li as settleUnsettledPrevious, Lo as stateSecretNameNeedles, Lr as isHandledOrphan, Ls as TemplateNoEchoReresolver, Lu as malformedRenderedContainersWarning, M as SUPERSEDED_COPY_HINT, Ma as secretBearing, Mc as producerRegionsFromState, Md as listNestedTemplateRows, Mi as PLANNED_EARLY_DELETE_CONSEQUENCE, Ml as tryGetTopLevelWriteOnlyProperties, Mo as secretNamePrintingBag, Mr as getCurrentNestedStackContext, Ms as isSignalKey, Mu as refuseMalformedOutputs, N as cfnFailureText, Na as secretBearingStateKeyWarning, Nc as regionLessSecretName, Nd as renderNestedTemplateTreeDefect, Nf as renderAssemblyPathEscape, Ni as earlyDeleteWhen, Nl as publicReferencesOf, No as secretNamePrintingBags, Nr as withNestedStackContext, Ns as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, Nu as refuseMalformedOutputsForDestroy, O as tryGetCloudFormationResourceMap, Oa as resourcesNamingDeclaredParameter, Oc as callerEnvCredentials, Ol as secretSegmentsOfState, Oo as journaledOrphanPrintingBag, Os as wouldReturnToSdkProvider, Ou as malformedLocalOutputsWarning, P as confirmOrRefuse, Pa as secretSafeKeyDisplay, Pc as withoutLapsedStaleShapeStamp, Pd as templateIdentity, Pf as resolveAssemblyPath, Pi as earlyDeletedOld, Pl as maskedPropertyFingerprintsOf, Pr as deleteJournaledOrphans, Ps as applyCustomResourceResponseExpiration, Pu as repairMalformedOutputsForReadOnly, Q as slashedSsmNameHealNote, Qa as supersededHeldByOtherTypeWarning, Qc as keepHeldTokenProvenance, Qi as planRollback, Ql as isReadableResourceEntry, Qn as keptForRetainedRecord, Qr as findRefactorHints, Qu as hasReadableResources, R as readDbInstanceAvailabilityZone, Ra as isWholeDynamicReferenceValue, Rd as CFN_TEMPLATE_BODY_LIMIT, Ri as withUnprovenUnsettled, Rl as declaresNoEcho, Ro as storedSecretNameNeedles, Rr as journaledOrphanLines, Rs as readsNoEchoDeleteValues, Ru as malformedResourcesWarning, S as taintedNamesOf, Sa as withNameGenerationReached, Sc as explicitRoleArnOrThrow, Sd as isAccessDenied, Si as undeclaredGrantSiblingMembers, So as noEchoComparisonForTemplate, Sr as displacedOpClause, Su as malformedOrphansWarning, T as prepareCloudFormationStackRetirement, Ta as computeParameterTaint, Tc as sendableAssumeRoleCommand, Td as withStackInstanceIdWithheld, Tf as hasPlainPrototype, Ti as sgSiblingDecidedById, Tl as displayPhysicalId, To as noEchoExactEchoLeavesOf, Ts as ProviderRegistry, Tu as repairMalformedOrphansForReadOnly, U as readRecordedConditionVerdicts, Ua as bindingSkippedOutputs, Uc as isUnboundTemplateParameter, Ui as updatePartialMessage, Ul as malformedOrphanRecordsWarning, Uo as ccRoutedInstanceTakesNoSnapshot, Ur as planOrphanAdoption, Uu as refuseMalformedState, V as conditionInputsFrom, Va as collectPublishedOutputNames, Vd as uploadCfnTemplate, Vi as equalModuloMask, Vl as isReadableOrphanRecord, Vo as PRE_DELETE_SNAPSHOT_TYPES, Vr as makeForeignHolderScan, Vs as withPrintingSecrets, Vu as refuseMalformedResourcesForDestroy, W as childTemplateLoader, Wa as DEFAULT_RESOURCE_TIMEOUT_MS, Wc as parameterTypeMayLoseSecretIdentity, Wd as decodeListingKey, Wi as updatePartialReason, Wl as malformedOrphanRowsKeptWarning, Wo as effectiveDeletionPolicy, Wr as DeploymentEventsReader, Ws as customResourcesFailedWithoutApp, Wu as repairMalformedResourcesForReadOnly, X as healSlashedSsmParameterNames, Xa as supersededAfterRollback, Xc as lacksRecordedTableArn, Xi as withCreateTokenLedger, Xl as unpreviewableOrphanRecords, Xr as formatDestructiveChange, Xu as displayLogicalId, Y as warnLegacySpelling, Ya as isSupersededResourceRecord, Yc as lacksRecordedRefArn, Yd as createLazyAssetModeContext, Yl as repairMalformedOrphanRecordsForReadOnly, Yo as buildFinalSnapshotIdentifier, Yr as formatChangeCounts, Ys as withCustomResourceStack, Yu as UNREADABLE_RESOURCES_MAP_ROW, Z as slashedSsmNameHealAdoptedNote, Za as supersededDependentsFirst, Zl as unreadableOrphanRecords, Zn as NestedCleanupQueue, Zr as orphanedLogicalIds, Zs as CloudControlProvider, Zu as hasReadableOutputs, _ as mixedSecretRowKeys, _a as nameGenerationHighWaterOf, _c as producerLookupOver, _d as rebuildClientForBucketRegion, _f as readBootstrapMarkerBody, _i as noEchoMacParametersOf, _l as MULTI_REGION_RECREATE_BLOCKED_TYPES, _o as gray, _r as formatResourceLine, _s as policyDocumentMatchesDeclared, _u as refuseMalformedResourcePropertiesForOrphan, a as mergeNoChangeOutputs, aa as recordUnderIdIsNotOwn, ac as getReadOnlyPropertyPaths, ad as hasNoCloudControlHandlers, ai as changedReferenceReason, al as carriesFetchableDynamicReference, ao as withPreviousPolicies, ar as sameMove, as as revertStackRecordsView, at as deferredServiceTokenWarning, au as refuseMalformedResourceEntriesForDeploy, b as recordedValuesOf, ba as retiredNameGenerationsAfter, bc as assertFlagRoleArn, bd as applyCrossPrefixScan, bf as BOOTSTRAP_MARKER_PREFIX, bi as siblingOwnedRevertDesired, bl as renderStatefulReason, bo as yellow, br as resolvePendingCloudControlRequests, bu as hasReadableOrphans, c as nestedSsmNameRowNote, ca as computeImplicitDeleteEdges, cc as DiffCalculator, ci as looselyEqual, cl as keepsSecretReferenceToken, co as cfnIngressPortValue, cr as isReceiver, ct as diffSecurity, cu as refuseMalformedResourceEntriesForImportSave, d as makeCanonicalizePropertiesFn, da as readsRegeneratingSecret, dc as isAlwaysLiveAttribute, dd as TemplateParser, df as ensureAssetStorage, di as propertiesChangedReason, dl as LEGACY_HANDLE_HEAL_REASON, dn as tagsMatchDeclared, do as sgProtocolKey, dt as PROTECTION_PROPERTY_BY_TYPE, du as unreadableResourceEntries, ea as demoteSupersededOrphans, ec as UNSPECIFIED_SKIP_REASON, ed as findHandledUnwrittenCreateOnly, ei as movedToHint, el as recordedOutputReferenceRegions, eo as supersededResourcesOf, er as readRefactorMarker, et as scanActiveConsumers, eu as malformedLocalResourcesWarning, f as calculatorMaskingPassedSecretLines, fa as segmentCleanupOptions, fc as poisonRenderedSpellingsCollidingIn, fd as S3StateBackend, ff as buildDenyExternalAccessPolicy, fi as proposeRenames, fr as childStackTags, fs as declaredMemberDocument, ft as isProtectionValueActive, fu as malformedDriftResourcePropertiesWarning, g as maskPassedSecretReasons, ga as nameGenerationCarriedFrom, gc as resolveDynamicReferences, gd as hasUnverifiableParameterRefusal, gf as parseBootstrapMarker, gi as noEchoMacBinding, gl as shownType, go as cyan, gs as memberReadFailure, gu as refuseMalformedResourcePropertiesForExport, h as maskPassedSecretOutputs, ha as orphanNeedsIdentity, hd as hasReasonlessBaselineRefusal, hf as getBootstrapMarkerKey, hi as createNoEchoValueMacs, hl as refuseStatefulReplacedReaders, ho as bold, hr as readsOnlyNoEchoParameters, hs as lambdaPermissionMatchesDeclared, hu as refuseMalformedResourcePropertiesForDrift, i as keptWholeReasonText, ia as recheckFailedPlan, id as NO_CC_HANDLERS_REASON, if as getDockerImageBySourceHash, ii as changedReferencePath, il as isImpossibleEmptyStoredAttribute, io as resolveReplacementOldType, ir as refuseRefactorMarker, it as renderUnreplacedTarget, iu as refuseMalformedResourceEntries, j as stringifyCfnTemplate, ja as exportAliasCollisionScrubWarning, jc as classifyReplaySecretRegion, jd as isAbsoluteAssetPath, jf as displayAssemblyPath, ji as DELETED_RESOURCE_REMEDY, jl as getTopLevelKeysHoldingUnreadableCreateOnly, jo as orphanRecordsPrintingBag, jr as collectNestedChildUnaddressed, k as parseCfnTemplate, ka as WITHHELD_NAME_DISPLAY, kc as envCredentialsAreAssumedRole, ki as replayFailedOperations, kl as withSecretPhysicalIdsMaskedInState, ko as maskEventTextWithBoundBags, kr as revertedNestedRowIds, ks as WaitConditionSignalStore, ku as malformedOutputsRefusalMessage, l as crossStackOutputProvenanceSource, la as typesDeletedBefore, lc as IntrinsicFunctionResolver, li as mappingPairs, ll as withSharedDrainBudget, lo as recordedSgRuleId, lr as removeSignalReceiverNamed, ls as LAMBDA_PERMISSION_STATEMENT_KEYS, lt as recordedProtectionEvidence, lu as refuseMalformedResourceEntriesForOrphan, m as maskPassedSecretChanges, ma as removeProtectionTypes, md as readOnlyStateVersionOf, mf as isCrossRegionRedirect, mi as NOECHO_MAC_KEY_ALIAS, ml as findReplacedReadersOfRecreateTargets, mo as canonicalizeIpProtocolValue, mr as macWriteOnlyKeys, ms as efsPolicyMatchesDeclared, mt as readProtection, mu as refuseMalformedResourcePropertiesForDestroy, n as applyStackTagsToTemplate, na as isReplacementOrphan, nc as deleteLeftInPlace, nd as unwrittenCreateOnlyReplacement, nf as rewriteTemplateAssetReferences, ni as withMovedTo, nl as withoutVersionAttestation, nr as refactorMarkerMovesOf, nt as planReplaceResourceTargets, nu as malformedScrubResourceEntriesRefusalMessage, o as checkNestedSsmNames, oa as replacementNeverSwapped, oc as isWaitAbandonedError, od as PROPERTY_COVERAGE_BY_TYPE, oi as differingRemedy, ol as isNamelessDynamicReferenceError, oo as findNestedStackTypeChanges, or as updateRefactorMarker, ot as findServiceTokenRefusals, ou as refuseMalformedResourceEntriesForDestroy, p as crossStackTaintSeeds, pa as removeProtectionTypeList, pc as stackIdTailOf, pd as splitImportedOps, pf as assertAssetBucketRegion, pi as referencedLogicalIds, po as canonicalizeIpv4Cidr, pr as literalRowTags, ps as declaredPolicyDocument, pt as perType, pu as malformedResourcePropertiesWarning, q as pendingMovesRefusalMessage, qa as deleteSupersededEntry, qc as isStalePlaceholderArnAttribute, qd as buildAssetRedirectMap, ql as refuseMalformedOrphanRecordsForDestroy, qo as unsupportedFinalSnapshotError, qr as constructPathOf$1, qu as withheldAccountClause, r as isSecretBearingReferenceString, ra as planFailedOps, rc as deleteSkipReason, rf as AssetManifestLoader, ri as changedReferenceInDiff, rl as getAccountInfo, ro as snapshotSegmentSurvivors, rr as refactorMarkerRefusalMessage, rs as destroyStackRecordsView, rt as refuseStatefulReplaceResourceTargets, ru as refuseMalformedResourceAttributesForOrphan, s as nestedSsmNameDeferredNote, sa as IMPLICIT_DELETE_DEPENDENCIES, sd as providerReplacementOldDeleted, si as isPairableType, sl as carriesDynamicReference, sn as declaredTagsReadback, sr as deleteSignalReceiver, ss as withStackRecords, st as serviceTokenBlockingReason, su as refuseMalformedResourceEntriesForImport, t as DeployEngine, ta as isJournaledOrphan, tc as deleteIndeterminateGuards, ti as rollbackOrphanIds, tl as recordedReferenceRegions, to as withoutSuperseded, tr as readRefactorMarkerOnce, tt as inRunStackKey, tu as malformedResourceEntriesWarning, u as inheritedProvenanceForChildDiff, ua as attemptUsesCompletedCreate, uc as isSelectOutOfBounds, uf as AssetModeResolver, ui as parseMappingFile, ul as INTRINSIC_KEYS, uo as sgCidrKey, ur as settleStackTagChildRuns, ut as recordedProtectionNote, uu as repairMalformedResourceEntriesForReadOnly, v as mixedSecretTagKeys, va as nameScopeOf, vc as refuseUnreadableCdkCrossAccountRefs, vd as CrossPrefixReadError, vf as validateAssetBucketName, vi as noEchoMacVerdict, vl as isStatefulRecreateTargetForReplace, vo as green, vr as startForceQuitFlushes, vs as reReadUntilSettled, vu as repairMalformedResourcePropertiesForReadOnly, w as deleteRetiredCloudFormationStack, wa as inheritProducerRegions, wc as parseIamRoleArn, wd as stackInstanceIdOf, wf as hasOwnKey, wi as sgRuleOwnershipIdentity, wo as withAttemptedItemsMasked, wr as dropSettledNestedJournals, ws as CC_BROKEN_REASON, wu as refuseMalformedOrphansForDestroy, x as securityDiffWithPassedSecretWithheld, xa as retiredNameGenerationsLeaving, xc as assertSendableRoleArn, xd as crossPrefixDeniedWarning, xi as stripSiblingOwnedParentMembers, xo as noEchoAttributeNamesOf, xr as NESTED_PENDING_PARENT_REASON, xs as verbatimEchoDriftKeys, xt as readStreamPolicy, xu as malformedOrphansRefusalMessage, y as readsTainted, ya as retiredAfterRollback, yc as applyRoleArnIfSet, yd as CrossPrefixScanCache, yf as validateContainerRepoName, yi as noEchoValueMacsOf, yl as isStatefulRecreateTargetSync, yo as red, yr as pendingRequestCount, yu as UNREADABLE_ORPHANS_CONTAINER_ROW, z as healZonelessDbInstanceRecords, za as noEchoParameterValueSeed, zd as CFN_TEMPLATE_URL_LIMIT, zi as calculateResourceDrift, zl as maskedPropertyFingerprint, zo as extractDeploymentEventError, zr as loadJournaledOrphans, zs as isCustomResourceType$1, zu as malformedStateRefusalMessage } from "./deploy-engine-C12Ygjb-.js";
10
10
  import { n as canonicalizeRegion, r as derivePartitionAndUrlSuffix, t as PARTITION_TABLE } from "./aws-partition-DA0r2sr-.js";
11
- import { C as timePhase, D as parseFailureDebugDetail, S as renderPhaseTimings, T as describeJsonParseFailure, a as getCreateOnlyPropertyPaths, c as templateResourceTypes, g as withRetry, k as utf8ByteLength, s as prefetchCreateOnlyPropertyPaths, u as describeTypeWithThrottleRetry, v as PhaseClock } from "./secret-reference-immutable-0mb2D0J5.js";
12
- import { l as setResolvedResourceTimeouts } from "./ec2-termination-protection-DXZyU3Q0.js";
13
- import { t as expectedOwnerParam } from "./expected-bucket-owner-C2OXO5oD.js";
14
- import { Ct as isReadableBag, Et as shouldRetainResource, Ot as stackInstanceIdCarriedFrom, St as importableOutputs, Tt as orphansCarriedFrom, _t as acceptedCreateOnlyDropsOf, bt as hasReadableExportSet, gt as slowCcOperationTimeoutMs, vt as describeRegionValueKind, wt as orphansAfterRollback, xt as importableOutputKeys, yt as exportNamesCarriedFrom } from "./delete-started-BtXSEHsh.js";
15
- import { Bn as recordNoEchoAttributeValues, Cn as splitGetAttStringForm, Ct as maskSecretsInError, E as noEchoOutputsComparison, F as valueAtCoordinate, Fn as provenPublicValue, Ft as scrubResourceRecord, Gn as WHOLE_DYNAMIC_REFERENCE_PATTERN, Hn as recordProvenPublicExpression, It as withPhysicalNameCopies, Kt as spelledKeysOf, L as liveMatchesUnresolvedTokenFrame, N as recordedNoEchoValuesOf, Rn as recordMaskOnlyValue, S as maskedLeafCoordinatesOf, T as noEchoLeavesOf, Un as wholeStringLeavesOf, Ut as dynamicReferenceTokens, Vn as recordNoEchoParameterFreshValue, Vt as DYNAMIC_REFERENCE_TOKEN_SCAN, Wt as keepTemplateLiteralLeaves, X as redactForState, Yt as identityKeyFor, _t as recordLogOnlyValue, b as maskReadbackAtCoordinates, bt as createSecretMasker, ct as createUnionSecretMasker, dt as literalSplitDelimitersOf, ft as logOnlyValueCount, g as canonicalCoordinates, gn as physicalNameCopiesOf, ht as recordLogOnlyParameterValue, in as inheritNestedStackParameterAssociations, j as readsNoEchoSource, mt as printingCorpusOf, ot as carryLogOnlyValues, qn as isSingleDynamicReferenceToken, qt as pathCrossesDottedKey, ut as hasMaskableValues, v as isMarkedCoordinate, vn as recordPhysicalNameCopy, vt as shareLogOnlyValues, w as noEchoCoordinatesOf, wn as carriesSecretMask, wt as maskSecretsInText, x as maskWholeValue, xt as errorCauseChain, y as maskAtCoordinates, yn as recordNestedStackParameterExpressions, yt as unionOfSecretBags, zn as recordMaskOnlyValuesIn, zt as isUncertifiedBaselineMaskPosition } from "./replacement-rules-BArdRPgU.js";
16
- import { S as unsettledPropertiesOf, T as withoutUnsettledProperties, b as unsettledItemsOf, w as withUnsettledProperties, y as unsettledItemsField } from "./restore-source-guard-k9BQAviV.js";
17
- import { u as differingIdentityWarning } from "./identity-read-denied-C17mECu-.js";
18
- import { n as isRedactedRecordedValue } from "./redacted-delete-address-S_A40Diz.js";
19
- import { a as withResourceDeadline } from "./resource-deadline-DWvjidOS.js";
20
- import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-C0JbYdmm.js";
11
+ import { C as timePhase, D as parseFailureDebugDetail, S as renderPhaseTimings, T as describeJsonParseFailure, a as getCreateOnlyPropertyPaths, c as templateResourceTypes, g as withRetry, k as utf8ByteLength, s as prefetchCreateOnlyPropertyPaths, u as describeTypeWithThrottleRetry, v as PhaseClock } from "./secret-reference-immutable-BC4abPuQ.js";
12
+ import { l as setResolvedResourceTimeouts } from "./ec2-termination-protection-UZAZ2Hzv.js";
13
+ import { t as expectedOwnerParam } from "./expected-bucket-owner-0yx_Q4Hl.js";
14
+ import { Ct as isReadableBag, Et as shouldRetainResource, Ot as stackInstanceIdCarriedFrom, St as importableOutputs, Tt as orphansCarriedFrom, _t as acceptedCreateOnlyDropsOf, bt as hasReadableExportSet, gt as slowCcOperationTimeoutMs, vt as describeRegionValueKind, wt as orphansAfterRollback, xt as importableOutputKeys, yt as exportNamesCarriedFrom } from "./delete-started-yz9plykR.js";
15
+ import { $n as WHOLE_DYNAMIC_REFERENCE_PATTERN, An as splitGetAttStringForm, C as maskedLeafCoordinatesOf, Cn as dynamicReferenceTokens, Ct as errorCauseChain, D as noEchoOutputsComparison, E as noEchoLeavesOf, Et as maskSecretsInText, Gt as identityKeyFor, Ht as spelledKeysOf, I as valueAtCoordinate, Jn as recordNoEchoAttributeValues, Kn as recordMaskOnlyValue, Lt as scrubResourceRecord, M as readsNoEchoSource, P as recordedNoEchoValuesOf, Q as redactForState, Qt as inheritNestedStackParameterAssociations, R as liveMatchesUnresolvedTokenFrame, Rt as withPhysicalNameCopies, S as maskWholeValue, St as createSecretMasker, T as noEchoCoordinatesOf, Tt as maskSecretsInError, Un as provenPublicValue, Ut as pathCrossesDottedKey, Vt as isUncertifiedBaselineMaskPosition, Xn as recordProvenPublicExpression, Yn as recordNoEchoParameterFreshValue, Zn as wholeStringLeavesOf, _n as physicalNameCopiesOf, _t as recordLogOnlyParameterValue, b as maskAtCoordinates, bt as shareLogOnlyValues, ct as carryLogOnlyValues, ft as hasMaskableValues, g as canonicalCoordinates, gt as printingCorpusOf, hn as keepTemplateLiteralLeaves, jn as carriesSecretMask, mt as logOnlyValueCount, pt as literalSplitDelimitersOf, qn as recordMaskOnlyValuesIn, tr as isSingleDynamicReferenceToken, un as recordNestedStackParameterExpressions, ut as createUnionSecretMasker, v as isMarkedCoordinate, x as maskReadbackAtCoordinates, xn as DYNAMIC_REFERENCE_TOKEN_SCAN, xt as unionOfSecretBags, yn as recordPhysicalNameCopy, yt as recordLogOnlyValue } from "./replacement-rules-BoZMVFdK.js";
16
+ import { S as unsettledPropertiesOf, T as withoutUnsettledProperties, b as unsettledItemsOf, w as withUnsettledProperties, y as unsettledItemsField } from "./restore-source-guard-BkS5tGr5.js";
17
+ import { u as differingIdentityWarning } from "./identity-read-denied-DBsqwW85.js";
18
+ import { n as isRedactedRecordedValue } from "./redacted-delete-address-DVgNoeo4.js";
19
+ import { a as withResourceDeadline } from "./resource-deadline-BkQ9mJAk.js";
20
+ import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-C74u9FtL.js";
21
21
  import { t as cdkdCacheHome } from "./cache-home-BVYKj3de.js";
22
22
  import { randomBytes, randomUUID } from "node:crypto";
23
23
  import { CopyObjectCommand, CreateBucketCommand, DeleteBucketCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetObjectCommand, HeadBucketCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, NotFound, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutBucketVersioningCommand, PutObjectCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
24
24
  import { GetRoleCommand, GetUserCommand } from "@aws-sdk/client-iam";
25
25
  import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
26
26
  import { DescribeSecurityGroupRulesCommand } from "@aws-sdk/client-ec2";
27
- import { CloudFormationClient, CreateChangeSetCommand, DeleteChangeSetCommand, DeleteStackCommand, DescribeChangeSetCommand, DescribeStackEventsCommand, DescribeStackResourcesCommand, DescribeStacksCommand, ExecuteChangeSetCommand, GetTemplateCommand, UpdateStackCommand, waitUntilChangeSetCreateComplete, waitUntilStackDeleteComplete, waitUntilStackImportComplete, waitUntilStackUpdateComplete } from "@aws-sdk/client-cloudformation";
27
+ import { CreateChangeSetCommand, DeleteChangeSetCommand, DescribeChangeSetCommand, DescribeStackEventsCommand, DescribeStacksCommand, ExecuteChangeSetCommand, GetTemplateCommand, UpdateStackCommand, waitUntilChangeSetCreateComplete, waitUntilStackImportComplete, waitUntilStackUpdateComplete } from "@aws-sdk/client-cloudformation";
28
28
  import { GetSecretValueCommand, SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
29
29
  import { GetParameterCommand, SSMClient } from "@aws-sdk/client-ssm";
30
30
  import { DescribeLogStreamsCommand, ResourceNotFoundException as ResourceNotFoundException$1 } from "@aws-sdk/client-cloudwatch-logs";
@@ -39,10 +39,10 @@ import { CreateAliasCommand, CreateKeyCommand, DescribeKeyCommand, KMSClient, Sc
39
39
  import { A2A_CONTAINER_PORT, A2A_PATH, AGENTCORE_A2A_PROTOCOL, AGENTCORE_AGUI_PROTOCOL, AGENTCORE_MCP_PROTOCOL, ConnectionRegistry, DEFAULT_AWS_EMULATOR_URL, DynamicReferenceResolver, EMULATOR_SCRUBBED_ENV_KEYS, EcsTaskResolutionError, MCP_CONTAINER_PORT, MCP_PATH, UNNAMED_WORKLOAD, a2aInvokeOnce, addAlbSpecificOptions, addAwsEndpointOptions, addCommonEcsServiceOptions, addImageOverrideOptions, addStartServiceSpecificOptions, albStrategy, applyWorkloadAwsWiringToEnv, attachAuthorizers, attachStageContext, availableApiIdentifiers, awaitLoopbackForwarderStatus, awsEmulatorEnvName, awsEmulatorRealServices, awsEmulatorSqsHostBlocks, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildNamespaceOwnerForwarderDockerArgs, buildStageMap, canonicalizeImageOverrideKeys, classifySourceChange, containsCrossStackIntrinsic, containsDynamicReference, createAuthorizerCache, createFileWatcher, createFileWatcher as createFileWatcher$1, createJwksCache, createMixedModeStateProvider, createWatchPredicates, defaultCredentialsLoader, describeAwsFailureForWarn, describeForwarderFailure, discoverRoutes, discoverWebSocketApis, dockerRegistryEnv, downloadAndExtractS3Bundle, effectiveLoopbackPorts, enforceImageOverrideOrphans, expandNestedStacks, filterRoutesByApiIdentifier, firstUsableRegion, getActiveWorkloadAwsWiring, getAwsEndpointOverride, groupRoutesByServer, groupWorkloadsRoutedApart, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, isAwsServiceRoutedToEmulator, keysNotFromTemplate, keysOverriddenBy, logMixedModeForWorkload, loopbackForwarderPlan, mcpInvokeOnce, noImplicitEcrPullArgs, parseAwsEndpoint, parseConnectionsPath, parseImageOverrideFlags, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, readAwsEmulatorEnvVarsFile, readEmulatorRunFiles, readEnvVarsFileText, readMtlsMaterialsFromDisk, realAwsServicesOf, resolveAgentCoreTarget, resolveAwsEmulatorOption, resolveDynamicReferencesInEnv, resolveEnvVars, resolveHostDefaultCredentials, resolveImageOverrides, resolveJwtAuthorizerIntrinsics, resolveSingleTarget, resolveWatchConfig, resolveWorkloadAwsWiring, runEcsServiceEmulator, runImageOverrideBuilds, setActiveWorkloadAwsWiring, setAwsEndpointOverride, signAgentCoreInvocation, startApiServer, topLevelStacks, verifyJwtViaDiscovery, waitForAgentCorePing, warnUnenforcedRouteAuthSettings, withNestedDescendants, withoutKeys } from "cdk-local/internal";
40
40
  import { isDeepStrictEqual, promisify } from "node:util";
41
41
  import graphlib from "graphlib";
42
- import { Command, InvalidArgumentError, Option } from "commander";
43
42
  import * as readline$1 from "node:readline/promises";
44
43
  import readline from "node:readline/promises";
45
- import { Document, Pair, Scalar, YAMLError, YAMLMap, YAMLSeq, isScalar, parse, parseDocument, stringify, visit } from "yaml";
44
+ import { Document, Scalar, isScalar, parse, stringify, visit } from "yaml";
45
+ import { Command, InvalidArgumentError, Option } from "commander";
46
46
  import { emitKeypressEvents } from "node:readline";
47
47
  import { collectSsmParameterRefs, createLocalStartAgentCoreCommand, createLocalStartCloudFrontCommand, createLocalStartMicrovmCommand, createLocalStartWebFunctionCommand, createLocalStateProvider, getEmbedConfig, isCfnFlagPresent, listTargets, rejectExplicitCfnStackWithMultipleStacks, resolveCfnFallbackRegion, resolveCfnStackName, resolveSsmParameters, setEmbedConfig, substituteAgainstState, substituteAgainstStateAsync, substituteEnvVarsFromState, substituteEnvVarsFromStateAsync } from "cdk-local";
48
48
  import { WebSocketServer } from "ws";
@@ -1176,40 +1176,6 @@ function createListCommand() {
1176
1176
  return cmd;
1177
1177
  }
1178
1178
 
1179
- // src/cli/commands/confirm-prompt.ts
1180
- let promptQueue = Promise.resolve();
1181
- function serializePrompt(ask) {
1182
- const asked = promptQueue.then(ask);
1183
- promptQueue = asked.catch(() => void 0);
1184
- return asked;
1185
- }
1186
- async function promptYesNo(prompt) {
1187
- const rl = readline$1.createInterface({
1188
- input: process.stdin,
1189
- output: process.stdout
1190
- });
1191
- try {
1192
- const ans = await rl.question(`${prompt} [Y/n] `);
1193
- return /^(y(es)?)?$/i.test(ans.trim());
1194
- } finally {
1195
- rl.close();
1196
- }
1197
- }
1198
- const DEFAULT_CONFIRM_SUFFIX = " [y/N] ";
1199
- async function confirmOrRefuse(prompt, options) {
1200
- if (process.stdin.isTTY !== true) throw new CdkdError(options.refusal, "NON_INTERACTIVE_CONFIRM");
1201
- const rl = readline$1.createInterface({
1202
- input: process.stdin,
1203
- output: options.output ?? process.stdout
1204
- });
1205
- try {
1206
- const ans = await rl.question(`${prompt}${options.suffix ?? " [y/N] "}`);
1207
- return /^y(es)?$/i.test(ans.trim());
1208
- } finally {
1209
- rl.close();
1210
- }
1211
- }
1212
-
1213
1179
  // src/cli/commands/require-approval.ts
1214
1180
  const REQUIRE_APPROVAL_VALUES = [
1215
1181
  "never",
@@ -1595,7 +1561,7 @@ function collectCrossStackRefs(node, onRef, unconditional) {
1595
1561
  // src/provisioning/register-providers.ts
1596
1562
  let providerClasses;
1597
1563
  function loadProviderClasses() {
1598
- providerClasses ??= import("./provider-classes-BiWcIBLc.js");
1564
+ providerClasses ??= import("./provider-classes-Bi3D5zDS.js");
1599
1565
  return providerClasses;
1600
1566
  }
1601
1567
  function registerAllProviders(registry, classes) {
@@ -2651,7 +2617,7 @@ function replaceResourcesForStack(ids, stackName, template) {
2651
2617
 
2652
2618
  // src/deployment/recreate-targets/validate.ts
2653
2619
  const EMPTY_ALLOW_SET$1 = /* @__PURE__ */ new Set();
2654
- const NESTED_STACK_RESOURCE_TYPE$1 = "AWS::CloudFormation::Stack";
2620
+ const NESTED_STACK_RESOURCE_TYPE = "AWS::CloudFormation::Stack";
2655
2621
  function validateRecreateTargets(input) {
2656
2622
  const seenCcApi = new Set(input.recreateViaCcApi);
2657
2623
  const seenSdk = new Set(input.recreateViaSdkProvider ?? []);
@@ -2758,7 +2724,7 @@ function validateRecreateTargets(input) {
2758
2724
  blockedNoCcRoute,
2759
2725
  blockedCcBroken,
2760
2726
  conflictingDirections,
2761
- nestedStackLogicalIds: Object.entries(input.template.Resources ?? {}).filter(([, resource]) => resource?.Type === NESTED_STACK_RESOURCE_TYPE$1).map(([id]) => id)
2727
+ nestedStackLogicalIds: Object.entries(input.template.Resources ?? {}).filter(([, resource]) => resource?.Type === NESTED_STACK_RESOURCE_TYPE).map(([id]) => id)
2762
2728
  };
2763
2729
  }
2764
2730
 
@@ -2797,7 +2763,7 @@ function renderRecreateTargetsErrors(validation) {
2797
2763
  if (lines.length > 0) lines.push("");
2798
2764
  lines.push(`${FLAG_UMBRELLA} refuses to operate on ${validation.blockedNestedStackTargets.length} nested-stack resource(s):`);
2799
2765
  for (const blocked of validation.blockedNestedStackTargets) {
2800
- const templateType = validation.nestedStackLogicalIds.includes(blocked.logicalId) ? NESTED_STACK_RESOURCE_TYPE$1 : void 0;
2766
+ const templateType = validation.nestedStackLogicalIds.includes(blocked.logicalId) ? NESTED_STACK_RESOURCE_TYPE : void 0;
2801
2767
  const shown = templateType && templateType !== blocked.resourceType ? `${recordedTypeShown(blocked.resourceType)} in state, ${templateType} in the template` : recordedTypeShown(blocked.resourceType);
2802
2768
  lines.push(` - ${blocked.logicalId} (${shown})`);
2803
2769
  }
@@ -3603,6 +3569,28 @@ function checkPinCcApiOptions(options, targetStacks, logger) {
3603
3569
  }
3604
3570
  }
3605
3571
 
3572
+ // src/cli/commands/deploy/dependency-closure.ts
3573
+ function withDependencyStacks(selected, allStacks, onAdd) {
3574
+ const inferred = inferCrossStackDepsByStack(allStacks, { kinds: ["ImportValue"] });
3575
+ const inApp = new Set(allStacks);
3576
+ const out = [...selected];
3577
+ const included = new Set(selected);
3578
+ const add = (stack) => {
3579
+ const deps = /* @__PURE__ */ new Set();
3580
+ for (const depName of stack.dependencyNames) for (const dep of stacksForDependency(depName, stack, allStacks)) deps.add(dep);
3581
+ for (const producer of inferred.get(stack) ?? []) if (producer !== stack && inApp.has(producer)) deps.add(producer);
3582
+ for (const dep of deps) {
3583
+ if (included.has(dep)) continue;
3584
+ included.add(dep);
3585
+ out.push(dep);
3586
+ onAdd?.(dep, stack);
3587
+ add(dep);
3588
+ }
3589
+ };
3590
+ for (const stack of selected) add(stack);
3591
+ return out;
3592
+ }
3593
+
3606
3594
  // src/cli/commands/deploy/command.ts
3607
3595
  async function deployCommand(stacks, options) {
3608
3596
  const runClock = new PhaseClock("run", { fromProcessStart: true });
@@ -3723,19 +3711,9 @@ async function deployCommand(stacks, options) {
3723
3711
  for (const producer of inferred.get(stack) ?? []) if (producer !== stack && inPool.has(producer)) deps.add(producer);
3724
3712
  return deps;
3725
3713
  };
3726
- const inferredStrongCrossStackDeps = inferCrossStackDepsByStack(allStacks, { kinds: ["ImportValue"] });
3727
3714
  if (!options.exclusively) {
3728
- const included = new Set(targetStacks);
3729
- const addDependencies = (stack) => {
3730
- for (const depStack of dependencyStacks(stack, inferredStrongCrossStackDeps, allStacks)) {
3731
- if (included.has(depStack)) continue;
3732
- included.add(depStack);
3733
- targetStacks.push(depStack);
3734
- logger.debug(`Auto-including dependency stack: ${depStack.stackName} (required by ${stack.stackName})`);
3735
- addDependencies(depStack);
3736
- }
3737
- };
3738
- for (const stack of [...targetStacks]) addDependencies(stack);
3715
+ const withDependencies = withDependencyStacks(targetStacks, allStacks, (dep, by) => logger.debug(`Auto-including dependency stack: ${dep.stackName} (required by ${by.stackName})`));
3716
+ targetStacks.splice(0, targetStacks.length, ...withDependencies);
3739
3717
  }
3740
3718
  const selectedNames = new Set(targetStacks.map((s) => s.stackName));
3741
3719
  const selectedSet = new Set(targetStacks);
@@ -3962,6 +3940,35 @@ function createDeployCommand() {
3962
3940
  var CrossStackPreview = class {
3963
3941
  exports = /* @__PURE__ */ new Map();
3964
3942
  outputs = /* @__PURE__ */ new Map();
3943
+ taintedExports = /* @__PURE__ */ new Set();
3944
+ taintedOutputs = /* @__PURE__ */ new Set();
3945
+ taintedTexts = /* @__PURE__ */ new Set();
3946
+ everyExportTainted = false;
3947
+ nestedOutputsTaintedOutside;
3948
+ exportTainted(_region, name) {
3949
+ return this.everyExportTainted || this.taintedExports.has(name);
3950
+ }
3951
+ stackOutputTainted(_region, stackName, outputName) {
3952
+ return this.taintedOutputs.has(JSON.stringify([stackName, outputName])) || this.nestedOutputsTaintedOutside !== void 0 && !this.nestedOutputsTaintedOutside.has(stackName);
3953
+ }
3954
+ markNestedOutputsTainted(topLevelStackNames) {
3955
+ this.nestedOutputsTaintedOutside = topLevelStackNames;
3956
+ }
3957
+ anyTainted() {
3958
+ return this.everyExportTainted || this.taintedOutputs.size > 0;
3959
+ }
3960
+ taintedValues() {
3961
+ return this.taintedTexts;
3962
+ }
3963
+ markTainted(stackName, outputName, exportName, values = []) {
3964
+ const outputKey = JSON.stringify([stackName, outputName]);
3965
+ const added = !this.taintedOutputs.has(outputKey);
3966
+ this.taintedOutputs.add(outputKey);
3967
+ if (exportName === null) this.everyExportTainted = true;
3968
+ else if (exportName !== void 0) this.taintedExports.add(exportName);
3969
+ for (const value of values) if (isScalar$1(value) && value !== "" && value !== "***") this.taintedTexts.add(String(value));
3970
+ return added;
3971
+ }
3965
3972
  exportValue(region, name) {
3966
3973
  return this.exports.get(key(region, name));
3967
3974
  }
@@ -4041,8 +4048,27 @@ async function resolvedExportNames(template, resolve) {
4041
4048
  }
4042
4049
  return names;
4043
4050
  }
4051
+ async function markProducerTaint(preview, resolve, input, exportNames) {
4052
+ const reads = input.readsSecretFedName;
4053
+ if (reads === void 0) return;
4054
+ const exportNameOf = exportNames ?? await resolvedExportNames(input.template, resolve);
4055
+ const stored = input.storedOutputs ?? {};
4056
+ for (const [outputName, definition] of Object.entries(input.template.Outputs ?? {})) {
4057
+ const output = definition;
4058
+ const secretName = reads(output?.Export);
4059
+ if (!reads(output?.Value) && !secretName) continue;
4060
+ const exportName = exportNameOf.get(outputName) ?? (output?.Export === void 0 ? void 0 : null);
4061
+ preview.markTainted(input.stackName, outputName, exportName, [
4062
+ Object.hasOwn(input.desiredOutputs, outputName) ? input.desiredOutputs[outputName] : void 0,
4063
+ Object.hasOwn(stored, outputName) ? stored[outputName] : void 0,
4064
+ ...typeof exportName === "string" ? [Object.hasOwn(stored, exportName) ? stored[exportName] : void 0] : [],
4065
+ ...secretName && typeof exportName === "string" ? [exportName] : []
4066
+ ]);
4067
+ }
4068
+ }
4044
4069
  async function recordProducerPreview(preview, region, resolve, input) {
4045
4070
  const exportNameOf = await resolvedExportNames(input.template, resolve);
4071
+ await markProducerTaint(preview, resolve, input, exportNameOf);
4046
4072
  const readsUnknownPreview = (value) => crossStackReads(value).some((read) => {
4047
4073
  return (read.kind === "export" ? preview.exportValue(region, read.name) : preview.stackOutput(read.region ?? region, read.stackName, read.outputName))?.kind === "unknown";
4048
4074
  });
@@ -4100,636 +4126,131 @@ function orderProducersFirst(stacks, dependenciesOf) {
4100
4126
  return ordered;
4101
4127
  }
4102
4128
 
4103
- // src/cli/commands/retire-cfn-stack/types.ts
4104
- const NESTED_STACK_RESOURCE_TYPE = "AWS::CloudFormation::Stack";
4105
- const TEMPLATE_BODY_LIMIT = CFN_TEMPLATE_BODY_LIMIT;
4106
- const TEMPLATE_URL_LIMIT = CFN_TEMPLATE_URL_LIMIT;
4107
-
4108
- // src/cli/cfn-stack-states.ts
4109
- const STABLE_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
4110
- "CREATE_COMPLETE",
4111
- "UPDATE_COMPLETE",
4112
- "UPDATE_ROLLBACK_COMPLETE",
4113
- "IMPORT_COMPLETE",
4114
- "IMPORT_ROLLBACK_COMPLETE"
4115
- ]);
4116
-
4117
- // src/cli/commands/retire-cfn-stack/failure-text.ts
4118
- const SUPERSEDED_COPY_HINT = "If that update completes (now or later), CloudFormation may have replaced resources; each superseded copy is RETAINED and managed by neither CloudFormation nor cdkd. Find them in the stack's events: rows whose reason reads \"Requested update requires the creation of a new physical resource\" name the old physical id. A re-run does not report them, because the template then already carries the Retain policies and no update runs.";
4119
- const MANUAL_RETIREMENT_ROUTE = "To retire the stack by hand: (1) UpdateStack with DeletionPolicy=Retain and UpdateReplacePolicy=Retain on every resource, (2) `cdkd import` without --migrate-from-cloudformation (it reads the physical ids from a same-named CloudFormation stack), (3) DeleteStack. The import must adopt every resource before you delete the stack: check its summary.";
4120
- function describeStackWaiterFailure(error) {
4121
- if (!(error instanceof Error)) return void 0;
4122
- let parsed;
4123
- try {
4124
- parsed = JSON.parse(error.message);
4125
- } catch {
4126
- return;
4127
- }
4128
- if (typeof parsed !== "object" || parsed === null || !("state" in parsed)) return void 0;
4129
- const result = parsed;
4130
- const state = typeof result.state === "string" ? result.state : "FAILURE";
4131
- const reason = result.reason;
4132
- const stacks = typeof reason === "object" && reason !== null && "Stacks" in reason ? reason.Stacks : void 0;
4133
- const stack = Array.isArray(stacks) && typeof stacks[0] === "object" ? stacks[0] : void 0;
4134
- const status = typeof stack?.StackStatus === "string" ? stack.StackStatus : void 0;
4135
- const statusReason = typeof stack?.StackStatusReason === "string" ? stack.StackStatusReason : void 0;
4136
- return `waiter ${state}` + (status ? `, stack status ${status}` : typeof reason === "string" ? `: ${reason}` : "") + (statusReason ? ` (${statusReason})` : "");
4137
- }
4138
- function cfnFailureText(error) {
4139
- const waiter = describeStackWaiterFailure(error);
4140
- if (waiter !== void 0 && error instanceof Error) {
4141
- try {
4142
- Object.defineProperty(error, "message", {
4143
- value: waiter,
4144
- writable: true,
4145
- configurable: true,
4146
- enumerable: false
4147
- });
4148
- Object.defineProperty(error, "stack", {
4149
- value: `${error.name}: ${waiter}`,
4150
- writable: true,
4151
- configurable: true,
4152
- enumerable: false
4153
- });
4154
- } catch {}
4155
- return waiter;
4156
- }
4157
- const failure = describeAwsFailure(error);
4158
- if (failure.redacted) getLogger().debug(safeMsg`CloudFormation failure detail: ${failure.detail}`);
4159
- return failure.summary.replace(/\.+$/, "");
4160
- }
4161
- var RetainUpdateFailedError = class extends Error {
4162
- cause;
4163
- constructor(cfnStackName, kind, cause) {
4164
- const text = cfnFailureText(cause);
4165
- super(safeMsg`The Retain-policy UpdateStack on CloudFormation stack ${displaySafe(cfnStackName)} ` + (kind === "rejected" ? "was rejected" : "did not complete") + safeMsg`: ${text}. cdkd state has not been written. ` + (kind === "unfinished" ? `${SUPERSEDED_COPY_HINT} ` : "") + "Re-run the same command once the cause is fixed. When the cause is a replacement CloudFormation cannot perform (a custom-named resource whose update requires replacing it), the same update by hand fails too: give that resource no custom name or a new one, or take it out of the stack, then re-run. To retire the stack by hand: (1) UpdateStack with DeletionPolicy=Retain and UpdateReplacePolicy=Retain on every resource, (2) `cdkd import` without --migrate-from-cloudformation (it reads the physical ids from a same-named CloudFormation stack), (3) DeleteStack. The import must adopt every resource before you delete the stack: check its summary.");
4166
- this.name = "RetainUpdateFailedError";
4167
- this.cause = cause;
4168
- }
4169
- };
4170
-
4171
- // src/cli/yaml-cfn.ts
4172
- const FN_TAGS = [
4173
- "GetAtt",
4174
- "Sub",
4175
- "Join",
4176
- "Select",
4177
- "Split",
4178
- "If",
4179
- "Equals",
4180
- "And",
4181
- "Or",
4182
- "Not",
4183
- "FindInMap",
4184
- "Base64",
4185
- "Cidr",
4186
- "GetAZs",
4187
- "ImportValue",
4188
- "Length",
4189
- "ToJsonString",
4190
- "ForEach"
4191
- ];
4192
- function nodeJs(node) {
4193
- if (node === null || node === void 0) return null;
4194
- if (typeof node === "object" && node !== null && "toJSON" in node) return node.toJSON();
4195
- return node;
4196
- }
4197
- function buildCustomTags() {
4198
- const tags = [];
4199
- tags.push({
4200
- tag: "!Ref",
4201
- resolve(value) {
4202
- return { Ref: value };
4203
- },
4204
- identify: () => false
4205
- });
4206
- tags.push({
4207
- tag: "!Condition",
4208
- resolve(value) {
4209
- return { Condition: value };
4210
- },
4211
- identify: () => false
4212
- });
4213
- tags.push({
4214
- tag: "!Transform",
4215
- collection: "map",
4216
- resolve(node) {
4217
- return { "Fn::Transform": nodeJs(node) };
4218
- },
4219
- identify: () => false
4220
- });
4221
- tags.push({
4222
- tag: "!GetAtt",
4223
- resolve(value) {
4224
- const dot = value.indexOf(".");
4225
- if (dot < 0) throw new Error(`${GETATT_SHAPE_REFUSAL}; got '${value}'`);
4226
- return { "Fn::GetAtt": [value.slice(0, dot), value.slice(dot + 1)] };
4227
- },
4228
- identify: () => false
4229
- });
4230
- tags.push({
4231
- tag: "!GetAtt",
4232
- collection: "seq",
4233
- resolve(node) {
4234
- return { "Fn::GetAtt": nodeJs(node) };
4235
- },
4236
- identify: () => false
4237
- });
4238
- for (const name of FN_TAGS) {
4239
- if (name === "GetAtt") continue;
4240
- const longKey = `Fn::${name}`;
4241
- tags.push({
4242
- tag: `!${name}`,
4243
- resolve(value) {
4244
- return { [longKey]: value };
4245
- },
4246
- identify: () => false
4247
- });
4248
- tags.push({
4249
- tag: `!${name}`,
4250
- collection: "seq",
4251
- resolve(node) {
4252
- return { [longKey]: nodeJs(node) };
4253
- },
4254
- identify: () => false
4255
- });
4256
- tags.push({
4257
- tag: `!${name}`,
4258
- collection: "map",
4259
- resolve(node) {
4260
- return { [longKey]: nodeJs(node) };
4261
- },
4262
- identify: () => false
4263
- });
4264
- }
4265
- return tags;
4266
- }
4267
- const CUSTOM_TAGS = buildCustomTags();
4268
- const GETATT_SHAPE_REFUSAL = "!GetAtt requires '<LogicalId>.<Attribute>'";
4269
- const YAML_ALIAS_EXHAUSTION = "Excessive alias count indicates a resource exhaustion attack";
4270
- function describeYamlFinding(err) {
4271
- if (err instanceof YAMLError) {
4272
- const at = err.linePos?.[0];
4273
- const where = at ? ` at line ${at.line}, column ${at.col}` : "";
4274
- if (err.code === "TAG_RESOLVE_FAILED" && err.message.startsWith(GETATT_SHAPE_REFUSAL)) return `${GETATT_SHAPE_REFUSAL}${where}`;
4275
- return `${err.name} ${err.code}${where}`;
4276
- }
4277
- if (err instanceof Error) return err.message === YAML_ALIAS_EXHAUSTION ? `${err.name}: ${YAML_ALIAS_EXHAUSTION}` : err.name || "Error";
4278
- return describeAwsFailure(err).detail;
4279
- }
4280
- function parseYamlTemplate(body) {
4281
- const doc = parseDocument(body, { customTags: CUSTOM_TAGS });
4282
- const logger = getLogger();
4283
- for (const warning of doc.warnings) {
4284
- logger.debug(safeMsg`Template YAML warning: ${parseFailureDebugDetail(warning)}`);
4285
- logger.warn(safeMsg`Template YAML warning: ${describeYamlFinding(warning)}`);
4286
- }
4287
- if (doc.errors.length > 0) throw doc.errors[0];
4288
- return doc.toJS();
4289
- }
4290
- function parseCfnTemplate(text) {
4291
- const format = detectTemplateFormat(text);
4292
- const body = text.charCodeAt(0) === 65279 ? text.slice(1) : text;
4293
- let parsed;
4294
- if (format === "json") try {
4295
- parsed = JSON.parse(body);
4296
- } catch (err) {
4297
- getLogger().debug(safeMsg`Template failed to parse as JSON: ${parseFailureDebugDetail(err)}`);
4298
- throw new Error(`Template is not valid JSON. Cause: ${describeJsonParseFailure(err, utf8ByteLength(body))}`);
4299
- }
4300
- else try {
4301
- parsed = parseYamlTemplate(body);
4302
- } catch (err) {
4303
- getLogger().debug(safeMsg`Template failed to parse as YAML: ${parseFailureDebugDetail(err)}`);
4304
- throw new Error(`Template is not valid YAML. Cause: ${describeYamlFinding(err)}`);
4305
- }
4306
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error(`Template root is not an object.`);
4307
- return parsed;
4308
- }
4309
- function stringifyCfnTemplate(template, format) {
4310
- if (format === "json") return JSON.stringify(template, null, 2);
4311
- const doc = new Document();
4312
- doc.contents = jsToYamlNode(template, doc);
4313
- return stringify(doc, {
4314
- aliasDuplicateObjects: false,
4315
- lineWidth: 0
4316
- });
4317
- }
4318
- function jsToYamlNode(value, doc) {
4319
- if (value === null || value === void 0) return new Scalar(null);
4320
- if (typeof value !== "object") return doc.createNode(value);
4321
- if (Array.isArray(value)) {
4322
- const seq = new YAMLSeq();
4323
- for (const item of value) seq.items.push(jsToYamlNode(item, doc));
4324
- return seq;
4325
- }
4326
- const keys = Object.keys(value);
4327
- if (keys.length === 1) {
4328
- const k = keys[0];
4329
- const v = value[k];
4330
- const tag = intrinsicShorthandFor(k);
4331
- if (tag) return makeIntrinsicNode(tag, v, doc);
4332
- }
4333
- const map = new YAMLMap();
4334
- for (const [k, v] of Object.entries(value)) map.items.push(new Pair(doc.createNode(k), jsToYamlNode(v, doc)));
4335
- return map;
4336
- }
4337
- function intrinsicShorthandFor(key) {
4338
- if (key === "Ref") return "!Ref";
4339
- if (key === "Condition") return "!Condition";
4340
- if (!key.startsWith("Fn::")) return null;
4341
- const name = key.slice(4);
4342
- if (name === "Transform") return "!Transform";
4343
- if (name === "GetAtt") return "!GetAtt";
4344
- if (FN_TAGS.includes(name)) return `!${name}`;
4345
- return null;
4346
- }
4347
- function makeIntrinsicNode(tag, value, doc) {
4348
- if (tag === "!Ref" || tag === "!Condition") {
4349
- const s = new Scalar(typeof value === "string" ? value : String(value));
4350
- s.tag = tag;
4351
- return s;
4352
- }
4353
- if (tag === "!GetAtt") {
4354
- if (Array.isArray(value) && value.length === 2 && typeof value[0] === "string" && typeof value[1] === "string") {
4355
- const s = new Scalar(`${value[0]}.${value[1]}`);
4356
- s.tag = tag;
4357
- return s;
4358
- }
4359
- const node = jsToYamlNode(value, doc);
4360
- node.tag = tag;
4361
- return node;
4362
- }
4363
- const node = jsToYamlNode(value, doc);
4364
- node.tag = tag;
4365
- return node;
4366
- }
4367
- function detectTemplateFormat(text) {
4368
- const trimmed = (text.charCodeAt(0) === 65279 ? text.slice(1) : text).trimStart();
4369
- if (trimmed.length === 0) return "json";
4370
- const first = trimmed.charCodeAt(0);
4371
- if (first === 123 || first === 91) return "json";
4372
- return "yaml";
4373
- }
4374
- function parseCfnTemplateWithFormat(text) {
4375
- const format = detectTemplateFormat(text);
4376
- return {
4377
- template: parseCfnTemplate(text),
4378
- format
4379
- };
4380
- }
4381
-
4382
- // src/cli/commands/retire-cfn-stack/retain-injection.ts
4383
- async function uploadTemplateForUpdateStack(args) {
4384
- return uploadCfnTemplate({
4385
- bucket: args.bucket,
4386
- body: args.body,
4387
- stackName: args.cfnStackName,
4388
- ...args.format && { format: args.format },
4389
- ...args.s3ClientOpts && { s3ClientOpts: args.s3ClientOpts }
4390
- });
4129
+ // src/cli/commands/diff-recursive/nested-template.ts
4130
+ const EMPTY_TEMPLATE = { Resources: {} };
4131
+ function isAbsoluteCrossPlatform(p) {
4132
+ return path.isAbsolute(p) || /^[a-zA-Z]:[\\/]/.test(p) || p.startsWith("\\\\");
4391
4133
  }
4392
- function injectRetainPolicies(templateBody, cfnStackName) {
4393
- const format = detectTemplateFormat(templateBody);
4394
- let parsed;
4134
+ function readNestedTemplate(templatePath) {
4135
+ let raw;
4395
4136
  try {
4396
- parsed = parseCfnTemplate(templateBody);
4137
+ raw = fs.readFileSync(templatePath, "utf-8");
4397
4138
  } catch (err) {
4398
- throw new Error(`Template for '${cfnStackName}' is not a valid CloudFormation template. cdkd's --migrate-from-cloudformation flow supports both JSON and YAML templates (YAML via a CFn-aware codec that preserves !Ref / !GetAtt / !Sub shorthand). Cause: ${describeAwsFailure(err).detail}`);
4399
- }
4400
- if (!("Resources" in parsed) || typeof parsed["Resources"] !== "object" || parsed["Resources"] === null || Array.isArray(parsed["Resources"])) throw new Error(`Template for '${cfnStackName}' has no Resources section — refusing to retire.`);
4401
- const modified = injectRetainPoliciesOnParsedResources(parsed["Resources"]);
4402
- return {
4403
- body: stringifyCfnTemplate(parsed, format),
4404
- modified,
4405
- format
4406
- };
4407
- }
4408
- function templateContainsNestedStackRows(templateBody) {
4409
- let parsed;
4410
- try {
4411
- parsed = parseCfnTemplate(templateBody);
4412
- } catch {
4413
- return false;
4414
- }
4415
- const resources = parsed["Resources"];
4416
- if (!resources || typeof resources !== "object" || Array.isArray(resources)) return false;
4417
- for (const resource of Object.values(resources)) {
4418
- if (!resource || typeof resource !== "object" || Array.isArray(resource)) continue;
4419
- if (resource["Type"] === "AWS::CloudFormation::Stack") return true;
4420
- }
4421
- return false;
4422
- }
4423
- function injectRetainPoliciesOnParsedResources(resources) {
4424
- let modified = false;
4425
- for (const [, resource] of Object.entries(resources)) {
4426
- if (!resource || typeof resource !== "object" || Array.isArray(resource)) continue;
4427
- const r = resource;
4428
- if (r["Type"] === "AWS::CloudFormation::Stack") continue;
4429
- if (r["DeletionPolicy"] !== "Retain") {
4430
- r["DeletionPolicy"] = "Retain";
4431
- modified = true;
4432
- }
4433
- if (r["UpdateReplacePolicy"] !== "Retain") {
4434
- r["UpdateReplacePolicy"] = "Retain";
4435
- modified = true;
4436
- }
4139
+ throw new Error(`Failed to read nested template at ${displayAssemblyPath(templatePath)}: ${describeFileReadFailure(err, templatePath)}`);
4437
4140
  }
4438
- return modified;
4439
- }
4440
- async function injectRetainPoliciesRecursive(rootTemplateBody, rootCfnStackName, rootTree, deps) {
4441
- const cleanups = [];
4442
4141
  try {
4443
- return {
4444
- ...await injectRetainPoliciesRecursiveInternal(rootTemplateBody, rootCfnStackName, rootTree, deps, cleanups),
4445
- cleanups
4446
- };
4142
+ return JSON.parse(raw);
4447
4143
  } catch (err) {
4448
- throw new RecursiveRetainInjectionError(describeAwsFailure(err).detail, cleanups, err instanceof Error ? err : void 0);
4144
+ throw new Error(`Failed to parse nested template at ${displayAssemblyPath(templatePath)}: ${describeFileReadFailure(err, templatePath)}`);
4449
4145
  }
4450
4146
  }
4451
- var RecursiveRetainInjectionError = class extends Error {
4452
- cleanups;
4453
- cause;
4454
- constructor(message, cleanups, cause) {
4455
- super(message);
4456
- this.name = "RecursiveRetainInjectionError";
4457
- this.cleanups = cleanups;
4458
- if (cause) this.cause = cause;
4459
- }
4460
- };
4461
- async function injectRetainPoliciesRecursiveInternal(templateBody, cfnStackName, tree, deps, cleanups) {
4462
- const format = detectTemplateFormat(templateBody);
4463
- let parsed;
4464
- try {
4465
- parsed = parseCfnTemplate(templateBody);
4466
- } catch (err) {
4467
- throw new Error(`Template for '${cfnStackName}' is not a valid CloudFormation template. cdkd's --migrate-from-cloudformation flow supports both JSON and YAML templates (YAML via a CFn-aware codec that preserves !Ref / !GetAtt / !Sub shorthand). Cause: ${describeAwsFailure(err).detail}`);
4468
- }
4469
- if (!("Resources" in parsed) || typeof parsed["Resources"] !== "object" || parsed["Resources"] === null || Array.isArray(parsed["Resources"])) throw new Error(`Template for '${cfnStackName}' has no Resources section — refusing to retire.`);
4470
- const resources = parsed["Resources"];
4471
- let modified = false;
4472
- for (const [logicalId, resource] of Object.entries(resources)) {
4473
- if (!resource || typeof resource !== "object" || Array.isArray(resource)) continue;
4474
- const r = resource;
4475
- if (r["Type"] !== "AWS::CloudFormation::Stack") continue;
4476
- const childNode = tree.nested.get(logicalId);
4477
- if (!childNode) throw new Error(`Template for '${cfnStackName}' has nested-stack '${logicalId}' (Type: ${NESTED_STACK_RESOURCE_TYPE}) but the CloudFormation resource tree has no matching child entry. AWS may have removed the child since DescribeStackResources ran, or the template was hand-edited mid-flight — re-run ${proseQuoted(cdkdRemedy("cdkd import", "--migrate-from-cloudformation"), "`")} to refresh.`);
4478
- const childTpl = await deps.cfnClient.send(new GetTemplateCommand({
4479
- StackName: childNode.physicalId,
4480
- TemplateStage: "Original"
4481
- }));
4482
- if (!childTpl.TemplateBody) throw new Error(`GetTemplate returned no body for nested stack '${logicalId}' (physicalId='${childNode.physicalId}', parent='${cfnStackName}').`);
4483
- const childResult = await injectRetainPoliciesRecursiveInternal(childTpl.TemplateBody, childNode.stackName, childNode, deps, cleanups);
4484
- if (childResult.modified) {
4485
- if (childResult.body.length > TEMPLATE_URL_LIMIT) throw new Error(`Modified nested-stack template for '${logicalId}' is ${childResult.body.length} bytes, exceeds the CloudFormation TemplateURL limit (${TEMPLATE_URL_LIMIT}). cdkd state has not been written; shrink the child template and retry, or retire the stack manually: (1) UpdateStack with Retain policies on the parent and each child, (2) cdkd import, (3) DeleteStack on the parent.`);
4486
- const uploaded = await uploadCfnTemplate({
4487
- bucket: deps.stateBucket,
4488
- body: childResult.body,
4489
- stackName: `${cfnStackName}__nested__${logicalId}`,
4490
- format: childResult.format,
4491
- ...deps.s3ClientOpts && { s3ClientOpts: deps.s3ClientOpts }
4492
- });
4493
- cleanups.push(uploaded.cleanup);
4494
- const propsRaw = r["Properties"];
4495
- const props = propsRaw && typeof propsRaw === "object" && !Array.isArray(propsRaw) ? propsRaw : r["Properties"] = {};
4496
- props["TemplateURL"] = uploaded.url;
4497
- modified = true;
4498
- }
4147
+ function indexNestedChildTemplates(template, templatePath) {
4148
+ const dir = path.dirname(templatePath);
4149
+ const result = nullPrototypeRecord();
4150
+ for (const [logicalId, resource] of Object.entries(template.Resources ?? {})) {
4151
+ if (resource?.Type !== "AWS::CloudFormation::Stack") continue;
4152
+ const assetPath = resource.Metadata?.["aws:asset:path"];
4153
+ if (typeof assetPath !== "string" || assetPath.length === 0) continue;
4154
+ if (isAbsoluteCrossPlatform(assetPath)) throw new Error(`Nested stack ${displayIdent(logicalId)} has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which is absolute. CDK emits relative asset paths for nested templates; an absolute path indicates the synth output was hand-modified or generated by a non-CDK toolchain. Refusing to load.`);
4155
+ const resolved = resolveAssemblyPath(dir, assetPath);
4156
+ if (!resolved.contained) throw new Error(`Nested stack ${displayIdent(logicalId)} has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which ${renderAssemblyPathEscape(resolved, dir)}`);
4157
+ result[logicalId] = resolved.path;
4499
4158
  }
4500
- if (injectRetainPoliciesOnParsedResources(resources)) modified = true;
4501
- return {
4502
- body: stringifyCfnTemplate(parsed, format),
4503
- modified,
4504
- format
4505
- };
4159
+ return result;
4506
4160
  }
4507
4161
 
4508
- // src/cli/commands/retire-cfn-stack/resource-tree.ts
4509
- async function getCloudFormationResourceTree(rootStackName, cfnClient) {
4510
- return walkCfnStackTree(rootStackName, rootStackName, cfnClient);
4511
- }
4512
- async function walkCfnStackTree(stackName, physicalId, cfnClient) {
4513
- const resp = await cfnClient.send(new DescribeStackResourcesCommand({ StackName: physicalId }));
4514
- const resources = /* @__PURE__ */ new Map();
4515
- const nestedChildren = [];
4516
- for (const r of resp.StackResources ?? []) {
4517
- if (!r.LogicalResourceId || !r.PhysicalResourceId) continue;
4518
- resources.set(r.LogicalResourceId, r.PhysicalResourceId);
4519
- if (r.ResourceType === "AWS::CloudFormation::Stack") nestedChildren.push({
4520
- logicalId: r.LogicalResourceId,
4521
- childArn: r.PhysicalResourceId
4522
- });
4523
- }
4524
- const childPairs = await Promise.all(nestedChildren.map(async ({ logicalId, childArn }) => ({
4525
- logicalId,
4526
- node: await walkCfnStackTree(childArn, childArn, cfnClient)
4527
- })));
4528
- const nested = /* @__PURE__ */ new Map();
4529
- for (const { logicalId, node } of childPairs) nested.set(logicalId, node);
4530
- return {
4531
- stackName,
4532
- physicalId,
4533
- resources,
4534
- nested
4535
- };
4162
+ // src/cli/commands/diff-recursive/cross-stack-taint.ts
4163
+ function crossStackTaintSeedsOf(template, region, preview) {
4164
+ if (preview === void 0 || !preview.anyTainted()) return /* @__PURE__ */ new Set();
4165
+ return crossStackTaintSeeds(template, (source) => {
4166
+ if (source === void 0) return true;
4167
+ return source.kind === "export" ? preview.exportTainted(region, source.name) : preview.stackOutputTainted(source.region ?? region, source.stackName, source.outputName);
4168
+ });
4536
4169
  }
4537
- function findReplacedCfnResources(before, after, nestedPath = []) {
4538
- const replaced = [];
4539
- for (const [logicalId, beforeId] of before.resources) {
4540
- const afterId = after.resources.get(logicalId);
4541
- if (afterId !== void 0 && afterId !== beforeId) replaced.push({
4542
- nestedPath,
4543
- logicalId,
4544
- before: beforeId,
4545
- after: afterId
4546
- });
4547
- }
4548
- for (const [childLogicalId, beforeChild] of before.nested) {
4549
- const afterChild = after.nested.get(childLogicalId);
4550
- if (afterChild) replaced.push(...findReplacedCfnResources(beforeChild, afterChild, [...nestedPath, childLogicalId]));
4551
- }
4552
- return replaced;
4170
+ function producerReadsSecretFedName(tainted) {
4171
+ if (tainted === void 0 || tainted.size === 0) return void 0;
4172
+ return (value) => readsTainted(value, tainted);
4553
4173
  }
4554
- async function tryGetCloudFormationResourceMap(stackName, cfnClient) {
4555
- const logger = getLogger();
4556
- let resp;
4557
- try {
4558
- resp = await cfnClient.send(new DescribeStackResourcesCommand({ StackName: stackName }));
4559
- } catch (err) {
4560
- if (isStackNotFoundError(err)) {
4561
- logger.debug(`No CloudFormation stack named '${stackName}'.`);
4562
- return null;
4563
- }
4564
- const reason = describeAwsFailure(err).detail;
4565
- const subject = isPasteableIdent(stackName) ? `CloudFormation stack '${stackName}'` : "a CloudFormation stack whose name is not a plain identifier";
4566
- logger.warn(`Could not read ${subject} to resolve physical IDs (${reason}).\nFalling back to per-resource lookup; resources whose physical name CloudFormation generated may be reported as not found. Grant cloudformation:DescribeStackResources, or pass --resource ${commandHole("LogicalId")}=${commandHole("physicalId")} for those resources.`);
4567
- return null;
4568
- }
4569
- const resources = /* @__PURE__ */ new Map();
4570
- for (const r of resp.StackResources ?? []) {
4571
- if (!r.LogicalResourceId || !r.PhysicalResourceId) continue;
4572
- resources.set(r.LogicalResourceId, r.PhysicalResourceId);
4573
- }
4574
- return resources;
4174
+ const MAX_NESTED_DEPTH$2 = 32;
4175
+ function taintedOutputsOf(template, tainted) {
4176
+ if (tainted.size === 0) return [];
4177
+ return Object.entries(template.Outputs ?? {}).filter(([, raw]) => {
4178
+ const output = raw;
4179
+ return readsTainted(output?.Value, tainted) || readsTainted(output?.Export, tainted);
4180
+ });
4575
4181
  }
4576
- function isStackNotFoundError(err) {
4577
- const name = err?.name;
4578
- const message = err?.message ?? "";
4579
- return name === "ValidationError" && /does not exist/i.test(message);
4182
+ function readChild(path, cache) {
4183
+ if (!cache.has(path)) try {
4184
+ const template = readNestedTemplate(path);
4185
+ cache.set(path, {
4186
+ template,
4187
+ children: indexNestedChildTemplates(template, path)
4188
+ });
4189
+ } catch {
4190
+ cache.set(path, null);
4191
+ }
4192
+ return cache.get(path) ?? null;
4193
+ }
4194
+ function subtreeTaintedNames(template, nestedTemplates, passed, preview, walk = {}) {
4195
+ const seeds = [...passed, ...crossStackTaintSeedsOf(template, "", preview)];
4196
+ let tainted = taintedNamesOf(template, seeds);
4197
+ const ancestors = walk.ancestors ?? /* @__PURE__ */ new Set();
4198
+ const depth = walk.depth ?? 0;
4199
+ if (nestedTemplates === void 0 || depth >= MAX_NESTED_DEPTH$2) return tainted;
4200
+ const cache = walk.cache ?? /* @__PURE__ */ new Map();
4201
+ const rows = /* @__PURE__ */ new Set();
4202
+ for (const [logicalId, raw] of Object.entries(template.Resources ?? {})) {
4203
+ if (raw?.Type !== "AWS::CloudFormation::Stack" || !Object.hasOwn(nestedTemplates, logicalId)) continue;
4204
+ const childPath = nestedTemplates[logicalId];
4205
+ if (ancestors.has(childPath)) continue;
4206
+ const child = readChild(childPath, cache);
4207
+ if (child === null) continue;
4208
+ const parameters = raw.Properties?.Parameters;
4209
+ const childPassed = [];
4210
+ if (parameters !== null && typeof parameters === "object" && !Array.isArray(parameters)) {
4211
+ for (const [key, value] of Object.entries(parameters)) if (readsTainted(value, tainted) || templateMixesDynamicReference(value)) childPassed.push(key);
4212
+ }
4213
+ const childTainted = subtreeTaintedNames(child.template, child.children, childPassed, preview, {
4214
+ ...walk,
4215
+ cache,
4216
+ ancestors: /* @__PURE__ */ new Set([...ancestors, childPath]),
4217
+ depth: depth + 1
4218
+ });
4219
+ const outputs = taintedOutputsOf(child.template, childTainted);
4220
+ for (const [name, output] of outputs) walk.onChildOutput?.(childPath, name, output);
4221
+ if (outputs.length > 0) rows.add(logicalId);
4222
+ }
4223
+ if (rows.size > 0) tainted = taintedNamesOf(template, [...seeds, ...rows]);
4224
+ return tainted;
4580
4225
  }
4581
-
4582
- // src/cli/commands/retire-cfn-stack/prepare.ts
4583
- async function drainTemplateUploads(cleanups, stateBucket, labels) {
4584
- const logger = getLogger();
4585
- for (const cleanup of cleanups) try {
4586
- await cleanup();
4587
- } catch (cleanupErr) {
4588
- const msg = describeAwsFailure(cleanupErr).detail;
4589
- logger.warn(`Failed to delete ${labels.what} from '${stateBucket}'${labels.when ? ` ${labels.when}` : ""}. Clean up manually under prefix '${MIGRATE_TMP_PREFIX}/'. Cause: ${msg}`);
4226
+ function exportNameOf(output, stackName) {
4227
+ if (output?.Export === void 0) return void 0;
4228
+ const name = output.Export.Name;
4229
+ if (typeof name === "string") return name;
4230
+ const sub = name?.["Fn::Sub"];
4231
+ if (stackName !== void 0 && name !== null && typeof name === "object" && Object.keys(name).length === 1 && typeof sub === "string") {
4232
+ const resolved = sub.split("${AWS::StackName}").join(stackName);
4233
+ if (!resolved.includes("${")) return resolved;
4590
4234
  }
4235
+ return null;
4591
4236
  }
4592
- async function prepareCloudFormationStackRetirement(options) {
4593
- const logger = getLogger();
4594
- const { cfnStackName, cfnClient, yes, stateBucket, s3ClientOpts, resourceTree } = options;
4595
- if (resourceTree && resourceTree.stackName !== cfnStackName) throw new Error(`prepareCloudFormationStackRetirement: caller-supplied resourceTree.stackName='${resourceTree.stackName}' does not match cfnStackName='${cfnStackName}'. The tree's root must be the stack being retired.`);
4596
- logger.info(`[1/4] Inspecting CloudFormation stack '${cfnStackName}'...`);
4597
- const stack = (await cfnClient.send(new DescribeStacksCommand({ StackName: cfnStackName }))).Stacks?.[0];
4598
- if (!stack) throw new Error(`CloudFormation stack '${cfnStackName}' not found.`);
4599
- const status = stack.StackStatus ?? "";
4600
- if (!STABLE_TERMINAL_STATUSES.has(status)) throw new Error(`CloudFormation stack '${cfnStackName}' is in status '${status}', which is not a stable terminal state. Wait for the stack to settle (or roll back) before retiring it.`);
4601
- const capabilities = stack.Capabilities ?? [];
4602
- const tpl = await cfnClient.send(new GetTemplateCommand({
4603
- StackName: cfnStackName,
4604
- TemplateStage: "Original"
4605
- }));
4606
- if (!tpl.TemplateBody) throw new Error(`GetTemplate returned no body for '${cfnStackName}'.`);
4607
- const nestedCleanups = [];
4608
- const hasNestedChildren = templateContainsNestedStackRows(tpl.TemplateBody);
4609
- let newBody;
4610
- let modified;
4611
- let format;
4612
- if (hasNestedChildren) {
4613
- const tree = resourceTree ?? await getCloudFormationResourceTree(cfnStackName, cfnClient);
4614
- try {
4615
- const recursive = await injectRetainPoliciesRecursive(tpl.TemplateBody, cfnStackName, tree, {
4616
- cfnClient,
4617
- stateBucket,
4618
- ...s3ClientOpts && { s3ClientOpts }
4619
- });
4620
- newBody = recursive.body;
4621
- modified = recursive.modified;
4622
- format = recursive.format;
4623
- nestedCleanups.push(...recursive.cleanups);
4624
- } catch (err) {
4625
- if (err instanceof RecursiveRetainInjectionError) await drainTemplateUploads(err.cleanups, stateBucket, {
4626
- what: "partial nested-template upload",
4627
- when: "during error recovery"
4628
- });
4629
- throw err;
4630
- }
4631
- } else ({body: newBody, modified, format} = injectRetainPolicies(tpl.TemplateBody, cfnStackName));
4632
- if (!yes) {
4633
- let proceed = false;
4634
- try {
4635
- proceed = await confirmPrompt$6(`Set DeletionPolicy=Retain and UpdateReplacePolicy=Retain on every resource in CloudFormation stack '${cfnStackName}', and delete the stack once cdkd state is written? AWS resources will NOT be deleted.`);
4636
- } finally {
4637
- if (!proceed) await drainTemplateUploads(nestedCleanups, stateBucket, {
4638
- what: "temporary nested-template upload",
4639
- when: "during cancel cleanup"
4640
- });
4641
- }
4642
- if (!proceed) {
4643
- logger.info("CloudFormation stack retirement cancelled. The stack is unchanged and will not be deleted.");
4644
- return { outcome: "cancelled" };
4645
- }
4646
- }
4647
- let templateUpdated = false;
4648
- if (!modified) {
4649
- logger.info(`[2/4] Template already has Retain on every resource — skipping UpdateStack.`);
4650
- await drainTemplateUploads(nestedCleanups, stateBucket, { what: "temporary nested-template upload" });
4651
- } else {
4652
- logger.info(`[2/4] Injected DeletionPolicy=Retain and UpdateReplacePolicy=Retain.`);
4653
- if (newBody.length > TEMPLATE_URL_LIMIT) throw new Error(`Modified template is ${newBody.length} bytes, exceeds the CloudFormation UpdateStack TemplateURL limit (${TEMPLATE_URL_LIMIT}). cdkd state has not been written; shrink or split the template and retry. ` + MANUAL_RETIREMENT_ROUTE);
4654
- let updateInput;
4655
- let s3Cleanup;
4656
- if (newBody.length <= TEMPLATE_BODY_LIMIT) updateInput = { TemplateBody: newBody };
4657
- else {
4658
- logger.info(` Template is ${newBody.length} bytes (over ${TEMPLATE_BODY_LIMIT} inline limit) — uploading to state bucket '${stateBucket}'.`);
4659
- const uploaded = await uploadTemplateForUpdateStack({
4660
- bucket: stateBucket,
4661
- body: newBody,
4662
- cfnStackName,
4663
- format,
4664
- ...s3ClientOpts && { s3ClientOpts }
4665
- });
4666
- updateInput = { TemplateURL: uploaded.url };
4667
- s3Cleanup = uploaded.cleanup;
4668
- }
4669
- try {
4670
- logger.info(`[3/4] Updating CloudFormation stack with Retain policies...`);
4671
- let updateRan = false;
4672
- try {
4673
- const previousParameters = (stack.Parameters ?? []).map((p) => ({
4674
- ParameterKey: p.ParameterKey,
4675
- UsePreviousValue: true
4676
- }));
4677
- await cfnClient.send(new UpdateStackCommand({
4678
- StackName: cfnStackName,
4679
- ...updateInput,
4680
- Capabilities: capabilities,
4681
- ...previousParameters.length > 0 && { Parameters: previousParameters }
4682
- }));
4683
- updateRan = true;
4684
- } catch (err) {
4685
- const msg = describeAwsFailure(err).detail;
4686
- if (/No updates are to be performed/i.test(msg)) logger.info(` CloudFormation reports no updates needed.`);
4687
- else throw new RetainUpdateFailedError(cfnStackName, "rejected", err);
4688
- }
4689
- if (updateRan) {
4690
- try {
4691
- await waitUntilStackUpdateComplete({
4692
- client: cfnClient,
4693
- maxWaitTime: 1800,
4694
- minDelay: 5,
4695
- maxDelay: 10
4696
- }, { StackName: cfnStackName });
4697
- } catch (err) {
4698
- throw new RetainUpdateFailedError(cfnStackName, "unfinished", err);
4237
+ function markAppProducerTaint(preview, stacks) {
4238
+ const topLevel = new Set(stacks.map((stack) => stack.stackName));
4239
+ const cache = /* @__PURE__ */ new Map();
4240
+ let grew = true;
4241
+ while (grew) {
4242
+ grew = false;
4243
+ for (const { stackName, template, nestedTemplates } of stacks) {
4244
+ const tainted = subtreeTaintedNames(template, nestedTemplates, [], preview, {
4245
+ cache,
4246
+ onChildOutput: (childPath, outputName, output) => {
4247
+ if (preview.markTainted(childPath, outputName, exportNameOf(output, void 0))) grew = true;
4248
+ preview.markNestedOutputsTainted(topLevel);
4699
4249
  }
4700
- templateUpdated = true;
4701
- }
4702
- } finally {
4703
- await drainTemplateUploads([...s3Cleanup ? [s3Cleanup] : [], ...nestedCleanups], stateBucket, { what: "temporary template upload" });
4250
+ });
4251
+ for (const [outputName, output] of taintedOutputsOf(template, tainted)) if (preview.markTainted(stackName, outputName, exportNameOf(output, stackName))) grew = true;
4704
4252
  }
4705
4253
  }
4706
- return {
4707
- outcome: "ready",
4708
- templateUpdated
4709
- };
4710
- }
4711
- async function confirmPrompt$6(prompt) {
4712
- return confirmOrRefuse(prompt, { refusal: `The CloudFormation stack retirement confirmation prompt cannot run in a non-interactive environment. Pass -y / --yes on ${cdkdRemedy("cdkd import", "--migrate-from-cloudformation")}. Alternatively, run it from a real terminal. Nothing has been written yet: cdkd state and the CloudFormation stack are unchanged, so re-running with -y / --yes is the whole recovery.` });
4713
- }
4714
-
4715
- // src/cli/commands/retire-cfn-stack/delete-stack.ts
4716
- async function deleteRetiredCloudFormationStack(cfnStackName, cfnClient) {
4717
- const logger = getLogger();
4718
- logger.info(`[4/4] Deleting CloudFormation stack '${cfnStackName}' (resources retained)...`);
4719
- try {
4720
- await cfnClient.send(new DeleteStackCommand({ StackName: cfnStackName }));
4721
- await waitUntilStackDeleteComplete({
4722
- client: cfnClient,
4723
- maxWaitTime: 1800,
4724
- minDelay: 5,
4725
- maxDelay: 10
4726
- }, { StackName: cfnStackName });
4727
- } catch (err) {
4728
- const error = /* @__PURE__ */ new Error(safeMsg`CloudFormation stack ${displaySafe(cfnStackName)} was NOT confirmed deleted: ` + safeMsg`${cfnFailureText(err)}. cdkd state is written and correct, and every resource ` + "carries DeletionPolicy=Retain, so deleting the stack deletes no resource. Delete the stack by hand once its cause is resolved (for example an export another stack still imports).");
4729
- error.cause = err;
4730
- throw error;
4731
- }
4732
- logger.info(`✓ CloudFormation stack '${cfnStackName}' retired. AWS resources are now solely managed by cdkd.`);
4733
4254
  }
4734
4255
 
4735
4256
  // src/cli/commands/diff-recursive/refusals.ts
@@ -4737,7 +4258,7 @@ function deployRefusesPropertiesReason(logicalIds) {
4737
4258
  return `${logicalIds.length} resource record(s) hold a 'properties' map that cannot be read. This preview repaired them to empty; 'cdkd deploy' refuses the record instead, so the deploy this previews will not start.`;
4738
4259
  }
4739
4260
  function nestedStackTypeChangeReason(tc) {
4740
- return `${displayIdent(tc.logicalId)}: Type changes from ${displayIdent(tc.currentType)} to ${displayIdent(tc.desiredType)}. cdkd does not replace a resource into or out of ${NESTED_STACK_RESOURCE_TYPE}; give the new resource a different logical id, or remove it in one deploy and add its replacement in the next.`;
4261
+ return `${displayIdent(tc.logicalId)}: Type changes from ${displayIdent(tc.currentType)} to ${displayIdent(tc.desiredType)}. cdkd does not replace a resource into or out of ${NESTED_STACK_RESOURCE_TYPE$1}; give the new resource a different logical id, or remove it in one deploy and add its replacement in the next.`;
4741
4262
  }
4742
4263
  function findUnroutableDropRefusals(template, stateResources, ccRouteUnavailableReason, conditionSettled = () => true) {
4743
4264
  const reasons = [];
@@ -4791,38 +4312,20 @@ function deployRefusesDroppedOrphanRowsReason(logicalIds) {
4791
4312
  return `${logicalIds.length} rollback-orphan record(s) in 'orphans' cannot be read as resources. This preview dropped them; 'cdkd deploy' refuses the record instead, so the deploy this previews will not start.`;
4792
4313
  }
4793
4314
  const EMPTY_ALLOW_SET = /* @__PURE__ */ new Set();
4794
-
4795
- // src/cli/commands/diff-recursive/nested-template.ts
4796
- const EMPTY_TEMPLATE = { Resources: {} };
4797
- function isAbsoluteCrossPlatform(p) {
4798
- return path.isAbsolute(p) || /^[a-zA-Z]:[\\/]/.test(p) || p.startsWith("\\\\");
4799
- }
4800
- function readNestedTemplate(templatePath) {
4801
- let raw;
4802
- try {
4803
- raw = fs.readFileSync(templatePath, "utf-8");
4804
- } catch (err) {
4805
- throw new Error(`Failed to read nested template at ${displayAssemblyPath(templatePath)}: ${describeFileReadFailure(err, templatePath)}`);
4806
- }
4807
- try {
4808
- return JSON.parse(raw);
4809
- } catch (err) {
4810
- throw new Error(`Failed to parse nested template at ${displayAssemblyPath(templatePath)}: ${describeFileReadFailure(err, templatePath)}`);
4811
- }
4812
- }
4813
- function indexNestedChildTemplates(template, templatePath) {
4814
- const dir = path.dirname(templatePath);
4815
- const result = nullPrototypeRecord();
4816
- for (const [logicalId, resource] of Object.entries(template.Resources ?? {})) {
4817
- if (resource?.Type !== "AWS::CloudFormation::Stack") continue;
4818
- const assetPath = resource.Metadata?.["aws:asset:path"];
4819
- if (typeof assetPath !== "string" || assetPath.length === 0) continue;
4820
- if (isAbsoluteCrossPlatform(assetPath)) throw new Error(`Nested stack ${displayIdent(logicalId)} has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which is absolute. CDK emits relative asset paths for nested templates; an absolute path indicates the synth output was hand-modified or generated by a non-CDK toolchain. Refusing to load.`);
4821
- const resolved = resolveAssemblyPath(dir, assetPath);
4822
- if (!resolved.contained) throw new Error(`Nested stack ${displayIdent(logicalId)} has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which ${renderAssemblyPathEscape(resolved, dir)}`);
4823
- result[logicalId] = resolved.path;
4824
- }
4825
- return result;
4315
+ function previewTypeAndServiceTokenRefusals(changes, stateResources, maskForLog) {
4316
+ const blocking = findNestedStackTypeChanges({
4317
+ changes,
4318
+ stateResources
4319
+ }).map(nestedStackTypeChangeReason);
4320
+ const serviceTokens = findServiceTokenRefusals({
4321
+ changes,
4322
+ stateResources
4323
+ });
4324
+ blocking.push(...serviceTokens.refused.map((refusal) => serviceTokenBlockingReason(refusal, maskForLog)));
4325
+ return {
4326
+ blocking,
4327
+ warnings: serviceTokens.deferred.map(deferredServiceTokenWarning)
4328
+ };
4826
4329
  }
4827
4330
 
4828
4331
  // src/cli/commands/diff-recursive/printing.ts
@@ -5843,7 +5346,7 @@ function noEchoFedChildParameters(parentStackRow, parentNoEchoParameters, parent
5843
5346
  })) fed.add(name);
5844
5347
  return fed;
5845
5348
  }
5846
- async function resolveChildStackParameters(parentStackRow, parentTemplate, parentState, region, parentStackName, stateBackend, parentParameters, parentConditions, cfnFallback, printingSecrets, attributeHealer, unresolvedKeys, trust, derivedNameSink, producerLookup, consumerAccount, secretTokens) {
5349
+ async function resolveChildStackParameters(parentStackRow, parentTemplate, parentState, region, parentStackName, stateBackend, parentParameters, parentConditions, cfnFallback, printingSecrets, attributeHealer, unresolvedKeys, trust, derivedNameSink, producerLookup, consumerAccount, secretTokens, crossStackPreview) {
5847
5350
  const rawParams = parentStackRow.Properties?.["Parameters"];
5848
5351
  if (!rawParams || typeof rawParams !== "object" || Array.isArray(rawParams)) return {};
5849
5352
  const inheritedStandIns = standInTokensOf(secretTokens?.inherited);
@@ -5864,6 +5367,7 @@ async function resolveChildStackParameters(parentStackRow, parentTemplate, paren
5864
5367
  secretNameSink: derivedNameSink ?? /* @__PURE__ */ new Map(),
5865
5368
  stateBackend,
5866
5369
  stackName: parentStackName,
5370
+ ...crossStackPreview && { crossStackPreview },
5867
5371
  stackIdTail: () => stackIdTailOf(parentState, parentStackName),
5868
5372
  stackIdOverride: () => parentState?.signalReceiverStackId,
5869
5373
  bestEffort: true,
@@ -6014,9 +5518,72 @@ async function previewNoEchoMacChanges(args) {
6014
5518
  return moved;
6015
5519
  }
6016
5520
 
5521
+ // src/cli/commands/diff-recursive/replace-resource-preview.ts
5522
+ async function previewReplaceResourceTargets(input) {
5523
+ if (input.targetIds === void 0 || input.targetIds.size === 0) return [];
5524
+ let replaced;
5525
+ try {
5526
+ const draft = new Map([...input.changes].map(([id, change]) => [id, { ...change }]));
5527
+ const plan = planReplaceResourceTargets(draft, input.targetIds);
5528
+ replaced = plan.replaced;
5529
+ for (const id of replaced) input.changes.set(id, draft.get(id));
5530
+ for (const target of plan.unreplaced) input.warn(renderUnreplacedTarget(input.stackName, target));
5531
+ } catch (error) {
5532
+ if (error instanceof CdkdError && error.code === "REPLACE_RESOURCE_REFUSED") return [error.message];
5533
+ throw error;
5534
+ }
5535
+ const stateful = async (check) => {
5536
+ try {
5537
+ await check();
5538
+ } catch (error) {
5539
+ if (!(error instanceof CdkdError && error.code === "STATEFUL_REPLACE_BLOCKED")) throw error;
5540
+ input.warn(`cdkd deploy refuses this plan unless --force-stateful-recreation is passed:\n${error.message}`);
5541
+ }
5542
+ };
5543
+ await stateful(() => refuseStatefulReplaceResourceTargets({
5544
+ targetIds: replaced,
5545
+ state: input.state,
5546
+ template: input.template,
5547
+ forceStatefulRecreation: false
5548
+ }));
5549
+ await stateful(() => refuseStatefulReplacedReaders({
5550
+ template: input.template,
5551
+ state: input.state,
5552
+ targetIds: replaced,
5553
+ conditions: input.conditions,
5554
+ forceStatefulRecreation: false,
5555
+ targetFlag: "--replace-resource"
5556
+ }));
5557
+ return [];
5558
+ }
5559
+ async function previewReplaceResourcePlan(input) {
5560
+ const { diff, settle, ...plan } = input;
5561
+ const changes = await diff(plan.targetIds);
5562
+ const settled = await settle(changes);
5563
+ const blocking = await previewReplaceResourceTargets({
5564
+ ...plan,
5565
+ changes
5566
+ });
5567
+ if (blocking.length === 0 || plan.targetIds === void 0) return {
5568
+ changes,
5569
+ settled,
5570
+ blocking
5571
+ };
5572
+ const unseeded = await diff(void 0, true);
5573
+ return {
5574
+ changes: unseeded,
5575
+ settled: await settle(unseeded),
5576
+ blocking
5577
+ };
5578
+ }
5579
+ function withoutWarnings(calculator) {
5580
+ const logger = Object.create(calculator.logger, { warn: { value: () => void 0 } });
5581
+ return Object.create(calculator, { logger: { value: logger } });
5582
+ }
5583
+
6017
5584
  // src/cli/commands/diff-recursive/compute-stack-diff.ts
6018
5585
  async function computeStackDiff(loadedState, template, region, stackName, stateBackend, diffCalculator, options = {}) {
6019
- const { parameters, canonicalizeProperties, ccRouteUnavailableReason, cfnFallback, producerLookup, consumerAccount, noEchoMacCache, macWriteOnlyLookups, inheritSecretBearingTemplate, inheritedSecrets, inheritedSecretTokens, inheritedDerivedNames, attributeHealer: unboundAttributeHealer, readLiveDbInstanceZone, parentUnresolvedParameters, inheritedNoEchoParameters, inheritedNoEchoParametersAnyVerdict, ssmNameHeal = "apply", crossStackPreview, recordCrossStackPreview } = options;
5586
+ const { parameters, canonicalizeProperties, ccRouteUnavailableReason, cfnFallback, producerLookup, consumerAccount, noEchoMacCache, macWriteOnlyLookups, inheritSecretBearingTemplate, inheritedSecrets, inheritedSecretTokens, inheritedDerivedNames, attributeHealer: unboundAttributeHealer, readLiveDbInstanceZone, parentUnresolvedParameters, inheritedNoEchoParameters, inheritedNoEchoParametersAnyVerdict, ssmNameHeal = "apply", crossStackPreview, recordCrossStackPreview, secretFedNames } = options;
6020
5587
  const currentState = previewSsmNameHeal(loadedState, template, stackName, ssmNameHeal);
6021
5588
  let healResources = currentState.resources ?? {};
6022
5589
  let healNamingSecrets;
@@ -6142,48 +5709,66 @@ async function computeStackDiff(loadedState, template, region, stackName, stateB
6142
5709
  unbound: unboundParameterNames
6143
5710
  });
6144
5711
  const resourcesForInputs = stateForDiff.resources;
6145
- maskedInputs = { sources: {
6146
- template: effectiveTemplate,
6147
- parameterInput: classified.parameterInput,
6148
- conditions,
6149
- childTemplate: childTemplateLoader(options.nestedTemplates),
6150
- resolve: async (node) => {
6151
- const secrets = /* @__PURE__ */ new Map();
6152
- return {
6153
- value: await intrinsicResolver.resolve(structuredClone(node), {
6154
- recordedSecretValues: secrets,
6155
- secretNameNeedles: stateSecretNameNeedles(resourcesForInputs, liveNamingJudge(resourcesForInputs)),
6156
- secretNameSink: derivedNames,
6157
- template: effectiveTemplate,
6158
- resources: resourcesForInputs,
6159
- stateBackend,
6160
- stackName,
6161
- stackIdTail: () => stackIdTailOf(currentState, stackName),
6162
- stackIdOverride: () => currentState?.signalReceiverStackId,
6163
- bestEffort: true,
6164
- ...Object.keys(classified.bound).length > 0 && { parameters: classified.bound },
6165
- ...conditions && Object.keys(conditions).length > 0 && { conditions },
6166
- skipDynamicReferences: true,
6167
- staleAttributeHeal: { phase: "probe" }
6168
- }),
6169
- secrets
6170
- };
6171
- }
6172
- } };
5712
+ maskedInputs = {
5713
+ sources: {
5714
+ template: effectiveTemplate,
5715
+ parameterInput: classified.parameterInput,
5716
+ conditions,
5717
+ childTemplate: childTemplateLoader(options.nestedTemplates),
5718
+ resolve: async (node) => {
5719
+ const secrets = /* @__PURE__ */ new Map();
5720
+ return {
5721
+ value: await intrinsicResolver.resolve(structuredClone(node), {
5722
+ recordedSecretValues: secrets,
5723
+ secretNameNeedles: stateSecretNameNeedles(resourcesForInputs, liveNamingJudge(resourcesForInputs)),
5724
+ secretNameSink: derivedNames,
5725
+ template: effectiveTemplate,
5726
+ resources: resourcesForInputs,
5727
+ stateBackend,
5728
+ stackName,
5729
+ stackIdTail: () => stackIdTailOf(currentState, stackName),
5730
+ stackIdOverride: () => currentState?.signalReceiverStackId,
5731
+ bestEffort: true,
5732
+ ...Object.keys(classified.bound).length > 0 && { parameters: classified.bound },
5733
+ ...conditions && Object.keys(conditions).length > 0 && { conditions },
5734
+ skipDynamicReferences: true,
5735
+ staleAttributeHeal: { phase: "probe" }
5736
+ }),
5737
+ secrets
5738
+ };
5739
+ }
5740
+ },
5741
+ publicReferences: publicReferencesOf(diffSecrets, [
5742
+ diffSecrets,
5743
+ noEchoParameterValueSeed(effectiveTemplate.Parameters, mergedParameters, inheritedForResolver, parameters),
5744
+ inheritedSecrets
5745
+ ])
5746
+ };
6173
5747
  }
6174
- const changes = await diffCalculator.calculateDiff(stateForDiff, effectiveTemplate, resolveFn, canonicalizeProperties, void 0, void 0, maskForLog, void 0, maskedInputs, options.refusalRecovery, noEchoComparisonForTemplate(effectiveTemplate, namingConditions, mergedParameters, stateForDiff.resources, /* @__PURE__ */ new Set([region, stackName]), inheritedNoEchoParameters), {
5748
+ const diffWith = (forcedReplacements, quiet) => (quiet === true ? withoutWarnings(diffCalculator) : diffCalculator).calculateDiff(stateForDiff, effectiveTemplate, resolveFn, canonicalizeProperties, void 0, void 0, maskForLog, forcedReplacements, maskedInputs, options.refusalRecovery, noEchoComparisonForTemplate(effectiveTemplate, namingConditions, mergedParameters, stateForDiff.resources, /* @__PURE__ */ new Set([region, stackName]), inheritedNoEchoParameters), {
6175
5749
  ...options.inheritedReferenceProvenance && { inherited: options.inheritedReferenceProvenance },
6176
5750
  crossStackOutputs: crossStackOutputProvenanceSource(crossStackReads, crossStackReads, stateBackend)
6177
5751
  }, options.forcedNestedChildRuns, options.updatePolicy === true);
6178
- warnLegacySpelling(changes, effectiveTemplate, stackName, logger);
6179
- const childStackTags = await settleStackTagChildRuns({
6180
- changes,
6181
- template: effectiveTemplate,
6182
- stackTags: options.stackTags,
5752
+ const planned = await previewReplaceResourcePlan({
5753
+ diff: diffWith,
5754
+ settle: (rows) => settleStackTagChildRuns({
5755
+ changes: rows,
5756
+ template: effectiveTemplate,
5757
+ stackTags: options.stackTags,
5758
+ state: stateForDiff,
5759
+ resolve: resolveFn,
5760
+ secrets: diffSecrets
5761
+ }),
5762
+ targetIds: options.replaceResources,
5763
+ stackName,
6183
5764
  state: stateForDiff,
6184
- resolve: resolveFn,
6185
- secrets: diffSecrets
5765
+ template: effectiveTemplate,
5766
+ conditions: namingConditions ?? {},
5767
+ warn: (message) => logger.warn(printing.mask(message))
6186
5768
  });
5769
+ const { changes, settled: childStackTags } = planned;
5770
+ blocking = [...blocking, ...planned.blocking];
5771
+ warnLegacySpelling(changes, effectiveTemplate, stackName, logger);
6187
5772
  const macConditions = conditions === void 0 ? void 0 : Object.fromEntries(Object.entries(conditions).filter(([name]) => !stillUnknown.includes(name)));
6188
5773
  const macMoved = await previewNoEchoMacChanges({
6189
5774
  changes,
@@ -6209,17 +5794,9 @@ async function computeStackDiff(loadedState, template, region, stackName, stateB
6209
5794
  ...conditions !== void 0 && { conditions: Object.fromEntries(Object.entries(conditions).filter(([name]) => !stillUnknown.includes(name))) }
6210
5795
  }));
6211
5796
  if (noEchoReaders.length > 0) logger.info(safeMsg`Stack ${displayStackName(stackName)}: ${String(noEchoReaders.length)} unchanged resource(s) read a NoEcho parameter, whose value state holds only as ***: the deploy compares it with AWS, and updates a resource whose value changed.`);
6212
- const nestedStackTypeChanges = findNestedStackTypeChanges({
6213
- changes,
6214
- stateResources: stateForDiff.resources
6215
- });
6216
- if (nestedStackTypeChanges.length > 0) blocking = [...blocking, ...nestedStackTypeChanges.map(nestedStackTypeChangeReason)];
6217
- const serviceTokens = findServiceTokenRefusals({
6218
- changes,
6219
- stateResources: stateForDiff.resources
6220
- });
6221
- if (serviceTokens.refused.length > 0) blocking = [...blocking, ...serviceTokens.refused.map((refusal) => serviceTokenBlockingReason(refusal, maskForLog))];
6222
- for (const row of serviceTokens.deferred) logger.warn(printing.mask(deferredServiceTokenWarning(row)));
5797
+ const previewed = previewTypeAndServiceTokenRefusals(changes, stateForDiff.resources, maskForLog);
5798
+ blocking = [...blocking, ...previewed.blocking];
5799
+ for (const warning of previewed.warnings) logger.warn(printing.mask(warning));
6223
5800
  blocking = [...blocking, ...findUpdatePolicyReplacementRefusals(changes, effectiveTemplate, stateForDiff.stackInstanceId !== void 0, options.createRouteOf === void 0 ? void 0 : (logicalId, change) => replacementCreateRoutesToCloudControl(options.createRouteOf, change, stateForDiff.resources[logicalId]?.properties))];
6224
5801
  for (const reason of findUnwrittenCreateOnlyRefusals(changes, stateForDiff.resources, ccRouteUnavailableReason)) logger.warn(printing.mask(reason));
6225
5802
  if (ccRouteUnavailableReason !== void 0) {
@@ -6280,15 +5857,21 @@ async function computeStackDiff(loadedState, template, region, stackName, stateB
6280
5857
  diffOutputsAgainst,
6281
5858
  stackName
6282
5859
  });
6283
- if (crossStackPreview && recordCrossStackPreview) await recordProducerPreview(crossStackPreview, region, resolveFn, {
5860
+ const readsSecretFed = producerReadsSecretFedName(secretFedNames);
5861
+ const producer = {
6284
5862
  stackName,
6285
5863
  template: effectiveTemplate,
6286
- changes,
6287
5864
  desiredOutputs: resolved.outputs,
6288
5865
  storedOutputs: currentState.outputs,
5866
+ ...readsSecretFed && { readsSecretFedName: readsSecretFed }
5867
+ };
5868
+ if (crossStackPreview && recordCrossStackPreview) await recordProducerPreview(crossStackPreview, region, resolveFn, {
5869
+ ...producer,
5870
+ changes,
6289
5871
  ...knownConditions !== void 0 && { conditions: knownConditions },
6290
5872
  holdsSecret: (text) => printing.mask(text) !== text
6291
5873
  });
5874
+ else if (crossStackPreview && readsSecretFed) await markProducerTaint(crossStackPreview, resolveFn, producer);
6292
5875
  const printingSecrets = printing.corpus();
6293
5876
  let shownChanges = changes;
6294
5877
  let shownOutputChanges = outputChanges;
@@ -6398,337 +5981,6 @@ async function loadStateOrEmpty(stackName, region, stateBackend, refusalRecovery
6398
5981
  };
6399
5982
  }
6400
5983
 
6401
- // src/cli/commands/diff-recursive/passed-secret-display.ts
6402
- function isRecord$2(value) {
6403
- return value !== null && typeof value === "object" && !Array.isArray(value);
6404
- }
6405
- function isIntrinsic$2(value) {
6406
- const keys = Object.keys(value);
6407
- return keys.length === 1 && (keys[0] === "Ref" || keys[0].startsWith("Fn::"));
6408
- }
6409
- const SIDES = [
6410
- "oldValue",
6411
- "newValue",
6412
- "newValueTemplate"
6413
- ];
6414
- function recordOf(value) {
6415
- return isRecord$2(value) ? value : {};
6416
- }
6417
- function mixesDynamicReference(value) {
6418
- return typeof value === "string" && value.includes("{{resolve:") && !isSingleDynamicReferenceToken(value);
6419
- }
6420
- function holdsMixedDynamicReference(value) {
6421
- const pending = [value];
6422
- const seen = /* @__PURE__ */ new Set();
6423
- while (pending.length > 0) {
6424
- const next = pending.pop();
6425
- if (mixesDynamicReference(next)) return true;
6426
- if (next === null || typeof next !== "object" || seen.has(next)) continue;
6427
- seen.add(next);
6428
- if (Array.isArray(next)) pending.push(...next);
6429
- else for (const [key, leaf] of Object.entries(next)) pending.push(key, leaf);
6430
- }
6431
- return false;
6432
- }
6433
- function holdsDynamicReference(value) {
6434
- const pending = [value];
6435
- const seen = /* @__PURE__ */ new Set();
6436
- while (pending.length > 0) {
6437
- const next = pending.pop();
6438
- if (typeof next === "string" && next.includes("{{resolve:")) return true;
6439
- if (next === null || typeof next !== "object" || seen.has(next)) continue;
6440
- seen.add(next);
6441
- pending.push(...Object.values(next));
6442
- }
6443
- return false;
6444
- }
6445
- function templateMixesDynamicReference(value, depth = 0) {
6446
- if (typeof value === "string") return mixesDynamicReference(value);
6447
- if (!isRecord$2(value) || depth > 64) return holdsDynamicReference(value);
6448
- const branches = value["Fn::If"];
6449
- if (isIntrinsic$2(value) && Array.isArray(branches) && branches.length === 3) return templateMixesDynamicReference(branches[1], depth + 1) || templateMixesDynamicReference(branches[2], depth + 1);
6450
- return holdsDynamicReference(value);
6451
- }
6452
- function rowEntries(rowProperties) {
6453
- const entries = Object.entries(recordOf(rowProperties["Parameters"]));
6454
- const tags = rowProperties["Tags"];
6455
- if (Array.isArray(tags)) for (const tag of tags) entries.push([recordOf(tag)["Key"], recordOf(tag)["Value"]]);
6456
- else entries.push(...Object.entries(recordOf(tags)));
6457
- return entries;
6458
- }
6459
- const ANY_TAG_KEY = "*";
6460
- const TAG_KEYS_TAINTED = "*key*";
6461
- function readsTainted(node, tainted) {
6462
- if (tainted.size === 0) return false;
6463
- return readsNoEchoSource(node, {
6464
- parameters: tainted,
6465
- attributeIsNoEcho: (logicalId) => tainted.has(logicalId)
6466
- });
6467
- }
6468
- function mixedSecretRowKeys(rowProperties, resolvedChildParameters, tainted) {
6469
- const keys = /* @__PURE__ */ new Set();
6470
- for (const [key, value] of Object.entries(recordOf(rowProperties?.["Parameters"]))) if (readsTainted(value, tainted)) keys.add(key);
6471
- for (const [key, value] of Object.entries(resolvedChildParameters)) if (mixesDynamicReference(value)) keys.add(key);
6472
- return keys;
6473
- }
6474
- function taintedNamesOf(template, passed) {
6475
- const tainted = new Set(passed ?? []);
6476
- const resources = recordOf(template.Resources);
6477
- for (const [logicalId, raw] of Object.entries(resources)) {
6478
- const resource = recordOf(raw);
6479
- if (resource["Type"] !== "AWS::CloudFormation::Stack") continue;
6480
- if (rowEntries(recordOf(resource["Properties"])).some(([, value]) => templateMixesDynamicReference(value))) tainted.add(logicalId);
6481
- }
6482
- if (tainted.size === 0) return tainted;
6483
- let grew = true;
6484
- while (grew) {
6485
- grew = false;
6486
- for (const [logicalId, resource] of Object.entries(resources)) {
6487
- if (tainted.has(logicalId)) continue;
6488
- if (readsTainted(recordOf(resource)["Properties"], tainted)) {
6489
- tainted.add(logicalId);
6490
- grew = true;
6491
- }
6492
- }
6493
- }
6494
- return tainted;
6495
- }
6496
- function mixedSecretTagKeys(rowProperties, resolvedTags, tainted, inherited) {
6497
- const keys = new Set(inherited ?? []);
6498
- const tags = rowProperties?.["Tags"];
6499
- const pairs = Array.isArray(tags) ? tags.map((tag) => [recordOf(tag)["Key"], recordOf(tag)["Value"]]) : Object.entries(recordOf(tags));
6500
- const derived = (node) => templateMixesDynamicReference(node) || readsTainted(node, tainted);
6501
- for (const [key, value] of pairs) if (typeof key === "string" ? mixesDynamicReference(key) : derived(key)) keys.add("*").add(TAG_KEYS_TAINTED);
6502
- else if (derived(value)) keys.add(typeof key === "string" ? key : "*");
6503
- for (const [key, value] of Object.entries(resolvedTags ?? {})) if (mixesDynamicReference(key)) keys.add("*").add(TAG_KEYS_TAINTED);
6504
- else if (mixesDynamicReference(value)) keys.add(key);
6505
- return keys;
6506
- }
6507
- function maskTagValues(value, keys, isMap) {
6508
- const named = (key) => keys.has("*") || typeof key === "string" && keys.has(key);
6509
- if (Array.isArray(value)) {
6510
- const shown = value.map((element) => maskTagValues(element, keys, false));
6511
- return shown.every((element, index) => element === value[index]) ? value : shown;
6512
- }
6513
- if (!isRecord$2(value)) return value;
6514
- const isEntry = Object.hasOwn(value, "Key") && Object.hasOwn(value, "Value");
6515
- if (!isEntry && isMap && keys.has("*key*")) return "***";
6516
- let changed = false;
6517
- const shown = {};
6518
- for (const [key, leaf] of Object.entries(value)) {
6519
- let next;
6520
- if (isEntry && key === "Key" && keys.has("*key*")) next = "***";
6521
- else if (isEntry && key === "Value" && named(value["Key"])) next = "***";
6522
- else if (isMap && named(key) && !isRecord$2(leaf) && !Array.isArray(leaf)) next = "***";
6523
- else next = maskTagValues(leaf, keys, /tag/i.test(key));
6524
- if (next !== leaf) changed = true;
6525
- shown[key] = next;
6526
- }
6527
- return changed ? shown : value;
6528
- }
6529
- function maskTagProperty(change, keys) {
6530
- if (keys.size === 0 || !/tag/i.test(change.path)) return change;
6531
- const next = { ...change };
6532
- let changed = false;
6533
- for (const side of SIDES) {
6534
- if (!Object.prototype.hasOwnProperty.call(change, side) || change[side] === void 0) continue;
6535
- const shown = maskTagValues(change[side], keys, true);
6536
- if (shown !== change[side]) {
6537
- next[side] = shown;
6538
- changed = true;
6539
- }
6540
- }
6541
- return changed ? next : change;
6542
- }
6543
- function labelledWhenMaskedAlike(real, shown) {
6544
- const alike = (change) => JSON.stringify(change.oldValue) === JSON.stringify(change.newValue);
6545
- return alike(shown) && !alike(real) ? {
6546
- ...shown,
6547
- maskedExpressionChanged: true
6548
- } : shown;
6549
- }
6550
- function maskedSides(change) {
6551
- const masked = { ...change };
6552
- if (masked.oldValue !== void 0) masked.oldValue = "***";
6553
- if (masked.newValue !== void 0) masked.newValue = "***";
6554
- if (masked.newValueTemplate !== void 0) masked.newValueTemplate = "***";
6555
- return masked;
6556
- }
6557
- function maskParameterKeys(side, flagged) {
6558
- let changed = false;
6559
- const shown = {};
6560
- for (const [key, value] of Object.entries(side)) if (value !== "***" && flagged.has(key)) {
6561
- shown[key] = "***";
6562
- changed = true;
6563
- } else shown[key] = value;
6564
- return changed ? shown : side;
6565
- }
6566
- function maskRowParameters(change, templateValue, tainted) {
6567
- const present = SIDES.filter((side) => Object.prototype.hasOwnProperty.call(change, side) && change[side] !== void 0);
6568
- if ((!isRecord$2(templateValue) || isIntrinsic$2(templateValue)) && readsTainted(templateValue, tainted) || present.some((side) => !isRecord$2(change[side]) && holdsMixedDynamicReference(change[side]))) return maskedSides(change);
6569
- const raw = recordOf(templateValue);
6570
- const flagged = /* @__PURE__ */ new Set();
6571
- for (const [key, value] of Object.entries(raw)) if (readsTainted(value, tainted)) flagged.add(key);
6572
- for (const side of present) for (const [key, value] of Object.entries(recordOf(change[side]))) if (holdsMixedDynamicReference(value)) flagged.add(key);
6573
- if (flagged.size === 0) return change;
6574
- const next = { ...change };
6575
- let changed = false;
6576
- for (const side of present) {
6577
- const value = change[side];
6578
- if (!isRecord$2(value)) continue;
6579
- const shown = maskParameterKeys(value, flagged);
6580
- if (shown !== value) {
6581
- next[side] = shown;
6582
- changed = true;
6583
- }
6584
- }
6585
- return changed ? next : change;
6586
- }
6587
- function maskPassedSecretChanges(changes, template, tainted, tagKeys = /* @__PURE__ */ new Set()) {
6588
- const resources = recordOf(template.Resources);
6589
- let anyChanged = false;
6590
- const shown = /* @__PURE__ */ new Map();
6591
- for (const [logicalId, change] of changes) {
6592
- const resource = recordOf(Object.hasOwn(resources, logicalId) ? resources[logicalId] : void 0);
6593
- const properties = recordOf(resource["Properties"]);
6594
- const isNestedRow = change.resourceType === "AWS::CloudFormation::Stack" || resource["Type"] === "AWS::CloudFormation::Stack";
6595
- let changed = false;
6596
- const propertyChanges = change.propertyChanges?.map((propertyChange) => {
6597
- const templateValue = Object.hasOwn(properties, propertyChange.path) ? properties[propertyChange.path] : void 0;
6598
- const next = isNestedRow && propertyChange.path === "Parameters" ? maskRowParameters(propertyChange, templateValue, tainted) : readsTainted(templateValue, tainted) || isNestedRow && SIDES.some((side) => holdsMixedDynamicReference(propertyChange[side])) ? maskedSides(propertyChange) : maskTagProperty(propertyChange, tagKeys);
6599
- if (next === propertyChange) return next;
6600
- changed = true;
6601
- return labelledWhenMaskedAlike(propertyChange, next);
6602
- });
6603
- if (changed && propertyChanges !== void 0) {
6604
- anyChanged = true;
6605
- shown.set(logicalId, {
6606
- ...change,
6607
- propertyChanges
6608
- });
6609
- } else shown.set(logicalId, change);
6610
- }
6611
- return anyChanged ? shown : changes;
6612
- }
6613
- function maskPassedSecretOutputs(outputChanges, template, tainted) {
6614
- if (tainted.size === 0 || outputChanges.length === 0) return outputChanges;
6615
- const outputs = recordOf(template.Outputs);
6616
- const taintedValues = /* @__PURE__ */ new Set();
6617
- let taintedExportValue = false;
6618
- let taintedExportName = false;
6619
- for (const [name, rawOutput] of Object.entries(outputs)) {
6620
- const output = recordOf(rawOutput);
6621
- const exported = isRecord$2(output["Export"]) ? output["Export"] : void 0;
6622
- if (readsTainted(output["Value"], tainted)) {
6623
- taintedValues.add(name);
6624
- if (exported !== void 0) taintedExportValue = true;
6625
- }
6626
- if (exported !== void 0 && readsTainted(exported["Name"], tainted)) taintedExportName = true;
6627
- }
6628
- let anyChanged = false;
6629
- const shown = outputChanges.map((change) => {
6630
- const maskValues = Object.hasOwn(outputs, change.name) && taintedValues.has(change.name) || change.isExport && taintedExportValue;
6631
- const withholdName = change.isExport && taintedExportName;
6632
- if (!maskValues && !withholdName) return change;
6633
- const next = { ...change };
6634
- if (maskValues) {
6635
- if (next.oldValue !== void 0) next.oldValue = "***";
6636
- if (next.newValue !== void 0) next.newValue = "***";
6637
- }
6638
- if (withholdName) next.nameDisplay = { kind: "withheld" };
6639
- anyChanged = true;
6640
- return next;
6641
- });
6642
- return anyChanged ? shown : outputChanges;
6643
- }
6644
- function calculatorMaskingPassedSecretLines(calculator, template, tainted) {
6645
- if (tainted.size === 0) return calculator;
6646
- const prefixes = [];
6647
- for (const rawResource of Object.values(recordOf(template.Resources))) {
6648
- const resource = recordOf(rawResource);
6649
- if (typeof resource["Type"] !== "string") continue;
6650
- for (const [key, value] of Object.entries(recordOf(resource["Properties"]))) if (readsTainted(value, tainted)) prefixes.push(`Property ${key} of ${resource["Type"]} requires replacement (from `);
6651
- }
6652
- if (prefixes.length === 0) return calculator;
6653
- const inner = calculator.logger;
6654
- const logger = Object.create(inner);
6655
- logger.debug = (message, ...args) => {
6656
- const prefix = prefixes.find((candidate) => message.startsWith(candidate));
6657
- inner.debug(prefix === void 0 ? message : `${prefix}${"***"} to ${"***"})`, ...args);
6658
- };
6659
- const wrapped = Object.create(calculator);
6660
- Object.defineProperty(wrapped, "logger", {
6661
- value: logger,
6662
- enumerable: true
6663
- });
6664
- return wrapped;
6665
- }
6666
- function recordedValuesOf(resources, tainted) {
6667
- const needles = /* @__PURE__ */ new Map();
6668
- for (const name of tainted) {
6669
- const record = Object.hasOwn(resources, name) ? resources[name] : void 0;
6670
- if (record === void 0) continue;
6671
- const pending = [record.physicalId, record.attributes];
6672
- const seen = /* @__PURE__ */ new Set();
6673
- while (pending.length > 0) {
6674
- const next = pending.pop();
6675
- if (typeof next === "string") {
6676
- if (next.length > 0 && next !== "***") recordLogOnlyValue(needles, next);
6677
- } else if (next !== null && typeof next === "object" && !seen.has(next)) {
6678
- seen.add(next);
6679
- pending.push(...Object.values(next));
6680
- }
6681
- }
6682
- }
6683
- return needles;
6684
- }
6685
- function securityDiffWithPassedSecretWithheld(securityDiff, changes, template, tainted) {
6686
- const resources = recordOf(template.Resources);
6687
- if (![...changes.values()].some((change) => {
6688
- if (change.changeType === "NO_CHANGE" || !tainted.has(change.logicalId)) return false;
6689
- const properties = recordOf(recordOf(Object.hasOwn(resources, change.logicalId) ? resources[change.logicalId] : void 0)["Properties"]);
6690
- return (change.propertyChanges ?? []).some((propertyChange) => isScrutinizedProperty(change.resourceType, propertyChange.path) && Object.hasOwn(properties, propertyChange.path) && readsTainted(properties[propertyChange.path], tainted));
6691
- })) return securityDiff;
6692
- return async () => {
6693
- const shown = await securityDiff();
6694
- if (shown.rendered === "") return shown;
6695
- return {
6696
- ...shown,
6697
- rendered: SECURITY_TABLE_WITHHELD
6698
- };
6699
- };
6700
- }
6701
- const SECURITY_TABLE_WITHHELD = "IAM / security-group changes found; their table is withheld because this stack reads a parameter passed with a secret dynamic reference (go-to-k/cdkd#7068).";
6702
- function maskPassedSecretReasons(reasons, template, tainted, orphans) {
6703
- if (tainted.size === 0 || reasons.length === 0) return reasons;
6704
- const resources = recordOf(template.Resources);
6705
- const tokenPrefixes = [];
6706
- for (const logicalId of tainted) {
6707
- if (!Object.hasOwn(resources, logicalId)) continue;
6708
- if (readsTainted(recordOf(recordOf(resources[logicalId])["Properties"])["ServiceToken"], tainted)) tokenPrefixes.push(`${displayIdent(logicalId)}: ServiceToken changes to `);
6709
- }
6710
- const shownIds = [];
6711
- for (const orphan of Array.isArray(orphans) ? orphans : []) {
6712
- const entry = recordOf(orphan);
6713
- const record = recordOf(entry["state"]);
6714
- if (typeof entry["logicalId"] !== "string" || !tainted.has(entry["logicalId"])) continue;
6715
- if (typeof record["physicalId"] !== "string" || record["physicalId"] === "") continue;
6716
- shownIds.push(displaySafe(String(displayPhysicalId(record["resourceType"], record["physicalId"]))));
6717
- }
6718
- let changed = false;
6719
- const shown = reasons.map((reason) => {
6720
- let next = reason;
6721
- const prefix = tokenPrefixes.find((candidate) => next.startsWith(candidate));
6722
- const end = next.indexOf(SERVICE_TOKEN_REASON_TAIL);
6723
- if (prefix !== void 0 && end > prefix.length) next = `${prefix}${"***"}${next.slice(end)}`;
6724
- for (const id of shownIds) next = next.split(id).join("***");
6725
- if (next !== reason) changed = true;
6726
- return next;
6727
- });
6728
- return changed ? shown : reasons;
6729
- }
6730
- const SERVICE_TOKEN_REASON_TAIL = ", away from the handler its record names.";
6731
-
6732
5984
  // src/cli/commands/diff-recursive/routes.ts
6733
5985
  const SDK_MIGRATION_TOKEN = "returning to SDK provider";
6734
5986
  function diffReplaces(change, record) {
@@ -6768,7 +6020,7 @@ function childRowRunsEngine(row) {
6768
6020
  return row?.changeType === "UPDATE" && (row.propertyChanges?.length ?? 0) > 0;
6769
6021
  }
6770
6022
  async function buildDiffTree(args) {
6771
- const { stackName, displayName, region, template: synthTemplate, nestedTemplates, recursive, stateBackend, diffCalculator, parentHasSecretReference, parameters, parentUnresolvedParameters, canonicalizeProperties, ccRouteUnavailableReason, assetRedirect, cfnFallback, updatePolicy, createRouteOf, producerLookup, crossStackPreview, consumerAccount, previewOrphanAdoption, attributeHealerFor, liveDbInstanceZoneReaderFor, ancestorTemplatePaths, isNestedChild, ssmNameHeal, inheritedSecrets, inheritedDerivedNames, inheritedNoEchoParameters, inheritedNoEchoParametersAnyVerdict, refusalRecovery, inheritedReferenceProvenance, inheritedSecretTokens, stackTags, inheritedMixedSecretParameters, inheritedMixedSecretTagKeys } = args;
6023
+ const { stackName, displayName, region, template: synthTemplate, nestedTemplates, recursive, stateBackend, diffCalculator, parentHasSecretReference, parameters, parentUnresolvedParameters, canonicalizeProperties, ccRouteUnavailableReason, assetRedirect, cfnFallback, updatePolicy, replaceResources, createRouteOf, producerLookup, crossStackPreview, consumerAccount, previewOrphanAdoption, attributeHealerFor, liveDbInstanceZoneReaderFor, ancestorTemplatePaths, isNestedChild, ssmNameHeal, inheritedSecrets, inheritedDerivedNames, inheritedNoEchoParameters, inheritedNoEchoParametersAnyVerdict, refusalRecovery, inheritedReferenceProvenance, inheritedSecretTokens, stackTags, inheritedMixedSecretParameters, inheritedMixedSecretTagKeys } = args;
6772
6024
  const unboundHealer = attributeHealerFor?.(stackName, region);
6773
6025
  const stackTagged = applyStackTagsToTemplate(synthTemplate, stackTags, (line) => logger.warn(line));
6774
6026
  const { state, unreadable, unreadableContainers, deployRefusals, found } = await loadStateOrEmpty(stackName, region, stateBackend, refusalRecovery);
@@ -6786,9 +6038,13 @@ async function buildDiffTree(args) {
6786
6038
  });
6787
6039
  for (const row of nestedSsmCheck?.forcedRows ?? []) logger.info(nestedSsmNameRowNote(row));
6788
6040
  for (const row of nestedSsmCheck?.deferredRows ?? []) logger.info(nestedSsmNameDeferredNote(row));
6789
- const passedSecretNames = taintedNamesOf(template, inheritedMixedSecretParameters);
6041
+ const ownSecretNames = taintedNamesOf(template, inheritedMixedSecretParameters);
6042
+ const passedSecretNames = crossStackPreview?.anyTainted() ? subtreeTaintedNames(template, nestedTemplates, inheritedMixedSecretParameters ?? [], crossStackPreview, ancestorTemplatePaths ? { ancestors: ancestorTemplatePaths } : {}) : ownSecretNames;
6043
+ const readsTaintedCrossStack = passedSecretNames.size > ownSecretNames.size;
6790
6044
  const passedSecretRecordNeedles = recordedValuesOf(state.resources ?? {}, passedSecretNames);
6791
- const runComputeStackDiff = (run) => hasMaskableValues(passedSecretRecordNeedles) ? withPrintingSecrets(passedSecretRecordNeedles, run) : run();
6045
+ for (const value of readsTaintedCrossStack ? crossStackPreview?.taintedValues() ?? [] : []) recordLogOnlyValue(passedSecretRecordNeedles, value);
6046
+ const underPassedSecretNeedles = (run) => hasMaskableValues(passedSecretRecordNeedles) ? withPrintingSecrets(passedSecretRecordNeedles, run) : run();
6047
+ const runComputeStackDiff = underPassedSecretNeedles;
6792
6048
  let stackDiff;
6793
6049
  try {
6794
6050
  stackDiff = await runComputeStackDiff(() => computeStackDiff(state, template, region, stackName, stateBackend, calculatorMaskingPassedSecretLines(diffCalculator, template, passedSecretNames), {
@@ -6798,12 +6054,14 @@ async function buildDiffTree(args) {
6798
6054
  ...ccRouteUnavailableReason && { ccRouteUnavailableReason },
6799
6055
  ...cfnFallback !== void 0 && { cfnFallback },
6800
6056
  ...updatePolicy === true && { updatePolicy },
6057
+ ...replaceResources !== void 0 && !isNestedChild && { replaceResources },
6801
6058
  ...createRouteOf && { createRouteOf },
6802
6059
  ...producerLookup && { producerLookup },
6803
6060
  ...consumerAccount && { consumerAccount },
6804
6061
  ...crossStackPreview && {
6805
6062
  crossStackPreview,
6806
- recordCrossStackPreview: !isNestedChild
6063
+ recordCrossStackPreview: !isNestedChild,
6064
+ secretFedNames: passedSecretNames
6807
6065
  },
6808
6066
  ...previewOrphanAdoption && { previewOrphanAdoption },
6809
6067
  ...inheritedSecrets && { inheritedSecrets },
@@ -6861,7 +6119,7 @@ async function buildDiffTree(args) {
6861
6119
  if (resource?.Type !== "AWS::CloudFormation::Stack") continue;
6862
6120
  templateChildIds.add(logicalId);
6863
6121
  const childTemplatePath = nestedTemplates[logicalId];
6864
- if (!childTemplatePath) throw new Error(`Nested template file not found for ${NESTED_STACK_RESOURCE_TYPE} ${displayIdent(logicalId)} under stack ${displayStackName(stackName)}. Verify the synth output emits Metadata['aws:asset:path'] on this resource (CDK 2.x cdk.NestedStack does so by default), then re-run synth.`);
6122
+ if (!childTemplatePath) throw new Error(`Nested template file not found for ${NESTED_STACK_RESOURCE_TYPE$1} ${displayIdent(logicalId)} under stack ${displayStackName(stackName)}. Verify the synth output emits Metadata['aws:asset:path'] on this resource (CDK 2.x cdk.NestedStack does so by default), then re-run synth.`);
6865
6123
  const childStackName = `${stackName}~${logicalId}`;
6866
6124
  const resolvedChildPath = path.resolve(childTemplatePath);
6867
6125
  const childIdentity = templateIdentity(childTemplatePath);
@@ -6879,10 +6137,10 @@ async function buildDiffTree(args) {
6879
6137
  ]), void 0, stateAfterAdoption.resources);
6880
6138
  const rowDerivedNames = /* @__PURE__ */ new Map();
6881
6139
  const childSecretTokens = /* @__PURE__ */ new Map();
6882
- const childParameters = await resolveChildStackParameters(resource, effectiveTemplate, stateAfterAdoption, region, stackName, stateBackend, resolvedParameters, conditions, cfnFallback, printingSecrets, attributeHealer && healerUnderRecordPrintingBag(attributeHealer, () => stateAfterAdoption.resources ?? {}, namingSecretsFor), childUnresolvedParameters, trust, rowDerivedNames, producerLookup, consumerAccount, {
6140
+ const childParameters = await underPassedSecretNeedles(() => resolveChildStackParameters(resource, effectiveTemplate, stateAfterAdoption, region, stackName, stateBackend, resolvedParameters, conditions, cfnFallback, printingSecrets, attributeHealer && healerUnderRecordPrintingBag(attributeHealer, () => stateAfterAdoption.resources ?? {}, namingSecretsFor), childUnresolvedParameters, trust, rowDerivedNames, producerLookup, consumerAccount, {
6883
6141
  inherited: inheritedSecretTokens,
6884
6142
  child: childSecretTokens
6885
- });
6143
+ }, crossStackPreview));
6886
6144
  const childMixedSecretParameters = mixedSecretRowKeys(resource.Properties, childParameters, passedSecretNames);
6887
6145
  const childMixedSecretTagKeys = mixedSecretTagKeys(resource.Properties, stackDiff.childStackTags?.get(logicalId), passedSecretNames, inheritedMixedSecretTagKeys);
6888
6146
  const passedSecretNeedles = /* @__PURE__ */ new Map();
@@ -7369,7 +6627,19 @@ async function diffCommand(stacks, options) {
7369
6627
  else throw new Error(`Multiple stacks found: ${allStacks.map(describeStack).join(", ")}. Specify stack name(s) or use --all (top-level stacks; '**' for every stack)`);
7370
6628
  if (targetStacks.length === 0) throw new Error(renderNoStackMatch(stackPatterns, allStacks));
7371
6629
  refuseFailedLookups(targetStacks, allStacks, result.failedLookups);
6630
+ const replaceTargetIds = [...new Set(options.replaceResource ?? [])];
6631
+ const deployStacks = replaceTargetIds.length > 0 ? withDependencyStacks(targetStacks, allStacks) : targetStacks;
7372
6632
  await synthesizer.expandMacrosForStacks(targetStacks, synthOptions);
6633
+ if (replaceTargetIds.length > 0) {
6634
+ const dependencies = deployStacks.filter((stack) => !targetStacks.includes(stack));
6635
+ if (dependencies.length > 0) await synthesizer.expandMacrosForStacks(dependencies, synthOptions);
6636
+ checkReplaceResourceOptions(options, deployStacks);
6637
+ for (const id of replaceTargetIds) {
6638
+ if (targetStacks.some((stack) => Object.hasOwn(stack.template.Resources ?? {}, id))) continue;
6639
+ const owner = deployStacks.find((stack) => Object.hasOwn(stack.template.Resources ?? {}, id));
6640
+ if (owner !== void 0) logger.warn(safeMsg`--replace-resource ${id}: declared by ${owner.stackName}, a dependency stack the deploy includes unless -e is passed; diff that stack to preview its replacement.`);
6641
+ }
6642
+ }
7373
6643
  const stateConfig = {
7374
6644
  bucket: stateBucket,
7375
6645
  prefix: options.statePrefix
@@ -7467,6 +6737,7 @@ async function diffCommand(stacks, options) {
7467
6737
  const treeEnvs = [];
7468
6738
  const producerLookup = producerLookupOver(allStacks);
7469
6739
  const crossStackPreview = new CrossStackPreview();
6740
+ markAppProducerTaint(crossStackPreview, allStacks);
7470
6741
  const inferredProducers = inferCrossStackDepsByStack(targetStacks);
7471
6742
  targetStacks = orderProducersFirst(targetStacks, (stack) => [...stack.dependencyNames.flatMap((name) => stacksForDependency(name, stack, targetStacks)), ...inferredProducers.get(stack) ?? []]);
7472
6743
  const sharedNames = new Set(targetStacks.map((s) => s.stackName).filter((name, i, names) => names.indexOf(name) !== i));
@@ -7485,6 +6756,7 @@ async function diffCommand(stacks, options) {
7485
6756
  logger.debug(`Rewrote ${rewritten} asset reference(s) to cdkd asset storage in template of stack ${stackInfo.stackName}`);
7486
6757
  }
7487
6758
  const stackTags = stackTagsOverride ?? stackInfo.tags;
6759
+ const replaceResources = replaceResourcesForStack(options.replaceResource, stackInfo.stackName, stackInfo.template);
7488
6760
  trees.push(await buildDiffTree({
7489
6761
  stackName: stackInfo.stackName,
7490
6762
  displayName: shownName,
@@ -7501,6 +6773,7 @@ async function diffCommand(stacks, options) {
7501
6773
  ...assetRedirect && { assetRedirect },
7502
6774
  ...options.cfnFallback === false && { cfnFallback: false },
7503
6775
  ...resolveUpdatePolicy(options.updatePolicy) === true && { updatePolicy: true },
6776
+ ...replaceResources && { replaceResources: replaceResources.logicalIds },
7504
6777
  producerLookup,
7505
6778
  crossStackPreview,
7506
6779
  ...stackInfo.account && { consumerAccount: stackInfo.account },
@@ -7588,7 +6861,7 @@ async function diffCommand(stacks, options) {
7588
6861
  }
7589
6862
  }
7590
6863
  function createDiffCommand() {
7591
- const cmd = new Command("diff").description("Show difference between current state and desired state").argument("[stacks...]", "Stack name(s) to diff. Accepts CDK display paths (e.g. 'MyStage/Api') with wildcards ('MyStage/*', '**'), or exact physical CloudFormation names (e.g. 'MyStage-Api').").option("--all", "Diff every top-level stack (top-level only; Stage stacks: '**')", false).option("--recursive", "Recurse into each AWS::CloudFormation::Stack row and diff every nested-stack child against its own deployed state (DFS order). Default is non-recursive, matching cdk diff.", false).option("--fail", "Exit with code 1 when any change is detected (matches cdk diff --fail). Alias for --fail-on=any-change.").option("--no-fail", "Never exit with code 1 for a change. Alias for --fail-on=never.").addOption(new Option("--fail-on <kind>", "Exit with code 1 when the diff contains the given kind of change: \"any-change\" fails on any difference, \"broadening\" only on changes that broaden IAM permissions or security-group rules, \"destructive\" only on changes that replace, delete or orphan a resource, \"never\" does not fail (default). \"broadening\" and \"destructive\" always check nested stacks (as --recursive); \"any-change\" does with --recursive. Cannot be used with --fail / --no-fail.").choices(DIFF_FAIL_ON_VALUES).argParser(parseFailOn)).option("--security-only", "Only print the security changes (IAM and security-group) of each stack whose changes broaden permissions, and count only those stacks as differences for --fail-on (matches cdk diff --security-only). Checks nested stacks too. Cannot be used with --json.").option("--json", "Output the diff as JSON (nested tree shape when combined with --recursive)", false).addOption(useCdkBootstrapAssetsOption).addOption(noCfnFallbackOption).addOption(diffUpdatePolicyOptions[0]).addOption(diffUpdatePolicyOptions[1]).action(withErrorHandling(diffCommand));
6864
+ const cmd = new Command("diff").description("Show difference between current state and desired state").argument("[stacks...]", "Stack name(s) to diff. Accepts CDK display paths (e.g. 'MyStage/Api') with wildcards ('MyStage/*', '**'), or exact physical CloudFormation names (e.g. 'MyStage-Api').").option("--all", "Diff every top-level stack (top-level only; Stage stacks: '**')", false).option("--recursive", "Recurse into each AWS::CloudFormation::Stack row and diff every nested-stack child against its own deployed state (DFS order). Default is non-recursive, matching cdk diff.", false).option("--fail", "Exit with code 1 when any change is detected (matches cdk diff --fail). Alias for --fail-on=any-change.").option("--no-fail", "Never exit with code 1 for a change. Alias for --fail-on=never.").addOption(new Option("--fail-on <kind>", "Exit with code 1 when the diff contains the given kind of change: \"any-change\" fails on any difference, \"broadening\" only on changes that broaden IAM permissions or security-group rules, \"destructive\" only on changes that replace, delete or orphan a resource, \"never\" does not fail (default). \"broadening\" and \"destructive\" always check nested stacks (as --recursive); \"any-change\" does with --recursive. Cannot be used with --fail / --no-fail.").choices(DIFF_FAIL_ON_VALUES).argParser(parseFailOn)).option("--security-only", "Only print the security changes (IAM and security-group) of each stack whose changes broaden permissions, and count only those stacks as differences for --fail-on (matches cdk diff --security-only). Checks nested stacks too. Cannot be used with --json.").option("--json", "Output the diff as JSON (nested tree shape when combined with --recursive)", false).addOption(useCdkBootstrapAssetsOption).addOption(noCfnFallbackOption).addOption(diffUpdatePolicyOptions[0]).addOption(diffUpdatePolicyOptions[1]).addOption(diffReplaceResourceOption).action(withErrorHandling(diffCommand));
7592
6865
  [
7593
6866
  ...commonOptions,
7594
6867
  ...appOptions,
@@ -15688,9 +14961,6 @@ function resolvablePrincipalLists(resource) {
15688
14961
  }
15689
14962
 
15690
14963
  // src/cli/commands/destroy-runner/superseded-schedule.ts
15691
- function mustDeleteBefore(type) {
15692
- return hasOwnKey(IMPLICIT_DELETE_DEPENDENCIES, type) ? IMPLICIT_DELETE_DEPENDENCIES[type] : [];
15693
- }
15694
14964
  function scheduleSupersededDeletes(state, executionLevels, retryLate) {
15695
14965
  const rows = supersededResourcesOf(state).filter((row) => !isCustomResourceType$1(row.state.resourceType) || retryLate.has(row));
15696
14966
  if (rows.length === 0) return [];
@@ -15713,11 +14983,11 @@ function scheduleSupersededDeletes(state, executionLevels, retryLate) {
15713
14983
  const step = stepOf.get(dep);
15714
14984
  if (step !== void 0) upper = Math.min(upper, step);
15715
14985
  }
15716
- const mustFollow = mustDeleteBefore(rowType);
14986
+ const mustFollow = typesDeletedBefore(rowType);
15717
14987
  for (const [logicalId, step] of stepOf) {
15718
14988
  const record = resources[logicalId];
15719
14989
  if (typeof record !== "object" || record === null) continue;
15720
- if (mustDeleteBefore(record.resourceType).includes(rowType)) upper = Math.min(upper, step);
14990
+ if (typesDeletedBefore(record.resourceType).includes(rowType)) upper = Math.min(upper, step);
15721
14991
  if (mustFollow.includes(record.resourceType)) lower = Math.max(lower, step + 1);
15722
14992
  const its = record.dependencies;
15723
14993
  if (Array.isArray(its) && its.includes(row.logicalId)) lower = Math.max(lower, step + 1);
@@ -18544,7 +17814,7 @@ async function walkCdkdStateStackTree(stackName, region, state, stateBackend, re
18544
17814
  const childResult = await stateBackend.getState(childStackName, region);
18545
17815
  if (!childResult) {
18546
17816
  const orphan = orphanCommandFor(stackName, region, recovery);
18547
- throw new Error(`cdkd state is missing nested-child ${quotedOrNotShown(childStackName)} (${quotedRegion(region)}). Parent stack ${quotedOrNotShown(stackName)} lists ${quotedOrNotShown(logicalId)} as an ${NESTED_STACK_RESOURCE_TYPE} row but no child state file exists at ${quotedOrNotShown(`cdkd/${childStackName}/${region}/state.json`)}. The cdkd state tree is inconsistent — re-deploy the parent stack to refresh, or drop the parent's record and re-import.${orphan.note}\nDrop it with: ${orphan.command}`);
17817
+ throw new Error(`cdkd state is missing nested-child ${quotedOrNotShown(childStackName)} (${quotedRegion(region)}). Parent stack ${quotedOrNotShown(stackName)} lists ${quotedOrNotShown(logicalId)} as an ${NESTED_STACK_RESOURCE_TYPE$1} row but no child state file exists at ${quotedOrNotShown(`cdkd/${childStackName}/${region}/state.json`)}. The cdkd state tree is inconsistent — re-deploy the parent stack to refresh, or drop the parent's record and re-import.${orphan.note}\nDrop it with: ${orphan.command}`);
18548
17818
  }
18549
17819
  if (childResult.divergentBodyRegion !== void 0) throw new Error(`cdkd state region mismatch: nested-child ${quotedOrNotShown(childStackName)} has state.region=${quotedOrNotShown(childResult.divergentBodyRegion)} but its parent ${quotedOrNotShown(stackName)} is being walked against region=${quotedOrNotShown(region)}. AWS does not support cross-region nested stacks; the state tree appears corrupt — re-deploy the parent stack to refresh.`);
18550
17820
  nestedChildren.set(logicalId, await walkCdkdStateStackTree(childStackName, region, childResult.state, stateBackend, recovery));
@@ -20924,7 +20194,7 @@ async function runPerStackImportPhases(ctx) {
20924
20194
  phase1BTemplate["Resources"][row.logicalId] = rewrittenRow;
20925
20195
  rewrittenNestedRows.set(row.logicalId, rewrittenRow);
20926
20196
  phase1BResources.push({
20927
- ResourceType: NESTED_STACK_RESOURCE_TYPE,
20197
+ ResourceType: NESTED_STACK_RESOURCE_TYPE$1,
20928
20198
  LogicalResourceId: row.logicalId,
20929
20199
  ResourceIdentifier: { StackId: childArn }
20930
20200
  });
@@ -38213,4 +37483,4 @@ function collectVerbFlags(program) {
38213
37483
  }
38214
37484
 
38215
37485
  export { effectiveInventoryItem as $, withRecordedCidrSpelling as A, LIFECYCLE_DEFAULT_STATUS as B, securityGroupReadbackDelays as C, stackIngressRuleHolder as D, singleSecurityGroupRuleId as E, clearLifecycleWritesOf as F, canonicalizeItemList as G, LIFECYCLE_RULE_PATH as H, lifecycleSettleTarget as I, lifecycleUsesFilterForm as J, effectiveLifecycleConfiguration as K, recordLifecycleWrite as L, sgRemovalRuleKey as M, sgRuleListMember as N, survivingRecordOfRuleId as O, LIFECYCLE_BASELINE_REREAD_DELAYS_MS as P, effectiveIntelligentTieringItem as Q, settleLifecycleRead as R, reconcileSgRules as S, sgRuleKey as T, LIFECYCLE_TAG_FILTERS_PATH as U, LIFECYCLE_FILTER_PATH as V, canonicalizeBlock as W, EVENTBRIDGE_CONFIG_PATH as X, parseCfnTimestamp as Y, effectiveAnalyticsItem as Z, ingressRuleIdentity as _, refuseRevertRevokingSiblingRules as a, declaresBucketObjectLock as at, isResendableSocketFailure as b, buildProgram, siblingIdOwnedSgRules as c, isPlainObject as ct, authorizeDefinitelyNotApplied as d, shownLifecycleRuleId as dt, effectiveNotificationConfiguration as et, canonicalizeSgInlineRuleProtocols as f, flattenIpPermissions as g, descriptionKey as h, resolveSecretDerivedPrincipals as i, configItemId as it, markCopiesAgreed as j, tagListsMatch as k, SG_READBACK_RETRY_DELAY_MS as l, manualBucketDeletionClause as lt, comparableIngressIdentity as m, holdsUnprovenSecretPrincipalToken as n, caughtErrorName as nt, sgRuleDiffKey as o, declaresNestedObjectLock as ot, canonicalizeSgRuleProtocol as p, lifecycleRuleScope as q, isResolvableSecretPrincipalList as r, coerceCfnNumber as rt, readSgIngressById as s, describeValue as st, runDestroyForStack as t, eventBridgeEnabledOf as tt, SG_RULE_PAGE_SIZE$1 as u, mergeLegacySingular as ut, isConnectTimeout as v, securityGroupRuleMatchesCfnIngress as w, narrowIngressIpProtocol as x, isDefaultEgressRule as y, takeLifecycleWrite as z };
38216
- //# sourceMappingURL=program-BBXUa34K.js.map
37486
+ //# sourceMappingURL=program-BPrn1MhZ.js.map