@cdkd/cli 0.363.0 → 0.365.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 (61) hide show
  1. package/dist/{ambient-client-defaults-B0X_cHw6.js → ambient-client-defaults-AnEvWPy0.js} +4 -3
  2. package/dist/ambient-client-defaults-AnEvWPy0.js.map +1 -0
  3. package/dist/{asg-provider-DTR9KTuD.js → asg-provider-BzCU3XtA.js} +20 -13
  4. package/dist/{asg-provider-DTR9KTuD.js.map → asg-provider-BzCU3XtA.js.map} +1 -1
  5. package/dist/cli.js +3 -3
  6. package/dist/{custom-resource-runtime-D_FKAsKw.js → custom-resource-runtime-SB_NsQMH.js} +6 -6
  7. package/dist/{custom-resource-runtime-D_FKAsKw.js.map → custom-resource-runtime-SB_NsQMH.js.map} +1 -1
  8. package/dist/{db-associated-roles-CuhoLHiQ.js → db-associated-roles-D1wmFO_Y.js} +2 -2
  9. package/dist/{db-associated-roles-CuhoLHiQ.js.map → db-associated-roles-D1wmFO_Y.js.map} +1 -1
  10. package/dist/{delete-started-B-oT5k3k.js → delete-started-BJNrzLUk.js} +13 -9
  11. package/dist/delete-started-BJNrzLUk.js.map +1 -0
  12. package/dist/{deploy-engine-Df4iprdW.js → deploy-engine-BSqVfcSN.js} +893 -416
  13. package/dist/deploy-engine-BSqVfcSN.js.map +1 -0
  14. package/dist/{ec2-termination-protection-DPiykJlb.js → ec2-termination-protection-ekOvhSp9.js} +8 -6
  15. package/dist/ec2-termination-protection-ekOvhSp9.js.map +1 -0
  16. package/dist/{ecr-uri-DmQer3M1.js → ecr-uri-VpDi19pi.js} +2 -2
  17. package/dist/{ecr-uri-DmQer3M1.js.map → ecr-uri-VpDi19pi.js.map} +1 -1
  18. package/dist/{expected-bucket-owner-IZ5-Kowg.js → expected-bucket-owner-CmPtCsrQ.js} +2 -2
  19. package/dist/{expected-bucket-owner-IZ5-Kowg.js.map → expected-bucket-owner-CmPtCsrQ.js.map} +1 -1
  20. package/dist/{iam-role-provider-lpDjrxOC.js → iam-role-provider-Ct6UbKFo.js} +495 -42
  21. package/dist/iam-role-provider-Ct6UbKFo.js.map +1 -0
  22. package/dist/{image-plan-CjcTwOTQ.js → image-plan-gTOaUUbI.js} +8 -8
  23. package/dist/{image-plan-CjcTwOTQ.js.map → image-plan-gTOaUUbI.js.map} +1 -1
  24. package/dist/index.d.ts +4 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +5 -5
  27. package/dist/{logger-BGwxRQKX.js → logger-IBUeRw1z.js} +2 -2
  28. package/dist/{logger-BGwxRQKX.js.map → logger-IBUeRw1z.js.map} +1 -1
  29. package/dist/{neptune-provider-DvqSeTAi.js → neptune-provider-QgaV_sKy.js} +14 -7
  30. package/dist/{neptune-provider-DvqSeTAi.js.map → neptune-provider-QgaV_sKy.js.map} +1 -1
  31. package/dist/{program-DYOdBiyw.js → program-tHhew1Z5.js} +262 -82
  32. package/dist/program-tHhew1Z5.js.map +1 -0
  33. package/dist/{provider-classes-DSmPsWi6.js → provider-classes-DTMnDVMz.js} +2225 -971
  34. package/dist/provider-classes-DTMnDVMz.js.map +1 -0
  35. package/dist/{rds-provider-Brs1PVkX.js → rds-provider-D2dkhl8m.js} +17 -10
  36. package/dist/rds-provider-D2dkhl8m.js.map +1 -0
  37. package/dist/{read-replica-Cnind5V_.js → read-replica-CfbVMoYV.js} +3 -3
  38. package/dist/{read-replica-Cnind5V_.js.map → read-replica-CfbVMoYV.js.map} +1 -1
  39. package/dist/{replacement-rules-D36vABVQ.js → replacement-rules-BiIOJMA-.js} +5 -4
  40. package/dist/{replacement-rules-D36vABVQ.js.map → replacement-rules-BiIOJMA-.js.map} +1 -1
  41. package/dist/{resource-deadline-vWMKeI6W.js → resource-deadline-BSpNiiNd.js} +34 -5
  42. package/dist/resource-deadline-BSpNiiNd.js.map +1 -0
  43. package/dist/{restore-source-guard-B4OUKYQG.js → restore-source-guard-Be6A_rNB.js} +4 -4
  44. package/dist/{restore-source-guard-B4OUKYQG.js.map → restore-source-guard-Be6A_rNB.js.map} +1 -1
  45. package/dist/{run-cli-DYcKa6BY.js → run-cli-BkrNHPD5.js} +2 -2
  46. package/dist/{run-cli-DYcKa6BY.js.map → run-cli-BkrNHPD5.js.map} +1 -1
  47. package/dist/{settle-own-write-members-CvwPYXi7.js → settle-own-write-members-BqAKt1e7.js} +13 -135
  48. package/dist/settle-own-write-members-BqAKt1e7.js.map +1 -0
  49. package/dist/{version-CBDLbnZ4.js → version-0AMFL2lR.js} +2 -2
  50. package/dist/{version-CBDLbnZ4.js.map → version-0AMFL2lR.js.map} +1 -1
  51. package/package.json +4 -4
  52. package/dist/ambient-client-defaults-B0X_cHw6.js.map +0 -1
  53. package/dist/delete-started-B-oT5k3k.js.map +0 -1
  54. package/dist/deploy-engine-Df4iprdW.js.map +0 -1
  55. package/dist/ec2-termination-protection-DPiykJlb.js.map +0 -1
  56. package/dist/iam-role-provider-lpDjrxOC.js.map +0 -1
  57. package/dist/program-DYOdBiyw.js.map +0 -1
  58. package/dist/provider-classes-DSmPsWi6.js.map +0 -1
  59. package/dist/rds-provider-Brs1PVkX.js.map +0 -1
  60. package/dist/resource-deadline-vWMKeI6W.js.map +0 -1
  61. package/dist/settle-own-write-members-CvwPYXi7.js.map +0 -1
@@ -1,15 +1,15 @@
1
- import { A as displayStackName, C as STACK_REF_MAX_CODE_POINTS, D as displayAwsMessage, 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, a as UNSHOWABLE_VALUE, c as deployReplaceCommand, d as pasteableCommand, f as physicalIdShownBesideCommand, 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 } from "./version-CBDLbnZ4.js";
2
- import { $ as withStackScope, A as configStringRefusal, C as fallbackNamePropertyFor, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, G as currentNameGeneration, H as looksLikeCdkdGeneratedName, J as getCurrentStackName, K as getCurrentSkipPrefix, M as replayWarn, O as configBooleanRefusal, P as requireConfigObject, Q as withSkipPrefix, S as explicitNamePropertyFor, T as withoutGeneratedFallbackName, V as generateResourceNameWithFallback, W as stackInstanceNameSuffix, X as isNameGeneration, Z as withNameGeneration, _ as currentLogLineMasker, b as alternateNamePropertiesFor, c as VERBOSE_POINTER, et as withStackScopeBeforeStateRead, g as verbosePointerTail, h as verbosePointerSentence, j as readConfigString, k as configIntegerRefusal, m as verboseAwareText, n as getLogger, p as safeStringify, q as getCurrentStackInstanceId, u as describeAwsFailure, v as installLogLineMaskerSource, w as generatedNameFor, x as applyDefaultNameForFallback, y as getLiveRenderer } from "./logger-BGwxRQKX.js";
3
- import { A as stripControlChars, C as isNameCooldownError, F as isAmbiguousOutcomeError, G as markRedactedCause, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, K as wrapMaskedAwsError, L as isIamPropagationError, O as relayedNameCollision, P as isAmbiguousCcHandlerErrorCode, Q as AccountIdUnavailableError, R as isRetryableTransientError, S as isNameCollisionErrorFrom, T as isReplayedNameCollisionFrom, U as isThrottlingError, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, Z as SelectOutOfBoundsRefusalError, _ as ResourceUpdateNotSupportedError, a as normalizeAwsError, at as ProvisioningError, b as isUpdateUnsupportedError, et as CdkdError, i as credentialFingerprint, k as escapeRegExp$1, m as ExportInUseError, n as ambientCredentialConfig, nt as DeploymentNotApprovedError, ot as ResourceTimeoutError, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, st as StateError, t as ambientClientDefaults, w as isRecreateRetryableError, z as isTransientServerError } from "./ambient-client-defaults-B0X_cHw6.js";
1
+ import { A as displayStackName, C as STACK_REF_MAX_CODE_POINTS, D as displayAwsMessage, 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, a as UNSHOWABLE_VALUE, c as deployReplaceCommand, d as pasteableCommand, f as physicalIdShownBesideCommand, 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 } from "./version-0AMFL2lR.js";
2
+ import { $ as withStackScope, A as configStringRefusal, C as fallbackNamePropertyFor, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, G as currentNameGeneration, H as looksLikeCdkdGeneratedName, J as getCurrentStackName, K as getCurrentSkipPrefix, M as replayWarn, O as configBooleanRefusal, P as requireConfigObject, Q as withSkipPrefix, S as explicitNamePropertyFor, T as withoutGeneratedFallbackName, V as generateResourceNameWithFallback, W as stackInstanceNameSuffix, X as isNameGeneration, Z as withNameGeneration, _ as currentLogLineMasker, b as alternateNamePropertiesFor, c as VERBOSE_POINTER, et as withStackScopeBeforeStateRead, g as verbosePointerTail, h as verbosePointerSentence, j as readConfigString, k as configIntegerRefusal, m as verboseAwareText, n as getLogger, p as safeStringify, q as getCurrentStackInstanceId, u as describeAwsFailure, v as installLogLineMaskerSource, w as generatedNameFor, x as applyDefaultNameForFallback, y as getLiveRenderer } from "./logger-IBUeRw1z.js";
3
+ import { A as stripControlChars, C as isNameCooldownError, F as isAmbiguousOutcomeError, G as markRedactedCause, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, K as wrapMaskedAwsError, L as isIamPropagationError, O as relayedNameCollision, P as isAmbiguousCcHandlerErrorCode, Q as AccountIdUnavailableError, R as isRetryableTransientError, S as isNameCollisionErrorFrom, T as isReplayedNameCollisionFrom, U as isThrottlingError, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, Z as SelectOutOfBoundsRefusalError, _ as ResourceUpdateNotSupportedError, a as normalizeAwsError, at as ProvisioningError, b as isUpdateUnsupportedError, et as CdkdError, i as credentialFingerprint, k as escapeRegExp$1, m as ExportInUseError, n as ambientCredentialConfig, nt as DeploymentNotApprovedError, ot as ResourceTimeoutError, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, st as StateError, t as ambientClientDefaults, w as isRecreateRetryableError, z as isTransientServerError } from "./ambient-client-defaults-AnEvWPy0.js";
4
4
  import { a as getAssumedRoleCredentials, c as setAssumedRoleCredentials, d as quietS3Logger, f as ambientRegion, i as awsEndpointOverrideUrl, n as awsClientDefaults, o as getPreAssumeEnvCredentials, r as awsEndpointOverrideActive, t as SECOND_ROLE_PUBLISH_REFUSAL, u as setPreAssumeEnvCredentials } from "./aws-client-defaults-DAebi99J.js";
5
5
  import { l as s3ClientDefaults, r as getAwsClients } from "./aws-clients-DOkPjjAW.js";
6
- import { A as IAM_PROPAGATION_MAX_DELAY_MS, B as phaseScopeForStack, C as prefetchCreateOnlyPropertyPaths, D as hasNoRegistrySchema, E as describeTypeWithThrottleRetry, G as timePhaseSync, H as recordPhase, I as ignoresUnmodifiedGroupSize, J as parseFailureDebugDetail, K as describeJsonParseFailure, L as rollingUpdatePolicy, M as CREATE_ONLY_PATHS_SNAPSHOT, N as INSTANCE_REFRESH_TRIGGER_PROPERTIES, O as isAwsEmulatorRegistryMiss, P as REPLACEMENT_TRIGGER_PROPERTIES, R as willReplaceGroup, S as isIntrinsicShaped, T as parseCreateOnlyPropertyPointers, V as phaseTimingsEnabled, W as timePhase, X as utf8ByteLength, Y as parseJsonNamingNoBody, a as reDisableInstanceApiTermination, c as resolvedResourceTimeoutMs, d as isRefusedBeforeApplying, f as markRefusedBeforeApplying, g as withPriorAttempts, h as provenOrphanIdsInJournal, i as observeThenDisableInstanceApiTermination, j as withRetry, k as reportAwsEmulatorRegistryMiss, m as priorAttemptsInJournal, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, p as priorAttemptLookup, q as jsonParseFailureStandIn, r as isTerminationProtectionPropagationError, v as unchangedBehindSecretReference, w as templateResourceTypes, x as getCreateOnlyPropertyPaths, y as cachedCreateOnlyPropertyPaths, z as PhaseClock } from "./ec2-termination-protection-DPiykJlb.js";
6
+ import { A as IAM_PROPAGATION_MAX_DELAY_MS, B as phaseScopeForStack, C as prefetchCreateOnlyPropertyPaths, D as hasNoRegistrySchema, E as describeTypeWithThrottleRetry, G as timePhaseSync, H as recordPhase, I as ignoresUnmodifiedGroupSize, J as parseFailureDebugDetail, K as describeJsonParseFailure, L as rollingUpdatePolicy, M as CREATE_ONLY_PATHS_SNAPSHOT, N as INSTANCE_REFRESH_TRIGGER_PROPERTIES, O as isAwsEmulatorRegistryMiss, P as REPLACEMENT_TRIGGER_PROPERTIES, R as willReplaceGroup, S as isIntrinsicShaped, T as parseCreateOnlyPropertyPointers, V as phaseTimingsEnabled, W as timePhase, X as utf8ByteLength, Y as parseJsonNamingNoBody, _ as onlySecretReferencesDiffer, a as reDisableInstanceApiTermination, c as resolvedResourceTimeoutMs, d as isRefusedBeforeApplying, f as markRefusedBeforeApplying, g as withPriorAttempts, h as provenOrphanIdsInJournal, i as observeThenDisableInstanceApiTermination, j as withRetry, k as reportAwsEmulatorRegistryMiss, m as priorAttemptsInJournal, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, p as priorAttemptLookup, q as jsonParseFailureStandIn, r as isTerminationProtectionPropagationError, v as unchangedBehindSecretReference, w as templateResourceTypes, x as getCreateOnlyPropertyPaths, y as cachedCreateOnlyPropertyPaths, z as PhaseClock } from "./ec2-termination-protection-ekOvhSp9.js";
7
7
  import { i as sameRegion, n as canonicalizeRegion, r as derivePartitionAndUrlSuffix } from "./aws-partition-DA0r2sr-.js";
8
- import { $t as markAuxiliaryFailure, A as assertRegionMatch, At as canonicalizeRoute53QueryName, B as resolveExplicitPhysicalId, Bt as createMaskedRetryLogger, D as withoutServerErrorRetries, F as isQuotableImportValue, Gt as RETRY_AUXILIARY_OWNER, H as markNotGone, Ht as maskDeep, I as normalizeAwsTagsToCfn, It as resourceTypeShown, Jt as createdBeforeFailure, K as observeThenDisableProtection, L as quotedRemedyLogicalId, Lt as segmentAfterAnchor, Mt as compositeIdSeparatorRefusal, Pt as logicalIdShown, Qt as isAuxiliaryMarkOf, R as refusalTypeShown, Rt as stateOrphanRecordRemedy, U as compensateProtectionFlip, Ut as maskerOrIdentity, V as isMarkedNotGone, Vt as isSecretDerivedValue, W as deleteWithProtectionCompensation, Wt as withDerivedNameMasks, Yt as createdResourceIdentityBeforeFailure, Zt as isAuxiliaryFailure, _n as withPasteableAwsProfile, at as runDeleteAttempt, bt as startInterruptWatch, ct as monotonicNowMs, d as CreatedResourceSink, dn as sanitizeRecoveryValue, en as markCreatedBeforeFailure, f as clearCreatedReport, fn as CUSTOM_RESOURCE_RESPONSE_PREFIX, g as retractCreatedResource, i as withResourceDeadline, it as protectionFlipKey, k as RESOURCE_NOT_FOUND, kt as withUnchangedSecretPrincipalLists, lt as DELETION_PROTECTION_DOC_POINTER, m as reportCreatedResource, mn as WAIT_CONDITION_SIGNAL_PREFIX, mt as protectedReplacementAdvice, n as enclosingDeadlineRemainingMs, nt as ProtectionFlipRegistry, o as prepareRemovalForUpdate, ot as ElapsedBudget, p as collectCreatedResources, pn as DEFAULT_STATE_PREFIX, pt as pasteableAwsCommand, r as whileEnclosingDeadlinesPaused, rt as isTerminalDeleteFailure, s as removalWarning, st as ElapsedBudgetRegistry, t as enclosingDeadlineExpired, u as withoutInjectedRemovals, un as recoveryCommandFlags, vn as injectiveKey, xn as producerRecordKey, yt as isInterruptedWaitError, zt as createMaskedLogSinks } from "./resource-deadline-vWMKeI6W.js";
9
- import { t as expectedOwnerParam } from "./expected-bucket-owner-IZ5-Kowg.js";
10
- import { Ct as assertRecordedIdentity, Dt as slowCcOperationTimeoutMs, Et as recordedIdentityId, Ft as replaceDeadIdentity, Gt as orphansCarriedFrom, Ht as importableOutputs, Jt as stackInstanceIdCarriedFrom, Kt as shouldRetainResource, Lt as acceptedCreateOnlyDropsOf, Mt as isUsableIdentityValue, Nt as keepRecordedIdentity, Ot as SURVIVOR_IDENTITY_ATTRIBUTES, Pt as newCopyDeleteAttributes, Rt as describeRegionValueKind, Tt as identityWarner, Ut as isReadableBag, Vt as importableOutputKeys, Wt as orphansAfterRollback, gt as deniedIdentityReadRefusal, ht as dbInstanceAttributes, i as dbClusterAttributes, jt as isRecordedIdentityAttribute, kt as attributesAfterUpdate, n as isRefusedByName, qt as skippedOutputsCarriedFrom, r as markDeleteStarted, t as isDeleteStarted, vt as isAccessDeniedError, wt as differingIdentityWarning, yt as lookupEachName, zt as exportNamesCarriedFrom } from "./delete-started-B-oT5k3k.js";
11
- import { $t as recordInheritedParameterValue, A as witnessNormalize, An as recordNoEchoAttributeValues, At as withoutPhysicalNameCopies, B as redactionClaimOf, Cn as noEchoParameterPlaintextsOf, Ct as withLegacyOverlapScan, D as recordedNoEchoValuesOf, Dn as recordFreshNoEchoValuesIn, Dt as replaceEmbeddedPhysicalNameRewrites, E as recordPassedNoEchoParameters, En as recordDerivedMaskOnlyValue, Et as repairPhysicalNameCopyLeaves, F as markLeafCertifiedBag, G as foldRecording, Gt as recordTakenIfBranch, H as mixedLiteralAnswered, Ht as splitOutsideDynamicReferences, I as markSameGenerationBag, In as isDynamicReferenceString, It as secretRerenderPairs, J as hasPassProvenance, Jt as templateRereadsAccountId, K as openRecordingScope, Kt as inheritedPseudoValue, L as mergeResolvedPairs, Ln as isSingleDynamicReferenceToken, M as carryRedactionMarks, Mn as recordProvenPublicExpression, Mt as DYNAMIC_REFERENCE_TOKEN_SCAN, N as intrinsicLeafResolutionOf, Nn as wholeStringLeavesOf, Nt as dynamicReferenceTokens, O as replaceAtCoordinates, Ot as scrubResourceRecord, P as isSameGenerationBag, Pn as withoutNoEchoParameterEntries, Q as recordReferenceResolution, Qt as recordInheritedParameterRead, R as recordIntrinsicLeafResolution, Rn as maskMatchSpans, S as noEchoParametersReadBy, Sn as markNoEchoParameterClass, St as replaceWholeLeaves, Tt as repairEmbeddedPhysicalNamesTowards, U as withLegacyMixedScan, Ut as standsForInheritedSecret, V as resolvedPlaintextOf, Vt as rereadParameterExpression, W as redactForState, Wt as recordDroppedArrayElements, X as passReadVersionsFor, Xt as inheritedParameterExpression, Y as passProvenanceFor, Yt as inheritNestedStackParameterAssociations, Z as recordReferenceProvenanceEntry, Zt as inheritedRenderedToken, _ as noEchoComparison, _n as freshNoEchoValuesOf, _t as maskSecretsInText, an as recordRecoverableMaskedOutput, at as literalSplitDelimitersOf, bn as isScopedSecretVerdict, bt as legacyReferenceLeavesOnly, c as parseLambdaFunctionAddress, ct as recordLogOnlyParameterValue, d as canonicalJson$7, dn as crossStackSourceKey, dt as shareLogOnlyValues, en as redactInheritedParameterValue, et as carryLogOnlyValues, f as isMarkedCoordinate, fn as recordCrossStackExpression, ft as unionOfSecretBags, g as maskedLeafCoordinatesOf, gn as contradictProvenPublicExpression, gt as maskSecretsInError, h as maskWholeValue, hn as carryFreshNoEchoMark, ht as maskRecordedSecretsInText, in as freshNoEchoLeafPositions, it as hasMaskableValues, jn as recordNoEchoParameterFreshValue, jt as spanNamesResolvableService, k as valueAtCoordinate, kt as withPhysicalNameCopies, ln as recordPhysicalNameCopy, lt as recordLogOnlySplitFragments, m as maskReadbackAtCoordinates, mn as carriesSecretMask, mt as errorCauseChain, nn as carriesFreshNoEchoValue, nt as createUnionSecretMasker, on as recoverMaskedOutput, ot as logOnlyValueCount, p as maskAtCoordinates, pn as splitGetAttStringForm, pt as createSecretMasker, q as recordSecretResolution, qt as recordInheritedPseudoParameters, rn as embedsFreshNoEchoValue, rt as hasLogOnlyValues, sn as physicalNameCopiesOf, st as printingCorpusOf, t as ReplacementRulesRegistry, tn as withdrawRenderedParameterSpelling, tt as carryLogOnlyValuesCarriedBy, u as canonicalCoordinates, un as recordNestedStackParameterExpressions, ut as recordLogOnlyValue, v as noEchoCoordinatesOf, vn as isMaskOnlyPlaintext, vt as differingStringLeaves, w as readbackPathFor, wn as pinScopedSecretVerdict, wt as embeddedPhysicalNameRewrites, x as noEchoParameterNodesAt, xn as isSecretExpressionByVerdictOrSpelling, xt as overlapRuleAnswered, y as noEchoLeavesOf, yn as isNoEchoParameterPlaintext, yt as legacyLeavesWithoutMask, z as recordIntrinsicLeafResolutionAs, zt as arrayPairsWhateverDrops } from "./replacement-rules-D36vABVQ.js";
12
- import { C as withUnsettledItems, S as unsettledPropertiesOf, T as withoutUnsettledProperties, _ as isUsableAttemptedName, b as unsettledItemsOf, c as planTagDiff, f as tagPlanWarning, h as definedAttributes, i as refuseRestoreFromItself, l as readTagList, u as refuseMalformedDesiredTags, v as unsettledContextOf, w as withUnsettledProperties, x as unsettledItemsTopKey, y as unsettledItemsField } from "./restore-source-guard-B4OUKYQG.js";
8
+ import { $t as isAuxiliaryFailure, A as assertRegionMatch, Bt as stateOrphanRecordRemedy, Cn as producerRecordKey, D as withoutServerErrorRetries, G as deleteWithProtectionCompensation, Gt as maskerOrIdentity, H as isMarkedNotGone, Ht as createMaskedRetryLogger, I as isQuotableImportValue, It as logicalIdShown, Kt as withDerivedNameMasks, L as normalizeAwsTagsToCfn, Mt as canonicalizeRoute53QueryName, Pt as compositeIdSeparatorRefusal, R as quotedRemedyLogicalId, Rt as resourceTypeShown, U as markNotGone, Ut as isSecretDerivedValue, V as resolveExplicitPhysicalId, Vt as createMaskedLogSinks, W as compensateProtectionFlip, Wt as maskDeep, Xt as createdBeforeFailure, Zt as createdResourceIdentityBeforeFailure, at as protectionFlipKey, bn as injectiveKey, bt as isInterruptedWaitError, ct as ElapsedBudgetRegistry, d as CreatedResourceSink, en as isAuxiliaryMarkOf, f as clearCreatedReport, fn as recoveryCommandFlags, g as retractCreatedResource, gn as WAIT_CONDITION_SIGNAL_PREFIX, hn as DEFAULT_STATE_PREFIX, ht as protectedReplacementAdvice, i as withResourceDeadline, it as isTerminalDeleteFailure, jt as withUnchangedSecretPrincipalLists, k as RESOURCE_NOT_FOUND, lt as monotonicNowMs, m as reportCreatedResource, mn as CUSTOM_RESOURCE_RESPONSE_PREFIX, mt as pasteableAwsCommand, n as enclosingDeadlineRemainingMs, nn as markCreatedBeforeFailure, o as prepareRemovalForUpdate, ot as runDeleteAttempt, p as collectCreatedResources, pn as sanitizeRecoveryValue, q as observeThenDisableProtection, qt as RETRY_AUXILIARY_OWNER, r as whileEnclosingDeadlinesPaused, rt as ProtectionFlipRegistry, s as removalWarning, st as ElapsedBudget, t as enclosingDeadlineExpired, tn as markAuxiliaryFailure, u as withoutInjectedRemovals, ut as DELETION_PROTECTION_DOC_POINTER, xt as startInterruptWatch, yn as withPasteableAwsProfile, z as refusalTypeShown, zt as segmentAfterAnchor } from "./resource-deadline-BSpNiiNd.js";
9
+ import { t as expectedOwnerParam } from "./expected-bucket-owner-CmPtCsrQ.js";
10
+ import { At as SURVIVOR_IDENTITY_ATTRIBUTES, Bt as describeRegionValueKind, Et as identityWarner, Ft as keepRecordedIdentity, Gt as isReadableBag, It as newCopyDeleteAttributes, Jt as shouldRetainResource, Kt as orphansAfterRollback, Lt as replaceDeadIdentity, Nt as isRecordedIdentityAttribute, Ot as recordedIdentityId, Pt as isUsableIdentityValue, Tt as differingIdentityWarning, Ut as importableOutputKeys, Vt as exportNamesCarriedFrom, Wt as importableOutputs, Xt as stackInstanceIdCarriedFrom, Yt as skippedOutputsCarriedFrom, bt as lookupEachName, gt as deniedIdentityReadRefusal, ht as dbInstanceAttributes, i as dbClusterAttributes, jt as attributesAfterUpdate, kt as slowCcOperationTimeoutMs, n as isRefusedByName, qt as orphansCarriedFrom, r as markDeleteStarted, t as isDeleteStarted, wt as assertRecordedIdentity, yt as isAccessDeniedError, zt as acceptedCreateOnlyDropsOf } from "./delete-started-BJNrzLUk.js";
11
+ import { $t as recordInheritedParameterValue, A as witnessNormalize, An as recordNoEchoAttributeValues, At as withoutPhysicalNameCopies, B as redactionClaimOf, Cn as noEchoParameterPlaintextsOf, Ct as withLegacyOverlapScan, D as recordedNoEchoValuesOf, Dn as recordFreshNoEchoValuesIn, Dt as replaceEmbeddedPhysicalNameRewrites, E as recordPassedNoEchoParameters, En as recordDerivedMaskOnlyValue, Et as repairPhysicalNameCopyLeaves, F as markLeafCertifiedBag, G as foldRecording, Gt as recordTakenIfBranch, H as mixedLiteralAnswered, Ht as splitOutsideDynamicReferences, I as markSameGenerationBag, In as isDynamicReferenceString, It as secretRerenderPairs, J as hasPassProvenance, Jt as templateRereadsAccountId, K as openRecordingScope, Kt as inheritedPseudoValue, L as mergeResolvedPairs, Ln as isSingleDynamicReferenceToken, M as carryRedactionMarks, Mn as recordProvenPublicExpression, Mt as DYNAMIC_REFERENCE_TOKEN_SCAN, N as intrinsicLeafResolutionOf, Nn as wholeStringLeavesOf, Nt as dynamicReferenceTokens, O as replaceAtCoordinates, Ot as scrubResourceRecord, P as isSameGenerationBag, Pn as withoutNoEchoParameterEntries, Q as recordReferenceResolution, Qt as recordInheritedParameterRead, R as recordIntrinsicLeafResolution, Rn as maskMatchSpans, S as noEchoParametersReadBy, Sn as markNoEchoParameterClass, St as replaceWholeLeaves, Tt as repairEmbeddedPhysicalNamesTowards, U as withLegacyMixedScan, Ut as standsForInheritedSecret, V as resolvedPlaintextOf, Vt as rereadParameterExpression, W as redactForState, Wt as recordDroppedArrayElements, X as passReadVersionsFor, Xt as inheritedParameterExpression, Y as passProvenanceFor, Yt as inheritNestedStackParameterAssociations, Z as recordReferenceProvenanceEntry, Zt as inheritedRenderedToken, _ as noEchoComparison, _n as freshNoEchoValuesOf, _t as maskSecretsInText, an as recordRecoverableMaskedOutput, at as literalSplitDelimitersOf, bn as isScopedSecretVerdict, bt as legacyReferenceLeavesOnly, c as parseLambdaFunctionAddress, ct as recordLogOnlyParameterValue, d as canonicalJson$7, dn as crossStackSourceKey, dt as shareLogOnlyValues, en as redactInheritedParameterValue, et as carryLogOnlyValues, f as isMarkedCoordinate, fn as recordCrossStackExpression, ft as unionOfSecretBags, g as maskedLeafCoordinatesOf, gn as contradictProvenPublicExpression, gt as maskSecretsInError, h as maskWholeValue, hn as carryFreshNoEchoMark, ht as maskRecordedSecretsInText, in as freshNoEchoLeafPositions, it as hasMaskableValues, jn as recordNoEchoParameterFreshValue, jt as spanNamesResolvableService, k as valueAtCoordinate, kt as withPhysicalNameCopies, ln as recordPhysicalNameCopy, lt as recordLogOnlySplitFragments, m as maskReadbackAtCoordinates, mn as carriesSecretMask, mt as errorCauseChain, nn as carriesFreshNoEchoValue, nt as createUnionSecretMasker, on as recoverMaskedOutput, ot as logOnlyValueCount, p as maskAtCoordinates, pn as splitGetAttStringForm, pt as createSecretMasker, q as recordSecretResolution, qt as recordInheritedPseudoParameters, rn as embedsFreshNoEchoValue, rt as hasLogOnlyValues, sn as physicalNameCopiesOf, st as printingCorpusOf, t as ReplacementRulesRegistry, tn as withdrawRenderedParameterSpelling, tt as carryLogOnlyValuesCarriedBy, u as canonicalCoordinates, un as recordNestedStackParameterExpressions, ut as recordLogOnlyValue, v as noEchoCoordinatesOf, vn as isMaskOnlyPlaintext, vt as differingStringLeaves, w as readbackPathFor, wn as pinScopedSecretVerdict, wt as embeddedPhysicalNameRewrites, x as noEchoParameterNodesAt, xn as isSecretExpressionByVerdictOrSpelling, xt as overlapRuleAnswered, y as noEchoLeavesOf, yn as isNoEchoParameterPlaintext, yt as legacyLeavesWithoutMask, z as recordIntrinsicLeafResolutionAs, zt as arrayPairsWhateverDrops } from "./replacement-rules-BiIOJMA-.js";
12
+ import { C as withUnsettledItems, S as unsettledPropertiesOf, T as withoutUnsettledProperties, _ as isUsableAttemptedName, b as unsettledItemsOf, c as planTagDiff, f as tagPlanWarning, h as definedAttributes, i as refuseRestoreFromItself, l as readTagList, u as refuseMalformedDesiredTags, v as unsettledContextOf, w as withUnsettledProperties, x as unsettledItemsTopKey, y as unsettledItemsField } from "./restore-source-guard-Be6A_rNB.js";
13
13
  import { createHash, randomUUID, timingSafeEqual } from "node:crypto";
14
14
  import { AsyncLocalStorage } from "node:async_hooks";
15
15
  import { CreateBucketCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketLifecycleConfigurationCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client } from "@aws-sdk/client-s3";
@@ -18,7 +18,7 @@ import { PublishCommand, SNSClient } from "@aws-sdk/client-sns";
18
18
  import { GetFunctionCommand, GetFunctionConfigurationCommand, GetFunctionUrlConfigCommand, InvokeCommand, LambdaClient, UpdateFunctionConfigurationCommand, waitUntilFunctionActiveV2, waitUntilFunctionUpdatedV2 } from "@aws-sdk/client-lambda";
19
19
  import { AssumeRoleCommand, GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
20
20
  import { CreateSnapshotCommand, DeleteVolumeCommand, DescribeAvailabilityZonesCommand, DescribeInstancesCommand, DescribeLaunchTemplatesCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeSecurityGroupsCommand, DescribeSnapshotsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcsCommand, GetIpamPoolAllocationsCommand } from "@aws-sdk/client-ec2";
21
- import { CreateTableCommand, DeleteResourcePolicyCommand, DeleteTableCommand, DescribeContinuousBackupsCommand, DescribeContributorInsightsCommand, DescribeKinesisStreamingDestinationCommand, DescribeTableCommand, DescribeTimeToLiveCommand, DisableKinesisStreamingDestinationCommand, DynamoDBClient, EnableKinesisStreamingDestinationCommand, GetResourcePolicyCommand, ListTagsOfResourceCommand, PolicyNotFoundException, PutResourcePolicyCommand, ResourceNotFoundException as ResourceNotFoundException$1, TagResourceCommand as TagResourceCommand$2, UntagResourceCommand as UntagResourceCommand$2, UpdateContinuousBackupsCommand, UpdateContributorInsightsCommand, UpdateKinesisStreamingDestinationCommand, UpdateTableCommand, UpdateTimeToLiveCommand } from "@aws-sdk/client-dynamodb";
21
+ import { CreateTableCommand, DeleteResourcePolicyCommand, DeleteTableCommand, DescribeContinuousBackupsCommand, DescribeContributorInsightsCommand, DescribeKinesisStreamingDestinationCommand, DescribeTableCommand, DescribeTimeToLiveCommand, DisableKinesisStreamingDestinationCommand, DynamoDBClient, EnableKinesisStreamingDestinationCommand, GetResourcePolicyCommand, ListTagsOfResourceCommand, PolicyNotFoundException, PutResourcePolicyCommand, ResourceNotFoundException as ResourceNotFoundException$1, TableNotFoundException, TagResourceCommand as TagResourceCommand$2, UntagResourceCommand as UntagResourceCommand$2, UpdateContinuousBackupsCommand, UpdateContributorInsightsCommand, UpdateKinesisStreamingDestinationCommand, UpdateTableCommand, UpdateTimeToLiveCommand } from "@aws-sdk/client-dynamodb";
22
22
  import { CancelUpdateStackCommand, CloudFormationClient, ContinueUpdateRollbackCommand, CreateStackCommand, DeleteStackCommand, DescribeStackEventsCommand, DescribeStackResourceCommand, DescribeStacksCommand, GetTemplateCommand, ListExportsCommand, UpdateStackCommand } from "@aws-sdk/client-cloudformation";
23
23
  import { GetRestApiCommand } from "@aws-sdk/client-api-gateway";
24
24
  import { DescribeApiDestinationCommand, DescribeConnectionCommand } from "@aws-sdk/client-eventbridge";
@@ -82,7 +82,7 @@ async function resolveBucketRegion(bucketName, opts = {}) {
82
82
  });
83
83
  }
84
84
  try {
85
- const { expectedOwnerParam } = await import("./expected-bucket-owner-IZ5-Kowg.js").then((n) => n.n);
85
+ const { expectedOwnerParam } = await import("./expected-bucket-owner-CmPtCsrQ.js").then((n) => n.n);
86
86
  return (await client.send(new GetBucketLocationCommand({
87
87
  Bucket: bucketName,
88
88
  ...await expectedOwnerParam(client)
@@ -4378,6 +4378,133 @@ var TemplateParser = class {
4378
4378
  }
4379
4379
  };
4380
4380
 
4381
+ // src/provisioning/providers/sns-subscription/attribute-plan.ts
4382
+ const MUTABLE_ATTRIBUTES = [
4383
+ "RawMessageDelivery",
4384
+ "FilterPolicy",
4385
+ "FilterPolicyScope",
4386
+ "RedrivePolicy",
4387
+ "DeliveryPolicy",
4388
+ "ReplayPolicy",
4389
+ "SubscriptionRoleArn"
4390
+ ];
4391
+ const RESET_VALUES = {
4392
+ RawMessageDelivery: "false",
4393
+ FilterPolicy: "",
4394
+ FilterPolicyScope: "MessageAttributes",
4395
+ RedrivePolicy: ""
4396
+ };
4397
+ const UNRESETTABLE_REASONS = {
4398
+ DeliveryPolicy: "DeliveryPolicy removed, which SNS cannot reset",
4399
+ ReplayPolicy: "ReplayPolicy removed, which SNS cannot reset",
4400
+ SubscriptionRoleArn: "SubscriptionRoleArn removed, which SNS cannot reset"
4401
+ };
4402
+ function toAttributeValue(key, value) {
4403
+ if (value === void 0) return void 0;
4404
+ if (key === "FilterPolicy" || key === "RedrivePolicy" || key === "DeliveryPolicy" || key === "ReplayPolicy") return typeof value === "string" ? value : JSON.stringify(value);
4405
+ return stringifyValue(value);
4406
+ }
4407
+ function resetValueOf(name) {
4408
+ return Object.hasOwn(RESET_VALUES, name) ? RESET_VALUES[name] : void 0;
4409
+ }
4410
+ function sameAttributeValue(name, desired, current) {
4411
+ if (current === void 0) return desired === resetValueOf(name);
4412
+ if (desired === current) return true;
4413
+ try {
4414
+ return JSON.stringify(JSON.parse(desired)) === JSON.stringify(JSON.parse(current));
4415
+ } catch {
4416
+ return false;
4417
+ }
4418
+ }
4419
+ function filterPolicyCleared(plan, current) {
4420
+ const planned = plan.find(([name]) => name === "FilterPolicy");
4421
+ if (planned !== void 0) return planned[1] === "";
4422
+ return current["FilterPolicy"] === void 0 || current["FilterPolicy"] === "";
4423
+ }
4424
+ function planSubscriptionAttributes(current, properties) {
4425
+ const calls = [];
4426
+ for (const name of MUTABLE_ATTRIBUTES) {
4427
+ const desired = toAttributeValue(name, properties[name]);
4428
+ const now = current[name];
4429
+ if (desired !== void 0) {
4430
+ if (!sameAttributeValue(name, desired, now)) calls.push([name, desired]);
4431
+ continue;
4432
+ }
4433
+ if (now === void 0 || now === "") continue;
4434
+ if (name === "FilterPolicyScope" && filterPolicyCleared(calls, current)) continue;
4435
+ const reset = resetValueOf(name);
4436
+ if (reset === void 0) return {
4437
+ kind: "replace",
4438
+ reason: UNRESETTABLE_REASONS[name]
4439
+ };
4440
+ if (now !== reset) calls.push([name, reset]);
4441
+ }
4442
+ const policy = calls.find(([name]) => name === "FilterPolicy");
4443
+ if (policy !== void 0 && policy[1] !== "" && calls.some(([name]) => name === "FilterPolicyScope")) return {
4444
+ kind: "replace",
4445
+ reason: "FilterPolicy and FilterPolicyScope change together"
4446
+ };
4447
+ return {
4448
+ kind: "in-place",
4449
+ calls
4450
+ };
4451
+ }
4452
+ function recordedSubscriptionAttributes(recorded) {
4453
+ const attributes = {};
4454
+ for (const name of MUTABLE_ATTRIBUTES) attributes[name] = toAttributeValue(name, recorded[name]);
4455
+ return attributes;
4456
+ }
4457
+
4458
+ // src/provisioning/providers/route53/record-name.ts
4459
+ const UNDECODABLE_OCTAL_ESCAPES = /* @__PURE__ */ new Set(["056", "134"]);
4460
+ function normalizeRecordName(name) {
4461
+ const lowered = name.replace(/\\([0-7]{3})/g, (match, oct) => UNDECODABLE_OCTAL_ESCAPES.has(oct) ? match : String.fromCharCode(parseInt(oct, 8))).toLowerCase();
4462
+ return lowered.endsWith(".") ? lowered : `${lowered}.`;
4463
+ }
4464
+
4465
+ // src/analyzer/diff-calculator/provider-replacement.ts
4466
+ const snsSubscriptionReplacement = (recorded, desired) => {
4467
+ const plan = planSubscriptionAttributes(recordedSubscriptionAttributes(recorded), desired);
4468
+ return plan.kind === "replace" ? plan.reason : void 0;
4469
+ };
4470
+ const recordSetRenameReplacement = (recorded, desired) => {
4471
+ const comparable = (value) => typeof value === "string" && value !== "" && !value.includes("{{resolve:");
4472
+ const [prevName, name] = [recorded["Name"], desired["Name"]];
4473
+ if (!comparable(prevName) || !comparable(name)) return void 0;
4474
+ if (!comparable(recorded["Type"]) || !comparable(desired["Type"])) return void 0;
4475
+ return normalizeRecordName(prevName) !== normalizeRecordName(name) ? "its Name changed, and Route 53 keys a record on its name" : void 0;
4476
+ };
4477
+ const PROVIDER_REPLACEMENT_PLANNERS = /* @__PURE__ */ new Map([["AWS::SNS::Subscription", {
4478
+ properties: [
4479
+ "DeliveryPolicy",
4480
+ "FilterPolicy",
4481
+ "FilterPolicyScope",
4482
+ "ReplayPolicy",
4483
+ "SubscriptionRoleArn"
4484
+ ],
4485
+ plan: snsSubscriptionReplacement,
4486
+ oldDeleted: "before-create"
4487
+ }], ["AWS::Route53::RecordSet", {
4488
+ properties: ["Name"],
4489
+ plan: recordSetRenameReplacement,
4490
+ oldDeleted: "during-deploy"
4491
+ }]]);
4492
+ function providerReplacementOldDeleted(resourceType) {
4493
+ return PROVIDER_REPLACEMENT_PLANNERS.get(resourceType)?.oldDeleted;
4494
+ }
4495
+ function providerReplacementReason(resourceType, record, desired) {
4496
+ const entry = PROVIDER_REPLACEMENT_PLANNERS.get(resourceType);
4497
+ if (entry === void 0) return void 0;
4498
+ if (record.resourceType !== resourceType || record.provisionedBy === "cc-api") return void 0;
4499
+ return entry.plan(record.properties ?? {}, desired);
4500
+ }
4501
+ function dropSupersededProviderReplacements(changes) {
4502
+ for (const change of changes.values()) {
4503
+ if (change.providerReplacement === void 0) continue;
4504
+ if ((change.propertyChanges ?? []).some((pc) => pc.requiresReplacement)) delete change.providerReplacement;
4505
+ }
4506
+ }
4507
+
4381
4508
  // src/provisioning/property-coverage.generated.ts
4382
4509
  const PROPERTY_COVERAGE_BY_TYPE = /* @__PURE__ */ new Map([
4383
4510
  ["AWS::ApiGateway::Account", {
@@ -4910,8 +5037,8 @@ const PROPERTY_COVERAGE_BY_TYPE = /* @__PURE__ */ new Map([
4910
5037
  "Tags",
4911
5038
  "ValidationMethod"
4912
5039
  ]),
4913
- sdkUnwired: /* @__PURE__ */ new Map(),
4914
- createOnlyDrops: /* @__PURE__ */ new Set(),
5040
+ sdkUnwired: /* @__PURE__ */ new Map([["CertificateUsage", "not yet implemented by cdkd"], ["RootHierarchyType", "not yet implemented by cdkd"]]),
5041
+ createOnlyDrops: /* @__PURE__ */ new Set(["CertificateUsage", "RootHierarchyType"]),
4915
5042
  readOnly: /* @__PURE__ */ new Set(["CertificateArn"]),
4916
5043
  primaryIdentifier: /* @__PURE__ */ new Set(["CertificateArn"]),
4917
5044
  ccRouteUnavailable: false
@@ -6452,6 +6579,7 @@ const PROPERTY_COVERAGE_BY_TYPE = /* @__PURE__ */ new Map([
6452
6579
  }],
6453
6580
  ["AWS::Lambda::Function", {
6454
6581
  handled: /* @__PURE__ */ new Set([
6582
+ "AcceleratorConfig",
6455
6583
  "Architectures",
6456
6584
  "CapacityProviderConfig",
6457
6585
  "Code",
@@ -6485,7 +6613,7 @@ const PROPERTY_COVERAGE_BY_TYPE = /* @__PURE__ */ new Map([
6485
6613
  "TracingConfig",
6486
6614
  "VpcConfig"
6487
6615
  ]),
6488
- sdkUnwired: /* @__PURE__ */ new Map([["AcceleratorConfig", "not yet implemented by cdkd"]]),
6616
+ sdkUnwired: /* @__PURE__ */ new Map(),
6489
6617
  createOnlyDrops: /* @__PURE__ */ new Set(),
6490
6618
  readOnly: /* @__PURE__ */ new Set(["Arn", "SnapStartResponse"]),
6491
6619
  primaryIdentifier: /* @__PURE__ */ new Set(["FunctionName"]),
@@ -7101,6 +7229,7 @@ const PROPERTY_COVERAGE_BY_TYPE = /* @__PURE__ */ new Map([
7101
7229
  ["AWS::Route53::RecordSet", {
7102
7230
  handled: /* @__PURE__ */ new Set([
7103
7231
  "AliasTarget",
7232
+ "AZAffinity",
7104
7233
  "CidrRoutingConfig",
7105
7234
  "Comment",
7106
7235
  "Failover",
@@ -7118,7 +7247,7 @@ const PROPERTY_COVERAGE_BY_TYPE = /* @__PURE__ */ new Map([
7118
7247
  "Type",
7119
7248
  "Weight"
7120
7249
  ]),
7121
- sdkUnwired: /* @__PURE__ */ new Map([["AZAffinity", "not yet implemented by cdkd"]]),
7250
+ sdkUnwired: /* @__PURE__ */ new Map(),
7122
7251
  createOnlyDrops: /* @__PURE__ */ new Set(),
7123
7252
  readOnly: /* @__PURE__ */ new Set(),
7124
7253
  primaryIdentifier: /* @__PURE__ */ new Set([
@@ -9972,6 +10101,88 @@ function getTopLevelKeysHoldingUnreadableCreateOnly(resourceType, properties) {
9972
10101
  for (const path of settledUnreadableCreateOnlyPaths.get(resourceType) ?? []) if (holdsValueAt(properties, path)) result.add(path[0]);
9973
10102
  return result;
9974
10103
  }
10104
+ const WRITE_ONLY_KEYS_KEPT_WHEN_OMITTED = /* @__PURE__ */ new Map([
10105
+ ["AWS::Lambda::Function", /* @__PURE__ */ new Map([["Code", ["Architectures"]]])],
10106
+ ["AWS::AmazonMQ::Broker", /* @__PURE__ */ new Map([
10107
+ ["Users", []],
10108
+ ["Configuration", []],
10109
+ ["EngineVersion", []]
10110
+ ])],
10111
+ ["AWS::AppFabric::AppAuthorization", /* @__PURE__ */ new Map([["Credential", []]])],
10112
+ ["AWS::Batch::ComputeEnvironment", /* @__PURE__ */ new Map([["ReplaceComputeEnvironment", ["ComputeResources"]], ["UpdatePolicy", ["ComputeResources"]]])],
10113
+ ["AWS::BedrockAgentCore::ApiKeyCredentialProvider", /* @__PURE__ */ new Map([["ApiKey", ["ApiKeySecretConfig", "ApiKeySecretSource"]]])],
10114
+ ["AWS::BedrockAgentCore::OAuth2CredentialProvider", /* @__PURE__ */ new Map([["Oauth2ProviderConfigInput", []]])],
10115
+ ["AWS::Bedrock::Flow", /* @__PURE__ */ new Map([["DefinitionString", ["DefinitionSubstitutions"]]])],
10116
+ ["AWS::CloudFront::KeyValueStore", /* @__PURE__ */ new Map([["ImportSource", []]])],
10117
+ ["AWS::Connect::User", /* @__PURE__ */ new Map([["Password", []]])],
10118
+ ["AWS::DMS::Endpoint", /* @__PURE__ */ new Map([["Password", []]])],
10119
+ ["AWS::DataSync::LocationAzureBlob", /* @__PURE__ */ new Map([["AzureBlobSasConfiguration", [
10120
+ "AzureBlobAuthenticationType",
10121
+ "CmkSecretConfig",
10122
+ "CustomSecretConfig"
10123
+ ]]])],
10124
+ ["AWS::DocDBElastic::Cluster", /* @__PURE__ */ new Map([["AdminUserPassword", []]])],
10125
+ ["AWS::EC2::VPNConnection", /* @__PURE__ */ new Map([["VpnTunnelOptionsSpecifications", []]])],
10126
+ ["AWS::ElastiCache::ReplicationGroup", /* @__PURE__ */ new Map([["AuthToken", []]])],
10127
+ ["AWS::ElastiCache::User", /* @__PURE__ */ new Map([["Passwords", ["AuthenticationMode", "NoPasswordRequired"]]])],
10128
+ ["AWS::ElasticBeanstalk::Environment", /* @__PURE__ */ new Map([["OptionSettings", ["TemplateName", "PlatformArn"]]])],
10129
+ ["AWS::FSx::StorageVirtualMachine", /* @__PURE__ */ new Map([["SvmAdminPassword", []]])],
10130
+ ["AWS::KinesisAnalyticsV2::Application", /* @__PURE__ */ new Map([["ApplicationConfiguration", [
10131
+ "RunConfiguration",
10132
+ "RuntimeEnvironment",
10133
+ "ServiceExecutionRole"
10134
+ ]], ["RunConfiguration", [
10135
+ "ApplicationConfiguration",
10136
+ "RuntimeEnvironment",
10137
+ "ServiceExecutionRole"
10138
+ ]]])],
10139
+ ["AWS::MemoryDB::User", /* @__PURE__ */ new Map([["AuthenticationMode", []]])],
10140
+ ["AWS::Redshift::Cluster", /* @__PURE__ */ new Map([["MasterUserPassword", ["ManageMasterPassword"]]])],
10141
+ ["AWS::RedshiftServerless::Namespace", /* @__PURE__ */ new Map([["AdminUserPassword", ["AdminUsername", "ManageAdminPassword"]]])],
10142
+ ["AWS::Route53Resolver::FirewallDomainList", /* @__PURE__ */ new Map([["Domains", ["DomainFileUrl"]]])],
10143
+ ["AWS::StepFunctions::StateMachineAlias", /* @__PURE__ */ new Map([["DeploymentPreference", []]])],
10144
+ ["AWS::Synthetics::Canary", /* @__PURE__ */ new Map([["Code", ["RuntimeVersion"]]])]
10145
+ ]);
10146
+ const KEPT_WHATEVER_SIBLING_CHANGED = /* @__PURE__ */ new Map([["AWS::Batch::ComputeEnvironment", isFargateComputeEnvironment]]);
10147
+ function isFargateComputeEnvironment(properties) {
10148
+ const resources = properties["ComputeResources"];
10149
+ if (typeof resources !== "object" || resources === null) return false;
10150
+ const type = resources["Type"];
10151
+ return type === "FARGATE" || type === "FARGATE_SPOT";
10152
+ }
10153
+ const WRITE_ONLY_KEYS_REFUSED_ON_UPDATE = /* @__PURE__ */ new Map([["AWS::Connect::User", /* @__PURE__ */ new Set(["Password"])]]);
10154
+ function isWriteOnlyKeyRefusedOnUpdate(resourceType, key) {
10155
+ return WRITE_ONLY_KEYS_REFUSED_ON_UPDATE.get(resourceType)?.has(key) === true;
10156
+ }
10157
+ function movedReferencesRefusedOnUpdate(resourceType, desiredAsWritten, recordedAsWritten) {
10158
+ const keys = WRITE_ONLY_KEYS_REFUSED_ON_UPDATE.get(resourceType);
10159
+ if (keys === void 0) return [];
10160
+ const holdsReference = (value) => JSON.stringify(value)?.includes("{{resolve:") === true;
10161
+ return [...keys].filter((key) => {
10162
+ const desired = desiredAsWritten[key];
10163
+ const recorded = recordedAsWritten[key];
10164
+ if (desired === void 0 || recorded === void 0) return false;
10165
+ if (isDeepStrictEqual(desired, recorded)) return false;
10166
+ return holdsReference(desired) || holdsReference(recorded);
10167
+ });
10168
+ }
10169
+ function getWriteOnlyKeysKeptWhenOmitted(resourceType, properties, previousProperties, writeOnly = /* @__PURE__ */ new Set()) {
10170
+ const row = WRITE_ONLY_KEYS_KEPT_WHEN_OMITTED.get(resourceType);
10171
+ if (row === void 0) return /* @__PURE__ */ new Set();
10172
+ const keptWhateverChanged = KEPT_WHATEVER_SIBLING_CHANGED.get(resourceType);
10173
+ if (keptWhateverChanged?.(properties) && keptWhateverChanged(previousProperties)) return new Set(row.keys());
10174
+ const result = /* @__PURE__ */ new Set();
10175
+ for (const [key, travelsWith] of row) if (travelsWith.every((k) => isDeepStrictEqual(properties[k], previousProperties[k]))) result.add(key);
10176
+ let dropped = true;
10177
+ while (dropped) {
10178
+ dropped = false;
10179
+ for (const key of result) if (row.get(key).some((k) => writeOnly.has(k) && properties[k] !== void 0 && !result.has(k))) {
10180
+ result.delete(key);
10181
+ dropped = true;
10182
+ }
10183
+ }
10184
+ return result;
10185
+ }
9975
10186
  function getSettledWriteOnlyPropertyPaths(resourceType) {
9976
10187
  return settledWriteOnlyPaths.get(resourceType) ?? [];
9977
10188
  }
@@ -9993,6 +10204,109 @@ function parseRegistrySchema(resourceType, schema) {
9993
10204
  return parseJsonNamingNoBody(schema, "the DescribeType schema", (line) => getLogger().child("WriteOnlyProperties").debug(safeMsg`${resourceType}: ${line}`));
9994
10205
  }
9995
10206
 
10207
+ // src/provisioning/secret-physical-id.ts
10208
+ const APPSYNC_APIKEY_ARN_RESOURCE_PATH = /^apis\/([^/|]+)\/apikeys?\/([^/|]+)$/;
10209
+ const APPSYNC_ARN = /^arn:[^:]+:appsync:[^:]*:[^:]*:(.+)$/;
10210
+ const SECRET_PHYSICAL_ID_TYPES = /* @__PURE__ */ new Set(["AWS::AppSync::ApiKey", "AWS::CloudFormation::WaitConditionHandle"]);
10211
+ const SUBSTRING_FLOOR = 4;
10212
+ function maskedSecretSegment(segment) {
10213
+ return `****${segment.slice(-4)}`;
10214
+ }
10215
+ function secretPhysicalIdSegment(resourceType, physicalId) {
10216
+ if (typeof physicalId !== "string" || physicalId === "") return void 0;
10217
+ if (typeof resourceType !== "string" || !SECRET_PHYSICAL_ID_TYPES.has(resourceType)) return;
10218
+ if (resourceType === "AWS::CloudFormation::WaitConditionHandle") {
10219
+ const query = physicalId.indexOf("?");
10220
+ return query >= 0 && query < physicalId.length - 1 ? physicalId.slice(query + 1) : void 0;
10221
+ }
10222
+ if (resourceType !== "AWS::AppSync::ApiKey") return void 0;
10223
+ const parts = physicalId.split("|");
10224
+ if (parts.length === 2 && parts[0] !== "" && parts[1] !== "") return parts[1];
10225
+ const arn = APPSYNC_ARN.exec(physicalId);
10226
+ const path = arn ? APPSYNC_APIKEY_ARN_RESOURCE_PATH.exec(arn[1]) : null;
10227
+ if (path) return path[2];
10228
+ return physicalId;
10229
+ }
10230
+ function maskSegmentsInText(text, segments) {
10231
+ let out = text;
10232
+ for (const segment of segments) {
10233
+ if (out === segment) return maskedSecretSegment(segment);
10234
+ if (segment.length >= SUBSTRING_FLOOR && out.includes(segment)) out = out.split(segment).join(maskedSecretSegment(segment));
10235
+ }
10236
+ return out;
10237
+ }
10238
+ function displayPhysicalId(resourceType, physicalId) {
10239
+ const segment = secretPhysicalIdSegment(resourceType, physicalId);
10240
+ if (segment === void 0 || typeof physicalId !== "string") return physicalId;
10241
+ return maskSegmentsInText(physicalId, [segment]);
10242
+ }
10243
+ function maskSecretSegmentsDeep(value, segments) {
10244
+ if (segments.length === 0) return value;
10245
+ const ordered = [...new Set(segments)].sort((a, b) => b.length - a.length);
10246
+ const walk = (v) => {
10247
+ if (typeof v === "string") return maskSegmentsInText(v, ordered);
10248
+ if (Array.isArray(v)) return v.map(walk);
10249
+ if (v !== null && typeof v === "object") {
10250
+ const out = {};
10251
+ for (const [k, child] of Object.entries(v)) out[k] = walk(child);
10252
+ return out;
10253
+ }
10254
+ return v;
10255
+ };
10256
+ return walk(value);
10257
+ }
10258
+ function segmentOfRecord(record) {
10259
+ if (record === null || typeof record !== "object") return void 0;
10260
+ const r = record;
10261
+ return secretPhysicalIdSegment(r.resourceType, r.physicalId);
10262
+ }
10263
+ function stringLeavesOf(value, out = []) {
10264
+ if (typeof value === "string") out.push(value);
10265
+ else if (Array.isArray(value)) for (const v of value) stringLeavesOf(v, out);
10266
+ else if (value !== null && typeof value === "object") for (const v of Object.values(value)) stringLeavesOf(v, out);
10267
+ return out;
10268
+ }
10269
+ function secretNamedAttributeLeavesOf$1(record) {
10270
+ if (record === null || typeof record !== "object") return [];
10271
+ const r = record;
10272
+ if (r.resourceType !== "AWS::CloudFormation::Stack") return [];
10273
+ const names = r.secretNamedAttributes;
10274
+ const attributes = r.attributes;
10275
+ if (!Array.isArray(names) || attributes === null || typeof attributes !== "object") return [];
10276
+ const leaves = [];
10277
+ for (const name of names) {
10278
+ if (typeof name !== "string" || !Object.hasOwn(attributes, name)) continue;
10279
+ for (const leaf of stringLeavesOf(attributes[name])) if (leaf !== "" && leaf !== "***" && !leaf.includes("{{resolve:")) leaves.push(leaf);
10280
+ }
10281
+ return leaves;
10282
+ }
10283
+ function secretSegmentsOfState(state) {
10284
+ if (state === null || typeof state !== "object") return [];
10285
+ const s = state;
10286
+ const segments = [];
10287
+ const add = (record) => {
10288
+ const segment = segmentOfRecord(record);
10289
+ if (segment !== void 0) segments.push(segment);
10290
+ };
10291
+ if (s.resources !== null && typeof s.resources === "object" && !Array.isArray(s.resources)) for (const record of Object.values(s.resources)) {
10292
+ add(record);
10293
+ segments.push(...secretNamedAttributeLeavesOf$1(record));
10294
+ }
10295
+ for (const list of [s.orphans, s.supersededResources]) {
10296
+ if (!Array.isArray(list)) continue;
10297
+ for (const entry of list) {
10298
+ if (entry === null || typeof entry !== "object") continue;
10299
+ const record = entry.state;
10300
+ add(record);
10301
+ segments.push(...secretNamedAttributeLeavesOf$1(record));
10302
+ }
10303
+ }
10304
+ return segments;
10305
+ }
10306
+ function withSecretPhysicalIdsMaskedInState(state, segments = secretSegmentsOfState(state)) {
10307
+ return maskSecretSegmentsDeep(state, segments);
10308
+ }
10309
+
9996
10310
  // src/deployment/replacement-name-holder/name-keys.ts
9997
10311
  const flat = (property) => ({ name: [[property]] });
9998
10312
  function ownEntry$1(table, key) {
@@ -10521,7 +10835,7 @@ function reverseReplacementTrustsGeneratedName(resourceType) {
10521
10835
 
10522
10836
  // src/deployment/replacement-name-holder/holder.ts
10523
10837
  function recordSetHolds(requested, recorded, observed, newPhysicalId, r, v) {
10524
- const newRecord = `${v.holderRecord} (${r.shown(newPhysicalId)})`;
10838
+ const newRecord = `${v.holderRecord} (${r.shown(displayPhysicalId(RECORD_SET, newPhysicalId))})`;
10525
10839
  const wantName = valueAt$2(requested, ["Name"]);
10526
10840
  const wantType = valueAt$2(requested, ["Type"]);
10527
10841
  const haveName = heldAt(recorded, observed, ["Name"]).value;
@@ -10571,7 +10885,7 @@ function reverseReplacementNewHoldsName(input) {
10571
10885
  function holderVerdict$1(input, v) {
10572
10886
  const { oldResourceType, newResourceType, requested, recorded, observed, physicalId } = input;
10573
10887
  const r = renderer(input.mask ?? ((value) => value));
10574
- const newResource = `${v.holder} (${r.shown(physicalId)})`;
10888
+ const newResource = `${v.holder} (${r.shown(displayPhysicalId(newResourceType, physicalId))})`;
10575
10889
  if (oldResourceType !== newResourceType && !SHARED_NAME_SPACES.some((s) => s.has(oldResourceType) && s.has(newResourceType))) return unproven(`${newResource} is of type ${r.shown(newResourceType)}, which cdkd does not know to share a name space with ${r.shown(oldResourceType)}`);
10576
10890
  if (oldResourceType === "AWS::Route53::RecordSet") return recordSetHolds(requested, recorded, observed, physicalId, r, v);
10577
10891
  const oldKey = nameKeyFor(oldResourceType);
@@ -10646,13 +10960,13 @@ function replacementOldHoldsSentName(input) {
10646
10960
  mask: input.mask
10647
10961
  }, DEPLOY_VOICE);
10648
10962
  }
10649
- function renderNameHeldElsewhere(change) {
10963
+ function renderNameHeldElsewhere(change, oldResourceType) {
10650
10964
  const property = change.property;
10651
10965
  const desiredPlain = isPlainName(change.desiredName);
10652
10966
  const asksFor = desiredPlain ? `asks for ${property} "${change.desiredName}"` : `asks for a name (${property}) that is not a plain identifier`;
10653
10967
  const heldProperty = change.heldProperty ?? property;
10654
10968
  const held = change.heldName === void 0 ? `does not hold that name` : isPlainName(change.heldName) ? `holds ${heldProperty} "${change.heldName}"` : `holds a name (${heldProperty}) that is not a plain identifier`;
10655
- return `The replacement ${asksFor}, but ${change.physicalId === "" ? "the resource being replaced, which has no recorded id," : isPlainName(change.physicalId) ? `the resource being replaced (${change.physicalId})` : "the resource being replaced, whose recorded id is not a plain identifier,"} ${held} — so ${desiredPlain ? `"${change.desiredName}"` : "the requested name"} is held by ANOTHER existing resource, not by the one being replaced, and deleting the old resource first cannot free it`;
10969
+ return `The replacement ${asksFor}, but ${change.physicalId === "" ? "the resource being replaced, which has no recorded id," : isPlainName(change.physicalId) ? `the resource being replaced (${displayPhysicalId(oldResourceType, change.physicalId)})` : "the resource being replaced, whose recorded id is not a plain identifier,"} ${held} — so ${desiredPlain ? `"${change.desiredName}"` : "the requested name"} is held by ANOTHER existing resource, not by the one being replaced, and deleting the old resource first cannot free it`;
10656
10970
  }
10657
10971
  function isPlainName(value) {
10658
10972
  return !/\s/.test(value) && displayIdent(value, { maxCodePoints: 1152 }) === value;
@@ -10764,8 +11078,8 @@ function probeErrorMeansNameHeld(resourceType, error) {
10764
11078
  if (typeof e.name === "string" && S3_CREDENTIAL_ERRORS.has(e.name)) return false;
10765
11079
  return e.name === "Forbidden" || e.$metadata?.httpStatusCode === 403;
10766
11080
  }
10767
- function renderReplacementNameChange(change, createProps) {
10768
- if (change.property !== "EventBusName") return renderNameHeldElsewhere(change);
11081
+ function renderReplacementNameChange(change, createProps, oldResourceType) {
11082
+ if (change.property !== "EventBusName") return renderNameHeldElsewhere(change, oldResourceType);
10769
11083
  const name = createProps["Name"];
10770
11084
  const rule = typeof name === "string" && isPlainName(name) ? `rule "${name}"` : "the rule (by its Name)";
10771
11085
  const bus = (value, fallback) => value !== void 0 && isPlainName(value) ? `bus "${value}"` : fallback;
@@ -13318,7 +13632,7 @@ function healMaskedOwnIdAttribute(resolver, logicalId, resource, attributeName,
13318
13632
  // src/deployment/intrinsic-resolver/getatt-refusals.ts
13319
13633
  function refuseUnservedAttribute(resolver, site) {
13320
13634
  const { logicalId, attributeName, resourceType, physicalId, context, observed, remedy } = site;
13321
- throw new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${displayMasked(resolver, resourceType, context)}: ${observed}. The physical id ${quotedRender(displayMasked(resolver, physicalId, context), "\"")} is not a usable ${displayMasked(resolver, attributeName, context)}, so cdkd refuses to substitute it. ${remedy}`);
13635
+ throw new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${displayMasked(resolver, resourceType, context)}: ${observed}. The physical id ${quotedRender(displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context), "\"")} is not a usable ${displayMasked(resolver, attributeName, context)}, so cdkd refuses to substitute it. ${remedy}`);
13322
13636
  }
13323
13637
  function refuseUnconstructibleAttribute(resolver, site) {
13324
13638
  const { logicalId, attributeName, resourceType, context, why, remedyWhenHealCompleted } = site;
@@ -13376,14 +13690,14 @@ function guardedPhysicalIdFallback(resolver, logicalId, attributeName, resourceT
13376
13690
  const expectsUrlShape = /(?:Url|URL)$/.test(attributeName) && !/^https?:\/\//.test(physicalId);
13377
13691
  if (expectsArnShape || expectsUrlShape) {
13378
13692
  const expectedShape = expectsArnShape ? "an ARN (arn:...)" : "a URL (http(s)://...)";
13379
- throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${loggedType}: ` + (recordMayBeStale ? `the state record holds no value for it, and the physical ID ` : `attributes are not enriched for this resource type, and the physical ID `) + `fallback ${quotedRender(displayMasked(resolver, physicalId, context), "\"")} is not ${expectedShape}. CloudFormation would return a different value here, so falling back to the physical ID would silently produce a wrong value (e.g. in stack Outputs). ` + (recordMayBeStale ? staleRecordRemedy(resolver, healOutcome, context) : unenrichedRemedy(resolver, resourceType, attributeName, healOutcome, context))));
13693
+ throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${loggedType}: ` + (recordMayBeStale ? `the state record holds no value for it, and the physical ID ` : `attributes are not enriched for this resource type, and the physical ID `) + `fallback ${quotedRender(displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context), "\"")} is not ${expectedShape}. CloudFormation would return a different value here, so falling back to the physical ID would silently produce a wrong value (e.g. in stack Outputs). ` + (recordMayBeStale ? staleRecordRemedy(resolver, healOutcome, context) : unenrichedRemedy(resolver, resourceType, attributeName, healOutcome, context))));
13380
13694
  }
13381
- if (resolver.strictGetAtt) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${loggedType}: ` + (recordMayBeStale ? `the state record holds no value for it, and --strict-getatt ` : `attributes are not enriched for this resource type, and --strict-getatt `) + `rejects the physical ID fallback ${quotedRender(displayMasked(resolver, physicalId, context), "\"")} (which may not be the value CloudFormation would return). Drop --strict-getatt to fall back with a warning. ` + (recordMayBeStale ? staleRecordRemedy(resolver, healOutcome, context) : unenrichedRemedy(resolver, resourceType, attributeName, healOutcome, context))));
13695
+ if (resolver.strictGetAtt) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${loggedType}: ` + (recordMayBeStale ? `the state record holds no value for it, and --strict-getatt ` : `attributes are not enriched for this resource type, and --strict-getatt `) + `rejects the physical ID fallback ${quotedRender(displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context), "\"")} (which may not be the value CloudFormation would return). Drop --strict-getatt to fall back with a warning. ` + (recordMayBeStale ? staleRecordRemedy(resolver, healOutcome, context) : unenrichedRemedy(resolver, resourceType, attributeName, healOutcome, context))));
13382
13696
  const topAttribute = attributeName.split(".")[0] ?? attributeName;
13383
13697
  const resources = context?.resources;
13384
13698
  const record = resources !== void 0 && Object.hasOwn(resources, logicalId) ? resources[logicalId] : void 0;
13385
13699
  const coverage = getPropertyCoverage(resourceType);
13386
- if (record?.provisionedBy !== "cc-api" && coverage?.readOnly.has(topAttribute) === true && !isPhysicalIdIdentifier(resourceType, coverage.primaryIdentifier, topAttribute) && !PHYSICAL_ID_ATTRIBUTES.has(`${resourceType}.${attributeName}`) && !(isOwnArnAttribute(resourceType, attributeName) && physicalId.startsWith("arn:"))) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${loggedType}: ` + (recordMayBeStale ? `the state record holds no value for it, and its physical ID ` : healOutcome?.kind === "read" ? `the provider's re-read of the resource reports no value for it (one still creating has none yet), and its physical ID ` : `cdkd does not record it for this resource type, and its physical ID `) + `${quotedRender(displayMasked(resolver, physicalId, context), "\"")} is not the value CloudFormation returns, so serving it would silently produce a wrong value. ` + (recordMayBeStale ? staleRecordRemedy(resolver, healOutcome, context) : unenrichedRemedy(resolver, resourceType, attributeName, healOutcome, context))));
13700
+ if (record?.provisionedBy !== "cc-api" && coverage?.readOnly.has(topAttribute) === true && !isPhysicalIdIdentifier(resourceType, coverage.primaryIdentifier, topAttribute) && !PHYSICAL_ID_ATTRIBUTES.has(`${resourceType}.${attributeName}`) && !(isOwnArnAttribute(resourceType, attributeName) && physicalId.startsWith("arn:"))) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${loggedType}: ` + (recordMayBeStale ? `the state record holds no value for it, and its physical ID ` : healOutcome?.kind === "read" ? `the provider's re-read of the resource reports no value for it (one still creating has none yet), and its physical ID ` : `cdkd does not record it for this resource type, and its physical ID `) + `${quotedRender(displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context), "\"")} is not the value CloudFormation returns, so serving it would silently produce a wrong value. ` + (recordMayBeStale ? staleRecordRemedy(resolver, healOutcome, context) : unenrichedRemedy(resolver, resourceType, attributeName, healOutcome, context))));
13387
13701
  resolver.physicalIdFallbackCount++;
13388
13702
  if (recordMayBeStale) {
13389
13703
  resolver.logger.warn(`The state record for ${displayMasked(resolver, logicalId, context)} (${loggedType}) holds no ${displayMasked(resolver, attributeName, context)}, returning physical ID. ` + staleRecordRemedy(resolver, healOutcome, context));
@@ -13460,7 +13774,7 @@ async function constructAttributeForCoreTypes(resolver, resource, attributeName,
13460
13774
  case "Ipv6CidrBlocks": try {
13461
13775
  const ec2 = resolver.clients.clientsForRegion(resolver.explicitRegion).ec2;
13462
13776
  const maxAttempts = 15;
13463
- const loggedId = displayMasked(resolver, physicalId, context);
13777
+ const loggedId = displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context);
13464
13778
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
13465
13779
  const associations = (await ec2.send(new DescribeVpcsCommand({ VpcIds: [physicalId] }))).Vpcs?.[0]?.Ipv6CidrBlockAssociationSet || [];
13466
13780
  const blocks = associations.filter((a) => a.Ipv6CidrBlockState?.State === "associated").map((a) => a.Ipv6CidrBlock);
@@ -13478,11 +13792,11 @@ async function constructAttributeForCoreTypes(resolver, resource, attributeName,
13478
13792
  resolver.logger.warn(`VPC ${loggedId} IPv6 CIDR did not reach 'associated' state after ${maxAttempts} attempts`);
13479
13793
  return [];
13480
13794
  } catch (error) {
13481
- resolver.logger.warn(`Failed to fetch VPC Ipv6CidrBlocks for ${displayMasked(resolver, physicalId, context)}: ${displayMasked(resolver, describeAwsFailure(error).detail, context)}`);
13795
+ resolver.logger.warn(`Failed to fetch VPC Ipv6CidrBlocks for ${displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context)}: ${displayMasked(resolver, describeAwsFailure(error).detail, context)}`);
13482
13796
  return [];
13483
13797
  }
13484
13798
  case "DefaultSecurityGroup": {
13485
- if (!/^vpc-[0-9a-f]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, DefaultSecurityGroup] for AWS::EC2::VPC: the state record's physical id ${quotedRender(displayMasked(resolver, physicalId, context).slice(0, 64), "\"")} is not a VPC id (vpc-<hex>), so cdkd will not use it as an EC2 filter value. Repair the record (cdkd import, or re-create the VPC) and deploy again.`));
13799
+ if (!/^vpc-[0-9a-f]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, DefaultSecurityGroup] for AWS::EC2::VPC: the state record's physical id ${quotedRender(displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context).slice(0, 64), "\"")} is not a VPC id (vpc-<hex>), so cdkd will not use it as an EC2 filter value. Repair the record (cdkd import, or re-create the VPC) and deploy again.`));
13486
13800
  const cachedGroupId = cachedVpcDefaultSecurityGroups[physicalId];
13487
13801
  if (cachedGroupId !== void 0) return cachedGroupId;
13488
13802
  let groupId;
@@ -13520,7 +13834,7 @@ async function constructAttributeForCoreTypes(resolver, resource, attributeName,
13520
13834
  });
13521
13835
  }
13522
13836
  case "DefaultNetworkAcl": {
13523
- if (!/^vpc-[0-9a-f]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, DefaultNetworkAcl] for AWS::EC2::VPC: the state record's physical id ${quotedRender(displayMasked(resolver, physicalId, context).slice(0, 64), "\"")} is not a VPC id (vpc-<hex>), so cdkd will not use it as an EC2 filter value. Repair the record (cdkd import, or re-create the VPC) and deploy again.`));
13837
+ if (!/^vpc-[0-9a-f]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, DefaultNetworkAcl] for AWS::EC2::VPC: the state record's physical id ${quotedRender(displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context).slice(0, 64), "\"")} is not a VPC id (vpc-<hex>), so cdkd will not use it as an EC2 filter value. Repair the record (cdkd import, or re-create the VPC) and deploy again.`));
13524
13838
  let aclId;
13525
13839
  try {
13526
13840
  aclId = (await resolver.clients.clientsForRegion(resolver.explicitRegion).ec2.send(new DescribeNetworkAclsCommand({ Filters: [{
@@ -14178,6 +14492,13 @@ async function resolveImportValue(resolver, importValueArg, context) {
14178
14492
  if (!context.stateBackend) throw markNonRetryable(/* @__PURE__ */ new Error("Fn::ImportValue: state backend is required for cross-stack references"));
14179
14493
  const loggedExportName = displayMasked(resolver, exportName, context);
14180
14494
  resolver.logger.debug(`Resolving Fn::ImportValue: ${loggedExportName}`);
14495
+ const previewed = context.crossStackPreview?.exportValue(resolver.resolverRegion, exportName);
14496
+ if (previewed && previewed.producerStack !== context.stackName) {
14497
+ const producer = displayMasked(resolver, previewed.producerStack, context);
14498
+ if (previewed.kind === "unknown") throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::ImportValue ${quotedRender(loggedExportName, "'")}: stack ${producer}, diffed in this run, publishes a new value only when it deploys`));
14499
+ resolver.logger.info(safeMsg`Resolved Fn::ImportValue: ${loggedExportName} (from this diff of ${producer}, which changes it)`);
14500
+ return previewed.value;
14501
+ }
14181
14502
  if (context.exportIndex) {
14182
14503
  let entry;
14183
14504
  try {
@@ -14554,6 +14875,12 @@ async function resolveGetStackOutput(resolver, arg, context) {
14554
14875
  const loggedRegion = displayMasked(resolver, loggedRegionText, context);
14555
14876
  const shownRoleArn = roleArn ? displayIdent(roleArn, { maxCodePoints: 613 }) : "";
14556
14877
  resolver.logger.debug(`Resolving Fn::GetStackOutput: StackName=${loggedStackName}, Region=${loggedRegion}, OutputName=${loggedOutputName}${roleArn ? `, RoleArn=${shownRoleArn}` : ""}`);
14878
+ const previewed = roleArn ? void 0 : context.crossStackPreview?.stackOutput(region, stackName, outputName);
14879
+ if (previewed) {
14880
+ if (previewed.kind === "unknown") throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: StackName=${loggedStackName}, OutputName=${loggedOutputName}: the stack, diffed in this run, publishes a new value only when it deploys`));
14881
+ resolver.logger.info(safeMsg`Resolved Fn::GetStackOutput: StackName=${loggedStackName}, OutputName=${loggedOutputName} (from this diff of the stack, which changes it)`);
14882
+ return previewed.value;
14883
+ }
14557
14884
  let readRoleArn = roleArn;
14558
14885
  let refuseCdkRead;
14559
14886
  if (cdkRef !== void 0) {
@@ -15093,107 +15420,6 @@ async function rebuildByToken(value, resolveToken) {
15093
15420
  return value;
15094
15421
  }
15095
15422
 
15096
- // src/provisioning/secret-physical-id.ts
15097
- const APPSYNC_APIKEY_ARN_RESOURCE_PATH = /^apis\/([^/|]+)\/apikeys?\/([^/|]+)$/;
15098
- const APPSYNC_ARN = /^arn:[^:]+:appsync:[^:]*:[^:]*:(.+)$/;
15099
- const SUBSTRING_FLOOR = 4;
15100
- function maskedSecretSegment(segment) {
15101
- return `****${segment.slice(-4)}`;
15102
- }
15103
- function secretPhysicalIdSegment(resourceType, physicalId) {
15104
- if (typeof physicalId !== "string" || physicalId === "") return void 0;
15105
- if (resourceType === "AWS::CloudFormation::WaitConditionHandle") {
15106
- const query = physicalId.indexOf("?");
15107
- return query >= 0 && query < physicalId.length - 1 ? physicalId.slice(query + 1) : void 0;
15108
- }
15109
- if (resourceType !== "AWS::AppSync::ApiKey") return void 0;
15110
- const parts = physicalId.split("|");
15111
- if (parts.length === 2 && parts[0] !== "" && parts[1] !== "") return parts[1];
15112
- const arn = APPSYNC_ARN.exec(physicalId);
15113
- const path = arn ? APPSYNC_APIKEY_ARN_RESOURCE_PATH.exec(arn[1]) : null;
15114
- if (path) return path[2];
15115
- return physicalId;
15116
- }
15117
- function maskSegmentsInText(text, segments) {
15118
- let out = text;
15119
- for (const segment of segments) {
15120
- if (out === segment) return maskedSecretSegment(segment);
15121
- if (segment.length >= SUBSTRING_FLOOR && out.includes(segment)) out = out.split(segment).join(maskedSecretSegment(segment));
15122
- }
15123
- return out;
15124
- }
15125
- function displayPhysicalId(resourceType, physicalId) {
15126
- const segment = secretPhysicalIdSegment(resourceType, physicalId);
15127
- if (segment === void 0 || typeof physicalId !== "string") return physicalId;
15128
- return maskSegmentsInText(physicalId, [segment]);
15129
- }
15130
- function maskSecretSegmentsDeep(value, segments) {
15131
- if (segments.length === 0) return value;
15132
- const ordered = [...new Set(segments)].sort((a, b) => b.length - a.length);
15133
- const walk = (v) => {
15134
- if (typeof v === "string") return maskSegmentsInText(v, ordered);
15135
- if (Array.isArray(v)) return v.map(walk);
15136
- if (v !== null && typeof v === "object") {
15137
- const out = {};
15138
- for (const [k, child] of Object.entries(v)) out[k] = walk(child);
15139
- return out;
15140
- }
15141
- return v;
15142
- };
15143
- return walk(value);
15144
- }
15145
- function segmentOfRecord(record) {
15146
- if (record === null || typeof record !== "object") return void 0;
15147
- const r = record;
15148
- return secretPhysicalIdSegment(r.resourceType, r.physicalId);
15149
- }
15150
- function stringLeavesOf(value, out = []) {
15151
- if (typeof value === "string") out.push(value);
15152
- else if (Array.isArray(value)) for (const v of value) stringLeavesOf(v, out);
15153
- else if (value !== null && typeof value === "object") for (const v of Object.values(value)) stringLeavesOf(v, out);
15154
- return out;
15155
- }
15156
- function secretNamedAttributeLeavesOf$1(record) {
15157
- if (record === null || typeof record !== "object") return [];
15158
- const r = record;
15159
- if (r.resourceType !== "AWS::CloudFormation::Stack") return [];
15160
- const names = r.secretNamedAttributes;
15161
- const attributes = r.attributes;
15162
- if (!Array.isArray(names) || attributes === null || typeof attributes !== "object") return [];
15163
- const leaves = [];
15164
- for (const name of names) {
15165
- if (typeof name !== "string" || !Object.hasOwn(attributes, name)) continue;
15166
- for (const leaf of stringLeavesOf(attributes[name])) if (leaf !== "" && leaf !== "***" && !leaf.includes("{{resolve:")) leaves.push(leaf);
15167
- }
15168
- return leaves;
15169
- }
15170
- function secretSegmentsOfState(state) {
15171
- if (state === null || typeof state !== "object") return [];
15172
- const s = state;
15173
- const segments = [];
15174
- const add = (record) => {
15175
- const segment = segmentOfRecord(record);
15176
- if (segment !== void 0) segments.push(segment);
15177
- };
15178
- if (s.resources !== null && typeof s.resources === "object" && !Array.isArray(s.resources)) for (const record of Object.values(s.resources)) {
15179
- add(record);
15180
- segments.push(...secretNamedAttributeLeavesOf$1(record));
15181
- }
15182
- for (const list of [s.orphans, s.supersededResources]) {
15183
- if (!Array.isArray(list)) continue;
15184
- for (const entry of list) {
15185
- if (entry === null || typeof entry !== "object") continue;
15186
- const record = entry.state;
15187
- add(record);
15188
- segments.push(...secretNamedAttributeLeavesOf$1(record));
15189
- }
15190
- }
15191
- return segments;
15192
- }
15193
- function withSecretPhysicalIdsMaskedInState(state, segments = secretSegmentsOfState(state)) {
15194
- return maskSecretSegmentsDeep(state, segments);
15195
- }
15196
-
15197
15423
  // src/deployment/intrinsic-resolver/getatt-construct-app.ts
15198
15424
  async function constructAttributeForAppTypes(resolver, resource, attributeName, context, logicalId, resourceType, physicalId, accountId, partition, region) {
15199
15425
  if (resourceType === "AWS::Events::Rule") switch (attributeName) {
@@ -15541,7 +15767,7 @@ async function constructAttributeForComputeTypes(resolver, attributeName, contex
15541
15767
  if (resourceType === "AWS::EC2::SecurityGroup") switch (attributeName) {
15542
15768
  case "GroupId": return physicalId;
15543
15769
  case "VpcId": {
15544
- if (!/^sg-[0-9a-f]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, VpcId] for AWS::EC2::SecurityGroup: the state record's physical id ${quotedRender(displayMasked(resolver, physicalId, context).slice(0, 64), "\"")} is not a security group id (sg-<hex>), so cdkd will not look it up. Repair the record (cdkd import, or re-create the security group) and deploy again.`));
15770
+ if (!/^sg-[0-9a-f]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, VpcId] for AWS::EC2::SecurityGroup: the state record's physical id ${quotedRender(displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context).slice(0, 64), "\"")} is not a security group id (sg-<hex>), so cdkd will not look it up. Repair the record (cdkd import, or re-create the security group) and deploy again.`));
15545
15771
  const cachedVpcId = cachedSecurityGroupVpcIds[physicalId];
15546
15772
  if (cachedVpcId !== void 0) return cachedVpcId;
15547
15773
  let vpcId;
@@ -15722,7 +15948,7 @@ async function constructAttributeForComputeTypes(resolver, attributeName, contex
15722
15948
  const value = attributeName === "LatestVersionNumber" ? lt?.LatestVersionNumber : lt?.DefaultVersionNumber;
15723
15949
  if (value !== void 0 && value !== null) return String(value);
15724
15950
  } catch (err) {
15725
- resolver.logger.warn(`DescribeLaunchTemplates(${displayMasked(resolver, physicalId, context)}) failed for ${displayMasked(resolver, attributeName, context)}: ${displayMasked(resolver, describeAwsFailure(err).detail, context)}`);
15951
+ resolver.logger.warn(`DescribeLaunchTemplates(${displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context)}) failed for ${displayMasked(resolver, attributeName, context)}: ${displayMasked(resolver, describeAwsFailure(err).detail, context)}`);
15726
15952
  }
15727
15953
  return attributeName === "LatestVersionNumber" ? "$Latest" : "$Default";
15728
15954
  }
@@ -15732,7 +15958,7 @@ async function constructAttributeForComputeTypes(resolver, attributeName, contex
15732
15958
  if (resourceType === "AWS::CloudFront::Distribution") switch (attributeName) {
15733
15959
  case "Id": return physicalId;
15734
15960
  case "DomainName": {
15735
- if (!/^[A-Z0-9]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, DomainName] for AWS::CloudFront::Distribution: the state record's physical id ${quotedRender(displayMasked(resolver, physicalId, context).slice(0, 64), "\"")} is not a distribution id (upper-case alphanumerics), so cdkd will not look it up. Repair the record (cdkd import, or re-create the distribution) and deploy again.`));
15961
+ if (!/^[A-Z0-9]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, DomainName] for AWS::CloudFront::Distribution: the state record's physical id ${quotedRender(displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context).slice(0, 64), "\"")} is not a distribution id (upper-case alphanumerics), so cdkd will not look it up. Repair the record (cdkd import, or re-create the distribution) and deploy again.`));
15736
15962
  const cachedDomainName = cachedCloudFrontDomainNames[physicalId];
15737
15963
  if (cachedDomainName !== void 0) return cachedDomainName;
15738
15964
  let domainName;
@@ -15769,7 +15995,7 @@ async function constructAttributeForComputeTypes(resolver, attributeName, contex
15769
15995
  if (attributeName === "VpcId") {
15770
15996
  if (context.staleAttributeHeal?.phase === "probe") throw new StaleAttributeMissSignal();
15771
15997
  const vpcIdHealOutcome = context.staleAttributeHeal?.phase === "settled" ? context.staleAttributeHeal.outcome : void 0;
15772
- throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${resourceType}: the state record holds no VpcId for it (the read-back that would have recorded it reported none), and the physical id ${quotedRender(displayMasked(resolver, physicalId, context), "\"")} is a name, not a VPC id, so cdkd refuses to substitute it. ${staleRecordRemedy(resolver, vpcIdHealOutcome, context)} Referencing the VPC directly also works.`));
15998
+ throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${resourceType}: the state record holds no VpcId for it (the read-back that would have recorded it reported none), and the physical id ${quotedRender(displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context), "\"")} is a name, not a VPC id, so cdkd refuses to substitute it. ${staleRecordRemedy(resolver, vpcIdHealOutcome, context)} Referencing the VPC directly also works.`));
15773
15999
  }
15774
16000
  return guardedPhysicalIdFallback(resolver, logicalId, attributeName, resourceType, physicalId, context);
15775
16001
  }
@@ -15787,7 +16013,7 @@ const subnetIpv6AttributeWait = {
15787
16013
  };
15788
16014
  async function readSubnetAttributeLive(resolver, attributeName, context, logicalId, physicalId) {
15789
16015
  const resourceType = "AWS::EC2::Subnet";
15790
- if (!/^subnet-[0-9a-f]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for AWS::EC2::Subnet: the state record's physical id ${quotedRender(displayMasked(resolver, physicalId, context).slice(0, 64), "\"")} is not a subnet id (subnet-<hex>), so cdkd will not look it up. Repair the record (cdkd import, or re-create the subnet) and deploy again.`));
16016
+ if (!/^subnet-[0-9a-f]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for AWS::EC2::Subnet: the state record's physical id ${quotedRender(displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context).slice(0, 64), "\"")} is not a subnet id (subnet-<hex>), so cdkd will not look it up. Repair the record (cdkd import, or re-create the subnet) and deploy again.`));
15791
16017
  const ec2 = resolver.clients.clientsForRegion(resolver.explicitRegion).ec2;
15792
16018
  const refuse = (observed, remedy) => refuseUnservedAttribute(resolver, {
15793
16019
  logicalId,
@@ -15820,7 +16046,7 @@ async function readSubnetAttributeLive(resolver, attributeName, context, logical
15820
16046
  };
15821
16047
  const notFound = () => refuse("DescribeSubnets returned no subnet for it", `Check that the subnet still exists in this region, or repair the record with ${cdkdRemedy("cdkd import")}.`);
15822
16048
  if (attributeName === "Ipv6CidrBlocks") {
15823
- const loggedId = displayMasked(resolver, physicalId, context);
16049
+ const loggedId = displayMasked(resolver, displayPhysicalId(resourceType, physicalId), context);
15824
16050
  const { attempts, delayMs } = subnetIpv6AttributeWait;
15825
16051
  for (let attempt = 1; attempt <= attempts; attempt++) {
15826
16052
  const associations = (await describe() ?? notFound()).Ipv6CidrBlockAssociationSet ?? [];
@@ -18209,16 +18435,22 @@ function withListenerRuleConditionOps(resourceType, patch, desired) {
18209
18435
  }
18210
18436
 
18211
18437
  // src/provisioning/cc-read-back-default-paths.ts
18212
- const CC_READ_BACK_DEFAULT_PATHS = { "AWS::OpenSearchService::Domain": [{
18213
- path: ["AdvancedOptions", "override_main_response_version"],
18214
- value: "false"
18215
- }, {
18216
- path: ["AIMLOptions"],
18217
- value: {
18218
- S3VectorsEngine: { Enabled: false },
18219
- ServerlessVectorAcceleration: { Enabled: false }
18220
- }
18221
- }] };
18438
+ const CC_READ_BACK_DEFAULT_PATHS = {
18439
+ "AWS::Connect::User": [{
18440
+ path: ["VoiceEnhancementConfigs"],
18441
+ value: [{ Channel: "VOICE" }]
18442
+ }],
18443
+ "AWS::OpenSearchService::Domain": [{
18444
+ path: ["AdvancedOptions", "override_main_response_version"],
18445
+ value: "false"
18446
+ }, {
18447
+ path: ["AIMLOptions"],
18448
+ value: {
18449
+ S3VectorsEngine: { Enabled: false },
18450
+ ServerlessVectorAcceleration: { Enabled: false }
18451
+ }
18452
+ }]
18453
+ };
18222
18454
  function hasCcReadBackDefaultPaths(resourceType) {
18223
18455
  return Object.prototype.hasOwnProperty.call(CC_READ_BACK_DEFAULT_PATHS, resourceType);
18224
18456
  }
@@ -18237,7 +18469,7 @@ function withCcReadBackDefaultRemovals(resourceType, patch, desired, liveModel)
18237
18469
  if (defaults.length === 0 || patch.length === 0 || liveModel === void 0) return patch;
18238
18470
  const extra = [];
18239
18471
  for (const { path, value } of defaults) {
18240
- const pointer = `/${path.map(escapeJsonPointer$1).join("/")}`;
18472
+ const pointer = `/${path.map(escapeJsonPointer$2).join("/")}`;
18241
18473
  if (patch.some((op) => op.path === pointer || op.path.startsWith(`${pointer}/`) || pointer.startsWith(`${op.path}/`))) continue;
18242
18474
  if (!isDeepStrictEqual(valueAt$1(liveModel, path), value)) continue;
18243
18475
  const declared = valueAt$1(desired, path);
@@ -18249,7 +18481,7 @@ function withCcReadBackDefaultRemovals(resourceType, patch, desired, liveModel)
18249
18481
  }
18250
18482
  return extra.length === 0 ? patch : [...patch, ...extra];
18251
18483
  }
18252
- function escapeJsonPointer$1(key) {
18484
+ function escapeJsonPointer$2(key) {
18253
18485
  return key.replace(/~/g, "~0").replace(/\//g, "~1");
18254
18486
  }
18255
18487
 
@@ -18272,7 +18504,7 @@ function withCcReadBackEmptyKeyRemovals(resourceType, patch, desired, liveModel)
18272
18504
  let out = patch;
18273
18505
  const extra = [];
18274
18506
  for (const key of keys) {
18275
- const path = `/${escapeJsonPointer(key)}`;
18507
+ const path = `/${escapeJsonPointer$1(key)}`;
18276
18508
  const existing = out.findIndex((op) => op.path === path);
18277
18509
  if (existing !== -1) {
18278
18510
  const op = out[existing];
@@ -18293,6 +18525,35 @@ function withCcReadBackEmptyKeyRemovals(resourceType, patch, desired, liveModel)
18293
18525
  }
18294
18526
  return extra.length === 0 && out === patch ? patch : [...out, ...extra];
18295
18527
  }
18528
+ function escapeJsonPointer$1(key) {
18529
+ return key.replace(/~/g, "~0").replace(/\//g, "~1");
18530
+ }
18531
+
18532
+ // src/provisioning/cc-read-back-exclusive-keys.ts
18533
+ const CC_READ_BACK_EXCLUSIVE_KEYS = {
18534
+ "AWS::Bedrock::Flow": [{
18535
+ readBack: "Definition",
18536
+ writtenAs: ["DefinitionString", "DefinitionS3Location"]
18537
+ }],
18538
+ "AWS::StepFunctions::StateMachineAlias": [{
18539
+ readBack: "RoutingConfiguration",
18540
+ writtenAs: ["DeploymentPreference"]
18541
+ }]
18542
+ };
18543
+ function hasCcReadBackExclusiveKeys(resourceType) {
18544
+ return Object.prototype.hasOwnProperty.call(CC_READ_BACK_EXCLUSIVE_KEYS, resourceType);
18545
+ }
18546
+ async function withCcReadBackExclusiveKeyRemovals(resourceType, patch, desired, readLiveModel) {
18547
+ const candidates = (hasCcReadBackExclusiveKeys(resourceType) ? CC_READ_BACK_EXCLUSIVE_KEYS[resourceType] : []).filter(({ readBack, writtenAs }) => patch.some((op) => (op.op === "add" || op.op === "replace") && writtenAs.some((key) => op.path === `/${escapeJsonPointer(key)}`)) && !patch.some((op) => op.path === `/${escapeJsonPointer(readBack)}`) && !Object.prototype.hasOwnProperty.call(desired, readBack));
18548
+ if (candidates.length === 0) return patch;
18549
+ const liveModel = await readLiveModel();
18550
+ if (liveModel === void 0) return patch;
18551
+ const extra = candidates.filter(({ readBack }) => Object.prototype.hasOwnProperty.call(liveModel, readBack)).map(({ readBack }) => ({
18552
+ op: "remove",
18553
+ path: `/${escapeJsonPointer(readBack)}`
18554
+ }));
18555
+ return extra.length === 0 ? patch : [...patch, ...extra];
18556
+ }
18296
18557
  function escapeJsonPointer(key) {
18297
18558
  return key.replace(/~/g, "~0").replace(/\//g, "~1");
18298
18559
  }
@@ -19001,9 +19262,16 @@ async function updateInIdLogScope(logicalId, physicalId, resourceType, propertie
19001
19262
  const writeOnlyProperties = await getTopLevelWriteOnlyProperties(resourceType);
19002
19263
  if (writeOnlyProperties.size > 0) {
19003
19264
  const keptOnPreviousSide = getTopLevelKeysHoldingUnreadableCreateOnly(resourceType, cleanProperties);
19265
+ const keptWhenOmitted = getWriteOnlyKeysKeptWhenOmitted(resourceType, cleanProperties, cleanPreviousProperties, writeOnlyProperties);
19004
19266
  const previousWithoutWriteOnly = { ...cleanPreviousProperties };
19005
19267
  for (const propertyName of writeOnlyProperties) {
19006
- if (keptOnPreviousSide.has(propertyName) && isDeepStrictEqual(cleanPreviousProperties[propertyName], cleanProperties[propertyName])) continue;
19268
+ const previous = cleanPreviousProperties[propertyName];
19269
+ const desired = cleanProperties[propertyName];
19270
+ if ((keptOnPreviousSide.has(propertyName) || keptWhenOmitted.has(propertyName)) && isDeepStrictEqual(previous, desired)) continue;
19271
+ if (keptWhenOmitted.has(propertyName) && isWriteOnlyKeyRefusedOnUpdate(resourceType, propertyName) && onlySecretReferencesDiffer(desired, previous, context?.maskSecrets)) {
19272
+ previousWithoutWriteOnly[propertyName] = desired;
19273
+ continue;
19274
+ }
19007
19275
  delete previousWithoutWriteOnly[propertyName];
19008
19276
  }
19009
19277
  patch = this.patchGenerator.generatePatch(previousWithoutWriteOnly, cleanProperties);
@@ -19029,6 +19297,7 @@ async function updateInIdLogScope(logicalId, physicalId, resourceType, propertie
19029
19297
  };
19030
19298
  }
19031
19299
  if (hasCcReadBackDefaultPaths(resourceType)) patch = withCcReadBackDefaultRemovals(resourceType, patch, cleanProperties, await readLiveModel());
19300
+ patch = await withCcReadBackExclusiveKeyRemovals(resourceType, patch, cleanProperties, readLiveModel);
19032
19301
  patch = withMeasuredRemovalsAsEmpty(patch, resourceType);
19033
19302
  if (writesTopLevelObject(patch)) {
19034
19303
  const [createOnlyPaths, readOnlyPaths] = await Promise.all([getCreateOnlyPropertyPaths(resourceType), getReadOnlyPropertyPaths(resourceType)]);
@@ -20252,7 +20521,7 @@ async function deleteInIdLogScope(logicalId, physicalId, resourceType, propertie
20252
20521
  const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
20253
20522
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
20254
20523
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
20255
- const { ASGProvider } = await import("./asg-provider-DTR9KTuD.js");
20524
+ const { ASGProvider } = await import("./asg-provider-BzCU3XtA.js");
20256
20525
  const delegateRegion = ambientRegion();
20257
20526
  let asgProvider = this.asgDeleteDelegates.get(delegateRegion);
20258
20527
  if (asgProvider === void 0) {
@@ -20407,7 +20676,7 @@ async function sdkDeleteDelegateInCcRegion(resourceType, logicalId, physicalId)
20407
20676
  const family = SDK_DELETE_FAMILIES.get(resourceType);
20408
20677
  const cached = this.sdkDeleteDelegates.get(family);
20409
20678
  if (cached !== void 0 && cached.region === ccRegion) return cached.provider;
20410
- const provider = family === "rds" ? new (await (import("./rds-provider-Brs1PVkX.js"))).RDSProvider({ region: ccRegion }) : new (await (import("./neptune-provider-DvqSeTAi.js"))).NeptuneProvider({ region: ccRegion });
20679
+ const provider = family === "rds" ? new (await (import("./rds-provider-D2dkhl8m.js"))).RDSProvider({ region: ccRegion }) : new (await (import("./neptune-provider-QgaV_sKy.js"))).NeptuneProvider({ region: ccRegion });
20411
20680
  this.sdkDeleteDelegates.set(family, {
20412
20681
  region: ccRegion,
20413
20682
  provider
@@ -22983,7 +23252,7 @@ async function publishToSns(topicArn, request) {
22983
23252
  }
22984
23253
  async function invokeLambda(serviceToken, request) {
22985
23254
  if (localCustomResourceRuntimeActive()) {
22986
- const { invokeCustomResourceFunctionLocally } = await import("./custom-resource-runtime-D_FKAsKw.js");
23255
+ const { invokeCustomResourceFunctionLocally } = await import("./custom-resource-runtime-SB_NsQMH.js");
22987
23256
  const local = await invokeCustomResourceFunctionLocally({
22988
23257
  lambda: this.lambdaClient,
22989
23258
  s3: this.s3Client
@@ -26700,6 +26969,8 @@ const LAMBDA_PERMISSION_STATEMENT_KEYS = [
26700
26969
  "SourceArn",
26701
26970
  "SourceAccount",
26702
26971
  "PrincipalOrgID",
26972
+ "EventSourceToken",
26973
+ "FunctionUrlAuthType",
26703
26974
  "InvokedViaFunctionUrl"
26704
26975
  ];
26705
26976
  function lambdaPermissionMatchesDeclared(read, declared) {
@@ -26712,6 +26983,91 @@ function lambdaPermissionMatchesDeclared(read, declared) {
26712
26983
  });
26713
26984
  }
26714
26985
 
26986
+ // src/deployment/stack-records-scope.ts
26987
+ const verifiedIdentityCaches = /* @__PURE__ */ new WeakMap();
26988
+ function verifiedIdentityCache(view) {
26989
+ const key = view?.runKey;
26990
+ if (key === void 0) return void 0;
26991
+ let cache = verifiedIdentityCaches.get(key);
26992
+ if (cache === void 0) {
26993
+ cache = /* @__PURE__ */ new Map();
26994
+ verifiedIdentityCaches.set(key, cache);
26995
+ }
26996
+ return cache;
26997
+ }
26998
+ async function awaitInFlightSibling(view, self, sibling) {
26999
+ const waiting = view.waiting;
27000
+ if (waiting === void 0 || waiting.has(sibling.logicalId)) return void 0;
27001
+ waiting.add(self);
27002
+ try {
27003
+ return await sibling.settled;
27004
+ } finally {
27005
+ waiting.delete(self);
27006
+ }
27007
+ }
27008
+ const stackRecordsStore = new AsyncLocalStorage();
27009
+ function withStackRecords(view, fn) {
27010
+ return stackRecordsStore.run(view, fn);
27011
+ }
27012
+ function getStackRecords() {
27013
+ return stackRecordsStore.getStore();
27014
+ }
27015
+ function deployStackRecordsView(records, before, deleting, unsettled = () => false, inFlight, writtenFresh) {
27016
+ const settled = () => Object.entries(records).filter(([lid]) => !unsettled(lid));
27017
+ return {
27018
+ ...inFlight && {
27019
+ inFlight,
27020
+ waiting: /* @__PURE__ */ new Set()
27021
+ },
27022
+ ...writtenFresh && { writtenFreshThisRun: writtenFresh },
27023
+ runKey: {},
27024
+ live: settled,
27025
+ retainedLeaving: (lid) => deleting.has(lid) && Object.hasOwn(before, lid) && shouldRetainResource(before[lid].deletionPolicy),
27026
+ survivors: () => [...settled().filter(([lid]) => !deleting.has(lid)), ...Object.entries(before).filter(([lid, record]) => deleting.has(lid) && shouldRetainResource(record.deletionPolicy))]
27027
+ };
27028
+ }
27029
+ function destroyStackRecordsView(records) {
27030
+ return {
27031
+ runKey: records,
27032
+ live: () => Object.entries(records),
27033
+ survivors: () => Object.entries(records).filter(([, record]) => shouldRetainResource(record.deletionPolicy))
27034
+ };
27035
+ }
27036
+ function replayStackRecordsView(records, orphanLogicalIds = /* @__PURE__ */ new Set(), failedOps = []) {
27037
+ const kept = Object.entries(records).filter(([lid, record]) => record.deletionPolicy === "Retain" || orphanLogicalIds.has(lid));
27038
+ return {
27039
+ runKey: records,
27040
+ live: () => Object.entries(records),
27041
+ survivors: () => [...Object.entries(records), ...kept.filter(([lid]) => !Object.hasOwn(records, lid))],
27042
+ journaledWrites: () => failedOps.filter((op) => op.physicalIdRecoveredFromError !== false).map((op) => {
27043
+ const idKey = Object.hasOwn(JOURNALED_IDENTITY_KEYS, op.resourceType) ? JOURNALED_IDENTITY_KEYS[op.resourceType] : void 0;
27044
+ return {
27045
+ resourceType: op.resourceType,
27046
+ physicalId: op.physicalId,
27047
+ properties: op.attemptedProperties,
27048
+ ...idKey !== void 0 && op.createdResourceIdentity !== void 0 && { attributes: { [idKey]: op.createdResourceIdentity } }
27049
+ };
27050
+ })
27051
+ };
27052
+ }
27053
+ const JOURNALED_IDENTITY_KEYS = {
27054
+ "AWS::IAM::User": "UserId",
27055
+ "AWS::IAM::InstanceProfile": "InstanceProfileId"
27056
+ };
27057
+ const REVERT_VIEW_RECORD_TYPES = /* @__PURE__ */ new Set([
27058
+ "AWS::IAM::Role",
27059
+ "AWS::IAM::Group",
27060
+ "AWS::IAM::User"
27061
+ ]);
27062
+ function revertStackRecordsView(records) {
27063
+ const principals = () => Object.entries(records).filter(([, record]) => REVERT_VIEW_RECORD_TYPES.has(record.resourceType));
27064
+ return {
27065
+ runKey: records,
27066
+ live: principals,
27067
+ survivors: principals
27068
+ };
27069
+ }
27070
+
26715
27071
  // src/provisioning/iam-sibling-managed-policies.ts
26716
27072
  const ATTACHMENT_FIELD = {
26717
27073
  "AWS::IAM::Role": "Roles",
@@ -27563,7 +27919,7 @@ async function ccRoutedInstanceTakesNoSnapshot(input) {
27563
27919
  if (resourceType !== "AWS::RDS::DBInstance") return false;
27564
27920
  if (region === void 0 || region === "") return false;
27565
27921
  const mask = input.mask ?? ((text) => text);
27566
- const { describeDBInstanceInRegion, isLiveReadReplica } = await import("./read-replica-Cnind5V_.js").then((n) => n.l);
27922
+ const { describeDBInstanceInRegion, isLiveReadReplica } = await import("./read-replica-CfbVMoYV.js").then((n) => n.l);
27567
27923
  let reason;
27568
27924
  try {
27569
27925
  const live = await describeDBInstanceInRegion(physicalId, region);
@@ -27671,6 +28027,93 @@ function maskedRecordRemedyFor(reads, resources, causeScoped = false) {
27671
28027
  return [parts.join(" "), ...commandLines].join("\n");
27672
28028
  }
27673
28029
 
28030
+ // src/deployment/deploy-value-equality.ts
28031
+ function isReplacementCeiling(pc) {
28032
+ return pc.requiresReplacement && (pc.inPlacePropagated === true || pc.replacementPropagated === true);
28033
+ }
28034
+ function keyOrderFreeJson(value) {
28035
+ return JSON.stringify(value, (_key, node) => {
28036
+ if (node === null || typeof node !== "object" || Array.isArray(node)) return node;
28037
+ const sorted = Object.create(null);
28038
+ for (const key of Object.keys(node).sort()) sorted[key] = node[key];
28039
+ return sorted;
28040
+ });
28041
+ }
28042
+ const IAM_ACTION = /^[a-z0-9-]{1,64}:[A-Za-z0-9*]{1,128}$/;
28043
+ const ACTION_IN_MESSAGE = [/\bperform:\s*([a-z0-9-]{1,64}:[A-Za-z0-9*]{1,128})(?=\s|$|[.,;])/, /\ballows the ([a-z0-9-]{1,64}:[A-Za-z0-9*]{1,128}) action\b/];
28044
+ const DENIAL_CLASSES = /* @__PURE__ */ new Set([
28045
+ "AccessDenied",
28046
+ "AccessDeniedException",
28047
+ "AuthorizationError",
28048
+ "UnauthorizedOperation"
28049
+ ]);
28050
+ function readDenialOf(error) {
28051
+ try {
28052
+ const name = error?.name;
28053
+ if (typeof name !== "string" || !DENIAL_CLASSES.has(name)) return void 0;
28054
+ const message = error.message;
28055
+ let action;
28056
+ if (typeof message === "string") for (const pattern of ACTION_IN_MESSAGE) {
28057
+ const found = pattern.exec(message)?.[1];
28058
+ if (found !== void 0 && IAM_ACTION.test(found)) {
28059
+ action = found;
28060
+ break;
28061
+ }
28062
+ }
28063
+ return {
28064
+ ...action !== void 0 && { action },
28065
+ errorClass: name
28066
+ };
28067
+ } catch {
28068
+ return;
28069
+ }
28070
+ }
28071
+ function grantSentence(denied) {
28072
+ const what = denied.action !== void 0 ? `the ${denied.action} permission` : `the read permission the provider's readback of this resource type needs`;
28073
+ return `AWS denied the read${denied.errorClass !== void 0 ? ` (${denied.errorClass})` : ""}, and re-running would be denied the same way: grant ${what} to the credentials cdkd runs with, then re-run`;
28074
+ }
28075
+ function liveHoldsFreshLeaves(live, leaves) {
28076
+ for (const leaf of leaves) {
28077
+ let node = live;
28078
+ for (const segment of leaf.path) {
28079
+ if (typeof segment === "number") {
28080
+ if (!Array.isArray(node) || segment >= node.length) return false;
28081
+ node = node[segment];
28082
+ continue;
28083
+ }
28084
+ if (node === null || typeof node !== "object" || Array.isArray(node)) return false;
28085
+ if (!Object.prototype.hasOwnProperty.call(node, segment)) return false;
28086
+ node = node[segment];
28087
+ }
28088
+ if (typeof leaf.plaintext === "string") {
28089
+ if (typeof node !== "string" || node !== leaf.plaintext) return false;
28090
+ } else if (node === void 0 || keyOrderFreeJson(node) !== keyOrderFreeJson(leaf.plaintext)) return false;
28091
+ }
28092
+ return true;
28093
+ }
28094
+ function outputMapsEqual(a, b) {
28095
+ return deepEqualValue(a, b);
28096
+ }
28097
+ function deepEqualValue(a, b) {
28098
+ if (a === b) return true;
28099
+ if (a == null || b == null) return a === b;
28100
+ if (typeof a !== typeof b) return false;
28101
+ if (typeof a !== "object") return false;
28102
+ if (Array.isArray(a) || Array.isArray(b)) {
28103
+ if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
28104
+ return a.every((v, i) => deepEqualValue(v, b[i]));
28105
+ }
28106
+ const ao = a;
28107
+ const bo = b;
28108
+ const ak = Object.keys(ao);
28109
+ if (ak.length !== Object.keys(bo).length) return false;
28110
+ for (const k of ak) {
28111
+ if (!Object.prototype.hasOwnProperty.call(bo, k)) return false;
28112
+ if (!deepEqualValue(ao[k], bo[k])) return false;
28113
+ }
28114
+ return true;
28115
+ }
28116
+
27674
28117
  // src/types/deployment-events.ts
27675
28118
  function extractDeploymentEventError(err) {
27676
28119
  if (!(err instanceof Error)) return {
@@ -27703,7 +28146,7 @@ function throwIfDeleteSkipped(result, logicalId, physicalId, duringClause, guard
27703
28146
  recordRollbackDeleteGuards(result, logicalId, physicalId, guardScope);
27704
28147
  const reason = deleteSkipReason(result);
27705
28148
  if (reason === void 0) return;
27706
- throw new Error(deleteSkippedMessage(logicalId, physicalId, reason, duringClause));
28149
+ throw new Error(deleteSkippedMessage(logicalId, displayPhysicalId(guardScope.resourceType, physicalId), reason, duringClause));
27707
28150
  }
27708
28151
  function recordRollbackDeleteGuards(result, logicalId, physicalId, scope) {
27709
28152
  for (const guard of deleteIndeterminateGuards(result)) scope.ctx.recordEvent?.({
@@ -27914,12 +28357,12 @@ function replayPrefixScope(input, logger, mask, restoring) {
27914
28357
  const rendered = displayIdent(masked);
27915
28358
  return rendered === masked ? `"${masked}"` : rendered;
27916
28359
  };
27917
- if (choice.kind === "reproduced" && choice.skipPrefix !== choice.recorded) logger.info(mask(` Rollback: ${restoring ? "re-creating" : "reverting"} ${subject} under the user-supplied-name prefix setting that created ` + (withheld ? `it (its physical id is withheld, as its name is secret-derived): ` : `${shown(input.physicalId)} (`) + `stack-name prefix ${setting(choice.skipPrefix)}; the failed deploy ran with it ${setting(choice.recorded)}${withheld ? "" : ")"}`));
28360
+ if (choice.kind === "reproduced" && choice.skipPrefix !== choice.recorded) logger.info(mask(` Rollback: ${restoring ? "re-creating" : "reverting"} ${subject} under the user-supplied-name prefix setting that created ` + (withheld ? `it (its physical id is withheld, as its name is secret-derived): ` : `${shown(displayPhysicalId(input.resourceType, input.physicalId))} (`) + `stack-name prefix ${setting(choice.skipPrefix)}; the failed deploy ran with it ${setting(choice.recorded)}${withheld ? "" : ")"}`));
27918
28361
  else if (choice.kind === "unreproduced" && restoring) {
27919
28362
  const idUnreadable = typeof input.physicalId !== "string" || input.physicalId === "";
27920
28363
  const prop = safe(choice.property);
27921
28364
  const unreadable = declared === void 0 ? idUnreadable ? `its ${prop} or its physical id` : `its ${prop}` : idUnreadable ? `its physical id` : void 0;
27922
- logger.warn(mask(` ⚠ ${subject}: cdkd cannot tell which user-supplied-name prefix setting created the old resource (` + (withheld ? `its physical id is withheld, as its name is secret-derived or unreadable` : shown(input.physicalId)) + `) — ` + (choice.names === void 0 ? unreadable !== void 0 ? `cdkd cannot read ${unreadable} to compare` : `cdkd cannot derive the names its ${prop} takes to compare` : secretDerived ? `its ${prop} is secret-derived, and neither name it derives matches` : `its ${prop} derives to ${quoted(choice.names.skipped)} (prefix skipped) or ${quoted(choice.names.kept)} (prefix kept), and it is neither`) + `; re-creating it with the stack-name prefix ${setting(choice.skipPrefix)}, as the failed deploy ran, so it may come back under a different physical name.`));
28365
+ logger.warn(mask(` ⚠ ${subject}: cdkd cannot tell which user-supplied-name prefix setting created the old resource (` + (withheld ? `its physical id is withheld, as its name is secret-derived or unreadable` : shown(displayPhysicalId(input.resourceType, input.physicalId))) + `) — ` + (choice.names === void 0 ? unreadable !== void 0 ? `cdkd cannot read ${unreadable} to compare` : `cdkd cannot derive the names its ${prop} takes to compare` : secretDerived ? `its ${prop} is secret-derived, and neither name it derives matches` : `its ${prop} derives to ${quoted(choice.names.skipped)} (prefix skipped) or ${quoted(choice.names.kept)} (prefix kept), and it is neither`) + `; re-creating it with the stack-name prefix ${setting(choice.skipPrefix)}, as the failed deploy ran, so it may come back under a different physical name.`));
27923
28366
  }
27924
28367
  const skip = choice.skipPrefix;
27925
28368
  return (fn) => withSkipPrefix(skip, () => inGeneration(fn));
@@ -28357,7 +28800,7 @@ async function readRecordAttributes(input) {
28357
28800
  knownPhysicalId: physicalId
28358
28801
  });
28359
28802
  if (found === null) return { kind: "not-found" };
28360
- if (found.physicalId !== physicalId) throw new Error(`the provider answered for a different resource (${found.physicalId}) than the one asked about (${physicalId})`);
28803
+ if (found.physicalId !== physicalId) throw new Error(`the provider answered for a different resource (${displayPhysicalId(resource.resourceType, found.physicalId)}) than the one asked about (${displayPhysicalId(resource.resourceType, physicalId)})`);
28361
28804
  if (flipped) assertSdkReadMatchesCcId(resource, logicalId, found.attributes ?? {});
28362
28805
  const reported = Object.entries(normalizeHealedAttributes(found.attributes));
28363
28806
  const attributes = Object.fromEntries(reported.filter(([, value]) => !carriesSecretMask(value)));
@@ -28405,60 +28848,6 @@ function createReadOnlyAttributeHealerFactory(options) {
28405
28848
  return (stackName, region) => Object.assign((logicalId, resource) => readOnce(stackName, region, logicalId, resource), { readOnly: true });
28406
28849
  }
28407
28850
 
28408
- // src/deployment/deploy-value-equality.ts
28409
- function isReplacementCeiling(pc) {
28410
- return pc.requiresReplacement && (pc.inPlacePropagated === true || pc.replacementPropagated === true);
28411
- }
28412
- function keyOrderFreeJson(value) {
28413
- return JSON.stringify(value, (_key, node) => {
28414
- if (node === null || typeof node !== "object" || Array.isArray(node)) return node;
28415
- const sorted = Object.create(null);
28416
- for (const key of Object.keys(node).sort()) sorted[key] = node[key];
28417
- return sorted;
28418
- });
28419
- }
28420
- function liveHoldsFreshLeaves(live, leaves) {
28421
- for (const leaf of leaves) {
28422
- let node = live;
28423
- for (const segment of leaf.path) {
28424
- if (typeof segment === "number") {
28425
- if (!Array.isArray(node) || segment >= node.length) return false;
28426
- node = node[segment];
28427
- continue;
28428
- }
28429
- if (node === null || typeof node !== "object" || Array.isArray(node)) return false;
28430
- if (!Object.prototype.hasOwnProperty.call(node, segment)) return false;
28431
- node = node[segment];
28432
- }
28433
- if (typeof leaf.plaintext === "string") {
28434
- if (typeof node !== "string" || node !== leaf.plaintext) return false;
28435
- } else if (node === void 0 || keyOrderFreeJson(node) !== keyOrderFreeJson(leaf.plaintext)) return false;
28436
- }
28437
- return true;
28438
- }
28439
- function outputMapsEqual(a, b) {
28440
- return deepEqualValue(a, b);
28441
- }
28442
- function deepEqualValue(a, b) {
28443
- if (a === b) return true;
28444
- if (a == null || b == null) return a === b;
28445
- if (typeof a !== typeof b) return false;
28446
- if (typeof a !== "object") return false;
28447
- if (Array.isArray(a) || Array.isArray(b)) {
28448
- if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
28449
- return a.every((v, i) => deepEqualValue(v, b[i]));
28450
- }
28451
- const ao = a;
28452
- const bo = b;
28453
- const ak = Object.keys(ao);
28454
- if (ak.length !== Object.keys(bo).length) return false;
28455
- for (const k of ak) {
28456
- if (!Object.prototype.hasOwnProperty.call(bo, k)) return false;
28457
- if (!deepEqualValue(ao[k], bo[k])) return false;
28458
- }
28459
- return true;
28460
- }
28461
-
28462
28851
  // src/deployment/deploy-engine/noecho.ts
28463
28852
  var NoEchoRunState = class {
28464
28853
  noEchoAttributeResources = /* @__PURE__ */ new Map();
@@ -29018,7 +29407,14 @@ async function readReaderForFreshNoEchoCeiling(deps, logicalId, currentResource,
29018
29407
  if (typeof name === "string" && /^[A-Za-z0-9_]{1,64}$/.test(name)) errorClass = name;
29019
29408
  } catch {}
29020
29409
  deps.logger.debug(safeMsg`Readback of ${logicalId} for a NoEcho value's replacement check failed (${errorClass}).`);
29021
- return { failure: "read-failed" };
29410
+ let denied;
29411
+ try {
29412
+ denied = readDenialOf(maskSecretsInError(error, secrets));
29413
+ } catch {}
29414
+ return {
29415
+ failure: "read-failed",
29416
+ ...denied !== void 0 && { denied }
29417
+ };
29022
29418
  } finally {
29023
29419
  if (timer !== void 0) clearTimeout(timer);
29024
29420
  }
@@ -29250,6 +29646,7 @@ async function replaceDeleteFirstAndRecreate(run, deps, logicalId, resourceType,
29250
29646
  forceDataDelete: deps.options.forceStatefulRecreation === true,
29251
29647
  ...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
29252
29648
  ...replacementDeleteContext(deps, updateReplacePolicy),
29649
+ stackHoldersStillAttached: true,
29253
29650
  recordedAttributes: currentResource.attributes,
29254
29651
  recordedCreateOnlyDrops: currentResource.acceptedCreateOnlyDrops,
29255
29652
  recordedNoEchoLeaves: currentResource.noEchoLeaves,
@@ -29259,7 +29656,7 @@ async function replaceDeleteFirstAndRecreate(run, deps, logicalId, resourceType,
29259
29656
  }));
29260
29657
  } catch (deleteError) {
29261
29658
  const shownSecrets = unionOfSecretBags([secrets, printingSecretsFor(deps.secretsRun(), logicalId)]);
29262
- const deleteText = fallbackFailureText(deps, deleteError, shownSecrets, (failure) => safeMsg`Failed to delete old resource ${maskSecretsInText(logicalId, shownSecrets)} ` + safeMsg`(${maskSecretsInText(currentResource.physicalId, shownSecrets)}) ` + `during the --replace delete-first fallback: ` + safeMsg`${asIsMessage(failure)}`);
29659
+ const deleteText = fallbackFailureText(deps, deleteError, shownSecrets, (failure) => safeMsg`Failed to delete old resource ${maskSecretsInText(logicalId, shownSecrets)} ` + safeMsg`(${maskSecretsInText(String(displayPhysicalId(currentResource.resourceType, currentResource.physicalId)), shownSecrets)}) ` + `during the --replace delete-first fallback: ` + safeMsg`${asIsMessage(failure)}`);
29263
29660
  throw stampRedacted$1(new Error(deleteText.message, { cause: deleteError instanceof Error ? maskSecretsInError(deleteError, secrets) : void 0 }), deleteText.redacted);
29264
29661
  }
29265
29662
  reportDeleteGuards(deleteResult, {
@@ -29268,7 +29665,7 @@ async function replaceDeleteFirstAndRecreate(run, deps, logicalId, resourceType,
29268
29665
  provisionedBy: oldDeleteProvisionedBy
29269
29666
  });
29270
29667
  const replaceSkipReason = deleteSkipReason(deleteResult);
29271
- if (replaceSkipReason !== void 0) throw new Error(deleteSkippedMessage(logicalId, currentResource.physicalId, replaceSkipReason, "during the --replace delete-first fallback"));
29668
+ if (replaceSkipReason !== void 0) throw new Error(deleteSkippedMessage(logicalId, displayPhysicalId(currentResource.resourceType, currentResource.physicalId), replaceSkipReason, "during the --replace delete-first fallback"));
29272
29669
  deps.logger.info(safeMsg` ${green("✓")} Old resource deleted`);
29273
29670
  run.oldDeletedBeforeCreate.add(logicalId);
29274
29671
  await oldDeleteProvider.waitForNameReleased?.(logicalId, currentResource.physicalId, oldResourceType, {
@@ -29288,7 +29685,7 @@ async function replaceDeleteFirstAndRecreate(run, deps, logicalId, resourceType,
29288
29685
  });
29289
29686
  } catch (recreateError) {
29290
29687
  const shownSecrets = unionOfSecretBags([secrets, printingSecretsFor(deps.secretsRun(), logicalId)]);
29291
- const recreateText = fallbackFailureText(deps, recreateError, shownSecrets, (failure) => safeMsg`Failed to re-create ${maskSecretsInText(logicalId, shownSecrets)} after the ` + safeMsg`--replace delete-first fallback already deleted the old resource (${maskSecretsInText(currentResource.physicalId, shownSecrets)}). ` + safeMsg`Re-run the deploy to create it fresh. Cause: ${asIsMessage(failure)}`);
29688
+ const recreateText = fallbackFailureText(deps, recreateError, shownSecrets, (failure) => safeMsg`Failed to re-create ${maskSecretsInText(logicalId, shownSecrets)} after the ` + safeMsg`--replace delete-first fallback already deleted the old resource (${maskSecretsInText(String(displayPhysicalId(currentResource.resourceType, currentResource.physicalId)), shownSecrets)}). ` + safeMsg`Re-run the deploy to create it fresh. Cause: ${asIsMessage(failure)}`);
29292
29689
  throw stampRedacted$1(new Error(recreateText.message, { cause: recreateError instanceof Error ? maskSecretsInError(recreateError, secrets) : void 0 }), recreateText.redacted);
29293
29690
  }
29294
29691
  }
@@ -29395,24 +29792,25 @@ async function checkedReplacementNameChange(deps, input) {
29395
29792
  if (found === null) return change;
29396
29793
  if (!typeChanged && probeFoundSameId(resourceType, found.physicalId, currentResource.physicalId)) return;
29397
29794
  const remedy = (await deps.rollbackRetainedCopies?.(input.stackName).catch(() => []) ?? []).some((copy) => copy.logicalId === logicalId && copy.resourceType === resourceType && probeFoundSameId(resourceType, copy.physicalId, found.physicalId)) ? `This stack's event history records that a rolled-back deploy kept ${displaySafe(logicalId)}'s replacement under this name because of UpdateReplacePolicy: Retain, as CloudFormation also does, untracked by cdkd. If the holder is that copy and you no longer need it, delete it; otherwise choose another name.` : `Choose a name no other resource holds, or delete the resource holding it if it is yours.`;
29398
- throw markNonRetryable(new CdkdError(maskName(`${subject} requires replacement, and another existing resource (${displaySafe(found.physicalId)}) already holds the name it asks for. ${renderReplacementNameChange(change, input.createProps)}. Since ${adoptsText}, creating the replacement would take that resource over and record it as this stack's. Nothing was created or deleted. ${remedy}`), "NAMED_REPLACEMENT_COLLISION"));
29795
+ throw markNonRetryable(new CdkdError(maskName(`${subject} requires replacement, and another existing resource (${displaySafe(displayPhysicalId(resourceType, found.physicalId))}) already holds the name it asks for. ${renderReplacementNameChange(change, input.createProps, input.oldResourceType)}. Since ${adoptsText}, creating the replacement would take that resource over and record it as this stack's. Nothing was created or deleted. ${remedy}`), "NAMED_REPLACEMENT_COLLISION"));
29399
29796
  }
29400
29797
 
29401
29798
  // src/deployment/deploy-engine/name-collision.ts
29402
- function replacementNameOrigin(logicalId, physicalId) {
29799
+ function replacementNameOrigin(logicalId, physicalId, resourceType) {
29800
+ const shownId = displayPhysicalId(resourceType, physicalId);
29403
29801
  if (looksLikeCdkdGeneratedName(physicalId, logicalId, getCurrentStackName(), getCurrentStackInstanceId())) return {
29404
- descriptor: `The physical name (${physicalId}) was GENERATED by cdkd from the construct's logical id rather than declared in your template, and that derivation has no random component — so the new resource asks for exactly the name the existing one still holds`,
29802
+ descriptor: `The physical name (${shownId}) was GENERATED by cdkd from the construct's logical id rather than declared in your template, and that derivation has no random component — so the new resource asks for exactly the name the existing one still holds`,
29405
29803
  remedy: "Either give the resource an explicit physical name in your CDK code, or rename the CONSTRUCT (its id feeds the generated name — note that this replaces the resource rather than renaming it in place)"
29406
29804
  };
29407
29805
  return {
29408
- descriptor: `The resource has a user-supplied physical name (${physicalId})`,
29806
+ descriptor: `The resource has a user-supplied physical name (${shownId})`,
29409
29807
  remedy: "Either rename the resource in your CDK code (a fresh name lets the safe create-first order proceed)"
29410
29808
  };
29411
29809
  }
29412
29810
  function generatedReplacementHolderAdvice(input) {
29413
29811
  if (input.change?.generated !== true) return "";
29414
29812
  const name = displaySafe(input.mask(input.change.desiredName), { asciiOnly: true });
29415
- const old = displaySafe(input.mask(input.oldPhysicalId), { asciiOnly: true });
29813
+ const old = displaySafe(input.mask(String(displayPhysicalId(input.oldResourceType, input.oldPhysicalId))), { asciiOnly: true });
29416
29814
  const lead = ` The colliding name ${isInertUnquoted(name) ? name : "the generated name"} is the one this replacement generates for its next name generation, so its holder is most likely the new resource an interrupted earlier attempt of this replacement created. If it is, `;
29417
29815
  const tail = `, or delete it and re-run the deploy.`;
29418
29816
  if (input.stackName.includes("~")) return lead + `adopt it through the top-level stack with ${proseQuoted(cdkdRemedy("cdkd import"), "`")} (then delete ${old} by hand)` + tail;
@@ -29437,7 +29835,7 @@ function orphanedNameCollisionAdvice(providerRegistry, changeType, logicalId, er
29437
29835
  const stackName = getCurrentStackName();
29438
29836
  if (!looksLikeCdkdGeneratedName(physicalId, logicalId, stackName, getCurrentStackInstanceId())) return;
29439
29837
  if (!stackName) return void 0;
29440
- const safeId = displaySafe(physicalId, { asciiOnly: true });
29838
+ const safeId = displaySafe(displayPhysicalId(error.resourceType, physicalId), { asciiOnly: true });
29441
29839
  const safeStack = displaySafe(stackName, { asciiOnly: true });
29442
29840
  const safeLogicalId = displaySafe(logicalId, { asciiOnly: true });
29443
29841
  const idShown = isInertUnquoted(safeId);
@@ -29545,7 +29943,8 @@ function findNestedStackTypeChanges(input) {
29545
29943
  }
29546
29944
  function renderNestedStackTypeChangeRefusal(typeChanges, stackName) {
29547
29945
  const rows = typeChanges.map((tc) => {
29548
- return `${` - ${tc.logicalId}: Type changes from ${tc.currentType} to ${tc.desiredType} (the existing ${tc.currentType} is ${tc.physicalId}).`}\n${tc.direction === "into-nested-stack" ? ` Replacing a single resource BY a nested stack is not supported: the create half of the replacement would deploy a whole child stack "${stackName}~${tc.logicalId}" as one row, while ${tc.physicalId} is still recorded under this logical id.` : ` Replacing a nested stack BY a single resource is not supported: a replacement deletes its old half as a best-effort cleanup step whose failure is only a warning, so the child stack "${stackName}~${tc.logicalId}" and every resource it owns could be left behind, untracked, under a deploy that reports success.`}`;
29946
+ const shownId = displayPhysicalId(tc.currentType, tc.physicalId);
29947
+ return `${` - ${tc.logicalId}: Type changes from ${tc.currentType} to ${tc.desiredType} (the existing ${tc.currentType} is ${shownId}).`}\n${tc.direction === "into-nested-stack" ? ` Replacing a single resource BY a nested stack is not supported: the create half of the replacement would deploy a whole child stack "${stackName}~${tc.logicalId}" as one row, while ${shownId} is still recorded under this logical id.` : ` Replacing a nested stack BY a single resource is not supported: a replacement deletes its old half as a best-effort cleanup step whose failure is only a warning, so the child stack "${stackName}~${tc.logicalId}" and every resource it owns could be left behind, untracked, under a deploy that reports success.`}`;
29549
29948
  });
29550
29949
  return `Refusing to deploy ${stackName}: ` + (typeChanges.length === 1 ? `a resource changes its Type ` : `${typeChanges.length} resources change their Type `) + `into or out of ${NESTED_STACK_RESOURCE_TYPE}, which cdkd does not replace in place.\n${rows.join("\n")}\n Deploy this as two changes instead: give the new resource a DIFFERENT logical id (in CDK, rename the construct) so the existing row is deleted through its own type's provider and the new one is created under its own — or remove the resource in one deploy and add its replacement in the next. There is no flag that overrides this refusal.`;
29551
29950
  }
@@ -29934,6 +30333,26 @@ function supersededResourcesOf(state) {
29934
30333
  if (!Array.isArray(rows)) return [];
29935
30334
  return rows.filter(isSupersededResourceRecord);
29936
30335
  }
30336
+ function supersededDependentsFirst(entries) {
30337
+ const ordered = [];
30338
+ let pending = [...entries];
30339
+ while (pending.length > 0) {
30340
+ const dependedOn = /* @__PURE__ */ new Set();
30341
+ for (const entry of pending) {
30342
+ const deps = entry.state.dependencies;
30343
+ if (!Array.isArray(deps)) continue;
30344
+ for (const dep of deps) if (typeof dep === "string" && dep !== entry.logicalId) dependedOn.add(dep);
30345
+ }
30346
+ const wave = pending.filter((entry) => !dependedOn.has(entry.logicalId));
30347
+ if (wave.length === 0) {
30348
+ ordered.push(...pending);
30349
+ break;
30350
+ }
30351
+ ordered.push(...wave);
30352
+ pending = pending.filter((entry) => !wave.includes(entry));
30353
+ }
30354
+ return ordered;
30355
+ }
29937
30356
  function isSupersededResourceRecord(row) {
29938
30357
  if (typeof row !== "object" || row === null) return false;
29939
30358
  const entry = row;
@@ -29954,7 +30373,7 @@ function isSupersededHeldBySameType(entry, resources) {
29954
30373
  return Object.values(resources).some((record) => typeof record === "object" && record !== null && record.physicalId === entry.state.physicalId && record.resourceType === entry.state.resourceType);
29955
30374
  }
29956
30375
  function supersededHeldByOtherTypeWarning(entry, holderType) {
29957
- return `the superseded ${entry.state.resourceType} of ${entry.logicalId} (${entry.state.physicalId}) was not deleted: a ${holderType} record of this stack has the same physical id, and cdkd never deletes an id a record names. If the ${entry.state.resourceType} still exists, delete it by hand; it is no longer tracked in state.`;
30376
+ return `the superseded ${entry.state.resourceType} of ${entry.logicalId} (${displayPhysicalId(entry.state.resourceType, entry.state.physicalId)}) was not deleted: a ${holderType} record of this stack has the same physical id, and cdkd never deletes an id a record names. If the ${entry.state.resourceType} still exists, delete it by hand; it is no longer tracked in state.`;
29958
30377
  }
29959
30378
  function addSuperseded(host, entry) {
29960
30379
  host.supersededResources = [...(Array.isArray(host.supersededResources) ? host.supersededResources : []).filter((row) => !isSupersededResourceRecord(row) || row.state.physicalId !== entry.state.physicalId || row.state.resourceType !== entry.state.resourceType), entry];
@@ -30154,10 +30573,10 @@ async function deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType,
30154
30573
  ...currentResource.dependencies !== void 0 && { dependencies: currentResource.dependencies },
30155
30574
  retry: () => deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType, currentResource, deleteProvider, deleteProperties, finalSnapshotIdentifier, updateReplacePolicy, secrets, deleteProvisionedBy, noEchoDeleteValues, true)
30156
30575
  });
30157
- deps.logger.info(safeMsg` Old ${logicalId} (${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}) is deleted after the rest of the deploy succeeds`);
30576
+ deps.logger.info(safeMsg` Old ${logicalId} (${displayPhysicalId(oldResourceType, currentResource.physicalId)}) is deleted after the rest of the deploy succeeds`);
30158
30577
  return;
30159
30578
  }
30160
- if (!isRetry) deps.logger.info(safeMsg` Deleting old ${logicalId} (${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)})...`);
30579
+ if (!isRetry) deps.logger.info(safeMsg` Deleting old ${logicalId} (${displayPhysicalId(oldResourceType, currentResource.physicalId)})...`);
30161
30580
  else if (!await journaledHolderIsOurs(run, deps, logicalId, oldResourceType, currentResource)) return;
30162
30581
  let sentSnapshotIdentifier = finalSnapshotIdentifier;
30163
30582
  if (owesPreDeleteSnapshot(oldResourceType, finalSnapshotIdentifier)) {
@@ -30188,7 +30607,7 @@ async function deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType,
30188
30607
  run.replacedOldMaySurvive.set(logicalId, run.replacedOldMaySurvive.get(logicalId) === "unconfirmed" ? "unconfirmed" : replacedDeleteFailureVerdict(deleteError));
30189
30608
  const deferred = run.deferredReplacedDeletes;
30190
30609
  if (!isRetry && deferred !== void 0) {
30191
- deps.logger.info(safeMsg` Could not delete old ${logicalId} (${currentResource.physicalId}) yet: ${deleteMsg}. Retrying after the rest of the deploy.`);
30610
+ deps.logger.info(safeMsg` Could not delete old ${logicalId} (${displayPhysicalId(oldResourceType, currentResource.physicalId)}) yet: ${deleteMsg}. Retrying after the rest of the deploy.`);
30192
30611
  recordSupersededForDeferral(run, deps, logicalId, currentResource, {
30193
30612
  updateReplacePolicy,
30194
30613
  finalSnapshotIdentifier: sentSnapshotIdentifier,
@@ -30206,7 +30625,7 @@ async function deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType,
30206
30625
  return;
30207
30626
  }
30208
30627
  const kept = isRetry && run.supersededEntries.has(logicalId);
30209
- deps.logger.warn(kept ? safeMsg` ⚠ Failed to delete old resource ${logicalId} (${currentResource.physicalId}): ${deleteMsg}. ${SUPERSEDED_KEPT_REMEDY}.` : safeMsg` ⚠ Failed to delete old resource ${logicalId} (${currentResource.physicalId}): ${deleteMsg}`);
30628
+ deps.logger.warn(kept ? safeMsg` ⚠ Failed to delete old resource ${logicalId} (${displayPhysicalId(oldResourceType, currentResource.physicalId)}): ${deleteMsg}. ${SUPERSEDED_KEPT_REMEDY}.` : safeMsg` ⚠ Failed to delete old resource ${logicalId} (${displayPhysicalId(oldResourceType, currentResource.physicalId)}): ${deleteMsg}`);
30210
30629
  }
30211
30630
  const recorded = isRetry ? run.supersededEntries.get(logicalId) : void 0;
30212
30631
  if (recorded !== void 0 && !deleteFailed && run.supersededHost !== void 0) {
@@ -30221,11 +30640,11 @@ async function deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType,
30221
30640
  const skipReason = deleteSkipReason(deleteResult);
30222
30641
  if (skipReason !== void 0) {
30223
30642
  run.replacedOldMaySurvive.set(logicalId, "unconfirmed");
30224
- run.replacedDeleteSkips.set(logicalId, `the replaced ${oldResourceType} (${currentResource.physicalId}) was not deleted (${skipReason}) and is no longer tracked by cdkd`);
30225
- deps.logger.warn(safeMsg` ⚠ ${deleteSkippedMessage(logicalId, currentResource.physicalId, skipReason, "while cleaning up the replaced resource", { commandFreeLine: true })}. Delete it manually — it is no longer tracked in state.`);
30643
+ run.replacedDeleteSkips.set(logicalId, `the replaced ${oldResourceType} (${displayPhysicalId(oldResourceType, currentResource.physicalId)}) was not deleted (${skipReason}) and is no longer tracked by cdkd`);
30644
+ deps.logger.warn(safeMsg` ⚠ ${deleteSkippedMessage(logicalId, displayPhysicalId(oldResourceType, currentResource.physicalId), skipReason, "while cleaning up the replaced resource", { commandFreeLine: true })}. Delete it manually — it is no longer tracked in state.`);
30226
30645
  } else if (!deleteFailed) {
30227
30646
  if (isRetry) run.replacedOldMaySurvive.delete(logicalId);
30228
- deps.logger.info(isRetry ? safeMsg` ${green("✓")} Old ${logicalId} (${currentResource.physicalId}) deleted` : safeMsg` ${green("✓")} Old resource deleted`);
30647
+ deps.logger.info(isRetry ? safeMsg` ${green("✓")} Old ${logicalId} (${displayPhysicalId(oldResourceType, currentResource.physicalId)}) deleted` : safeMsg` ${green("✓")} Old resource deleted`);
30229
30648
  }
30230
30649
  }
30231
30650
  async function journaledHolderIsOurs(run, deps, logicalId, oldResourceType, oldResource) {
@@ -30250,7 +30669,7 @@ async function journaledHolderIsOurs(run, deps, logicalId, oldResourceType, oldR
30250
30669
  const why = unreadHolderCause(judged);
30251
30670
  if (recorded === void 0) {
30252
30671
  run.replacedOldMaySurvive.set(logicalId, "unconfirmed");
30253
- run.replacedDeleteSkips.set(logicalId, `the replaced ${oldResourceType} (${oldResource.physicalId}) was not deleted (${why}) and is no longer tracked by cdkd`);
30672
+ run.replacedDeleteSkips.set(logicalId, `the replaced ${oldResourceType} (${displayPhysicalId(oldResourceType, oldResource.physicalId)}) was not deleted (${why}) and is no longer tracked by cdkd`);
30254
30673
  }
30255
30674
  deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${shown}) was not deleted: ${why}, so no delete was sent. ` + (recorded !== void 0 ? safeMsg`${SUPERSEDED_KEPT_REMEDY}.` : "It is no longer tracked in state: delete it manually once you confirm it is the stack's."));
30256
30675
  return false;
@@ -30271,7 +30690,7 @@ async function takeOwedSnapshot(run, deps, logicalId, oldResource, secrets, isRe
30271
30690
  const recorded = isRetry ? run.supersededEntries.get(logicalId) : void 0;
30272
30691
  const tracking = () => recorded !== void 0 ? "kept" : oldIdHeldByAnotherRecord(deps, logicalId, oldResource) ? "held" : "untracked";
30273
30692
  if (isRetry && deps.interrupted()) {
30274
- deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${oldResource.physicalId}) was not deleted: the deploy was interrupted before its final snapshot (UpdateReplacePolicy: Snapshot). ` + (tracking() === "kept" ? safeMsg`${SUPERSEDED_KEPT_REMEDY}.` : tracking() === "held" ? "Another resource of this stack records the same physical id." : "Delete it manually once you have a snapshot; it is no longer tracked in state."));
30693
+ deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${displayPhysicalId(oldResource.resourceType, oldResource.physicalId)}) was not deleted: the deploy was interrupted before its final snapshot (UpdateReplacePolicy: Snapshot). ` + (tracking() === "kept" ? safeMsg`${SUPERSEDED_KEPT_REMEDY}.` : tracking() === "held" ? "Another resource of this stack records the same physical id." : "Delete it manually once you have a snapshot; it is no longer tracked in state."));
30275
30694
  return false;
30276
30695
  }
30277
30696
  const snapshotMask = createUnionSecretMasker([secrets, secretNameBagFor(deps.secretsRun(), logicalId)]);
@@ -30283,7 +30702,7 @@ async function takeOwedSnapshot(run, deps, logicalId, oldResource, secrets, isRe
30283
30702
  });
30284
30703
  } catch (snapshotError) {
30285
30704
  if (!isRetry) run.replacedOldMaySurvive.set(logicalId, "kept");
30286
- deps.logger.warn(safeMsg` ⚠ Final snapshot for old ${logicalId} (${oldResource.physicalId}) ` + safeMsg`failed: ${asIsMessage(snapshotMask(describeAwsFailure(snapshotError).detail))}. ` + `The old resource was NOT deleted (UpdateReplacePolicy: Snapshot). ` + (tracking() === "kept" ? safeMsg`${SUPERSEDED_KEPT_REMEDY}.` : tracking() === "held" ? "Another resource of this stack records the same physical id." : "Delete it manually once you have a snapshot; it is no longer tracked in state."));
30705
+ deps.logger.warn(safeMsg` ⚠ Final snapshot for old ${logicalId} (${displayPhysicalId(oldResource.resourceType, oldResource.physicalId)}) ` + safeMsg`failed: ${asIsMessage(snapshotMask(describeAwsFailure(snapshotError).detail))}. ` + `The old resource was NOT deleted (UpdateReplacePolicy: Snapshot). ` + (tracking() === "kept" ? safeMsg`${SUPERSEDED_KEPT_REMEDY}.` : tracking() === "held" ? "Another resource of this stack records the same physical id." : "Delete it manually once you have a snapshot; it is no longer tracked in state."));
30287
30706
  return false;
30288
30707
  }
30289
30708
  if (recorded?.finalSnapshotIdentifier !== void 0 && run.supersededHost !== void 0) {
@@ -30358,63 +30777,21 @@ async function createFirstThenDeleteOld(run, deps, input) {
30358
30777
  const createAwsMsg = displayAwsMessage(maskName(createFailure.detail));
30359
30778
  const createMsg = createFailure.redacted ? displaySafe(maskName(createFailure.summary)).replace(/\.$/, "") : createAwsMsg;
30360
30779
  if (createFailure.redacted) deps.logger.debug(safeMsg`${maskName(logicalId)}: the create-first attempt collided: ${asIsMessage(createAwsMsg)}`);
30361
- throw markNonRetryable(new CdkdError(maskName(`${displaySafe(logicalId)} (${displaySafe(resourceType)}) requires replacement (${input.trigger}), and cdkd created the new resource first because its name differs, but the create collided: ${createMsg}. If the collision is on the requested name: ${renderReplacementNameChange(input.change, input.createProps)}. Nothing was deleted` + (retainOld ? ` (UpdateReplacePolicy: Retain keeps the old resource in place)` : "") + ". Choose a name no other resource holds, or delete the resource holding it if it is yours." + generatedReplacementHolderAdvice({
30780
+ throw markNonRetryable(new CdkdError(maskName(`${displaySafe(logicalId)} (${displaySafe(resourceType)}) requires replacement (${input.trigger}), and cdkd created the new resource first because its name differs, but the create collided: ${createMsg}. If the collision is on the requested name: ${renderReplacementNameChange(input.change, input.createProps, input.oldResourceType)}. Nothing was deleted` + (retainOld ? ` (UpdateReplacePolicy: Retain keeps the old resource in place)` : "") + ". Choose a name no other resource holds, or delete the resource holding it if it is yours." + generatedReplacementHolderAdvice({
30362
30781
  stackName: input.stackName,
30363
30782
  logicalId,
30364
30783
  change: input.change,
30365
30784
  oldPhysicalId: currentResource.physicalId,
30785
+ oldResourceType: currentResource.resourceType,
30366
30786
  mask: (text) => maskName(maskSecretsInText(text, unionOfSecretBags([secrets, printingSecretsFor(deps.secretsRun(), logicalId)])))
30367
30787
  })), "NAMED_REPLACEMENT_COLLISION", createError instanceof Error ? createError : void 0));
30368
30788
  }
30369
- if (input.equalIdIsSameResource && createResult.physicalId === currentResource.physicalId) throw markNonRetryable(new CdkdError(maskName(`${displaySafe(logicalId)} (${displaySafe(resourceType)}) requires replacement (${input.trigger}) under a new name, but the create returned the resource being replaced (${displaySafe(currentResource.physicalId)}) instead of a new one, so cdkd cannot tell which name it holds. Nothing was deleted. Delete that resource by hand if it is yours, then re-run the deploy.`), "NAMED_REPLACEMENT_IDEMPOTENT_CREATE"));
30789
+ if (input.equalIdIsSameResource && createResult.physicalId === currentResource.physicalId) throw markNonRetryable(new CdkdError(maskName(`${displaySafe(logicalId)} (${displaySafe(resourceType)}) requires replacement (${input.trigger}) under a new name, but the create returned the resource being replaced (${displaySafe(displayPhysicalId(currentResource.resourceType, currentResource.physicalId))}) instead of a new one, so cdkd cannot tell which name it holds. Nothing was deleted. Delete that resource by hand if it is yours, then re-run the deploy.`), "NAMED_REPLACEMENT_IDEMPOTENT_CREATE"));
30370
30790
  if (retainOld) return createResult;
30371
30791
  await deleteReplacedAfterCreate(run, deps, logicalId, input.oldResourceType, currentResource, input.deleteProvider, input.deleteProperties, finalSnapshotIdentifier, input.deletePolicy, secrets, input.deleteProvisionedBy, input.noEchoDeleteValues, false, createResult.physicalId === currentResource.physicalId && resourceType === input.oldResourceType);
30372
30792
  return createResult;
30373
30793
  }
30374
30794
 
30375
- // src/deployment/stack-records-scope.ts
30376
- async function awaitInFlightSibling(view, self, sibling) {
30377
- const waiting = view.waiting;
30378
- if (waiting === void 0 || waiting.has(sibling.logicalId)) return void 0;
30379
- waiting.add(self);
30380
- try {
30381
- return await sibling.settled;
30382
- } finally {
30383
- waiting.delete(self);
30384
- }
30385
- }
30386
- const stackRecordsStore = new AsyncLocalStorage();
30387
- function withStackRecords(view, fn) {
30388
- return stackRecordsStore.run(view, fn);
30389
- }
30390
- function getStackRecords() {
30391
- return stackRecordsStore.getStore();
30392
- }
30393
- function deployStackRecordsView(records, before, deleting, unsettled = () => false, inFlight) {
30394
- const settled = () => Object.entries(records).filter(([lid]) => !unsettled(lid));
30395
- return {
30396
- ...inFlight && {
30397
- inFlight,
30398
- waiting: /* @__PURE__ */ new Set()
30399
- },
30400
- live: settled,
30401
- survivors: () => [...settled().filter(([lid]) => !deleting.has(lid)), ...Object.entries(before).filter(([lid, record]) => deleting.has(lid) && shouldRetainResource(record.deletionPolicy))]
30402
- };
30403
- }
30404
- function destroyStackRecordsView(records) {
30405
- return {
30406
- live: () => Object.entries(records),
30407
- survivors: () => Object.entries(records).filter(([, record]) => shouldRetainResource(record.deletionPolicy))
30408
- };
30409
- }
30410
- function replayStackRecordsView(records, orphanLogicalIds = /* @__PURE__ */ new Set()) {
30411
- const kept = Object.entries(records).filter(([lid, record]) => record.deletionPolicy === "Retain" || orphanLogicalIds.has(lid));
30412
- return {
30413
- live: () => Object.entries(records),
30414
- survivors: () => [...Object.entries(records), ...kept.filter(([lid]) => !Object.hasOwn(records, lid))]
30415
- };
30416
- }
30417
-
30418
30795
  // src/deployment/deploy-engine/replacement/deferred-deletes.ts
30419
30796
  async function retryDeferredReplacedDeletes(run, deps, stackName, counts) {
30420
30797
  const deferred = run.deferredReplacedDeletes;
@@ -30431,11 +30808,11 @@ async function retryDeferredReplacedDeletes(run, deps, stackName, counts) {
30431
30808
  const guards = [];
30432
30809
  try {
30433
30810
  await withPrintingSecrets(secretNameBagFor(deps.secretsRun(), logicalId), () => withStackRecords(deps.stackRecordsView(), () => collectDeleteGuards(guards, async () => {
30434
- deps.logger.info(safeMsg` Deleting old ${logicalId} (${entry.physicalId})...`);
30811
+ deps.logger.info(safeMsg` Deleting old ${logicalId} (${displayPhysicalId(entry.resourceType, entry.physicalId)})...`);
30435
30812
  try {
30436
30813
  await entry.retry();
30437
30814
  } catch {
30438
- deps.logger.warn(safeMsg` ⚠ Failed to delete old resource ${logicalId} (${entry.physicalId}): the retry failed unexpectedly`);
30815
+ deps.logger.warn(safeMsg` ⚠ Failed to delete old resource ${logicalId} (${displayPhysicalId(entry.resourceType, entry.physicalId)}): the retry failed unexpectedly`);
30439
30816
  }
30440
30817
  })));
30441
30818
  } finally {
@@ -30489,7 +30866,7 @@ async function retryDeferredReplacedDeletes(run, deps, stackName, counts) {
30489
30866
  function warnUnsentUntracked(run, deps, pending) {
30490
30867
  for (const [logicalId, entry] of pending) {
30491
30868
  if (run.supersededEntries.has(logicalId)) continue;
30492
- withPrintingSecrets(secretNameBagFor(deps.secretsRun(), logicalId), () => deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${entry.physicalId}) was not deleted: the deploy was interrupted. It is no longer tracked in state, so delete it manually`));
30869
+ withPrintingSecrets(secretNameBagFor(deps.secretsRun(), logicalId), () => deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${displayPhysicalId(entry.resourceType, entry.physicalId)}) was not deleted: the deploy was interrupted. It is no longer tracked in state, so delete it manually`));
30493
30870
  }
30494
30871
  }
30495
30872
  function warnUnretriedReplacedDeletes(run, deps, why) {
@@ -30497,7 +30874,7 @@ function warnUnretriedReplacedDeletes(run, deps, why) {
30497
30874
  run.deferredReplacedDeletes = void 0;
30498
30875
  const cause = why === "failed" ? "the deploy failed first" : why === "interrupted" ? "the deploy was interrupted" : "its nested stack's cleanup could not run";
30499
30876
  const noteFor = (logicalId) => run.supersededEntries.has(logicalId) ? `not retried: ${cause}; cdkd keeps it in state, and the next deploy retries the delete` : `not retried: ${cause}; it is no longer tracked in state, so delete it manually`;
30500
- for (const [logicalId, entry] of deferred ?? []) withPrintingSecrets(secretNameBagFor(deps.secretsRun(), logicalId), () => why === "cleanup-failed" && entry.failureMessage === void 0 ? deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${entry.physicalId}) was not deleted: ${cause}. ${run.supersededEntries.has(logicalId) ? "cdkd keeps it in state, and the next deploy deletes it" : "It is no longer tracked in state, so delete it manually"}`) : entry.cleanupPhase === true ? run.supersededEntries.has(logicalId) ? deps.logger.info(safeMsg` Old ${logicalId} (${entry.physicalId}) was not deleted: ${cause}. A rollback of the deploy adopts it again; otherwise cdkd keeps it in state, and the next deploy deletes it`) : deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${entry.physicalId}) was not deleted: ${cause}. A rollback of the deploy adopts it again; otherwise it is no longer tracked in state, so delete it manually`) : deps.logger.warn(entry.failureMessage === void 0 ? safeMsg` ⚠ The old physical id of ${logicalId} (${entry.physicalId}) was not sent its Delete: ${cause}. A rollback sends the new id an Update with the old properties, and this id is tracked again if the handler answers it; otherwise ${run.supersededEntries.has(logicalId) ? "cdkd keeps it in state, and the next deploy sends the Delete" : "it is no longer tracked in state, so delete it manually"}` : safeMsg` ⚠ Failed to delete old resource ${logicalId} (${entry.physicalId}): ${entry.failureMessage} (${noteFor(logicalId)})`));
30877
+ for (const [logicalId, entry] of deferred ?? []) withPrintingSecrets(secretNameBagFor(deps.secretsRun(), logicalId), () => why === "cleanup-failed" && entry.failureMessage === void 0 ? deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${displayPhysicalId(entry.resourceType, entry.physicalId)}) was not deleted: ${cause}. ${run.supersededEntries.has(logicalId) ? "cdkd keeps it in state, and the next deploy deletes it" : "It is no longer tracked in state, so delete it manually"}`) : entry.cleanupPhase === true ? run.supersededEntries.has(logicalId) ? deps.logger.info(safeMsg` Old ${logicalId} (${displayPhysicalId(entry.resourceType, entry.physicalId)}) was not deleted: ${cause}. A rollback of the deploy adopts it again; otherwise cdkd keeps it in state, and the next deploy deletes it`) : deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${displayPhysicalId(entry.resourceType, entry.physicalId)}) was not deleted: ${cause}. A rollback of the deploy adopts it again; otherwise it is no longer tracked in state, so delete it manually`) : deps.logger.warn(entry.failureMessage === void 0 ? safeMsg` ⚠ The old physical id of ${logicalId} (${displayPhysicalId(entry.resourceType, entry.physicalId)}) was not sent its Delete: ${cause}. A rollback sends the new id an Update with the old properties, and this id is tracked again if the handler answers it; otherwise ${run.supersededEntries.has(logicalId) ? "cdkd keeps it in state, and the next deploy sends the Delete" : "it is no longer tracked in state, so delete it manually"}` : safeMsg` ⚠ Failed to delete old resource ${logicalId} (${displayPhysicalId(entry.resourceType, entry.physicalId)}): ${entry.failureMessage} (${noteFor(logicalId)})`));
30501
30878
  }
30502
30879
 
30503
30880
  // src/deployment/masking-retry-logger.ts
@@ -33045,7 +33422,7 @@ async function replayOrphanFlag(s) {
33045
33422
  ...orphanFlagProvisionedBy && { provisionedBy: orphanFlagProvisionedBy },
33046
33423
  ...record?.physicalId && {
33047
33424
  physicalId: record.physicalId,
33048
- reason: mask(`--orphan left ${op.logicalId} (${op.resourceType}) in AWS as ${record.physicalId} and dropped it from state; it is live, still billing, and no longer tracked by cdkd.`)
33425
+ reason: mask(`--orphan left ${op.logicalId} (${op.resourceType}) in AWS as ${displayPhysicalId(record.resourceType, record.physicalId)} and dropped it from state; it is live, still billing, and no longer tracked by cdkd.`)
33049
33426
  }
33050
33427
  });
33051
33428
  } else logger.info(` Rollback: Leaving ${safe(op.logicalId)} at its new state (--orphan)`);
@@ -33078,7 +33455,7 @@ async function replayOrphanRetain(s) {
33078
33455
  ...orphanProvisionedBy && { provisionedBy: orphanProvisionedBy },
33079
33456
  ...record?.physicalId && {
33080
33457
  physicalId: record.physicalId,
33081
- reason: mask(`DeletionPolicy: Retain left ${op.logicalId} (${op.resourceType}) in AWS as ${record.physicalId} and dropped it from state; it is live, still billing, and no longer tracked by cdkd.`)
33458
+ reason: mask(`DeletionPolicy: Retain left ${op.logicalId} (${op.resourceType}) in AWS as ${displayPhysicalId(record.resourceType, record.physicalId)} and dropped it from state; it is live, still billing, and no longer tracked by cdkd.`)
33082
33459
  }
33083
33460
  });
33084
33461
  }
@@ -33110,6 +33487,7 @@ async function replayDelete(s) {
33110
33487
  const physicalId = op.physicalId;
33111
33488
  const deleteCreated = () => withReplayDeletePrinting(s, () => provider.delete(op.logicalId, physicalId, op.resourceType, op.properties, {
33112
33489
  expectedRegion: ctx.region,
33490
+ stackHoldersStillAttached: true,
33113
33491
  ...removeProtection && { removeProtection: true },
33114
33492
  ...createRollbackClaimed && { inlinePolicyClaimed: createRollbackClaimed },
33115
33493
  ...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
@@ -33309,8 +33687,8 @@ function coordinatePath(coordinate) {
33309
33687
  function shownPaths(coordinates) {
33310
33688
  return coordinates.map((coordinate) => plainOrDescribed(coordinatePath(coordinate), "property path")).join(", ");
33311
33689
  }
33312
- function unreadableNoEchoLeafRefusal(logicalId, coordinates, failure) {
33313
- const why = failure === "read-failed" ? "reading the resource back from AWS failed, so cdkd could not learn the value AWS holds there (re-running the rollback retries the read)" : "cdkd cannot read the value AWS holds there (the property is write-only, AWS does not return it, or cdkd has no readback for this resource type)";
33690
+ function unreadableNoEchoLeafRefusal(logicalId, coordinates, failure, denied) {
33691
+ const why = failure === "read-failed" ? "reading the resource back from AWS failed, so cdkd could not learn the value AWS holds " + (denied !== void 0 ? `there (${grantSentence(denied)} the rollback)` : "there (re-running the rollback retries the read)") : "cdkd cannot read the value AWS holds there (the property is write-only, AWS does not return it, or cdkd has no readback for this resource type)";
33314
33692
  return markNonRetryable(new CdkdError(`Cannot roll ${shownLogicalId(logicalId)} back: its recorded baseline holds a NoEcho value only as the redaction mask ('${"***"}') at ${shownPaths(coordinates)}, and ${why}. cdkd sent nothing rather than write the mask to the live resource. Restore the property with ${proseQuoted(cdkdRemedy("cdkd deploy"))}, which sends the NoEcho parameter's value again (a NoEcho attribute of a custom resource is sent again only when that custom resource updates in the same deploy).`, "ROLLBACK_REDACTED_BASELINE"));
33315
33693
  }
33316
33694
  function refuseMarkedNoEchoRecreate(props, marked, logicalId) {
@@ -33369,8 +33747,12 @@ async function readLive$1(live, baseline, marked, logicalId, ctx) {
33369
33747
  })]);
33370
33748
  if (result === void 0 || result === null || typeof result !== "object") return { failure: "not-readable" };
33371
33749
  return { live: result };
33372
- } catch {
33373
- return { failure: "read-failed" };
33750
+ } catch (error) {
33751
+ const denied = readDenialOf(error);
33752
+ return {
33753
+ failure: "read-failed",
33754
+ ...denied !== void 0 && { denied }
33755
+ };
33374
33756
  } finally {
33375
33757
  if (timer !== void 0) clearTimeout(timer);
33376
33758
  }
@@ -33391,7 +33773,7 @@ async function substituteMarkedNoEchoLeaves(input) {
33391
33773
  inert: pending
33392
33774
  };
33393
33775
  const read = await readLive$1(live, baseline, pending, logicalId, ctx);
33394
- if ("failure" in read) throw unreadableNoEchoLeafRefusal(logicalId, pending, read.failure);
33776
+ if ("failure" in read) throw unreadableNoEchoLeafRefusal(logicalId, pending, read.failure, read.denied);
33395
33777
  const values = [];
33396
33778
  const unreadable = [];
33397
33779
  for (const coordinate of pending) {
@@ -33590,16 +33972,24 @@ function canonicalizeTagListsDeep(v) {
33590
33972
  }
33591
33973
  const ID_RE = /^[a-z][a-z0-9]*-[0-9a-f]{6,}$/;
33592
33974
  const isIdLike = (s) => typeof s === "string" && (s.startsWith("arn:") || ID_RE.test(s));
33593
- function canonicalizeIdArraysDeep(v) {
33975
+ const ORDER_SIGNIFICANT_ID_ARRAY_PATHS = { "AWS::Lambda::Function": ["Layers"] };
33976
+ function orderSignificantIdArrayPaths(resourceType) {
33977
+ if (resourceType === void 0 || !Object.hasOwn(ORDER_SIGNIFICANT_ID_ARRAY_PATHS, resourceType)) return [];
33978
+ return ORDER_SIGNIFICANT_ID_ARRAY_PATHS[resourceType];
33979
+ }
33980
+ function canonicalizeIdArraysDeep(v, orderedPaths = []) {
33981
+ return walkIdArrays(v, "", orderedPaths);
33982
+ }
33983
+ function walkIdArrays(v, path, orderedPaths) {
33594
33984
  if (Array.isArray(v)) {
33595
- const mapped = v.map(canonicalizeIdArraysDeep);
33596
- if (mapped.length > 1 && mapped.every(isIdLike)) return [...mapped].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
33985
+ const mapped = v.map((el) => walkIdArrays(el, path, orderedPaths));
33986
+ if (mapped.length > 1 && mapped.every(isIdLike) && !matchesPathPrefix(path, orderedPaths)) return [...mapped].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
33597
33987
  return mapped;
33598
33988
  }
33599
33989
  if (v && typeof v === "object") {
33600
33990
  if (!hasPlainPrototype(v)) return v;
33601
33991
  const out = nullPrototypeRecord();
33602
- for (const [k, val] of Object.entries(v)) out[k] = canonicalizeIdArraysDeep(val);
33992
+ for (const [k, val] of Object.entries(v)) out[k] = walkIdArrays(val, path === "" ? k : `${path}.${k}`, orderedPaths);
33603
33993
  return out;
33604
33994
  }
33605
33995
  return v;
@@ -33662,8 +34052,9 @@ function calculateResourceDrift(stateProperties, awsProperties, options) {
33662
34052
  const union = options?.unionWalkObjects ?? false;
33663
34053
  const unordered = options?.unorderedPaths ?? [];
33664
34054
  const unionPaths = options?.unionWalkPaths ?? [];
33665
- stateProperties = canonicalizeUnorderedArraysAtPaths(canonicalizeIdArraysDeep(canonicalizeTagListsDeep(stateProperties)), unordered);
33666
- awsProperties = canonicalizeUnorderedArraysAtPaths(canonicalizeIdArraysDeep(canonicalizeTagListsDeep(awsProperties)), unordered);
34055
+ const orderedIdPaths = orderSignificantIdArrayPaths(options?.resourceType);
34056
+ stateProperties = canonicalizeUnorderedArraysAtPaths(canonicalizeIdArraysDeep(canonicalizeTagListsDeep(stateProperties), orderedIdPaths), unordered);
34057
+ awsProperties = canonicalizeUnorderedArraysAtPaths(canonicalizeIdArraysDeep(canonicalizeTagListsDeep(awsProperties), orderedIdPaths), unordered);
33667
34058
  for (const key of Object.keys(stateProperties)) {
33668
34059
  if (isIgnoredPath(key, ignore)) continue;
33669
34060
  diffAt(key, stateProperties[key], awsProperties[key], drifts, ignore, union, unionPaths);
@@ -33933,7 +34324,8 @@ async function unsettledAfterUpdate(args) {
33933
34324
  if (!Object.hasOwn(live, name) || desired[name] === void 0) continue;
33934
34325
  if (calculateResourceDrift(canonical({ [name]: desired[name] }), canonical({ [name]: live[name] }), {
33935
34326
  ignorePaths,
33936
- unorderedPaths
34327
+ unorderedPaths,
34328
+ resourceType: args.resourceType
33937
34329
  }).length > 0) kept.push(name);
33938
34330
  }
33939
34331
  return kept.sort();
@@ -34161,7 +34553,7 @@ async function replayReadopt(s, survivor) {
34161
34553
  const oldKind = survivor === void 0 ? "retained" : "surviving";
34162
34554
  const current = stateResources[op.logicalId];
34163
34555
  const prev = op.previousState;
34164
- const oldShown = hasAddressablePhysicalId({ physicalId: prev.physicalId }) ? displaySafe(mask(prev.physicalId)) : "no recorded id";
34556
+ const oldShown = hasAddressablePhysicalId({ physicalId: prev.physicalId }) ? displaySafe(mask(String(displayPhysicalId(prev.resourceType, prev.physicalId)))) : "no recorded id";
34165
34557
  const unprovenCopyRefusal = (reason) => {
34166
34558
  const remedy = orphanRemedy(op.logicalId, ctx);
34167
34559
  return ownRemedyError(markNonRetryable(new CdkdError(safeMsg`Cannot reverse the replacement of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): ` + reason + ` The ${oldKind} old resource (${oldShown}) is named only by the rollback journal, so the JOURNAL is kept. Check both resources by hand.` + (remedy.offered ? ` To leave this one as it is, re-run ${rerunRollbackPhrase(ctx, proseQuoted(cdkdRemedy("cdkd rollback"), "`"))} with the command below; that also drops the journal's only record of the ${oldKind} old resource (${oldShown}), so note that id first.` : ` No repair of the state record makes this op succeed on a re-run.`) + remedy.clause + remedy.line, STATE_RESOURCES_MALFORMED)));
@@ -34169,16 +34561,16 @@ async function replayReadopt(s, survivor) {
34169
34561
  const opIdUnusable = op.physicalId !== void 0 && !hasAddressablePhysicalId(op);
34170
34562
  if (!rollbackRetainsNewResource(current) && rollbackCannotAddress(current, op.resourceType, current.provisionedBy ?? op.provisionedBy, current.physicalId)) {
34171
34563
  if (opIdUnusable) throw unprovenCopyRefusal("neither its state record nor its rollback journal entry has a non-empty string 'physicalId' for the replacement's new resource, so cdkd cannot address that resource in AWS or tell which resource it is, and sent nothing.");
34172
- const target = op.physicalId === void 0 ? void 0 : refusalPhysicalId(mask(String(op.physicalId)));
34564
+ const target = op.physicalId === void 0 ? void 0 : refusalPhysicalId(mask(String(displayPhysicalId(op.resourceType, op.physicalId))));
34173
34565
  const repair = target === void 0 ? `Repair the record's 'physicalId' to the id of the replacement's NEW resource (inspect it with ${proseQuoted(cdkdRemedy("cdkd state show"), "`")}): the journal does not record that id, and the re-run DELETES the resource the repaired record names as the new copy, so name the right one. Then re-run ${rerunRollbackPhrase(ctx, proseQuoted(cdkdRemedy("cdkd rollback"), "`"))}.` : `Repair the record's 'physicalId' to ${target}, the replacement's new resource the journal records (inspect it with ${proseQuoted(cdkdRemedy("cdkd state show"), "`")}); the re-run deletes it and re-adopts the old one. Any other id stops the revert and drops the journal's only record of the ${oldKind} old resource (${oldShown}). Then re-run ${rerunRollbackPhrase(ctx, proseQuoted(cdkdRemedy("cdkd rollback"), "`"))}.` + (describedPhysicalIdPointer(target) !== "" ? " That id is left out of the prose above: it is not a plain identifier — read it from the rollback journal." : target.includes("***") ? ` That id is shown masked — read the full value from the rollback journal.` : "");
34174
34566
  throw new CdkdError(safeMsg`Cannot reverse the replacement of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): ` + `its state record has no non-empty string 'physicalId', so cdkd cannot address the new resource in AWS to delete it, and sent nothing. The ${oldKind} old resource (${oldShown}) is named only by the rollback journal, so the JOURNAL is kept. ` + repair, STATE_RESOURCES_MALFORMED);
34175
34567
  }
34176
34568
  if (!rollbackRetainsNewResource(current) && opIdUnusable && current.physicalId !== op.physicalId) throw unprovenCopyRefusal("its rollback journal entry has no non-empty string 'physicalId' for the replacement's new resource, so cdkd cannot tell whether the resource state records under this id is that one, and did not delete it; nothing was sent.");
34177
- logger.info(` Rollback: Reversing replacement of ${safe(op.logicalId)} (${safe(op.resourceType)}) — deleting the new resource and re-adopting the ${oldKind} old one (${displaySafe(mask(prev.physicalId))})`);
34569
+ logger.info(` Rollback: Reversing replacement of ${safe(op.logicalId)} (${safe(op.resourceType)}) — deleting the new resource and re-adopting the ${oldKind} old one (${displaySafe(mask(String(displayPhysicalId(prev.resourceType, prev.physicalId))))})`);
34178
34570
  let survivorReason;
34179
34571
  const survivorId = retainedSurvivorId(current, op);
34180
34572
  if (rollbackRetainsNewResource(current)) {
34181
- const survivorMessages = retainedSurvivorMessages(op.logicalId, op.resourceType, survivorId ?? "no recorded id", `State is restored to the old resource (${prev.physicalId}).`, mask);
34573
+ const survivorMessages = retainedSurvivorMessages(op.logicalId, op.resourceType, survivorId === void 0 ? "no recorded id" : String(displayPhysicalId(current.resourceType, survivorId)), `State is restored to the old resource (${displayPhysicalId(prev.resourceType, prev.physicalId)}).`, mask);
34182
34574
  logger.warn(survivorMessages.warn);
34183
34575
  survivorReason = survivorMessages.reason;
34184
34576
  result.warnings++;
@@ -34191,6 +34583,7 @@ async function replayReadopt(s, survivor) {
34191
34583
  const readoptClaimed = inlinePolicyWriters.claimedFor(op.resourceType, op.logicalId, stateResources);
34192
34584
  const readoptDelete = await withReplayDeletePrinting(s, () => newDeleteProvider.delete(op.logicalId, current.physicalId, op.resourceType, current.properties, {
34193
34585
  expectedRegion: ctx.region,
34586
+ stackHoldersStillAttached: true,
34194
34587
  ...readoptClaimed && { inlinePolicyClaimed: readoptClaimed },
34195
34588
  ...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
34196
34589
  deletionPolicy: replacementDeletePolicy(current.updateReplacePolicy),
@@ -34373,6 +34766,10 @@ function earlyDeletedOld(op, oldType, unconfirmedFoundGone = false) {
34373
34766
  function earlyDeleteWhen(kind) {
34374
34767
  return kind === "before-create" ? "deleted the old resource before creating its replacement" : "deleted the old resource before the deploy succeeded";
34375
34768
  }
34769
+ const PLANNED_EARLY_DELETE_CONSEQUENCE = "a failed deploy's rollback does not restore what AWS held for it beyond its recorded properties";
34770
+ function plannedEarlyDeleteNote(kind) {
34771
+ return `the deploy ${kind === "during-deploy" ? "deletes the old resource before the deploy succeeds" : kind === "recreate" ? "deletes the old resource before creating its replacement (unless the replacement takes another name)" : "deletes the old resource before creating its replacement"}, so ${PLANNED_EARLY_DELETE_CONSEQUENCE}`;
34772
+ }
34376
34773
 
34377
34774
  // src/deployment/rollback-executor/replay-reverse-replacement/failures.ts
34378
34775
  function embeddedFailureText(error, logDetail) {
@@ -34406,6 +34803,7 @@ async function deleteMarkedRecreate(error, s) {
34406
34803
  try {
34407
34804
  const outcome = await withReplayDeletePrinting(s, () => s.provider.delete(s.op.logicalId, madeId, s.oldType, s.properties, {
34408
34805
  expectedRegion: s.region,
34806
+ stackHoldersStillAttached: true,
34409
34807
  deletionPolicy: "Delete",
34410
34808
  maskSecrets: s.mask
34411
34809
  }));
@@ -34434,6 +34832,7 @@ async function recreateOldResource(s, r) {
34434
34832
  ...newCopyClaimed && { inlinePolicyClaimed: newCopyClaimed },
34435
34833
  ...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
34436
34834
  deletionPolicy: replacementDeletePolicy(current.updateReplacePolicy),
34835
+ stackHoldersStillAttached: true,
34437
34836
  recordedAttributes: newCopyDeleteAttributes(op.resourceType, current.attributes, op.oldDeletedBeforeCreate, op.previousState?.attributes),
34438
34837
  recordedCreateOnlyDrops: current.acceptedCreateOnlyDrops,
34439
34838
  recordedNoEchoLeaves: current.noEchoLeaves,
@@ -34456,7 +34855,7 @@ async function recreateOldResource(s, r) {
34456
34855
  });
34457
34856
  } catch (recreateError) {
34458
34857
  await deleteMarkedRecreate(recreateError, recreateCleanup);
34459
- const recreateFailure = (text) => mask(`Failed to re-create the old ${safe(op.logicalId)} after the new resource (${mask(current.physicalId)}) was already deleted: ${displaySafe(text)}${text.endsWith(".") ? "" : "."} The resource is now absent — fix forward by re-deploying the stack.`);
34858
+ const recreateFailure = (text) => mask(`Failed to re-create the old ${safe(op.logicalId)} after the new resource (${mask(String(displayPhysicalId(current.resourceType, current.physicalId)))}) was already deleted: ${displaySafe(text)}${text.endsWith(".") ? "" : "."} The resource is now absent — fix forward by re-deploying the stack.`);
34460
34859
  const recreateText = embeddedFailureText(recreateError, (detail) => logger.debug(displaySafe(recreateFailure(detail))));
34461
34860
  throw stampRedacted(new Error(recreateFailure(recreateText.text), { cause: maskSecretsInError(recreateError instanceof Error ? recreateError : void 0, secrets) }), recreateText.redacted);
34462
34861
  }
@@ -34464,7 +34863,7 @@ async function recreateOldResource(s, r) {
34464
34863
  let deletedNewFirst = false;
34465
34864
  let createResult;
34466
34865
  if (reverseDeleteFirst) {
34467
- logger.info(` Rollback: the replacement deleted the old resource before creating the new one — ` + safeMsg`deleting the new resource (${mask(current.physicalId)}) first...`);
34866
+ logger.info(` Rollback: the replacement deleted the old resource before creating the new one — ` + safeMsg`deleting the new resource (${mask(String(displayPhysicalId(current.resourceType, current.physicalId)))}) first...`);
34468
34867
  await deleteNewResourceFirst("while clearing the new resource before re-creating the old one (the replacement deleted the old one first)");
34469
34868
  deletedNewFirst = true;
34470
34869
  createResult = await recreateAfterNewDeleted();
@@ -34496,22 +34895,22 @@ async function recreateOldResource(s, r) {
34496
34895
  }));
34497
34896
  if (!holder.holds) {
34498
34897
  const remedy = orphanRemedy(op.logicalId, ctx);
34499
- const oldShown = refusalPhysicalId(mask(prev.physicalId));
34898
+ const oldShown = refusalPhysicalId(mask(String(displayPhysicalId(prev.resourceType, prev.physicalId))));
34500
34899
  throw ownRemedyError(markNonRetryable(new CdkdError(mask(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create of the old resource (${oldShown}) collided (why is on the Collision diagnosis line below) — so ` + (holder.known ? `another resource holds the colliding name` : `if another resource holds the name it collided on`) + " (an orphan of an earlier attempt, or one made outside this stack), deleting the new resource would destroy it and collide again. Nothing was deleted. Remove or rename whatever holds that name if it is yours — if that is the new resource itself, delete it by hand — then re-run ") + rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback")) + mask(`, which proceeds: the journal is kept, so the revert resumes from here.` + (remedy.offered ? " To leave THIS resource alone and let the rest of the rollback proceed, re-run with the command below." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown)}\nCollision diagnosis: ${holder.diagnosis}\nUnderlying collision: ${collisionLine(mask(msg))}`) + remedy.line, "NAMED_REPLACEMENT_COLLISION", maskSecretsInError(createError instanceof Error ? createError : void 0, secrets))));
34501
34900
  }
34502
34901
  if (rollbackRetainsNewResource(current)) {
34503
34902
  const remedy = orphanRemedy(op.logicalId, ctx);
34504
- const oldShown = refusalPhysicalId(mask(prev.physicalId));
34505
- const newShown = refusalPhysicalId(mask(current.physicalId));
34903
+ const oldShown = refusalPhysicalId(mask(String(displayPhysicalId(prev.resourceType, prev.physicalId))));
34904
+ const newShown = refusalPhysicalId(mask(String(displayPhysicalId(current.resourceType, current.physicalId))));
34506
34905
  throw ownRemedyError(markNonRetryable(new CdkdError(mask(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create of the old resource (${oldShown}) collided with the name still held by the new one (${newShown}), and UpdateReplacePolicy: Retain pins that new resource in place, so cdkd will not delete it to free the name. Delete the new resource yourself, or remove UpdateReplacePolicy: Retain, then re-run `) + rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback")) + mask(` — the journal is kept, so the revert resumes from here.` + (remedy.offered ? " To leave THIS resource alone and let the rest of the rollback proceed, re-run with the command below: one op failure stops the segment loop, so a single pinned resource otherwise halts every OLDER segment too." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown, newShown)}\nUnderlying collision: ${collisionLine(mask(msg))}`) + remedy.line, "NAMED_REPLACEMENT_COLLISION", maskSecretsInError(createError instanceof Error ? createError : void 0, secrets))));
34507
34906
  }
34508
34907
  if (deleteFirstBlocked !== void 0) {
34509
34908
  const remedy = orphanRemedy(op.logicalId, ctx);
34510
- const oldShown = refusalPhysicalId(mask(prev.physicalId));
34511
- const newShown = refusalPhysicalId(mask(current.physicalId));
34909
+ const oldShown = refusalPhysicalId(mask(String(displayPhysicalId(prev.resourceType, prev.physicalId))));
34910
+ const newShown = refusalPhysicalId(mask(String(displayPhysicalId(current.resourceType, current.physicalId))));
34512
34911
  throw ownRemedyError(markNonRetryable(new CdkdError(mask(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create of the old resource (${oldShown}) collided with the name still held by the new one (${newShown}), and the old resource's properties name what ${refusalLogicalId(deleteFirstBlocked.logicalId)} was before the same deploy replaced or deleted it, which this rollback may not be able to restore, so cdkd will not delete the new resource to free the name. Nothing was deleted. Re-deploy to fix forward, or re-run `) + rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback")) + mask(` once the old resource can be re-created — the journal is kept.` + (remedy.offered ? " To leave THIS resource alone and let the rest of the rollback proceed, re-run with the command below." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown, newShown)}\nUnderlying collision: ${collisionLine(mask(msg))}`) + remedy.line, "NAMED_REPLACEMENT_COLLISION", maskSecretsInError(createError instanceof Error ? createError : void 0, secrets))));
34513
34912
  }
34514
- logger.info(` Rollback: re-create collided with the new resource's name — deleting the new resource (${displaySafe(mask(current.physicalId))}) first...` + (typeChanged ? ` (this op changed the resource's Type, ${safe(op.resourceType)} -> ${safe(oldType)}, which share a name space)` : ""));
34913
+ logger.info(` Rollback: re-create collided with the new resource's name — deleting the new resource (${displaySafe(mask(String(displayPhysicalId(current.resourceType, current.physicalId))))}) first...` + (typeChanged ? ` (this op changed the resource's Type, ${safe(op.resourceType)} -> ${safe(oldType)}, which share a name space)` : ""));
34515
34914
  await deleteNewResourceFirst("while clearing the new resource so the old one could be re-created");
34516
34915
  deletedNewFirst = true;
34517
34916
  createResult = await recreateAfterNewDeleted();
@@ -34542,7 +34941,7 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
34542
34941
  }) && !deletedNewFirst && createResult.physicalId === current.physicalId;
34543
34942
  const keepLiveRecord = adoptedLiveNewResource && oldType === op.resourceType && !isCustomResource(oldType);
34544
34943
  if (adoptedLiveNewResource) {
34545
- const liveShown = refusalPhysicalId(mask(current.physicalId));
34944
+ const liveShown = refusalPhysicalId(mask(String(displayPhysicalId(current.resourceType, current.physicalId))));
34546
34945
  logger.warn(` ⚠ ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create returned the LIVE new resource (${liveShown}) instead of re-creating the old one — its Create API is name-idempotent and the new resource still holds the same user-supplied name. Skipping the delete-new step (it would delete that very resource). ` + (keepLiveRecord ? "The old resource's ORIGINAL properties were NOT re-applied; state keeps the live resource's record, with the failed deploy's properties, so " + safeMsg`${proseQuoted(cdkdRemedy("cdkd deploy"))} re-applies the template's, or rename the resource to make the replacement ` + `reversible.` : "The old resource's ORIGINAL properties may NOT have been re-applied; state now records the pre-replacement properties, so inspect the drift and " + safeMsg`run ${proseQuoted(cdkdRemedy("cdkd deploy"))} to reconcile, or rename the resource to make the replacement ` + `reversible.`) + `${describedPhysicalIdPointer(liveShown)}\nInspect it with: ${pasteableCommand("cdkd drift", [{
34547
34946
  value: stackName,
34548
34947
  hole: "stack"
@@ -34592,7 +34991,7 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
34592
34991
  let survivorReason;
34593
34992
  const survivorId = retainedSurvivorId(current, op);
34594
34993
  if (!deletedNewFirst && !adoptedLiveNewResource && rollbackRetainsNewResource(current)) {
34595
- const survivorMessages = retainedSurvivorMessages(op.logicalId, op.resourceType, survivorId ?? "no recorded id", `State records the re-created old resource (${stateResources[op.logicalId]?.physicalId ?? prev.physicalId}).`, mask);
34994
+ const survivorMessages = retainedSurvivorMessages(op.logicalId, op.resourceType, survivorId === void 0 ? "no recorded id" : String(displayPhysicalId(current.resourceType, survivorId)), `State records the re-created old resource (${displayPhysicalId(prev.resourceType, stateResources[op.logicalId]?.physicalId ?? prev.physicalId)}).`, mask);
34596
34995
  logger.warn(survivorMessages.warn);
34597
34996
  survivorReason = survivorMessages.reason;
34598
34997
  result.warnings++;
@@ -34602,6 +35001,7 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
34602
35001
  const deleteNewAfterRecreateRoute = resolveNewDeleteRoute();
34603
35002
  const deleteNewAfterRecreate = await withReplayDeletePrinting(s, () => deleteNewAfterRecreateRoute.provider.delete(op.logicalId, current.physicalId, op.resourceType, current.properties, {
34604
35003
  expectedRegion: ctx.region,
35004
+ stackHoldersStillAttached: true,
34605
35005
  ...newCopyClaimed && { inlinePolicyClaimed: newCopyClaimed },
34606
35006
  ...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
34607
35007
  deletionPolicy: replacementDeletePolicy(current.updateReplacePolicy),
@@ -34613,9 +35013,9 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
34613
35013
  }));
34614
35014
  throwIfDeleteSkipped(deleteNewAfterRecreate, op.logicalId, current.physicalId, "while deleting the new resource after re-creating the old one", newDeleteGuardScope(deleteNewAfterRecreateRoute.provisionedBy));
34615
35015
  } catch (deleteError) {
34616
- logger.warn(mask(` Rollback: old ${safe(op.logicalId)} re-created, but deleting the new resource (${displaySafe(mask(current.physicalId))}) failed: ${displaySafe(describeAwsFailure(deleteError).detail)}. ` + (recordSuperseded ? `${SUPERSEDED_KEPT_REMEDY}.` : `Delete it manually — it is no longer tracked in state.`)));
35016
+ logger.warn(mask(` Rollback: old ${safe(op.logicalId)} re-created, but deleting the new resource (${displaySafe(mask(String(displayPhysicalId(current.resourceType, current.physicalId))))}) failed: ${displaySafe(describeAwsFailure(deleteError).detail)}. ` + (recordSuperseded ? `${SUPERSEDED_KEPT_REMEDY}.` : `Delete it manually — it is no longer tracked in state.`)));
34617
35017
  const survivorFailure = embeddedFailureText(deleteError).text;
34618
- survivorReason = `The replacement's new ${op.resourceType} (${current.physicalId}) could not be deleted after the old resource was re-created: ${survivorFailure}${survivorFailure.endsWith(".") ? "" : "."} ` + (recordSuperseded ? `It is live and still billing; ${SUPERSEDED_KEPT_REMEDY}.` : `It is live, still billing, and no longer tracked by cdkd — delete it yourself.`);
35018
+ survivorReason = `The replacement's new ${op.resourceType} (${displayPhysicalId(current.resourceType, current.physicalId)}) could not be deleted after the old resource was re-created: ${survivorFailure}${survivorFailure.endsWith(".") ? "" : "."} ` + (recordSuperseded ? `It is live and still billing; ${SUPERSEDED_KEPT_REMEDY}.` : `It is live, still billing, and no longer tracked by cdkd — delete it yourself.`);
34619
35019
  result.warnings++;
34620
35020
  }
34621
35021
  const recreatedId = displaySafe(mask(String(displayPhysicalId(oldType, createResult.physicalId))));
@@ -34638,7 +35038,7 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
34638
35038
  return survivorReason === void 0;
34639
35039
  };
34640
35040
  const keep = (reason) => {
34641
- logger.warn(mask(` Rollback: old ${safe(op.logicalId)} re-created, but the new resource (${displaySafe(mask(current.physicalId))}) was not deleted: ${reason}. ${SUPERSEDED_KEPT_REMEDY}.`));
35041
+ logger.warn(mask(` Rollback: old ${safe(op.logicalId)} re-created, but the new resource (${displaySafe(mask(String(displayPhysicalId(current.resourceType, current.physicalId))))}) was not deleted: ${reason}. ${SUPERSEDED_KEPT_REMEDY}.`));
34642
35042
  result.warnings++;
34643
35043
  ctx.recordEvent?.({
34644
35044
  eventType: "ROLLBACK_RESOURCE_SUCCEEDED",
@@ -34648,16 +35048,16 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
34648
35048
  resourceType: op.resourceType,
34649
35049
  ...current.provisionedBy && { provisionedBy: current.provisionedBy },
34650
35050
  physicalId: current.physicalId,
34651
- reason: mask(`The old resource was re-created; the new one (${current.physicalId}) was not deleted: ${reason}. ${SUPERSEDED_KEPT_REMEDY}.`)
35051
+ reason: mask(`The old resource was re-created; the new one (${displayPhysicalId(current.resourceType, current.physicalId)}) was not deleted: ${reason}. ${SUPERSEDED_KEPT_REMEDY}.`)
34652
35052
  });
34653
35053
  };
34654
35054
  if (deferral !== void 0) {
34655
- logger.info(safeMsg` Rollback: old ${safe(op.logicalId)} re-created first; the new resource ` + safeMsg`(${mask(current.physicalId)}) is deleted once the resources that reference it ` + `are reverted`);
35055
+ logger.info(safeMsg` Rollback: old ${safe(op.logicalId)} re-created first; the new resource ` + safeMsg`(${mask(String(displayPhysicalId(current.resourceType, current.physicalId)))}) is deleted once the resources that reference it ` + `are reverted`);
34656
35056
  deferral.defer(async () => {
34657
35057
  let gone = false;
34658
35058
  try {
34659
35059
  if (supersededHolderOf(superseded, stateResources) !== void 0) {
34660
- logger.warn(safeMsg` Rollback: not deleting the new ${shownLogicalId(op.logicalId)} ` + safeMsg`(${mask(current.physicalId)}): a record of this stack now holds its ` + safeMsg`physical id. Check it with ${cdkdRemedy("cdkd drift")}.`);
35060
+ logger.warn(safeMsg` Rollback: not deleting the new ${shownLogicalId(op.logicalId)} ` + safeMsg`(${mask(String(displayPhysicalId(current.resourceType, current.physicalId)))}): a record of this stack now holds its ` + safeMsg`physical id. Check it with ${cdkdRemedy("cdkd drift")}.`);
34661
35061
  result.warnings++;
34662
35062
  ctx.recordEvent?.({
34663
35063
  eventType: "ROLLBACK_RESOURCE_SUCCEEDED",
@@ -34666,7 +35066,7 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
34666
35066
  logicalId: op.logicalId,
34667
35067
  resourceType: op.resourceType,
34668
35068
  ...op.provisionedBy && { provisionedBy: op.provisionedBy },
34669
- reason: mask(`The old resource was re-created; the new one (${current.physicalId}) was not deleted because a record of this stack now holds its physical id.`)
35069
+ reason: mask(`The old resource was re-created; the new one (${displayPhysicalId(current.resourceType, current.physicalId)}) was not deleted because a record of this stack now holds its physical id.`)
34670
35070
  });
34671
35071
  gone = true;
34672
35072
  } else gone = await finish();
@@ -34738,14 +35138,14 @@ async function replayReverseReplacement(s) {
34738
35138
  }
34739
35139
  if (survivor === "exists" && op.oldResourceMaySurvive === "unconfirmed") throw survivorUnprovenRefusal(s, oldType, "maybe-deleting");
34740
35140
  if (op.oldResourceMaySurvive === "deferred" && survivor !== "gone" && survivor !== "interrupted" && (survivor === "exists" || deferredDeleteStillPending(ctx.supersededResources, prev, oldType))) {
34741
- logger.info(safeMsg` Rollback: the old resource of ${safe(op.logicalId)} (${mask(String(prev.physicalId))}) was not deleted yet — re-adopting it`);
35141
+ logger.info(safeMsg` Rollback: the old resource of ${safe(op.logicalId)} (${mask(String(displayPhysicalId(prev.resourceType, prev.physicalId)))}) was not deleted yet — re-adopting it`);
34742
35142
  await replayReadopt(s, {});
34743
35143
  if (identityUnverified) warnUnverifiedSurvivor(s, oldType);
34744
35144
  if (survivor === "identity-uncompared" || survivor === "identity-unread") warnUnverifiedSurvivor(s, oldType, survivor);
34745
35145
  return;
34746
35146
  }
34747
35147
  if (survivor === "exists") {
34748
- const oldShown = refusalPhysicalId(mask(String(prev.physicalId)));
35148
+ const oldShown = refusalPhysicalId(mask(String(displayPhysicalId(prev.resourceType, prev.physicalId))));
34749
35149
  logger.warn(safeMsg` ⚠ Rollback: the old resource of ${shownLogicalId(op.logicalId)} (${oldShown}) still ` + "exists — the deploy's delete of it was not confirmed — so it is re-adopted instead of re-created. Part of it may have been removed before that delete failed: check it " + safeMsg`with ${cdkdRemedy("cdkd drift")} after the rollback.${describedPhysicalIdPointer(oldShown)}`);
34750
35150
  result.warnings++;
34751
35151
  await replayReadopt(s, { reason: `the old resource survived a delete that was refused or never sent during the deploy and was re-adopted instead of re-created; the provider may have run part of that delete, so check it with ${cdkdRemedy("cdkd drift")}` });
@@ -34754,7 +35154,7 @@ async function replayReverseReplacement(s) {
34754
35154
  }
34755
35155
  if (survivor !== "gone") throw survivorUnprovenRefusal(s, oldType, survivor);
34756
35156
  unconfirmedFoundGone = op.oldResourceMaySurvive === "unconfirmed";
34757
- logger.info(safeMsg` Rollback: the old resource of ${safe(op.logicalId)} (${mask(String(prev.physicalId))}) is gone — re-creating it`);
35157
+ logger.info(safeMsg` Rollback: the old resource of ${safe(op.logicalId)} (${mask(String(displayPhysicalId(prev.resourceType, prev.physicalId)))}) is gone — re-creating it`);
34758
35158
  }
34759
35159
  const typeChanged = oldType !== op.resourceType;
34760
35160
  if (!requireRestorableBaseline(prev.properties, logger, {
@@ -34857,7 +35257,7 @@ function uncomparedIdentityCause(oldType, verdict) {
34857
35257
  function survivorUnprovenRefusal(s, oldType, verdict) {
34858
35258
  const { op, ctx, mask } = s;
34859
35259
  const remedy = orphanRemedy(op.logicalId, ctx);
34860
- const oldId = op.previousState?.physicalId;
35260
+ const oldId = displayPhysicalId(op.previousState?.resourceType, op.previousState?.physicalId);
34861
35261
  const oldShown = hasAddressablePhysicalId({ physicalId: oldId }) ? refusalPhysicalId(mask(String(oldId))) : "no recorded id";
34862
35262
  const rerun = rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback"));
34863
35263
  const identity = verdict === "identity-uncompared" || verdict === "identity-unread";
@@ -34867,7 +35267,7 @@ function survivorUnprovenRefusal(s, oldType, verdict) {
34867
35267
  function foreignSurvivorRefusal(s, oldType, verdict) {
34868
35268
  const { op, ctx, mask } = s;
34869
35269
  const remedy = orphanRemedy(op.logicalId, ctx);
34870
- const oldShown = refusalPhysicalId(mask(String(op.previousState?.physicalId)));
35270
+ const oldShown = refusalPhysicalId(mask(String(displayPhysicalId(op.previousState?.resourceType, op.previousState?.physicalId))));
34871
35271
  const rerun = rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback"));
34872
35272
  const seen = verdict === "foreign-account" ? `it is not in this account's bucket list, so it belongs to another account` : verdict === "foreign-region" ? `it is in another region than this stack's, and a bucket never moves region` : verdict === "foreign-recreated" ? "its creation date differs from the one read when the deploy deferred the old bucket's delete, and in us-east-1 only a re-create changes it" : verdict === "foreign-appeared" ? `nothing held that id when this rollback started` : `its ${SURVIVOR_IDENTITY_ATTRIBUTES[oldType] ?? "identity"} differs`;
34873
35273
  return ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(oldType)}): AWS reports a resource under the old physical id (${oldShown}), but not the one this stack recorded (${seen}), so another resource took that name after the stack's was deleted. Re-adopting it would make it this stack's, and re-creating the old one would collide with it. Nothing was sent and the journal is kept. If that resource is not meant to be there, remove it, then re-run ${rerun}, which re-creates the old one.` + (remedy.offered ? " To keep the new resource in its place instead, re-run with the command below; leave the other resource alone." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown)}` + remedy.line, "REPLACED_SURVIVOR_UNPROVEN")));
@@ -34875,7 +35275,7 @@ function foreignSurvivorRefusal(s, oldType, verdict) {
34875
35275
  function modifiedSurvivorRefusal(s, oldType) {
34876
35276
  const { op, ctx, mask } = s;
34877
35277
  const remedy = orphanRemedy(op.logicalId, ctx);
34878
- const oldShown = refusalPhysicalId(mask(String(op.previousState?.physicalId)));
35278
+ const oldShown = refusalPhysicalId(mask(String(displayPhysicalId(op.previousState?.resourceType, op.previousState?.physicalId))));
34879
35279
  const rerun = rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback"));
34880
35280
  return ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(oldType)}): the bucket under the old name (${oldShown}) may have been re-created or modified since the failed deploy: its creation date differs from the one read when the deploy deferred its delete, and outside us-east-1 S3 moves that date on a configuration write (tags, versioning, encryption, policy) as well as on a re-create, so cdkd cannot tell which. Re-adopting it would delete the new resource for what may be another owner's bucket. Nothing was sent and the journal is kept. Re-running ${rerun} refuses again while that bucket is there.` + (remedy.offered ? " To keep the new resource in its place instead, re-run with the command below; the bucket under the old name is then outside the stack: if it is this stack's old bucket, delete it by hand once its contents are no longer needed, and otherwise leave it alone." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown)}` + remedy.line, "REPLACED_SURVIVOR_UNPROVEN")));
34881
35281
  }
@@ -35235,15 +35635,15 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
35235
35635
  logger.info(` Rollback: failed ${safe(op.changeType)} of ${safe(op.logicalId)} (${safe(op.resourceType)}) left nothing to revert, skipping`);
35236
35636
  break;
35237
35637
  case "skip-failed-mismatch":
35238
- logger.warn(safeMsg` Rollback: Skipping failed CREATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — it recorded ${mask(String(op.physicalId))}, which is not the resource state tracks under this id; manual attention may be required`);
35638
+ logger.warn(safeMsg` Rollback: Skipping failed CREATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — it recorded ${mask(String(displayPhysicalId(op.resourceType, op.physicalId)))}, which is not the resource state tracks under this id; manual attention may be required`);
35239
35639
  recordRollbackSkip(skipScope, op, "The failed CREATE recorded a physical id other than the one state now tracks under this logical id, so the rollback left it as it is; manual attention may be required.");
35240
35640
  break;
35241
35641
  case "skip-failed-replaced-deleted":
35242
- logger.warn(safeMsg` Rollback: Skipping failed UPDATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — its replacement deleted the old resource ${mask(String(op.physicalId))} before the new one's create failed, so there is nothing to revert` + (options.forDestroy === true ? "; the destroy drops its record with the stack" : "; state still records it, and a deploy whose template still replaces it creates it again"));
35642
+ logger.warn(safeMsg` Rollback: Skipping failed UPDATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — its replacement deleted the old resource ${mask(String(displayPhysicalId(op.previousState?.resourceType ?? op.resourceType, op.physicalId)))} before the new one's create failed, so there is nothing to revert` + (options.forDestroy === true ? "; the destroy drops its record with the stack" : "; state still records it, and a deploy whose template still replaces it creates it again"));
35243
35643
  recordRollbackSkip(skipScope, op, "The failed UPDATE was a replacement that deleted the old resource before its create failed, so there is nothing to revert it onto; state still records the deleted resource.");
35244
35644
  break;
35245
35645
  case "skip-failed-superseded":
35246
- logger.warn(safeMsg` Rollback: Skipping failed CREATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — it created ${mask(String(op.physicalId))} before failing, and a later deploy or rollback may own a resource under that id now; if it is not in use, delete it manually`);
35646
+ logger.warn(safeMsg` Rollback: Skipping failed CREATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — it created ${mask(String(displayPhysicalId(op.resourceType, op.physicalId)))} before failing, and a later deploy or rollback may own a resource under that id now; if it is not in use, delete it manually`);
35247
35647
  recordRollbackSkip(skipScope, op, "The failed CREATE created its resource before failing, but a later deploy or rollback may own a resource under that id now, so the rollback left it as it is; manual attention may be required.");
35248
35648
  break;
35249
35649
  case "skip-failed-unknown":
@@ -35323,11 +35723,11 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
35323
35723
  });
35324
35724
  break;
35325
35725
  }
35326
- if (verdict !== void 0 && "retry" in verdict) throw new Error(`${String(op.physicalId)} is not deleted: ${verdict.retry}. The journal keeps it for a re-run; ${proseQuoted(cdkdRemedy("cdkd rollback", "--drop-failed"), "`")} removes only that record and leaves the resource in AWS`);
35726
+ if (verdict !== void 0 && "retry" in verdict) throw new Error(`${String(displayPhysicalId(op.resourceType, op.physicalId))} is not deleted: ${verdict.retry}. The journal keeps it for a re-run; ${proseQuoted(cdkdRemedy("cdkd rollback", "--drop-failed"), "`")} removes only that record and leaves the resource in AWS`);
35327
35727
  if (verdict !== void 0) {
35328
35728
  const keep = verdict.keep;
35329
35729
  const finish = verdict.finish ?? "if it is not in use, delete it by hand";
35330
- logger.warn(safeMsg` Rollback: Skipping failed CREATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — it created ${mask(String(op.physicalId))} before failing, but ${keep}. It is left in AWS: ${finish}`);
35730
+ logger.warn(safeMsg` Rollback: Skipping failed CREATE of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) — it created ${mask(String(displayPhysicalId(op.resourceType, op.physicalId)))} before failing, but ${keep}. It is left in AWS: ${finish}`);
35331
35731
  recordRollbackSkip(skipScope, op, `The failed CREATE created its resource before failing, but ${keep}, so it is left in AWS; ${finish}.`);
35332
35732
  break;
35333
35733
  }
@@ -35350,6 +35750,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
35350
35750
  secrets
35351
35751
  }, () => provider.delete(op.logicalId, op.physicalId, op.resourceType, op.attemptedProperties, {
35352
35752
  expectedRegion: ctx.region,
35753
+ stackHoldersStillAttached: true,
35353
35754
  ...removeProtection && { removeProtection: true },
35354
35755
  ...failedCreateClaimed && { inlinePolicyClaimed: failedCreateClaimed },
35355
35756
  ...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
@@ -35561,10 +35962,10 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
35561
35962
 
35562
35963
  // src/deployment/rollback-executor.ts
35563
35964
  async function replayRollback(...args) {
35564
- return await withProducerRegions(() => replayProducerRegionEvidence(args[3]), () => withStackRecords(replayStackRecordsView(args[1], args[4]?.orphanLogicalIds), () => replayRollbackUnbound(...args)));
35965
+ return await withProducerRegions(() => replayProducerRegionEvidence(args[3]), () => withStackRecords(replayStackRecordsView(args[1], args[4]?.orphanLogicalIds, args[4]?.failedOperations), () => replayRollbackUnbound(...args)));
35565
35966
  }
35566
35967
  async function replayFailedOperations(...args) {
35567
- return await withProducerRegions(() => replayProducerRegionEvidence(args[3]), () => withStackRecords(replayStackRecordsView(args[1]), async () => {
35968
+ return await withProducerRegions(() => replayProducerRegionEvidence(args[3]), () => withStackRecords(replayStackRecordsView(args[1], void 0, args[0]), async () => {
35568
35969
  const [ops, stateResources, stackName, ctx, options = {}] = args;
35569
35970
  if (options.movedIdCleanups !== void 0) {
35570
35971
  const result = await replayFailedOperationsUnbound(...args);
@@ -37469,6 +37870,14 @@ function splitLocation(location) {
37469
37870
  }
37470
37871
 
37471
37872
  // src/analyzer/refactor-hints.ts
37873
+ function referencesAgree(create, record, sameStack, isNew) {
37874
+ if ((create.createdReferences ?? []).some(isNew)) return false;
37875
+ const staying = create.stayingReferences ?? [];
37876
+ if (staying.length === 0) return true;
37877
+ if (!sameStack) return false;
37878
+ if (record.recordedDependencies === void 0) return true;
37879
+ return staying.every((id) => record.recordedDependencies.includes(id));
37880
+ }
37472
37881
  function findRefactorHints(stacks) {
37473
37882
  const hints = /* @__PURE__ */ new Map();
37474
37883
  for (const env of new Set(stacks.map((s) => s.env))) {
@@ -37482,17 +37891,34 @@ function findRefactorHints(stacks) {
37482
37891
  row
37483
37892
  })));
37484
37893
  if (deletes.length === 0 || creates.length === 0) continue;
37485
- const matchesOf = /* @__PURE__ */ new Map();
37486
- const claims = /* @__PURE__ */ new Map();
37487
- for (const c of creates) {
37488
- const matches = deletes.filter((d) => d.row.resourceType === c.row.resourceType && looselyEqual(c.row.properties, d.row.properties));
37489
- matchesOf.set(c, matches);
37490
- for (const d of matches) claims.set(d, (claims.get(d) ?? 0) + 1);
37491
- }
37492
- for (const c of creates) {
37493
- const matches = matchesOf.get(c) ?? [];
37494
- if (matches.length !== 1 || claims.get(matches[0]) !== 1) continue;
37495
- const d = matches[0];
37894
+ const pairUp = (isNewIn) => {
37895
+ const matchesOf = /* @__PURE__ */ new Map();
37896
+ const claims = /* @__PURE__ */ new Map();
37897
+ for (const c of creates) {
37898
+ const matches = deletes.filter((d) => d.row.resourceType === c.row.resourceType && looselyEqual(c.row.properties, d.row.properties) && referencesAgree(c.row, d.row, c.stack === d.stack, (id) => isNewIn(c, id)));
37899
+ matchesOf.set(c, matches);
37900
+ for (const d of matches) claims.set(d, (claims.get(d) ?? 0) + 1);
37901
+ }
37902
+ const pairs = /* @__PURE__ */ new Map();
37903
+ for (const c of creates) {
37904
+ const matches = matchesOf.get(c) ?? [];
37905
+ if (matches.length === 1 && claims.get(matches[0]) === 1) pairs.set(c, matches[0]);
37906
+ }
37907
+ return pairs;
37908
+ };
37909
+ const isNew = /* @__PURE__ */ new Set();
37910
+ const referencesNew = (c, logicalId) => {
37911
+ const referenced = creates.find((other) => other.stack === c.stack && other.row.logicalId === logicalId);
37912
+ return referenced === void 0 || isNew.has(referenced);
37913
+ };
37914
+ let pairs = pairUp(referencesNew);
37915
+ for (;;) {
37916
+ const grown = creates.filter((c) => !pairs.has(c) && !isNew.has(c));
37917
+ if (grown.length === 0) break;
37918
+ for (const c of grown) isNew.add(c);
37919
+ pairs = pairUp(referencesNew);
37920
+ }
37921
+ for (const [c, d] of pairs) {
37496
37922
  let byId = hints.get(d.stack.id);
37497
37923
  if (byId === void 0) {
37498
37924
  byId = /* @__PURE__ */ new Map();
@@ -37509,26 +37935,38 @@ function findRefactorHints(stacks) {
37509
37935
  function rollbackOrphanIds(orphans) {
37510
37936
  return new Set((Array.isArray(orphans) ? orphans : []).map((o) => o !== null && typeof o === "object" ? o.logicalId : void 0).filter((id) => typeof id === "string"));
37511
37937
  }
37512
- function hintSidesOf(changes, template, exclude = /* @__PURE__ */ new Set()) {
37938
+ function hintSidesOf(changes, template, exclude = /* @__PURE__ */ new Set(), records) {
37513
37939
  const rows = [...changes];
37514
37940
  const deletedTypes = new Set(rows.filter((c) => c.changeType === "DELETE").map((c) => c.resourceType));
37515
37941
  const updated = new Set(rows.filter((c) => c.changeType === "UPDATE" || c.changeType === "CREATE" && !deletedTypes.has(c.resourceType)).map((c) => c.logicalId));
37942
+ const deleted = new Set(rows.filter((c) => c.changeType === "DELETE").map((c) => c.logicalId));
37943
+ const staying = /* @__PURE__ */ new Set([...rows.filter((c) => c.changeType === "UPDATE" || c.changeType === "NO_CHANGE").map((c) => c.logicalId), ...Object.keys(records ?? {}).filter((id) => !deleted.has(id))]);
37944
+ const created = new Set(rows.filter((c) => c.changeType === "CREATE").map((c) => c.logicalId));
37516
37945
  const creates = [];
37517
37946
  const deletes = [];
37518
37947
  for (const change of rows) {
37519
37948
  if (exclude.has(change.logicalId)) continue;
37520
37949
  if (change.changeType === "CREATE") {
37521
37950
  if (changedDependencyOf(template, change.logicalId, (id) => updated.has(id)) !== void 0) continue;
37951
+ const references = [...referencedLogicalIds(template, change.logicalId)];
37952
+ const stayingReferences = references.filter((id) => staying.has(id));
37953
+ const createdReferences = references.filter((id) => created.has(id));
37522
37954
  creates.push({
37523
37955
  logicalId: change.logicalId,
37524
37956
  resourceType: change.resourceType,
37525
- properties: change.desiredProperties ?? {}
37957
+ properties: change.desiredProperties ?? {},
37958
+ ...stayingReferences.length > 0 && { stayingReferences },
37959
+ ...createdReferences.length > 0 && { createdReferences }
37526
37960
  });
37527
- } else if (change.changeType === "DELETE") deletes.push({
37528
- logicalId: change.logicalId,
37529
- resourceType: change.resourceType,
37530
- properties: change.currentProperties ?? {}
37531
- });
37961
+ } else if (change.changeType === "DELETE") {
37962
+ const dependencies = (records && Object.hasOwn(records, change.logicalId) ? records[change.logicalId] : void 0)?.dependencies;
37963
+ deletes.push({
37964
+ logicalId: change.logicalId,
37965
+ resourceType: change.resourceType,
37966
+ properties: change.currentProperties ?? {},
37967
+ ...Array.isArray(dependencies) && { recordedDependencies: dependencies.filter((id) => typeof id === "string") }
37968
+ });
37969
+ }
37532
37970
  }
37533
37971
  return {
37534
37972
  creates,
@@ -37561,12 +37999,14 @@ function findDestructiveChanges(stackName, changes, records, template, recreateT
37561
37999
  if (impact === void 0) continue;
37562
38000
  const recorded = typeof record?.constructPath === "string" ? record.constructPath : void 0;
37563
38001
  const constructPath = constructPathOf(template, change.logicalId) ?? recorded;
38002
+ const earlyDelete = impact === "WILL_REPLACE" ? plannedEarlyDelete(change, resourceType, template, recreateTargets) : void 0;
37564
38003
  found.push({
37565
38004
  stackName,
37566
38005
  logicalId: change.logicalId,
37567
38006
  resourceType,
37568
38007
  ...constructPath !== void 0 && { constructPath },
37569
- impact
38008
+ impact,
38009
+ ...earlyDelete !== void 0 && { earlyDelete }
37570
38010
  });
37571
38011
  }
37572
38012
  return found;
@@ -37589,6 +38029,16 @@ function destructiveImpactOf(change, record) {
37589
38029
  default: return;
37590
38030
  }
37591
38031
  }
38032
+ function plannedEarlyDelete(change, oldType, template, recreateTargets) {
38033
+ if (isInlinePolicyType(oldType)) return void 0;
38034
+ if (change.changeType !== "UPDATE") return void 0;
38035
+ if (recreateTargets.has(change.logicalId)) {
38036
+ const resources = template?.Resources;
38037
+ return (resources !== void 0 && Object.hasOwn(resources, change.logicalId) ? resources[change.logicalId]?.UpdateReplacePolicy : void 0) === "Retain" ? void 0 : "recreate";
38038
+ }
38039
+ if (change.providerReplacement === void 0 || oldType !== change.resourceType) return void 0;
38040
+ return providerReplacementOldDeleted(change.resourceType);
38041
+ }
37592
38042
  function constructPathOf(template, logicalId) {
37593
38043
  const resources = template?.Resources;
37594
38044
  if (resources === void 0 || !Object.hasOwn(resources, logicalId)) return void 0;
@@ -37605,7 +38055,7 @@ function describeDestructiveImpact(impact) {
37605
38055
  }
37606
38056
  function formatDestructiveChange(change) {
37607
38057
  const path = change.constructPath !== void 0 ? `${displaySafe(displayPath(change.constructPath))} ` : "";
37608
- return `${displayIdent(change.stackName)}: ${displaySafe(change.resourceType)} ${path}${displayIdent(change.logicalId)} ${describeDestructiveImpact(change.impact)}` + (change.movedTo !== void 0 ? movedToHint(change.movedTo) : "");
38058
+ return `${displayIdent(change.stackName)}: ${displaySafe(change.resourceType)} ${path}${displayIdent(change.logicalId)} ${describeDestructiveImpact(change.impact)}` + (change.earlyDelete !== void 0 ? ` — ${plannedEarlyDeleteNote(change.earlyDelete)}` : "") + (change.movedTo !== void 0 ? movedToHint(change.movedTo) : "");
37609
38059
  }
37610
38060
  function displayPath(constructPath) {
37611
38061
  let parts = constructPath.replace(/^\//, "").split("/");
@@ -38425,7 +38875,7 @@ async function planOrphanAdoption(params) {
38425
38875
  if (params.managedLogicalIds.has(record.logicalId)) continue;
38426
38876
  outcome.remaining.push(record);
38427
38877
  if ((params.template.Resources?.[record.logicalId])?.Type !== record.state.resourceType) continue;
38428
- outcome.warnings.push(`${displayIdent(record.logicalId)} (${displayIdent(record.state.resourceType)}) was left in AWS by an earlier rollback as ${displaySafe(record.state.physicalId)} (DeletionPolicy: Retain). This deploy does not take it back: it creates a new resource under a new name, as CloudFormation does. To manage the kept resource again, adopt it with: ${cdkdRemedy("cdkd import")}`);
38878
+ outcome.warnings.push(`${displayIdent(record.logicalId)} (${displayIdent(record.state.resourceType)}) was left in AWS by an earlier rollback as ${displaySafe(displayPhysicalId(record.state.resourceType, record.state.physicalId))} (DeletionPolicy: Retain). This deploy does not take it back: it creates a new resource under a new name, as CloudFormation does. To manage the kept resource again, adopt it with: ${cdkdRemedy("cdkd import")}`);
38429
38879
  }
38430
38880
  return outcome;
38431
38881
  }
@@ -38435,7 +38885,7 @@ async function planOrphanAdoption(params) {
38435
38885
  const { logicalId, state } = record;
38436
38886
  const shownId = displayIdent(logicalId);
38437
38887
  const shownType = displayIdent(state.resourceType);
38438
- const shownPhysicalId = displaySafe(state.physicalId);
38888
+ const shownPhysicalId = displaySafe(displayPhysicalId(state.resourceType, state.physicalId));
38439
38889
  if (params.managedLogicalIds.has(logicalId)) {
38440
38890
  params.logger.debug(`orphan ${shownId}: already present in state.resources — dropping the stale record`);
38441
38891
  continue;
@@ -38470,7 +38920,7 @@ async function planOrphanAdoption(params) {
38470
38920
  }
38471
38921
  if (found !== null && found.physicalId !== state.physicalId) {
38472
38922
  outcome.remaining.push(record);
38473
- outcome.notices.push(`${shownId} (${shownType}): cdkd asked about ${shownPhysicalId} and its provider answered for ${displaySafe(found.physicalId)} — not adopting.`);
38923
+ outcome.notices.push(`${shownId} (${shownType}): cdkd asked about ${shownPhysicalId} and its provider answered for ${displaySafe(displayPhysicalId(state.resourceType, found.physicalId))} — not adopting.`);
38474
38924
  continue;
38475
38925
  }
38476
38926
  if (found === null) {
@@ -38653,7 +39103,7 @@ async function adoptRollbackOrphans(deps, currentState, effectiveTemplate) {
38653
39103
  for (const [logicalId, record] of Object.entries(plan.adopted)) {
38654
39104
  adoptedFrom.set(logicalId, records.findLast((r) => r.logicalId === logicalId)?.state);
38655
39105
  currentState.resources[logicalId] = record;
38656
- deps.logger.info(safeMsg`Adopting ${displayIdent(logicalId)} (${displayIdent(record.resourceType)}) left in AWS ` + safeMsg`by an earlier rollback as ${displaySafe(maskSecretsInText(record.physicalId, named))}`);
39106
+ deps.logger.info(safeMsg`Adopting ${displayIdent(logicalId)} (${displayIdent(record.resourceType)}) left in AWS ` + safeMsg`by an earlier rollback as ${displaySafe(maskSecretsInText(String(displayPhysicalId(record.resourceType, record.physicalId)), named))}`);
38657
39107
  }
38658
39108
  if (records.length > 0) currentState.orphans = plan.remaining;
38659
39109
  return plan;
@@ -39282,7 +39732,7 @@ function nestedPendingSnapshot(state, refusesExportName) {
39282
39732
  }
39283
39733
  };
39284
39734
  }
39285
- function displacedPhysicalIdShown(op, logger, physicalId = journalOpPhysicalId(op)) {
39735
+ function displacedPhysicalIdShown(op, logger, physicalId = journalOpPhysicalId(op), idType = op.resourceType) {
39286
39736
  if (physicalId === void 0) return void 0;
39287
39737
  const masker = createOpMasker(logger, /* @__PURE__ */ new Map());
39288
39738
  for (const properties of [
@@ -39298,12 +39748,12 @@ function displacedPhysicalIdShown(op, logger, physicalId = journalOpPhysicalId(o
39298
39748
  physicalIds: [physicalId]
39299
39749
  });
39300
39750
  }
39301
- return displaySafe(String(masker.mask(physicalId)));
39751
+ return displaySafe(String(masker.mask(String(displayPhysicalId(idType, physicalId)))));
39302
39752
  }
39303
39753
  function displacedOpClause(op, marks, logger) {
39304
39754
  const retainedOld = retainedOldPhysicalId(op);
39305
39755
  if (retainedOld !== void 0 && marks.some((m) => isMarkFor(m, op))) {
39306
- const shownOld = displacedPhysicalIdShown(op, logger, retainedOld);
39756
+ const shownOld = displacedPhysicalIdShown(op, logger, retainedOld, op.previousState?.resourceType ?? op.resourceType);
39307
39757
  return `replaced ${shownOld} ${op.oldResourceRetained === true ? "but kept it (UpdateReplacePolicy: Retain)" : op.oldResourceMaySurvive === "deferred" ? "and may have kept it (its delete waits for the deploy to succeed)" : op.oldResourceMaySurvive !== void 0 ? "and may have kept it (its delete was not confirmed)" : "and may have kept it (the journal records no verdict)"}; cdkd import adopted the replacement, so ${shownOld} is left untracked`;
39308
39758
  }
39309
39759
  const shownId = displacedPhysicalIdShown(op, logger);
@@ -41416,7 +41866,7 @@ async function refuseTakenCreateName(engine, input) {
41416
41866
  if (found === null) return;
41417
41867
  const holderId = found.physicalId;
41418
41868
  const ownHolder = Object.entries(input.stateResources).find(([otherId, record]) => otherId !== logicalId && record.resourceType === resourceType && probeFoundSameId(resourceType, record.physicalId, holderId));
41419
- if (ownHolder !== void 0) return refuse(`${subject} is created with ${named}, which this stack's ${displaySafe(ownHolder[0])} (${shown(holderId)}) already holds — a construct moved or renamed keeps its explicit name under a new logical id. ` + (refusesItself ? "" : `Since ${adoptsText}, the create would hand back that resource and the removal of ${displaySafe(ownHolder[0])} would then delete it. `) + `Nothing was created. Give the new resource another name, or deploy the removal of ${displaySafe(ownHolder[0])} first. Do not delete or import that resource: it is already this stack's.`);
41869
+ if (ownHolder !== void 0) return refuse(`${subject} is created with ${named}, which this stack's ${displaySafe(ownHolder[0])} (${shown(displayPhysicalId(resourceType, holderId))}) already holds — a construct moved or renamed keeps its explicit name under a new logical id. ` + (refusesItself ? "" : `Since ${adoptsText}, the create would hand back that resource and the removal of ${displaySafe(ownHolder[0])} would then delete it. `) + `Nothing was created. Give the new resource another name, or deploy the removal of ${displaySafe(ownHolder[0])} first. Do not delete or import that resource: it is already this stack's.`);
41420
41870
  const ownCase = "if the resource is this stack's own (left by an earlier interrupted deploy, or kept by an earlier `cdkd destroy` under DeletionPolicy: Retain)";
41421
41871
  const built = input.stackName.includes("~") || resourceType === "AWS::S3::Bucket" ? void 0 : pasteableCommand("cdkd import", [{
41422
41872
  value: input.stackName,
@@ -41429,7 +41879,7 @@ async function refuseTakenCreateName(engine, input) {
41429
41879
  const adopt = built !== void 0 && maskName(built.command) === built.command ? built : void 0;
41430
41880
  const ownRemedy = input.stackName.includes("~") ? `${ownCase}, delete it and re-run.` : adopt !== void 0 ? `${ownCase}, delete it, or adopt it with ${proseQuoted(cdkdRemedy("cdkd import"), "`")} using the command below and re-run.` : `${ownCase}, delete it or adopt it with ${proseQuoted(cdkdRemedy("cdkd import"), "`")} and re-run.`;
41431
41881
  const holeNote = adopt === void 0 || adopt.withheld.length === 0 ? "" : " The command below prints a quoted hole in place of a value cdkd will not name on a command line; replace it whole, quotes included, with your stack name or '<logicalId>=<physicalId>', shell-quoted.";
41432
- return refuse(`${subject} is created with ${named}, and an existing resource (${shown(holderId)}) already holds that name. ` + (refusesItself ? `A log group's create refuses a taken name, as CloudFormation's does. ` : `Since ${adoptsText}, creating it would take that resource over and record it as this stack's, for a later \`cdkd destroy\` to delete. `) + `Nothing was created. Choose a name no other resource holds; ` + ownRemedy + holeNote + (adopt === void 0 ? "" : `
41882
+ return refuse(`${subject} is created with ${named}, and an existing resource (${shown(displayPhysicalId(resourceType, holderId))}) already holds that name. ` + (refusesItself ? `A log group's create refuses a taken name, as CloudFormation's does. ` : `Since ${adoptsText}, creating it would take that resource over and record it as this stack's, for a later \`cdkd destroy\` to delete. `) + `Nothing was created. Choose a name no other resource holds; ` + ownRemedy + holeNote + (adopt === void 0 ? "" : `
41433
41883
  CONFIRM IT IS YOURS FIRST: another stack or app may own a resource of that name, and adopting it hands that resource to this stack's \`cdkd destroy\`.\nAdopt with: ${adopt.command}`));
41434
41884
  }
41435
41885
  async function resumeAbandonedCreate(engine, args) {
@@ -41687,7 +42137,7 @@ function commandsOf(script) {
41687
42137
  return script.replace(/\\\r?\n/g, " ").split(/\r?\n|;|&&|\|\||\|/).map((c) => c.trim()).filter((c) => c.length > 0);
41688
42138
  }
41689
42139
  function parseBootstrapCall(command) {
41690
- const tokens = command.split(/\s+/).map((t) => t.replace(/^[\[("',]+|[\]),"']+$/g, "")).filter((t) => t.length > 0);
42140
+ const tokens = command.split(/\s+/).map((t) => t.replace(/^[[("',]+|[\]),"']+$/g, "")).filter((t) => t.length > 0);
41691
42141
  const at = tokens.findIndex((t) => /(?:^|[/\\])cfn-(?:init|signal)(?:\.exe)?$/i.test(t));
41692
42142
  if (at !== -1) {
41693
42143
  const kind = /init(?:\.exe)?$/i.test(tokens[at]) ? "init" : "signal";
@@ -42664,7 +43114,7 @@ Drop the record with: ${dropCommand}`);
42664
43114
  hole: nested ? "child-stack" : "stack",
42665
43115
  opts: { plainIdent: true }
42666
43116
  };
42667
- deps.logger.warn(safeMsg`${deleteSkippedMessage(logicalId, currentResource.physicalId, deleteSkipped, "while removing it from the template")}` + ". Its cdkd state record was KEPT, so the next 'cdkd deploy' re-attempts the delete. Repair the record first (for a nested stack it is the CHILD's own state, whose other resources may already be gone), or delete the resource by hand and drop the record." + (interrupted ? ` The commands name the child stack record. Its destroy was interrupted: re-run ` + safeMsg`${proseQuoted(cdkdRemedy("cdkd deploy"))} to resume it, and drop the child record only if that cannot finish, ` + "after deleting by hand what the child still holds (the inspect command with --show-nested lists every level; a child with nested stacks of its own has records under '<child>~<logicalId>' too, each needing the same drop)." : nested ? " The commands name the child stack record. Dropping it drops every record the child still has and nothing reaches those resources again, so first delete by hand what the child still holds (the inspect command with --show-nested lists every level; a child with nested stacks of its own has records under '<child>~<logicalId>' too, each needing the same drop). The next 'cdkd deploy' then removes this row." : " Keep '--resource' on the drop: without it the command drops the record of every resource in this still-deployed stack.") + (accountClause === "" ? "" : safeMsg` ${accountClause}`) + safeMsg`\nInspect it with: ${pasteableCommand("cdkd state show", [
43117
+ deps.logger.warn(safeMsg`${deleteSkippedMessage(logicalId, displayPhysicalId(currentResource.resourceType, currentResource.physicalId), deleteSkipped, "while removing it from the template")}` + ". Its cdkd state record was KEPT, so the next 'cdkd deploy' re-attempts the delete. Repair the record first (for a nested stack it is the CHILD's own state, whose other resources may already be gone), or delete the resource by hand and drop the record." + (interrupted ? ` The commands name the child stack record. Its destroy was interrupted: re-run ` + safeMsg`${proseQuoted(cdkdRemedy("cdkd deploy"))} to resume it, and drop the child record only if that cannot finish, ` + "after deleting by hand what the child still holds (the inspect command with --show-nested lists every level; a child with nested stacks of its own has records under '<child>~<logicalId>' too, each needing the same drop)." : nested ? " The commands name the child stack record. Dropping it drops every record the child still has and nothing reaches those resources again, so first delete by hand what the child still holds (the inspect command with --show-nested lists every level; a child with nested stacks of its own has records under '<child>~<logicalId>' too, each needing the same drop). The next 'cdkd deploy' then removes this row." : " Keep '--resource' on the drop: without it the command drops the record of every resource in this still-deployed stack.") + (accountClause === "" ? "" : safeMsg` ${accountClause}`) + safeMsg`\nInspect it with: ${pasteableCommand("cdkd state show", [
42668
43118
  stackArg,
42669
43119
  {
42670
43120
  flag: "--stack-region",
@@ -42747,7 +43197,7 @@ async function retryCarriedSupersededResources(engine, host, carried, resources,
42747
43197
  live: () => Object.entries(resources),
42748
43198
  survivors: () => Object.entries(resources)
42749
43199
  };
42750
- for (const entry of carried) {
43200
+ for (const entry of supersededDependentsFirst(carried)) {
42751
43201
  if (engine.interrupted) break;
42752
43202
  const { logicalId } = entry;
42753
43203
  const { physicalId, resourceType } = entry.state;
@@ -42760,11 +43210,11 @@ async function retryCarriedSupersededResources(engine, host, carried, resources,
42760
43210
  withPrintingSecrets(bag, () => engine.logger.warn(safeMsg` ⚠ ${supersededHeldByOtherTypeWarning(entry, holder.resourceType)}`));
42761
43211
  continue;
42762
43212
  }
42763
- withPrintingSecrets(bag, () => engine.logger.debug(safeMsg`Superseded ${logicalId} (${physicalId}) is held by a record again; not deleting it`));
43213
+ withPrintingSecrets(bag, () => engine.logger.debug(safeMsg`Superseded ${logicalId} (${displayPhysicalId(resourceType, physicalId)}) is held by a record again; not deleting it`));
42764
43214
  continue;
42765
43215
  }
42766
43216
  await withPrintingSecrets(bag, () => withStackRecords(view, async () => {
42767
- engine.logger.info(safeMsg` Deleting old ${logicalId} (${physicalId}), superseded by an earlier deploy...`);
43217
+ engine.logger.info(safeMsg` Deleting old ${logicalId} (${displayPhysicalId(resourceType, physicalId)}), superseded by an earlier deploy...`);
42768
43218
  let outcome;
42769
43219
  try {
42770
43220
  const route = engine.providerRegistry.getProviderFor({
@@ -42778,7 +43228,7 @@ async function retryCarriedSupersededResources(engine, host, carried, resources,
42778
43228
  stop: () => engine.interrupted,
42779
43229
  once: options.waitInUse !== true,
42780
43230
  holderProvider: () => engine.providerRegistry.getProvider(resourceType),
42781
- warn: (message) => engine.logger.warn(safeMsg` ⚠ Old ${logicalId} (${physicalId}): ${message}`),
43231
+ warn: (message) => engine.logger.warn(safeMsg` ⚠ Old ${logicalId} (${displayPhysicalId(resourceType, physicalId)}): ${message}`),
42782
43232
  preDeleteSnapshot: {
42783
43233
  clients: engine.options.finalSnapshotClients ?? getAwsClients(),
42784
43234
  logger: {
@@ -42799,24 +43249,24 @@ async function retryCarriedSupersededResources(engine, host, carried, resources,
42799
43249
  changed = true;
42800
43250
  }
42801
43251
  const detail = maskSecretsInText(describeAwsFailure(outcome.error).detail, bag);
42802
- engine.logger.warn(safeMsg` ⚠ Failed to delete old resource ${logicalId} (${physicalId}): ${detail}. ${SUPERSEDED_KEPT_REMEDY}.`);
43252
+ engine.logger.warn(safeMsg` ⚠ Failed to delete old resource ${logicalId} (${displayPhysicalId(resourceType, physicalId)}): ${detail}. ${SUPERSEDED_KEPT_REMEDY}.`);
42803
43253
  return;
42804
43254
  }
42805
43255
  removeSuperseded(host, entry);
42806
43256
  changed = true;
42807
43257
  if (outcome.kind === "gone") {
42808
- engine.logger.info(safeMsg` ${green("✓")} Old ${logicalId} (${physicalId}) is already gone; no delete was sent`);
43258
+ engine.logger.info(safeMsg` ${green("✓")} Old ${logicalId} (${displayPhysicalId(resourceType, physicalId)}) is already gone; no delete was sent`);
42809
43259
  return;
42810
43260
  }
42811
43261
  if (outcome.kind === "notOurs") {
42812
- engine.logger.warn(safeMsg` ⚠ Old ${logicalId} (${physicalId}) was not deleted: ${outcome.cause}. The replaced resource is gone, and cdkd no longer tracks it in state.`);
43262
+ engine.logger.warn(safeMsg` ⚠ Old ${logicalId} (${displayPhysicalId(resourceType, physicalId)}) was not deleted: ${outcome.cause}. The replaced resource is gone, and cdkd no longer tracks it in state.`);
42813
43263
  return;
42814
43264
  }
42815
43265
  if (outcome.kind === "notDeleted") {
42816
- engine.logger.warn(safeMsg` ⚠ ${deleteSkippedMessage(logicalId, physicalId, outcome.reason, "while cleaning up the superseded resource", { commandFreeLine: true })}. Delete it manually — it is no longer tracked in state.`);
43266
+ engine.logger.warn(safeMsg` ⚠ ${deleteSkippedMessage(logicalId, displayPhysicalId(resourceType, physicalId), outcome.reason, "while cleaning up the superseded resource", { commandFreeLine: true })}. Delete it manually — it is no longer tracked in state.`);
42817
43267
  return;
42818
43268
  }
42819
- engine.logger.info(safeMsg` ${green("✓")} Old ${logicalId} (${physicalId}) deleted`);
43269
+ engine.logger.info(safeMsg` ${green("✓")} Old ${logicalId} (${displayPhysicalId(resourceType, physicalId)}) deleted`);
42820
43270
  }));
42821
43271
  }
42822
43272
  return changed;
@@ -42894,7 +43344,7 @@ async function runQueuedNestedCleanup(engine, stackName, host, pass, context) {
42894
43344
  engine.logger.debug(safeMsg`Old ${logicalId} of nested stack ${display} is no longer awaiting its delete; not deleting it`);
42895
43345
  } else if (recorded === void 0 && Object.values(read.state.resources).some((record) => typeof record === "object" && record !== null && record.physicalId === entry.physicalId && record.resourceType === entry.resourceType)) {
42896
43346
  run.deferredReplacedDeletes?.delete(logicalId);
42897
- engine.logger.warn(safeMsg` ⚠ Old ${logicalId} of nested stack ${display} (${entry.physicalId}) was not deleted: a record of that stack names its physical id again, and cdkd never deletes an id a record names`);
43347
+ engine.logger.warn(safeMsg` ⚠ Old ${logicalId} of nested stack ${display} (${displayPhysicalId(entry.resourceType, entry.physicalId)}) was not deleted: a record of that stack names its physical id again, and cdkd never deletes an id a record names`);
42898
43348
  }
42899
43349
  }
42900
43350
  const before = supersededResourcesOf(host);
@@ -42955,7 +43405,7 @@ async function persistDropped(engine, stackName, fresh, dropped, replaced = [])
42955
43405
  }
42956
43406
  const again = attempt < 4 && isEtagConflict(failure) ? await engine.stateBackend.getState(stackName, region).catch(() => null) : null;
42957
43407
  if (again === null || again === void 0) {
42958
- const ids = dropped.map((entry) => `${entry.logicalId} (${entry.state.physicalId})`).join(", ");
43408
+ const ids = dropped.map((entry) => `${entry.logicalId} (${displayPhysicalId(entry.state.resourceType, entry.state.physicalId)})`).join(", ");
42959
43409
  engine.logger.warn(safeMsg` ⚠ Could not record in the state of nested stack ${displayStackName(stackName)} (region ${region}) that these replaced resources were deleted: ${ids}: ${asIsMessage(describeAwsFailure(failure).summary)}. They stay listed there, and its next deploy sends their deletes again`);
42960
43410
  return dropped.length;
42961
43411
  }
@@ -43261,7 +43711,7 @@ function planContributorInsightsOp(desired, previous, onUnusable) {
43261
43711
  onUnusable(desired.reason);
43262
43712
  return;
43263
43713
  }
43264
- if (desired.kind === "absent") return previous.kind === "absent" ? void 0 : { action: "DISABLE" };
43714
+ if (desired.kind === "absent") return previous.kind === "absent" || previous.kind === "usable" && !previous.enabled ? void 0 : { action: "DISABLE" };
43265
43715
  if (previous.kind === "usable" && previous.enabled === desired.enabled && (!desired.enabled || previous.mode === desired.mode)) return;
43266
43716
  if (!desired.enabled) return { action: "DISABLE" };
43267
43717
  return desired.mode === void 0 ? { action: "ENABLE" } : {
@@ -43319,12 +43769,25 @@ function enabledForStatus(status, transientAsTarget) {
43319
43769
  if (status === "DISABLED" || transientAsTarget && status === "DISABLING") return false;
43320
43770
  }
43321
43771
  function reverseMapTableContributorInsights(status, mode) {
43322
- const enabled = enabledForStatus(status, false);
43772
+ const enabled = enabledForStatus(status, true);
43323
43773
  if (enabled === void 0) return void 0;
43324
43774
  const block = { Enabled: enabled };
43325
43775
  if (enabled && mode !== void 0) block["Mode"] = mode;
43326
43776
  return block;
43327
43777
  }
43778
+ function completeTableContributorInsightsBaseline(baseline, aws, properties) {
43779
+ if (hasOwnKey(baseline, "ContributorInsightsSpecification")) return void 0;
43780
+ const live = aws[CONTRIBUTOR_INSIGHTS_KEY];
43781
+ if (typeof live !== "object" || live === null || Array.isArray(live)) return void 0;
43782
+ const declared = readContributorInsightsSpec(properties[CONTRIBUTOR_INSIGHTS_KEY], CONTRIBUTOR_INSIGHTS_KEY);
43783
+ if (declared.kind !== "usable") return void 0;
43784
+ const block = { Enabled: declared.enabled };
43785
+ if (!declared.enabled) return block;
43786
+ const liveBlock = live;
43787
+ const mode = declared.mode ?? (liveBlock["Enabled"] === true && typeof liveBlock["Mode"] === "string" ? liveBlock["Mode"] : void 0);
43788
+ if (mode !== void 0) block["Mode"] = mode;
43789
+ return block;
43790
+ }
43328
43791
  function reverseMapIndexContributorInsights(status, mode, declaredBlock) {
43329
43792
  const declared = readContributorInsightsSpec(declaredBlock, INDEX_CONTRIBUTOR_INSIGHTS_PATH);
43330
43793
  if (declared.kind !== "usable") return void 0;
@@ -48216,14 +48679,14 @@ function canonicalJson$1(value) {
48216
48679
  }
48217
48680
 
48218
48681
  // src/provisioning/providers/dynamodb-globaltable/read-support.ts
48219
- async function readReplicaSubSpecs(client, tableName, regionLabel, declaredReplica) {
48682
+ async function readReplicaSubSpecs(client, tableName, regionLabel, declaredReplica, served) {
48220
48683
  const out = {};
48221
48684
  try {
48222
48685
  const ci = await client.send(new DescribeContributorInsightsCommand({ TableName: tableName }));
48223
48686
  const block = reverseMapReplicaContributorInsights(ci.ContributorInsightsStatus, ci.ContributorInsightsMode, declaredReplica?.["ContributorInsightsSpecification"]);
48224
48687
  if (block !== void 0) out["ContributorInsightsSpecification"] = block;
48225
48688
  } catch (err) {
48226
- if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
48689
+ if ((served || strictFor("Replicas")) && !(err instanceof ResourceNotFoundException$1)) throw err;
48227
48690
  this.logger.debug(`Could not read ContributorInsights for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
48228
48691
  }
48229
48692
  try {
@@ -48231,7 +48694,7 @@ async function readReplicaSubSpecs(client, tableName, regionLabel, declaredRepli
48231
48694
  const block = reverseMapReplicaPitr(description?.PointInTimeRecoveryStatus, description?.RecoveryPeriodInDays, declaredReplica?.["PointInTimeRecoverySpecification"]);
48232
48695
  if (block !== void 0) out["PointInTimeRecoverySpecification"] = block;
48233
48696
  } catch (err) {
48234
- if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
48697
+ if ((served || strictFor("Replicas")) && !(err instanceof ResourceNotFoundException$1) && !(err instanceof TableNotFoundException)) throw err;
48235
48698
  this.logger.debug(`Could not read PointInTimeRecovery for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
48236
48699
  }
48237
48700
  try {
@@ -48242,12 +48705,12 @@ async function readReplicaSubSpecs(client, tableName, regionLabel, declaredRepli
48242
48705
  out["KinesisStreamSpecification"] = ksOut;
48243
48706
  }
48244
48707
  } catch (err) {
48245
- if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
48708
+ if ((served || strictFor("Replicas")) && !(err instanceof ResourceNotFoundException$1)) throw err;
48246
48709
  this.logger.debug(`Could not read KinesisStreamingDestination for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
48247
48710
  }
48248
48711
  return out;
48249
48712
  }
48250
- async function readReplicaPolicies(client, tableName, regionLabel, tableArn, streamArn, declaredReplica, afterOwnWrite, entry) {
48713
+ async function readReplicaPolicies(client, tableName, regionLabel, tableArn, streamArn, declaredReplica, afterOwnWrite, entry, served) {
48251
48714
  if (declaredReplica === void 0) return;
48252
48715
  const readOne = async (what, arn, container) => {
48253
48716
  if (arn === void 0 || arn === "") return void 0;
@@ -48278,6 +48741,7 @@ async function readReplicaPolicies(client, tableName, regionLabel, tableArn, str
48278
48741
  if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
48279
48742
  this.logger.debug(safeMsg`Could not read the ${what} of the ${regionLabel} replica of ${tableName}: ${describeAwsFailure(err).detail}`);
48280
48743
  if (afterOwnWrite && (last !== void 0 && last !== "" || isThrottlingError(err) || isTransientServerError(err) || isAmbiguousOutcomeError(err) || err instanceof ResourceNotFoundException$1)) return declaredMember();
48744
+ if (served && !(err instanceof ResourceNotFoundException$1)) throw err;
48281
48745
  return;
48282
48746
  }
48283
48747
  };
@@ -48290,7 +48754,7 @@ async function readReplicaPolicies(client, tableName, regionLabel, tableArn, str
48290
48754
  if (member !== void 0) entry["ReplicaStreamSpecification"] = { ResourcePolicy: member };
48291
48755
  }
48292
48756
  }
48293
- async function readAutoScalingSettings(tableName, scalableDimension, client, indexName) {
48757
+ async function readAutoScalingSettings(tableName, scalableDimension, client, indexName, served = true) {
48294
48758
  const resourceId = autoScalingResourceId(tableName, indexName);
48295
48759
  try {
48296
48760
  const asClient = client ?? new ApplicationAutoScalingClient({
@@ -48323,7 +48787,7 @@ async function readAutoScalingSettings(tableName, scalableDimension, client, ind
48323
48787
  TargetTrackingScalingPolicyConfiguration: tttConfig
48324
48788
  };
48325
48789
  } catch (err) {
48326
- if (strictFor(indexName !== void 0 ? "GlobalSecondaryIndexes" : scalableDimension.includes("Write") ? "WriteProvisionedThroughputSettings" : "Replicas")) throw err;
48790
+ if (served || strictFor(indexName !== void 0 ? "GlobalSecondaryIndexes" : scalableDimension.includes("Write") ? "WriteProvisionedThroughputSettings" : "Replicas")) throw err;
48327
48791
  this.logger.debug(`Could not read application-autoscaling settings for ${resourceId} (${scalableDimension}): ${describeAwsFailure(err).detail}`);
48328
48792
  return null;
48329
48793
  }
@@ -48452,6 +48916,9 @@ async function unsettledInTransition(physicalId, _logicalId, _resourceType, name
48452
48916
  return names;
48453
48917
  }
48454
48918
  }
48919
+ function replicaServed(status) {
48920
+ return status === void 0 || status === "ACTIVE" || status === "UPDATING";
48921
+ }
48455
48922
  async function readCurrentState(physicalId, logicalId, _resourceType, properties, context) {
48456
48923
  const afterOwnWrite = context?.afterOwnWrite === true;
48457
48924
  try {
@@ -48480,6 +48947,7 @@ async function readCurrentState(physicalId, logicalId, _resourceType, properties
48480
48947
  const entry = { Region: r.RegionName };
48481
48948
  if (!r.RegionName) return entry;
48482
48949
  const isLocal = r.RegionName === currentRegion;
48950
+ const served = replicaServed(r.ReplicaStatus);
48483
48951
  const kmsKey = isLocal ? table.SSEDescription?.Status === "ENABLED" ? table.SSEDescription.KMSMasterKeyArn : void 0 : r.KMSMasterKeyId;
48484
48952
  if (kmsKey !== void 0 && kmsKey !== "") entry["SSESpecification"] = { KMSMasterKeyId: kmsKey };
48485
48953
  entry["TableClass"] = (isLocal ? void 0 : r.ReplicaTableClassSummary?.TableClass) ?? table.TableClassSummary?.TableClass ?? "STANDARD";
@@ -48487,7 +48955,7 @@ async function readCurrentState(physicalId, logicalId, _resourceType, properties
48487
48955
  const client = isLocal ? this.dynamoDBClient : this.getRegionalClient(r.RegionName);
48488
48956
  const regionLabel = r.RegionName;
48489
48957
  const replicaArn = isLocal ? table.TableArn : table.TableArn ? this.replicaArnForRegion(table.TableArn, r.RegionName) : void 0;
48490
- const subs = await this.readReplicaSubSpecs(client, tableNameForSubs, regionLabel, declaredReplica);
48958
+ const subs = await this.readReplicaSubSpecs(client, tableNameForSubs, regionLabel, declaredReplica, served);
48491
48959
  Object.assign(entry, subs);
48492
48960
  let protection;
48493
48961
  let disassociationProtection;
@@ -48505,20 +48973,20 @@ async function readCurrentState(physicalId, logicalId, _resourceType, properties
48505
48973
  disassociationProtection = regional.Table?.DisassociationProtectionEnabled;
48506
48974
  streamArn = regional.Table?.LatestStreamArn;
48507
48975
  } catch (err) {
48508
- if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
48976
+ if ((served || strictFor("Replicas")) && !(err instanceof ResourceNotFoundException$1)) throw err;
48509
48977
  if (err instanceof ResourceNotFoundException$1) this.logger.debug(safeMsg`Cross-region replica ${regionLabel} returned RNF on DescribeTable; omitting its protection and stream policy`);
48510
48978
  else this.logger.debug(safeMsg`Could not read the ${regionLabel} replica of ${tableNameForSubs}: ${describeAwsFailure(err).detail}`);
48511
48979
  }
48512
48980
  if (typeof protection === "boolean") entry["DeletionProtectionEnabled"] = protection;
48513
48981
  if (typeof disassociationProtection === "boolean" && declaredReplica?.["DisassociationProtectionEnabled"] !== void 0) entry[DISASSOCIATION_PROTECTION_KEY] = disassociationProtection;
48514
- await this.readReplicaPolicies(client, tableNameForSubs, regionLabel, replicaArn, streamArn, declaredReplica, afterOwnWrite, entry);
48982
+ await this.readReplicaPolicies(client, tableNameForSubs, regionLabel, replicaArn, streamArn, declaredReplica, afterOwnWrite, entry, served);
48515
48983
  if (replicaArn) {
48516
48984
  const listTags = async () => normalizeAwsTagsToCfn((await client.send(new ListTagsOfResourceCommand({ ResourceArn: replicaArn }))).Tags);
48517
48985
  const tagsDeclared = writtenReplicaTags(afterOwnWrite, replicaArn, declaredReplica);
48518
48986
  try {
48519
48987
  entry["Tags"] = tagsDeclared === void 0 ? await listTags() : await this.settleReplicaTags(listTags, tagsDeclared, logicalId);
48520
48988
  } catch (tagErr) {
48521
- if (strictFor("Replicas") && !(tagErr instanceof ResourceNotFoundException$1)) throw tagErr;
48989
+ if ((served || strictFor("Replicas")) && !(tagErr instanceof ResourceNotFoundException$1)) throw tagErr;
48522
48990
  if (tagErr instanceof ResourceNotFoundException$1) {
48523
48991
  if (isLocal) throw tagErr;
48524
48992
  this.logger.debug(`Cross-region replica ${regionLabel} returned RNF on ListTagsOfResource; omitting Tags`);
@@ -48531,7 +48999,7 @@ async function readCurrentState(physicalId, logicalId, _resourceType, properties
48531
48999
  } else entry["Tags"] = [];
48532
49000
  if (billingMode === "PROVISIONED") {
48533
49001
  const replicaAutoScalingClient = isLocal ? void 0 : this.getRegionalAutoScalingClient(regionLabel);
48534
- const readAutoScaling = await this.readAutoScalingSettings(tableNameForSubs, "dynamodb:table:ReadCapacityUnits", replicaAutoScalingClient);
49002
+ const readAutoScaling = await this.readAutoScalingSettings(tableNameForSubs, "dynamodb:table:ReadCapacityUnits", replicaAutoScalingClient, void 0, served);
48535
49003
  if (readAutoScaling) entry["ReadProvisionedThroughputSettings"] = { ReadCapacityAutoScalingSettings: readAutoScaling };
48536
49004
  else if (strictFor("Replicas") && regionalRead !== void 0) entry["ReadProvisionedThroughputSettings"] = { ReadCapacityUnits: regionalRead };
48537
49005
  }
@@ -48607,7 +49075,7 @@ async function readCurrentState(physicalId, logicalId, _resourceType, properties
48607
49075
  };
48608
49076
  else if (ttlStatus === "DISABLED") {}
48609
49077
  } catch (ttlErr) {
48610
- if (strictFor("TimeToLiveSpecification")) throw ttlErr;
49078
+ if (strictFor("TimeToLiveSpecification") || !(ttlErr instanceof ResourceNotFoundException$1)) throw ttlErr;
48611
49079
  this.logger.debug(`Could not read TimeToLive for ${tableNameForSubs}: ${describeAwsFailure(ttlErr).detail}`);
48612
49080
  }
48613
49081
  return result;
@@ -50483,7 +50951,7 @@ async function requireDeploymentApproval(args) {
50483
50951
  id: "self",
50484
50952
  stackName: args.stackName,
50485
50953
  env: "",
50486
- ...hintSidesOf(changes, args.template, rollbackOrphanIds(args.orphans))
50954
+ ...hintSidesOf(changes, args.template, rollbackOrphanIds(args.orphans), args.records)
50487
50955
  }]).get("self")) : destructiveChanges;
50488
50956
  const count = (type) => changes.filter((c) => c.changeType === type).length;
50489
50957
  if (enclosingDeadlineExpired()) throw approvalAfterTimeout(args.stackName);
@@ -50995,9 +51463,9 @@ async function recreateDestroyThenCreate(engine, { currentResource, equalIdIsSam
50995
51463
  if (updateReplacePolicy === "Retain") {
50996
51464
  engine.replacementRun.retainedOldOnReplacement.add(logicalId);
50997
51465
  await noteRetainedResource(oldResourceType, logicalId);
50998
- engine.logger.warn(safeMsg` ⚠ ${logicalId} has UpdateReplacePolicy: Retain — ${recreateFlagName} will ` + safeMsg`leak the old physical resource (${currentResource.physicalId}). The new ` + "resource shares the same name where applicable; if the type has user-supplied names (e.g. functionName, bucketName), the create will deterministically collide with the retained orphan.");
51466
+ engine.logger.warn(safeMsg` ⚠ ${logicalId} has UpdateReplacePolicy: Retain — ${recreateFlagName} will ` + safeMsg`leak the old physical resource (${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}). The new ` + "resource shares the same name where applicable; if the type has user-supplied names (e.g. functionName, bucketName), the create will deterministically collide with the retained orphan.");
50999
51467
  } else {
51000
- engine.logger.info(safeMsg` Destroying old ${logicalId} (${currentResource.physicalId}) before recreate...`);
51468
+ engine.logger.info(safeMsg` Destroying old ${logicalId} (${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}) before recreate...`);
51001
51469
  const recreateFinalSnapshotId = await prepareFinalSnapshotForDelete(engine.replacementDeps(), logicalId, oldResourceType, currentResource, updateReplacePolicy, createUnionSecretMasker([updateSecrets, secretNameBagFor(engine.secretsRun, logicalId)]));
51002
51470
  let recreateDeleteResult;
51003
51471
  try {
@@ -51006,6 +51474,7 @@ async function recreateDestroyThenCreate(engine, { currentResource, equalIdIsSam
51006
51474
  forceDataDelete: engine.options.forceStatefulRecreation === true,
51007
51475
  ...recreateFinalSnapshotId !== void 0 && { finalSnapshotIdentifier: recreateFinalSnapshotId },
51008
51476
  ...replacementDeleteContext(engine.replacementDeps(), updateReplacePolicy),
51477
+ stackHoldersStillAttached: true,
51009
51478
  recordedAttributes: currentResource.attributes,
51010
51479
  recordedCreateOnlyDrops: currentResource.acceptedCreateOnlyDrops,
51011
51480
  recordedNoEchoLeaves: currentResource.noEchoLeaves,
@@ -51022,7 +51491,7 @@ async function recreateDestroyThenCreate(engine, { currentResource, equalIdIsSam
51022
51491
  observed: currentResource.observedProperties
51023
51492
  }) ? "Give it a new name in the template, so that the recreate creates the new resource first and deletes the old one once its dependents have moved, or remove" : `Remove`) + ` those dependents from the template, deploy, recreate it, and add them back.` : "";
51024
51493
  const deleteFailure = describeAwsFailure(deleteError);
51025
- const destroyFailureText = (text) => safeMsg`Failed to destroy old resource ${maskSecretsInText(logicalId, shownSecrets)} ` + safeMsg`(${maskSecretsInText(currentResource.physicalId, shownSecrets)}) during ${recreateFlagName}: ` + safeMsg`${asIsMessage(maskSecretsInText(text, shownSecrets))}` + dependentHint;
51494
+ const destroyFailureText = (text) => safeMsg`Failed to destroy old resource ${maskSecretsInText(logicalId, shownSecrets)} ` + safeMsg`(${maskSecretsInText(String(displayPhysicalId(currentResource.resourceType, currentResource.physicalId)), shownSecrets)}) during ${recreateFlagName}: ` + safeMsg`${asIsMessage(maskSecretsInText(text, shownSecrets))}` + dependentHint;
51026
51495
  if (deleteFailure.redacted) engine.logger.debug(destroyFailureText(deleteFailure.detail));
51027
51496
  const destroyFailure = new Error(destroyFailureText(deleteFailure.redacted ? deleteFailure.summary : deleteFailure.detail), { cause: deleteError instanceof Error ? maskSecretsInError(deleteError, updateSecrets) : void 0 });
51028
51497
  throw deleteFailure.redacted && deleteError instanceof Error ? markRedactedCause(destroyFailure) : destroyFailure;
@@ -51033,7 +51502,7 @@ async function recreateDestroyThenCreate(engine, { currentResource, equalIdIsSam
51033
51502
  provisionedBy: oldDeleteRoute.provisionedBy
51034
51503
  });
51035
51504
  const recreateSkipReason = deleteSkipReason(recreateDeleteResult);
51036
- if (recreateSkipReason !== void 0) throw new Error(deleteSkippedMessage(logicalId, currentResource.physicalId, recreateSkipReason, `during ${recreateFlagName}`));
51505
+ if (recreateSkipReason !== void 0) throw new Error(deleteSkippedMessage(logicalId, displayPhysicalId(currentResource.resourceType, currentResource.physicalId), recreateSkipReason, `during ${recreateFlagName}`));
51037
51506
  engine.logger.info(safeMsg` ${green("✓")} Old resource deleted`);
51038
51507
  engine.replacementRun.oldDeletedBeforeCreate.add(logicalId);
51039
51508
  await oldDeleteProvider.waitForNameReleased?.(logicalId, currentResource.physicalId, oldResourceType, {
@@ -51060,7 +51529,7 @@ async function recreateDestroyThenCreate(engine, { currentResource, equalIdIsSam
51060
51529
  onInterrupted: () => new InterruptedError("user"),
51061
51530
  isRetryable: isRecreateRetryableError
51062
51531
  }));
51063
- if (equalIdIsSameResource && updateReplacePolicy === "Retain" && createResult.physicalId === currentResource.physicalId) throw new CdkdError(safeMsg`${logicalId} (${resourceType}) recreate returned the existing resource ` + safeMsg`(${currentResource.physicalId}) instead of creating a new one — its Create ` + "API is name-idempotent — and UpdateReplacePolicy: Retain means the old resource was never destroyed, so the new properties were not applied. Rename the resource in your CDK code (or remove the explicit physical name) so the recreate can produce a genuinely new resource.", "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
51532
+ if (equalIdIsSameResource && updateReplacePolicy === "Retain" && createResult.physicalId === currentResource.physicalId) throw new CdkdError(safeMsg`${logicalId} (${resourceType}) recreate returned the existing resource ` + safeMsg`(${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}) instead of creating a new one — its Create ` + "API is name-idempotent — and UpdateReplacePolicy: Retain means the old resource was never destroyed, so the new properties were not applied. Rename the resource in your CDK code (or remove the explicit physical name) so the recreate can produce a genuinely new resource.", "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
51064
51533
  return createResult;
51065
51534
  }
51066
51535
 
@@ -51094,7 +51563,7 @@ async function replaceCreateFirst(engine, { currentResource, equalIdIsSameResour
51094
51563
  const createSentence = createMsg.endsWith(".") ? createMsg.slice(0, -1) : createMsg;
51095
51564
  if (!isNameCollisionErrorFrom(createError, logicalId)) throw createError;
51096
51565
  if (createFailure.redacted) engine.logger.debug(safeMsg`${maskSecretsInText(logicalId, updateSecrets)}: the create-first attempt collided: ${asIsMessage(createAwsMsg)}`);
51097
- const nameOrigin = replacementNameOrigin(logicalId, currentResource.physicalId);
51566
+ const nameOrigin = replacementNameOrigin(logicalId, currentResource.physicalId, currentResource.resourceType);
51098
51567
  const nameHeldElsewhere = replacementRequestsDifferentName({
51099
51568
  oldResourceType,
51100
51569
  newResourceType: resourceType,
@@ -51103,7 +51572,7 @@ async function replaceCreateFirst(engine, { currentResource, equalIdIsSameResour
51103
51572
  observed: currentResource.observedProperties,
51104
51573
  physicalId: currentResource.physicalId
51105
51574
  });
51106
- if (nameHeldElsewhere !== void 0) throw markNonRetryable(new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but the create-first ` + safeMsg`attempt collided: ${createSentence}. ${renderNameHeldElsewhere(nameHeldElsewhere)}` + (engine.options.replace === true ? ` — so --replace was NOT applied and nothing was deleted.` : updateReplacePolicy === "Retain" ? " — so removing UpdateReplacePolicy: Retain and re-running with `cdkd deploy --replace` would delete this resource and still collide." : " — so `cdkd deploy --replace` would delete this resource and still collide.") + " Choose a name no other resource holds, or delete the resource holding it if it is yours.", "NAMED_REPLACEMENT_COLLISION", createError instanceof Error ? createError : void 0));
51575
+ if (nameHeldElsewhere !== void 0) throw markNonRetryable(new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but the create-first ` + safeMsg`attempt collided: ${createSentence}. ${renderNameHeldElsewhere(nameHeldElsewhere, currentResource.resourceType)}` + (engine.options.replace === true ? ` — so --replace was NOT applied and nothing was deleted.` : updateReplacePolicy === "Retain" ? " — so removing UpdateReplacePolicy: Retain and re-running with `cdkd deploy --replace` would delete this resource and still collide." : " — so `cdkd deploy --replace` would delete this resource and still collide.") + " Choose a name no other resource holds, or delete the resource holding it if it is yours.", "NAMED_REPLACEMENT_COLLISION", createError instanceof Error ? createError : void 0));
51107
51576
  const holder = replacementOldHoldsSentName({
51108
51577
  createType: resourceType,
51109
51578
  holderType: oldResourceType,
@@ -51124,20 +51593,21 @@ async function replaceCreateFirst(engine, { currentResource, equalIdIsSameResour
51124
51593
  logicalId,
51125
51594
  change: nameChange,
51126
51595
  oldPhysicalId: currentResource.physicalId,
51596
+ oldResourceType: currentResource.resourceType,
51127
51597
  mask: (value) => maskSecretsInText(value, unionOfSecretBags([updateSecrets, printingSecretsFor(engine.secretsRun, logicalId)]))
51128
51598
  }) + ` Underlying collision: ${createMsg}`, updateSecrets), "NAMED_REPLACEMENT_COLLISION", createError instanceof Error ? createError : void 0));
51129
51599
  }
51130
51600
  if (updateReplacePolicy === "Retain") throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its physical name ` + `is still held by the existing resource AND UpdateReplacePolicy: Retain ` + safeMsg`pins that resource in place. ${nameOrigin.descriptor}. ` + safeMsg`${nameOrigin.remedy} — with Retain, the old resource keeps the name, so a ` + `same-name replacement can never proceed.`, "NAMED_REPLACEMENT_COLLISION");
51131
51601
  if (engine.options.replace !== true) throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but the create-first ` + safeMsg`attempt collided with the existing resource: ${createSentence}. ` + safeMsg`${nameOrigin.descriptor}, so the CloudFormation-style safe replacement ` + "order (create the new resource before deleting the old) cannot reuse the occupied name — CloudFormation refuses this shape with \"cannot update a stack when a custom-named resource requires replacing\". " + safeMsg`${nameOrigin.remedy}, or re-run with ${deployReplaceCommand()} to delete ` + "the old resource FIRST and recreate it under the same name (the resource is briefly unavailable while it is recreated).", "NAMED_REPLACEMENT_COLLISION");
51132
- engine.logger.info(` Create-first collided with the existing resource's name and --replace is ` + safeMsg`set — deleting old ${logicalId} (${currentResource.physicalId}) first...`);
51602
+ engine.logger.info(` Create-first collided with the existing resource's name and --replace is ` + safeMsg`set — deleting old ${logicalId} (${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}) first...`);
51133
51603
  deletedOldFirst = true;
51134
51604
  createResult = await replaceDeleteFirstAndRecreate(engine.replacementRun, engine.replacementDeps(), logicalId, resourceType, oldResourceType, currentResource, oldDeleteProvider, replaceProvider, replaceProps, updateSecrets, updateReplacePolicy, oldDeleteRoute.provisionedBy, noEchoDeleteValues);
51135
51605
  }
51136
51606
  if (equalIdIsSameResource && !deletedOldFirst && createResult.physicalId === currentResource.physicalId) {
51137
- const idempotentNameOrigin = replacementNameOrigin(logicalId, currentResource.physicalId);
51138
- if (updateReplacePolicy === "Retain") throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its Create API is ` + `name-idempotent: the create-first attempt returned the existing resource ` + safeMsg`(${currentResource.physicalId}) instead of creating a new one, and ` + `UpdateReplacePolicy: Retain pins that resource in place. ` + safeMsg`${idempotentNameOrigin.descriptor}. ${idempotentNameOrigin.remedy} — with ` + "Retain, the old resource keeps the name, so a same-name replacement can never proceed.", "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
51139
- if (engine.options.replace !== true) throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its Create API is ` + `name-idempotent: the create-first attempt returned the EXISTING resource ` + safeMsg`(${currentResource.physicalId}) instead of creating a new one, so deleting ` + `the "old" resource would silently destroy the resource the deploy just ` + safeMsg`reported as created. ${idempotentNameOrigin.descriptor}; ` + safeMsg`${idempotentNameOrigin.remedy}, or re-run with ` + `${deployReplaceCommand()} to delete the old resource FIRST and recreate it under the same name (the resource is briefly unavailable while it is recreated). Note: this branch is also reached when the old resource was deleted out-of-band and the physical id is name-derived — there the create was a genuine fresh create; \`--replace\` converges that case too.`, "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
51140
- engine.logger.info(` Create-first returned the existing resource (name-idempotent Create API) ` + safeMsg`and --replace is set — deleting old ${logicalId} ` + safeMsg`(${currentResource.physicalId}) first...`);
51607
+ const idempotentNameOrigin = replacementNameOrigin(logicalId, currentResource.physicalId, currentResource.resourceType);
51608
+ if (updateReplacePolicy === "Retain") throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its Create API is ` + `name-idempotent: the create-first attempt returned the existing resource ` + safeMsg`(${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}) instead of creating a new one, and ` + `UpdateReplacePolicy: Retain pins that resource in place. ` + safeMsg`${idempotentNameOrigin.descriptor}. ${idempotentNameOrigin.remedy} — with ` + "Retain, the old resource keeps the name, so a same-name replacement can never proceed.", "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
51609
+ if (engine.options.replace !== true) throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its Create API is ` + `name-idempotent: the create-first attempt returned the EXISTING resource ` + safeMsg`(${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}) instead of creating a new one, so deleting ` + `the "old" resource would silently destroy the resource the deploy just ` + safeMsg`reported as created. ${idempotentNameOrigin.descriptor}; ` + safeMsg`${idempotentNameOrigin.remedy}, or re-run with ` + `${deployReplaceCommand()} to delete the old resource FIRST and recreate it under the same name (the resource is briefly unavailable while it is recreated). Note: this branch is also reached when the old resource was deleted out-of-band and the physical id is name-derived — there the create was a genuine fresh create; \`--replace\` converges that case too.`, "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
51610
+ engine.logger.info(` Create-first returned the existing resource (name-idempotent Create API) ` + safeMsg`and --replace is set — deleting old ${logicalId} ` + safeMsg`(${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}) first...`);
51141
51611
  deletedOldFirst = true;
51142
51612
  createResult = await replaceDeleteFirstAndRecreate(engine.replacementRun, engine.replacementDeps(), logicalId, resourceType, oldResourceType, currentResource, oldDeleteProvider, replaceProvider, replaceProps, updateSecrets, updateReplacePolicy, oldDeleteRoute.provisionedBy, noEchoDeleteValues);
51143
51613
  }
@@ -51154,7 +51624,7 @@ async function replaceCreateFirst(engine, { currentResource, equalIdIsSameResour
51154
51624
  if (snapshotError instanceof CdkdError && snapshotError.code === "FINAL_SNAPSHOT_UNSUPPORTED") throw snapshotError;
51155
51625
  snapshotBlockedDelete = true;
51156
51626
  engine.replacementRun.replacedOldMaySurvive.set(logicalId, "kept");
51157
- engine.logger.warn(safeMsg` ⚠ Final snapshot for old ${logicalId} (${currentResource.physicalId}) ` + safeMsg`failed: ${asIsMessage(describeAwsFailure(snapshotError).detail)}. ` + "The old resource was NOT deleted (UpdateReplacePolicy: Snapshot) — delete it manually once you have a snapshot; it is no longer tracked in state.");
51627
+ engine.logger.warn(safeMsg` ⚠ Final snapshot for old ${logicalId} (${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}) ` + safeMsg`failed: ${asIsMessage(describeAwsFailure(snapshotError).detail)}. ` + "The old resource was NOT deleted (UpdateReplacePolicy: Snapshot) — delete it manually once you have a snapshot; it is no longer tracked in state.");
51158
51628
  }
51159
51629
  if (!snapshotBlockedDelete) await deleteReplacedAfterCreate(engine.replacementRun, engine.replacementDeps(), logicalId, oldResourceType, currentResource, oldDeleteProvider, currentResource.properties, cleanupFinalSnapshotId, updateReplacePolicy, updateSecrets, oldDeleteRoute.provisionedBy, noEchoDeleteValues, false, createResult.physicalId === currentResource.physicalId && resourceType === oldResourceType);
51160
51630
  }
@@ -51394,7 +51864,7 @@ async function deleteOldIdAfterDeploy(run, deps, input) {
51394
51864
  return;
51395
51865
  }
51396
51866
  if (keptBy === "Snapshot") {
51397
- run.replacedDeleteSkips.set(logicalId, `the old physical id ${oldResource.physicalId} was not sent a Delete (UpdateReplacePolicy: Snapshot) and is no longer tracked by cdkd`);
51867
+ run.replacedDeleteSkips.set(logicalId, `the old physical id ${shownOldId} was not sent a Delete (UpdateReplacePolicy: Snapshot) and is no longer tracked by cdkd`);
51398
51868
  deps.logger.warn(safeMsg` ⚠ ${logicalId} has UpdateReplacePolicy: Snapshot, which a custom resource cannot take — its old physical id (${shownOldId}) is not sent a Delete and is no longer tracked by cdkd`);
51399
51869
  return;
51400
51870
  }
@@ -51402,7 +51872,7 @@ async function deleteOldIdAfterDeploy(run, deps, input) {
51402
51872
  try {
51403
51873
  noEchoDeleteValues = await input.noEchoDeleteValues();
51404
51874
  } catch {
51405
- run.replacedDeleteSkips.set(logicalId, `the old physical id ${oldResource.physicalId} was not sent a Delete (its properties could not be prepared) and is no longer tracked by cdkd`);
51875
+ run.replacedDeleteSkips.set(logicalId, `the old physical id ${shownOldId} was not sent a Delete (its properties could not be prepared) and is no longer tracked by cdkd`);
51406
51876
  deps.logger.warn(safeMsg` ⚠ ${logicalId}'s old physical id (${shownOldId}) is not sent a Delete: cdkd could not prepare its properties. It is no longer tracked by cdkd; delete what the handler made under it manually`);
51407
51877
  return;
51408
51878
  }
@@ -51506,6 +51976,7 @@ async function replaceFallbackFor(engine, { currentProps, currentResource, logic
51506
51976
  forceDataDelete: engine.options.forceStatefulRecreation === true,
51507
51977
  ...fallbackFinalSnapshotId !== void 0 && { finalSnapshotIdentifier: fallbackFinalSnapshotId },
51508
51978
  ...replacementDeleteContext(engine.replacementDeps(), fallbackUpdateReplacePolicy),
51979
+ stackHoldersStillAttached: true,
51509
51980
  recordedAttributes: currentResource.attributes,
51510
51981
  recordedCreateOnlyDrops: currentResource.acceptedCreateOnlyDrops,
51511
51982
  recordedNoEchoLeaves: currentResource.noEchoLeaves,
@@ -51524,7 +51995,7 @@ async function replaceFallbackFor(engine, { currentProps, currentResource, logic
51524
51995
  provisionedBy: updateDecision.provisionedBy
51525
51996
  });
51526
51997
  const fallbackSkipReason = deleteSkipReason(fallbackDeleteResult);
51527
- if (fallbackSkipReason !== void 0) throw new Error(deleteSkippedMessage(logicalId, currentResource.physicalId, fallbackSkipReason, "during the UPDATE-not-supported replacement"));
51998
+ if (fallbackSkipReason !== void 0) throw new Error(deleteSkippedMessage(logicalId, displayPhysicalId(currentResource.resourceType, currentResource.physicalId), fallbackSkipReason, "during the UPDATE-not-supported replacement"));
51528
51999
  engine.replacementRun.oldDeletedBeforeCreate.add(logicalId);
51529
52000
  await updateProvider.waitForNameReleased?.(logicalId, currentResource.physicalId, resourceType, {
51530
52001
  isInterrupted: () => engine.userInterrupted,
@@ -51571,7 +52042,7 @@ async function replaceFallbackFor(engine, { currentProps, currentResource, logic
51571
52042
  if (!retainOldOnReplace) {
51572
52043
  const shownSecrets = unionOfSecretBags([updateSecrets, printingSecretsFor(engine.secretsRun, logicalId)]);
51573
52044
  const createFailure = describeAwsFailure(createError);
51574
- const createFailureText = (text) => safeMsg`Failed to create ${maskSecretsInText(logicalId, shownSecrets)} after the ` + safeMsg`UPDATE-not-supported replacement: the old resource (${maskSecretsInText(currentResource.physicalId, shownSecrets)}) ` + safeMsg`is now gone. Re-run the deploy to create it fresh. Cause: ${asIsMessage(maskSecretsInText(text, shownSecrets))}`;
52045
+ const createFailureText = (text) => safeMsg`Failed to create ${maskSecretsInText(logicalId, shownSecrets)} after the ` + safeMsg`UPDATE-not-supported replacement: the old resource (${maskSecretsInText(String(displayPhysicalId(currentResource.resourceType, currentResource.physicalId)), shownSecrets)}) ` + safeMsg`is now gone. Re-run the deploy to create it fresh. Cause: ${asIsMessage(maskSecretsInText(text, shownSecrets))}`;
51575
52046
  if (createFailure.redacted) engine.logger.debug(createFailureText(createFailure.detail));
51576
52047
  const createFailed = new Error(createFailureText(createFailure.redacted ? createFailure.summary : createFailure.detail), { cause: createError instanceof Error ? createError : void 0 });
51577
52048
  throw createFailure.redacted && createError instanceof Error ? markRedactedCause(createFailed) : createFailed;
@@ -51585,8 +52056,8 @@ async function replaceFallbackFor(engine, { currentProps, currentResource, logic
51585
52056
  observed: currentResource.observedProperties,
51586
52057
  physicalId: currentResource.physicalId
51587
52058
  });
51588
- if (nameHeldElsewhere !== void 0) throw markNonRetryable(new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement because the ` + `provisioning layer cannot update it in place, but the create collided. ` + safeMsg`${renderNameHeldElsewhere(nameHeldElsewhere)} — so removing ` + "UpdateReplacePolicy: Retain would delete this resource and still collide. Choose a name no other resource holds, or delete the resource holding it if it is yours.", "NAMED_REPLACEMENT_COLLISION", createError instanceof Error ? createError : void 0));
51589
- const nameOrigin = replacementNameOrigin(logicalId, currentResource.physicalId);
52059
+ if (nameHeldElsewhere !== void 0) throw markNonRetryable(new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement because the ` + `provisioning layer cannot update it in place, but the create collided. ` + safeMsg`${renderNameHeldElsewhere(nameHeldElsewhere, currentResource.resourceType)} — so removing ` + "UpdateReplacePolicy: Retain would delete this resource and still collide. Choose a name no other resource holds, or delete the resource holding it if it is yours.", "NAMED_REPLACEMENT_COLLISION", createError instanceof Error ? createError : void 0));
52060
+ const nameOrigin = replacementNameOrigin(logicalId, currentResource.physicalId, currentResource.resourceType);
51590
52061
  throw markNonRetryable(new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement because the ` + "provisioning layer cannot update it in place — but its physical name is still held by the existing resource AND UpdateReplacePolicy: Retain pins that resource in place. " + safeMsg`${nameOrigin.descriptor}. ${nameOrigin.remedy} — with Retain, the old ` + "resource keeps the name, so a same-name replacement can never proceed. Removing UpdateReplacePolicy: Retain lets cdkd delete the old resource first, which destroys it and any data it holds.", "NAMED_REPLACEMENT_COLLISION", createError instanceof Error ? createError : void 0));
51591
52062
  }
51592
52063
  if (!retainOldOnReplace && !createFirst && createResult.physicalId === currentResource.physicalId && !equalIdNamesDifferentResources({
@@ -51602,8 +52073,8 @@ async function replaceFallbackFor(engine, { currentProps, currentResource, logic
51602
52073
  oldProperties: currentResource.properties,
51603
52074
  newProperties: resolvedProps
51604
52075
  })) {
51605
- const idempotentNameOrigin = replacementNameOrigin(logicalId, currentResource.physicalId);
51606
- throw markNonRetryable(new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its Create ` + `API is name-idempotent: the create returned the existing resource ` + safeMsg`(${currentResource.physicalId}) instead of creating a new one, and ` + `UpdateReplacePolicy: Retain pins that resource in place, so the new ` + safeMsg`properties were not applied. ${idempotentNameOrigin.descriptor}. ` + safeMsg`${idempotentNameOrigin.remedy} — with Retain, the old resource keeps ` + `the name, so a same-name replacement can never proceed.`, "NAMED_REPLACEMENT_IDEMPOTENT_CREATE"));
52076
+ const idempotentNameOrigin = replacementNameOrigin(logicalId, currentResource.physicalId, currentResource.resourceType);
52077
+ throw markNonRetryable(new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its Create ` + `API is name-idempotent: the create returned the existing resource ` + safeMsg`(${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}) instead of creating a new one, and ` + `UpdateReplacePolicy: Retain pins that resource in place, so the new ` + safeMsg`properties were not applied. ${idempotentNameOrigin.descriptor}. ` + safeMsg`${idempotentNameOrigin.remedy} — with Retain, the old resource keeps ` + `the name, so a same-name replacement can never proceed.`, "NAMED_REPLACEMENT_IDEMPOTENT_CREATE"));
51607
52078
  }
51608
52079
  engine.replacementRun.retainedOldOnReplacement.add(logicalId);
51609
52080
  engine.logger.warn(safeMsg` ⚠ ${logicalId} has UpdateReplacePolicy: Retain — the old physical ` + safeMsg`resource (${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)}) is RETAINED and is no longer ` + "tracked by cdkd: it keeps running and incurring cost, and `cdkd destroy` will not remove it. Delete it yourself once you no longer need its data.");
@@ -52004,6 +52475,7 @@ function deferredServiceTokenWarning(row) {
52004
52475
  }
52005
52476
 
52006
52477
  // src/deployment/deploy-engine/update/finish.ts
52478
+ const WRITE_ONLY_KEY_CHANGE_REFUSED = "WRITE_ONLY_KEY_CHANGE_REFUSED";
52007
52479
  async function finishUpdate(engine, input) {
52008
52480
  const { logicalId, change, stateResources, stackName, template, parameterValues, conditions, counts, progress, resourceType, renderer, currentResource, oldResourceType, typeChanged, currentProps, updateSecrets, resolvedProps, lostChild, lostWithParent, desiredForSkipCheckAsWritten, witness, currentPropsAsWritten, otherFreshAt, pendingParameterLeaves, unsettledNames, movedAsWritten, confirmedPaths, macChangedPaths, propertyDrivenReplacement, recreateViaCcApi, recreateViaSdkProvider, recreateFlagged, needsReplacement, policyReplacement } = input;
52009
52481
  const liveLabel = engine.liveTaskLabels.get(logicalId);
@@ -52080,6 +52552,8 @@ async function finishUpdate(engine, input) {
52080
52552
  diffSawTokenChange: diffMovedServiceToken(change)
52081
52553
  });
52082
52554
  if (serviceTokenRefusal !== void 0) throw markRefusedBeforeApplying(markNonRetryable(new CdkdError(renderServiceTokenRefusal([serviceTokenRefusal], stackName, createSecretMasker(updateSecrets)), SERVICE_TOKEN_CHANGE_REFUSED)));
52555
+ const movedRefused = movedReferencesRefusedOnUpdate(resourceType, desiredForSkipCheckAsWritten, currentPropsAsWritten);
52556
+ if (movedRefused.length > 0) throw markRefusedBeforeApplying(markNonRetryable(new CdkdError(safeMsg`${logicalId} (${resourceType}): ${movedRefused.join(", ")} cannot be changed after creation, and its secret reference changed (or was added or removed) since the recorded value. Restore the recorded reference, or replace the resource under a new logical id.`, WRITE_ONLY_KEY_CHANGE_REFUSED)));
52083
52557
  const changedProperties = new Set([.../* @__PURE__ */ new Set([
52084
52558
  ...Object.keys(desiredForSkipCheckAsWritten),
52085
52559
  ...Object.keys(currentPropsAsWritten),
@@ -52302,7 +52776,10 @@ async function provisionUpdate(engine, logicalId, change, stateResources, stackN
52302
52776
  continue;
52303
52777
  }
52304
52778
  const verdict = verdictAt(pc.path);
52305
- if (verdict === "read-failed") throw markNonRetryable(new CdkdError(safeMsg`${logicalId}.${pc.path} is a create-only property a NoEcho parameter feeds, and reading the resource back from AWS to compare it failed. cdkd does not replace a resource on a failed read: re-run the deploy.`, "NOECHO_READBACK_FAILED"));
52779
+ if (verdict === "read-failed") {
52780
+ const denied = read !== void 0 && "failure" in read ? read.denied : void 0;
52781
+ throw markNonRetryable(new CdkdError(denied !== void 0 ? safeMsg`${logicalId}.${pc.path} is a create-only property a NoEcho parameter feeds, and reading the resource back from AWS to compare it failed. cdkd does not replace a resource on a failed read. ${grantSentence(denied)} the deploy.` : safeMsg`${logicalId}.${pc.path} is a create-only property a NoEcho parameter feeds, and reading the resource back from AWS to compare it failed. cdkd does not replace a resource on a failed read: re-run the deploy.`, "NOECHO_READBACK_FAILED"));
52782
+ }
52306
52783
  if (verdict === "held") {
52307
52784
  parameterHeldKeys.add(pc.path);
52308
52785
  engine.logger.debug(safeMsg`${logicalId}.${pc.path} carries a NoEcho parameter value AWS already holds: not replaced.`);
@@ -52919,7 +53396,7 @@ async function settleFailedDeployRecords(run) {
52919
53396
  engine.logger.warn(safeMsg` ⚠ ${lost.logicalId} (${childType}) went with a resource this deploy re-created under the same id; restoring it failed, and its state record is kept because the write may have reached AWS. If it is missing there, re-run the deploy with `.concat(recovery, " to write it again."));
52920
53397
  continue;
52921
53398
  }
52922
- const parentPhysicalId = newResources[lost.parent]?.physicalId;
53399
+ const parentPhysicalId = displayPhysicalId(newResources[lost.parent]?.resourceType, newResources[lost.parent]?.physicalId);
52923
53400
  const parentShown = parentPhysicalId !== void 0 && parentPhysicalId !== "" ? safeMsg`${lost.parent} (${parentPhysicalId})` : safeMsg`${lost.parent}`;
52924
53401
  const mayStillBeLive = attempted.has(lost.logicalId) ? safeMsg` Its write may still be on `.concat(parentShown, safeMsg`: if ${lost.logicalId} is removed from the template before the next deploy, remove it from that resource by hand.`) : "";
52925
53402
  if (lost.action === "forget" && mayStillBeLive !== "") {
@@ -53070,7 +53547,7 @@ async function rollbackFailedDeploy(run, error, initialDeploy, currentEtag) {
53070
53547
  if (autoRollbackClean) await settleNestedChildrenAfterCleanRollback(engine.rollbackDeps(), stackName, rollbackSettledNested, await settleJournalAfterCleanRollback(engine.rollbackDeps(), stackName, rollbackRemainingFailedOps, initialDeploy));
53071
53548
  } catch (retryError) {
53072
53549
  engine.logger.warn(safeMsg`Failed to save state after rollback: ${asIsMessage(describeAwsFailure(retryError).detail)}`);
53073
- for (const entry of rollbackSuperseded) withPrintingSecrets(unionOfSecretBags([secretNameBagFor(engine.secretsRun, entry.logicalId), orphanRecordsPrintingBag([entry])]), () => engine.logger.warn(safeMsg` ${entry.logicalId}'s new ${entry.state.resourceType} ` + safeMsg`(${entry.state.physicalId}) the rollback left to delete is NOT recorded: ` + "delete it manually."));
53550
+ for (const entry of rollbackSuperseded) withPrintingSecrets(unionOfSecretBags([secretNameBagFor(engine.secretsRun, entry.logicalId), orphanRecordsPrintingBag([entry])]), () => engine.logger.warn(safeMsg` ${entry.logicalId}'s new ${entry.state.resourceType} ` + safeMsg`(${displayPhysicalId(entry.state.resourceType, entry.state.physicalId)}) the rollback left to delete is NOT recorded: ` + "delete it manually."));
53074
53551
  }
53075
53552
  }
53076
53553
  }
@@ -53145,7 +53622,7 @@ async function executeDeploymentBody(engine, template, currentState, changes, da
53145
53622
  const startedUpdates = /* @__PURE__ */ new Set();
53146
53623
  const settledUpdates = /* @__PURE__ */ new Set();
53147
53624
  const inFlightWrites = /* @__PURE__ */ new Map();
53148
- engine.stackRecordsView = deployStackRecordsView(newResources, currentState.resources, deleteChanges, (logicalId) => startedUpdates.has(logicalId) && !settledUpdates.has(logicalId), () => [...inFlightWrites.values()].map(({ write }) => write));
53625
+ engine.stackRecordsView = deployStackRecordsView(newResources, currentState.resources, deleteChanges, (logicalId) => startedUpdates.has(logicalId) && !settledUpdates.has(logicalId), () => [...inFlightWrites.values()].map(({ write }) => write), (logicalId) => engine.replacementRun.updateWasReplaced.get(logicalId) === true || completedOperations.some((op) => op.logicalId === logicalId && op.changeType === "CREATE"));
53149
53626
  engine.replacementRun.deferredReplacedDeletes = /* @__PURE__ */ new Map();
53150
53627
  engine.replacementRun.supersededHost = currentState;
53151
53628
  const carriedSuperseded = supersededResourcesOf(currentState).filter((entry) => {
@@ -55304,5 +55781,5 @@ var DeployEngine = class {
55304
55781
  }
55305
55782
  };
55306
55783
 
55307
- export { recordTagWrite as $, policyContentKey as $a, refuseMalformedResourcePropertiesForDrift as $c, cyan as $i, hasUnverifiableParameterRefusal as $l, propertiesChangedReason as $n, applyRoleArnIfSet as $o, redactedDeleteAddressFields as $r, isLegacyHandleId as $s, macWriteOnlyKeys as $t, BOOTSTRAP_MARKER_PREFIX as $u, recordedProtectionEvidence as A, createPreDeleteFinalSnapshot as Aa, refuseMalformedOrphanRecordsForDestroy as Ac, isExportAliasCollision as Ai, accountArgs as Al, crossStackReadsForPartialSave as An, UNSPECIFIED_SKIP_REASON as Ao, updatePartialReason as Ar, extractGetAttRefs as As, DELETE_INDEX_WAIT_PROCEED_NOTE as At, isDefaultBootstrapBucketName as Au, declaredStreamTagsMember as B, OWN_WRITE_REREAD_DELAYS_MS as Ba, refuseMalformedResourceAttributesForOrphan as Bc, holdsSupersededResources as Bi, unwrittenCreateOnlyReplacement as Bl, findRefactorHints as Bn, isAlwaysLiveAttribute as Bo, demoteSupersededOrphans as Br, isImpossibleEmptyStoredAttribute as Bs, isTruthyCfnBoolean as Bt, resolveFileAssetSourcePath as Bu, pendingMovesOutOf as C, PRE_DELETE_SNAPSHOT_TYPES as Ca, deployRefusesOrphanRowsReason as Cc, carriedExportAliasExposure as Ci, malformedStateRefusalMessage as Cl, loadJournaledOrphans as Cn, localCustomResourceRuntimeActive as Co, settleUnsettledPrevious as Cr, AWS_NO_VALUE as Cs, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as Ct, decodeListingKey as Cu, findServiceTokenRefusals as D, isFinalSnapshotError as Da, malformedOrphanRowsKeptWarning as Dc, noEchoParameterValueSeed as Di, refuseMalformedState as Dl, planOrphanAdoption as Dn, CloudControlProvider as Do, equalModuloMask as Dr, lacksRecordedRefArn as Ds, deleteBudgetKey as Dt, createAssetRedirectResolver as Du, deferredServiceTokenWarning as E, effectiveDeletionPolicy as Ea, malformedOrphanRecordsWarning as Ec, isWholeDynamicReferenceValue as Ei, refuseMalformedResourcesForExport as El, makeSiblingClaimReader as En, waitForLambdaFunctionActive as Eo, equalModuloMarkedMask as Er, refStateLookupFromResource as Es, compensateRemovedDeletionProtection as Et, buildAssetRedirectMap as Eu, readProtection as F, isStoredExpression as Fa, isReadableResourceEntry as Fc, awaitInFlightSibling as Fi, hasReadableOutputs as Fl, noEchoMacVerdict as Fn, getReadOnlyPropertyPaths as Fo, reserveStackCreateToken as Fr, recordedProvenanceOf as Fs, relayedIndexBusyDelete as Ft, rewriteTemplateAssetReferences as Fu, streamDeclaresTags as G, lambdaPermissionMatchesDeclared as Ga, refuseMalformedResourceEntriesForImportSave as Gc, supersededResourcesOf as Gi, hasNoCloudControlHandlers as Gl, changedReferenceInDiff as Gn, displayPhysicalId as Go, recordUnderIdIsNotOwn as Gr, withSharedDrainBudget as Gs, refactorMarkerMovesOf as Gt, buildDenyExternalAccessPolicy as Gu, readStreamPolicy as H, declaredMemberDocument as Ha, refuseMalformedResourceEntriesForDeploy as Hc, supersededAfterRollback as Hi, withoutSdkUnwiredProperties as Hl, movedToHint as Hn, stackIdTailOf as Ho, isReplacementOrphan as Hr, isNamelessDynamicReferenceError as Hs, recordRetainedForReadoption as Ht, warnWholeAssemblyAsSource as Hu, DynamoDBGlobalTableProvider as I, withoutSiblingAttachedArns as Ia, malformedLocalResourceEntriesWarning as Ic, destroyStackRecordsView as Ii, hasReadableResources as Il, noEchoValueMacsOf as In, isWaitAbandonedError as Io, withCreateTokenLedger as Ir, recordedReferenceRegions as Is, waitForIndexesSettled as It, AssetManifestLoader as Iu, streamTagsMatchDeclared as J, reReadUntilSettled as Ja, unreadableResourceEntries as Jc, snapshotSegmentSurvivors as Ji, S3StateBackend as Jl, differingRemedy as Jn, secretSegmentsOfState as Jo, computeImplicitDeleteEdges as Jr, containsIntrinsic as Js, sameMove as Jt, getBootstrapMarkerKey as Ju, streamMemberRefusals as K, memberReadFailure as Ka, refuseMalformedResourceEntriesForOrphan as Kc, withoutSuperseded as Ki, PROPERTY_COVERAGE_BY_TYPE as Kl, changedReferencePath as Kn, maskedSecretSegment as Ko, replacementNeverSwapped as Kr, namesRecreatedParent as Ks, refactorMarkerRefusalMessage as Kt, assertAssetBucketRegion as Ku, STREAM_POLICY_KEY as L, withoutSiblingOwned as La, malformedLocalResourcesWarning as Lc, getStackRecords as Li, findActionableSdkUnwired as Ll, constructPathOf as Ln, markWaitAbandoned as Lo, acquireIdempotencyToken as Lr, referenceProvenanceOf as Ls, ECR_AUTO_DELETE_IMAGES_TAG as Lt, getDockerImageBySourceHash as Lu, PROTECTION_PROPERTY_BY_TYPE as M, collectGroupsAddedBySiblings as Ma, repairMalformedOrphanRecordsForReadOnly as Mc, DEFAULT_RESOURCE_TIMEOUT_MS as Mi, STATE_RESOURCES_MALFORMED as Ml, createNoEchoValueMacs as Mn, deleteLeftInPlace as Mo, replacementCreateRoutesToCloudControl as Mr, keepHeldTokenProvenance as Ms, TABLE_INDEX_NOUN as Mt, loadPublishableAssetManifest as Mu, isProtectionValueActive as N, collectManagedPolicyArnsAttachedBySiblings as Na, unpreviewableOrphanRecords as Nc, DEFAULT_RESOURCE_WARN_AFTER_MS as Ni, UNREADABLE_RESOURCES_MAP_ROW as Nl, noEchoMacBinding as Nn, deleteSkipReason as No, earliestDefined as Nr, outputReferenceProvenanceOf as Ns, deleteTableWithIndexBusyRetry as Nt, redirectDockerAsset as Nu, serviceTokenBlockingReason as O, refusesFinalSnapshot as Oa, previewableOrphanRecords as Oc, collectDeclaredOutputNames as Oi, repairMalformedResourcesForReadOnly as Ol, DeploymentEventsReader as On, waitForGoneAfterDelete as Oo, undeclaredEmptyObservedKeys as Or, lacksRecordedTableArn as Os, resolveDynamoDbDeleteBudgetClock as Ot, createLazyAssetModeContext as Ou, perType as P, collectPrincipalsAttachingPolicy as Pa, unreadableOrphanRecords as Pc, maskingRetryLogger as Pi, displayLogicalId as Pl, noEchoMacParametersOf as Pn, withIndeterminateGuard as Po, ledgerForStack as Pr, recordedOutputReferenceRegions as Ps, maskedLogger as Pt, redirectFileAsset as Pu, isDynamoDBTableArnIn as Q, attemptedPolicyDocument as Qa, refuseMalformedResourcePropertiesForDestroy as Qc, bold as Qi, hasReasonlessBaselineRefusal as Ql, parseMappingFile as Qn, refuseUnreadableCdkCrossAccountRefs as Qo, isRedactedRecordedValue as Qr, LEGACY_HANDLE_ID_PREFIX as Qs, removeSignalReceiverNamed as Qt, validateContainerRepoName as Qu, STREAM_TAGS_KEY as R, KMS_DEFAULT_KEY_POLICY_ID as Ra, malformedResourceEntriesWarning as Rc, withStackRecords as Ri, findHandledUnwrittenCreateOnly as Rl, findDestructiveChanges as Rn, IntrinsicFunctionResolver as Ro, planRollback as Rr, referenceTokensIn as Rs, S3_AUTO_DELETE_OBJECTS_TAG as Rt, isCfnTemplateAssetPath as Ru, hasPendingMovesOut as S, ATOMIC_FINAL_SNAPSHOT_TYPES as Sa, maskedPropertyFingerprint as Sc, secretSafeKeyDisplay as Si, malformedResourcesWarning as Sl, journaledOrphanLines as Sn, localCustomResourceCommand as So, recordAfterRollbackUpdate as Sr, parameterTypeMayLoseSecretIdentity as Ss, DYNAMODB_DELETE_DEADLINE_MARGIN_MS as St, purgeNoncurrentKeyVersions as Su, refusePendingMovesOut as T, ccRoutedInstanceTakesNoSnapshot as Ta, malformedOrphanRecordsRefusalMessage as Tc, exportNameSecretExposure as Ti, refuseMalformedResourcesForDestroy as Tl, makeForeignHolderScan as Tn, withCustomResourceStack as To, calculateResourceDrift as Tr, isStalePlaceholderArnAttribute as Ts, beginDeleteWait as Tt, synthesizedStacks as Tu, reverseMapStreamPolicy as U, declaredPolicyDocument as Ua, refuseMalformedResourceEntriesForDestroy as Uc, supersededHeldByOtherTypeWarning as Ui, withoutUnwrittenSdkUnwiredProperties as Ul, rollbackOrphanIds as Un, isSettledInstanceState as Uo, planFailedOps as Ur, carriesDynamicReference as Us, readRefactorMarker as Ut, AssetModeResolver as Uu, planStreamMemberOps as V, SNS_DEFAULT_POLICY_ID as Va, refuseMalformedResourceEntries as Vc, isSupersededResourceRecord as Vi, withoutAcceptedSdkUnwiredProperties as Vl, hintSidesOf as Vn, poisonRenderedSpellingsCollidingIn as Vo, isJournaledOrphan as Vr, carriesFetchableDynamicReference as Vs, keptForRetainedRecord as Vt, warnAbsoluteAssetPath as Vu, streamDeclaresPolicy as W, efsPolicyMatchesDeclared as Wa, refuseMalformedResourceEntriesForImport as Wc, supersededHolderOf as Wi, NO_CC_HANDLERS_REASON as Wl, withMovedTo as Wn, APPSYNC_APIKEY_ARN_RESOURCE_PATH as Wo, recheckFailedPlan as Wr, keepsSecretReferenceToken as Ws, readRefactorMarkerOnce as Wt, ensureAssetStorage as Wu, clearTagWrites as X, warnUnsettledMember as Xa, malformedResourcePropertiesWarning as Xc, withPreviousPolicies as Xi, isKnownTokenFreeState as Xl, looselyEqual as Xn, resolveDynamicReferences as Xo, readsRegeneratingSecret as Xr, replacementSidesForLog as Xs, deleteSignalReceiver as Xt, readBootstrapMarkerBody as Xu, TAGS_BASELINE_REREAD_DELAYS_MS as Y, settleDeclaredMember as Ya, malformedDriftResourcePropertiesWarning as Yc, resolveReplacementOldType as Yi, splitImportedOps as Yl, isPairableType as Yn, withSecretPhysicalIdsMaskedInState as Yo, attemptUsesCompletedCreate as Yr, markNewValueKnownAfterDeploy as Ys, updateRefactorMarker as Yt, parseBootstrapMarker as Yu, declaredTagsReadback as Z, verbatimEchoDriftKeys as Za, refuseMalformedResourceProperties as Zc, findNestedStackTypeChanges as Zi, readOnlyStateVersionOf as Zl, mappingPairs as Zn, producerLookupOver as Zo, REDACTED_DELETE_ADDRESS_SKIP_REASON as Zr, siblingsOf as Zs, isReceiver as Zt, validateAssetBucketName as Zu, conditionFingerprint as _, secretNamedAttributeNamesOf as _a, movedMaskedProperties as _c, WITHHELD_NAME_DISPLAY as _i, refuseMalformedOutputsForDestroy as _l, withNestedStackContext as _n, withPrintingSecrets as _o, replayRollback as _r, s3BucketDualStackDomainName as _s, planIndexContributorInsightsOps as _t, templateIdentity as _u, scanActiveConsumers as a, noEchoComparisonForTemplate as aa, isStatefulRecreateTargetSync as ac, nullPrototypeRecord as ad, nameGenerationHighWaterOf as ai, malformedOrphansRefusalMessage as al, NESTED_PENDING_PARENT_REASON as an, WaitConditionSignalStore as ao, recordedRuleIdOf as ar, sendableAssumeRoleCommand as as, planTimeToLive as at, isAccessDenied$1 as au, readRecordedConditionVerdicts as b, storedSecretNameNeedles as ba, passedParameterClassesOf as bc, secretBearing as bi, refuseDivergentRecordRegionForDestroy as bl, dropFailedHint as bn, customResourcesFailedWithoutApp as bo, earlyDeletedOld as br, coerceParameterTypedValue as bs, reverseMapTableContributorInsights as bt, ssmResolvedValueType as bu, nestedSsmNameDeferredNote as c, withAttemptedItemsMasked as ca, coerceWarmThroughput as cc, assemblyPathEscape as cd, retiredNameGenerationsAfter as ci, refuseMalformedOrphansForDestroy as cl, dropSettledNestedJournals as cn, isSignalKey as co, siblingOwnedSgRuleIdentities as cr, callerEnvCredentials as cs, planVectorIndexUpdates as ct, withStackInstanceIdWithheld as cu, slashedSsmNameHealAdoptedNote as d, journaledOrphanPrintingBag as da, toFiniteNumber as dc, namesTheSameDirectory as dd, getCurrentProducerRegions as di, malformedExportSourceWarning as dl, recordDisplacedSkips as dn, customResourceResponseExpirationWarning as do, SG_RULE_ID_PATTERN as dr, classifyReplaySecretRegion as ds, vectorIndexesSettled as dt, stringifyValue as du, gray as ea, findReplacedReadersOfRecreateTargets as ec, getCdkdAssetBucketName as ed, redactedDeleteAddressSkip as ei, refuseMalformedResourcePropertiesForExport as el, readsOnlyNoEchoParameters as en, CC_BROKEN_REASON as eo, proposeRenames as er, assertFlagRoleArn as es, settleWrittenTags as et, rebuildClientForBucketRegion as eu, slashedSsmNameHealNote as f, maskEventTextWithBoundBags as fa, getSettledWriteOnlyPropertyPaths as fc, renderAssemblyPathEscape as fd, inheritProducerRegions as fi, malformedLocalOutputsWarning as fl, revertNestedChildFromJournal as fn, responsePresignClient as fo, cfnIngressPortValue as fr, producerRegionsFromState as fs, vectorIndexesShapeDetail as ft, missingStateBucketRemedy as fu, makeCanonicalizePropertiesFn as g, secretNamePrintingBags as ga, maskedPropertyFingerprintsOf as gc, resourcesNamingDeclaredParameter as gi, refuseMalformedOutputs as gl, getCurrentNestedStackContext as gn, getCurrentResourceSecrets as go, replayFailedOperations as gr, s3BucketDomainName as gs, planContributorInsightsOp as gt, renderNestedTemplateTreeDefect as gu, inheritedProvenanceForChildDiff as h, secretNamePrintingBag as ha, inputFingerprinter as hc, resolveBucketRegion as hd, reachableDivergentParameters as hi, refuseMalformedNestedChildOutputs as hl, collectNestedChildUnaddressed as hn, isCustomResourceType as ho, canonicalizeIpProtocolValue as hr, s3BucketArn as hs, indexDeclaresContributorInsights as ht, listNestedTemplateRows as hu, mergeNoChangeOutputs as i, noEchoAttributeNamesOf as ia, isStatefulRecreateTargetForReplace as ic, hasPlainPrototype as id, nameGenerationCarriedFrom as ii, hasReadableOrphans as il, resolvePendingCloudControlRequests as in, wouldReturnToSdkProvider as io, undeclaredGrantSiblingMembers as ir, parseIamRoleArn as is, isTtlRateLimited as it, crossPrefixDeniedWarning as iu, recordedProtectionNote as j, buildFinalSnapshotIdentifier as ja, refuseMalformedOrphansForOrphan as jc, bindingSkippedOutputs as ji, withheldAccountClause as jl, NOECHO_MAC_KEY_ALIAS as jn, deleteIndeterminateGuards as jo, findUpdatePolicyReplacementRefusals as jr, promoteInPlaceAttributeDependents as js, INDEX_SETTLE_POLL_INTERVAL_MS as jt, isDefaultBootstrapRepoName as ju, diffSecurity as k, unsupportedFinalSnapshotError as ka, refuseMalformedOrphanRecords as kc, collectPublishedOutputNames as ki, JSON_LISTING_HOLE_VALUE as kl, DeploymentEventsStore as kn, RollbackInlinePolicyWriters as ko, updatePartialMessage as kr, parseWebACLArn as ks, resolveDynamoDbDeleteBudgetMs as kt, flattenAssetPlaceholders as ku, nestedSsmNameRowNote as l, createReadOnlyAttributeHealerFactory as la, isWarmThroughputDecrease as lc, describeFileReadFailure as ld, retiredNameGenerationsLeaving as li, repairMalformedOrphansForReadOnly as ll, getNestedRevertRun as ln, CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID as lo, siblingRecordedSgRuleIds as lr, envCredentialsAreAssumedRole as ls, readbackVectorIndexes as lt, isSecretValuedAttribute as lu, crossStackOutputProvenanceSource as m, orphanRecordsPrintingBag as ma, tryGetTopLevelWriteOnlyProperties as mc, clearBucketRegionCache as md, namesAnyDeclaredParameter as mi, malformedOutputsWarning as ml, withNestedRevertRun as mn, readsNoEchoDeleteValues as mo, sgProtocolKey as mr, isUnexposedRecordedIdentity as ms, contributorInsightsRefusals as mt, isAbsoluteAssetPath as mu, isSecretBearingReferenceString as n, red as na, shownType as nc, defineOwnKey as nd, removeProtectionTypeList as ni, repairMalformedResourcePropertiesForReadOnly as nl, formatResourceLine as nn, ccBrokenReason as no, siblingOwnedRevertDesired as nr, explicitRoleArnOrThrow as ns, takeTagWrite as nt, CrossPrefixScanCache as nu, inRunStackKey as o, noEchoExactEchoLeavesOf as oa, renderStatefulReason as oc, ownValue as od, nameScopeOf as oi, malformedOrphansWarning as ol, displacedOpClause as on, classifyHandleUrl as oo, sgRuleOwnershipIdentity as or, AWS_CREDENTIAL_ENV_KEYS as os, readTtlSpec as ot, isNotImplemented as ou, slashedSsmNameHealPendingNote as p, namingSecretsWithRecordedNoEcho as pa, getTopLevelKeysHoldingUnreadableCreateOnly as pc, resolveAssemblyPath as pd, computeParameterTaint as pi, malformedOutputsRefusalMessage as pl, revertedNestedRowIds as pn, TemplateNoEchoReresolver as po, recordedSgRuleId as pr, regionLessSecretName as ps, CONTRIBUTOR_INSIGHTS_KEY as pt, findNestedTemplateTreeDefect as pu, streamPolicyMatchesDeclared as q, policyDocumentMatchesDeclared as qa, repairMalformedResourceEntriesForReadOnly as qc, replacedDeleteFailureVerdict as qi, TemplateParser as ql, changedReferenceReason as qn, secretPhysicalIdSegment as qo, IMPLICIT_DELETE_DEPENDENCIES as qr, INTRINSIC_KEYS as qs, refuseRefactorMarker as qt, isCrossRegionRedirect as qu, keptWholeReasonText as r, yellow as ra, MULTI_REGION_RECREATE_BLOCKED_TYPES as rc, hasOwnKey as rd, orphanNeedsIdentity as ri, UNREADABLE_ORPHANS_CONTAINER_ROW as rl, pendingRequestCount as rn, isCustomResource as ro, stripSiblingOwnedParentMembers as rr, isIamRoleArn as rs, isTtlAlreadyDisabled as rt, applyCrossPrefixScan as ru, checkNestedSsmNames as s, noEchoParameterNamesOf as sa, WARM_THROUGHPUT_MEMBERS as sc, absoluteAssemblyPathEscape as sd, retiredAfterRollback as si, refuseMalformedOrphans as sl, displacedPhysicalIdShown as sn, evaluateSignals as so, sgSiblingDecidedById as sr, applyCallerIdentityCredentials as ss, sendTtlWaitingOutRateLimit as st, stackInstanceIdOf as su, DeployEngine as t, green as ta, isPlainReferenceTo as tc, getCdkdContainerRepoName as td, segmentCleanupOptions as ti, refuseMalformedResourcePropertiesForOrphan as tl, licensedNameHolder as tn, ProviderRegistry as to, referencedLogicalIds as tr, assertSendableRoleArn as ts, tagsMatchDeclared as tt, CrossPrefixReadError as tu, healSlashedSsmParameterNames as u, completedReplayEntries as ua, toCfnInteger as uc, displayAssemblyPath as ud, withNameGenerationReached as ui, malformedExportNamesWarning as ul, nestedChildStackName as un, applyCustomResourceResponseExpiration as uo, withoutSiblingOwnedSgRules as ur, classifyRecordedSecretRegion as us, vectorIndexesForCreate as ut, isSensitiveAttributeName as uu, conditionInputsFrom as v, secretNamedRecordNeedles as va, parameterInputsFor as vc, displayTextOrWithheld as vi, repairMalformedOutputsForReadOnly as vl, deleteJournaledOrphans as vn, NO_LOCAL_CUSTOM_RESOURCES_FLAG as vo, DELETED_RESOURCE_REMEDY as vr, s3BucketRegionalDomainName as vs, readContributorInsightsSpec as vt, SSM_PARAMETER_VALUE_PREFIX as vu, pendingMovesRefusalMessage as w, ccRoutedFinalSnapshotError as wa, isReadableOrphanRecord as wc, exportNameNoEchoParameters as wi, refuseMalformedResourcesForDeploy as wl, sameJournaledOrphans as wn, setLocalCustomResourceRuntimeEnabled as wo, withUnprovenUnsettled as wr, cfnRefValueFromPhysicalId as ws, DYNAMODB_DELETE_POLL_COST_MS as wt, rememberSynthesizedStacks as wu, childTemplateLoader as x, extractDeploymentEventError as xa, declaresNoEcho as xc, secretBearingStateKeyWarning as xi, malformedRenderedContainersWarning as xl, isHandledOrphan as xn, customResourcesRunWithoutApp as xo, buildReadCurrentStateContext as xr, isUnboundTemplateParameter as xs, stripIndexContributorInsights as xt, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as xu, parentSuppliedValues as y, stateSecretNameNeedles as ya, maskedInputProof as yc, exportAliasCollisionScrubWarning as yi, STATE_REGION_DIVERGED as yl, dropFailedCommands as yn, customResourceStackName as yo, earlyDeleteWhen as yr, s3BucketWebsiteUrl as ys, reverseMapIndexContributorInsights as yt, isListParameterType as yu, declaredStreamPolicyMember as z, LAMBDA_PERMISSION_STATEMENT_KEYS as za, malformedScrubResourceEntriesRefusalMessage as zc, deleteSupersededEntry as zi, findSdkUnwiredProperties as zl, formatDestructiveChange as zn, isSelectOutOfBounds as zo, seedsDeleteFirstGuard as zr, getAccountInfo as zs, hasCdkAutoDeleteTag as zt, parseAssetManifestBody as zu };
55308
- //# sourceMappingURL=deploy-engine-Df4iprdW.js.map
55784
+ export { recordTagWrite as $, reReadUntilSettled as $a, unreadableResourceEntries as $c, gray as $i, providerReplacementOldDeleted as $l, parseMappingFile as $n, assertFlagRoleArn as $o, REDACTED_DELETE_ADDRESS_SKIP_REASON as $r, findReplacedReadersOfRecreateTargets as $s, removeSignalReceiverNamed as $t, AssetModeResolver as $u, recordedProtectionEvidence as A, buildFinalSnapshotIdentifier as Aa, malformedOrphanRecordsRefusalMessage as Ac, collectDeclaredOutputNames as Ai, refuseMalformedResourcesForDestroy as Al, DeploymentEventsStore as An, withCustomResourceStack as Ao, undeclaredEmptyObservedKeys as Ar, promoteInPlaceAttributeDependents as As, resolveDynamoDbDeleteBudgetMs as At, ssmResolvedValueType as Au, declaredStreamTagsMember as B, revertStackRecordsView as Ba, isReadableResourceEntry as Bc, supersededAfterRollback as Bi, hasReadableOutputs as Bl, formatDestructiveChange as Bn, getReadOnlyPropertyPaths as Bo, planRollback as Br, carriesFetchableDynamicReference as Bs, hasCdkAutoDeleteTag as Bt, isDefaultBootstrapBucketName as Bu, pendingMovesOutOf as C, ccRoutedFinalSnapshotError as Ca, parameterInputsFor as Cc, resolveAssemblyPath as Cd, secretBearingStateKeyWarning as Ci, repairMalformedOutputsForReadOnly as Cl, journaledOrphanLines as Cn, NO_LOCAL_CUSTOM_RESOURCES_FLAG as Co, buildReadCurrentStateContext as Cr, cfnRefValueFromPhysicalId as Cs, DYNAMODB_DELETE_DEADLINE_MARGIN_MS as Ct, findNestedTemplateTreeDefect as Cu, findServiceTokenRefusals as D, refusesFinalSnapshot as Da, maskedPropertyFingerprint as Dc, exportNameSecretExposure as Di, malformedResourcesWarning as Dl, makeSiblingClaimReader as Dn, localCustomResourceCommand as Do, calculateResourceDrift as Dr, lacksRecordedTableArn as Ds, compensateRemovedDeletionProtection as Dt, templateIdentity as Du, deferredServiceTokenWarning as E, isFinalSnapshotError as Ea, declaresNoEcho as Ec, exportNameNoEchoParameters as Ei, malformedRenderedContainersWarning as El, makeForeignHolderScan as En, customResourcesRunWithoutApp as Eo, withUnprovenUnsettled as Er, lacksRecordedRefArn as Es, beginDeleteWait as Et, renderNestedTemplateTreeDefect as Eu, readProtection as F, withoutSiblingAttachedArns as Fa, refuseMalformedOrphanRecordsForDestroy as Fc, DEFAULT_RESOURCE_WARN_AFTER_MS as Fi, accountArgs as Fl, noEchoMacParametersOf as Fn, UNSPECIFIED_SKIP_REASON as Fo, earliestDefined as Fr, recordedReferenceRegions as Fs, maskedLogger as Ft, synthesizedStacks as Fu, streamDeclaresTags as G, OWN_WRITE_REREAD_DELAYS_MS as Ga, refuseMalformedResourceAttributesForOrphan as Gc, withoutSuperseded as Gi, unwrittenCreateOnlyReplacement as Gl, withMovedTo as Gn, isAlwaysLiveAttribute as Go, planFailedOps as Gr, namesRecreatedParent as Gs, readRefactorMarkerOnce as Gt, rewriteTemplateAssetReferences as Gu, readStreamPolicy as H, withStackRecords as Ha, malformedLocalResourcesWarning as Hc, supersededHeldByOtherTypeWarning as Hi, findActionableSdkUnwired as Hl, hintSidesOf as Hn, markWaitAbandoned as Ho, demoteSupersededOrphans as Hr, carriesDynamicReference as Hs, keptForRetainedRecord as Ht, loadPublishableAssetManifest as Hu, DynamoDBGlobalTableProvider as I, withoutSiblingOwned as Ia, refuseMalformedOrphansForOrphan as Ic, maskingRetryLogger as Ii, withheldAccountClause as Il, noEchoMacVerdict as In, deleteIndeterminateGuards as Io, ledgerForStack as Ir, referenceProvenanceOf as Is, relayedIndexBusyDelete as It, buildAssetRedirectMap as Iu, streamTagsMatchDeclared as J, declaredPolicyDocument as Ja, refuseMalformedResourceEntriesForDestroy as Jc, resolveReplacementOldType as Ji, withoutUnwrittenSdkUnwiredProperties as Jl, changedReferenceReason as Jn, isSettledInstanceState as Jo, replacementNeverSwapped as Jr, markNewValueKnownAfterDeploy as Js, refuseRefactorMarker as Jt, isCfnTemplateAssetPath as Ju, streamMemberRefusals as K, SNS_DEFAULT_POLICY_ID as Ka, refuseMalformedResourceEntries as Kc, replacedDeleteFailureVerdict as Ki, withoutAcceptedSdkUnwiredProperties as Kl, changedReferenceInDiff as Kn, poisonRenderedSpellingsCollidingIn as Ko, recheckFailedPlan as Kr, INTRINSIC_KEYS as Ks, refactorMarkerMovesOf as Kt, AssetManifestLoader as Ku, STREAM_POLICY_KEY as L, awaitInFlightSibling as La, repairMalformedOrphanRecordsForReadOnly as Lc, deleteSupersededEntry as Li, STATE_RESOURCES_MALFORMED as Ll, noEchoValueMacsOf as Ln, deleteLeftInPlace as Lo, reserveStackCreateToken as Lr, referenceTokensIn as Ls, waitForIndexesSettled as Lt, createAssetRedirectResolver as Lu, PROTECTION_PROPERTY_BY_TYPE as M, collectManagedPolicyArnsAttachedBySiblings as Ma, malformedOrphanRowsKeptWarning as Mc, isExportAliasCollision as Mi, refuseMalformedState as Ml, NOECHO_MAC_KEY_ALIAS as Mn, CloudControlProvider as Mo, updatePartialReason as Mr, outputReferenceProvenanceOf as Ms, INDEX_SETTLE_POLL_INTERVAL_MS as Mt, purgeNoncurrentKeyVersions as Mu, isProtectionValueActive as N, collectPrincipalsAttachingPolicy as Na, previewableOrphanRecords as Nc, bindingSkippedOutputs as Ni, repairMalformedResourcesForReadOnly as Nl, createNoEchoValueMacs as Nn, waitForGoneAfterDelete as No, findUpdatePolicyReplacementRefusals as Nr, recordedOutputReferenceRegions as Ns, TABLE_INDEX_NOUN as Nt, decodeListingKey as Nu, serviceTokenBlockingReason as O, unsupportedFinalSnapshotError as Oa, deployRefusesOrphanRowsReason as Oc, isWholeDynamicReferenceValue as Oi, malformedStateRefusalMessage as Ol, planOrphanAdoption as On, localCustomResourceRuntimeActive as Oo, equalModuloMarkedMask as Or, parseWebACLArn as Os, deleteBudgetKey as Ot, SSM_PARAMETER_VALUE_PREFIX as Ou, perType as P, isStoredExpression as Pa, refuseMalformedOrphanRecords as Pc, DEFAULT_RESOURCE_TIMEOUT_MS as Pi, JSON_LISTING_HOLE_VALUE as Pl, noEchoMacBinding as Pn, RollbackInlinePolicyWriters as Po, replacementCreateRoutesToCloudControl as Pr, recordedProvenanceOf as Ps, deleteTableWithIndexBusyRetry as Pt, rememberSynthesizedStacks as Pu, isDynamoDBTableArnIn as Q, policyDocumentMatchesDeclared as Qa, repairMalformedResourceEntriesForReadOnly as Qc, cyan as Qi, dropSupersededProviderReplacements as Ql, mappingPairs as Qn, applyRoleArnIfSet as Qo, readsRegeneratingSecret as Qr, isLegacyHandleId as Qs, isReceiver as Qt, warnWholeAssemblyAsSource as Qu, STREAM_TAGS_KEY as R, destroyStackRecordsView as Ra, unpreviewableOrphanRecords as Rc, holdsSupersededResources as Ri, UNREADABLE_RESOURCES_MAP_ROW as Rl, constructPathOf as Rn, deleteSkipReason as Ro, withCreateTokenLedger as Rr, getAccountInfo as Rs, ECR_AUTO_DELETE_IMAGES_TAG as Rt, createLazyAssetModeContext as Ru, hasPendingMovesOut as S, PRE_DELETE_SNAPSHOT_TYPES as Sa, movedMaskedProperties as Sc, renderAssemblyPathEscape as Sd, secretBearing as Si, refuseMalformedOutputsForDestroy as Sl, isHandledOrphan as Sn, withPrintingSecrets as So, earlyDeletedOld as Sr, AWS_NO_VALUE as Ss, stripIndexContributorInsights as St, missingStateBucketRemedy as Su, refusePendingMovesOut as T, effectiveDeletionPolicy as Ta, passedParameterClassesOf as Tc, resolveBucketRegion as Td, carriedExportAliasExposure as Ti, refuseDivergentRecordRegionForDestroy as Tl, sameJournaledOrphans as Tn, customResourcesFailedWithoutApp as To, settleUnsettledPrevious as Tr, refStateLookupFromResource as Ts, DYNAMODB_DELETE_POLL_COST_MS as Tt, listNestedTemplateRows as Tu, reverseMapStreamPolicy as U, KMS_DEFAULT_KEY_POLICY_ID as Ua, malformedResourceEntriesWarning as Uc, supersededHolderOf as Ui, findHandledUnwrittenCreateOnly as Ul, movedToHint as Un, IntrinsicFunctionResolver as Uo, isJournaledOrphan as Ur, keepsSecretReferenceToken as Us, recordRetainedForReadoption as Ut, redirectDockerAsset as Uu, planStreamMemberOps as V, verifiedIdentityCache as Va, malformedLocalResourceEntriesWarning as Vc, supersededDependentsFirst as Vi, hasReadableResources as Vl, findRefactorHints as Vn, isWaitAbandonedError as Vo, seedsDeleteFirstGuard as Vr, isNamelessDynamicReferenceError as Vs, isTruthyCfnBoolean as Vt, isDefaultBootstrapRepoName as Vu, streamDeclaresPolicy as W, LAMBDA_PERMISSION_STATEMENT_KEYS as Wa, malformedScrubResourceEntriesRefusalMessage as Wc, supersededResourcesOf as Wi, findSdkUnwiredProperties as Wl, rollbackOrphanIds as Wn, isSelectOutOfBounds as Wo, isReplacementOrphan as Wr, withSharedDrainBudget as Ws, readRefactorMarker as Wt, redirectFileAsset as Wu, clearTagWrites as X, lambdaPermissionMatchesDeclared as Xa, refuseMalformedResourceEntriesForImportSave as Xc, findNestedStackTypeChanges as Xi, hasNoCloudControlHandlers as Xl, isPairableType as Xn, producerLookupOver as Xo, computeImplicitDeleteEdges as Xr, siblingsOf as Xs, updateRefactorMarker as Xt, resolveFileAssetSourcePath as Xu, TAGS_BASELINE_REREAD_DELAYS_MS as Y, efsPolicyMatchesDeclared as Ya, refuseMalformedResourceEntriesForImport as Yc, withPreviousPolicies as Yi, NO_CC_HANDLERS_REASON as Yl, differingRemedy as Yn, resolveDynamicReferences as Yo, IMPLICIT_DELETE_DEPENDENCIES as Yr, replacementSidesForLog as Ys, sameMove as Yt, parseAssetManifestBody as Yu, declaredTagsReadback as Z, memberReadFailure as Za, refuseMalformedResourceEntriesForOrphan as Zc, bold as Zi, PROPERTY_COVERAGE_BY_TYPE as Zl, looselyEqual as Zn, refuseUnreadableCdkCrossAccountRefs as Zo, attemptUsesCompletedCreate as Zr, LEGACY_HANDLE_ID_PREFIX as Zs, deleteSignalReceiver as Zt, warnAbsoluteAssetPath as Zu, conditionFingerprint as _, secretNamedRecordNeedles as _a, getSettledWriteOnlyPropertyPaths as _c, absoluteAssemblyPathEscape as _d, reachableDivergentParameters as _i, malformedLocalOutputsWarning as _l, getCurrentNestedStackContext as _n, responsePresignClient as _o, replayFailedOperations as _r, s3BucketRegionalDomainName as _s, planContributorInsightsOp as _t, stackInstanceIdOf as _u, scanActiveConsumers as a, noEchoExactEchoLeavesOf as aa, renderStatefulReason as ac, parseBootstrapMarker as ad, orphanNeedsIdentity as ai, refuseMalformedResourcePropertiesForExport as al, resolvePendingCloudControlRequests as an, CC_BROKEN_REASON as ao, undeclaredGrantSiblingMembers as ar, AWS_CREDENTIAL_ENV_KEYS as as, planTimeToLive as at, splitImportedOps as au, readRecordedConditionVerdicts as b, extractDeploymentEventError as ba, inputFingerprinter as bc, displayAssemblyPath as bd, displayTextOrWithheld as bi, refuseMalformedNestedChildOutputs as bl, dropFailedCommands as bn, isCustomResourceType as bo, PLANNED_EARLY_DELETE_CONSEQUENCE as br, isUnboundTemplateParameter as bs, reverseMapIndexContributorInsights as bt, isSensitiveAttributeName as bu, nestedSsmNameDeferredNote as c, createReadOnlyAttributeHealerFactory as ca, isWarmThroughputDecrease as cc, validateContainerRepoName as cd, nameScopeOf as ci, UNREADABLE_ORPHANS_CONTAINER_ROW as cl, displacedPhysicalIdShown as cn, isCustomResource as co, sgSiblingDecidedById as cr, envCredentialsAreAssumedRole as cs, planVectorIndexUpdates as ct, hasReasonlessBaselineRefusal as cu, slashedSsmNameHealAdoptedNote as d, maskEventTextWithBoundBags as da, APPSYNC_APIKEY_ARN_RESOURCE_PATH as dc, getCdkdContainerRepoName as dd, retiredNameGenerationsLeaving as di, malformedOrphansWarning as dl, nestedChildStackName as dn, classifyHandleUrl as do, withoutSiblingOwnedSgRules as dr, producerRegionsFromState as ds, vectorIndexesSettled as dt, CrossPrefixReadError as du, green as ea, isPlainReferenceTo as ec, ensureAssetStorage as ed, isRedactedRecordedValue as ei, malformedDriftResourcePropertiesWarning as el, macWriteOnlyKeys as en, settleDeclaredMember as eo, propertiesChangedReason as er, assertSendableRoleArn as es, settleWrittenTags as et, providerReplacementReason as eu, slashedSsmNameHealNote as f, namingSecretsWithRecordedNoEcho as fa, displayPhysicalId as fc, defineOwnKey as fd, withNameGenerationReached as fi, refuseMalformedOrphans as fl, recordDisplacedSkips as fn, evaluateSignals as fo, SG_RULE_ID_PATTERN as fr, regionLessSecretName as fs, vectorIndexesShapeDetail as ft, CrossPrefixScanCache as fu, makeCanonicalizePropertiesFn as g, secretNamedAttributeNamesOf as ga, withSecretPhysicalIdsMaskedInState as gc, ownValue as gd, namesAnyDeclaredParameter as gi, malformedExportSourceWarning as gl, collectNestedChildUnaddressed as gn, customResourceResponseExpirationWarning as go, canonicalizeIpProtocolValue as gr, s3BucketDualStackDomainName as gs, indexDeclaresContributorInsights as gt, isNotImplemented as gu, inheritedProvenanceForChildDiff as h, secretNamePrintingBags as ha, secretSegmentsOfState as hc, nullPrototypeRecord as hd, computeParameterTaint as hi, malformedExportNamesWarning as hl, withNestedRevertRun as hn, applyCustomResourceResponseExpiration as ho, sgProtocolKey as hr, s3BucketDomainName as hs, contributorInsightsRefusals as ht, isAccessDenied$1 as hu, mergeNoChangeOutputs as i, noEchoComparisonForTemplate as ia, isStatefulRecreateTargetSync as ic, getBootstrapMarkerKey as id, removeProtectionTypeList as ii, refuseMalformedResourcePropertiesForDrift as il, pendingRequestCount as in, policyContentKey as io, stripSiblingOwnedParentMembers as ir, sendableAssumeRoleCommand as is, isTtlRateLimited as it, S3StateBackend as iu, recordedProtectionNote as j, collectGroupsAddedBySiblings as ja, malformedOrphanRecordsWarning as jc, collectPublishedOutputNames as ji, refuseMalformedResourcesForExport as jl, crossStackReadsForPartialSave as jn, waitForLambdaFunctionActive as jo, updatePartialMessage as jr, keepHeldTokenProvenance as js, DELETE_INDEX_WAIT_PROCEED_NOTE as jt, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as ju, diffSecurity as k, createPreDeleteFinalSnapshot as ka, isReadableOrphanRecord as kc, noEchoParameterValueSeed as ki, refuseMalformedResourcesForDeploy as kl, DeploymentEventsReader as kn, setLocalCustomResourceRuntimeEnabled as ko, equalModuloMask as kr, extractGetAttRefs as ks, resolveDynamoDbDeleteBudgetClock as kt, isListParameterType as ku, nestedSsmNameRowNote as l, completedReplayEntries as la, toCfnInteger as lc, BOOTSTRAP_MARKER_PREFIX as ld, retiredAfterRollback as li, hasReadableOrphans as ll, dropSettledNestedJournals as ln, wouldReturnToSdkProvider as lo, siblingOwnedSgRuleIdentities as lr, classifyRecordedSecretRegion as ls, readbackVectorIndexes as lt, hasUnverifiableParameterRefusal as lu, crossStackOutputProvenanceSource as m, secretNamePrintingBag as ma, secretPhysicalIdSegment as mc, hasPlainPrototype as md, inheritProducerRegions as mi, repairMalformedOrphansForReadOnly as ml, revertedNestedRowIds as mn, CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID as mo, recordedSgRuleId as mr, s3BucketArn as ms, completeTableContributorInsightsBaseline as mt, crossPrefixDeniedWarning as mu, isSecretBearingReferenceString as n, yellow as na, MULTI_REGION_RECREATE_BLOCKED_TYPES as nc, assertAssetBucketRegion as nd, redactedDeleteAddressSkip as ni, refuseMalformedResourceProperties as nl, licensedNameHolder as nn, verbatimEchoDriftKeys as no, referencedLogicalIds as nr, isIamRoleArn as ns, takeTagWrite as nt, planSubscriptionAttributes as nu, inRunStackKey as o, noEchoParameterNamesOf as oa, WARM_THROUGHPUT_MEMBERS as oc, readBootstrapMarkerBody as od, nameGenerationCarriedFrom as oi, refuseMalformedResourcePropertiesForOrphan as ol, NESTED_PENDING_PARENT_REASON as on, ProviderRegistry as oo, recordedRuleIdOf as or, applyCallerIdentityCredentials as os, readTtlSpec as ot, isKnownTokenFreeState as ou, slashedSsmNameHealPendingNote as p, orphanRecordsPrintingBag as pa, maskedSecretSegment as pc, hasOwnKey as pd, getCurrentProducerRegions as pi, refuseMalformedOrphansForDestroy as pl, revertNestedChildFromJournal as pn, isSignalKey as po, cfnIngressPortValue as pr, isUnexposedRecordedIdentity as ps, CONTRIBUTOR_INSIGHTS_KEY as pt, applyCrossPrefixScan as pu, streamPolicyMatchesDeclared as q, declaredMemberDocument as qa, refuseMalformedResourceEntriesForDeploy as qc, snapshotSegmentSurvivors as qi, withoutSdkUnwiredProperties as ql, changedReferencePath as qn, stackIdTailOf as qo, recordUnderIdIsNotOwn as qr, containsIntrinsic as qs, refactorMarkerRefusalMessage as qt, getDockerImageBySourceHash as qu, keptWholeReasonText as r, noEchoAttributeNamesOf as ra, isStatefulRecreateTargetForReplace as rc, isCrossRegionRedirect as rd, segmentCleanupOptions as ri, refuseMalformedResourcePropertiesForDestroy as rl, formatResourceLine as rn, attemptedPolicyDocument as ro, siblingOwnedRevertDesired as rr, parseIamRoleArn as rs, isTtlAlreadyDisabled as rt, TemplateParser as ru, checkNestedSsmNames as s, withAttemptedItemsMasked as sa, coerceWarmThroughput as sc, validateAssetBucketName as sd, nameGenerationHighWaterOf as si, repairMalformedResourcePropertiesForReadOnly as sl, displacedOpClause as sn, ccBrokenReason as so, sgRuleOwnershipIdentity as sr, callerEnvCredentials as ss, sendTtlWaitingOutRateLimit as st, readOnlyStateVersionOf as su, DeployEngine as t, red as ta, shownType as tc, buildDenyExternalAccessPolicy as td, redactedDeleteAddressFields as ti, malformedResourcePropertiesWarning as tl, readsOnlyNoEchoParameters as tn, warnUnsettledMember as to, proposeRenames as tr, explicitRoleArnOrThrow as ts, tagsMatchDeclared as tt, normalizeRecordName as tu, healSlashedSsmParameterNames as u, journaledOrphanPrintingBag as ua, toFiniteNumber as uc, getCdkdAssetBucketName as ud, retiredNameGenerationsAfter as ui, malformedOrphansRefusalMessage as ul, getNestedRevertRun as un, WaitConditionSignalStore as uo, siblingRecordedSgRuleIds as ur, classifyReplaySecretRegion as us, vectorIndexesForCreate as ut, rebuildClientForBucketRegion as uu, conditionInputsFrom as v, stateSecretNameNeedles as va, getTopLevelKeysHoldingUnreadableCreateOnly as vc, assemblyPathEscape as vd, resourcesNamingDeclaredParameter as vi, malformedOutputsRefusalMessage as vl, withNestedStackContext as vn, TemplateNoEchoReresolver as vo, replayRollback as vr, s3BucketWebsiteUrl as vs, planIndexContributorInsightsOps as vt, withStackInstanceIdWithheld as vu, pendingMovesRefusalMessage as w, ccRoutedInstanceTakesNoSnapshot as wa, maskedInputProof as wc, clearBucketRegionCache as wd, secretSafeKeyDisplay as wi, STATE_REGION_DIVERGED as wl, loadJournaledOrphans as wn, customResourceStackName as wo, recordAfterRollbackUpdate as wr, isStalePlaceholderArnAttribute as ws, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as wt, isAbsoluteAssetPath as wu, childTemplateLoader as x, ATOMIC_FINAL_SNAPSHOT_TYPES as xa, maskedPropertyFingerprintsOf as xc, namesTheSameDirectory as xd, exportAliasCollisionScrubWarning as xi, refuseMalformedOutputs as xl, dropFailedHint as xn, getCurrentResourceSecrets as xo, earlyDeleteWhen as xr, parameterTypeMayLoseSecretIdentity as xs, reverseMapTableContributorInsights as xt, stringifyValue as xu, parentSuppliedValues as y, storedSecretNameNeedles as ya, tryGetTopLevelWriteOnlyProperties as yc, describeFileReadFailure as yd, WITHHELD_NAME_DISPLAY as yi, malformedOutputsWarning as yl, deleteJournaledOrphans as yn, readsNoEchoDeleteValues as yo, DELETED_RESOURCE_REMEDY as yr, coerceParameterTypedValue as ys, readContributorInsightsSpec as yt, isSecretValuedAttribute as yu, declaredStreamPolicyMember as z, getStackRecords as za, unreadableOrphanRecords as zc, isSupersededResourceRecord as zi, displayLogicalId as zl, findDestructiveChanges as zn, withIndeterminateGuard as zo, acquireIdempotencyToken as zr, isImpossibleEmptyStoredAttribute as zs, S3_AUTO_DELETE_OBJECTS_TAG as zt, flattenAssetPlaceholders as zu };
55785
+ //# sourceMappingURL=deploy-engine-BSqVfcSN.js.map