@cdkd/cli 0.358.6 → 0.359.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 (58) hide show
  1. package/dist/{ambient-client-defaults-XFcZ_IMI.js → ambient-client-defaults-BNqC0q-Z.js} +3 -3
  2. package/dist/{ambient-client-defaults-XFcZ_IMI.js.map → ambient-client-defaults-BNqC0q-Z.js.map} +1 -1
  3. package/dist/{asg-provider-BP8oMti2.js → asg-provider-BDCUGWZV.js} +6 -6
  4. package/dist/{asg-provider-BP8oMti2.js.map → asg-provider-BDCUGWZV.js.map} +1 -1
  5. package/dist/cli.js +3 -3
  6. package/dist/{custom-resource-runtime-QfoyaxPW.js → custom-resource-runtime-DMkX_oQo.js} +6 -6
  7. package/dist/{custom-resource-runtime-QfoyaxPW.js.map → custom-resource-runtime-DMkX_oQo.js.map} +1 -1
  8. package/dist/{db-associated-roles-5I6qQ0C6.js → db-associated-roles-Bx5ML-MI.js} +2 -2
  9. package/dist/{db-associated-roles-5I6qQ0C6.js.map → db-associated-roles-Bx5ML-MI.js.map} +1 -1
  10. package/dist/{delete-started-B3fWZ4t9.js → delete-started-V5NHQ1O-.js} +4 -4
  11. package/dist/{delete-started-B3fWZ4t9.js.map → delete-started-V5NHQ1O-.js.map} +1 -1
  12. package/dist/{deploy-engine-DwpkRhxS.js → deploy-engine-BjSv27_M.js} +2111 -906
  13. package/dist/deploy-engine-BjSv27_M.js.map +1 -0
  14. package/dist/{ec2-termination-protection-CEAH5-4N.js → ec2-termination-protection-hc3MeuqF.js} +11 -7
  15. package/dist/ec2-termination-protection-hc3MeuqF.js.map +1 -0
  16. package/dist/{ecr-uri-CsP8Bfa_.js → ecr-uri-D1ijxg7D.js} +2 -2
  17. package/dist/{ecr-uri-CsP8Bfa_.js.map → ecr-uri-D1ijxg7D.js.map} +1 -1
  18. package/dist/{expected-bucket-owner-Lk8hXI9d.js → expected-bucket-owner-CQimj8gv.js} +2 -2
  19. package/dist/{expected-bucket-owner-Lk8hXI9d.js.map → expected-bucket-owner-CQimj8gv.js.map} +1 -1
  20. package/dist/{iam-role-provider-B6iCxpQV.js → iam-role-provider-b46RdZD5.js} +117 -68
  21. package/dist/iam-role-provider-b46RdZD5.js.map +1 -0
  22. package/dist/{image-plan-D-54O-Nq.js → image-plan-DtFbiJj5.js} +8 -8
  23. package/dist/{image-plan-D-54O-Nq.js.map → image-plan-DtFbiJj5.js.map} +1 -1
  24. package/dist/index.d.ts +4 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +5 -5
  27. package/dist/{logger-jcgg96uu.js → logger-CqKPJ_tV.js} +2 -2
  28. package/dist/{logger-jcgg96uu.js.map → logger-CqKPJ_tV.js.map} +1 -1
  29. package/dist/{neptune-provider-CpoLlf2R.js → neptune-provider-DiyWADaS.js} +7 -7
  30. package/dist/{neptune-provider-CpoLlf2R.js.map → neptune-provider-DiyWADaS.js.map} +1 -1
  31. package/dist/{program-DDysnPS0.js → program-Cdwgr3Yv.js} +882 -391
  32. package/dist/program-Cdwgr3Yv.js.map +1 -0
  33. package/dist/{provider-classes-CwIe3PGY.js → provider-classes-DhmwW7hI.js} +938 -514
  34. package/dist/provider-classes-DhmwW7hI.js.map +1 -0
  35. package/dist/{rds-provider-DJtzCaTQ.js → rds-provider-DpOZv_UG.js} +10 -10
  36. package/dist/{rds-provider-DJtzCaTQ.js.map → rds-provider-DpOZv_UG.js.map} +1 -1
  37. package/dist/{read-replica-eSaw4q1p.js → read-replica-Ct0oakPU.js} +3 -3
  38. package/dist/{read-replica-eSaw4q1p.js.map → read-replica-Ct0oakPU.js.map} +1 -1
  39. package/dist/{replacement-rules-DOyuWYSl.js → replacement-rules-CMnMy7rf.js} +3 -3
  40. package/dist/{replacement-rules-DOyuWYSl.js.map → replacement-rules-CMnMy7rf.js.map} +1 -1
  41. package/dist/{resource-deadline-Cd5Jfimc.js → resource-deadline-DlZTHrBj.js} +123 -122
  42. package/dist/resource-deadline-DlZTHrBj.js.map +1 -0
  43. package/dist/{restore-source-guard-YKb1WUF2.js → restore-source-guard-DIs6rqZm.js} +4 -4
  44. package/dist/{restore-source-guard-YKb1WUF2.js.map → restore-source-guard-DIs6rqZm.js.map} +1 -1
  45. package/dist/{run-cli-CyokhRcp.js → run-cli-BLZnjA32.js} +2 -2
  46. package/dist/{run-cli-CyokhRcp.js.map → run-cli-BLZnjA32.js.map} +1 -1
  47. package/dist/{diff-calculator-Drt5nkqk.js → settle-own-write-members-C1uPhq2z.js} +161 -16
  48. package/dist/settle-own-write-members-C1uPhq2z.js.map +1 -0
  49. package/dist/{version-DKW7jD3V.js → version-DyE_oClc.js} +2 -2
  50. package/dist/{version-DKW7jD3V.js.map → version-DyE_oClc.js.map} +1 -1
  51. package/package.json +1 -1
  52. package/dist/deploy-engine-DwpkRhxS.js.map +0 -1
  53. package/dist/diff-calculator-Drt5nkqk.js.map +0 -1
  54. package/dist/ec2-termination-protection-CEAH5-4N.js.map +0 -1
  55. package/dist/iam-role-provider-B6iCxpQV.js.map +0 -1
  56. package/dist/program-DDysnPS0.js.map +0 -1
  57. package/dist/provider-classes-CwIe3PGY.js.map +0 -1
  58. package/dist/resource-deadline-Cd5Jfimc.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-DKW7jD3V.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-jcgg96uu.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-XFcZ_IMI.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-DyE_oClc.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-CqKPJ_tV.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-BNqC0q-Z.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 withRetry, B as phaseTimingsEnabled, C as templateResourceTypes, D as isAwsEmulatorRegistryMiss, E as hasNoRegistrySchema, F as ignoresUnmodifiedGroupSize, G as describeJsonParseFailure, I as rollingUpdatePolicy, J as parseJsonNamingNoBody, K as jsonParseFailureStandIn, L as willReplaceGroup, M as INSTANCE_REFRESH_TRIGGER_PROPERTIES, N as REPLACEMENT_TRIGGER_PROPERTIES, O as reportAwsEmulatorRegistryMiss, R as PhaseClock, S as prefetchCreateOnlyPropertyPaths, T as describeTypeWithThrottleRetry, U as timePhase, V as recordPhase, W as timePhaseSync, Y as utf8ByteLength, _ as unchangedBehindSecretReference, a as reDisableInstanceApiTermination, b as getCreateOnlyPropertyPaths, d as markRefusedBeforeApplying, f as priorAttemptLookup, h as withPriorAttempts, i as observeThenDisableInstanceApiTermination, j as CREATE_ONLY_PATHS_SNAPSHOT, k as IAM_PROPAGATION_MAX_DELAY_MS, m as provenOrphanIdsInJournal, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, p as priorAttemptsInJournal, q as parseFailureDebugDetail, r as isTerminationProtectionPropagationError, s as resolvedResourceTimeoutMs, u as isRefusedBeforeApplying, v as cachedCreateOnlyPropertyPaths, w as parseCreateOnlyPropertyPointers, x as isIntrinsicShaped, z as phaseScopeForStack } from "./ec2-termination-protection-CEAH5-4N.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-hc3MeuqF.js";
7
7
  import { i as sameRegion, n as canonicalizeRegion, r as derivePartitionAndUrlSuffix } from "./aws-partition-DA0r2sr-.js";
8
- import { $ as deleteWithProtectionCompensation, $t as markAuxiliaryFailure, At as canonicalizeRoute53QueryName, Bt as createMaskedRetryLogger, Ct as protectedReplacementAdvice, Gt as RETRY_AUXILIARY_OWNER, H as normalizeAwsTagsToCfn, Ht as maskDeep, I as withoutServerErrorRetries, It as resourceTypeShown, J as RESOURCE_NOT_FOUND, Jt as createdBeforeFailure, K as resolveExplicitPhysicalId, Lt as segmentAfterAnchor, Mt as compositeIdSeparatorRefusal, Ot as isInterruptedWaitError, Pt as logicalIdShown, Q as compensateProtectionFlip, Qt as isAuxiliaryMarkOf, Rt as stateOrphanRecordRemedy, St as pasteableAwsCommand, T as withUnchangedSecretPrincipalLists, U as quotedRemedyLogicalId, Ut as maskerOrIdentity, V as isQuotableImportValue, Vt as isSecretDerivedValue, W as refusalTypeShown, Wt as withDerivedNameMasks, X as isMarkedNotGone, Y as assertRegionMatch, Yt as createdResourceIdentityBeforeFailure, Z as markNotGone, Zt as isAuxiliaryFailure, _n as injectiveKey, _t as monotonicNowMs, bn as producerRecordKey, d as CreatedResourceSink, dn as sanitizeRecoveryValue, dt as ProtectionFlipRegistry, en as markCreatedBeforeFailure, f as clearCreatedReport, fn as CUSTOM_RESOURCE_RESPONSE_PREFIX, ft as isTerminalDeleteFailure, g as retractCreatedResource, gn as withPasteableAwsProfile, gt as ElapsedBudgetRegistry, ht as ElapsedBudget, i as withResourceDeadline, kt as startInterruptWatch, m as reportCreatedResource, mt as runDeleteAttempt, n as enclosingDeadlineRemainingMs, o as prepareRemovalForUpdate, p as collectCreatedResources, pn as DEFAULT_STATE_PREFIX, pt as protectionFlipKey, r as whileEnclosingDeadlinesPaused, s as removalWarning, t as enclosingDeadlineExpired, tt as observeThenDisableProtection, u as withoutInjectedRemovals, un as recoveryCommandFlags, vt as DELETION_PROTECTION_DOC_POINTER, zt as createMaskedLogSinks } from "./resource-deadline-Cd5Jfimc.js";
9
- import { t as expectedOwnerParam } from "./expected-bucket-owner-Lk8hXI9d.js";
10
- import { Ct as isReadableBag, Dt as skippedOutputsCarriedFrom, Et as shouldRetainResource, Ot as stackInstanceIdCarriedFrom, St as importableOutputs, Tt as orphansCarriedFrom, _t as acceptedCreateOnlyDropsOf, gt as slowCcOperationTimeoutMs, ht as dbInstanceAttributes, i as dbClusterAttributes, n as isRefusedByName, r as markDeleteStarted, t as isDeleteStarted, vt as describeRegionValueKind, wt as orphansAfterRollback, xt as importableOutputKeys, yt as exportNamesCarriedFrom } from "./delete-started-B3fWZ4t9.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$6, 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-DOyuWYSl.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-YKb1WUF2.js";
8
+ import { $t as markAuxiliaryFailure, At as canonicalizeRoute53QueryName, B as assertRegionMatch, Bt as createMaskedRetryLogger, D as withoutServerErrorRetries, F as refusalTypeShown, Gt as RETRY_AUXILIARY_OWNER, H as markNotGone, Ht as maskDeep, It as resourceTypeShown, Jt as createdBeforeFailure, K as observeThenDisableProtection, L as resolveExplicitPhysicalId, Lt as segmentAfterAnchor, M as isQuotableImportValue, Mt as compositeIdSeparatorRefusal, N as normalizeAwsTagsToCfn, P as quotedRemedyLogicalId, Pt as logicalIdShown, Qt as isAuxiliaryMarkOf, 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, 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, wt as holdsSecretDerivedEntry, xn as producerRecordKey, yt as isInterruptedWaitError, z as RESOURCE_NOT_FOUND, zt as createMaskedLogSinks } from "./resource-deadline-DlZTHrBj.js";
9
+ import { t as expectedOwnerParam } from "./expected-bucket-owner-CQimj8gv.js";
10
+ import { Ct as isReadableBag, Dt as skippedOutputsCarriedFrom, Et as shouldRetainResource, Ot as stackInstanceIdCarriedFrom, St as importableOutputs, Tt as orphansCarriedFrom, _t as acceptedCreateOnlyDropsOf, gt as slowCcOperationTimeoutMs, ht as dbInstanceAttributes, i as dbClusterAttributes, n as isRefusedByName, r as markDeleteStarted, t as isDeleteStarted, vt as describeRegionValueKind, wt as orphansAfterRollback, xt as importableOutputKeys, yt as exportNamesCarriedFrom } from "./delete-started-V5NHQ1O-.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-CMnMy7rf.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-DIs6rqZm.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";
@@ -82,7 +82,7 @@ async function resolveBucketRegion(bucketName, opts = {}) {
82
82
  });
83
83
  }
84
84
  try {
85
- const { expectedOwnerParam } = await import("./expected-bucket-owner-Lk8hXI9d.js").then((n) => n.n);
85
+ const { expectedOwnerParam } = await import("./expected-bucket-owner-CQimj8gv.js").then((n) => n.n);
86
86
  return (await client.send(new GetBucketLocationCommand({
87
87
  Bucket: bucketName,
88
88
  ...await expectedOwnerParam(client)
@@ -1803,7 +1803,7 @@ var CrossPrefixReadError = class extends Error {
1803
1803
  key;
1804
1804
  cause;
1805
1805
  constructor(key, cause) {
1806
- super(`reading ${displayIdent(key, { maxCodePoints: 1024 })} failed (${errorName$1(cause, "an unknown error")})`);
1806
+ super(`reading ${displayIdent(key, { maxCodePoints: 1024 })} failed (${errorName$2(cause, "an unknown error")})`);
1807
1807
  this.name = "CrossPrefixReadError";
1808
1808
  this.key = key;
1809
1809
  this.cause = cause;
@@ -2081,7 +2081,7 @@ function destructiveDeployUnderOtherPrefixMessage(s, prefixes, action = "deploy-
2081
2081
  function staleRecordNotice(s, prefixes) {
2082
2082
  return `Note: bucket ${displayIdent(s.bucket)} also holds a record of stack ${subjectText(s)} under another state prefix (${prefixesText(prefixes)}) that owns no resource -- the leftover of a failed first deploy. It does not block this command; remove it with \`${stateCommand("orphan", s, prefixes[0])}\`${prefixes.length > 1 ? ", and the same with each other prefix" : ""}.`;
2083
2083
  }
2084
- function errorName$1(error, fallback) {
2084
+ function errorName$2(error, fallback) {
2085
2085
  const subject = error instanceof CrossPrefixReadError ? error.cause : error;
2086
2086
  return subject !== null && typeof subject === "object" && typeof subject.name === "string" ? displaySafe(subject.name, { asciiOnly: true }) : fallback;
2087
2087
  }
@@ -2089,10 +2089,10 @@ function failedKeyText(error) {
2089
2089
  return error instanceof CrossPrefixReadError ? ` reading s3 object ${displayIdent(error.key, { maxCodePoints: 1024 })}` : "";
2090
2090
  }
2091
2091
  function crossPrefixDeniedWarning(s, error, stage = "probe") {
2092
- if (stage === "registry" && isNotImplemented(unwrapCause(error))) return `Could not use the stack registry for stack ${subjectText(s)}: the state bucket's endpoint does not implement a conditional write${failedKeyText(error)} (${errorName$1(error, "NotImplemented")}), so the bucket's other state prefixes were scanned instead, which is slower. Continuing.`;
2093
- if (stage === "registry") return `Could not use the stack registry for stack ${subjectText(s)}: S3 refused${failedKeyText(error)} (${errorName$1(error, "AccessDenied")}), so the bucket's other state prefixes were scanned instead, which is slower. Grant s3:GetObject, s3:PutObject and s3:DeleteObject on ${displayIdent(s.bucket)}/_cdkd-registry/* to use it. Continuing.`;
2092
+ if (stage === "registry" && isNotImplemented(unwrapCause(error))) return `Could not use the stack registry for stack ${subjectText(s)}: the state bucket's endpoint does not implement a conditional write${failedKeyText(error)} (${errorName$2(error, "NotImplemented")}), so the bucket's other state prefixes were scanned instead, which is slower. Continuing.`;
2093
+ if (stage === "registry") return `Could not use the stack registry for stack ${subjectText(s)}: S3 refused${failedKeyText(error)} (${errorName$2(error, "AccessDenied")}), so the bucket's other state prefixes were scanned instead, which is slower. Grant s3:GetObject, s3:PutObject and s3:DeleteObject on ${displayIdent(s.bucket)}/_cdkd-registry/* to use it. Continuing.`;
2094
2094
  const what = stage === "list" ? `S3 refused to list bucket ${displayIdent(s.bucket)}` : `S3 refused a read under another state prefix of bucket ${displayIdent(s.bucket)}`;
2095
- return `Could not check the other state prefixes for stack ${subjectText(s)}: ${what} (${errorName$1(error, "AccessDenied")}). Continuing. Deploying one stack name under two state prefixes in one account and region is unsupported.`;
2095
+ return `Could not check the other state prefixes for stack ${subjectText(s)}: ${what} (${errorName$2(error, "AccessDenied")}). Continuing. Deploying one stack name under two state prefixes in one account and region is unsupported.`;
2096
2096
  }
2097
2097
  function inProgressUnderOtherPrefixMessage(s, action, prefix) {
2098
2098
  const account = recoveryCommandFlags({
@@ -2118,7 +2118,7 @@ function inProgressUnderOtherPrefixMessage(s, action, prefix) {
2118
2118
  return `Refusing to ${VERB[action]} stack ${subjectText(s)}: bucket ${displayIdent(s.bucket)} assigns it to state prefix ${displayIdent(prefix)}, which records nothing for it yet but holds its lock, so a deploy there may be in progress. ${UNSUPPORTED_SENTENCE} ${NOTHING[action]} Re-run once that deploy has finished; if none is running, remove its lock with \`${unlock}\` and re-run.`;
2119
2119
  }
2120
2120
  function crossPrefixFailedMessage(s, action, error) {
2121
- return `Refusing to ${VERB[action]} stack ${subjectText(s)}: cdkd could not check whether the bucket ${displayIdent(s.bucket)} records it under another state prefix (${errorName$1(error, "an unknown error")}${failedKeyText(error)}). ${UNSUPPORTED_SENTENCE} ${NOTHING[action]} Re-run once the check can succeed.`;
2121
+ return `Refusing to ${VERB[action]} stack ${subjectText(s)}: cdkd could not check whether the bucket ${displayIdent(s.bucket)} records it under another state prefix (${errorName$2(error, "an unknown error")}${failedKeyText(error)}). ${UNSUPPORTED_SENTENCE} ${NOTHING[action]} Re-run once the check can succeed.`;
2122
2122
  }
2123
2123
  function applyCrossPrefixScan(result, s, action, warn, info) {
2124
2124
  if (result.kind !== "in-progress" && result.stale !== void 0 && result.stale.length > 0) info?.(staleRecordNotice(s, result.stale));
@@ -4946,6 +4946,18 @@ const PROPERTY_COVERAGE_BY_TYPE = /* @__PURE__ */ new Map([
4946
4946
  primaryIdentifier: /* @__PURE__ */ new Set(["StackId"]),
4947
4947
  ccRouteUnavailable: true
4948
4948
  }],
4949
+ ["AWS::CloudFormation::WaitCondition", {
4950
+ handled: /* @__PURE__ */ new Set([
4951
+ "Count",
4952
+ "Handle",
4953
+ "Timeout"
4954
+ ]),
4955
+ sdkUnwired: /* @__PURE__ */ new Map(),
4956
+ createOnlyDrops: /* @__PURE__ */ new Set(),
4957
+ readOnly: /* @__PURE__ */ new Set(["Data", "Id"]),
4958
+ primaryIdentifier: /* @__PURE__ */ new Set(["Id"]),
4959
+ ccRouteUnavailable: true
4960
+ }],
4949
4961
  ["AWS::CloudFormation::WaitConditionHandle", {
4950
4962
  handled: /* @__PURE__ */ new Set(),
4951
4963
  sdkUnwired: /* @__PURE__ */ new Map(),
@@ -7571,7 +7583,6 @@ const NON_PROVISIONABLE_TYPES = /* @__PURE__ */ new Set([
7571
7583
  "AWS::CleanRoomsML::TrainedModelInferenceJob",
7572
7584
  "AWS::CloudFormation::Macro",
7573
7585
  "AWS::CloudFormation::ResourceScan",
7574
- "AWS::CloudFormation::WaitCondition",
7575
7586
  "AWS::CloudFront::StreamingDistribution",
7576
7587
  "AWS::CloudHSMV2::Backup",
7577
7588
  "AWS::CodeArtifact::Package",
@@ -7853,6 +7864,7 @@ const SDK_PROVIDER_NON_PROVISIONABLE_TYPES = /* @__PURE__ */ new Set([
7853
7864
  "AWS::BedrockAgentCore::Browser",
7854
7865
  "AWS::BedrockAgentCore::CodeInterpreter",
7855
7866
  "AWS::Budgets::Budget",
7867
+ "AWS::CloudFormation::WaitCondition",
7856
7868
  "AWS::CloudFormation::WaitConditionHandle",
7857
7869
  "AWS::CloudWatch::AnomalyDetector",
7858
7870
  "AWS::CodeBuild::Project",
@@ -8877,12 +8889,12 @@ function malformedOrphansForOrphanRefusalMessage(rawStackName, rawRegion, logica
8877
8889
 
8878
8890
  // src/deployment/masked-property-fingerprints/core.ts
8879
8891
  const FINGERPRINT_LAYOUT$1 = 1;
8880
- function canonicalJson$5(value) {
8892
+ function canonicalJson$6(value) {
8881
8893
  if (value === void 0) return "null";
8882
- if (Array.isArray(value)) return `[${value.map(canonicalJson$5).join(",")}]`;
8894
+ if (Array.isArray(value)) return `[${value.map(canonicalJson$6).join(",")}]`;
8883
8895
  if (value !== null && typeof value === "object") {
8884
8896
  const record = value;
8885
- return `{${Object.keys(record).filter((key) => record[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson$5(record[key])}`).join(",")}}`;
8897
+ return `{${Object.keys(record).filter((key) => record[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson$6(record[key])}`).join(",")}}`;
8886
8898
  }
8887
8899
  return JSON.stringify(value) ?? "null";
8888
8900
  }
@@ -8903,7 +8915,7 @@ function splitInputFingerprint(entry) {
8903
8915
  };
8904
8916
  }
8905
8917
  function templateCarriesNeedle(templateValue, secrets) {
8906
- const text = canonicalJson$5(templateValue);
8918
+ const text = canonicalJson$6(templateValue);
8907
8919
  for (const needle of printingCorpusOf(secrets).keys()) {
8908
8920
  if (needle.length < 4) continue;
8909
8921
  if (text.includes(needle) || text.includes(JSON.stringify(needle).slice(1, -1))) return true;
@@ -8911,7 +8923,7 @@ function templateCarriesNeedle(templateValue, secrets) {
8911
8923
  return false;
8912
8924
  }
8913
8925
  function maskedPropertyFingerprint(templateValue) {
8914
- const digest = createHash("sha256").update(canonicalJson$5({
8926
+ const digest = createHash("sha256").update(canonicalJson$6({
8915
8927
  layout: FINGERPRINT_LAYOUT$1,
8916
8928
  value: templateValue
8917
8929
  })).digest("hex");
@@ -8953,34 +8965,34 @@ function passedKey(passed) {
8953
8965
  function isNestedStackRow(logicalId, walk) {
8954
8966
  if (!Object.hasOwn(walk.resources, logicalId)) return false;
8955
8967
  const definition = walk.resources[logicalId];
8956
- return isPlainObject$9(definition) && definition["Type"] === "AWS::CloudFormation::Stack";
8968
+ return isPlainObject$10(definition) && definition["Type"] === "AWS::CloudFormation::Stack";
8957
8969
  }
8958
8970
  function getAttAttribute(operand, target) {
8959
8971
  if (Array.isArray(operand)) return operand.length === 2 && typeof operand[1] === "string" ? operand[1] : void 0;
8960
8972
  return typeof operand === "string" ? operand.slice(target.length + 1) : void 0;
8961
8973
  }
8962
8974
  function rowParameters(definition) {
8963
- const properties = isPlainObject$9(definition) ? definition["Properties"] : void 0;
8975
+ const properties = isPlainObject$10(definition) ? definition["Properties"] : void 0;
8964
8976
  if (properties === void 0) return {};
8965
- if (!isPlainObject$9(properties)) return "unknown";
8977
+ if (!isPlainObject$10(properties)) return "unknown";
8966
8978
  const parameters = properties["Parameters"];
8967
8979
  if (parameters === void 0) return {};
8968
- if (!isPlainObject$9(parameters) || intrinsicKey(parameters) !== void 0) return "unknown";
8980
+ if (!isPlainObject$10(parameters) || intrinsicKey(parameters) !== void 0) return "unknown";
8969
8981
  return parameters;
8970
8982
  }
8971
8983
  function childParameterInputs(template, passed) {
8972
- const declared = isPlainObject$9(template.Parameters) ? template.Parameters : {};
8984
+ const declared = isPlainObject$10(template.Parameters) ? template.Parameters : {};
8973
8985
  const inputs = /* @__PURE__ */ new Map();
8974
8986
  for (const name of Object.keys(declared)) {
8975
8987
  const definition = declared[name];
8976
- if (isPlainObject$9(definition) && declaresNoEcho(definition)) inputs.set(name, { kind: "secret" });
8988
+ if (isPlainObject$10(definition) && declaresNoEcho(definition)) inputs.set(name, { kind: "secret" });
8977
8989
  else if (passed.has(name)) {
8978
8990
  const passedClass = passed.get(name);
8979
8991
  inputs.set(name, passedClass === "clean" ? {
8980
8992
  kind: "value",
8981
8993
  value: void 0
8982
8994
  } : passedClass === "unknown" ? { kind: "unknown" } : { kind: "secret" });
8983
- } else if (isPlainObject$9(definition) && Object.hasOwn(definition, "Default") && !carriesSecretValue(definition["Default"], [])) inputs.set(name, {
8995
+ } else if (isPlainObject$10(definition) && Object.hasOwn(definition, "Default") && !carriesSecretValue(definition["Default"], [])) inputs.set(name, {
8984
8996
  kind: "value",
8985
8997
  value: definition["Default"]
8986
8998
  });
@@ -8997,7 +9009,7 @@ function closureClass(closure) {
8997
9009
  return closure.unread ? "unread" : "clean";
8998
9010
  }
8999
9011
  async function childOutputClass(loaded, outputName, passed, chain, shared) {
9000
- if (loaded === void 0 || !isPlainObject$9(loaded.template)) return "unknown";
9012
+ if (loaded === void 0 || !isPlainObject$10(loaded.template)) return "unknown";
9001
9013
  const scopeKey = JSON.stringify([loaded.identity, passedKey(passed)]);
9002
9014
  const memoKey = JSON.stringify([scopeKey, outputName]);
9003
9015
  const memo = shared.outputs.get(memoKey);
@@ -9010,8 +9022,8 @@ async function classifyChildOutput(loaded, outputName, passed, chain, shared, sc
9010
9022
  if (++shared.steps > MAX_NESTED_OUTPUT_STEPS) return "unknown";
9011
9023
  if (chain.includes(loaded.identity) || chain.length >= MAX_NESTED_OUTPUT_DEPTH) return "unknown";
9012
9024
  const template = loaded.template;
9013
- const output = (isPlainObject$9(template.Outputs) ? template.Outputs : {})[outputName];
9014
- if (!isPlainObject$9(output) || !Object.hasOwn(output, "Value")) return "unknown";
9025
+ const output = (isPlainObject$10(template.Outputs) ? template.Outputs : {})[outputName];
9026
+ if (!isPlainObject$10(output) || !Object.hasOwn(output, "Value")) return "unknown";
9015
9027
  const scope = {
9016
9028
  walk: newWalk({
9017
9029
  template,
@@ -9083,7 +9095,7 @@ async function expressionClass(value, scope) {
9083
9095
  return result;
9084
9096
  };
9085
9097
  if (Array.isArray(value)) return all(value);
9086
- if (!isPlainObject$9(value)) return "clean";
9098
+ if (!isPlainObject$10(value)) return "clean";
9087
9099
  const key = intrinsicKey(value);
9088
9100
  if (key === void 0) return all(Object.values(value));
9089
9101
  const operand = value[key];
@@ -9098,7 +9110,7 @@ async function expressionClass(value, scope) {
9098
9110
  case "Fn::Sub": {
9099
9111
  const text = Array.isArray(operand) ? operand[0] : operand;
9100
9112
  if (typeof text !== "string") return worseOf("unknown", await expressionClass(operand, scope));
9101
- const vars = Array.isArray(operand) && isPlainObject$9(operand[1]) ? operand[1] : {};
9113
+ const vars = Array.isArray(operand) && isPlainObject$10(operand[1]) ? operand[1] : {};
9102
9114
  let result = text.includes("{{resolve:") ? "secret" : "clean";
9103
9115
  result = worseOf(result, await all(Object.values(vars)));
9104
9116
  for (const name of subPlaceholders(text)) {
@@ -9169,7 +9181,7 @@ async function maskedInputWalk(templateValue, sources, covered) {
9169
9181
  };
9170
9182
  }
9171
9183
  function inputFingerprintOf(form, templateValue) {
9172
- const digest = createHash("sha256").update(canonicalJson$5({
9184
+ const digest = createHash("sha256").update(canonicalJson$6({
9173
9185
  layout: 2,
9174
9186
  value: form
9175
9187
  })).digest("hex");
@@ -9190,7 +9202,7 @@ async function classifyPassedParameters(parameters, sources) {
9190
9202
  }
9191
9203
  async function classifyPassed(parameters, sources, nested) {
9192
9204
  const classes = /* @__PURE__ */ new Map();
9193
- if (!isPlainObject$9(parameters)) return classes;
9205
+ if (!isPlainObject$10(parameters)) return classes;
9194
9206
  for (const [name, expression] of Object.entries(parameters)) {
9195
9207
  let passedClass;
9196
9208
  try {
@@ -9212,7 +9224,7 @@ function passedParameterClassesOf(bag) {
9212
9224
 
9213
9225
  // src/deployment/masked-property-fingerprints/input-walk.ts
9214
9226
  var UnknownInput = class extends Error {};
9215
- function isPlainObject$9(value) {
9227
+ function isPlainObject$10(value) {
9216
9228
  return value !== null && typeof value === "object" && !Array.isArray(value);
9217
9229
  }
9218
9230
  const DYNAMIC_REFERENCE_OPEN = "{{resolve:";
@@ -9220,7 +9232,7 @@ const NESTED_STACK_TYPE$4 = "AWS::CloudFormation::Stack";
9220
9232
  const NESTED_OUTPUT_PREFIX = "Outputs.";
9221
9233
  function carriesSecretValue(value, corpora) {
9222
9234
  if (carriesSecretMask(value)) return true;
9223
- const text = canonicalJson$5(value);
9235
+ const text = canonicalJson$6(value);
9224
9236
  if (text.includes("{{resolve:")) return true;
9225
9237
  for (const corpus of corpora) {
9226
9238
  if (corpus === void 0) continue;
@@ -9232,7 +9244,7 @@ function carriesSecretValue(value, corpora) {
9232
9244
  return false;
9233
9245
  }
9234
9246
  function parameterInputsFor(args) {
9235
- const declared = isPlainObject$9(args.template.Parameters) ? args.template.Parameters : {};
9247
+ const declared = isPlainObject$10(args.template.Parameters) ? args.template.Parameters : {};
9236
9248
  const values = args.values ?? {};
9237
9249
  const inputs = /* @__PURE__ */ new Map();
9238
9250
  const bound = {};
@@ -9243,7 +9255,7 @@ function parameterInputsFor(args) {
9243
9255
  continue;
9244
9256
  }
9245
9257
  const value = values[name];
9246
- let secret = isPlainObject$9(definition) && declaresNoEcho(definition) || carriesSecretValue(value, []);
9258
+ let secret = isPlainObject$10(definition) && declaresNoEcho(definition) || carriesSecretValue(value, []);
9247
9259
  if (!secret && args.nestedChild === true && args.supplied !== void 0) {
9248
9260
  if (Object.hasOwn(args.supplied, name)) {
9249
9261
  const passed = args.passedClasses?.get(name);
@@ -9269,7 +9281,7 @@ function parameterInputsFor(args) {
9269
9281
  };
9270
9282
  }
9271
9283
  function carriesReference(operand) {
9272
- return canonicalJson$5(operand).includes(DYNAMIC_REFERENCE_OPEN);
9284
+ return canonicalJson$6(operand).includes(DYNAMIC_REFERENCE_OPEN);
9273
9285
  }
9274
9286
  function proof(walk, proven) {
9275
9287
  return walk.covered === void 0 ? {} : { proven: proven() };
@@ -9303,7 +9315,7 @@ function intrinsicKey(value) {
9303
9315
  const OPAQUE_ATTRIBUTE_TYPES = /* @__PURE__ */ new Set(["AWS::CloudFormation::CustomResource", NESTED_STACK_TYPE$4]);
9304
9316
  function hasOpaqueAttributes(logicalId, walk) {
9305
9317
  const definition = walk.resources[logicalId];
9306
- const type = isPlainObject$9(definition) ? definition["Type"] : void 0;
9318
+ const type = isPlainObject$10(definition) ? definition["Type"] : void 0;
9307
9319
  return typeof type === "string" && (type.startsWith("Custom::") || OPAQUE_ATTRIBUTE_TYPES.has(type));
9308
9320
  }
9309
9321
  function getAttTarget$1(operand) {
@@ -9328,7 +9340,7 @@ function taintOf(logicalId, walk) {
9328
9340
  const visit = (value) => {
9329
9341
  if (typeof value === "string") return value.includes(DYNAMIC_REFERENCE_OPEN);
9330
9342
  if (Array.isArray(value)) return value.some(visit);
9331
- if (!isPlainObject$9(value)) return false;
9343
+ if (!isPlainObject$10(value)) return false;
9332
9344
  const key = intrinsicKey(value);
9333
9345
  const operand = key === void 0 ? void 0 : value[key];
9334
9346
  let verdict = "clean";
@@ -9340,7 +9352,7 @@ function taintOf(logicalId, walk) {
9340
9352
  else if (key === "Fn::FindInMap" && mapReadClass(operand, walk.sources.template) !== "clean") verdict = "tainted";
9341
9353
  else if (key === "Fn::Sub") {
9342
9354
  const text = Array.isArray(operand) ? operand[0] : operand;
9343
- const vars = Array.isArray(operand) && isPlainObject$9(operand[1]) ? operand[1] : {};
9355
+ const vars = Array.isArray(operand) && isPlainObject$10(operand[1]) ? operand[1] : {};
9344
9356
  if (typeof text === "string") for (const name of subPlaceholders(text)) {
9345
9357
  if (Object.hasOwn(vars, name)) continue;
9346
9358
  const owner = name.includes(".") ? name.split(".")[0] : name;
@@ -9354,7 +9366,7 @@ function taintOf(logicalId, walk) {
9354
9366
  return Object.values(value).some(visit);
9355
9367
  };
9356
9368
  const definition = walk.resources[logicalId];
9357
- const result = visit(isPlainObject$9(definition) ? definition["Properties"] : void 0) ? "tainted" : unknown ? "unknown" : "clean";
9369
+ const result = visit(isPlainObject$10(definition) ? definition["Properties"] : void 0) ? "tainted" : unknown ? "unknown" : "clean";
9358
9370
  walk.inProgress.delete(logicalId);
9359
9371
  walk.taint.set(logicalId, result);
9360
9372
  return result;
@@ -9370,7 +9382,7 @@ function conditionInput(name, walk) {
9370
9382
  return typeof verdict === "boolean" ? verdict : "unknown";
9371
9383
  }
9372
9384
  function conditionClosure(name, walk) {
9373
- const definitions = isPlainObject$9(walk.sources.template.Conditions) ? walk.sources.template.Conditions : {};
9385
+ const definitions = isPlainObject$10(walk.sources.template.Conditions) ? walk.sources.template.Conditions : {};
9374
9386
  let secret = false;
9375
9387
  let unknown = false;
9376
9388
  let unread = false;
@@ -9385,7 +9397,7 @@ function conditionClosure(name, walk) {
9385
9397
  value.forEach(visit);
9386
9398
  return;
9387
9399
  }
9388
- if (!isPlainObject$9(value)) return;
9400
+ if (!isPlainObject$10(value)) return;
9389
9401
  const keys = Object.keys(value);
9390
9402
  if (keys.length === 1 && keys[0] === "Condition" && typeof value["Condition"] === "string") {
9391
9403
  pending.push(value["Condition"]);
@@ -9418,7 +9430,7 @@ function conditionClosure(name, walk) {
9418
9430
  if (key === "Fn::Sub") {
9419
9431
  const operand = value["Fn::Sub"];
9420
9432
  const text = Array.isArray(operand) ? operand[0] : operand;
9421
- const vars = Array.isArray(operand) && isPlainObject$9(operand[1]) ? operand[1] : {};
9433
+ const vars = Array.isArray(operand) && isPlainObject$10(operand[1]) ? operand[1] : {};
9422
9434
  if (typeof text === "string") for (const name of subPlaceholders(text)) {
9423
9435
  if (Object.hasOwn(vars, name)) continue;
9424
9436
  if (name.includes(".") && !name.startsWith("AWS::")) secret = true;
@@ -9447,8 +9459,8 @@ function mapReadClass(operand, template) {
9447
9459
  const mapName = Array.isArray(operand) ? operand[0] : void 0;
9448
9460
  if (typeof mapName !== "string") return "unknown";
9449
9461
  const mappings = template.Mappings;
9450
- const map = isPlainObject$9(mappings) && Object.hasOwn(mappings, mapName) ? mappings[mapName] : void 0;
9451
- if (!isPlainObject$9(map)) return "unknown";
9462
+ const map = isPlainObject$10(mappings) && Object.hasOwn(mappings, mapName) ? mappings[mapName] : void 0;
9463
+ if (!isPlainObject$10(map)) return "unknown";
9452
9464
  return carriesSecretValue(map, []) ? "secret" : "clean";
9453
9465
  }
9454
9466
  async function resolvedInput(node, walk) {
@@ -9526,7 +9538,7 @@ async function inputForm(value, walk) {
9526
9538
  ...proof(walk, () => parts.every(isProven))
9527
9539
  };
9528
9540
  }
9529
- if (!isPlainObject$9(value)) return {
9541
+ if (!isPlainObject$10(value)) return {
9530
9542
  form: value,
9531
9543
  concrete: true
9532
9544
  };
@@ -9590,7 +9602,7 @@ async function inputForm(value, walk) {
9590
9602
  concrete: false
9591
9603
  };
9592
9604
  }
9593
- const explicit = Array.isArray(operand) && isPlainObject$9(operand[1]) ? operand[1] : {};
9605
+ const explicit = Array.isArray(operand) && isPlainObject$10(operand[1]) ? operand[1] : {};
9594
9606
  const vars = await inputForm(explicit, walk);
9595
9607
  const placeholders = [];
9596
9608
  let concrete = vars.concrete && !text.includes("{{resolve:");
@@ -9648,8 +9660,8 @@ function newWalk(sources, nested = {
9648
9660
  return {
9649
9661
  ...covered !== void 0 && { covered },
9650
9662
  sources,
9651
- resources: isPlainObject$9(sources.template.Resources) ? sources.template.Resources : {},
9652
- parameters: isPlainObject$9(sources.template.Parameters) ? sources.template.Parameters : {},
9663
+ resources: isPlainObject$10(sources.template.Resources) ? sources.template.Resources : {},
9664
+ parameters: isPlainObject$10(sources.template.Parameters) ? sources.template.Parameters : {},
9653
9665
  taint: /* @__PURE__ */ new Map(),
9654
9666
  inProgress: /* @__PURE__ */ new Set(),
9655
9667
  stackChain: nested.stackChain,
@@ -9685,13 +9697,13 @@ function possiblyMaskedKeys(resolvedProps, corpora) {
9685
9697
  const wholeShortLeaf = (value) => {
9686
9698
  if (typeof value === "string") return short.includes(value);
9687
9699
  if (Array.isArray(value)) return value.some(wholeShortLeaf);
9688
- if (isPlainObject$9(value)) return Object.values(value).some(wholeShortLeaf);
9700
+ if (isPlainObject$10(value)) return Object.values(value).some(wholeShortLeaf);
9689
9701
  return false;
9690
9702
  };
9691
9703
  return Object.keys(resolvedProps).filter((key) => {
9692
9704
  const value = resolvedProps[key];
9693
9705
  if (carriesSecretMask(value) || wholeShortLeaf(value)) return true;
9694
- const text = canonicalJson$5(value);
9706
+ const text = canonicalJson$6(value);
9695
9707
  return long.some((needle) => text.includes(needle) || text.includes(JSON.stringify(needle).slice(1, -1)));
9696
9708
  });
9697
9709
  }
@@ -9716,7 +9728,7 @@ function maskedPropertyFingerprintsOf(record) {
9716
9728
  const read = /* @__PURE__ */ new Map();
9717
9729
  if (record === null || typeof record !== "object") return read;
9718
9730
  const field = record.maskedPropertyFingerprints;
9719
- if (!isPlainObject$9(field)) return read;
9731
+ if (!isPlainObject$10(field)) return read;
9720
9732
  for (const [key, value] of Object.entries(field)) if (typeof value === "string" && value.startsWith("sha256:")) read.set(key, value);
9721
9733
  return read;
9722
9734
  }
@@ -9724,7 +9736,7 @@ function maskedPropertyInputFingerprintsOf(record) {
9724
9736
  const read = /* @__PURE__ */ new Map();
9725
9737
  if (record === null || typeof record !== "object") return read;
9726
9738
  const field = record.maskedPropertyInputFingerprints;
9727
- if (!isPlainObject$9(field)) return read;
9739
+ if (!isPlainObject$10(field)) return read;
9728
9740
  const text = maskedPropertyFingerprintsOf(record);
9729
9741
  for (const [key, value] of Object.entries(field)) {
9730
9742
  if (typeof value !== "string" || !value.startsWith("inputs-sha256:")) continue;
@@ -9771,7 +9783,7 @@ async function movedMaskedProperties(record, templateProps, fingerprinter, onReb
9771
9783
  function withRebaselinedFingerprints(record, fingerprints) {
9772
9784
  const text = maskedPropertyFingerprintsOf(record);
9773
9785
  const field = record.maskedPropertyInputFingerprints;
9774
- const next = isPlainObject$9(field) ? Object.entries(field) : [];
9786
+ const next = isPlainObject$10(field) ? Object.entries(field) : [];
9775
9787
  let changed = false;
9776
9788
  for (const [key, value] of Object.entries(fingerprints)) {
9777
9789
  if (text.get(key) !== splitInputFingerprint(value).text) continue;
@@ -9804,10 +9816,10 @@ function withMaskedPropertyFingerprints(scrubbed, writtenBag, templateProps, sec
9804
9816
  fingerprints = maskedPropertyFingerprintsFor(scrubbed.properties, templateProps);
9805
9817
  inputs = boundInputFingerprints(fingerprints, inputFingerprints);
9806
9818
  } else {
9807
- if (!isPlainObject$9(previous)) return scrubbed;
9819
+ if (!isPlainObject$10(previous)) return scrubbed;
9808
9820
  if (corpora.length === 0) return scrubbed;
9809
9821
  fingerprints = { ...previous };
9810
- inputs = isPlainObject$9(previousInputs) ? { ...previousInputs } : void 0;
9822
+ inputs = isPlainObject$10(previousInputs) ? { ...previousInputs } : void 0;
9811
9823
  }
9812
9824
  if (fingerprints !== void 0 && corpora.length > 0) {
9813
9825
  const refused = Object.keys(fingerprints).filter((key) => Object.hasOwn(templateProps, key) && corpora.some((corpus) => templateCarriesNeedle(templateProps[key], corpus)));
@@ -10182,7 +10194,7 @@ function replacementNameKeyMoves(input) {
10182
10194
  if (key === void 0) return void 0;
10183
10195
  const fold = replacementOrderIsCaseSensitive(input.resourceType) ? (v) => v : (v) => v.toLowerCase();
10184
10196
  for (const path of key.name) {
10185
- const desiredName = valueAt$1(input.desiredProperties, path);
10197
+ const desiredName = valueAt$2(input.desiredProperties, path);
10186
10198
  if (desiredName === void 0) continue;
10187
10199
  const held = heldAt(input.recorded, input.observed, path);
10188
10200
  if (held.unreadable || held.value === void 0) return void 0;
@@ -10210,7 +10222,7 @@ function renameMakesRecreateCreateFirst(input) {
10210
10222
  }
10211
10223
  return false;
10212
10224
  }
10213
- function valueAt$1(bag, path) {
10225
+ function valueAt$2(bag, path) {
10214
10226
  let node = bag;
10215
10227
  for (const segment of path.slice(0, -1)) {
10216
10228
  if (node === null || typeof node !== "object" || Array.isArray(node)) return void 0;
@@ -10227,14 +10239,14 @@ function unreadableAt(bag, path) {
10227
10239
  if (node === null || typeof node !== "object" || Array.isArray(node)) return false;
10228
10240
  node = node[segment];
10229
10241
  }
10230
- return node !== void 0 && node !== null && valueAt$1(bag, path) === void 0;
10242
+ return node !== void 0 && node !== null && valueAt$2(bag, path) === void 0;
10231
10243
  }
10232
10244
  function heldAt(recorded, observed, path) {
10233
10245
  if (unreadableAt(recorded, path)) return {
10234
10246
  value: void 0,
10235
10247
  unreadable: true
10236
10248
  };
10237
- const value = valueAt$1(recorded, path) ?? valueAt$1(observed, path);
10249
+ const value = valueAt$2(recorded, path) ?? valueAt$2(observed, path);
10238
10250
  return {
10239
10251
  value,
10240
10252
  unreadable: value === void 0 && unreadableAt(observed, path)
@@ -10292,9 +10304,9 @@ const DEPLOY_VOICE = {
10292
10304
  };
10293
10305
  function sentIdentifierIs(requested, recorded, observed, physicalId) {
10294
10306
  const isNameKey = (key) => /(Name|Identifier)$/.test(key);
10295
- if (!Object.keys(requested).some((key) => isNameKey(key) && valueAt$1(requested, [key]) === physicalId)) return false;
10307
+ if (!Object.keys(requested).some((key) => isNameKey(key) && valueAt$2(requested, [key]) === physicalId)) return false;
10296
10308
  return [...new Set([...Object.keys(requested), ...Object.keys(recorded ?? {})].filter(isNameKey))].every((key) => {
10297
- const sent = valueAt$1(requested, [key]);
10309
+ const sent = valueAt$2(requested, [key]);
10298
10310
  return sent !== void 0 && heldAt(recorded, observed, [key]).value === sent;
10299
10311
  });
10300
10312
  }
@@ -10323,7 +10335,7 @@ function replayPrefixChoice(input) {
10323
10335
  if (raw === void 0 || raw === "") return { kind: "not-applicable" };
10324
10336
  const recorded = getCurrentSkipPrefix();
10325
10337
  const property = rewrite.property;
10326
- const declared = valueAt$1(input.properties, [property]);
10338
+ const declared = valueAt$2(input.properties, [property]);
10327
10339
  if (declared === void 0 || typeof input.logicalId !== "string" || typeof input.physicalId !== "string" || input.physicalId === "") return {
10328
10340
  kind: "unreproduced",
10329
10341
  skipPrefix: recorded,
@@ -10471,22 +10483,22 @@ function reverseReplacementTrustsGeneratedName(resourceType) {
10471
10483
  // src/deployment/replacement-name-holder/holder.ts
10472
10484
  function recordSetHolds(requested, recorded, observed, newPhysicalId, r, v) {
10473
10485
  const newRecord = `${v.holderRecord} (${r.shown(newPhysicalId)})`;
10474
- const wantName = valueAt$1(requested, ["Name"]);
10475
- const wantType = valueAt$1(requested, ["Type"]);
10486
+ const wantName = valueAt$2(requested, ["Name"]);
10487
+ const wantType = valueAt$2(requested, ["Type"]);
10476
10488
  const haveName = heldAt(recorded, observed, ["Name"]).value;
10477
10489
  const haveType = heldAt(recorded, observed, ["Type"]).value;
10478
10490
  if (wantName === void 0 || wantType === void 0) return unproven(`cdkd cannot read the Name and Type ${v.createdRecord} asked for`);
10479
10491
  const wanted = `${v.create} asked for Name ${r.quoted(wantName)}`;
10480
10492
  if (haveName === void 0 || haveType === void 0) return unproven(`${wanted}, and cdkd cannot read the name ${newRecord} holds`);
10481
10493
  if (dnsFold(wantName) !== dnsFold(haveName)) return /\\[0-9]{3}/.test(wantName + haveName) ? unproven(`${wanted}, and cdkd cannot compare it with the escaped name ${newRecord} holds`) : elsewhere(`${wanted}, while ${newRecord} holds Name ${r.quoted(haveName)}`);
10482
- const wantZoneId = valueAt$1(requested, ["HostedZoneId"]);
10494
+ const wantZoneId = valueAt$2(requested, ["HostedZoneId"]);
10483
10495
  const haveZoneId = heldAt(recorded, observed, ["HostedZoneId"]).value;
10484
- const wantZoneName = valueAt$1(requested, ["HostedZoneName"]);
10496
+ const wantZoneName = valueAt$2(requested, ["HostedZoneName"]);
10485
10497
  const haveZoneName = heldAt(recorded, observed, ["HostedZoneName"]).value;
10486
10498
  const sameZone = wantZoneId !== void 0 && haveZoneId !== void 0 ? zoneIdFold(wantZoneId) === zoneIdFold(haveZoneId) : wantZoneName !== void 0 && haveZoneName !== void 0 ? dnsFold(wantZoneName) === dnsFold(haveZoneName) : void 0;
10487
10499
  if (sameZone === false) return elsewhere(`${wanted}, while ${newRecord} is in another hosted zone`);
10488
10500
  if (sameZone === void 0) return unproven(`${wanted}, and cdkd cannot tell whether ${newRecord} is in the same hosted zone`);
10489
- const wantSet = valueAt$1(requested, ["SetIdentifier"]);
10501
+ const wantSet = valueAt$2(requested, ["SetIdentifier"]);
10490
10502
  const haveSet = heldAt(recorded, observed, ["SetIdentifier"]).value;
10491
10503
  if (wantType.toUpperCase() === "CNAME" !== (haveType.toUpperCase() === "CNAME")) return HOLDS;
10492
10504
  if (wantType.toUpperCase() !== haveType.toUpperCase()) return elsewhere(`${wanted} of Type ${r.quoted(wantType)}, while ${newRecord} is a ${r.quoted(haveType)} record of that name`);
@@ -10502,7 +10514,7 @@ function pathValue(bag, path) {
10502
10514
  return node;
10503
10515
  }
10504
10516
  function rewrittenNameHolds(input, rewrite, viaCloudControl, labels, newResource, r, v) {
10505
- const declared = valueAt$1(input.requested, [rewrite.property]);
10517
+ const declared = valueAt$2(input.requested, [rewrite.property]);
10506
10518
  const logicalId = typeof input.logicalId === "string" && input.logicalId !== "" ? input.logicalId : void 0;
10507
10519
  if (declared === void 0 && (viaCloudControl || logicalId === void 0)) return unproven(`${v.create} named no ${labels}, and cdkd cannot derive the name its provider generates, so it cannot show that ${newResource} holds it`);
10508
10520
  const sent = viaCloudControl ? declared : generateResourceNameWithFallback(declared, logicalId ?? "", { maxLength: rewrite.maxLength });
@@ -10536,11 +10548,11 @@ function holderVerdict$1(input, v) {
10536
10548
  const rewrite = ownEntry$1(SENT_NAME_REWRITTEN, oldResourceType);
10537
10549
  if (rewrite !== void 0) return rewrittenNameHolds(input, rewrite, input.createdVia === "cc-api", labels, newResource, r, v);
10538
10550
  let generatedName = false;
10539
- let namePath = oldKey.name.find((path) => valueAt$1(requested, path) !== void 0);
10540
- let wantName = namePath === void 0 ? void 0 : valueAt$1(requested, namePath);
10551
+ let namePath = oldKey.name.find((path) => valueAt$2(requested, path) !== void 0);
10552
+ let wantName = namePath === void 0 ? void 0 : valueAt$2(requested, namePath);
10541
10553
  if (namePath === void 0 && input.generated !== void 0 && reverseReplacementTrustsGeneratedName(oldResourceType)) {
10542
- namePath = oldKey.name.find((path) => valueAt$1(input.generated, path) !== void 0);
10543
- wantName = namePath === void 0 ? void 0 : valueAt$1(input.generated, namePath);
10554
+ namePath = oldKey.name.find((path) => valueAt$2(input.generated, path) !== void 0);
10555
+ wantName = namePath === void 0 ? void 0 : valueAt$2(input.generated, namePath);
10544
10556
  generatedName = wantName !== void 0;
10545
10557
  }
10546
10558
  const derived = ownEntry$1(DERIVED_GENERATED_NAMES, oldResourceType);
@@ -10559,14 +10571,14 @@ function holderVerdict$1(input, v) {
10559
10571
  const h = heldAt(recorded, observed, path);
10560
10572
  return h.value !== void 0 || h.unreadable;
10561
10573
  });
10562
- const recordedName = namePathHeld && valueAt$1(recorded, namePathHeld);
10563
- const observedName = namePathHeld && valueAt$1(observed, namePathHeld);
10574
+ const recordedName = namePathHeld && valueAt$2(recorded, namePathHeld);
10575
+ const observedName = namePathHeld && valueAt$2(observed, namePathHeld);
10564
10576
  if (namePathHeld !== void 0 && recordedName !== void 0 && observedName !== void 0 && !same(recordedName, observedName)) return unproven(`${wanted}, and the records of ${newResource} disagree on its ${r.shown(namePathHeld.join("."))} (recorded ${r.quoted(recordedName)}, read back ${r.quoted(observedName)}), so cdkd cannot show which name it holds`);
10565
10577
  const haveName = namePathHeld === void 0 ? void 0 : heldAt(recorded, observed, namePathHeld).value;
10566
10578
  if (!(haveName !== void 0 && same(haveName, wantName) || physicalId !== "" && !NO_PHYSICAL_ID_NAME_PROOF.has(newResourceType) && holderIdNames(inCase(physicalId), inCase(wantName)))) return haveName !== void 0 && !generatedName ? elsewhere(`${wanted}, while ${newResource} holds ${r.quoted(haveName)}`) : unproven(`${wanted}, and cdkd cannot show that ${newResource} holds that name`);
10567
10579
  for (const [i, path] of (oldKey.scope ?? []).entries()) {
10568
10580
  const label = r.shown(path.join("."));
10569
- const wantRaw = valueAt$1(requested, path);
10581
+ const wantRaw = valueAt$2(requested, path);
10570
10582
  const have = heldAt(recorded, observed, path);
10571
10583
  if (wantRaw === void 0 && unreadableAt(requested, path) || have.unreadable) return unproven(`${wanted}, and cdkd cannot read the ${label} that places it`);
10572
10584
  const fallback = oldKey.scopeDefaults?.[i];
@@ -11940,11 +11952,11 @@ function validReferenceRegion(region) {
11940
11952
  if (typeof region !== "string") return void 0;
11941
11953
  return canonicalizeRegion(region) === region && isClientSafeRegion(region) ? region : void 0;
11942
11954
  }
11943
- function isPlainObject$8(value) {
11955
+ function isPlainObject$9(value) {
11944
11956
  return value !== null && typeof value === "object" && !Array.isArray(value);
11945
11957
  }
11946
11958
  function validateReferenceProvenance(token, raw) {
11947
- if (!isSingleDynamicReferenceToken(token) || !isPlainObject$8(raw)) return void 0;
11959
+ if (!isSingleDynamicReferenceToken(token) || !isPlainObject$9(raw)) return void 0;
11948
11960
  const versionsRaw = Object.hasOwn(raw, "versions") ? raw["versions"] : void 0;
11949
11961
  const readRaw = Object.hasOwn(raw, "readVersions") ? raw["readVersions"] : void 0;
11950
11962
  if (readRaw !== void 0) {
@@ -11962,11 +11974,11 @@ function validateReferenceProvenance(token, raw) {
11962
11974
  return out;
11963
11975
  }
11964
11976
  function referenceProvenanceOf(record) {
11965
- if (!isPlainObject$8(record) || !Object.hasOwn(record, "referenceProvenance")) return void 0;
11977
+ if (!isPlainObject$9(record) || !Object.hasOwn(record, "referenceProvenance")) return void 0;
11966
11978
  return validatedBag(record["referenceProvenance"]);
11967
11979
  }
11968
11980
  function validatedBag(field) {
11969
- if (!isPlainObject$8(field)) return void 0;
11981
+ if (!isPlainObject$9(field)) return void 0;
11970
11982
  const out = Object.create(null);
11971
11983
  for (const [token, raw] of Object.entries(field)) {
11972
11984
  const entry = validateReferenceProvenance(token, raw);
@@ -11975,9 +11987,9 @@ function validatedBag(field) {
11975
11987
  return { ...out };
11976
11988
  }
11977
11989
  function recordedProvenanceOf(record, token) {
11978
- if (!isPlainObject$8(record) || !Object.hasOwn(record, "referenceProvenance")) return void 0;
11990
+ if (!isPlainObject$9(record) || !Object.hasOwn(record, "referenceProvenance")) return void 0;
11979
11991
  const field = record["referenceProvenance"];
11980
- if (!isPlainObject$8(field) || !Object.hasOwn(field, token)) return void 0;
11992
+ if (!isPlainObject$9(field) || !Object.hasOwn(field, token)) return void 0;
11981
11993
  return validateReferenceProvenance(token, field[token]);
11982
11994
  }
11983
11995
  function recordedReferenceRegions(record) {
@@ -11999,7 +12011,7 @@ function regionsOf(field) {
11999
12011
  function keepHeldTokenProvenance(record) {
12000
12012
  if (!hasReferenceProvenanceField(record)) return record;
12001
12013
  const field = record.referenceProvenance;
12002
- if (!isPlainObject$8(field)) return record;
12014
+ if (!isPlainObject$9(field)) return record;
12003
12015
  const held = recordReferenceTokens(record);
12004
12016
  const keys = Object.keys(field);
12005
12017
  if (keys.every((token) => held.has(token))) return record;
@@ -12011,12 +12023,12 @@ function keepHeldTokenProvenance(record) {
12011
12023
  };
12012
12024
  }
12013
12025
  function hasReferenceProvenanceField(record) {
12014
- return isPlainObject$8(record) && Object.hasOwn(record, "referenceProvenance") && record["referenceProvenance"] !== void 0;
12026
+ return isPlainObject$9(record) && Object.hasOwn(record, "referenceProvenance") && record["referenceProvenance"] !== void 0;
12015
12027
  }
12016
12028
  function outputReferenceProvenanceOf(state, outputKey) {
12017
- if (!isPlainObject$8(state) || !Object.hasOwn(state, "outputReferenceProvenance")) return;
12029
+ if (!isPlainObject$9(state) || !Object.hasOwn(state, "outputReferenceProvenance")) return;
12018
12030
  const field = state["outputReferenceProvenance"];
12019
- if (!isPlainObject$8(field) || !Object.hasOwn(field, outputKey)) return void 0;
12031
+ if (!isPlainObject$9(field) || !Object.hasOwn(field, outputKey)) return void 0;
12020
12032
  return validatedBag(field[outputKey]);
12021
12033
  }
12022
12034
  function persistable(token, entry) {
@@ -12034,7 +12046,7 @@ function tokensUnderPaths(properties, paths) {
12034
12046
  for (const item of value) descend(item, path, next);
12035
12047
  return;
12036
12048
  }
12037
- if (isPlainObject$8(value) && Object.hasOwn(value, path[at])) descend(value[path[at]], path, at + 1);
12049
+ if (isPlainObject$9(value) && Object.hasOwn(value, path[at])) descend(value[path[at]], path, at + 1);
12038
12050
  };
12039
12051
  for (const path of paths) descend(properties, path, 0);
12040
12052
  return out;
@@ -12077,7 +12089,7 @@ function unionWithPrevious(pass, before) {
12077
12089
  }
12078
12090
  function outputProvenanceForPersist(args) {
12079
12091
  const { outputs, resolvedThisRun, carriedFrom, sinkOf } = args;
12080
- if (!resolvedThisRun) return carriedFrom !== void 0 && isPlainObject$8(carriedFrom.outputReferenceProvenance) ? carriedFrom.outputReferenceProvenance : void 0;
12092
+ if (!resolvedThisRun) return carriedFrom !== void 0 && isPlainObject$9(carriedFrom.outputReferenceProvenance) ? carriedFrom.outputReferenceProvenance : void 0;
12081
12093
  let out;
12082
12094
  for (const [outputKey, value] of Object.entries(outputs)) {
12083
12095
  const sink = sinkOf(outputKey);
@@ -12916,6 +12928,224 @@ function s3BucketWebsiteUrl(bucketName, region) {
12916
12928
  return `http://${bucketName}.s3-website${S3_WEBSITE_ENDPOINT_LEGACY_DASH_REGIONS.has(folded) ? "-" : "."}${folded}.${urlSuffix}`;
12917
12929
  }
12918
12930
 
12931
+ // src/provisioning/getatt-attributes.generated.ts
12932
+ const WRITABLE_GETATT_ATTRIBUTES = {
12933
+ "AWS::Amplify::Branch": ["BranchName"],
12934
+ "AWS::Amplify::Domain": [
12935
+ "AutoSubDomainCreationPatterns",
12936
+ "AutoSubDomainIAMRole",
12937
+ "DomainName",
12938
+ "EnableAutoSubDomain"
12939
+ ],
12940
+ "AWS::AppMesh::GatewayRoute": [
12941
+ "GatewayRouteName",
12942
+ "MeshName",
12943
+ "MeshOwner",
12944
+ "VirtualGatewayName"
12945
+ ],
12946
+ "AWS::AppMesh::Mesh": ["MeshName"],
12947
+ "AWS::AppMesh::Route": [
12948
+ "MeshName",
12949
+ "MeshOwner",
12950
+ "RouteName",
12951
+ "VirtualRouterName"
12952
+ ],
12953
+ "AWS::AppMesh::VirtualGateway": [
12954
+ "MeshName",
12955
+ "MeshOwner",
12956
+ "VirtualGatewayName"
12957
+ ],
12958
+ "AWS::AppMesh::VirtualNode": [
12959
+ "MeshName",
12960
+ "MeshOwner",
12961
+ "VirtualNodeName"
12962
+ ],
12963
+ "AWS::AppMesh::VirtualRouter": [
12964
+ "MeshName",
12965
+ "MeshOwner",
12966
+ "VirtualRouterName"
12967
+ ],
12968
+ "AWS::AppMesh::VirtualService": [
12969
+ "MeshName",
12970
+ "MeshOwner",
12971
+ "VirtualServiceName"
12972
+ ],
12973
+ "AWS::AppSync::DataSource": ["Name"],
12974
+ "AWS::AppSync::DomainName": ["DomainName"],
12975
+ "AWS::AppSync::FunctionConfiguration": ["DataSourceName", "Name"],
12976
+ "AWS::AppSync::Resolver": ["FieldName", "TypeName"],
12977
+ "AWS::Backup::BackupSelection": ["BackupPlanId"],
12978
+ "AWS::Backup::BackupVault": ["BackupVaultName"],
12979
+ "AWS::CleanRooms::AnalysisTemplate": ["Schema"],
12980
+ "AWS::Cloud9::EnvironmentEC2": ["Name"],
12981
+ "AWS::CloudWatch::InsightRule": ["RuleName"],
12982
+ "AWS::CodeArtifact::Domain": ["EncryptionKey"],
12983
+ "AWS::CodeArtifact::Repository": ["DomainName", "DomainOwner"],
12984
+ "AWS::EC2::CapacityReservation": [
12985
+ "AvailabilityZone",
12986
+ "InstanceType",
12987
+ "Tenancy"
12988
+ ],
12989
+ "AWS::EC2::Instance": ["AvailabilityZone"],
12990
+ "AWS::EC2::SecurityGroup": ["VpcId"],
12991
+ "AWS::EC2::Subnet": [
12992
+ "AvailabilityZone",
12993
+ "AvailabilityZoneId",
12994
+ "CidrBlock",
12995
+ "OutpostArn",
12996
+ "VpcId"
12997
+ ],
12998
+ "AWS::EC2::VPC": ["CidrBlock"],
12999
+ "AWS::EFS::MountTarget": ["IpAddress"],
13000
+ "AWS::EKS::Nodegroup": ["ClusterName", "NodegroupName"],
13001
+ "AWS::ElasticLoadBalancingV2::LoadBalancer": ["SecurityGroups"],
13002
+ "AWS::EventSchemas::Discoverer": ["CrossAccount"],
13003
+ "AWS::EventSchemas::Registry": ["RegistryName"],
13004
+ "AWS::EventSchemas::Schema": ["SchemaName"],
13005
+ "AWS::Events::EventBus": ["Name"],
13006
+ "AWS::GameLift::GameSessionQueue": ["Name"],
13007
+ "AWS::GameLift::MatchmakingConfiguration": ["Name"],
13008
+ "AWS::GameLift::MatchmakingRuleSet": ["Name"],
13009
+ "AWS::Grafana::Workspace": ["GrafanaVersion"],
13010
+ "AWS::Greengrass::ConnectorDefinition": ["Name"],
13011
+ "AWS::Greengrass::CoreDefinition": ["Name"],
13012
+ "AWS::Greengrass::DeviceDefinition": ["Name"],
13013
+ "AWS::Greengrass::FunctionDefinition": ["Name"],
13014
+ "AWS::Greengrass::Group": ["Name", "RoleArn"],
13015
+ "AWS::Greengrass::LoggerDefinition": ["Name"],
13016
+ "AWS::Greengrass::ResourceDefinition": ["Name"],
13017
+ "AWS::Greengrass::SubscriptionDefinition": ["Name"],
13018
+ "AWS::ImageBuilder::Component": ["Name"],
13019
+ "AWS::ImageBuilder::ContainerRecipe": ["Name"],
13020
+ "AWS::ImageBuilder::DistributionConfiguration": ["Name"],
13021
+ "AWS::ImageBuilder::ImagePipeline": ["Name"],
13022
+ "AWS::ImageBuilder::ImageRecipe": ["Name"],
13023
+ "AWS::ImageBuilder::InfrastructureConfiguration": ["Name"],
13024
+ "AWS::Kinesis::StreamConsumer": ["ConsumerName", "StreamARN"],
13025
+ "AWS::MSK::Cluster": ["CurrentVersion"],
13026
+ "AWS::ManagedBlockchain::Member": ["NetworkId"],
13027
+ "AWS::ManagedBlockchain::Node": ["MemberId", "NetworkId"],
13028
+ "AWS::MediaConvert::JobTemplate": ["Name"],
13029
+ "AWS::MediaConvert::Preset": ["Name"],
13030
+ "AWS::MediaConvert::Queue": ["Name"],
13031
+ "AWS::NetworkManager::ConnectAttachment": ["ProposedSegmentChange"],
13032
+ "AWS::NetworkManager::SiteToSiteVpnAttachment": ["ProposedSegmentChange"],
13033
+ "AWS::NetworkManager::TransitGatewayRouteTableAttachment": ["ProposedSegmentChange"],
13034
+ "AWS::NetworkManager::VpcAttachment": ["ProposedSegmentChange"],
13035
+ "AWS::OpsWorks::Instance": ["AvailabilityZone"],
13036
+ "AWS::OpsWorks::UserProfile": ["SshUsername"],
13037
+ "AWS::QuickSight::Analysis": ["Errors", "Sheets"],
13038
+ "AWS::RDS::DBInstance": ["DBSystemId"],
13039
+ "AWS::RDS::DBParameterGroup": ["DBParameterGroupName"],
13040
+ "AWS::RedshiftServerless::Workgroup": ["Workgroup"],
13041
+ "AWS::RoboMaker::RobotApplication": ["CurrentRevisionId"],
13042
+ "AWS::RoboMaker::SimulationApplication": ["CurrentRevisionId"],
13043
+ "AWS::Route53Resolver::ResolverEndpoint": [
13044
+ "Direction",
13045
+ "Name",
13046
+ "OutpostArn",
13047
+ "PreferredInstanceType",
13048
+ "ResolverEndpointType"
13049
+ ],
13050
+ "AWS::Route53Resolver::ResolverRule": [
13051
+ "DomainName",
13052
+ "Name",
13053
+ "ResolverEndpointId",
13054
+ "TargetIps"
13055
+ ],
13056
+ "AWS::Route53Resolver::ResolverRuleAssociation": [
13057
+ "Name",
13058
+ "ResolverRuleId",
13059
+ "VPCId"
13060
+ ],
13061
+ "AWS::S3::AccessPoint": ["Name"],
13062
+ "AWS::SNS::Topic": ["TopicName"],
13063
+ "AWS::SQS::Queue": ["QueueName"],
13064
+ "AWS::SSM::Parameter": ["Type"],
13065
+ "AWS::SSM::ResourceDataSync": ["SyncName"],
13066
+ "AWS::SageMaker::CodeRepository": ["CodeRepositoryName"],
13067
+ "AWS::SageMaker::Endpoint": ["EndpointName"],
13068
+ "AWS::SageMaker::EndpointConfig": ["EndpointConfigName"],
13069
+ "AWS::SageMaker::Model": ["ModelName"],
13070
+ "AWS::SageMaker::ModelPackage": ["LastModifiedTime"],
13071
+ "AWS::SageMaker::NotebookInstance": ["NotebookInstanceName"],
13072
+ "AWS::SageMaker::NotebookInstanceLifecycleConfig": ["NotebookInstanceLifecycleConfigName"],
13073
+ "AWS::SageMaker::Workteam": ["WorkteamName"],
13074
+ "AWS::ServiceDiscovery::Service": ["Name"],
13075
+ "AWS::Signer::SigningProfile": ["ProfileName"],
13076
+ "AWS::StepFunctions::Activity": ["Name"],
13077
+ "AWS::Transfer::User": ["ServerId", "UserName"]
13078
+ };
13079
+ const SHAPE_MISMATCHED_GETATT_ATTRIBUTES = {
13080
+ "AWS::DocDB::DBCluster": ["Port"],
13081
+ "AWS::Events::EventBus": ["Policy"],
13082
+ "AWS::MediaLive::Input": ["Destinations", "Sources"]
13083
+ };
13084
+
13085
+ // src/deployment/recorded-identity-attributes.ts
13086
+ const SURVIVOR_IDENTITY_ATTRIBUTES = {
13087
+ "AWS::IAM::Role": "RoleId",
13088
+ "AWS::IAM::ManagedPolicy": "PolicyId",
13089
+ "AWS::DynamoDB::Table": "TableId",
13090
+ "AWS::RDS::DBInstance": "DbiResourceId",
13091
+ "AWS::RDS::DBCluster": "DBClusterResourceId",
13092
+ "AWS::IAM::User": "UserId",
13093
+ "AWS::IAM::Group": "GroupId",
13094
+ "AWS::IAM::InstanceProfile": "InstanceProfileId"
13095
+ };
13096
+ function isRecordedIdentityAttribute(resourceType, key) {
13097
+ return Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, resourceType) && SURVIVOR_IDENTITY_ATTRIBUTES[resourceType] === key;
13098
+ }
13099
+ function keepRecordedIdentity(resourceType, previous, next, onDiffering) {
13100
+ if (!Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, resourceType)) return next;
13101
+ const key = SURVIVOR_IDENTITY_ATTRIBUTES[resourceType];
13102
+ const held = previous !== void 0 && Object.hasOwn(previous, key) ? previous[key] : void 0;
13103
+ const recorded = isUsableIdentityValue(held) ? held : void 0;
13104
+ if (recorded === void 0 || next[key] === recorded) return next;
13105
+ if (Object.hasOwn(next, key) && next[key] !== void 0) onDiffering?.(key);
13106
+ return {
13107
+ ...next,
13108
+ [key]: recorded
13109
+ };
13110
+ }
13111
+ function attributesAfterUpdate(resourceType, previous, result, onDiffering) {
13112
+ if (result.wasReplaced) return result.attributes;
13113
+ const next = result.attributes ?? previous;
13114
+ return next === void 0 ? void 0 : keepRecordedIdentity(resourceType, previous, next, onDiffering);
13115
+ }
13116
+ function withoutDeadIdentity(resourceType, attributes) {
13117
+ if (attributes === void 0 || !Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, resourceType)) return attributes;
13118
+ const key = SURVIVOR_IDENTITY_ATTRIBUTES[resourceType];
13119
+ if (!Object.hasOwn(attributes, key)) return attributes;
13120
+ const { [key]: _dead, ...rest } = attributes;
13121
+ return rest;
13122
+ }
13123
+ function newCopyDeleteAttributes(resourceType, current, oldDeletedBeforeCreate, previous) {
13124
+ if (oldDeletedBeforeCreate !== true || !Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, resourceType)) return current;
13125
+ const key = SURVIVOR_IDENTITY_ATTRIBUTES[resourceType];
13126
+ return current?.[key] !== void 0 && current[key] === previous?.[key] ? withoutDeadIdentity(resourceType, current) : current;
13127
+ }
13128
+ function isUsableIdentityValue(value) {
13129
+ return typeof value === "string" && value !== "" && !value.includes("***") && !holdsSecretDerivedEntry(value);
13130
+ }
13131
+ function replaceDeadIdentity(resourceType, attributes, previous, madeIdentity) {
13132
+ const dropped = newCopyDeleteAttributes(resourceType, attributes, true, previous);
13133
+ if (dropped === attributes || madeIdentity === void 0 || madeIdentity === "") return dropped;
13134
+ return {
13135
+ ...dropped,
13136
+ [SURVIVOR_IDENTITY_ATTRIBUTES[resourceType]]: madeIdentity
13137
+ };
13138
+ }
13139
+
13140
+ // src/deployment/unexposed-identity-attribute.ts
13141
+ function isUnexposedRecordedIdentity(resourceType, attributeName) {
13142
+ if (!isRecordedIdentityAttribute(resourceType, attributeName)) return false;
13143
+ const coverage = getPropertyCoverage(resourceType);
13144
+ if (coverage === void 0) return false;
13145
+ if (coverage.readOnly.has(attributeName)) return false;
13146
+ return !(Object.hasOwn(WRITABLE_GETATT_ATTRIBUTES, resourceType) && WRITABLE_GETATT_ATTRIBUTES[resourceType].includes(attributeName));
13147
+ }
13148
+
12919
13149
  // src/deployment/intrinsic-resolver/getatt/flat-object-attributes.ts
12920
13150
  const FLAT_OBJECT_MEMBERS = {
12921
13151
  "AWS::RDS::DBInstance": {
@@ -13189,6 +13419,10 @@ function refuseEndpointTheEngineLacks(resolver, resource, logicalId, attributeNa
13189
13419
  const other = lacking === "RedisEndpoint" ? "ConfigurationEndpoint" : "RedisEndpoint";
13190
13420
  throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}]: the cache cluster's engine is ${displayMasked(resolver, engine, context)}, which has no ${lacking}. CloudFormation answers an empty Address and Port for it; cdkd refuses instead of passing an empty endpoint on. Reference ${other} instead.`));
13191
13421
  }
13422
+ function refuseUnexposedRecordedIdentity(resolver, resourceType, logicalId, attributeName, context) {
13423
+ if (!isUnexposedRecordedIdentity(resourceType, attributeName)) return;
13424
+ throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${displayMasked(resolver, resourceType, context)}: CloudFormation does not expose ${displayMasked(resolver, attributeName, context)} as an attribute of this type and rejects the template. cdkd records it for its own identity checks only. Read an attribute the type exposes, or use Ref.`));
13425
+ }
13192
13426
 
13193
13427
  // src/deployment/intrinsic-resolver/getatt-construct-core.ts
13194
13428
  const NOT_CONSTRUCTED = Symbol("NOT_CONSTRUCTED");
@@ -14877,8 +15111,12 @@ function maskedSecretSegment(segment) {
14877
15111
  return `****${segment.slice(-4)}`;
14878
15112
  }
14879
15113
  function secretPhysicalIdSegment(resourceType, physicalId) {
14880
- if (resourceType !== "AWS::AppSync::ApiKey") return void 0;
14881
15114
  if (typeof physicalId !== "string" || physicalId === "") return void 0;
15115
+ if (resourceType === "AWS::CloudFormation::WaitConditionHandle") {
15116
+ const query = physicalId.indexOf("?");
15117
+ return query >= 0 && query < physicalId.length - 1 ? physicalId.slice(query + 1) : void 0;
15118
+ }
15119
+ if (resourceType !== "AWS::AppSync::ApiKey") return void 0;
14882
15120
  const parts = physicalId.split("|");
14883
15121
  if (parts.length === 2 && parts[0] !== "" && parts[1] !== "") return parts[1];
14884
15122
  const arn = APPSYNC_ARN.exec(physicalId);
@@ -16506,6 +16744,7 @@ async function resolveGetAtt(resolver, getAtt, context) {
16506
16744
  if (!resource) throw markNonRetryable(/* @__PURE__ */ new Error(`Resource ${displayMasked(resolver, logicalId, context)} not found for Fn::GetAtt`));
16507
16745
  recordSecretNamedRead(logicalId, void 0, context);
16508
16746
  refuseEndpointTheEngineLacks(resolver, resource, logicalId, attributeName, context);
16747
+ refuseUnexposedRecordedIdentity(resolver, resource.resourceType, logicalId, attributeName, context);
16509
16748
  if (!isAlwaysLiveAttribute(resource.resourceType, attributeName) && resource.attributes !== void 0) {
16510
16749
  const storedValue = Object.hasOwn(resource.attributes, attributeName) ? resource.attributes[attributeName] : assembleFlatObjectAttribute(resource.resourceType, attributeName, resource.attributes);
16511
16750
  const flatValue = isImpossibleEmptyStoredAttribute(resource.resourceType, attributeName, storedValue) ? void 0 : storedValue;
@@ -17645,160 +17884,6 @@ function maskLeavesDeep(value) {
17645
17884
  return "***";
17646
17885
  }
17647
17886
 
17648
- // src/provisioning/getatt-attributes.generated.ts
17649
- const WRITABLE_GETATT_ATTRIBUTES = {
17650
- "AWS::Amplify::Branch": ["BranchName"],
17651
- "AWS::Amplify::Domain": [
17652
- "AutoSubDomainCreationPatterns",
17653
- "AutoSubDomainIAMRole",
17654
- "DomainName",
17655
- "EnableAutoSubDomain"
17656
- ],
17657
- "AWS::AppMesh::GatewayRoute": [
17658
- "GatewayRouteName",
17659
- "MeshName",
17660
- "MeshOwner",
17661
- "VirtualGatewayName"
17662
- ],
17663
- "AWS::AppMesh::Mesh": ["MeshName"],
17664
- "AWS::AppMesh::Route": [
17665
- "MeshName",
17666
- "MeshOwner",
17667
- "RouteName",
17668
- "VirtualRouterName"
17669
- ],
17670
- "AWS::AppMesh::VirtualGateway": [
17671
- "MeshName",
17672
- "MeshOwner",
17673
- "VirtualGatewayName"
17674
- ],
17675
- "AWS::AppMesh::VirtualNode": [
17676
- "MeshName",
17677
- "MeshOwner",
17678
- "VirtualNodeName"
17679
- ],
17680
- "AWS::AppMesh::VirtualRouter": [
17681
- "MeshName",
17682
- "MeshOwner",
17683
- "VirtualRouterName"
17684
- ],
17685
- "AWS::AppMesh::VirtualService": [
17686
- "MeshName",
17687
- "MeshOwner",
17688
- "VirtualServiceName"
17689
- ],
17690
- "AWS::AppSync::DataSource": ["Name"],
17691
- "AWS::AppSync::DomainName": ["DomainName"],
17692
- "AWS::AppSync::FunctionConfiguration": ["DataSourceName", "Name"],
17693
- "AWS::AppSync::Resolver": ["FieldName", "TypeName"],
17694
- "AWS::Backup::BackupSelection": ["BackupPlanId"],
17695
- "AWS::Backup::BackupVault": ["BackupVaultName"],
17696
- "AWS::CleanRooms::AnalysisTemplate": ["Schema"],
17697
- "AWS::Cloud9::EnvironmentEC2": ["Name"],
17698
- "AWS::CloudWatch::InsightRule": ["RuleName"],
17699
- "AWS::CodeArtifact::Domain": ["EncryptionKey"],
17700
- "AWS::CodeArtifact::Repository": ["DomainName", "DomainOwner"],
17701
- "AWS::EC2::CapacityReservation": [
17702
- "AvailabilityZone",
17703
- "InstanceType",
17704
- "Tenancy"
17705
- ],
17706
- "AWS::EC2::Instance": ["AvailabilityZone"],
17707
- "AWS::EC2::SecurityGroup": ["VpcId"],
17708
- "AWS::EC2::Subnet": [
17709
- "AvailabilityZone",
17710
- "AvailabilityZoneId",
17711
- "CidrBlock",
17712
- "OutpostArn",
17713
- "VpcId"
17714
- ],
17715
- "AWS::EC2::VPC": ["CidrBlock"],
17716
- "AWS::EFS::MountTarget": ["IpAddress"],
17717
- "AWS::EKS::Nodegroup": ["ClusterName", "NodegroupName"],
17718
- "AWS::ElasticLoadBalancingV2::LoadBalancer": ["SecurityGroups"],
17719
- "AWS::EventSchemas::Discoverer": ["CrossAccount"],
17720
- "AWS::EventSchemas::Registry": ["RegistryName"],
17721
- "AWS::EventSchemas::Schema": ["SchemaName"],
17722
- "AWS::Events::EventBus": ["Name"],
17723
- "AWS::GameLift::GameSessionQueue": ["Name"],
17724
- "AWS::GameLift::MatchmakingConfiguration": ["Name"],
17725
- "AWS::GameLift::MatchmakingRuleSet": ["Name"],
17726
- "AWS::Grafana::Workspace": ["GrafanaVersion"],
17727
- "AWS::Greengrass::ConnectorDefinition": ["Name"],
17728
- "AWS::Greengrass::CoreDefinition": ["Name"],
17729
- "AWS::Greengrass::DeviceDefinition": ["Name"],
17730
- "AWS::Greengrass::FunctionDefinition": ["Name"],
17731
- "AWS::Greengrass::Group": ["Name", "RoleArn"],
17732
- "AWS::Greengrass::LoggerDefinition": ["Name"],
17733
- "AWS::Greengrass::ResourceDefinition": ["Name"],
17734
- "AWS::Greengrass::SubscriptionDefinition": ["Name"],
17735
- "AWS::ImageBuilder::Component": ["Name"],
17736
- "AWS::ImageBuilder::ContainerRecipe": ["Name"],
17737
- "AWS::ImageBuilder::DistributionConfiguration": ["Name"],
17738
- "AWS::ImageBuilder::ImagePipeline": ["Name"],
17739
- "AWS::ImageBuilder::ImageRecipe": ["Name"],
17740
- "AWS::ImageBuilder::InfrastructureConfiguration": ["Name"],
17741
- "AWS::Kinesis::StreamConsumer": ["ConsumerName", "StreamARN"],
17742
- "AWS::MSK::Cluster": ["CurrentVersion"],
17743
- "AWS::ManagedBlockchain::Member": ["NetworkId"],
17744
- "AWS::ManagedBlockchain::Node": ["MemberId", "NetworkId"],
17745
- "AWS::MediaConvert::JobTemplate": ["Name"],
17746
- "AWS::MediaConvert::Preset": ["Name"],
17747
- "AWS::MediaConvert::Queue": ["Name"],
17748
- "AWS::NetworkManager::ConnectAttachment": ["ProposedSegmentChange"],
17749
- "AWS::NetworkManager::SiteToSiteVpnAttachment": ["ProposedSegmentChange"],
17750
- "AWS::NetworkManager::TransitGatewayRouteTableAttachment": ["ProposedSegmentChange"],
17751
- "AWS::NetworkManager::VpcAttachment": ["ProposedSegmentChange"],
17752
- "AWS::OpsWorks::Instance": ["AvailabilityZone"],
17753
- "AWS::OpsWorks::UserProfile": ["SshUsername"],
17754
- "AWS::QuickSight::Analysis": ["Errors", "Sheets"],
17755
- "AWS::RDS::DBInstance": ["DBSystemId"],
17756
- "AWS::RDS::DBParameterGroup": ["DBParameterGroupName"],
17757
- "AWS::RedshiftServerless::Workgroup": ["Workgroup"],
17758
- "AWS::RoboMaker::RobotApplication": ["CurrentRevisionId"],
17759
- "AWS::RoboMaker::SimulationApplication": ["CurrentRevisionId"],
17760
- "AWS::Route53Resolver::ResolverEndpoint": [
17761
- "Direction",
17762
- "Name",
17763
- "OutpostArn",
17764
- "PreferredInstanceType",
17765
- "ResolverEndpointType"
17766
- ],
17767
- "AWS::Route53Resolver::ResolverRule": [
17768
- "DomainName",
17769
- "Name",
17770
- "ResolverEndpointId",
17771
- "TargetIps"
17772
- ],
17773
- "AWS::Route53Resolver::ResolverRuleAssociation": [
17774
- "Name",
17775
- "ResolverRuleId",
17776
- "VPCId"
17777
- ],
17778
- "AWS::S3::AccessPoint": ["Name"],
17779
- "AWS::SNS::Topic": ["TopicName"],
17780
- "AWS::SQS::Queue": ["QueueName"],
17781
- "AWS::SSM::Parameter": ["Type"],
17782
- "AWS::SSM::ResourceDataSync": ["SyncName"],
17783
- "AWS::SageMaker::CodeRepository": ["CodeRepositoryName"],
17784
- "AWS::SageMaker::Endpoint": ["EndpointName"],
17785
- "AWS::SageMaker::EndpointConfig": ["EndpointConfigName"],
17786
- "AWS::SageMaker::Model": ["ModelName"],
17787
- "AWS::SageMaker::ModelPackage": ["LastModifiedTime"],
17788
- "AWS::SageMaker::NotebookInstance": ["NotebookInstanceName"],
17789
- "AWS::SageMaker::NotebookInstanceLifecycleConfig": ["NotebookInstanceLifecycleConfigName"],
17790
- "AWS::SageMaker::Workteam": ["WorkteamName"],
17791
- "AWS::ServiceDiscovery::Service": ["Name"],
17792
- "AWS::Signer::SigningProfile": ["ProfileName"],
17793
- "AWS::StepFunctions::Activity": ["Name"],
17794
- "AWS::Transfer::User": ["ServerId", "UserName"]
17795
- };
17796
- const SHAPE_MISMATCHED_GETATT_ATTRIBUTES = {
17797
- "AWS::DocDB::DBCluster": ["Port"],
17798
- "AWS::Events::EventBus": ["Policy"],
17799
- "AWS::MediaLive::Input": ["Destinations", "Sources"]
17800
- };
17801
-
17802
17887
  // src/provisioning/read-only-properties.ts
17803
17888
  function isDefinitiveRefusal(error) {
17804
17889
  if (isThrottlingError(error)) return false;
@@ -18093,12 +18178,99 @@ function featureName(entry) {
18093
18178
  return typeof name === "string" ? name : void 0;
18094
18179
  }
18095
18180
 
18181
+ // src/provisioning/elbv2-listener-rule-patch.ts
18182
+ const LISTENER_RULE_TYPE = "AWS::ElasticLoadBalancingV2::ListenerRule";
18183
+ function isPlainObject$8(value) {
18184
+ return value !== null && typeof value === "object" && !Array.isArray(value);
18185
+ }
18186
+ function sortedStrings(value) {
18187
+ return Array.isArray(value) && value.every((v) => typeof v === "string") ? [...value].sort() : value;
18188
+ }
18189
+ function withoutEchoedValues(condition) {
18190
+ if (!isPlainObject$8(condition) || !Object.prototype.hasOwnProperty.call(condition, "Values")) return condition;
18191
+ const values = condition["Values"];
18192
+ const isEmpty = Array.isArray(values) && values.length === 0;
18193
+ if (!Object.entries(condition).some(([key, value]) => key.endsWith("Config") && isPlainObject$8(value) && (isEmpty || isDeepStrictEqual(sortedStrings(value["Values"]), sortedStrings(values))))) return condition;
18194
+ const { Values: _echo, ...rest } = condition;
18195
+ return rest;
18196
+ }
18197
+ function conditionsToSend(value) {
18198
+ return Array.isArray(value) ? value.map(withoutEchoedValues) : value;
18199
+ }
18200
+ function withListenerRuleConditionOps(resourceType, patch, desired) {
18201
+ if (resourceType !== LISTENER_RULE_TYPE || patch.length === 0) return patch;
18202
+ const existing = patch.findIndex((op) => op.path === "/Conditions");
18203
+ if (existing !== -1) {
18204
+ const op = patch[existing];
18205
+ if (op.op !== "add" && op.op !== "replace") return patch;
18206
+ return patch.map((o, i) => i === existing ? {
18207
+ ...o,
18208
+ value: conditionsToSend(o.value)
18209
+ } : o);
18210
+ }
18211
+ if (!Array.isArray(desired["Conditions"])) return patch;
18212
+ return [...patch, {
18213
+ op: "add",
18214
+ path: "/Conditions",
18215
+ value: conditionsToSend(desired["Conditions"])
18216
+ }];
18217
+ }
18218
+
18219
+ // src/provisioning/cc-read-back-default-paths.ts
18220
+ const CC_READ_BACK_DEFAULT_PATHS = { "AWS::OpenSearchService::Domain": [{
18221
+ path: ["AdvancedOptions", "override_main_response_version"],
18222
+ value: "false"
18223
+ }, {
18224
+ path: ["AIMLOptions"],
18225
+ value: {
18226
+ S3VectorsEngine: { Enabled: false },
18227
+ ServerlessVectorAcceleration: { Enabled: false }
18228
+ }
18229
+ }] };
18230
+ function hasCcReadBackDefaultPaths(resourceType) {
18231
+ return Object.prototype.hasOwnProperty.call(CC_READ_BACK_DEFAULT_PATHS, resourceType);
18232
+ }
18233
+ const ABSENT$1 = Symbol("absent");
18234
+ function valueAt$1(bag, path) {
18235
+ let cur = bag;
18236
+ for (const segment of path) {
18237
+ if (cur === null || typeof cur !== "object" || Array.isArray(cur)) return ABSENT$1;
18238
+ if (!Object.prototype.hasOwnProperty.call(cur, segment)) return ABSENT$1;
18239
+ cur = cur[segment];
18240
+ }
18241
+ return cur;
18242
+ }
18243
+ function withCcReadBackDefaultRemovals(resourceType, patch, desired, liveModel) {
18244
+ const defaults = hasCcReadBackDefaultPaths(resourceType) ? CC_READ_BACK_DEFAULT_PATHS[resourceType] : [];
18245
+ if (defaults.length === 0 || patch.length === 0 || liveModel === void 0) return patch;
18246
+ const extra = [];
18247
+ for (const { path, value } of defaults) {
18248
+ const pointer = `/${path.map(escapeJsonPointer$1).join("/")}`;
18249
+ if (patch.some((op) => op.path === pointer || op.path.startsWith(`${pointer}/`) || pointer.startsWith(`${op.path}/`))) continue;
18250
+ if (!isDeepStrictEqual(valueAt$1(liveModel, path), value)) continue;
18251
+ const declared = valueAt$1(desired, path);
18252
+ if (declared !== ABSENT$1 && !isDeepStrictEqual(declared, value)) continue;
18253
+ extra.push({
18254
+ op: "remove",
18255
+ path: pointer
18256
+ });
18257
+ }
18258
+ return extra.length === 0 ? patch : [...patch, ...extra];
18259
+ }
18260
+ function escapeJsonPointer$1(key) {
18261
+ return key.replace(/~/g, "~0").replace(/\//g, "~1");
18262
+ }
18263
+
18096
18264
  // src/provisioning/cc-read-back-empty-keys.ts
18097
- const CC_READ_BACK_EMPTY_KEYS = { "AWS::ImageBuilder::InfrastructureConfiguration": ["ResourceTags"] };
18265
+ const CC_READ_BACK_EMPTY_KEYS = {
18266
+ "AWS::DataSync::Task": ["Name", "Schedule"],
18267
+ "AWS::ImageBuilder::InfrastructureConfiguration": ["ResourceTags"]
18268
+ };
18098
18269
  function hasCcReadBackEmptyKeys(resourceType) {
18099
18270
  return Object.prototype.hasOwnProperty.call(CC_READ_BACK_EMPTY_KEYS, resourceType);
18100
18271
  }
18101
- function isEmptyCollection(value) {
18272
+ function isEmptyValue(value) {
18273
+ if (value === "") return true;
18102
18274
  if (Array.isArray(value)) return value.length === 0;
18103
18275
  return value !== null && typeof value === "object" && Object.keys(value).length === 0;
18104
18276
  }
@@ -18112,14 +18284,16 @@ function withCcReadBackEmptyKeyRemovals(resourceType, patch, desired, liveModel)
18112
18284
  const existing = out.findIndex((op) => op.path === path);
18113
18285
  if (existing !== -1) {
18114
18286
  const op = out[existing];
18115
- if ((op.op === "add" || op.op === "replace") && isEmptyCollection(op.value)) out = Object.prototype.hasOwnProperty.call(liveModel, key) ? out.map((o, i) => i === existing ? {
18287
+ const live = liveModel[key];
18288
+ const keepsLiveString = op.value === "" && typeof live === "string" && live !== "";
18289
+ if ((op.op === "add" || op.op === "replace") && isEmptyValue(op.value) && !keepsLiveString) out = Object.prototype.hasOwnProperty.call(liveModel, key) ? out.map((o, i) => i === existing ? {
18116
18290
  op: "remove",
18117
18291
  path
18118
18292
  } : o) : out.filter((_, i) => i !== existing);
18119
18293
  continue;
18120
18294
  }
18121
- if (!isEmptyCollection(liveModel[key])) continue;
18122
- if (Object.prototype.hasOwnProperty.call(desired, key) && !isEmptyCollection(desired[key])) continue;
18295
+ if (!isEmptyValue(liveModel[key])) continue;
18296
+ if (Object.prototype.hasOwnProperty.call(desired, key) && !isEmptyValue(desired[key])) continue;
18123
18297
  extra.push({
18124
18298
  op: "remove",
18125
18299
  path
@@ -18841,6 +19015,7 @@ async function updateInIdLogScope(logicalId, physicalId, resourceType, propertie
18841
19015
  }
18842
19016
  }
18843
19017
  patch = withGuardDutyDetectorReadBackOps(resourceType, patch, cleanProperties, context?.desiredFromAwsReadback === true ? { previous: cleanPreviousProperties } : void 0);
19018
+ patch = withListenerRuleConditionOps(resourceType, patch, cleanProperties);
18844
19019
  let liveModelRead;
18845
19020
  const readLiveModel = () => liveModelRead ??= this.readCcResourceModel(resourceType, physicalId, idLog);
18846
19021
  if (hasCcReadBackEmptyKeys(resourceType)) {
@@ -18851,6 +19026,7 @@ async function updateInIdLogScope(logicalId, physicalId, resourceType, propertie
18851
19026
  ...sentNothing
18852
19027
  };
18853
19028
  }
19029
+ if (hasCcReadBackDefaultPaths(resourceType)) patch = withCcReadBackDefaultRemovals(resourceType, patch, cleanProperties, await readLiveModel());
18854
19030
  if (writesTopLevelObject(patch)) {
18855
19031
  const [createOnlyPaths, readOnlyPaths] = await Promise.all([getCreateOnlyPropertyPaths(resourceType), getReadOnlyPropertyPaths(resourceType)]);
18856
19032
  const gaps = [...nestedCreateOnlyGaps(patch, createOnlyPaths), ...nestedReadOnlyGaps(patch, (readOnlyPaths ?? []).map((path) => path.split(".")), cleanPreviousProperties, resourceType)];
@@ -18999,7 +19175,7 @@ async function deleteEc2VolumeDirect(client, volumeId, logicalId, opts) {
18999
19175
  await client.send(new DeleteVolumeCommand({ VolumeId: volumeId }));
19000
19176
  opts.logger.debug(`DeleteVolume accepted for ${logicalId} (${volumeId})`);
19001
19177
  } catch (error) {
19002
- if (errorName(error) !== "IncorrectState") throw error;
19178
+ if (errorName$1(error) !== "IncorrectState") throw error;
19003
19179
  let state;
19004
19180
  try {
19005
19181
  state = await readVolumeState(client, volumeId);
@@ -19048,11 +19224,11 @@ async function readVolumeState(client, volumeId) {
19048
19224
  const volume = (await client.send(new DescribeVolumesCommand({ VolumeIds: [volumeId] }))).Volumes?.[0];
19049
19225
  return volume === void 0 ? void 0 : volume.State ?? "unknown";
19050
19226
  } catch (error) {
19051
- if (errorName(error) === "InvalidVolume.NotFound") return void 0;
19227
+ if (errorName$1(error) === "InvalidVolume.NotFound") return void 0;
19052
19228
  throw error;
19053
19229
  }
19054
19230
  }
19055
- function errorName(error) {
19231
+ function errorName$1(error) {
19056
19232
  if (typeof error !== "object" || error === null) return "";
19057
19233
  const name = error.name;
19058
19234
  return typeof name === "string" ? name : "";
@@ -19700,6 +19876,62 @@ function ccProtectionSite(resourceType, physicalId, entry, region) {
19700
19876
  };
19701
19877
  }
19702
19878
 
19879
+ // src/provisioning/recorded-identity.ts
19880
+ function recordedIdentityId(resourceType, context) {
19881
+ if (!Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, resourceType)) return void 0;
19882
+ const key = SURVIVOR_IDENTITY_ATTRIBUTES[resourceType];
19883
+ const value = context?.recordedAttributes?.[key];
19884
+ return isUsableIdentityValue(value) ? {
19885
+ key,
19886
+ value
19887
+ } : void 0;
19888
+ }
19889
+ var RecordedIdentityError = class extends ProvisioningError {
19890
+ constructor(message, resourceType, logicalId, physicalId, cause) {
19891
+ super(message, resourceType, logicalId, physicalId, cause);
19892
+ Object.setPrototypeOf(this, new.target.prototype);
19893
+ this.name = "RecordedIdentityError";
19894
+ }
19895
+ };
19896
+ var RecordedIdentityMismatchError = class RecordedIdentityMismatchError extends RecordedIdentityError {
19897
+ attribute;
19898
+ constructor(params) {
19899
+ const { label, resourceType, logicalId, physicalId, attribute, context } = params;
19900
+ super(`Cannot delete ${label} ${logicalId}: the ${label} holding the name cdkd recorded is not the one cdkd created (its ${attribute} differs from the recorded one), so cdkd sent no delete and kept the record. Leave that ${label} alone; if the one cdkd created is gone, drop the record with ${stateOrphanRecordRemedy(context, logicalId)}.`, resourceType, logicalId, physicalId);
19901
+ Object.setPrototypeOf(this, RecordedIdentityMismatchError.prototype);
19902
+ this.attribute = attribute;
19903
+ this.name = "RecordedIdentityMismatchError";
19904
+ markNonRetryable(this);
19905
+ }
19906
+ };
19907
+ const RECORDED_IDENTITY_REREAD_DELAY_MS = 5e3;
19908
+ async function assertRecordedIdentity(params) {
19909
+ const recorded = recordedIdentityId(params.resourceType, params.context);
19910
+ if (recorded === void 0) return;
19911
+ const { label, resourceType, logicalId, physicalId, context } = params;
19912
+ let liveId = params.liveId;
19913
+ if (typeof liveId === "string" && liveId !== "" && liveId !== recorded.value) {
19914
+ await new Promise((resolve) => setTimeout(resolve, RECORDED_IDENTITY_REREAD_DELAY_MS));
19915
+ liveId = await params.reread();
19916
+ }
19917
+ if (typeof liveId !== "string" || liveId === "") throw markNotGone(new RecordedIdentityError(`Cannot delete ${label} ${logicalId}: AWS answered without its ${recorded.key}, so cdkd cannot confirm it is the one cdkd created; nothing was sent and the record is kept. Re-run the operation.`, resourceType, logicalId, physicalId));
19918
+ if (liveId === recorded.value) return;
19919
+ throw new RecordedIdentityMismatchError({
19920
+ label,
19921
+ resourceType,
19922
+ logicalId,
19923
+ physicalId,
19924
+ attribute: recorded.key,
19925
+ context
19926
+ });
19927
+ }
19928
+ function differingIdentityWarning(logicalId, resourceType, attribute) {
19929
+ return safeMsg`${logicalId} (${resourceType}): the update answered with another ${attribute} than the recorded one, so it may have reached another resource under the same name; cdkd keeps the recorded ${attribute}. Check the resource before deleting anything by hand.`;
19930
+ }
19931
+ function identityWarner(logger, mask, op) {
19932
+ return (attribute) => logger.warn(mask(differingIdentityWarning(op.logicalId, op.resourceType, attribute)));
19933
+ }
19934
+
19703
19935
  // src/provisioning/cloud-control/delete-guards.ts
19704
19936
  const CC_DELETE_IDENTITY_CHECKED_TYPES = /* @__PURE__ */ new Set(["AWS::S3::Bucket"]);
19705
19937
  function requiresCcDeleteIdentityCheck(resourceType) {
@@ -19715,6 +19947,17 @@ function bucketLocationToRegion(constraint) {
19715
19947
  function isNoSuchBucketError(error) {
19716
19948
  return error?.name === "NoSuchBucket";
19717
19949
  }
19950
+ const CC_MODEL_OMITS_IDENTITY = /* @__PURE__ */ new Set([
19951
+ "AWS::DynamoDB::Table",
19952
+ "AWS::IAM::User",
19953
+ "AWS::IAM::Group",
19954
+ "AWS::IAM::InstanceProfile"
19955
+ ]);
19956
+ const CC_DELETE_RECORDED_IDENTITY_ATTRIBUTES = new Map(Object.entries(SURVIVOR_IDENTITY_ATTRIBUTES).filter(([resourceType]) => !CC_MODEL_OMITS_IDENTITY.has(resourceType)));
19957
+ function recordedCcDeleteIdentity(resourceType, context) {
19958
+ if (!CC_DELETE_RECORDED_IDENTITY_ATTRIBUTES.has(resourceType)) return void 0;
19959
+ return recordedIdentityId(resourceType, context);
19960
+ }
19718
19961
  const SDK_DELETE_FAMILIES = /* @__PURE__ */ new Map([
19719
19962
  ["AWS::RDS::DBCluster", "rds"],
19720
19963
  ["AWS::RDS::DBInstance", "rds"],
@@ -19741,6 +19984,113 @@ function isCcConflict(error) {
19741
19984
  return typeof error === "object" && error !== null && error.name === "ResourceConflictException";
19742
19985
  }
19743
19986
 
19987
+ // src/provisioning/cloud-control/delete-identity.ts
19988
+ async function assertRecordedRegionAgainstClient(phase, expectedRegion, resourceType, logicalId, physicalId) {
19989
+ const recordedRegion = canonicalizeRegion(expectedRegion?.trim());
19990
+ if (recordedRegion === void 0 || recordedRegion === "") return;
19991
+ let clientRegion;
19992
+ try {
19993
+ clientRegion = canonicalizeRegion((await this.cloudControlClient.config.region())?.trim());
19994
+ } catch (error) {
19995
+ this.logger.debug(`Could not resolve the Cloud Control client region before the ${phase} region check for ${logicalId} (${resourceType}): ${displaySafe(describeAwsFailure(error).detail)}`);
19996
+ clientRegion = void 0;
19997
+ }
19998
+ try {
19999
+ assertRegionMatch(clientRegion, recordedRegion, resourceType, logicalId, physicalId, phase);
20000
+ } catch (error) {
20001
+ throw markNonRetryable(error);
20002
+ }
20003
+ }
20004
+ async function assertRecordedIdentityBeforeCcDelete(logicalId, resourceType, physicalId, context) {
20005
+ if (recordedCcDeleteIdentity(resourceType, context) === void 0) return;
20006
+ const read = async () => {
20007
+ let raw;
20008
+ try {
20009
+ raw = (await this.cloudControlClient.send(new GetResourceCommand({
20010
+ TypeName: resourceType,
20011
+ Identifier: physicalId
20012
+ }))).ResourceDescription?.Properties;
20013
+ } catch (error) {
20014
+ if (error?.name === "ResourceNotFoundException") return ABSENT;
20015
+ try {
20016
+ this.handleError(error, "READ", resourceType, logicalId, physicalId);
20017
+ } catch (wrapped) {
20018
+ throw markNotGoneOnNeedle(wrapped);
20019
+ }
20020
+ }
20021
+ const key = CC_DELETE_RECORDED_IDENTITY_ATTRIBUTES.get(resourceType);
20022
+ try {
20023
+ const model = typeof raw === "string" ? JSON.parse(raw) : void 0;
20024
+ const live = model !== null && typeof model === "object" && !Array.isArray(model) ? model[key] : void 0;
20025
+ return typeof live === "string" ? live : void 0;
20026
+ } catch {
20027
+ return;
20028
+ }
20029
+ };
20030
+ const first = await read();
20031
+ if (first === ABSENT) return;
20032
+ await assertRecordedIdentity({
20033
+ label: resourceType,
20034
+ resourceType,
20035
+ logicalId,
20036
+ physicalId,
20037
+ liveId: first,
20038
+ reread: async () => {
20039
+ const again = await read();
20040
+ return again === ABSENT ? void 0 : again;
20041
+ },
20042
+ context
20043
+ });
20044
+ }
20045
+ const ABSENT = Symbol("absent");
20046
+ async function confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context) {
20047
+ if (!requiresCcDeleteIdentityCheck(resourceType)) return void 0;
20048
+ const recordedRegion = context?.expectedRegion?.trim();
20049
+ let expectedRegion = recordedRegion === void 0 || recordedRegion === "" ? void 0 : recordedRegion;
20050
+ let clientRegionError;
20051
+ if (expectedRegion === void 0) try {
20052
+ const clientRegion = (await this.cloudControlClient.config.region())?.trim();
20053
+ expectedRegion = clientRegion === void 0 || clientRegion === "" ? void 0 : clientRegion;
20054
+ } catch (error) {
20055
+ const clientRegionFailure = describeAwsFailure(error);
20056
+ clientRegionError = clientRegionFailure.summary;
20057
+ this.logger.debug(`Could not resolve the Cloud Control client region while confirming ${physicalId}: ${clientRegionFailure.detail}`);
20058
+ expectedRegion = void 0;
20059
+ }
20060
+ if (expectedRegion === void 0) {
20061
+ const reason = clientRegionError === void 0 ? `neither the stack state nor the AWS client reports a region` : `the stack state records no region and the AWS client's region could not be resolved: ${clientRegionError}`;
20062
+ this.logger.warn(`Could not confirm that ${resourceType} ${physicalId} (${logicalId}) is the resource this destroy targets: ${reason.replace(/[.\s]+$/, "")}. Proceeding with the delete.`);
20063
+ return {
20064
+ guard: CC_DELETE_REGION_IDENTITY_GUARD,
20065
+ reason
20066
+ };
20067
+ }
20068
+ const wantRegion = canonicalizeRegion(expectedRegion);
20069
+ let actualRegion;
20070
+ try {
20071
+ const location = await getAwsClients().s3.send(new GetBucketLocationCommand({ Bucket: physicalId }));
20072
+ actualRegion = bucketLocationToRegion(location.LocationConstraint);
20073
+ } catch (error) {
20074
+ if (isNoSuchBucketError(error)) {
20075
+ this.logger.debug(`Bucket ${physicalId} (${logicalId}) is already absent; leaving the delete to the Cloud Control idempotency path`);
20076
+ return;
20077
+ }
20078
+ const failure = describeAwsFailure(error);
20079
+ this.logger.debug(`s3:GetBucketLocation on ${physicalId} (${logicalId}) failed: ${failure.detail}`);
20080
+ const summarySentence = failure.summary.replace(/[.\s]+$/, "");
20081
+ this.logger.warn(`Could not confirm which region S3 bucket ${physicalId} (${logicalId}) lives in before deleting it: ${summarySentence}. S3 bucket names are globally unique, so cdkd cannot rule out that this name denotes a bucket in another region. Grant s3:GetBucketLocation on the bucket to enable the check. Proceeding with the delete.`);
20082
+ return {
20083
+ guard: CC_DELETE_REGION_IDENTITY_GUARD,
20084
+ reason: `s3:GetBucketLocation on ${physicalId} could not be answered: ${failure.summary}`
20085
+ };
20086
+ }
20087
+ if (actualRegion === wantRegion) {
20088
+ this.logger.debug(`Confirmed S3 bucket ${physicalId} (${logicalId}) lives in ${wantRegion} before deleting it`);
20089
+ return;
20090
+ }
20091
+ throw markNonRetryable(new ProvisioningError(`Refusing to delete S3 bucket ${physicalId} for ${logicalId} (${resourceType}): the bucket carrying that name lives in ${actualRegion}, while this destroy targets ${wantRegion}. S3 bucket names are globally unique, so a physical id recorded in cdkd state can denote a bucket in a different region. S3 follows the region redirect for a body-bearing operation, so issuing this delete risks destroying the live bucket in ${actualRegion} instead, unrecoverably, rather than reporting the bucket absent. Confirm the physical id recorded in cdkd state (cdkd state show) and correct the record: --region does not change this comparison, which reads the region stored in the state file, so re-running the destroy with a different flag value will not resolve it.`, resourceType, logicalId, physicalId));
20092
+ }
20093
+
19744
20094
  // src/provisioning/delete-gone-wait.ts
19745
20095
  async function waitForGoneAfterDelete(opts) {
19746
20096
  const sleep = opts.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
@@ -19943,7 +20293,7 @@ async function deleteInIdLogScope(logicalId, physicalId, resourceType, propertie
19943
20293
  const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
19944
20294
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
19945
20295
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
19946
- const { ASGProvider } = await import("./asg-provider-BP8oMti2.js");
20296
+ const { ASGProvider } = await import("./asg-provider-BDCUGWZV.js");
19947
20297
  const delegateRegion = ambientRegion();
19948
20298
  let asgProvider = this.asgDeleteDelegates.get(delegateRegion);
19949
20299
  if (asgProvider === void 0) {
@@ -19952,6 +20302,7 @@ async function deleteInIdLogScope(logicalId, physicalId, resourceType, propertie
19952
20302
  }
19953
20303
  return withIndeterminateGuard(await asgProvider.delete(logicalId, physicalId, resourceType, properties, context), indeterminateGuard);
19954
20304
  }
20305
+ await assertRecordedIdentityBeforeCcDelete.call(this, logicalId, resourceType, physicalId, context);
19955
20306
  if ((context?.deletionPolicy === "Delete" || context?.skipFinalSnapshot === true) && SDK_DELETE_FAMILIES.has(resourceType)) {
19956
20307
  if (deletesThroughSdkProvider(resourceType, properties)) {
19957
20308
  const delegate = await this.sdkDeleteDelegateInCcRegion(resourceType, logicalId, physicalId);
@@ -20097,7 +20448,7 @@ async function sdkDeleteDelegateInCcRegion(resourceType, logicalId, physicalId)
20097
20448
  const family = SDK_DELETE_FAMILIES.get(resourceType);
20098
20449
  const cached = this.sdkDeleteDelegates.get(family);
20099
20450
  if (cached !== void 0 && cached.region === ccRegion) return cached.provider;
20100
- const provider = family === "rds" ? new (await (import("./rds-provider-DJtzCaTQ.js"))).RDSProvider({ region: ccRegion }) : new (await (import("./neptune-provider-CpoLlf2R.js"))).NeptuneProvider({ region: ccRegion });
20451
+ const provider = family === "rds" ? new (await (import("./rds-provider-DpOZv_UG.js"))).RDSProvider({ region: ccRegion }) : new (await (import("./neptune-provider-DiyWADaS.js"))).NeptuneProvider({ region: ccRegion });
20101
20452
  this.sdkDeleteDelegates.set(family, {
20102
20453
  region: ccRegion,
20103
20454
  provider
@@ -20119,71 +20470,6 @@ async function ec2ClientInCcRegion(resourceType, logicalId, physicalId) {
20119
20470
  return ec2;
20120
20471
  }
20121
20472
 
20122
- // src/provisioning/cloud-control/delete-identity.ts
20123
- async function assertRecordedRegionAgainstClient(phase, expectedRegion, resourceType, logicalId, physicalId) {
20124
- const recordedRegion = canonicalizeRegion(expectedRegion?.trim());
20125
- if (recordedRegion === void 0 || recordedRegion === "") return;
20126
- let clientRegion;
20127
- try {
20128
- clientRegion = canonicalizeRegion((await this.cloudControlClient.config.region())?.trim());
20129
- } catch (error) {
20130
- this.logger.debug(`Could not resolve the Cloud Control client region before the ${phase} region check for ${logicalId} (${resourceType}): ${displaySafe(describeAwsFailure(error).detail)}`);
20131
- clientRegion = void 0;
20132
- }
20133
- try {
20134
- assertRegionMatch(clientRegion, recordedRegion, resourceType, logicalId, physicalId, phase);
20135
- } catch (error) {
20136
- throw markNonRetryable(error);
20137
- }
20138
- }
20139
- async function confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context) {
20140
- if (!requiresCcDeleteIdentityCheck(resourceType)) return void 0;
20141
- const recordedRegion = context?.expectedRegion?.trim();
20142
- let expectedRegion = recordedRegion === void 0 || recordedRegion === "" ? void 0 : recordedRegion;
20143
- let clientRegionError;
20144
- if (expectedRegion === void 0) try {
20145
- const clientRegion = (await this.cloudControlClient.config.region())?.trim();
20146
- expectedRegion = clientRegion === void 0 || clientRegion === "" ? void 0 : clientRegion;
20147
- } catch (error) {
20148
- const clientRegionFailure = describeAwsFailure(error);
20149
- clientRegionError = clientRegionFailure.summary;
20150
- this.logger.debug(`Could not resolve the Cloud Control client region while confirming ${physicalId}: ${clientRegionFailure.detail}`);
20151
- expectedRegion = void 0;
20152
- }
20153
- if (expectedRegion === void 0) {
20154
- const reason = clientRegionError === void 0 ? `neither the stack state nor the AWS client reports a region` : `the stack state records no region and the AWS client's region could not be resolved: ${clientRegionError}`;
20155
- this.logger.warn(`Could not confirm that ${resourceType} ${physicalId} (${logicalId}) is the resource this destroy targets: ${reason.replace(/[.\s]+$/, "")}. Proceeding with the delete.`);
20156
- return {
20157
- guard: CC_DELETE_REGION_IDENTITY_GUARD,
20158
- reason
20159
- };
20160
- }
20161
- const wantRegion = canonicalizeRegion(expectedRegion);
20162
- let actualRegion;
20163
- try {
20164
- const location = await getAwsClients().s3.send(new GetBucketLocationCommand({ Bucket: physicalId }));
20165
- actualRegion = bucketLocationToRegion(location.LocationConstraint);
20166
- } catch (error) {
20167
- if (isNoSuchBucketError(error)) {
20168
- this.logger.debug(`Bucket ${physicalId} (${logicalId}) is already absent; leaving the delete to the Cloud Control idempotency path`);
20169
- return;
20170
- }
20171
- const failure = describeAwsFailure(error);
20172
- this.logger.debug(`s3:GetBucketLocation on ${physicalId} (${logicalId}) failed: ${failure.detail}`);
20173
- const summarySentence = failure.summary.replace(/[.\s]+$/, "");
20174
- this.logger.warn(`Could not confirm which region S3 bucket ${physicalId} (${logicalId}) lives in before deleting it: ${summarySentence}. S3 bucket names are globally unique, so cdkd cannot rule out that this name denotes a bucket in another region. Grant s3:GetBucketLocation on the bucket to enable the check. Proceeding with the delete.`);
20175
- return {
20176
- guard: CC_DELETE_REGION_IDENTITY_GUARD,
20177
- reason: `s3:GetBucketLocation on ${physicalId} could not be answered: ${failure.summary}`
20178
- };
20179
- }
20180
- if (actualRegion === wantRegion) {
20181
- this.logger.debug(`Confirmed S3 bucket ${physicalId} (${logicalId}) lives in ${wantRegion} before deleting it`);
20182
- return;
20183
- }
20184
- throw markNonRetryable(new ProvisioningError(`Refusing to delete S3 bucket ${physicalId} for ${logicalId} (${resourceType}): the bucket carrying that name lives in ${actualRegion}, while this destroy targets ${wantRegion}. S3 bucket names are globally unique, so a physical id recorded in cdkd state can denote a bucket in a different region. S3 follows the region redirect for a body-bearing operation, so issuing this delete risks destroying the live bucket in ${actualRegion} instead, unrecoverably, rather than reporting the bucket absent. Confirm the physical id recorded in cdkd state (cdkd state show) and correct the record: --region does not change this comparison, which reads the region stored in the state file, so re-running the destroy with a different flag value will not resolve it.`, resourceType, logicalId, physicalId));
20185
- }
20186
-
20187
20473
  // src/provisioning/cloud-control/protection.ts
20188
20474
  async function disableCcProtection(logicalId, physicalId, resourceType, entry) {
20189
20475
  const protectionProperty = entry.property;
@@ -21802,11 +22088,11 @@ function applyNoEchoDeleteValues(properties, recordedLeaves, values) {
21802
22088
  payload: properties,
21803
22089
  unresolved: []
21804
22090
  };
21805
- const byKey = new Map((values?.leaves ?? []).map((leaf) => [canonicalJson$6(leaf.coordinate), leaf]));
22091
+ const byKey = new Map((values?.leaves ?? []).map((leaf) => [canonicalJson$7(leaf.coordinate), leaf]));
21806
22092
  const entries = [];
21807
22093
  const unresolved = [];
21808
22094
  for (const coordinate of masked) {
21809
- const leaf = byKey.get(canonicalJson$6(coordinate));
22095
+ const leaf = byKey.get(canonicalJson$7(coordinate));
21810
22096
  if (leaf === void 0) unresolved.push(coordinate);
21811
22097
  else entries.push({
21812
22098
  coordinate,
@@ -21857,7 +22143,7 @@ async function noEchoDeleteValuesFromResolved(options) {
21857
22143
  const fingerprinter = options.inputSources === void 0 ? void 0 : inputFingerprinter(templateProps, options.inputSources);
21858
22144
  const leaves = [];
21859
22145
  for (const coordinate of masked) {
21860
- if (!nodes.has(canonicalJson$6(coordinate))) continue;
22146
+ if (!nodes.has(canonicalJson$7(coordinate))) continue;
21861
22147
  if (!await fingerprintsUnchanged(record, templateProps, coordinate, fingerprinter)) continue;
21862
22148
  const value = valueAtCoordinate(resolvedProperties, coordinate);
21863
22149
  if (value === void 0 || carriesSecretMask(value)) continue;
@@ -22036,7 +22322,7 @@ var TemplateNoEchoReresolver = class TemplateNoEchoReresolver {
22036
22322
  const bag = await this.noEchoNeedles();
22037
22323
  const leaves = [];
22038
22324
  for (const coordinate of masked) {
22039
- const key = canonicalJson$6(coordinate);
22325
+ const key = canonicalJson$7(coordinate);
22040
22326
  if (!nodes.has(key)) continue;
22041
22327
  const node = nodes.get(key)?.node;
22042
22328
  if (!readsParametersOnly(node, declared, refused)) continue;
@@ -22738,7 +23024,7 @@ async function publishToSns(topicArn, request) {
22738
23024
  }
22739
23025
  async function invokeLambda(serviceToken, request) {
22740
23026
  if (localCustomResourceRuntimeActive()) {
22741
- const { invokeCustomResourceFunctionLocally } = await import("./custom-resource-runtime-QfoyaxPW.js");
23027
+ const { invokeCustomResourceFunctionLocally } = await import("./custom-resource-runtime-DMkX_oQo.js");
22742
23028
  const local = await invokeCustomResourceFunctionLocally({
22743
23029
  lambda: this.lambdaClient,
22744
23030
  s3: this.s3Client
@@ -23219,6 +23505,217 @@ var CustomResourceProvider = class CustomResourceProvider {
23219
23505
  }
23220
23506
  };
23221
23507
 
23508
+ // src/provisioning/wait-condition-signal-versions.ts
23509
+ async function listSignalVersions(client, bucket, key, owner) {
23510
+ const versions = [];
23511
+ let keyMarker;
23512
+ let versionIdMarker;
23513
+ do {
23514
+ const page = await client.send(new ListObjectVersionsCommand({
23515
+ Bucket: bucket,
23516
+ Prefix: key,
23517
+ ...owner,
23518
+ EncodingType: "url",
23519
+ ...keyMarker !== void 0 && { KeyMarker: keyMarker },
23520
+ ...versionIdMarker !== void 0 && { VersionIdMarker: versionIdMarker }
23521
+ }));
23522
+ for (const v of page.Versions ?? []) {
23523
+ if (typeof v.VersionId !== "string") continue;
23524
+ let listed;
23525
+ try {
23526
+ listed = decodeListingKey(v.Key);
23527
+ } catch {
23528
+ continue;
23529
+ }
23530
+ if (listed === key) versions.push({
23531
+ versionId: v.VersionId,
23532
+ size: v.Size ?? 0
23533
+ });
23534
+ }
23535
+ keyMarker = page.IsTruncated ? decodeListingKey(page.NextKeyMarker) : void 0;
23536
+ versionIdMarker = page.IsTruncated ? page.NextVersionIdMarker : void 0;
23537
+ } while (keyMarker !== void 0);
23538
+ return versions.reverse();
23539
+ }
23540
+
23541
+ // src/provisioning/wait-condition-signal-store.ts
23542
+ const SIGNAL_URL_EXPIRES_IN_SECONDS = 604800;
23543
+ const MAX_SIGNAL_BYTES = 65536;
23544
+ const LEGACY_HANDLE_ID_PREFIX = "cdkd-wait-condition-handle-";
23545
+ const SIGNAL_KEY = new RegExp(`^${WAIT_CONDITION_SIGNAL_PREFIX}/[A-Za-z0-9]{1,255}-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\.json$`);
23546
+ function signalKeyFor(logicalId) {
23547
+ return `${WAIT_CONDITION_SIGNAL_PREFIX}/${logicalId}-${randomUUID()}.json`;
23548
+ }
23549
+ function classifyHandleUrl(handle, bucket) {
23550
+ if (handle.startsWith("cdkd-wait-condition-handle-")) return { kind: "legacy" };
23551
+ let parsed;
23552
+ try {
23553
+ parsed = new URL(handle);
23554
+ } catch {
23555
+ return { kind: "foreign" };
23556
+ }
23557
+ const marker = `/${WAIT_CONDITION_SIGNAL_PREFIX}/`;
23558
+ const at = parsed.pathname.lastIndexOf(marker);
23559
+ if (at < 0) return { kind: "foreign" };
23560
+ let key;
23561
+ try {
23562
+ key = decodeURIComponent(parsed.pathname.slice(at + 1));
23563
+ } catch {
23564
+ return { kind: "foreign" };
23565
+ }
23566
+ if (!SIGNAL_KEY.test(key)) return { kind: "foreign" };
23567
+ const before = parsed.pathname.slice(0, at);
23568
+ return before === `/${bucket}` || before === "" && parsed.hostname.startsWith(`${bucket}.`) ? {
23569
+ kind: "ours",
23570
+ key
23571
+ } : { kind: "foreign" };
23572
+ }
23573
+ function parseSignalBody(body) {
23574
+ let doc;
23575
+ try {
23576
+ doc = JSON.parse(body);
23577
+ } catch {
23578
+ return;
23579
+ }
23580
+ if (doc === null || typeof doc !== "object" || Array.isArray(doc)) return void 0;
23581
+ const d = doc;
23582
+ const status = typeof d["Status"] === "string" ? d["Status"].toUpperCase() : void 0;
23583
+ if (status !== "SUCCESS" && status !== "FAILURE") return void 0;
23584
+ const text = (v) => v === void 0 || v === null ? "" : typeof v === "string" ? v : JSON.stringify(v);
23585
+ return {
23586
+ status,
23587
+ uniqueId: text(d["UniqueId"]),
23588
+ data: text(d["Data"]),
23589
+ reason: text(d["Reason"])
23590
+ };
23591
+ }
23592
+ function evaluateSignals(signals, count) {
23593
+ const data = /* @__PURE__ */ new Map();
23594
+ if (count <= 0) return {
23595
+ state: "succeeded",
23596
+ data: {}
23597
+ };
23598
+ for (const signal of signals) {
23599
+ if (signal.status === "FAILURE") return {
23600
+ state: "failed",
23601
+ signal
23602
+ };
23603
+ data.set(signal.uniqueId, signal.data);
23604
+ if (data.size >= count) return {
23605
+ state: "succeeded",
23606
+ data: Object.fromEntries(data)
23607
+ };
23608
+ }
23609
+ return {
23610
+ state: "pending",
23611
+ successes: data.size
23612
+ };
23613
+ }
23614
+ var WaitConditionSignalStore = class {
23615
+ bucket;
23616
+ clients = /* @__PURE__ */ new WeakMap();
23617
+ logger = getLogger().child("WaitConditionSignalStore");
23618
+ setBucket(bucket) {
23619
+ this.bucket = bucket;
23620
+ }
23621
+ requireBucket() {
23622
+ if (this.bucket === void 0 || this.bucket === "") throw new Error("No cdkd state bucket is configured, so no wait condition signal URL can be issued.");
23623
+ return this.bucket;
23624
+ }
23625
+ client() {
23626
+ const base = getAwsClients().s3;
23627
+ const bucket = this.requireBucket();
23628
+ let resolved = this.clients.get(base);
23629
+ if (resolved === void 0) {
23630
+ resolved = rebuildClientForBucketRegion(base, bucket, {
23631
+ reuseClientCredentials: true,
23632
+ tolerateNonStandardClient: true
23633
+ }).then((rebuilt) => rebuilt ?? base);
23634
+ this.clients.set(base, resolved);
23635
+ resolved.catch(() => {
23636
+ if (this.clients.get(base) === resolved) this.clients.delete(base);
23637
+ });
23638
+ }
23639
+ return resolved;
23640
+ }
23641
+ async issueSignalUrl(logicalId) {
23642
+ const bucket = this.requireBucket();
23643
+ const client = await this.client();
23644
+ const key = signalKeyFor(logicalId);
23645
+ const url = await getSignedUrl(client, new PutObjectCommand({
23646
+ Bucket: bucket,
23647
+ Key: key
23648
+ }), { expiresIn: SIGNAL_URL_EXPIRES_IN_SECONDS });
23649
+ let expiresAt = new Date(Date.now() + SIGNAL_URL_EXPIRES_IN_SECONDS * 1e3);
23650
+ try {
23651
+ const provider = client.config?.credentials;
23652
+ const creds = typeof provider === "function" ? await provider() : void 0;
23653
+ if (creds?.expiration instanceof Date && creds.expiration < expiresAt) expiresAt = creds.expiration;
23654
+ } catch {}
23655
+ return {
23656
+ url,
23657
+ key,
23658
+ expiresAt
23659
+ };
23660
+ }
23661
+ async readSignals(key, seen, maxVersions = Infinity) {
23662
+ const bucket = this.requireBucket();
23663
+ const client = await this.client();
23664
+ const owner = await expectedOwnerParam(client);
23665
+ const versions = await listSignalVersions(client, bucket, key, owner);
23666
+ if (versions.length > maxVersions) throw Object.assign(/* @__PURE__ */ new Error(`${versions.length} signal versions exceed the limit of ${maxVersions}`), { name: "WaitConditionSignalFlood" });
23667
+ const signals = [];
23668
+ for (const { versionId, size } of versions) {
23669
+ if (!seen.has(versionId)) seen.set(versionId, await this.readVersion(client, bucket, key, versionId, size, owner));
23670
+ const signal = seen.get(versionId);
23671
+ if (signal) signals.push(signal);
23672
+ }
23673
+ return signals;
23674
+ }
23675
+ async readVersion(client, bucket, key, versionId, size, owner) {
23676
+ if (size === 0) return null;
23677
+ if (size > 65536) {
23678
+ this.logger.warn(safeMsg`Ignoring a wait condition signal of ${size} bytes (over ${MAX_SIGNAL_BYTES}).`);
23679
+ return null;
23680
+ }
23681
+ const body = await (await client.send(new GetObjectCommand({
23682
+ Bucket: bucket,
23683
+ Key: key,
23684
+ VersionId: versionId,
23685
+ ...owner
23686
+ }))).Body?.transformToString() ?? "";
23687
+ const signal = parseSignalBody(body);
23688
+ if (signal === void 0) {
23689
+ this.logger.warn(safeMsg`Ignoring a wait condition signal that is not a {"Status": "SUCCESS" | "FAILURE", ...} document (${body.length} bytes).`);
23690
+ return null;
23691
+ }
23692
+ return signal;
23693
+ }
23694
+ async deleteSignals(key) {
23695
+ try {
23696
+ const bucket = this.requireBucket();
23697
+ const client = await this.client();
23698
+ const owner = await expectedOwnerParam(client);
23699
+ const deleted = await client.send(new DeleteObjectCommand({
23700
+ Bucket: bucket,
23701
+ Key: key,
23702
+ ...owner
23703
+ }));
23704
+ await purgeNoncurrentKeyVersions(client, bucket, [key], { requestFields: owner });
23705
+ if (deleted.DeleteMarker === true && typeof deleted.VersionId === "string") await client.send(new DeleteObjectCommand({
23706
+ Bucket: bucket,
23707
+ Key: key,
23708
+ VersionId: deleted.VersionId,
23709
+ ...owner
23710
+ }));
23711
+ } catch (error) {
23712
+ const failure = describeAwsFailure(error);
23713
+ this.logger.warn(safeMsg`Could not remove the wait condition signal object ${key}: ${failure.summary}`);
23714
+ this.logger.debug(safeMsg`Signal object delete failure detail: ${failure.detail}`);
23715
+ }
23716
+ }
23717
+ };
23718
+
23222
23719
  // src/provisioning/provider-registry/routing.ts
23223
23720
  function getProviderFor(input) {
23224
23721
  const debug = (message) => {
@@ -25797,6 +26294,7 @@ var ProviderRegistry = class {
25797
26294
  providers = /* @__PURE__ */ new Map();
25798
26295
  cloudControlProvider;
25799
26296
  customResourceProvider;
26297
+ waitConditionSignals = new WaitConditionSignalStore();
25800
26298
  skipResourceTypes = /* @__PURE__ */ new Set();
25801
26299
  allowedUnsupportedTypes = /* @__PURE__ */ new Set();
25802
26300
  allowedUnsupportedProperties = /* @__PURE__ */ new Set();
@@ -25821,6 +26319,7 @@ var ProviderRegistry = class {
25821
26319
  }
25822
26320
  setCustomResourceResponseBucket(bucket) {
25823
26321
  this.customResourceProvider.setResponseBucket(bucket);
26322
+ this.waitConditionSignals.setBucket(bucket);
25824
26323
  this.logger.debug(`Custom resource response bucket set to: ${bucket}`);
25825
26324
  }
25826
26325
  skipResourceType(resourceType) {
@@ -25897,6 +26396,292 @@ function isCustomResource(resourceType) {
25897
26396
  return resourceType.startsWith("Custom::") || resourceType === "AWS::CloudFormation::CustomResource";
25898
26397
  }
25899
26398
 
26399
+ // src/provisioning/policy-document-content.ts
26400
+ const MASK = "***";
26401
+ const PERMANENT_CDKD_CODES = /* @__PURE__ */ new Set(["ROLLBACK_SECRET_TOKEN_SCAN_MISMATCH"]);
26402
+ const MARKED_PERMANENT_CODE_PREFIXES = ["INTRINSIC_RESOLUTION_REFUSAL", "ROLLBACK_SECRET_REGION_AMBIGUOUS"];
26403
+ const NOT_FOUND_ERROR_NAMES = /* @__PURE__ */ new Set([
26404
+ "ResourceNotFoundException",
26405
+ "ParameterNotFound",
26406
+ "ParameterVersionNotFound"
26407
+ ]);
26408
+ function holdsUnresolvedValue(document) {
26409
+ let root = document;
26410
+ if (typeof document === "string") try {
26411
+ root = JSON.parse(document);
26412
+ } catch {
26413
+ root = document;
26414
+ }
26415
+ const walk = (v) => {
26416
+ if (typeof v === "string") return v === MASK || v.includes("{{resolve:");
26417
+ if (Array.isArray(v)) return v.some(walk);
26418
+ if (v !== null && typeof v === "object") return Object.values(v).some(walk);
26419
+ return false;
26420
+ };
26421
+ return walk(root);
26422
+ }
26423
+ function isPermanentResolutionError(error) {
26424
+ let current = error;
26425
+ for (let depth = 0; depth < 5 && current != null; depth++) {
26426
+ const e = current;
26427
+ if (typeof e.name === "string" && NOT_FOUND_ERROR_NAMES.has(e.name)) return true;
26428
+ if (typeof e.code === "string") {
26429
+ if (PERMANENT_CDKD_CODES.has(e.code)) return true;
26430
+ const code = e.code;
26431
+ if (MARKED_PERMANENT_CODE_PREFIXES.some((p) => code.startsWith(p)) && isMarkedNonRetryable(current)) return true;
26432
+ }
26433
+ if (typeof e.message === "string" && e.message.startsWith("Dynamic reference: ")) return true;
26434
+ current = e.cause;
26435
+ }
26436
+ return false;
26437
+ }
26438
+ function errorName(error) {
26439
+ const name = error?.name;
26440
+ return typeof name === "string" && /^[\w.-]{1,128}$/.test(name) ? name : "error";
26441
+ }
26442
+ async function attemptedPolicyDocument(recorded, resolve) {
26443
+ let document = recorded;
26444
+ if (resolve) try {
26445
+ document = await resolve();
26446
+ } catch (error) {
26447
+ return isPermanentResolutionError(error) ? {
26448
+ kind: "unusable",
26449
+ why: "a secret it references does not exist or cannot be used"
26450
+ } : {
26451
+ kind: "retry",
26452
+ errorName: errorName(error)
26453
+ };
26454
+ }
26455
+ if (!(typeof document === "string" && document.length > 0 || document !== null && typeof document === "object")) return {
26456
+ kind: "unusable",
26457
+ why: "no policy document it attempted is recorded"
26458
+ };
26459
+ if (holdsUnresolvedValue(document)) return {
26460
+ kind: "unusable",
26461
+ why: "its policy document still holds a secret reference or masked value"
26462
+ };
26463
+ return {
26464
+ kind: "document",
26465
+ document
26466
+ };
26467
+ }
26468
+ const ACCOUNT_ID = /^\d{12}$/;
26469
+ const ACCOUNT_ROOT_ARN = /^arn:[a-z-]+:iam::(\d{12}):root$/;
26470
+ const LIST_KEYS = [
26471
+ "Action",
26472
+ "NotAction",
26473
+ "Resource",
26474
+ "NotResource"
26475
+ ];
26476
+ const PRINCIPAL_KEYS = ["Principal", "NotPrincipal"];
26477
+ function unwrapSingle(value) {
26478
+ return Array.isArray(value) && value.length === 1 ? value[0] : value;
26479
+ }
26480
+ function accountKey(value) {
26481
+ if (typeof value !== "string") return value;
26482
+ if (ACCOUNT_ID.test(value)) return `account:${value}`;
26483
+ const m = ACCOUNT_ROOT_ARN.exec(value);
26484
+ return m ? `account:${m[1]}` : value;
26485
+ }
26486
+ const ANYONE = "anyone:*";
26487
+ function normalizePrincipal(principal) {
26488
+ if (principal === "*") return ANYONE;
26489
+ if (principal === null || typeof principal !== "object" || Array.isArray(principal)) return principal;
26490
+ const keys = Object.keys(principal);
26491
+ if (keys.length === 1 && keys[0] === "AWS" && unwrapSingle(principal["AWS"]) === "*") return ANYONE;
26492
+ const out = {};
26493
+ for (const [key, raw] of Object.entries(principal)) out[key] = unwrapSingle(key === "AWS" ? Array.isArray(raw) ? raw.map(accountKey) : accountKey(raw) : raw);
26494
+ return out;
26495
+ }
26496
+ function normalizeStatement(statement) {
26497
+ if (statement === null || typeof statement !== "object" || Array.isArray(statement)) return statement;
26498
+ const out = { ...statement };
26499
+ for (const key of LIST_KEYS) if (Object.prototype.hasOwnProperty.call(out, key)) out[key] = unwrapSingle(out[key]);
26500
+ for (const key of PRINCIPAL_KEYS) if (Object.prototype.hasOwnProperty.call(out, key)) out[key] = normalizePrincipal(out[key]);
26501
+ return out;
26502
+ }
26503
+ function canonicalJson$5(value) {
26504
+ const sortKeys = (v) => {
26505
+ if (Array.isArray(v)) return v.map(sortKeys);
26506
+ if (v !== null && typeof v === "object") {
26507
+ const out = Object.create(null);
26508
+ for (const key of Object.keys(v).sort()) out[key] = sortKeys(v[key]);
26509
+ return out;
26510
+ }
26511
+ return v;
26512
+ };
26513
+ return JSON.stringify(sortKeys(value));
26514
+ }
26515
+ function policyContentKey(document) {
26516
+ let value = document;
26517
+ if (typeof document === "string") try {
26518
+ value = JSON.parse(document);
26519
+ } catch {
26520
+ return `raw:${document}`;
26521
+ }
26522
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
26523
+ const doc = { ...value };
26524
+ if (Object.prototype.hasOwnProperty.call(doc, "Statement")) doc["Statement"] = (Array.isArray(doc["Statement"]) ? doc["Statement"] : [doc["Statement"]]).map(normalizeStatement);
26525
+ value = doc;
26526
+ }
26527
+ return canonicalJson$5(value);
26528
+ }
26529
+
26530
+ // src/provisioning/settle-after-own-write.ts
26531
+ const OWN_WRITE_REREAD_DELAYS_MS = [
26532
+ 500,
26533
+ 1e3,
26534
+ 2e3
26535
+ ];
26536
+ async function reReadUntilSettled(read, settled, delaysMs) {
26537
+ let answer = await read();
26538
+ for (const delayMs of delaysMs) {
26539
+ if (settled(answer)) return {
26540
+ answer,
26541
+ settled: true
26542
+ };
26543
+ await new Promise((resolve) => setTimeout(resolve, delayMs));
26544
+ answer = await read();
26545
+ }
26546
+ return {
26547
+ answer,
26548
+ settled: settled(answer)
26549
+ };
26550
+ }
26551
+ function memberReadFailure(err) {
26552
+ return isThrottlingError(err) || isTransientServerError(err) || isAmbiguousOutcomeError(err) ? "failed" : "refused";
26553
+ }
26554
+ async function settleDeclaredMember(first, read, matches, declared, delaysMs, unsettled) {
26555
+ const settled = (answer) => typeof answer === "object" && matches(answer.value);
26556
+ if (first === "refused" || settled(first)) return first;
26557
+ let newest = first;
26558
+ for (const delayMs of delaysMs) {
26559
+ await new Promise((resolve) => setTimeout(resolve, delayMs));
26560
+ let answer;
26561
+ try {
26562
+ answer = await read();
26563
+ } catch (err) {
26564
+ answer = memberReadFailure(err);
26565
+ }
26566
+ if (answer === "refused") break;
26567
+ if (answer !== "failed") newest = answer;
26568
+ if (settled(newest)) return newest;
26569
+ }
26570
+ if (newest !== "failed") unsettled();
26571
+ return newest === "absent" ? { value: declared } : newest;
26572
+ }
26573
+ function warnUnsettledMember(logger, logicalId, resourceType, memberKey) {
26574
+ logger.warn(safeMsg`${resourceType} ${logicalId}: the read right after the write never showed the declared ${memberKey}, so its drift baseline may not match the live resource; run ${proseQuoted(cdkdRemedy("cdkd state refresh-observed"))} on the stack to re-capture it`);
26575
+ }
26576
+ function declaredMemberDocument(value) {
26577
+ if (typeof value === "string") {
26578
+ if (value === "") return void 0;
26579
+ try {
26580
+ return JSON.parse(value);
26581
+ } catch {
26582
+ return value;
26583
+ }
26584
+ }
26585
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
26586
+ }
26587
+ const KMS_DEFAULT_KEY_POLICY_ID = "key-default-1";
26588
+ const EFS_FILE_SYSTEM_ARN = /^arn:[a-z-]+:elasticfilesystem:[a-z0-9-]+:\d{12}:file-system\/fs-[0-9a-f]+$/;
26589
+ function efsPolicyMatchesDeclared(answer, declared, fileSystemId) {
26590
+ return policyDocumentMatchesDeclared(withoutAddedResource(answer, declared, fileSystemId), declared);
26591
+ }
26592
+ function withoutAddedResource(answer, declared, fileSystemId) {
26593
+ const parse = (doc) => {
26594
+ if (typeof doc !== "string") return doc;
26595
+ try {
26596
+ return JSON.parse(doc);
26597
+ } catch {
26598
+ return doc;
26599
+ }
26600
+ };
26601
+ const read = parse(answer);
26602
+ const want = parse(declared);
26603
+ const statements = (doc) => {
26604
+ if (typeof doc !== "object" || doc === null || Array.isArray(doc)) return void 0;
26605
+ const s = doc["Statement"];
26606
+ return s === void 0 ? void 0 : Array.isArray(s) ? s : [s];
26607
+ };
26608
+ const readStatements = statements(read);
26609
+ const wantStatements = statements(want);
26610
+ if (readStatements === void 0 || wantStatements === void 0) return answer;
26611
+ return {
26612
+ ...read,
26613
+ Statement: readStatements.map((entry, index) => {
26614
+ const wanted = wantStatements[index];
26615
+ if (typeof entry !== "object" || entry === null || typeof wanted !== "object" || wanted === null || Object.prototype.hasOwnProperty.call(wanted, "Resource")) return entry;
26616
+ const resource = entry["Resource"];
26617
+ if (typeof resource !== "string" || !EFS_FILE_SYSTEM_ARN.test(resource) || fileSystemId !== void 0 && !resource.endsWith(`:file-system/${fileSystemId}`)) return entry;
26618
+ const { Resource: _added, ...rest } = entry;
26619
+ return rest;
26620
+ })
26621
+ };
26622
+ }
26623
+ function declaredPolicyDocument(properties) {
26624
+ if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return;
26625
+ const doc = properties["PolicyDocument"];
26626
+ if (typeof doc === "string") return doc === "" ? void 0 : doc;
26627
+ return typeof doc === "object" && doc !== null && !Array.isArray(doc) ? doc : void 0;
26628
+ }
26629
+ function policyDocumentMatchesDeclared(answer, declared) {
26630
+ return answer !== void 0 && policyContentKey(foldConditionValues(answer)) === policyContentKey(foldConditionValues(declared));
26631
+ }
26632
+ function foldConditionValues(document) {
26633
+ let doc = document;
26634
+ if (typeof doc === "string") try {
26635
+ doc = JSON.parse(doc);
26636
+ } catch {
26637
+ return document;
26638
+ }
26639
+ if (typeof doc !== "object" || doc === null || Array.isArray(doc)) return doc;
26640
+ const statement = doc["Statement"];
26641
+ if (statement === void 0) return doc;
26642
+ const statements = Array.isArray(statement) ? statement : [statement];
26643
+ return {
26644
+ ...doc,
26645
+ Statement: statements.map((entry) => {
26646
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return entry;
26647
+ const condition = entry["Condition"];
26648
+ if (typeof condition !== "object" || condition === null || Array.isArray(condition)) return entry;
26649
+ const folded = {};
26650
+ for (const [operator, block] of Object.entries(condition)) {
26651
+ if (typeof block !== "object" || block === null || Array.isArray(block)) {
26652
+ folded[operator] = block;
26653
+ continue;
26654
+ }
26655
+ const values = {};
26656
+ for (const [key, value] of Object.entries(block)) values[key] = Array.isArray(value) && value.length === 1 ? value[0] : value;
26657
+ folded[operator] = values;
26658
+ }
26659
+ return {
26660
+ ...entry,
26661
+ Condition: folded
26662
+ };
26663
+ })
26664
+ };
26665
+ }
26666
+ const SNS_DEFAULT_POLICY_ID = "__default_policy_ID";
26667
+ const LAMBDA_PERMISSION_STATEMENT_KEYS = [
26668
+ "Action",
26669
+ "Principal",
26670
+ "SourceArn",
26671
+ "SourceAccount",
26672
+ "PrincipalOrgID",
26673
+ "InvokedViaFunctionUrl"
26674
+ ];
26675
+ function lambdaPermissionMatchesDeclared(read, declared) {
26676
+ return LAMBDA_PERMISSION_STATEMENT_KEYS.every((key) => {
26677
+ if (key === "InvokedViaFunctionUrl") return read[key] === true === (coerceCfnBoolean(declared[key]) === true);
26678
+ const want = declared[key];
26679
+ const got = read[key];
26680
+ if (want === void 0 || want === null || want === "") return got === void 0;
26681
+ return key === "Principal" ? accountKey(got) === accountKey(want) : got === want;
26682
+ });
26683
+ }
26684
+
25900
26685
  // src/provisioning/iam-sibling-managed-policies.ts
25901
26686
  const ATTACHMENT_FIELD = {
25902
26687
  "AWS::IAM::Role": "Roles",
@@ -26735,7 +27520,7 @@ async function ccRoutedInstanceTakesNoSnapshot(input) {
26735
27520
  if (resourceType !== "AWS::RDS::DBInstance") return false;
26736
27521
  if (region === void 0 || region === "") return false;
26737
27522
  const mask = input.mask ?? ((text) => text);
26738
- const { describeDBInstanceInRegion, isLiveReadReplica } = await import("./read-replica-eSaw4q1p.js").then((n) => n.l);
27523
+ const { describeDBInstanceInRegion, isLiveReadReplica } = await import("./read-replica-Ct0oakPU.js").then((n) => n.l);
26739
27524
  let reason;
26740
27525
  try {
26741
27526
  const live = await describeDBInstanceInRegion(physicalId, region);
@@ -28286,12 +29071,12 @@ const gray = (s) => `${codes.gray}${s}${codes.reset}`;
28286
29071
  const bold = (s) => `${codes.bright}${s}${codes.reset}`;
28287
29072
 
28288
29073
  // src/deployment/delete-guard-scope.ts
28289
- const storage$1 = new AsyncLocalStorage();
29074
+ const storage$2 = new AsyncLocalStorage();
28290
29075
  function collectDeleteGuards(sink, fn) {
28291
- return storage$1.run(sink, fn);
29076
+ return storage$2.run(sink, fn);
28292
29077
  }
28293
29078
  function reportDeleteGuards(result, target) {
28294
- const sink = storage$1.getStore();
29079
+ const sink = storage$2.getStore();
28295
29080
  if (!sink) return;
28296
29081
  for (const guard of deleteIndeterminateGuards(result)) sink.push({
28297
29082
  guard: guard.guard,
@@ -28648,183 +29433,6 @@ function isReplacementNameRefusal(error, logicalId) {
28648
29433
  return false;
28649
29434
  }
28650
29435
 
28651
- // src/deployment/superseded-resources.ts
28652
- function supersededResourcesOf(state) {
28653
- const rows = state?.supersededResources;
28654
- if (!Array.isArray(rows)) return [];
28655
- return rows.filter(isSupersededResourceRecord);
28656
- }
28657
- function isSupersededResourceRecord(row) {
28658
- if (typeof row !== "object" || row === null) return false;
28659
- const entry = row;
28660
- const record = entry["state"];
28661
- if (typeof entry["logicalId"] !== "string") return false;
28662
- if (typeof record !== "object" || record === null) return false;
28663
- const { physicalId, resourceType, properties } = record;
28664
- return typeof physicalId === "string" && physicalId !== "" && typeof resourceType === "string" && resourceType !== "" && typeof properties === "object" && properties !== null && !Array.isArray(properties);
28665
- }
28666
- function isSupersededHeld(entry, resources) {
28667
- return supersededHolderOf(entry, resources) !== void 0;
28668
- }
28669
- function supersededHolderOf(entry, resources) {
28670
- const holders = Object.values(resources).filter((record) => typeof record === "object" && record !== null && record.physicalId === entry.state.physicalId);
28671
- return holders.find((record) => record.resourceType === entry.state.resourceType) ?? holders[0];
28672
- }
28673
- function isSupersededHeldBySameType(entry, resources) {
28674
- return Object.values(resources).some((record) => typeof record === "object" && record !== null && record.physicalId === entry.state.physicalId && record.resourceType === entry.state.resourceType);
28675
- }
28676
- function supersededHeldByOtherTypeWarning(entry, holderType) {
28677
- 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.`;
28678
- }
28679
- function addSuperseded(host, entry) {
28680
- 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];
28681
- }
28682
- function canRecordSuperseded(record, deleteContext) {
28683
- if (deleteNeedsThisRunsNoEchoValues(record, deleteContext.noEchoDeleteValues)) return false;
28684
- if (deleteContext.persistedRecord !== true && Array.isArray(record.noEchoLeaves) && record.noEchoLeaves.length > 0) return false;
28685
- if (deleteContext.inlinePolicyClaimed !== void 0) return false;
28686
- return !INLINE_POLICY_TYPES.has(record.resourceType);
28687
- }
28688
- function deleteNeedsThisRunsNoEchoValues(record, noEchoDeleteValues) {
28689
- if (noEchoDeleteValues !== void 0) return true;
28690
- return readsNoEchoDeleteValues(record.resourceType) && Array.isArray(record.noEchoLeaves) && record.noEchoLeaves.length > 0;
28691
- }
28692
- function isInlinePolicyType(resourceType) {
28693
- return INLINE_POLICY_TYPES.has(resourceType);
28694
- }
28695
- const INLINE_POLICY_TYPES = /* @__PURE__ */ new Set([
28696
- "AWS::IAM::Policy",
28697
- "AWS::IAM::RolePolicy",
28698
- "AWS::IAM::UserPolicy",
28699
- "AWS::IAM::GroupPolicy"
28700
- ]);
28701
- function removeSuperseded(host, entry) {
28702
- if (!Array.isArray(host.supersededResources)) return;
28703
- const remaining = host.supersededResources.filter((row) => row !== entry);
28704
- if (remaining.length === 0) delete host.supersededResources;
28705
- else host.supersededResources = remaining;
28706
- }
28707
- function supersededAfterRollback(base, pending, resources) {
28708
- const added = Array.isArray(pending.supersededResources) ? pending.supersededResources : [];
28709
- const all = [...ownNotPending(base, added).filter((entry) => !isSupersededResourceRecord(entry) || !isSupersededHeldBySameType(entry, resources)), ...added];
28710
- return all.length > 0 ? { supersededResources: all } : {};
28711
- }
28712
- function ownNotPending(base, added) {
28713
- return (Array.isArray(base.supersededResources) ? base.supersededResources : []).filter((entry) => !added.some((a) => a.state.physicalId === entry.state.physicalId && a.state.resourceType === entry.state.resourceType));
28714
- }
28715
- const SUPERSEDED_KEPT_REMEDY = "cdkd keeps it in state: the next `cdkd deploy` of this stack retries the delete, and `cdkd destroy` deletes it";
28716
- function withoutSuperseded(state) {
28717
- const { supersededResources: _dropped, ...rest } = state;
28718
- return rest;
28719
- }
28720
- async function deleteSupersededEntry(entry, input) {
28721
- const record = entry.state;
28722
- const owesSnapshot = entry.skipFinalSnapshot !== true && entry.finalSnapshotIdentifier !== void 0 && PRE_DELETE_SNAPSHOT_TYPES.has(record.resourceType);
28723
- if (owesSnapshot) {
28724
- if (input.preDeleteSnapshot === void 0) return {
28725
- kind: "failed",
28726
- error: new CdkdError(`The final snapshot of ${entry.logicalId}'s superseded ${record.resourceType} could not be taken here. The resource was NOT deleted.`, "FINAL_SNAPSHOT_FAILED")
28727
- };
28728
- if (input.stop()) return {
28729
- kind: "failed",
28730
- error: new CdkdError(`The run was interrupted before the final snapshot of ${entry.logicalId}'s superseded ${record.resourceType}. The resource was NOT deleted.`, "FINAL_SNAPSHOT_FAILED")
28731
- };
28732
- try {
28733
- await createPreDeleteFinalSnapshot(record.resourceType, record.physicalId, entry.logicalId, input.preDeleteSnapshot.clients, input.preDeleteSnapshot.logger, {
28734
- refuseUnsnapshottableState: true,
28735
- reuseStartedAtOrAfter: Number.isFinite(entry.supersededAt) ? entry.supersededAt : Date.now(),
28736
- stop: input.stop
28737
- });
28738
- } catch (error) {
28739
- return {
28740
- kind: "failed",
28741
- error
28742
- };
28743
- }
28744
- }
28745
- const { finalSnapshotIdentifier: _taken, ...snapshotTaken } = entry;
28746
- const failed = (error) => owesSnapshot ? {
28747
- kind: "failed",
28748
- error,
28749
- replacement: snapshotTaken
28750
- } : {
28751
- kind: "failed",
28752
- error
28753
- };
28754
- let result;
28755
- try {
28756
- const send = () => input.provider.delete(entry.logicalId, record.physicalId, record.resourceType, record.properties, {
28757
- expectedRegion: input.region,
28758
- ...entry.forceDataDelete === true && { forceDataDelete: true },
28759
- ...entry.finalSnapshotIdentifier !== void 0 && !PRE_DELETE_SNAPSHOT_TYPES.has(record.resourceType) && { finalSnapshotIdentifier: entry.finalSnapshotIdentifier },
28760
- deletionPolicy: replacementDeletePolicy(entry.updateReplacePolicy),
28761
- ...entry.skipFinalSnapshot === true && { skipFinalSnapshot: true },
28762
- ...input.removeProtection === true && { removeProtection: true },
28763
- ...input.stackDestroy === true && { stackDestroy: true },
28764
- recordedAttributes: record.attributes,
28765
- recordedCreateOnlyDrops: record.acceptedCreateOnlyDrops,
28766
- recordedNoEchoLeaves: record.noEchoLeaves,
28767
- recordedTypedPayloadLeaves: record.typedPayloadLeaves,
28768
- maskSecrets: input.maskSecrets
28769
- });
28770
- result = input.once === true ? await send() : await retryWhileInUse(send, input.stop);
28771
- } catch (error) {
28772
- return failed(error);
28773
- }
28774
- reportDeleteGuards(result, {
28775
- physicalId: record.physicalId,
28776
- resourceType: record.resourceType,
28777
- provisionedBy: record.provisionedBy
28778
- });
28779
- const reason = deleteSkipReason(result);
28780
- return reason === void 0 ? { kind: "deleted" } : {
28781
- kind: "notDeleted",
28782
- reason
28783
- };
28784
- }
28785
- const supersededInUseRetry = {
28786
- attempts: 6,
28787
- delayMs: 1e4
28788
- };
28789
- const IN_USE_ERROR_NAMES = /* @__PURE__ */ new Set([
28790
- "ResourceInUseException",
28791
- "ResourceInUse",
28792
- "DependencyViolation"
28793
- ]);
28794
- const IN_USE_CONFLICT = /\bare using it\b/;
28795
- function isInUseRefusal(error) {
28796
- for (let current = error, depth = 0; current !== void 0 && depth < 8; depth++) {
28797
- if (typeof current !== "object" || current === null) return false;
28798
- const { name, message } = current;
28799
- if (typeof name === "string" && IN_USE_ERROR_NAMES.has(name)) return true;
28800
- if (name === "ConflictException" && typeof message === "string" && IN_USE_CONFLICT.test(message)) return true;
28801
- current = current.cause;
28802
- }
28803
- return false;
28804
- }
28805
- function isInUseOrConflictRefusal(error) {
28806
- if (isInUseRefusal(error)) return true;
28807
- for (let current = error, depth = 0; current !== void 0 && depth < 8; depth++) {
28808
- if (typeof current !== "object" || current === null) return false;
28809
- if (current.name === "ConflictException") return true;
28810
- current = current.cause;
28811
- }
28812
- return false;
28813
- }
28814
- async function retryWhileInUse(send, stop) {
28815
- for (let attempt = 1;; attempt++) try {
28816
- return await send();
28817
- } catch (error) {
28818
- if (attempt >= supersededInUseRetry.attempts || stop() || !isInUseRefusal(error) || isMarkedNonRetryable(error)) throw error;
28819
- await new Promise((resolve) => setTimeout(resolve, supersededInUseRetry.delayMs));
28820
- if (stop()) throw error;
28821
- }
28822
- }
28823
- function holdsSupersededResources(record) {
28824
- const rows = record.supersededResources;
28825
- return rows !== void 0 && (!Array.isArray(rows) || rows.length > 0);
28826
- }
28827
-
28828
29436
  // src/deployment/rollback-executor/replay-scope.ts
28829
29437
  function withReplayDeletePrinting(scope, fn) {
28830
29438
  const deployBag = scope.ctx.logOnlyNeedlesFor?.(scope.op.logicalId);
@@ -29108,7 +29716,6 @@ async function liveSurvivorRead(ctx, oldType, physicalId) {
29108
29716
  clearTimeout(timer);
29109
29717
  }
29110
29718
  }
29111
- const SURVIVOR_IDENTITY_ATTRIBUTES = { "AWS::IAM::Role": "RoleId" };
29112
29719
  const INTERRUPT_POLL_MS = 250;
29113
29720
  async function probeReplacedSurvivor(s, oldType, timeoutMs = REPLACED_SURVIVOR_PROBE_TIMEOUT_MS) {
29114
29721
  if (s.isInterrupted?.() === true) return "interrupted";
@@ -29186,19 +29793,294 @@ function judgeHolder(s, oldType, existence, read, snapshot) {
29186
29793
  return read.identity === void 0 ? "unknown" : "exists";
29187
29794
  }
29188
29795
  async function identityVerdict(s, physicalId, oldType) {
29189
- const key = SURVIVOR_IDENTITY_ATTRIBUTES[oldType];
29190
- if (key === void 0) return "exists";
29191
- const recorded = s.op.previousState?.attributes?.[key];
29192
- if (typeof recorded !== "string" || recorded === "" || recorded.includes("***")) return "exists";
29796
+ const held = recordedIdentityValue(oldType, s.op.previousState?.attributes);
29797
+ if (held.kind === "no-attribute" || held.kind === "not-recorded") return "identity-unverified";
29798
+ const recorded = recordedIdentityId(oldType, { recordedAttributes: s.op.previousState?.attributes })?.value;
29799
+ if (recorded === void 0) return "identity-uncompared";
29193
29800
  try {
29194
29801
  const provider = s.ctx.providerRegistry.getProvider(oldType);
29195
- if (typeof provider.resourceIdentity !== "function") return "exists";
29802
+ if (typeof provider.resourceIdentity !== "function") return "identity-unverified";
29196
29803
  const live = await withReplayDeletePrinting(s, () => provider.resourceIdentity(physicalId, oldType, { expectedRegion: s.ctx.region }));
29197
29804
  if (live === RESOURCE_NOT_FOUND) return "gone";
29198
- return typeof live === "string" && live !== "" && live !== recorded ? "foreign" : "exists";
29805
+ if (typeof live !== "string" || live === "") return "identity-uncompared";
29806
+ return live === recorded ? "exists" : "foreign";
29199
29807
  } catch {
29200
- return "exists";
29808
+ return "identity-unread";
29809
+ }
29810
+ }
29811
+ function recordedIdentityValue(oldType, attributes) {
29812
+ if (!Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, oldType)) return { kind: "no-attribute" };
29813
+ const key = SURVIVOR_IDENTITY_ATTRIBUTES[oldType];
29814
+ const value = typeof attributes === "object" && attributes !== null && Object.hasOwn(attributes, key) ? attributes[key] : void 0;
29815
+ return value === void 0 || value === null || value === "" ? { kind: "not-recorded" } : {
29816
+ kind: "held",
29817
+ key
29818
+ };
29819
+ }
29820
+ function unverifiedIdentityCause(oldType, attributes, shownType) {
29821
+ const held = recordedIdentityValue(oldType, attributes);
29822
+ if (held.kind === "no-attribute") return `cdkd records no AWS-assigned id for ${shownType} to compare`;
29823
+ const key = SURVIVOR_IDENTITY_ATTRIBUTES[oldType];
29824
+ return held.kind === "not-recorded" ? `its state record holds no ${key}: it was written before cdkd recorded one` : `cdkd has no read of the ${key} for ${shownType}`;
29825
+ }
29826
+
29827
+ // src/deployment/journaled-holder.ts
29828
+ const journaledHolderRead = {
29829
+ attempts: 3,
29830
+ delayMs: 2e3
29831
+ };
29832
+ function isUnreadHolder(judged) {
29833
+ return judged === "unreadable" || judged === "interrupted";
29834
+ }
29835
+ async function judgeJournaledHolder(input) {
29836
+ if (input.journaled.split("|")[0] !== canonicalizeRegion(input.region)) return { incomparable: "the recorded generation names another region than the stack's" };
29837
+ try {
29838
+ if (typeof input.provider().replacedSurvivorIdentity !== "function") return { incomparable: "cdkd reads no holder for this resource type" };
29839
+ } catch {
29840
+ return { incomparable: "cdkd reads no holder for this resource type" };
29841
+ }
29842
+ let judged = "unreadable";
29843
+ for (let attempt = 0; attempt < journaledHolderRead.attempts; attempt++) {
29844
+ if (attempt > 0) {
29845
+ if (input.interrupted()) return "interrupted";
29846
+ await new Promise((resolve) => setTimeout(resolve, journaledHolderRead.delayMs));
29847
+ }
29848
+ judged = judge(await readHolder(input), input.journaled, input.resourceType);
29849
+ if (judged !== "unreadable") break;
29850
+ }
29851
+ return judged;
29852
+ }
29853
+ function unreadHolderCause(judged) {
29854
+ return judged === "interrupted" ? "the run was interrupted before cdkd could read what holds that name now to confirm it is the resource the deploy replaced" : "cdkd could not read what holds that name now to confirm it is the resource the deploy replaced";
29855
+ }
29856
+ function incomparableHolderNote(reason) {
29857
+ return `cdkd cannot compare what holds that name now with the generation it recorded (${reason}), so the delete is sent by name, as for an entry recorded without one`;
29858
+ }
29859
+ function notOursHolderCause(resourceType, attribute) {
29860
+ return `the ${resourceType} now under that name is not the one the deploy replaced (its ${attribute} differs from what cdkd read when it deferred the delete), so no delete was sent and that resource was left alone`;
29861
+ }
29862
+ async function readHolder(input) {
29863
+ let timer;
29864
+ try {
29865
+ const provider = input.provider();
29866
+ if (typeof provider.replacedSurvivorIdentity !== "function") return { kind: "unknown" };
29867
+ return await Promise.race([provider.replacedSurvivorIdentity(input.physicalId, input.resourceType, { expectedRegion: input.region }), new Promise((resolve) => {
29868
+ timer = setTimeout(() => resolve({ kind: "unknown" }), DEFERRAL_IDENTITY_TIMEOUT_MS);
29869
+ })]);
29870
+ } catch {
29871
+ return { kind: "unknown" };
29872
+ } finally {
29873
+ clearTimeout(timer);
29874
+ }
29875
+ }
29876
+ function judge(read, journaled, resourceType) {
29877
+ switch (read.kind) {
29878
+ case "gone": return "gone";
29879
+ case "foreign": return { notOurs: read.seen === "other-account" ? "owning account" : "region" };
29880
+ case "unknown": return "unreadable";
29881
+ case "owned":
29882
+ if (read.identity === void 0) return "unreadable";
29883
+ if (read.identity === journaled) return "ours";
29884
+ return journaled.split("|")[0] === SURVIVOR_LIVE_READ_TYPES[resourceType] ? { notOurs: "creation time" } : "ours";
29885
+ }
29886
+ }
29887
+
29888
+ // src/deployment/superseded-resources.ts
29889
+ function supersededResourcesOf(state) {
29890
+ const rows = state?.supersededResources;
29891
+ if (!Array.isArray(rows)) return [];
29892
+ return rows.filter(isSupersededResourceRecord);
29893
+ }
29894
+ function isSupersededResourceRecord(row) {
29895
+ if (typeof row !== "object" || row === null) return false;
29896
+ const entry = row;
29897
+ const record = entry["state"];
29898
+ if (typeof entry["logicalId"] !== "string") return false;
29899
+ if (typeof record !== "object" || record === null) return false;
29900
+ const { physicalId, resourceType, properties } = record;
29901
+ return typeof physicalId === "string" && physicalId !== "" && typeof resourceType === "string" && resourceType !== "" && typeof properties === "object" && properties !== null && !Array.isArray(properties);
29902
+ }
29903
+ function isSupersededHeld(entry, resources) {
29904
+ return supersededHolderOf(entry, resources) !== void 0;
29905
+ }
29906
+ function supersededHolderOf(entry, resources) {
29907
+ const holders = Object.values(resources).filter((record) => typeof record === "object" && record !== null && record.physicalId === entry.state.physicalId);
29908
+ return holders.find((record) => record.resourceType === entry.state.resourceType) ?? holders[0];
29909
+ }
29910
+ function isSupersededHeldBySameType(entry, resources) {
29911
+ return Object.values(resources).some((record) => typeof record === "object" && record !== null && record.physicalId === entry.state.physicalId && record.resourceType === entry.state.resourceType);
29912
+ }
29913
+ function supersededHeldByOtherTypeWarning(entry, holderType) {
29914
+ 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.`;
29915
+ }
29916
+ function addSuperseded(host, entry) {
29917
+ 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];
29918
+ }
29919
+ function canRecordSuperseded(record, deleteContext) {
29920
+ if (deleteNeedsThisRunsNoEchoValues(record, deleteContext.noEchoDeleteValues)) return false;
29921
+ if (deleteContext.persistedRecord !== true && Array.isArray(record.noEchoLeaves) && record.noEchoLeaves.length > 0) return false;
29922
+ if (deleteContext.inlinePolicyClaimed !== void 0) return false;
29923
+ return !INLINE_POLICY_TYPES.has(record.resourceType);
29924
+ }
29925
+ function deleteNeedsThisRunsNoEchoValues(record, noEchoDeleteValues) {
29926
+ if (noEchoDeleteValues !== void 0) return true;
29927
+ return readsNoEchoDeleteValues(record.resourceType) && Array.isArray(record.noEchoLeaves) && record.noEchoLeaves.length > 0;
29928
+ }
29929
+ function isInlinePolicyType(resourceType) {
29930
+ return INLINE_POLICY_TYPES.has(resourceType);
29931
+ }
29932
+ const INLINE_POLICY_TYPES = /* @__PURE__ */ new Set([
29933
+ "AWS::IAM::Policy",
29934
+ "AWS::IAM::RolePolicy",
29935
+ "AWS::IAM::UserPolicy",
29936
+ "AWS::IAM::GroupPolicy"
29937
+ ]);
29938
+ function removeSuperseded(host, entry) {
29939
+ if (!Array.isArray(host.supersededResources)) return;
29940
+ const remaining = host.supersededResources.filter((row) => row !== entry);
29941
+ if (remaining.length === 0) delete host.supersededResources;
29942
+ else host.supersededResources = remaining;
29943
+ }
29944
+ function supersededAfterRollback(base, pending, resources) {
29945
+ const added = Array.isArray(pending.supersededResources) ? pending.supersededResources : [];
29946
+ const all = [...ownNotPending(base, added).filter((entry) => !isSupersededResourceRecord(entry) || !isSupersededHeldBySameType(entry, resources)), ...added];
29947
+ return all.length > 0 ? { supersededResources: all } : {};
29948
+ }
29949
+ function ownNotPending(base, added) {
29950
+ return (Array.isArray(base.supersededResources) ? base.supersededResources : []).filter((entry) => !added.some((a) => a.state.physicalId === entry.state.physicalId && a.state.resourceType === entry.state.resourceType));
29951
+ }
29952
+ const SUPERSEDED_KEPT_REMEDY = "cdkd keeps it in state: the next `cdkd deploy` of this stack retries the delete, and `cdkd destroy` deletes it";
29953
+ function withoutSuperseded(state) {
29954
+ const { supersededResources: _dropped, ...rest } = state;
29955
+ return rest;
29956
+ }
29957
+ async function deleteSupersededEntry(entry, input) {
29958
+ const record = entry.state;
29959
+ if (Object.prototype.hasOwnProperty.call(entry, "identity")) {
29960
+ const journaled = entry.identity;
29961
+ const judged = typeof journaled !== "string" || journaled === "" ? { incomparable: "the recorded generation is malformed" } : input.holderProvider === void 0 ? { incomparable: "cdkd reads no holder for this resource type" } : await judgeJournaledHolder({
29962
+ provider: input.holderProvider,
29963
+ resourceType: record.resourceType,
29964
+ physicalId: record.physicalId,
29965
+ region: input.region,
29966
+ journaled,
29967
+ interrupted: input.stop
29968
+ });
29969
+ if (judged === "gone") return { kind: "gone" };
29970
+ if (isUnreadHolder(judged)) return {
29971
+ kind: "failed",
29972
+ error: new CdkdError(`No delete was sent: ${unreadHolderCause(judged)}`, "SUPERSEDED_HOLDER_UNREAD")
29973
+ };
29974
+ if (typeof judged === "object" && "incomparable" in judged) input.warn?.(incomparableHolderNote(judged.incomparable));
29975
+ else if (judged !== "ours") return {
29976
+ kind: "notOurs",
29977
+ cause: notOursHolderCause(record.resourceType, judged.notOurs)
29978
+ };
29979
+ }
29980
+ const owesSnapshot = entry.skipFinalSnapshot !== true && entry.finalSnapshotIdentifier !== void 0 && PRE_DELETE_SNAPSHOT_TYPES.has(record.resourceType);
29981
+ if (owesSnapshot) {
29982
+ if (input.preDeleteSnapshot === void 0) return {
29983
+ kind: "failed",
29984
+ error: new CdkdError(`The final snapshot of ${entry.logicalId}'s superseded ${record.resourceType} could not be taken here. The resource was NOT deleted.`, "FINAL_SNAPSHOT_FAILED")
29985
+ };
29986
+ if (input.stop()) return {
29987
+ kind: "failed",
29988
+ error: new CdkdError(`The run was interrupted before the final snapshot of ${entry.logicalId}'s superseded ${record.resourceType}. The resource was NOT deleted.`, "FINAL_SNAPSHOT_FAILED")
29989
+ };
29990
+ try {
29991
+ await createPreDeleteFinalSnapshot(record.resourceType, record.physicalId, entry.logicalId, input.preDeleteSnapshot.clients, input.preDeleteSnapshot.logger, {
29992
+ refuseUnsnapshottableState: true,
29993
+ reuseStartedAtOrAfter: Number.isFinite(entry.supersededAt) ? entry.supersededAt : Date.now(),
29994
+ stop: input.stop
29995
+ });
29996
+ } catch (error) {
29997
+ return {
29998
+ kind: "failed",
29999
+ error
30000
+ };
30001
+ }
30002
+ }
30003
+ const { finalSnapshotIdentifier: _taken, ...snapshotTaken } = entry;
30004
+ const failed = (error) => owesSnapshot ? {
30005
+ kind: "failed",
30006
+ error,
30007
+ replacement: snapshotTaken
30008
+ } : {
30009
+ kind: "failed",
30010
+ error
30011
+ };
30012
+ let result;
30013
+ try {
30014
+ const send = () => input.provider.delete(entry.logicalId, record.physicalId, record.resourceType, record.properties, {
30015
+ expectedRegion: input.region,
30016
+ ...entry.forceDataDelete === true && { forceDataDelete: true },
30017
+ ...entry.finalSnapshotIdentifier !== void 0 && !PRE_DELETE_SNAPSHOT_TYPES.has(record.resourceType) && { finalSnapshotIdentifier: entry.finalSnapshotIdentifier },
30018
+ deletionPolicy: replacementDeletePolicy(entry.updateReplacePolicy),
30019
+ ...entry.skipFinalSnapshot === true && { skipFinalSnapshot: true },
30020
+ ...input.removeProtection === true && { removeProtection: true },
30021
+ ...input.stackDestroy === true && { stackDestroy: true },
30022
+ recordedAttributes: record.attributes,
30023
+ recordedCreateOnlyDrops: record.acceptedCreateOnlyDrops,
30024
+ recordedNoEchoLeaves: record.noEchoLeaves,
30025
+ recordedTypedPayloadLeaves: record.typedPayloadLeaves,
30026
+ maskSecrets: input.maskSecrets
30027
+ });
30028
+ result = input.once === true ? await send() : await retryWhileInUse(send, input.stop);
30029
+ } catch (error) {
30030
+ return failed(error);
29201
30031
  }
30032
+ reportDeleteGuards(result, {
30033
+ physicalId: record.physicalId,
30034
+ resourceType: record.resourceType,
30035
+ provisionedBy: record.provisionedBy
30036
+ });
30037
+ const reason = deleteSkipReason(result);
30038
+ return reason === void 0 ? { kind: "deleted" } : {
30039
+ kind: "notDeleted",
30040
+ reason
30041
+ };
30042
+ }
30043
+ const supersededInUseRetry = {
30044
+ attempts: 6,
30045
+ delayMs: 1e4
30046
+ };
30047
+ const IN_USE_ERROR_NAMES = /* @__PURE__ */ new Set([
30048
+ "ResourceInUseException",
30049
+ "ResourceInUse",
30050
+ "DependencyViolation"
30051
+ ]);
30052
+ const IN_USE_CONFLICT = /\bare using it\b/;
30053
+ function isInUseRefusal(error) {
30054
+ for (let current = error, depth = 0; current !== void 0 && depth < 8; depth++) {
30055
+ if (typeof current !== "object" || current === null) return false;
30056
+ const { name, message } = current;
30057
+ if (typeof name === "string" && IN_USE_ERROR_NAMES.has(name)) return true;
30058
+ if (name === "ConflictException" && typeof message === "string" && IN_USE_CONFLICT.test(message)) return true;
30059
+ current = current.cause;
30060
+ }
30061
+ return false;
30062
+ }
30063
+ function isInUseOrConflictRefusal(error) {
30064
+ if (isInUseRefusal(error)) return true;
30065
+ for (let current = error, depth = 0; current !== void 0 && depth < 8; depth++) {
30066
+ if (typeof current !== "object" || current === null) return false;
30067
+ if (current.name === "ConflictException") return true;
30068
+ current = current.cause;
30069
+ }
30070
+ return false;
30071
+ }
30072
+ async function retryWhileInUse(send, stop) {
30073
+ for (let attempt = 1;; attempt++) try {
30074
+ return await send();
30075
+ } catch (error) {
30076
+ if (attempt >= supersededInUseRetry.attempts || stop() || !isInUseRefusal(error) || isMarkedNonRetryable(error)) throw error;
30077
+ await new Promise((resolve) => setTimeout(resolve, supersededInUseRetry.delayMs));
30078
+ if (stop()) throw error;
30079
+ }
30080
+ }
30081
+ function holdsSupersededResources(record) {
30082
+ const rows = record.supersededResources;
30083
+ return rows !== void 0 && (!Array.isArray(rows) || rows.length > 0);
29202
30084
  }
29203
30085
 
29204
30086
  // src/deployment/deploy-engine/replacement/delete-replaced.ts
@@ -29211,6 +30093,15 @@ async function deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType,
29211
30093
  const identity = await readDeferralIdentity(deps.providerRegistry(), oldResourceType, currentResource.physicalId, deps.stackRegion);
29212
30094
  if (identity !== void 0) run.replacedOldIdentity.set(logicalId, identity);
29213
30095
  else run.replacedOldIdentity.delete(logicalId);
30096
+ const recorded = run.supersededEntries.get(logicalId);
30097
+ if (identity !== void 0 && recorded !== void 0 && run.supersededHost !== void 0) {
30098
+ const withIdentity = {
30099
+ ...recorded,
30100
+ identity
30101
+ };
30102
+ addSuperseded(run.supersededHost, withIdentity);
30103
+ run.supersededEntries.set(logicalId, withIdentity);
30104
+ }
29214
30105
  run.deferredReplacedDeletes?.set(logicalId, {
29215
30106
  physicalId: currentResource.physicalId,
29216
30107
  resourceType: oldResourceType,
@@ -29224,6 +30115,7 @@ async function deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType,
29224
30115
  return;
29225
30116
  }
29226
30117
  if (!isRetry) deps.logger.info(safeMsg` Deleting old ${logicalId} (${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)})...`);
30118
+ else if (!await journaledHolderIsOurs(run, deps, logicalId, oldResourceType, currentResource)) return;
29227
30119
  let sentSnapshotIdentifier = finalSnapshotIdentifier;
29228
30120
  if (owesPreDeleteSnapshot(oldResourceType, finalSnapshotIdentifier)) {
29229
30121
  if (!await takeOwedSnapshot(run, deps, logicalId, currentResource, secrets, isRetry)) return;
@@ -29293,6 +30185,45 @@ async function deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType,
29293
30185
  deps.logger.info(isRetry ? safeMsg` ${green("✓")} Old ${logicalId} (${currentResource.physicalId}) deleted` : safeMsg` ${green("✓")} Old resource deleted`);
29294
30186
  }
29295
30187
  }
30188
+ async function journaledHolderIsOurs(run, deps, logicalId, oldResourceType, oldResource) {
30189
+ const journaled = run.replacedOldIdentity.get(logicalId);
30190
+ if (journaled === void 0) return true;
30191
+ const judged = await judgeJournaledHolder({
30192
+ provider: () => deps.providerRegistry().getProvider(oldResourceType),
30193
+ resourceType: oldResourceType,
30194
+ physicalId: oldResource.physicalId,
30195
+ region: deps.stackRegion,
30196
+ journaled,
30197
+ interrupted: () => deps.interrupted()
30198
+ });
30199
+ if (judged === "ours") return true;
30200
+ const shown = displayPhysicalId(oldResource.resourceType, oldResource.physicalId);
30201
+ if (typeof judged === "object" && "incomparable" in judged) {
30202
+ deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${shown}): ${incomparableHolderNote(judged.incomparable)}`);
30203
+ return true;
30204
+ }
30205
+ const recorded = run.supersededEntries.get(logicalId);
30206
+ if (isUnreadHolder(judged)) {
30207
+ const why = unreadHolderCause(judged);
30208
+ if (recorded === void 0) {
30209
+ run.replacedOldMaySurvive.set(logicalId, "unconfirmed");
30210
+ run.replacedDeleteSkips.set(logicalId, `the replaced ${oldResourceType} (${oldResource.physicalId}) was not deleted (${why}) and is no longer tracked by cdkd`);
30211
+ }
30212
+ 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."));
30213
+ return false;
30214
+ }
30215
+ if (recorded !== void 0 && run.supersededHost !== void 0) {
30216
+ removeSuperseded(run.supersededHost, recorded);
30217
+ run.supersededEntries.delete(logicalId);
30218
+ }
30219
+ run.replacedOldMaySurvive.delete(logicalId);
30220
+ if (judged === "gone") {
30221
+ deps.logger.info(safeMsg` ${green("✓")} Old ${logicalId} (${shown}) is already gone; no delete was sent`);
30222
+ return false;
30223
+ }
30224
+ deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${shown}) was not deleted: ${notOursHolderCause(oldResourceType, judged.notOurs)}. The replaced resource is gone, and cdkd no longer tracks it in state.`);
30225
+ return false;
30226
+ }
29296
30227
  async function takeOwedSnapshot(run, deps, logicalId, oldResource, secrets, isRetry) {
29297
30228
  const recorded = isRetry ? run.supersededEntries.get(logicalId) : void 0;
29298
30229
  const tracking = () => recorded !== void 0 ? "kept" : oldIdHeldByAnotherRecord(deps, logicalId, oldResource) ? "held" : "untracked";
@@ -32464,7 +33395,7 @@ function maskRestoredNoEchoRecord(record, baseline, substituted = []) {
32464
33395
  const marked = noEchoLeavesOf(baseline) ?? [];
32465
33396
  const names = declaredNoEchoAttributeNames(baseline);
32466
33397
  if (marked.length === 0 && names.length === 0 && substituted.length === 0) return record;
32467
- const echoes = (name, value) => value !== record.physicalId && substituted.some((leaf) => leaf.coordinate[0] === name && canonicalJson$6(leaf.value) === canonicalJson$6(value));
33398
+ const echoes = (name, value) => value !== record.physicalId && substituted.some((leaf) => leaf.coordinate[0] === name && canonicalJson$7(leaf.value) === canonicalJson$7(value));
32468
33399
  let attributes = record.attributes;
32469
33400
  if (attributes !== void 0 && attributes !== null && typeof attributes === "object") for (const [name, value] of Object.entries(attributes)) {
32470
33401
  if (!names.includes(name) && !echoes(name, value)) continue;
@@ -32475,7 +33406,7 @@ function maskRestoredNoEchoRecord(record, baseline, substituted = []) {
32475
33406
  const list = coordinate.findIndex((segment) => typeof segment === "number");
32476
33407
  if (list < 0) return false;
32477
33408
  const path = coordinate.slice(0, list);
32478
- return canonicalJson$6(valueAtCoordinate(byIndex, path)) !== canonicalJson$6(valueAtCoordinate(baseline.properties, path));
33409
+ return canonicalJson$7(valueAtCoordinate(byIndex, path)) !== canonicalJson$7(valueAtCoordinate(baseline.properties, path));
32479
33410
  });
32480
33411
  const properties = reshaped.length === 0 ? byIndex : maskReadbackAtCoordinates(byIndex, baseline.properties, reshaped);
32481
33412
  const widened = reshaped.map((coordinate) => readbackPathFor(byIndex, baseline.properties, coordinate)).filter((path, i) => path !== void 0 && path.length < reshaped[i].length);
@@ -33111,15 +34042,15 @@ async function createWithRollbackRetry(provider, create, logicalId, logger, isIn
33111
34042
  isRetryable: outer.isRetryable
33112
34043
  });
33113
34044
  }
33114
- function recordAfterRollbackUpdate(restored, result) {
33115
- return withoutNoEchoValueMacs(withoutUnsettledProperties(recordAfterRollbackUpdateUnsettled(restored, result)));
34045
+ function recordAfterRollbackUpdate(restored, result, onDiffering) {
34046
+ return withoutNoEchoValueMacs(withoutUnsettledProperties(recordAfterRollbackUpdateUnsettled(restored, result, onDiffering)));
33116
34047
  }
33117
34048
  function withoutNoEchoValueMacs(record) {
33118
34049
  if (record.noEchoValueMacs === void 0) return record;
33119
34050
  const { noEchoValueMacs: _dropped, ...rest } = record;
33120
34051
  return rest;
33121
34052
  }
33122
- function recordAfterRollbackUpdateUnsettled(restored, result) {
34053
+ function recordAfterRollbackUpdateUnsettled(restored, result, onDiffering) {
33123
34054
  if (result === void 0) return restored;
33124
34055
  const returned = result.attributes;
33125
34056
  const replacedId = result.wasReplaced && typeof result.physicalId === "string" && result.physicalId !== "" ? result.physicalId : void 0;
@@ -33130,10 +34061,10 @@ function recordAfterRollbackUpdateUnsettled(restored, result) {
33130
34061
  ...returned === void 0 && idChanged ? withoutAttributes : restored,
33131
34062
  ...replacedId !== void 0 && { physicalId: replacedId },
33132
34063
  ...result.effectiveProperties && { properties: copyClaimingProviderBag(result.effectiveProperties) },
33133
- ...returned !== void 0 && { attributes: result.wasReplaced ? { ...returned } : {
34064
+ ...returned !== void 0 && { attributes: result.wasReplaced ? { ...returned } : keepRecordedIdentity(restored.resourceType, restored.attributes, {
33134
34065
  ...restored.attributes,
33135
34066
  ...returned
33136
- } }
34067
+ }, onDiffering) }
33137
34068
  };
33138
34069
  }
33139
34070
  function recordedPropertiesAfterReplayCreate(restored, result) {
@@ -33166,6 +34097,7 @@ function buildReadCurrentStateContext(state, excludedLogicalId) {
33166
34097
  const ownObserved = ownRecord("observedProperties");
33167
34098
  return {
33168
34099
  siblings,
34100
+ ...isReadableResourceEntry(own) && own.provisionedBy === "cc-api" && { ccApiRead: true },
33169
34101
  ...ownAttributes && { attributes: ownAttributes },
33170
34102
  ...ownObserved && { driftBaseline: ownObserved }
33171
34103
  };
@@ -33369,7 +34301,8 @@ async function replayRevert(s) {
33369
34301
  ...previousState,
33370
34302
  physicalId: current.physicalId
33371
34303
  } : previousState;
33372
- stateResources[op.logicalId] = maskRestoredNoEchoRecord(redactRollbackRecord(await withRefreshedObservedBaseline(recordAfterRollbackUpdate(restoreBase, revertResult), {
34304
+ const revertedRecord = recordAfterRollbackUpdate(restoreBase, revertResult, identityWarner(logger, mask, op));
34305
+ stateResources[op.logicalId] = maskRestoredNoEchoRecord(redactRollbackRecord(await withRefreshedObservedBaseline(revertedRecord, {
33373
34306
  provider,
33374
34307
  op,
33375
34308
  desiredProps,
@@ -33473,7 +34406,7 @@ async function recreateOldResource(s, r) {
33473
34406
  ...newCopyClaimed && { inlinePolicyClaimed: newCopyClaimed },
33474
34407
  ...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
33475
34408
  deletionPolicy: replacementDeletePolicy(current.updateReplacePolicy),
33476
- recordedAttributes: current.attributes,
34409
+ recordedAttributes: newCopyDeleteAttributes(op.resourceType, current.attributes, op.oldDeletedBeforeCreate, op.previousState?.attributes),
33477
34410
  recordedCreateOnlyDrops: current.acceptedCreateOnlyDrops,
33478
34411
  recordedNoEchoLeaves: current.noEchoLeaves,
33479
34412
  recordedTypedPayloadLeaves: current.typedPayloadLeaves,
@@ -33632,7 +34565,7 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
33632
34565
  ...newCopyClaimed && { inlinePolicyClaimed: newCopyClaimed },
33633
34566
  ...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
33634
34567
  deletionPolicy: replacementDeletePolicy(current.updateReplacePolicy),
33635
- recordedAttributes: current.attributes,
34568
+ recordedAttributes: newCopyDeleteAttributes(op.resourceType, current.attributes, op.oldDeletedBeforeCreate, op.previousState?.attributes),
33636
34569
  recordedCreateOnlyDrops: current.acceptedCreateOnlyDrops,
33637
34570
  recordedNoEchoLeaves: current.noEchoLeaves,
33638
34571
  recordedTypedPayloadLeaves: current.typedPayloadLeaves,
@@ -33757,16 +34690,26 @@ async function replayReverseReplacement(s) {
33757
34690
  result.warnings++;
33758
34691
  survivor = "exists";
33759
34692
  }
34693
+ let identityUnverified = false;
34694
+ if (survivor === "identity-unverified") {
34695
+ identityUnverified = true;
34696
+ survivor = "exists";
34697
+ }
33760
34698
  if (survivor === "exists" && op.oldResourceMaySurvive === "unconfirmed") throw survivorUnprovenRefusal(s, oldType, "maybe-deleting");
33761
34699
  if (op.oldResourceMaySurvive === "deferred" && survivor !== "gone" && survivor !== "interrupted" && (survivor === "exists" || deferredDeleteStillPending(ctx.supersededResources, prev, oldType))) {
33762
34700
  logger.info(safeMsg` Rollback: the old resource of ${safe(op.logicalId)} (${mask(String(prev.physicalId))}) was not deleted yet — re-adopting it`);
33763
- return replayReadopt(s, {});
34701
+ await replayReadopt(s, {});
34702
+ if (identityUnverified) warnUnverifiedSurvivor(s, oldType);
34703
+ if (survivor === "identity-uncompared" || survivor === "identity-unread") warnUnverifiedSurvivor(s, oldType, survivor);
34704
+ return;
33764
34705
  }
33765
34706
  if (survivor === "exists") {
33766
34707
  const oldShown = refusalPhysicalId(mask(String(prev.physicalId)));
33767
34708
  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)}`);
33768
34709
  result.warnings++;
33769
- return 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")}` });
34710
+ 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")}` });
34711
+ if (identityUnverified) warnUnverifiedSurvivor(s, oldType);
34712
+ return;
33770
34713
  }
33771
34714
  if (survivor !== "gone") throw survivorUnprovenRefusal(s, oldType, survivor);
33772
34715
  logger.info(safeMsg` Rollback: the old resource of ${safe(op.logicalId)} (${mask(String(prev.physicalId))}) is gone — re-creating it`);
@@ -33856,14 +34799,24 @@ async function replayReverseReplacement(s) {
33856
34799
  const { createResult, deletedNewFirst } = await recreateOldResource(s, scope);
33857
34800
  await finishReverseReplacement(s, scope, createResult, deletedNewFirst);
33858
34801
  }
34802
+ function warnUnverifiedSurvivor(s, oldType, uncompared) {
34803
+ const { op, logger, mask } = s;
34804
+ const cause = uncompared === void 0 ? unverifiedIdentityCause(oldType, op.previousState?.attributes, refusalResourceType(oldType)) : uncomparedIdentityCause(oldType, uncompared);
34805
+ logger.warn(mask(safeMsg` ⚠ Rollback: cdkd could not prove that the resource AWS reports under the old id of ` + safeMsg`${shownLogicalId(op.logicalId)} is the one cdkd created ` + safeMsg`(${cause}), so it was re-adopted because AWS reports it` + (uncompared === void 0 ? "" : ` and state still lists it as awaiting its delete`) + `. If it is not this stack's, leave it alone and drop ` + safeMsg`its record after the rollback with ${stateOrphanRecordRemedy(void 0, String(op.logicalId))}.`));
34806
+ }
34807
+ function uncomparedIdentityCause(oldType, verdict) {
34808
+ const key = SURVIVOR_IDENTITY_ATTRIBUTES[oldType] ?? "identity";
34809
+ return verdict === "identity-unread" ? `the read of its ${key} failed, so cdkd could not compare it with the recorded one` : `cdkd could not compare it with the recorded ${key}: the recorded value is redacted, or the read could not name the resource`;
34810
+ }
33859
34811
  function survivorUnprovenRefusal(s, oldType, verdict) {
33860
34812
  const { op, ctx, mask } = s;
33861
34813
  const remedy = orphanRemedy(op.logicalId, ctx);
33862
34814
  const oldId = op.previousState?.physicalId;
33863
34815
  const oldShown = hasAddressablePhysicalId({ physicalId: oldId }) ? refusalPhysicalId(mask(String(oldId))) : "no recorded id";
33864
34816
  const rerun = rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback"));
33865
- const why = verdict === "free-unreadable" ? `nothing held that name when this rollback started, and its current state could not be read; re-running ${rerun} reads it again` : verdict === "vacated" ? `the name went free while this rollback read it (AWS reported it, then a second read found no bucket under it), so re-adopting it would delete the new resource for nothing; re-running ${rerun} reads it again` : verdict === "owner-unverified" ? `cdkd could not read whether it does, nor whether it belongs to this account (this account's bucket list could not be read; it needs s3:ListAllMyBuckets). Re-adopting another owner's bucket would delete the new one; re-running ${rerun} reads both again` : verdict === "unreadable" ? "cdkd has no read for this resource type that can tell whether it does. Re-creating it could duplicate it or collide with it" : verdict === "interrupted" ? `the rollback was interrupted before cdkd could read whether it does; re-running ${rerun} reads it` : verdict === "unknown" ? `cdkd could not read whether it does (the read failed or did not answer in time); re-running ${rerun} reads it again. Re-creating it could duplicate it or collide with it` : `AWS still reports it, but its failed delete may have been accepted and still be running, or only partly ran. Re-adopting it could leave neither resource once a running delete finishes, or one that delete already stripped; once AWS reports it gone, re-running ${rerun} re-creates it. A refused delete is not running, so waiting does not help: if its delete was refused, delete it by hand, then re-run ${rerun}`;
33866
- return ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(oldType)}): ` + (verdict === "vacated" || verdict === "free-unreadable" ? `the old resource (${oldShown}) cannot be proven the stack's: ${why}.` : `the deploy did not confirm that it deleted the old resource (${oldShown}), so it may still exist, and ${why}.`) + ` Nothing was sent and the journal is kept.` + (remedy.offered ? ` To keep the new resource in its place instead, re-run with the command below, ` + (verdict === "vacated" || verdict === "free-unreadable" ? `and leave anything under the old id alone unless it is this stack's.` : `then delete the old resource by hand if it still exists.`) : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown)}` + remedy.line, "REPLACED_SURVIVOR_UNPROVEN")));
34817
+ const identity = verdict === "identity-uncompared" || verdict === "identity-unread";
34818
+ const why = verdict === "identity-uncompared" ? `AWS reports a resource under that id, but ${uncomparedIdentityCause(oldType, verdict)}, so cdkd cannot tell whether it is the one this stack created; a re-run meets the same answer. Re-adopting another owner's resource would delete the new one` : verdict === "identity-unread" ? `AWS reports a resource under that id, but ${uncomparedIdentityCause(oldType, verdict)}; re-running ${rerun} reads it again. Re-adopting another owner's resource would delete the new one` : verdict === "free-unreadable" ? `nothing held that name when this rollback started, and its current state could not be read; re-running ${rerun} reads it again` : verdict === "vacated" ? `the name went free while this rollback read it (AWS reported it, then a second read found no bucket under it), so re-adopting it would delete the new resource for nothing; re-running ${rerun} reads it again` : verdict === "owner-unverified" ? `cdkd could not read whether it does, nor whether it belongs to this account (this account's bucket list could not be read; it needs s3:ListAllMyBuckets). Re-adopting another owner's bucket would delete the new one; re-running ${rerun} reads both again` : verdict === "unreadable" ? "cdkd has no read for this resource type that can tell whether it does. Re-creating it could duplicate it or collide with it" : verdict === "interrupted" ? `the rollback was interrupted before cdkd could read whether it does; re-running ${rerun} reads it` : verdict === "unknown" ? `cdkd could not read whether it does (the read failed or did not answer in time); re-running ${rerun} reads it again. Re-creating it could duplicate it or collide with it` : `AWS still reports it, but its failed delete may have been accepted and still be running, or only partly ran. Re-adopting it could leave neither resource once a running delete finishes, or one that delete already stripped; once AWS reports it gone, re-running ${rerun} re-creates it. A refused delete is not running, so waiting does not help: if its delete was refused, delete it by hand, then re-run ${rerun}`;
34819
+ return ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(oldType)}): ` + (identity || verdict === "vacated" || verdict === "free-unreadable" ? `the old resource (${oldShown}) cannot be proven the stack's: ${why}.` : `the deploy did not confirm that it deleted the old resource (${oldShown}), so it may still exist, and ${why}.`) + ` Nothing was sent and the journal is kept.` + (remedy.offered ? ` To keep the new resource in its place instead, re-run with the command below, ` + (identity || verdict === "vacated" || verdict === "free-unreadable" ? `and leave anything under the old id alone unless it is this stack's.` : `then delete the old resource by hand if it still exists.`) : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown)}` + remedy.line, "REPLACED_SURVIVOR_UNPROVEN")));
33867
34820
  }
33868
34821
  function foreignSurvivorRefusal(s, oldType, verdict) {
33869
34822
  const { op, ctx, mask } = s;
@@ -34218,6 +35171,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
34218
35171
  const secrets = /* @__PURE__ */ new Map();
34219
35172
  const opMasker = createOpMasker(logger, secrets, ctx.logOnlyNeedlesFor?.(op.logicalId));
34220
35173
  const mask = opMasker.mask;
35174
+ const warnIdentity = identityWarner(logger, mask, op);
34221
35175
  const skipScope = {
34222
35176
  ctx,
34223
35177
  stackName,
@@ -34484,7 +35438,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
34484
35438
  }
34485
35439
  ], op.logicalId, logger, options.isInterrupted, secrets, mask));
34486
35440
  if (revertFailedResult) recordNoEchoAttributeValues(revertFailedResult, secrets, desiredProps);
34487
- stateResources[op.logicalId] = maskRestoredNoEchoRecord(redactRollbackRecord(withNameGenerationReached(await withRefreshedObservedBaseline(recordAfterRollbackUpdate(prev, revertFailedResult), {
35441
+ stateResources[op.logicalId] = maskRestoredNoEchoRecord(redactRollbackRecord(withNameGenerationReached(await withRefreshedObservedBaseline(recordAfterRollbackUpdate(prev, revertFailedResult, warnIdentity), {
34488
35442
  provider,
34489
35443
  op,
34490
35444
  desiredProps,
@@ -34706,6 +35660,11 @@ function cfnIngressPortValue(value) {
34706
35660
  }
34707
35661
  return NaN;
34708
35662
  }
35663
+ const SG_RULE_ID_PATTERN = /^sgr-[0-9a-f]+$/;
35664
+ function recordedSgRuleId(attributes) {
35665
+ const recorded = attributes?.["Id"];
35666
+ return typeof recorded === "string" && SG_RULE_ID_PATTERN.test(recorded) ? recorded : void 0;
35667
+ }
34709
35668
 
34710
35669
  // src/provisioning/sg-sibling-rules.ts
34711
35670
  const RULE_TYPE = {
@@ -34752,11 +35711,12 @@ function sgRuleOwnershipIdentity(rule, direction) {
34752
35711
  ...PEER_KEYS[direction].map((key) => rule[key] ?? null)
34753
35712
  ]);
34754
35713
  }
34755
- function siblingOwnedSgRuleIdentities(groupId, direction, properties, context) {
35714
+ function siblingOwnedSgRuleIdentities(groupId, direction, properties, context, skip) {
34756
35715
  const owned = /* @__PURE__ */ new Set();
34757
35716
  if (typeof groupId !== "string" || groupId === "") return owned;
34758
- for (const sibling of Object.values(context?.siblings ?? {})) {
35717
+ for (const [lid, sibling] of Object.entries(context?.siblings ?? {})) {
34759
35718
  if (sibling.resourceType !== RULE_TYPE[direction]) continue;
35719
+ if (skip?.(lid, sibling) === true) continue;
34760
35720
  const props = sibling.properties;
34761
35721
  if (!isPlainRecord$3(props) || props["GroupId"] !== groupId) continue;
34762
35722
  const identity = sgRuleOwnershipIdentity(props, direction);
@@ -34770,6 +35730,64 @@ function siblingOwnedSgRuleIdentities(groupId, direction, properties, context) {
34770
35730
  }
34771
35731
  return owned;
34772
35732
  }
35733
+ const INGRESS_IDENTITY_KEYS = [
35734
+ "IpProtocol",
35735
+ "FromPort",
35736
+ "ToPort",
35737
+ "CidrIp",
35738
+ "CidrIpv6",
35739
+ "SourceSecurityGroupId",
35740
+ "SourceSecurityGroupName",
35741
+ "SourceSecurityGroupOwnerId",
35742
+ "SourcePrefixListId"
35743
+ ];
35744
+ function sgSiblingDecidedById(selfLogicalId, self, records, groupProperties) {
35745
+ if (!isPlainRecord$3(self)) return false;
35746
+ const direction = self.resourceType === RULE_TYPE.ingress ? "ingress" : self.resourceType === RULE_TYPE.egress ? "egress" : void 0;
35747
+ const props = self.properties;
35748
+ const id = recordedRuleIdOf(self);
35749
+ if (direction === void 0 || !isPlainRecord$3(props) || id === void 0) return false;
35750
+ const groupId = props["GroupId"];
35751
+ if (typeof groupId !== "string" || groupId === "") return false;
35752
+ if (INGRESS_IDENTITY_KEYS.some((key) => isRedactedRecordedValue(props[key]))) return false;
35753
+ if (props["SourceSecurityGroupName"] != null && props["SourceSecurityGroupId"] == null) return false;
35754
+ const identity = sgRuleOwnershipIdentity(props, direction);
35755
+ if (identity === void 0) return false;
35756
+ for (const [lid, other] of records) {
35757
+ if (lid === selfLogicalId || !isPlainRecord$3(other)) continue;
35758
+ if (other.resourceType !== RULE_TYPE[direction]) continue;
35759
+ const otherProps = other.properties;
35760
+ if (!isPlainRecord$3(otherProps) || otherProps["GroupId"] !== groupId) continue;
35761
+ if (recordedRuleIdOf(other) === id) return false;
35762
+ if (sgRuleOwnershipIdentity(otherProps, direction) === identity) return false;
35763
+ }
35764
+ const inline = groupProperties?.[LIST_KEY[direction]];
35765
+ if (Array.isArray(inline) && inline.some((e) => sgRuleOwnershipIdentity(e, direction) === identity)) return false;
35766
+ return true;
35767
+ }
35768
+ function skipSiblingsDecidedById(properties, context) {
35769
+ if (context?.ccApiRead === true) return void 0;
35770
+ const records = Object.entries(context?.siblings ?? {});
35771
+ return (lid, sibling) => sgSiblingDecidedById(lid, sibling, records, properties);
35772
+ }
35773
+ function recordedRuleIdOf(record) {
35774
+ return recordedSgRuleId(record.attributes) ?? (typeof record.physicalId === "string" && SG_RULE_ID_PATTERN.test(record.physicalId) ? record.physicalId : void 0);
35775
+ }
35776
+ function siblingRecordedSgRuleIds(groupId, records, direction) {
35777
+ const ids = /* @__PURE__ */ new Map();
35778
+ if (typeof groupId !== "string" || groupId === "" || records === void 0) return ids;
35779
+ for (const [, record] of records) {
35780
+ if (!isPlainRecord$3(record)) continue;
35781
+ const recordDirection = record.resourceType === RULE_TYPE.ingress ? "ingress" : record.resourceType === RULE_TYPE.egress ? "egress" : void 0;
35782
+ if (recordDirection === void 0) continue;
35783
+ if (direction !== void 0 && recordDirection !== direction) continue;
35784
+ const props = record.properties;
35785
+ if (!isPlainRecord$3(props) || props["GroupId"] !== groupId) continue;
35786
+ const id = recordedRuleIdOf(record);
35787
+ if (id !== void 0) ids.set(id, sgRuleOwnershipIdentity(props, recordDirection));
35788
+ }
35789
+ return ids;
35790
+ }
34773
35791
  function withoutSiblingOwnedSgRules(rules, owned, direction) {
34774
35792
  if (owned.size === 0) return [...rules];
34775
35793
  return rules.filter((rule) => {
@@ -34789,19 +35807,20 @@ function stripSiblingOwnedSgRules(resourceType, physicalId, baseline, aws, prope
34789
35807
  for (const direction of ["ingress", "egress"]) {
34790
35808
  const owned = siblingOwnedSgRuleIdentities(physicalId, direction, properties, context);
34791
35809
  if (owned.size === 0) continue;
35810
+ const liveOwned = siblingOwnedSgRuleIdentities(physicalId, direction, properties, context, skipSiblingsDecidedById(properties, context));
34792
35811
  const key = LIST_KEY[direction];
34793
- const strip = (bag) => {
35812
+ const strip = (bag, drop) => {
34794
35813
  const list = bag[key];
34795
- if (!Array.isArray(list)) return bag;
34796
- const kept = withoutSiblingOwnedSgRules(list, owned, direction);
35814
+ if (!Array.isArray(list) || drop.size === 0) return bag;
35815
+ const kept = withoutSiblingOwnedSgRules(list, drop, direction);
34797
35816
  return kept.length === list.length ? bag : {
34798
35817
  ...bag,
34799
35818
  [key]: kept
34800
35819
  };
34801
35820
  };
34802
35821
  out = {
34803
- baseline: strip(out.baseline),
34804
- aws: strip(out.aws)
35822
+ baseline: strip(out.baseline, owned),
35823
+ aws: strip(out.aws, liveOwned)
34805
35824
  };
34806
35825
  }
34807
35826
  return out;
@@ -35148,7 +36167,7 @@ function helperOwnedLists(resourceType, physicalId, properties, context) {
35148
36167
  if (resourceType === "AWS::EC2::SecurityGroup") for (const [key, direction] of [["SecurityGroupIngress", "ingress"], ["SecurityGroupEgress", "egress"]]) out.push({
35149
36168
  key,
35150
36169
  keyOf: (m) => sgRuleOwnershipIdentity(m, direction),
35151
- owned: siblingOwnedSgRuleIdentities(physicalId, direction, properties, context)
36170
+ owned: siblingOwnedSgRuleIdentities(physicalId, direction, properties, context, skipSiblingsDecidedById(properties, context))
35152
36171
  });
35153
36172
  return out.filter((l) => l.owned.size > 0);
35154
36173
  }
@@ -37994,22 +39013,22 @@ function sameJournaledOrphans(a, b) {
37994
39013
  }
37995
39014
 
37996
39015
  // src/provisioning/nested-stack-context.ts
37997
- const storage = new AsyncLocalStorage();
39016
+ const storage$1 = new AsyncLocalStorage();
37998
39017
  function withNestedStackContext(ctx, fn) {
37999
- return storage.run(ctx, fn);
39018
+ return storage$1.run(ctx, fn);
38000
39019
  }
38001
39020
  function getCurrentNestedStackContext() {
38002
- return storage.getStore();
39021
+ return storage$1.getStore();
38003
39022
  }
38004
39023
  async function collectNestedChildUnaddressed(fn) {
38005
- const ctx = storage.getStore();
39024
+ const ctx = storage$1.getStore();
38006
39025
  if (!ctx) return {
38007
39026
  value: await fn(),
38008
39027
  unaddressed: void 0
38009
39028
  };
38010
39029
  const slot = {};
38011
39030
  return {
38012
- value: await storage.run({
39031
+ value: await storage$1.run({
38013
39032
  ...ctx,
38014
39033
  childUnaddressed: slot
38015
39034
  }, fn),
@@ -39369,6 +40388,7 @@ var GeneratedNameMismatchError = class extends Error {
39369
40388
  function provenNothingCreated(error, logicalId, resourceType) {
39370
40389
  if (createdBeforeFailure(error, logicalId, resourceType) !== void 0) return false;
39371
40390
  if (isAmbiguousOutcomeError(error) || isThrottlingError(error)) return false;
40391
+ if (isNameCollisionErrorFrom(error, logicalId)) return false;
39372
40392
  let current = error;
39373
40393
  for (let depth = 0; depth < 8 && current !== null && typeof current === "object"; depth++) {
39374
40394
  const status = current.$metadata?.httpStatusCode;
@@ -39916,6 +40936,15 @@ function formatResourceLine(op, logicalId, resourceType, verbOverride) {
39916
40936
  }
39917
40937
  }
39918
40938
 
40939
+ // src/provisioning/licensed-name-holder.ts
40940
+ const storage = new AsyncLocalStorage();
40941
+ function withLicensedNameHolder(holder, fn) {
40942
+ return storage.run({ holder }, fn);
40943
+ }
40944
+ function licensedNameHolder() {
40945
+ return storage.getStore()?.holder;
40946
+ }
40947
+
39919
40948
  // src/deployment/deploy-engine/update/noecho-macs.ts
39920
40949
  function covers(coordinate, key, leafPath) {
39921
40950
  if (coordinate[0] !== key) return false;
@@ -40148,7 +41177,7 @@ async function provisionCreate(engine, logicalId, change, stateResources, stackN
40148
41177
  engine.generatedNameGuard?.noteSent(logicalId);
40149
41178
  result = resumed;
40150
41179
  } else {
40151
- await refuseUnlicensedGeneratedName(engine, {
41180
+ const licensedHolder = await refuseUnlicensedGeneratedName(engine, {
40152
41181
  logicalId,
40153
41182
  resourceType,
40154
41183
  stackName,
@@ -40167,10 +41196,10 @@ async function provisionCreate(engine, logicalId, change, stateResources, stackN
40167
41196
  });
40168
41197
  engine.generatedNameGuard?.noteSent(logicalId);
40169
41198
  try {
40170
- result = await engine.withRetry(() => withCurrentResourceSecrets(createSecrets, () => createProvider.create(logicalId, resourceType, createProps, {
41199
+ result = await engine.withRetry(() => withCurrentResourceSecrets(createSecrets, () => withLicensedNameHolder(licensedHolder, () => createProvider.create(logicalId, resourceType, createProps, {
40171
41200
  maskSecrets: createSecretMasker(createSecrets),
40172
41201
  ...typedPayloadLeaves !== void 0 && { typedPayloadLeaves }
40173
- })), logicalId, void 0, void 0, createProvider);
41202
+ }))), logicalId, void 0, void 0, createProvider);
40174
41203
  } catch (error) {
40175
41204
  engine.generatedNameGuard?.noteFailed(logicalId, error);
40176
41205
  throw error;
@@ -40215,11 +41244,11 @@ async function provisionCreate(engine, logicalId, change, stateResources, stackN
40215
41244
  async function guardedReplacementCreate(engine, input, create) {
40216
41245
  const guard = engine.generatedNameGuard;
40217
41246
  if (input.keepsName === true || guard?.candidate(input.logicalId) === void 0) return create();
40218
- await refuseUnlicensedGeneratedName(engine, input);
41247
+ const licensedHolder = await refuseUnlicensedGeneratedName(engine, input);
40219
41248
  guard.noteSent(input.logicalId);
40220
41249
  let result;
40221
41250
  try {
40222
- result = await create();
41251
+ result = await withLicensedNameHolder(licensedHolder, create);
40223
41252
  } catch (error) {
40224
41253
  guard.noteFailed(input.logicalId, error);
40225
41254
  throw error;
@@ -40236,13 +41265,14 @@ async function refuseUnlicensedGeneratedName(engine, input) {
40236
41265
  const subject = `${displaySafe(logicalId)} (${displaySafe(resourceType)})`;
40237
41266
  const checked = engine.generatedNameGuard.candidate(logicalId) ?? asked;
40238
41267
  const named = `the cdkd-generated ${checked.property ?? "name"} ${displaySafe(checked.name)}`;
40239
- const adoptsText = "its create API hands back or overwrites an existing resource of that name instead of refusing it";
41268
+ const refusesItself = resourceType === "AWS::Logs::LogGroup";
41269
+ const adoptsText = refusesItself ? `cdkd checks a log group's name before its create, as CloudFormation refuses a taken one` : "its create API hands back or overwrites an existing resource of that name instead of refusing it";
40240
41270
  const refuse = (message) => {
40241
41271
  throw markNonRetryable(markRefusedBeforeApplying(new CdkdError(message, "GENERATED_NAME_HELD")));
40242
41272
  };
40243
41273
  switch (verdict.kind) {
40244
- case "free":
40245
- case "licensed": return;
41274
+ case "free": return;
41275
+ case "licensed": return verdict.holder;
40246
41276
  case "unchecked":
40247
41277
  engine.logger.warn(safeMsg`${subject} is created with ${named} without checking whether another resource already ` + safeMsg`holds it: the lookup was refused (${describeAwsFailure(verdict.error).summary}). ` + "Grant this identity the type's Describe / List permission to have cdkd refuse taking over another deployment's resource.");
40248
41278
  return;
@@ -40263,9 +41293,9 @@ async function refuseUnlicensedGeneratedName(engine, input) {
40263
41293
  }], recoveryCommandFlags(engine.options.refusalRecovery).flags).command, "`")}`;
40264
41294
  if (verdict.ownIntent !== void 0) {
40265
41295
  const why = verdict.ownIntent === "abandoned" ? "a deploy of this stack that was killed or force-unlocked" : "a create of this stack that came back failed (a timeout or a server error)";
40266
- return refuse(`${subject} would be created with ${named}, which an existing resource (${displaySafe(verdict.holder)}) already holds. This stack's create-token ledger records that ${why} sent this name, but this type reports no creation time, so cdkd cannot tell that resource is the one it made rather than another deployment's created since. Since ${adoptsText}, creating it would take that resource over. ${displaySafe(logicalId)} was not created. The likely cause: the resource is this stack's own, from that deploy. If it is, ${importLine} and re-run; if it is not, this stack is also deployed under another state backend.`);
41296
+ return refuse(`${subject} would be created with ${named}, which an existing resource (${displaySafe(verdict.holder)}) already holds. This stack's create-token ledger records that ${why} sent this name, but this type reports no creation time, so cdkd cannot tell that resource is the one it made rather than another deployment's created since. ` + (refusesItself ? "" : `Since ${adoptsText}, creating it would take that resource over. `) + `${displaySafe(logicalId)} was not created. The likely cause: the resource is this stack's own, from that deploy. If it is, ${importLine} and re-run; if it is not, this stack is also deployed under another state backend.`);
40267
41297
  }
40268
- return refuse(`${subject} would be created with ${named}, which an existing resource (${displaySafe(verdict.holder)}) already holds, and nothing this stack records names that resource: not its state, its rollback journal or create-token ledger, nor what a destroy of it under this state prefix kept. Since ${adoptsText}, creating it would take that resource over, as CloudFormation refuses with "already exists". ${displaySafe(logicalId)} was not created. The likely cause: this stack is also deployed under another state backend (another --state-prefix, --state-bucket or account), where cdkd generates the same names. One stack name per account and region is supported: deploy it under one backend only, or give this stack another name. If the resource is this stack's own, ${importLine} and re-run.`);
41298
+ return refuse(`${subject} would be created with ${named}, which an existing resource (${displaySafe(verdict.holder)}) already holds, and nothing this stack records names that resource: not its state, its rollback journal or create-token ledger, nor what a destroy of it under this state prefix kept. ` + (refusesItself ? `CloudFormation refuses it with "already exists". ` : `Since ${adoptsText}, creating it would take that resource over, as CloudFormation refuses with "already exists". `) + `${displaySafe(logicalId)} was not created. The likely cause: this stack is also deployed under another state backend (another --state-prefix, --state-bucket or account), where cdkd generates the same names. One stack name per account and region is supported: deploy it under one backend only, or give this stack another name. If the resource is this stack's own, ${importLine} and re-run.`);
40269
41299
  }
40270
41300
  }
40271
41301
  }
@@ -40283,7 +41313,8 @@ async function refuseTakenCreateName(engine, input) {
40283
41313
  const shown = (value) => displaySafe(maskName(value));
40284
41314
  const subject = `${displaySafe(logicalId)} (${displaySafe(resourceType)})`;
40285
41315
  const named = `${question.property} ${shown(question.desiredName)}`;
40286
- const adoptsText = "its create API hands back or overwrites an existing resource of that name instead of refusing it";
41316
+ const refusesItself = resourceType === "AWS::Logs::LogGroup";
41317
+ const adoptsText = refusesItself ? `cdkd checks a log group's name before its create, as CloudFormation refuses a taken one` : "its create API hands back or overwrites an existing resource of that name instead of refusing it";
40287
41318
  const refuse = (message, cause, redactedCause = false) => {
40288
41319
  const refusal = new CdkdError(maskName(message), "NAMED_CREATE_COLLISION", cause instanceof Error ? cause : void 0);
40289
41320
  throw markNonRetryable(markRefusedBeforeApplying(redactedCause && cause instanceof Error ? markRedactedCause(refusal) : refusal));
@@ -40319,7 +41350,7 @@ async function refuseTakenCreateName(engine, input) {
40319
41350
  if (found === null) return;
40320
41351
  const holderId = found.physicalId;
40321
41352
  const ownHolder = Object.entries(input.stateResources).find(([otherId, record]) => otherId !== logicalId && record.resourceType === resourceType && probeFoundSameId(resourceType, record.physicalId, holderId));
40322
- 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. 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.`);
41353
+ 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.`);
40323
41354
  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)";
40324
41355
  const built = input.stackName.includes("~") || resourceType === "AWS::S3::Bucket" ? void 0 : pasteableCommand("cdkd import", [{
40325
41356
  value: input.stackName,
@@ -40332,7 +41363,7 @@ async function refuseTakenCreateName(engine, input) {
40332
41363
  const adopt = built !== void 0 && maskName(built.command) === built.command ? built : void 0;
40333
41364
  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.`;
40334
41365
  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.";
40335
- return refuse(`${subject} is created with ${named}, and an existing resource (${shown(holderId)}) already holds that name. 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 ? "" : `
41366
+ 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 ? "" : `
40336
41367
  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}`));
40337
41368
  }
40338
41369
  async function resumeAbandonedCreate(engine, args) {
@@ -40940,6 +41971,8 @@ async function retryCarriedSupersededResources(engine, host, carried, resources,
40940
41971
  maskSecrets: createSecretMasker(bag),
40941
41972
  stop: () => engine.interrupted,
40942
41973
  once: options.waitInUse !== true,
41974
+ holderProvider: () => engine.providerRegistry.getProvider(resourceType),
41975
+ warn: (message) => engine.logger.warn(safeMsg` ⚠ Old ${logicalId} (${physicalId}): ${message}`),
40943
41976
  preDeleteSnapshot: {
40944
41977
  clients: engine.options.finalSnapshotClients ?? getAwsClients(),
40945
41978
  logger: {
@@ -40965,6 +41998,14 @@ async function retryCarriedSupersededResources(engine, host, carried, resources,
40965
41998
  }
40966
41999
  removeSuperseded(host, entry);
40967
42000
  changed = true;
42001
+ if (outcome.kind === "gone") {
42002
+ engine.logger.info(safeMsg` ${green("✓")} Old ${logicalId} (${physicalId}) is already gone; no delete was sent`);
42003
+ return;
42004
+ }
42005
+ if (outcome.kind === "notOurs") {
42006
+ 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.`);
42007
+ return;
42008
+ }
40968
42009
  if (outcome.kind === "notDeleted") {
40969
42010
  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.`);
40970
42011
  return;
@@ -44673,6 +45714,136 @@ function protectedDeleteMessage(logicalId, shownTable, regions, stackDestroy, al
44673
45714
  return safeMsg`DynamoDB GlobalTable ${logicalId} (${shownTable}) has deletion protection enabled in ${regions.join(", ")}; ` + `${changed} ${remedy}`;
44674
45715
  }
44675
45716
 
45717
+ // src/provisioning/tags-own-write-baseline.ts
45718
+ const TAGS_BASELINE_REREAD_DELAYS_MS = [
45719
+ 500,
45720
+ 1e3,
45721
+ 2e3,
45722
+ 4e3
45723
+ ];
45724
+ const tagWrites = /* @__PURE__ */ new Map();
45725
+ function recordTagWrite(resourceType, id, set, removed) {
45726
+ let byId = tagWrites.get(resourceType);
45727
+ if (byId === void 0) {
45728
+ byId = /* @__PURE__ */ new Map();
45729
+ tagWrites.set(resourceType, byId);
45730
+ }
45731
+ const write = byId.get(id) ?? {
45732
+ set: /* @__PURE__ */ new Map(),
45733
+ removed: /* @__PURE__ */ new Set()
45734
+ };
45735
+ for (const key of removed) {
45736
+ write.set.delete(key);
45737
+ write.removed.add(key);
45738
+ }
45739
+ for (const [key, value] of set) {
45740
+ write.removed.delete(key);
45741
+ write.set.set(key, value);
45742
+ }
45743
+ byId.set(id, write);
45744
+ }
45745
+ function takeTagWrite(resourceType, id) {
45746
+ const byId = tagWrites.get(resourceType);
45747
+ const write = byId?.get(id);
45748
+ byId?.delete(id);
45749
+ return write;
45750
+ }
45751
+ function clearTagWrites(resourceType, owned) {
45752
+ const byId = tagWrites.get(resourceType);
45753
+ if (byId === void 0) return;
45754
+ for (const id of byId.keys()) if (owned(id)) byId.delete(id);
45755
+ }
45756
+ function isDynamoDBTableArnIn(arn, tableName, regions) {
45757
+ const parts = arn.split(":");
45758
+ return parts.length === 6 && parts[2] === "dynamodb" && regions.has(parts[3] ?? "") && parts[5] === `table/${tableName}`;
45759
+ }
45760
+ function tagsShowWrite(read, write) {
45761
+ if (!Array.isArray(read)) return false;
45762
+ const live = /* @__PURE__ */ new Map();
45763
+ for (const entry of read) {
45764
+ if (typeof entry !== "object" || entry === null) return false;
45765
+ const { Key: key, Value: value } = entry;
45766
+ if (typeof key !== "string") return false;
45767
+ live.set(key, value);
45768
+ }
45769
+ for (const [key, value] of write.set) if (live.get(key) !== value) return false;
45770
+ for (const key of write.removed) if (live.has(key)) return false;
45771
+ return true;
45772
+ }
45773
+ function overlayTagWrite(read, write) {
45774
+ const seen = /* @__PURE__ */ new Set();
45775
+ const out = [];
45776
+ for (const tag of read) {
45777
+ if (write.removed.has(tag.Key) || seen.has(tag.Key)) continue;
45778
+ seen.add(tag.Key);
45779
+ const value = write.set.get(tag.Key);
45780
+ out.push(value === void 0 ? tag : {
45781
+ Key: tag.Key,
45782
+ Value: value
45783
+ });
45784
+ }
45785
+ for (const [Key, Value] of write.set) if (!seen.has(Key)) out.push({
45786
+ Key,
45787
+ Value
45788
+ });
45789
+ return out;
45790
+ }
45791
+ async function settleWrittenTags(first, reRead, write, delaysMs, onUnsettled, terminal = () => false) {
45792
+ let newest;
45793
+ let firstError;
45794
+ let answered = false;
45795
+ const take = (answer) => {
45796
+ if (terminal(answer) || tagsShowWrite(answer, write)) return true;
45797
+ newest = answer;
45798
+ return false;
45799
+ };
45800
+ try {
45801
+ const answer = await first();
45802
+ answered = true;
45803
+ if (take(answer)) return answer;
45804
+ } catch (err) {
45805
+ if (memberReadFailure(err) === "refused") throw err;
45806
+ firstError = err;
45807
+ }
45808
+ for (const delayMs of delaysMs) {
45809
+ await new Promise((resolve) => setTimeout(resolve, delayMs));
45810
+ let answer;
45811
+ try {
45812
+ answer = await reRead();
45813
+ } catch (err) {
45814
+ if (!answered && memberReadFailure(err) === "failed") continue;
45815
+ break;
45816
+ }
45817
+ answered = true;
45818
+ if (take(answer)) return answer;
45819
+ }
45820
+ if (newest === void 0) throw firstError;
45821
+ onUnsettled();
45822
+ return overlayTagWrite(newest, write);
45823
+ }
45824
+ function declaredTagsReadback(desired) {
45825
+ const read = readTagList(desired, "desired");
45826
+ if (read.kind !== "tags") return void 0;
45827
+ const byKey = /* @__PURE__ */ new Map();
45828
+ for (const tag of read.tags) byKey.set(tag.Key, tag.Value);
45829
+ return [...byKey].filter(([key]) => !key.startsWith("aws:")).map(([Key, Value]) => ({
45830
+ Key,
45831
+ Value
45832
+ }));
45833
+ }
45834
+ function tagsMatchDeclared(read, declared) {
45835
+ if (!Array.isArray(read)) return false;
45836
+ const live = /* @__PURE__ */ new Map();
45837
+ for (const entry of read) {
45838
+ if (typeof entry !== "object" || entry === null) return false;
45839
+ const { Key: key, Value: value } = entry;
45840
+ if (typeof key !== "string") return false;
45841
+ if (!key.startsWith("aws:")) live.set(key, value);
45842
+ }
45843
+ const want = declared.filter((t) => !t.Key.startsWith("aws:"));
45844
+ return live.size === want.length && want.every((t) => live.get(t.Key) === t.Value);
45845
+ }
45846
+
44676
45847
  // src/provisioning/providers/dynamodb-globaltable/update-plan.ts
44677
45848
  async function updatePhasePlan(scope) {
44678
45849
  const { physicalId, logicalId, maskSecrets, currentRegion, properties, previousProperties, context, warn, resourceType, log } = scope;
@@ -45326,6 +46497,8 @@ async function updatePhaseIndexes(scope) {
45326
46497
 
45327
46498
  // src/provisioning/providers/dynamodb-globaltable/update.ts
45328
46499
  async function update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
46500
+ const replicaRegions = /* @__PURE__ */ new Set([...declaredReplicaRegions(properties), ...declaredReplicaRegions(previousProperties)]);
46501
+ clearTagWrites("AWS::DynamoDB::GlobalTable", (arn) => isDynamoDBTableArnIn(arn, physicalId, replicaRegions));
45329
46502
  return unsettledScope.run({
45330
46503
  mark: (key) => context?.markUnsettled?.(key),
45331
46504
  unsettled: context?.unsettledProperties ?? /* @__PURE__ */ new Set(),
@@ -45556,6 +46729,7 @@ async function applyTagDiffOnClient(client, tableArn, resourceType, id, oldTagsR
45556
46729
  ResourceArn: tableArn,
45557
46730
  TagKeys: tagsToRemove
45558
46731
  }));
46732
+ recordTagWrite("AWS::DynamoDB::GlobalTable", tableArn, [], tagsToRemove);
45559
46733
  this.logger.debug(maskSecrets(`Removed ${tagsToRemove.length} tag(s) from DynamoDB GlobalTable ${tableArn}`));
45560
46734
  }
45561
46735
  if (tagsToAdd.length > 0) {
@@ -45563,6 +46737,7 @@ async function applyTagDiffOnClient(client, tableArn, resourceType, id, oldTagsR
45563
46737
  ResourceArn: tableArn,
45564
46738
  Tags: tagsToAdd
45565
46739
  }));
46740
+ recordTagWrite("AWS::DynamoDB::GlobalTable", tableArn, tagsToAdd.map((t) => [t.Key, t.Value]), []);
45566
46741
  if (region !== void 0 && REGION_SEGMENT.test(region)) {
45567
46742
  let recordedKeys;
45568
46743
  try {
@@ -45575,6 +46750,14 @@ async function applyTagDiffOnClient(client, tableArn, resourceType, id, oldTagsR
45575
46750
  this.logger.debug(maskSecrets(`Added/updated ${tagsToAdd.length} tag(s) on DynamoDB GlobalTable ${tableArn}`));
45576
46751
  }
45577
46752
  }
46753
+ function declaredReplicaRegions(bag) {
46754
+ const replicas = bag["Replicas"];
46755
+ if (!Array.isArray(replicas)) return [];
46756
+ return replicas.flatMap((r) => {
46757
+ const region = typeof r === "object" && r !== null ? r["Region"] : void 0;
46758
+ return typeof region === "string" ? [region] : [];
46759
+ });
46760
+ }
45578
46761
 
45579
46762
  // src/provisioning/providers/dynamodb-globaltable/autoscaling.ts
45580
46763
  async function applyAutoScalingDiff(tableName, dimension, oldSettings, newSettings, client, indexName, budget, maskSecrets = (text) => text, progress) {
@@ -46029,6 +47212,344 @@ async function deleteGlobalTableResource(logicalId, physicalId, resourceType, co
46029
47212
  }
46030
47213
  }
46031
47214
 
47215
+ // src/provisioning/dynamodb-stream-members.ts
47216
+ const STREAM_SPECIFICATION_KEY = "StreamSpecification";
47217
+ const STREAM_POLICY_KEY = "ResourcePolicy";
47218
+ const STREAM_TAGS_KEY = "Tags";
47219
+ const POLICY_PATH = `${STREAM_SPECIFICATION_KEY}.${STREAM_POLICY_KEY}`;
47220
+ const TAGS_PATH = `${STREAM_SPECIFICATION_KEY}.${STREAM_TAGS_KEY}`;
47221
+ function isPlainObject$2(value) {
47222
+ return typeof value === "object" && value !== null && !Array.isArray(value);
47223
+ }
47224
+ function refusalOf(guard) {
47225
+ try {
47226
+ guard();
47227
+ return;
47228
+ } catch (error) {
47229
+ return describeAwsFailure(error).detail;
47230
+ }
47231
+ }
47232
+ function blockMembers(block) {
47233
+ return isPlainObject$2(block) ? block : {};
47234
+ }
47235
+ function readStreamPolicy(block) {
47236
+ const value = blockMembers(block)[STREAM_POLICY_KEY];
47237
+ if (value === void 0 || value === null) return { kind: "absent" };
47238
+ const containerRefusal = refusalOf(() => requireConfigObject(value, POLICY_PATH));
47239
+ if (containerRefusal !== void 0) return {
47240
+ kind: "unusable",
47241
+ reason: containerRefusal
47242
+ };
47243
+ const documentPath = `${POLICY_PATH}.PolicyDocument`;
47244
+ const document = value["PolicyDocument"];
47245
+ if (typeof document === "string") return document.trim() === "" ? {
47246
+ kind: "unusable",
47247
+ reason: `${documentPath} must not be a blank string`
47248
+ } : {
47249
+ kind: "usable",
47250
+ document
47251
+ };
47252
+ if (document === void 0 || document === null) return {
47253
+ kind: "unusable",
47254
+ reason: `${documentPath} is required when ${POLICY_PATH} is declared`
47255
+ };
47256
+ const documentRefusal = refusalOf(() => requireConfigObject(document, documentPath));
47257
+ if (documentRefusal !== void 0) return {
47258
+ kind: "unusable",
47259
+ reason: documentRefusal
47260
+ };
47261
+ return {
47262
+ kind: "usable",
47263
+ document: JSON.stringify(document)
47264
+ };
47265
+ }
47266
+ function readStreamTags(block) {
47267
+ const value = blockMembers(block)[STREAM_TAGS_KEY];
47268
+ if (value === void 0 || value === null) return { kind: "absent" };
47269
+ if (!Array.isArray(value)) return {
47270
+ kind: "unusable",
47271
+ reason: `${TAGS_PATH} must be an array of {Key, Value} entries`
47272
+ };
47273
+ const tags = /* @__PURE__ */ new Map();
47274
+ for (const [position, entry] of value.entries()) {
47275
+ const entryPath = `${TAGS_PATH}[${position}]`;
47276
+ const refusal = refusalOf(() => requireConfigObject(entry, entryPath)) ?? configStringRefusal(entry, "Key", "required", entryPath) ?? configStringRefusal(entry, "Value", "", entryPath);
47277
+ if (refusal !== void 0) return {
47278
+ kind: "unusable",
47279
+ reason: refusal
47280
+ };
47281
+ const { Key: key, Value: tagValue } = entry;
47282
+ if (typeof key !== "string") return {
47283
+ kind: "unusable",
47284
+ reason: `${entryPath}.Key is required`
47285
+ };
47286
+ tags.set(key, typeof tagValue === "string" ? tagValue : "");
47287
+ }
47288
+ return {
47289
+ kind: "usable",
47290
+ tags
47291
+ };
47292
+ }
47293
+ function streamMemberRefusals(block) {
47294
+ const refusals = [];
47295
+ const policy = readStreamPolicy(block);
47296
+ if (policy.kind === "unusable") refusals.push(policy.reason);
47297
+ const tags = readStreamTags(block);
47298
+ if (tags.kind === "unusable") refusals.push(tags.reason);
47299
+ return refusals;
47300
+ }
47301
+ function planStreamMemberOps(desiredBlock, previousBlock, options, onUnusable) {
47302
+ let desiredPolicy = readStreamPolicy(desiredBlock);
47303
+ let desiredTags = readStreamTags(desiredBlock);
47304
+ if (desiredPolicy.kind === "unusable") onUnusable(desiredPolicy.reason);
47305
+ if (desiredTags.kind === "unusable") onUnusable(desiredTags.reason);
47306
+ let previousPolicy = readStreamPolicy(previousBlock);
47307
+ let previousTags = readStreamTags(previousBlock);
47308
+ if (options.freshStream) {
47309
+ if (desiredPolicy.kind === "unusable" && previousPolicy.kind === "usable") desiredPolicy = previousPolicy;
47310
+ if (desiredTags.kind === "unusable" && previousTags.kind === "usable") desiredTags = previousTags;
47311
+ previousPolicy = { kind: "absent" };
47312
+ previousTags = { kind: "absent" };
47313
+ } else if (options.contentsUnknown === true) {
47314
+ previousPolicy = {
47315
+ kind: "unusable",
47316
+ reason: ""
47317
+ };
47318
+ previousTags = { kind: "absent" };
47319
+ }
47320
+ const tagOps = [];
47321
+ if (desiredTags.kind !== "unusable") {
47322
+ const desired = desiredTags.kind === "usable" ? desiredTags.tags : /* @__PURE__ */ new Map();
47323
+ const previous = previousTags.kind === "usable" ? previousTags.tags : /* @__PURE__ */ new Map();
47324
+ const keysToRemove = [...previous.keys()].filter((key) => !desired.has(key));
47325
+ if (keysToRemove.length > 0) tagOps.push({
47326
+ kind: "untag",
47327
+ keys: keysToRemove
47328
+ });
47329
+ const tagsToSet = [...desired].filter(([key, value]) => previous.get(key) !== value).map(([Key, Value]) => ({
47330
+ Key,
47331
+ Value
47332
+ }));
47333
+ if (tagsToSet.length > 0) tagOps.push({
47334
+ kind: "tag",
47335
+ tags: tagsToSet
47336
+ });
47337
+ }
47338
+ const policyPut = desiredPolicy.kind === "usable" && !(previousPolicy.kind === "usable" && samePolicyDocument(previousPolicy.document, desiredPolicy.document));
47339
+ const policyDelete = previousPolicy.kind !== "absent" && (desiredPolicy.kind === "absent" || policyPut && tagOps.length > 0);
47340
+ const ops = [];
47341
+ if (policyDelete) ops.push({ kind: "deletePolicy" });
47342
+ ops.push(...tagOps);
47343
+ if (policyPut && desiredPolicy.kind === "usable") ops.push({
47344
+ kind: "putPolicy",
47345
+ document: desiredPolicy.document
47346
+ });
47347
+ return ops;
47348
+ }
47349
+ function samePolicyDocument(left, right) {
47350
+ if (left === right) return true;
47351
+ try {
47352
+ return canonicalJson$1(JSON.parse(left)) === canonicalJson$1(JSON.parse(right));
47353
+ } catch {
47354
+ return false;
47355
+ }
47356
+ }
47357
+ function streamDeclaresPolicy(desiredBlock) {
47358
+ return readStreamPolicy(desiredBlock).kind === "usable";
47359
+ }
47360
+ function streamDeclaresTags(desiredBlock) {
47361
+ return readStreamTags(desiredBlock).kind === "usable";
47362
+ }
47363
+ function reverseMapStreamPolicy(livePolicy, desiredBlock) {
47364
+ if (livePolicy === void 0 || livePolicy === "") return void 0;
47365
+ const declared = blockMembers(blockMembers(desiredBlock)[STREAM_POLICY_KEY])["PolicyDocument"];
47366
+ let parsed;
47367
+ try {
47368
+ parsed = JSON.parse(livePolicy);
47369
+ } catch {
47370
+ return { PolicyDocument: livePolicy };
47371
+ }
47372
+ if (typeof declared !== "string") return { PolicyDocument: parsed };
47373
+ let declaredParsed;
47374
+ try {
47375
+ declaredParsed = JSON.parse(declared);
47376
+ } catch {
47377
+ return { PolicyDocument: livePolicy };
47378
+ }
47379
+ return { PolicyDocument: canonicalJson$1(declaredParsed) === canonicalJson$1(parsed) ? declared : livePolicy };
47380
+ }
47381
+ function streamPolicyMatchesDeclared(livePolicy, desiredBlock) {
47382
+ const declared = readStreamPolicy(desiredBlock);
47383
+ if (declared.kind !== "usable" || livePolicy === void 0) return false;
47384
+ try {
47385
+ return canonicalJson$1(JSON.parse(livePolicy)) === canonicalJson$1(JSON.parse(declared.document));
47386
+ } catch {
47387
+ return false;
47388
+ }
47389
+ }
47390
+ function declaredStreamPolicyMember(desiredBlock) {
47391
+ const declared = readStreamPolicy(desiredBlock);
47392
+ return declared.kind === "usable" ? reverseMapStreamPolicy(declared.document, desiredBlock) : void 0;
47393
+ }
47394
+ function declaredStreamTagsMember(desiredBlock) {
47395
+ const declared = readStreamTags(desiredBlock);
47396
+ return declared.kind === "usable" ? [...declared.tags].map(([Key, Value]) => ({
47397
+ Key,
47398
+ Value
47399
+ })) : void 0;
47400
+ }
47401
+ function streamTagsMatchDeclared(liveTags, desiredBlock) {
47402
+ const declared = readStreamTags(desiredBlock);
47403
+ if (declared.kind !== "usable" || liveTags.length !== declared.tags.size) return false;
47404
+ return liveTags.every((tag) => declared.tags.get(tag.Key) === tag.Value);
47405
+ }
47406
+ function canonicalJson$1(value) {
47407
+ if (Array.isArray(value)) return `[${value.map(canonicalJson$1).join(",")}]`;
47408
+ if (isPlainObject$2(value)) return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson$1(value[key])}`).join(",")}}`;
47409
+ return JSON.stringify(value) ?? "null";
47410
+ }
47411
+
47412
+ // src/provisioning/providers/dynamodb-globaltable/read-support.ts
47413
+ async function readReplicaSubSpecs(client, tableName, regionLabel, declaredReplica) {
47414
+ const out = {};
47415
+ try {
47416
+ const ci = await client.send(new DescribeContributorInsightsCommand({ TableName: tableName }));
47417
+ const block = reverseMapReplicaContributorInsights(ci.ContributorInsightsStatus, ci.ContributorInsightsMode, declaredReplica?.["ContributorInsightsSpecification"]);
47418
+ if (block !== void 0) out["ContributorInsightsSpecification"] = block;
47419
+ } catch (err) {
47420
+ if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
47421
+ this.logger.debug(`Could not read ContributorInsights for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
47422
+ }
47423
+ try {
47424
+ const description = (await client.send(new DescribeContinuousBackupsCommand({ TableName: tableName }))).ContinuousBackupsDescription?.PointInTimeRecoveryDescription;
47425
+ const block = reverseMapReplicaPitr(description?.PointInTimeRecoveryStatus, description?.RecoveryPeriodInDays, declaredReplica?.["PointInTimeRecoverySpecification"]);
47426
+ if (block !== void 0) out["PointInTimeRecoverySpecification"] = block;
47427
+ } catch (err) {
47428
+ if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
47429
+ this.logger.debug(`Could not read PointInTimeRecovery for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
47430
+ }
47431
+ try {
47432
+ const active = ((await client.send(new DescribeKinesisStreamingDestinationCommand({ TableName: tableName }))).KinesisDataStreamDestinations ?? []).find((d) => d.DestinationStatus === "ACTIVE" || d.DestinationStatus === "ENABLING");
47433
+ if (active?.StreamArn) {
47434
+ const ksOut = { StreamArn: active.StreamArn };
47435
+ if (active.ApproximateCreationDateTimePrecision !== void 0) ksOut["ApproximateCreationDateTimePrecision"] = active.ApproximateCreationDateTimePrecision;
47436
+ out["KinesisStreamSpecification"] = ksOut;
47437
+ }
47438
+ } catch (err) {
47439
+ if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
47440
+ this.logger.debug(`Could not read KinesisStreamingDestination for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
47441
+ }
47442
+ return out;
47443
+ }
47444
+ async function readReplicaPolicies(client, tableName, regionLabel, tableArn, streamArn, declaredReplica, afterOwnWrite, entry) {
47445
+ if (declaredReplica === void 0) return;
47446
+ const readOne = async (what, arn, container) => {
47447
+ if (arn === void 0 || arn === "") return void 0;
47448
+ const declaredMember = () => declaredStreamPolicyMember(container);
47449
+ let last;
47450
+ const read = async () => {
47451
+ try {
47452
+ last = (await client.send(new GetResourcePolicyCommand({ ResourceArn: arn }))).Policy;
47453
+ } catch (err) {
47454
+ if (!(err instanceof PolicyNotFoundException)) throw err;
47455
+ last = void 0;
47456
+ }
47457
+ return last;
47458
+ };
47459
+ try {
47460
+ let live = await read();
47461
+ for (const delayMs of afterOwnWrite ? this.policyRereadDelaysMs : []) {
47462
+ if (streamPolicyMatchesDeclared(live, container)) break;
47463
+ await new Promise((resolve) => setTimeout(resolve, delayMs));
47464
+ live = await read();
47465
+ }
47466
+ if (afterOwnWrite && !streamPolicyMatchesDeclared(live, container)) {
47467
+ this.logger.debug(safeMsg`Kept the declared ${what} of the ${regionLabel} replica of ${tableName} in the baseline captured after its write: the read never settled on it`);
47468
+ return declaredMember();
47469
+ }
47470
+ return reverseMapStreamPolicy(live, container);
47471
+ } catch (err) {
47472
+ if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
47473
+ this.logger.debug(safeMsg`Could not read the ${what} of the ${regionLabel} replica of ${tableName}: ${describeAwsFailure(err).detail}`);
47474
+ if (afterOwnWrite && (last !== void 0 && last !== "" || isThrottlingError(err) || isTransientServerError(err) || isAmbiguousOutcomeError(err) || err instanceof ResourceNotFoundException$1)) return declaredMember();
47475
+ return;
47476
+ }
47477
+ };
47478
+ if (readTablePolicy(declaredReplica).kind === "usable") {
47479
+ const member = await readOne("ResourcePolicy", tableArn, declaredReplica);
47480
+ if (member !== void 0) entry["ResourcePolicy"] = member;
47481
+ }
47482
+ if (readStreamPolicy$1(declaredReplica).kind === "usable") {
47483
+ const member = await readOne("stream ResourcePolicy", streamArn, declaredReplica["ReplicaStreamSpecification"]);
47484
+ if (member !== void 0) entry["ReplicaStreamSpecification"] = { ResourcePolicy: member };
47485
+ }
47486
+ }
47487
+ async function readAutoScalingSettings(tableName, scalableDimension, client, indexName) {
47488
+ const resourceId = autoScalingResourceId(tableName, indexName);
47489
+ try {
47490
+ const asClient = client ?? new ApplicationAutoScalingClient({
47491
+ ...ambientClientDefaults(),
47492
+ region: await this.dynamoDBClient.config.region() ?? ""
47493
+ });
47494
+ const targets = (await asClient.send(new DescribeScalableTargetsCommand({
47495
+ ServiceNamespace: "dynamodb",
47496
+ ResourceIds: [resourceId],
47497
+ ScalableDimension: scalableDimension
47498
+ }))).ScalableTargets ?? [];
47499
+ if (targets.length === 0) return null;
47500
+ const target = targets[0];
47501
+ if (target.MinCapacity === void 0 || target.MaxCapacity === void 0) return null;
47502
+ const targetTracking = ((await asClient.send(new DescribeScalingPoliciesCommand({
47503
+ ServiceNamespace: "dynamodb",
47504
+ ResourceId: resourceId,
47505
+ ScalableDimension: scalableDimension
47506
+ }))).ScalingPolicies ?? []).find((p) => p.PolicyType === "TargetTrackingScaling");
47507
+ if (!targetTracking) return null;
47508
+ const cfg = targetTracking.TargetTrackingScalingPolicyConfiguration;
47509
+ if (!cfg || cfg.TargetValue === void 0) return null;
47510
+ const tttConfig = { TargetValue: cfg.TargetValue };
47511
+ if (cfg.DisableScaleIn !== void 0) tttConfig["DisableScaleIn"] = cfg.DisableScaleIn;
47512
+ if (cfg.ScaleInCooldown !== void 0) tttConfig["ScaleInCooldown"] = cfg.ScaleInCooldown;
47513
+ if (cfg.ScaleOutCooldown !== void 0) tttConfig["ScaleOutCooldown"] = cfg.ScaleOutCooldown;
47514
+ return {
47515
+ MinCapacity: target.MinCapacity,
47516
+ MaxCapacity: target.MaxCapacity,
47517
+ TargetTrackingScalingPolicyConfiguration: tttConfig
47518
+ };
47519
+ } catch (err) {
47520
+ if (strictFor(indexName !== void 0 ? "GlobalSecondaryIndexes" : scalableDimension.includes("Write") ? "WriteProvisionedThroughputSettings" : "Replicas")) throw err;
47521
+ this.logger.debug(`Could not read application-autoscaling settings for ${resourceId} (${scalableDimension}): ${describeAwsFailure(err).detail}`);
47522
+ return null;
47523
+ }
47524
+ }
47525
+ async function importResource(input) {
47526
+ const explicit = resolveExplicitPhysicalId(input, "TableName");
47527
+ if (explicit) try {
47528
+ const resp = await this.dynamoDBClient.send(new DescribeTableCommand({ TableName: explicit }));
47529
+ return {
47530
+ physicalId: explicit,
47531
+ attributes: definedAttributes({
47532
+ Arn: resp.Table?.TableArn,
47533
+ TableId: resp.Table?.TableId,
47534
+ StreamArn: resp.Table?.LatestStreamArn,
47535
+ TableName: resp.Table?.TableName ?? explicit
47536
+ })
47537
+ };
47538
+ } catch (err) {
47539
+ if (err instanceof ResourceNotFoundException$1) return null;
47540
+ throw err;
47541
+ }
47542
+ return null;
47543
+ }
47544
+ function writtenReplicaTags(afterOwnWrite, replicaArn, declaredReplica) {
47545
+ if (!afterOwnWrite) return void 0;
47546
+ const written = takeTagWrite("AWS::DynamoDB::GlobalTable", replicaArn);
47547
+ return declaredReplica === void 0 ? void 0 : written;
47548
+ }
47549
+ function settleReplicaTags(listTags, written, logicalId) {
47550
+ return settleWrittenTags(listTags, listTags, written, this.tagsBaselineRereadDelaysMs, () => warnUnsettledMember(this.logger, logicalId, "AWS::DynamoDB::GlobalTable", "Tags"));
47551
+ }
47552
+
46032
47553
  // src/provisioning/providers/dynamodb-globaltable/read.ts
46033
47554
  async function isSameResource(journaledPhysicalId, record, resourceType, context) {
46034
47555
  if (resourceType !== "AWS::DynamoDB::GlobalTable") return "unknown";
@@ -46125,7 +47646,7 @@ async function unsettledInTransition(physicalId, _logicalId, _resourceType, name
46125
47646
  return names;
46126
47647
  }
46127
47648
  }
46128
- async function readCurrentState(physicalId, _logicalId, _resourceType, properties, context) {
47649
+ async function readCurrentState(physicalId, logicalId, _resourceType, properties, context) {
46129
47650
  const afterOwnWrite = context?.afterOwnWrite === true;
46130
47651
  try {
46131
47652
  const table = (await this.dynamoDBClient.send(new DescribeTableCommand({ TableName: physicalId }))).Table;
@@ -46185,21 +47706,23 @@ async function readCurrentState(physicalId, _logicalId, _resourceType, propertie
46185
47706
  if (typeof protection === "boolean") entry["DeletionProtectionEnabled"] = protection;
46186
47707
  if (typeof disassociationProtection === "boolean" && declaredReplica?.["DisassociationProtectionEnabled"] !== void 0) entry[DISASSOCIATION_PROTECTION_KEY] = disassociationProtection;
46187
47708
  await this.readReplicaPolicies(client, tableNameForSubs, regionLabel, replicaArn, streamArn, declaredReplica, afterOwnWrite, entry);
46188
- if (replicaArn) try {
46189
- const tagsResp = await client.send(new ListTagsOfResourceCommand({ ResourceArn: replicaArn }));
46190
- entry["Tags"] = normalizeAwsTagsToCfn(tagsResp.Tags);
46191
- } catch (tagErr) {
46192
- if (strictFor("Replicas") && !(tagErr instanceof ResourceNotFoundException$1)) throw tagErr;
46193
- if (tagErr instanceof ResourceNotFoundException$1) {
46194
- if (isLocal) throw tagErr;
46195
- this.logger.debug(`Cross-region replica ${regionLabel} returned RNF on ListTagsOfResource; omitting Tags`);
46196
- entry["Tags"] = [];
46197
- } else {
46198
- this.logger.warn(`Could not fetch tags for DynamoDB GlobalTable ${tableNameForSubs} in ${regionLabel}: ${describeAwsFailure(tagErr).detail}`);
46199
- entry["Tags"] = [];
47709
+ if (replicaArn) {
47710
+ const listTags = async () => normalizeAwsTagsToCfn((await client.send(new ListTagsOfResourceCommand({ ResourceArn: replicaArn }))).Tags);
47711
+ const tagsDeclared = writtenReplicaTags(afterOwnWrite, replicaArn, declaredReplica);
47712
+ try {
47713
+ entry["Tags"] = tagsDeclared === void 0 ? await listTags() : await this.settleReplicaTags(listTags, tagsDeclared, logicalId);
47714
+ } catch (tagErr) {
47715
+ if (strictFor("Replicas") && !(tagErr instanceof ResourceNotFoundException$1)) throw tagErr;
47716
+ if (tagErr instanceof ResourceNotFoundException$1) {
47717
+ if (isLocal) throw tagErr;
47718
+ this.logger.debug(`Cross-region replica ${regionLabel} returned RNF on ListTagsOfResource; omitting Tags`);
47719
+ entry["Tags"] = [];
47720
+ } else {
47721
+ this.logger.warn(`Could not fetch tags for DynamoDB GlobalTable ${tableNameForSubs} in ${regionLabel}: ${describeAwsFailure(tagErr).detail}`);
47722
+ entry["Tags"] = [];
47723
+ }
46200
47724
  }
46201
- }
46202
- else entry["Tags"] = [];
47725
+ } else entry["Tags"] = [];
46203
47726
  if (billingMode === "PROVISIONED") {
46204
47727
  const replicaAutoScalingClient = isLocal ? void 0 : this.getRegionalAutoScalingClient(regionLabel);
46205
47728
  const readAutoScaling = await this.readAutoScalingSettings(tableNameForSubs, "dynamodb:table:ReadCapacityUnits", replicaAutoScalingClient);
@@ -46288,336 +47811,6 @@ async function readCurrentState(physicalId, _logicalId, _resourceType, propertie
46288
47811
  }
46289
47812
  }
46290
47813
 
46291
- // src/provisioning/dynamodb-stream-members.ts
46292
- const STREAM_SPECIFICATION_KEY = "StreamSpecification";
46293
- const STREAM_POLICY_KEY = "ResourcePolicy";
46294
- const STREAM_TAGS_KEY = "Tags";
46295
- const POLICY_PATH = `${STREAM_SPECIFICATION_KEY}.${STREAM_POLICY_KEY}`;
46296
- const TAGS_PATH = `${STREAM_SPECIFICATION_KEY}.${STREAM_TAGS_KEY}`;
46297
- function isPlainObject$2(value) {
46298
- return typeof value === "object" && value !== null && !Array.isArray(value);
46299
- }
46300
- function refusalOf(guard) {
46301
- try {
46302
- guard();
46303
- return;
46304
- } catch (error) {
46305
- return describeAwsFailure(error).detail;
46306
- }
46307
- }
46308
- function blockMembers(block) {
46309
- return isPlainObject$2(block) ? block : {};
46310
- }
46311
- function readStreamPolicy(block) {
46312
- const value = blockMembers(block)[STREAM_POLICY_KEY];
46313
- if (value === void 0 || value === null) return { kind: "absent" };
46314
- const containerRefusal = refusalOf(() => requireConfigObject(value, POLICY_PATH));
46315
- if (containerRefusal !== void 0) return {
46316
- kind: "unusable",
46317
- reason: containerRefusal
46318
- };
46319
- const documentPath = `${POLICY_PATH}.PolicyDocument`;
46320
- const document = value["PolicyDocument"];
46321
- if (typeof document === "string") return document.trim() === "" ? {
46322
- kind: "unusable",
46323
- reason: `${documentPath} must not be a blank string`
46324
- } : {
46325
- kind: "usable",
46326
- document
46327
- };
46328
- if (document === void 0 || document === null) return {
46329
- kind: "unusable",
46330
- reason: `${documentPath} is required when ${POLICY_PATH} is declared`
46331
- };
46332
- const documentRefusal = refusalOf(() => requireConfigObject(document, documentPath));
46333
- if (documentRefusal !== void 0) return {
46334
- kind: "unusable",
46335
- reason: documentRefusal
46336
- };
46337
- return {
46338
- kind: "usable",
46339
- document: JSON.stringify(document)
46340
- };
46341
- }
46342
- function readStreamTags(block) {
46343
- const value = blockMembers(block)[STREAM_TAGS_KEY];
46344
- if (value === void 0 || value === null) return { kind: "absent" };
46345
- if (!Array.isArray(value)) return {
46346
- kind: "unusable",
46347
- reason: `${TAGS_PATH} must be an array of {Key, Value} entries`
46348
- };
46349
- const tags = /* @__PURE__ */ new Map();
46350
- for (const [position, entry] of value.entries()) {
46351
- const entryPath = `${TAGS_PATH}[${position}]`;
46352
- const refusal = refusalOf(() => requireConfigObject(entry, entryPath)) ?? configStringRefusal(entry, "Key", "required", entryPath) ?? configStringRefusal(entry, "Value", "", entryPath);
46353
- if (refusal !== void 0) return {
46354
- kind: "unusable",
46355
- reason: refusal
46356
- };
46357
- const { Key: key, Value: tagValue } = entry;
46358
- if (typeof key !== "string") return {
46359
- kind: "unusable",
46360
- reason: `${entryPath}.Key is required`
46361
- };
46362
- tags.set(key, typeof tagValue === "string" ? tagValue : "");
46363
- }
46364
- return {
46365
- kind: "usable",
46366
- tags
46367
- };
46368
- }
46369
- function streamMemberRefusals(block) {
46370
- const refusals = [];
46371
- const policy = readStreamPolicy(block);
46372
- if (policy.kind === "unusable") refusals.push(policy.reason);
46373
- const tags = readStreamTags(block);
46374
- if (tags.kind === "unusable") refusals.push(tags.reason);
46375
- return refusals;
46376
- }
46377
- function planStreamMemberOps(desiredBlock, previousBlock, options, onUnusable) {
46378
- let desiredPolicy = readStreamPolicy(desiredBlock);
46379
- let desiredTags = readStreamTags(desiredBlock);
46380
- if (desiredPolicy.kind === "unusable") onUnusable(desiredPolicy.reason);
46381
- if (desiredTags.kind === "unusable") onUnusable(desiredTags.reason);
46382
- let previousPolicy = readStreamPolicy(previousBlock);
46383
- let previousTags = readStreamTags(previousBlock);
46384
- if (options.freshStream) {
46385
- if (desiredPolicy.kind === "unusable" && previousPolicy.kind === "usable") desiredPolicy = previousPolicy;
46386
- if (desiredTags.kind === "unusable" && previousTags.kind === "usable") desiredTags = previousTags;
46387
- previousPolicy = { kind: "absent" };
46388
- previousTags = { kind: "absent" };
46389
- } else if (options.contentsUnknown === true) {
46390
- previousPolicy = {
46391
- kind: "unusable",
46392
- reason: ""
46393
- };
46394
- previousTags = { kind: "absent" };
46395
- }
46396
- const tagOps = [];
46397
- if (desiredTags.kind !== "unusable") {
46398
- const desired = desiredTags.kind === "usable" ? desiredTags.tags : /* @__PURE__ */ new Map();
46399
- const previous = previousTags.kind === "usable" ? previousTags.tags : /* @__PURE__ */ new Map();
46400
- const keysToRemove = [...previous.keys()].filter((key) => !desired.has(key));
46401
- if (keysToRemove.length > 0) tagOps.push({
46402
- kind: "untag",
46403
- keys: keysToRemove
46404
- });
46405
- const tagsToSet = [...desired].filter(([key, value]) => previous.get(key) !== value).map(([Key, Value]) => ({
46406
- Key,
46407
- Value
46408
- }));
46409
- if (tagsToSet.length > 0) tagOps.push({
46410
- kind: "tag",
46411
- tags: tagsToSet
46412
- });
46413
- }
46414
- const policyPut = desiredPolicy.kind === "usable" && !(previousPolicy.kind === "usable" && samePolicyDocument(previousPolicy.document, desiredPolicy.document));
46415
- const policyDelete = previousPolicy.kind !== "absent" && (desiredPolicy.kind === "absent" || policyPut && tagOps.length > 0);
46416
- const ops = [];
46417
- if (policyDelete) ops.push({ kind: "deletePolicy" });
46418
- ops.push(...tagOps);
46419
- if (policyPut && desiredPolicy.kind === "usable") ops.push({
46420
- kind: "putPolicy",
46421
- document: desiredPolicy.document
46422
- });
46423
- return ops;
46424
- }
46425
- function samePolicyDocument(left, right) {
46426
- if (left === right) return true;
46427
- try {
46428
- return canonicalJson$1(JSON.parse(left)) === canonicalJson$1(JSON.parse(right));
46429
- } catch {
46430
- return false;
46431
- }
46432
- }
46433
- function streamDeclaresPolicy(desiredBlock) {
46434
- return readStreamPolicy(desiredBlock).kind === "usable";
46435
- }
46436
- function streamDeclaresTags(desiredBlock) {
46437
- return readStreamTags(desiredBlock).kind === "usable";
46438
- }
46439
- function reverseMapStreamPolicy(livePolicy, desiredBlock) {
46440
- if (livePolicy === void 0 || livePolicy === "") return void 0;
46441
- const declared = blockMembers(blockMembers(desiredBlock)[STREAM_POLICY_KEY])["PolicyDocument"];
46442
- let parsed;
46443
- try {
46444
- parsed = JSON.parse(livePolicy);
46445
- } catch {
46446
- return { PolicyDocument: livePolicy };
46447
- }
46448
- if (typeof declared !== "string") return { PolicyDocument: parsed };
46449
- let declaredParsed;
46450
- try {
46451
- declaredParsed = JSON.parse(declared);
46452
- } catch {
46453
- return { PolicyDocument: livePolicy };
46454
- }
46455
- return { PolicyDocument: canonicalJson$1(declaredParsed) === canonicalJson$1(parsed) ? declared : livePolicy };
46456
- }
46457
- function streamPolicyMatchesDeclared(livePolicy, desiredBlock) {
46458
- const declared = readStreamPolicy(desiredBlock);
46459
- if (declared.kind !== "usable" || livePolicy === void 0) return false;
46460
- try {
46461
- return canonicalJson$1(JSON.parse(livePolicy)) === canonicalJson$1(JSON.parse(declared.document));
46462
- } catch {
46463
- return false;
46464
- }
46465
- }
46466
- function declaredStreamPolicyMember(desiredBlock) {
46467
- const declared = readStreamPolicy(desiredBlock);
46468
- return declared.kind === "usable" ? reverseMapStreamPolicy(declared.document, desiredBlock) : void 0;
46469
- }
46470
- function declaredStreamTagsMember(desiredBlock) {
46471
- const declared = readStreamTags(desiredBlock);
46472
- return declared.kind === "usable" ? [...declared.tags].map(([Key, Value]) => ({
46473
- Key,
46474
- Value
46475
- })) : void 0;
46476
- }
46477
- function streamTagsMatchDeclared(liveTags, desiredBlock) {
46478
- const declared = readStreamTags(desiredBlock);
46479
- if (declared.kind !== "usable" || liveTags.length !== declared.tags.size) return false;
46480
- return liveTags.every((tag) => declared.tags.get(tag.Key) === tag.Value);
46481
- }
46482
- function canonicalJson$1(value) {
46483
- if (Array.isArray(value)) return `[${value.map(canonicalJson$1).join(",")}]`;
46484
- if (isPlainObject$2(value)) return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson$1(value[key])}`).join(",")}}`;
46485
- return JSON.stringify(value) ?? "null";
46486
- }
46487
-
46488
- // src/provisioning/providers/dynamodb-globaltable/read-support.ts
46489
- async function readReplicaSubSpecs(client, tableName, regionLabel, declaredReplica) {
46490
- const out = {};
46491
- try {
46492
- const ci = await client.send(new DescribeContributorInsightsCommand({ TableName: tableName }));
46493
- const block = reverseMapReplicaContributorInsights(ci.ContributorInsightsStatus, ci.ContributorInsightsMode, declaredReplica?.["ContributorInsightsSpecification"]);
46494
- if (block !== void 0) out["ContributorInsightsSpecification"] = block;
46495
- } catch (err) {
46496
- if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
46497
- this.logger.debug(`Could not read ContributorInsights for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
46498
- }
46499
- try {
46500
- const description = (await client.send(new DescribeContinuousBackupsCommand({ TableName: tableName }))).ContinuousBackupsDescription?.PointInTimeRecoveryDescription;
46501
- const block = reverseMapReplicaPitr(description?.PointInTimeRecoveryStatus, description?.RecoveryPeriodInDays, declaredReplica?.["PointInTimeRecoverySpecification"]);
46502
- if (block !== void 0) out["PointInTimeRecoverySpecification"] = block;
46503
- } catch (err) {
46504
- if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
46505
- this.logger.debug(`Could not read PointInTimeRecovery for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
46506
- }
46507
- try {
46508
- const active = ((await client.send(new DescribeKinesisStreamingDestinationCommand({ TableName: tableName }))).KinesisDataStreamDestinations ?? []).find((d) => d.DestinationStatus === "ACTIVE" || d.DestinationStatus === "ENABLING");
46509
- if (active?.StreamArn) {
46510
- const ksOut = { StreamArn: active.StreamArn };
46511
- if (active.ApproximateCreationDateTimePrecision !== void 0) ksOut["ApproximateCreationDateTimePrecision"] = active.ApproximateCreationDateTimePrecision;
46512
- out["KinesisStreamSpecification"] = ksOut;
46513
- }
46514
- } catch (err) {
46515
- if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
46516
- this.logger.debug(`Could not read KinesisStreamingDestination for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
46517
- }
46518
- return out;
46519
- }
46520
- async function readReplicaPolicies(client, tableName, regionLabel, tableArn, streamArn, declaredReplica, afterOwnWrite, entry) {
46521
- if (declaredReplica === void 0) return;
46522
- const readOne = async (what, arn, container) => {
46523
- if (arn === void 0 || arn === "") return void 0;
46524
- const declaredMember = () => declaredStreamPolicyMember(container);
46525
- let last;
46526
- const read = async () => {
46527
- try {
46528
- last = (await client.send(new GetResourcePolicyCommand({ ResourceArn: arn }))).Policy;
46529
- } catch (err) {
46530
- if (!(err instanceof PolicyNotFoundException)) throw err;
46531
- last = void 0;
46532
- }
46533
- return last;
46534
- };
46535
- try {
46536
- let live = await read();
46537
- for (const delayMs of afterOwnWrite ? this.policyRereadDelaysMs : []) {
46538
- if (streamPolicyMatchesDeclared(live, container)) break;
46539
- await new Promise((resolve) => setTimeout(resolve, delayMs));
46540
- live = await read();
46541
- }
46542
- if (afterOwnWrite && !streamPolicyMatchesDeclared(live, container)) {
46543
- this.logger.debug(safeMsg`Kept the declared ${what} of the ${regionLabel} replica of ${tableName} in the baseline captured after its write: the read never settled on it`);
46544
- return declaredMember();
46545
- }
46546
- return reverseMapStreamPolicy(live, container);
46547
- } catch (err) {
46548
- if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
46549
- this.logger.debug(safeMsg`Could not read the ${what} of the ${regionLabel} replica of ${tableName}: ${describeAwsFailure(err).detail}`);
46550
- if (afterOwnWrite && (last !== void 0 && last !== "" || isThrottlingError(err) || isTransientServerError(err) || isAmbiguousOutcomeError(err) || err instanceof ResourceNotFoundException$1)) return declaredMember();
46551
- return;
46552
- }
46553
- };
46554
- if (readTablePolicy(declaredReplica).kind === "usable") {
46555
- const member = await readOne("ResourcePolicy", tableArn, declaredReplica);
46556
- if (member !== void 0) entry["ResourcePolicy"] = member;
46557
- }
46558
- if (readStreamPolicy$1(declaredReplica).kind === "usable") {
46559
- const member = await readOne("stream ResourcePolicy", streamArn, declaredReplica["ReplicaStreamSpecification"]);
46560
- if (member !== void 0) entry["ReplicaStreamSpecification"] = { ResourcePolicy: member };
46561
- }
46562
- }
46563
- async function readAutoScalingSettings(tableName, scalableDimension, client, indexName) {
46564
- const resourceId = autoScalingResourceId(tableName, indexName);
46565
- try {
46566
- const asClient = client ?? new ApplicationAutoScalingClient({
46567
- ...ambientClientDefaults(),
46568
- region: await this.dynamoDBClient.config.region() ?? ""
46569
- });
46570
- const targets = (await asClient.send(new DescribeScalableTargetsCommand({
46571
- ServiceNamespace: "dynamodb",
46572
- ResourceIds: [resourceId],
46573
- ScalableDimension: scalableDimension
46574
- }))).ScalableTargets ?? [];
46575
- if (targets.length === 0) return null;
46576
- const target = targets[0];
46577
- if (target.MinCapacity === void 0 || target.MaxCapacity === void 0) return null;
46578
- const targetTracking = ((await asClient.send(new DescribeScalingPoliciesCommand({
46579
- ServiceNamespace: "dynamodb",
46580
- ResourceId: resourceId,
46581
- ScalableDimension: scalableDimension
46582
- }))).ScalingPolicies ?? []).find((p) => p.PolicyType === "TargetTrackingScaling");
46583
- if (!targetTracking) return null;
46584
- const cfg = targetTracking.TargetTrackingScalingPolicyConfiguration;
46585
- if (!cfg || cfg.TargetValue === void 0) return null;
46586
- const tttConfig = { TargetValue: cfg.TargetValue };
46587
- if (cfg.DisableScaleIn !== void 0) tttConfig["DisableScaleIn"] = cfg.DisableScaleIn;
46588
- if (cfg.ScaleInCooldown !== void 0) tttConfig["ScaleInCooldown"] = cfg.ScaleInCooldown;
46589
- if (cfg.ScaleOutCooldown !== void 0) tttConfig["ScaleOutCooldown"] = cfg.ScaleOutCooldown;
46590
- return {
46591
- MinCapacity: target.MinCapacity,
46592
- MaxCapacity: target.MaxCapacity,
46593
- TargetTrackingScalingPolicyConfiguration: tttConfig
46594
- };
46595
- } catch (err) {
46596
- if (strictFor(indexName !== void 0 ? "GlobalSecondaryIndexes" : scalableDimension.includes("Write") ? "WriteProvisionedThroughputSettings" : "Replicas")) throw err;
46597
- this.logger.debug(`Could not read application-autoscaling settings for ${resourceId} (${scalableDimension}): ${describeAwsFailure(err).detail}`);
46598
- return null;
46599
- }
46600
- }
46601
- async function importResource(input) {
46602
- const explicit = resolveExplicitPhysicalId(input, "TableName");
46603
- if (explicit) try {
46604
- const resp = await this.dynamoDBClient.send(new DescribeTableCommand({ TableName: explicit }));
46605
- return {
46606
- physicalId: explicit,
46607
- attributes: definedAttributes({
46608
- Arn: resp.Table?.TableArn,
46609
- TableId: resp.Table?.TableId,
46610
- StreamArn: resp.Table?.LatestStreamArn,
46611
- TableName: resp.Table?.TableName ?? explicit
46612
- })
46613
- };
46614
- } catch (err) {
46615
- if (err instanceof ResourceNotFoundException$1) return null;
46616
- throw err;
46617
- }
46618
- return null;
46619
- }
46620
-
46621
47814
  // src/provisioning/providers/dynamodb-globaltable/drift.ts
46622
47815
  function getDriftUnknownPaths(_resourceType, properties) {
46623
47816
  const paths = ["TableType"];
@@ -47060,6 +48253,10 @@ var DynamoDBGlobalTableProvider = class {
47060
48253
  readReplicaPolicies(...args) {
47061
48254
  return readReplicaPolicies.call(this, ...args);
47062
48255
  }
48256
+ tagsBaselineRereadDelaysMs = TAGS_BASELINE_REREAD_DELAYS_MS;
48257
+ settleReplicaTags(...args) {
48258
+ return settleReplicaTags.call(this, ...args);
48259
+ }
47063
48260
  readAutoScalingSettings(...args) {
47064
48261
  return readAutoScalingSettings.call(this, ...args);
47065
48262
  }
@@ -49828,7 +51025,7 @@ async function updateInPlace(engine, { changedProperties, noEchoOnlyChangedPrope
49828
51025
  }
49829
51026
  const dischargedByReplacement = result.wasReplaced === true && result.physicalId !== currentResource.physicalId;
49830
51027
  const keepsParameterRefusal = !dischargedByReplacement && hasUnverifiableParameterRefusal(currentResource);
49831
- const carriedAttributes = result.attributes ?? (result.wasReplaced ? void 0 : currentResource.attributes);
51028
+ const carriedAttributes = attributesAfterUpdate(resourceType, currentResource.attributes, result, (key) => engine.logger.warn(differingIdentityWarning(logicalId, resourceType, key)));
49832
51029
  registerNoEchoAttributes(engine.secretsRun, engine.maskingDeps(), logicalId, {
49833
51030
  ...carriedAttributes && { attributes: carriedAttributes },
49834
51031
  ...result.noEchoAttributes === true && { noEchoAttributes: true },
@@ -50831,6 +52028,14 @@ async function provisionCreateUpdateNode(run, createUpdateExecutor, enqueueLostC
50831
52028
  ...journaledUpdatePolicyField(change.changeType, engine.options.updatePolicy, template, logicalId, engine.resolvedUpdatePolicies.get(logicalId))
50832
52029
  };
50833
52030
  failedOperations.push(failedOp);
52031
+ const deadRecord = newResources[logicalId];
52032
+ if (change.changeType === "UPDATE" && engine.replacementRun.oldDeletedBeforeCreate.has(logicalId) && deadRecord !== void 0) {
52033
+ const attributes = replaceDeadIdentity(deadRecord.resourceType, deadRecord.attributes, previousState?.attributes, markedCreatedId === deadRecord.physicalId ? createdResourceIdentityBeforeFailure(provisionError, logicalId, change.resourceType) : void 0);
52034
+ if (attributes !== deadRecord.attributes) newResources[logicalId] = {
52035
+ ...deadRecord,
52036
+ ...attributes && { attributes }
52037
+ };
52038
+ }
50834
52039
  const heldNow = newResources[logicalId];
50835
52040
  if (attemptedGeneration !== void 0 && heldNow !== void 0) newResources[logicalId] = withNameGenerationReached(heldNow, logicalId, attemptedGeneration);
50836
52041
  let replacementOrphanOp;
@@ -53280,5 +54485,5 @@ var DeployEngine = class {
53280
54485
  }
53281
54486
  };
53282
54487
 
53283
- export { sendTtlWaitingOutRateLimit as $, getReadOnlyPropertyPaths as $a, findSdkUnwiredProperties as $c, secretNamePrintingBag as $i, parseAssetManifestBody as $l, sgProtocolKey as $n, referenceProvenanceOf as $o, reachableDivergentParameters as $r, malformedScrubResourceEntriesRefusalMessage as $s, displacedPhysicalIdShown as $t, recordedProtectionEvidence as A, responsePresignClient as Aa, refuseMalformedOutputs as Ac, isSupersededResourceRecord as Ai, renderNestedTemplateTreeDefect as Al, findDestructiveChanges as An, regionLessSecretName as Ao, replacementNeverSwapped as Ar, maskedPropertyFingerprintsOf as As, S3_AUTO_DELETE_OBJECTS_TAG as At, declaredStreamTagsMember as B, localCustomResourceCommand as Ba, refuseMalformedResourcesForExport as Bc, red as Bi, buildAssetRedirectMap as Bl, differingRemedy as Bn, cfnRefValueFromPhysicalId as Bo, removeProtectionTypeList as Br, malformedOrphanRecordsWarning as Bs, sameMove as Bt, pendingMovesOutOf as C, ProviderRegistry as Ca, repairMalformedOrphansForReadOnly as Cc, replacedDeleteFailureVerdict as Ci, isSecretValuedAttribute as Cl, NOECHO_MAC_KEY_ALIAS as Cn, AWS_CREDENTIAL_ENV_KEYS as Co, seedsDeleteFirstGuard as Cr, isWarmThroughputDecrease as Cs, INDEX_SETTLE_POLL_INTERVAL_MS as Ct, describeFileReadFailure as Cu, findServiceTokenRefusals as D, CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID as Da, malformedOutputsRefusalMessage as Dc, findNestedStackTypeChanges as Di, findNestedTemplateTreeDefect as Dl, noEchoMacVerdict as Dn, classifyRecordedSecretRegion as Do, planFailedOps as Dr, getTopLevelKeysHoldingUnreadableCreateOnly as Ds, relayedIndexBusyDelete as Dt, resolveAssemblyPath as Du, deferredServiceTokenWarning as E, wouldReturnToSdkProvider as Ea, malformedLocalOutputsWarning as Ec, withPreviousPolicies as Ei, missingStateBucketRemedy as El, noEchoMacParametersOf as En, envCredentialsAreAssumedRole as Eo, isReplacementOrphan as Er, getSettledWriteOnlyPropertyPaths as Es, maskedLogger as Et, renderAssemblyPathEscape as Eu, readProtection as F, withPrintingSecrets as Fa, malformedRenderedContainersWarning as Fc, withoutSuperseded as Fi, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as Fl, rollbackOrphanIds as Fn, s3BucketWebsiteUrl as Fo, REDACTED_DELETE_ADDRESS_SKIP_REASON as Fr, declaresNoEcho as Fs, readRefactorMarker as Ft, streamDeclaresTags as G, CloudControlProvider as Ga, withheldAccountClause as Gc, noEchoParameterNamesOf as Gi, isDefaultBootstrapRepoName as Gl, propertiesChangedReason as Gn, parseWebACLArn as Go, retiredAfterRollback as Gr, refuseMalformedOrphansForOrphan as Gs, chunks as Gt, readStreamPolicy as H, setLocalCustomResourceRuntimeEnabled as Ha, repairMalformedResourcesForReadOnly as Hc, noEchoAttributeNamesOf as Hi, createLazyAssetModeContext as Hl, looselyEqual as Hn, refStateLookupFromResource as Ho, nameGenerationCarriedFrom as Hr, previewableOrphanRecords as Hs, macWriteOnlyKeys as Ht, DynamoDBGlobalTableProvider as I, NO_LOCAL_CUSTOM_RESOURCES_FLAG as Ia, malformedResourcesWarning as Ic, bold as Ii, purgeNoncurrentKeyVersions as Il, withMovedTo as In, coerceParameterTypedValue as Io, isRedactedRecordedValue as Ir, maskedPropertyFingerprint as Is, readRefactorMarkerOnce as It, streamTagsMatchDeclared as J, UNSPECIFIED_SKIP_REASON as Ja, displayLogicalId as Jc, completedReplayEntries as Ji, redirectFileAsset as Jl, siblingOwnedRevertDesired as Jn, keepHeldTokenProvenance as Jo, withNameGenerationReached as Jr, unreadableOrphanRecords as Js, withApiLimit as Jt, streamMemberRefusals as K, waitForGoneAfterDelete as Ka, STATE_RESOURCES_MALFORMED as Kc, withAttemptedItemsMasked as Ki, loadPublishableAssetManifest as Kl, proposeRenames as Kn, extractGetAttRefs as Ko, retiredNameGenerationsAfter as Kr, repairMalformedOrphanRecordsForReadOnly as Ks, isAccessDeniedError as Kt, STREAM_POLICY_KEY as L, customResourceStackName as La, malformedStateRefusalMessage as Lc, cyan as Li, decodeListingKey as Ll, changedReferenceInDiff as Ln, isUnboundTemplateParameter as Lo, redactedDeleteAddressFields as Lr, deployRefusesOrphanRowsReason as Ls, refactorMarkerMovesOf as Lt, PROTECTION_PROPERTY_BY_TYPE as M, readsNoEchoDeleteValues as Ma, repairMalformedOutputsForReadOnly as Mc, supersededHeldByOtherTypeWarning as Mi, SSM_PARAMETER_VALUE_PREFIX as Ml, findRefactorHints as Mn, s3BucketDomainName as Mo, computeImplicitDeleteEdges as Mr, parameterInputsFor as Ms, isTruthyCfnBoolean as Mt, isProtectionValueActive as N, isCustomResourceType as Na, STATE_REGION_DIVERGED as Nc, supersededHolderOf as Ni, isListParameterType as Nl, hintSidesOf as Nn, s3BucketDualStackDomainName as No, attemptUsesCompletedCreate as Nr, maskedInputProof as Ns, keptForRetainedRecord as Nt, serviceTokenBlockingReason as O, applyCustomResourceResponseExpiration as Oa, malformedOutputsWarning as Oc, deleteSupersededEntry as Oi, isAbsoluteAssetPath as Ol, noEchoValueMacsOf as On, classifyReplaySecretRegion as Oo, recheckFailedPlan as Or, tryGetTopLevelWriteOnlyProperties as Os, waitForIndexesSettled as Ot, clearBucketRegionCache as Ou, perType as P, getCurrentResourceSecrets as Pa, refuseDivergentRecordRegionForDestroy as Pc, supersededResourcesOf as Pi, ssmResolvedValueType as Pl, movedToHint as Pn, s3BucketRegionalDomainName as Po, readsRegeneratingSecret as Pr, passedParameterClassesOf as Ps, recordRetainedForReadoption as Pt, readTtlSpec as Q, withIndeterminateGuard as Qa, findHandledUnwrittenCreateOnly as Qc, orphanRecordsPrintingBag as Qi, isCfnTemplateAssetPath as Ql, cfnIngressPortValue as Qn, recordedReferenceRegions as Qo, namesAnyDeclaredParameter as Qr, malformedResourceEntriesWarning as Qs, displacedOpClause as Qt, STREAM_TAGS_KEY as R, customResourcesFailedWithoutApp as Ra, refuseMalformedResourcesForDeploy as Rc, gray as Ri, rememberSynthesizedStacks as Rl, changedReferencePath as Rn, parameterTypeMayLoseSecretIdentity as Ro, redactedDeleteAddressSkip as Rr, isReadableOrphanRecord as Rs, refactorMarkerRefusalMessage as Rt, hasPendingMovesOut as S, CC_BROKEN_REASON as Sa, refuseMalformedOrphansForDestroy as Sc, withStackRecords as Si, withStackInstanceIdWithheld as Sl, crossStackReadsForPartialSave as Sn, sendableAssumeRoleCommand as So, planRollback as Sr, coerceWarmThroughput as Ss, DELETE_INDEX_WAIT_PROCEED_NOTE as St, assemblyPathEscape as Su, refusePendingMovesOut as T, isCustomResource as Ta, malformedExportSourceWarning as Tc, resolveReplacementOldType as Ti, stringifyValue as Tl, noEchoMacBinding as Tn, callerEnvCredentials as To, isJournaledOrphan as Tr, toFiniteNumber as Ts, deleteTableWithIndexBusyRetry as Tt, namesTheSameDirectory as Tu, reverseMapStreamPolicy as U, withCustomResourceStack as Ua, JSON_LISTING_HOLE_VALUE as Uc, noEchoComparisonForTemplate as Ui, flattenAssetPlaceholders as Ul, mappingPairs as Un, lacksRecordedRefArn as Uo, nameGenerationHighWaterOf as Ur, refuseMalformedOrphanRecords as Us, readsOnlyNoEchoParameters as Ut, planStreamMemberOps as V, localCustomResourceRuntimeActive as Va, refuseMalformedState as Vc, yellow as Vi, createAssetRedirectResolver as Vl, isPairableType as Vn, isStalePlaceholderArnAttribute as Vo, orphanNeedsIdentity as Vr, malformedOrphanRowsKeptWarning as Vs, updateRefactorMarker as Vt, streamDeclaresPolicy as W, waitForLambdaFunctionActive as Wa, accountArgs as Wc, noEchoExactEchoLeavesOf as Wi, isDefaultBootstrapBucketName as Wl, parseMappingFile as Wn, lacksRecordedTableArn as Wo, nameScopeOf as Wr, refuseMalformedOrphanRecordsForDestroy as Ws, formatResourceLine as Wt, isTtlRateLimited as X, deleteLeftInPlace as Xa, hasReadableResources as Xc, maskEventTextWithBoundBags as Xi, AssetManifestLoader as Xl, siblingOwnedSgRuleIdentities as Xn, recordedOutputReferenceRegions as Xo, inheritProducerRegions as Xr, malformedLocalResourceEntriesWarning as Xs, resolvePendingCloudControlRequests as Xt, isTtlAlreadyDisabled as Y, deleteIndeterminateGuards as Ya, hasReadableOutputs as Yc, journaledOrphanPrintingBag as Yi, rewriteTemplateAssetReferences as Yl, stripSiblingOwnedParentMembers as Yn, outputReferenceProvenanceOf as Yo, getCurrentProducerRegions as Yr, isReadableResourceEntry as Ys, pendingRequestCount as Yt, planTimeToLive as Z, deleteSkipReason as Za, findActionableSdkUnwired as Zc, namingSecretsWithRecordedNoEcho as Zi, getDockerImageBySourceHash as Zl, withoutSiblingOwnedSgRules as Zn, recordedProvenanceOf as Zo, computeParameterTaint as Zr, malformedLocalResourcesWarning as Zs, NESTED_PENDING_PARENT_REASON as Zt, conditionFingerprint as _, collectManagedPolicyArnsAttachedBySiblings as _a, UNREADABLE_ORPHANS_CONTAINER_ROW as _c, DEFAULT_RESOURCE_WARN_AFTER_MS as _i, applyCrossPrefixScan as _l, makeForeignHolderScan as _n, assertFlagRoleArn as _o, earliestDefined as _r, MULTI_REGION_RECREATE_BLOCKED_TYPES as _s, beginDeleteWait as _t, hasOwnKey as _u, scanActiveConsumers as a, extractDeploymentEventError as aa, refuseMalformedResourceEntriesForImportSave as ac, secretBearingStateKeyWarning as ai, hasNoCloudControlHandlers as al, revertedNestedRowIds as an, poisonRenderedSpellingsCollidingIn as ao, recordAfterRollbackUpdate as ar, carriesDynamicReference as as, CONTRIBUTOR_INSIGHTS_KEY as at, buildDenyExternalAccessPolicy as au, readRecordedConditionVerdicts as b, withoutSiblingAttachedArns as ba, malformedOrphansWarning as bc, destroyStackRecordsView as bi, isNotImplemented as bl, DeploymentEventsReader as bn, isIamRoleArn as bo, withCreateTokenLedger as br, renderStatefulReason as bs, resolveDynamoDbDeleteBudgetClock as bt, ownValue as bu, nestedSsmNameDeferredNote as c, ccRoutedFinalSnapshotError as ca, unreadableResourceEntries as cc, exportNameNoEchoParameters as ci, S3StateBackend as cl, getCurrentNestedStackContext as cn, APPSYNC_APIKEY_ARN_RESOURCE_PATH as co, calculateResourceDrift as cr, namesRecreatedParent as cs, planContributorInsightsOp as ct, getBootstrapMarkerKey as cu, slashedSsmNameHealAdoptedNote as d, isFinalSnapshotError as da, refuseMalformedResourceProperties as dc, noEchoParameterValueSeed as di, readOnlyStateVersionOf as dl, dropFailedCommands as dn, secretSegmentsOfState as do, undeclaredEmptyObservedKeys as dr, markNewValueKnownAfterDeploy as ds, reverseMapIndexContributorInsights as dt, validateAssetBucketName as du, secretNamePrintingBags as ea, refuseMalformedResourceAttributesForOrphan as ec, resourcesNamingDeclaredParameter as ei, unwrittenCreateOnlyReplacement as el, dropSettledNestedJournals as en, isWaitAbandonedError as eo, canonicalizeIpProtocolValue as er, referenceTokensIn as es, planVectorIndexUpdates as et, resolveFileAssetSourcePath as eu, slashedSsmNameHealNote as f, refusesFinalSnapshot as fa, refuseMalformedResourcePropertiesForDestroy as fc, collectDeclaredOutputNames as fi, hasReasonlessBaselineRefusal as fl, dropFailedHint as fn, withSecretPhysicalIdsMaskedInState as fo, verbatimEchoDriftKeys as fr, replacementSidesForLog as fs, reverseMapTableContributorInsights as ft, validateContainerRepoName as fu, makeCanonicalizePropertiesFn as g, collectGroupsAddedBySiblings as ga, repairMalformedResourcePropertiesForReadOnly as gc, DEFAULT_RESOURCE_TIMEOUT_MS as gi, CrossPrefixScanCache as gl, sameJournaledOrphans as gn, applyRoleArnIfSet as go, replacementCreateRoutesToCloudControl as gr, shownType as gs, DYNAMODB_DELETE_POLL_COST_MS as gt, defineOwnKey as gu, inheritedProvenanceForChildDiff as h, buildFinalSnapshotIdentifier as ha, refuseMalformedResourcePropertiesForOrphan as hc, bindingSkippedOutputs as hi, CrossPrefixReadError as hl, loadJournaledOrphans as hn, refuseUnreadableCdkCrossAccountRefs as ho, findUpdatePolicyReplacementRefusals as hr, isPlainReferenceTo as hs, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as ht, getCdkdContainerRepoName as hu, mergeNoChangeOutputs as i, storedSecretNameNeedles as ia, refuseMalformedResourceEntriesForImport as ic, secretBearing as ii, NO_CC_HANDLERS_REASON as il, revertNestedChildFromJournal as in, isAlwaysLiveAttribute as io, buildReadCurrentStateContext as ir, isNamelessDynamicReferenceError as is, vectorIndexesShapeDetail as it, ensureAssetStorage as iu, recordedProtectionNote as j, TemplateNoEchoReresolver as ja, refuseMalformedOutputsForDestroy as jc, supersededAfterRollback as ji, templateIdentity as jl, formatDestructiveChange as jn, s3BucketArn as jo, IMPLICIT_DELETE_DEPENDENCIES as jr, movedMaskedProperties as js, hasCdkAutoDeleteTag as jt, diffSecurity as k, customResourceResponseExpirationWarning as ka, refuseMalformedNestedChildOutputs as kc, holdsSupersededResources as ki, listNestedTemplateRows as kl, constructPathOf as kn, producerRegionsFromState as ko, recordUnderIdIsNotOwn as kr, inputFingerprinter as ks, ECR_AUTO_DELETE_IMAGES_TAG as kt, resolveBucketRegion as ku, nestedSsmNameRowNote as l, ccRoutedInstanceTakesNoSnapshot as la, malformedDriftResourcePropertiesWarning as lc, exportNameSecretExposure as li, splitImportedOps as ll, withNestedStackContext as ln, maskedSecretSegment as lo, equalModuloMarkedMask as lr, INTRINSIC_KEYS as ls, planIndexContributorInsightsOps as lt, parseBootstrapMarker as lu, crossStackOutputProvenanceSource as m, createPreDeleteFinalSnapshot as ma, refuseMalformedResourcePropertiesForExport as mc, isExportAliasCollision as mi, rebuildClientForBucketRegion as ml, journaledOrphanLines as mn, producerLookupOver as mo, updatePartialReason as mr, findReplacedReadersOfRecreateTargets as ms, DYNAMODB_DELETE_DEADLINE_MARGIN_MS as mt, getCdkdAssetBucketName as mu, isSecretBearingReferenceString as n, secretNamedRecordNeedles as na, refuseMalformedResourceEntriesForDeploy as nc, displayTextOrWithheld as ni, withoutSdkUnwiredProperties as nl, nestedChildStackName as nn, IntrinsicFunctionResolver as no, replayRollback as nr, isImpossibleEmptyStoredAttribute as ns, vectorIndexesForCreate as nt, warnWholeAssemblyAsSource as nu, inRunStackKey as o, ATOMIC_FINAL_SNAPSHOT_TYPES as oa, refuseMalformedResourceEntriesForOrphan as oc, secretSafeKeyDisplay as oi, PROPERTY_COVERAGE_BY_TYPE as ol, withNestedRevertRun as on, stackIdTailOf as oo, settleUnsettledPrevious as or, keepsSecretReferenceToken as os, contributorInsightsRefusals as ot, assertAssetBucketRegion as ou, slashedSsmNameHealPendingNote as p, unsupportedFinalSnapshotError as pa, refuseMalformedResourcePropertiesForDrift as pc, collectPublishedOutputNames as pi, hasUnverifiableParameterRefusal as pl, isHandledOrphan as pn, resolveDynamicReferences as po, updatePartialMessage as pr, siblingsOf as ps, stripIndexContributorInsights as pt, BOOTSTRAP_MARKER_PREFIX as pu, streamPolicyMatchesDeclared as q, RollbackInlinePolicyWriters as qa, UNREADABLE_RESOURCES_MAP_ROW as qc, createReadOnlyAttributeHealerFactory as qi, redirectDockerAsset as ql, referencedLogicalIds as qn, promoteInPlaceAttributeDependents as qo, retiredNameGenerationsLeaving as qr, unpreviewableOrphanRecords as qs, lookupEachName as qt, keptWholeReasonText as r, stateSecretNameNeedles as ra, refuseMalformedResourceEntriesForDestroy as rc, exportAliasCollisionScrubWarning as ri, withoutUnwrittenSdkUnwiredProperties as rl, recordDisplacedSkips as rn, isSelectOutOfBounds as ro, DELETED_RESOURCE_REMEDY as rr, carriesFetchableDynamicReference as rs, vectorIndexesSettled as rt, AssetModeResolver as ru, checkNestedSsmNames as s, PRE_DELETE_SNAPSHOT_TYPES as sa, repairMalformedResourceEntriesForReadOnly as sc, carriedExportAliasExposure as si, TemplateParser as sl, collectNestedChildUnaddressed as sn, isSettledInstanceState as so, withUnprovenUnsettled as sr, withSharedDrainBudget as ss, indexDeclaresContributorInsights as st, isCrossRegionRedirect as su, DeployEngine as t, secretNamedAttributeNamesOf as ta, refuseMalformedResourceEntries as tc, WITHHELD_NAME_DISPLAY as ti, withoutAcceptedSdkUnwiredProperties as tl, getNestedRevertRun as tn, markWaitAbandoned as to, replayFailedOperations as tr, getAccountInfo as ts, readbackVectorIndexes as tt, warnAbsoluteAssetPath as tu, healSlashedSsmParameterNames as u, effectiveDeletionPolicy as ua, malformedResourcePropertiesWarning as uc, isWholeDynamicReferenceValue as ui, isKnownTokenFreeState as ul, deleteJournaledOrphans as un, secretPhysicalIdSegment as uo, equalModuloMask as ur, containsIntrinsic as us, readContributorInsightsSpec as ut, readBootstrapMarkerBody as uu, conditionInputsFrom as v, collectPrincipalsAttachingPolicy as va, hasReadableOrphans as vc, maskingRetryLogger as vi, crossPrefixDeniedWarning as vl, makeSiblingClaimReader as vn, assertSendableRoleArn as vo, ledgerForStack as vr, isStatefulRecreateTargetForReplace as vs, compensateRemovedDeletionProtection as vt, hasPlainPrototype as vu, pendingMovesRefusalMessage as w, ccBrokenReason as wa, malformedExportNamesWarning as wc, snapshotSegmentSurvivors as wi, isSensitiveAttributeName as wl, createNoEchoValueMacs as wn, applyCallerIdentityCredentials as wo, demoteSupersededOrphans as wr, toCfnInteger as ws, TABLE_INDEX_NOUN as wt, displayAssemblyPath as wu, childTemplateLoader as x, withoutSiblingOwned as xa, refuseMalformedOrphans as xc, getStackRecords as xi, stackInstanceIdOf as xl, DeploymentEventsStore as xn, parseIamRoleArn as xo, acquireIdempotencyToken as xr, WARM_THROUGHPUT_MEMBERS as xs, resolveDynamoDbDeleteBudgetMs as xt, absoluteAssemblyPathEscape as xu, parentSuppliedValues as y, isStoredExpression as ya, malformedOrphansRefusalMessage as yc, awaitInFlightSibling as yi, isAccessDenied$1 as yl, planOrphanAdoption as yn, explicitRoleArnOrThrow as yo, reserveStackCreateToken as yr, isStatefulRecreateTargetSync as ys, deleteBudgetKey as yt, nullPrototypeRecord as yu, declaredStreamPolicyMember as z, customResourcesRunWithoutApp as za, refuseMalformedResourcesForDestroy as zc, green as zi, synthesizedStacks as zl, changedReferenceReason as zn, AWS_NO_VALUE as zo, segmentCleanupOptions as zr, malformedOrphanRecordsRefusalMessage as zs, refuseRefactorMarker as zt };
53284
- //# sourceMappingURL=deploy-engine-DwpkRhxS.js.map
54488
+ export { recordTagWrite as $, ProviderRegistry as $a, refuseMalformedResourcePropertiesForDrift as $c, gray as $i, hasUnverifiableParameterRefusal as $l, parseMappingFile as $n, producerLookupOver as $o, redactedDeleteAddressSkip as $r, siblingsOf as $s, formatResourceLine as $t, BOOTSTRAP_MARKER_PREFIX as $u, recordedProtectionEvidence as A, buildFinalSnapshotIdentifier as Aa, refuseMalformedOrphanRecordsForDestroy as Ac, bindingSkippedOutputs as Ai, accountArgs as Al, DeploymentEventsStore as An, differingIdentityWarning as Ao, findUpdatePolicyReplacementRefusals as Ar, lacksRecordedTableArn as As, DELETE_INDEX_WAIT_PROCEED_NOTE as At, isDefaultBootstrapBucketName as Au, declaredStreamTagsMember as B, SNS_DEFAULT_POLICY_ID as Ba, refuseMalformedResourceAttributesForOrphan as Bc, isSupersededResourceRecord as Bi, unwrittenCreateOnlyReplacement as Bl, formatDestructiveChange as Bn, IntrinsicFunctionResolver as Bo, isJournaledOrphan as Br, referenceTokensIn as Bs, isTruthyCfnBoolean as Bt, resolveFileAssetSourcePath as Bu, pendingMovesOutOf as C, ccRoutedFinalSnapshotError as Ca, deployRefusesOrphanRowsReason as Cc, exportNameNoEchoParameters as Ci, malformedStateRefusalMessage as Cl, journaledOrphanLines as Cn, withCustomResourceStack as Co, calculateResourceDrift as Cr, isUnboundTemplateParameter as Cs, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as Ct, decodeListingKey as Cu, findServiceTokenRefusals as D, refusesFinalSnapshot as Da, malformedOrphanRowsKeptWarning as Dc, collectDeclaredOutputNames as Di, refuseMalformedState as Dl, makeSiblingClaimReader as Dn, RecordedIdentityError as Do, verbatimEchoDriftKeys as Dr, isStalePlaceholderArnAttribute as Ds, deleteBudgetKey as Dt, createAssetRedirectResolver as Du, deferredServiceTokenWarning as E, isFinalSnapshotError as Ea, malformedOrphanRecordsWarning as Ec, noEchoParameterValueSeed as Ei, refuseMalformedResourcesForExport as El, makeForeignHolderScan as En, waitForGoneAfterDelete as Eo, undeclaredEmptyObservedKeys as Er, cfnRefValueFromPhysicalId as Es, compensateRemovedDeletionProtection as Et, buildAssetRedirectMap as Eu, readProtection as F, withoutSiblingAttachedArns as Fa, isReadableResourceEntry as Fc, destroyStackRecordsView as Fi, hasReadableOutputs as Fl, noEchoMacParametersOf as Fn, deleteSkipReason as Fo, withCreateTokenLedger as Fr, outputReferenceProvenanceOf as Fs, relayedIndexBusyDelete as Ft, rewriteTemplateAssetReferences as Fu, streamDeclaresTags as G, memberReadFailure as Ga, refuseMalformedResourceEntriesForImportSave as Gc, withoutSuperseded as Gi, hasNoCloudControlHandlers as Gl, withMovedTo as Gn, isSettledInstanceState as Go, replacementNeverSwapped as Gr, carriesDynamicReference as Gs, refactorMarkerMovesOf as Gt, buildDenyExternalAccessPolicy as Gu, readStreamPolicy as H, declaredPolicyDocument as Ha, refuseMalformedResourceEntriesForDeploy as Hc, supersededHeldByOtherTypeWarning as Hi, withoutSdkUnwiredProperties as Hl, hintSidesOf as Hn, isAlwaysLiveAttribute as Ho, planFailedOps as Hr, isImpossibleEmptyStoredAttribute as Hs, recordRetainedForReadoption as Ht, warnWholeAssemblyAsSource as Hu, DynamoDBGlobalTableProvider as I, withoutSiblingOwned as Ia, malformedLocalResourceEntriesWarning as Ic, getStackRecords as Ii, hasReadableResources as Il, noEchoMacVerdict as In, withIndeterminateGuard as Io, acquireIdempotencyToken as Ir, recordedOutputReferenceRegions as Is, waitForIndexesSettled as It, AssetManifestLoader as Iu, streamTagsMatchDeclared as J, settleDeclaredMember as Ja, unreadableResourceEntries as Jc, resolveReplacementOldType as Ji, S3StateBackend as Jl, changedReferenceReason as Jn, maskedSecretSegment as Jo, attemptUsesCompletedCreate as Jr, namesRecreatedParent as Js, sameMove as Jt, getBootstrapMarkerKey as Ju, streamMemberRefusals as K, policyDocumentMatchesDeclared as Ka, refuseMalformedResourceEntriesForOrphan as Kc, replacedDeleteFailureVerdict as Ki, PROPERTY_COVERAGE_BY_TYPE as Kl, changedReferenceInDiff as Kn, APPSYNC_APIKEY_ARN_RESOURCE_PATH as Ko, IMPLICIT_DELETE_DEPENDENCIES as Kr, keepsSecretReferenceToken as Ks, refactorMarkerRefusalMessage as Kt, assertAssetBucketRegion as Ku, STREAM_POLICY_KEY as L, KMS_DEFAULT_KEY_POLICY_ID as La, malformedLocalResourcesWarning as Lc, withStackRecords as Li, findActionableSdkUnwired as Ll, noEchoValueMacsOf as Ln, getReadOnlyPropertyPaths as Lo, planRollback as Lr, recordedProvenanceOf as Ls, ECR_AUTO_DELETE_IMAGES_TAG as Lt, getDockerImageBySourceHash as Lu, PROTECTION_PROPERTY_BY_TYPE as M, collectManagedPolicyArnsAttachedBySiblings as Ma, repairMalformedOrphanRecordsForReadOnly as Mc, DEFAULT_RESOURCE_WARN_AFTER_MS as Mi, STATE_RESOURCES_MALFORMED as Ml, NOECHO_MAC_KEY_ALIAS as Mn, UNSPECIFIED_SKIP_REASON as Mo, earliestDefined as Mr, extractGetAttRefs as Ms, TABLE_INDEX_NOUN as Mt, loadPublishableAssetManifest as Mu, isProtectionValueActive as N, collectPrincipalsAttachingPolicy as Na, unpreviewableOrphanRecords as Nc, maskingRetryLogger as Ni, UNREADABLE_RESOURCES_MAP_ROW as Nl, createNoEchoValueMacs as Nn, deleteIndeterminateGuards as No, ledgerForStack as Nr, promoteInPlaceAttributeDependents as Ns, deleteTableWithIndexBusyRetry as Nt, redirectDockerAsset as Nu, serviceTokenBlockingReason as O, unsupportedFinalSnapshotError as Oa, previewableOrphanRecords as Oc, collectPublishedOutputNames as Oi, repairMalformedResourcesForReadOnly as Ol, planOrphanAdoption as On, RecordedIdentityMismatchError as Oo, updatePartialMessage as Or, refStateLookupFromResource as Os, resolveDynamoDbDeleteBudgetClock as Ot, createLazyAssetModeContext as Ou, perType as P, isStoredExpression as Pa, unreadableOrphanRecords as Pc, awaitInFlightSibling as Pi, displayLogicalId as Pl, noEchoMacBinding as Pn, deleteLeftInPlace as Po, reserveStackCreateToken as Pr, keepHeldTokenProvenance as Ps, maskedLogger as Pt, redirectFileAsset as Pu, isDynamoDBTableArnIn as Q, CC_BROKEN_REASON as Qa, refuseMalformedResourcePropertiesForDestroy as Qc, cyan as Qi, hasReasonlessBaselineRefusal as Ql, mappingPairs as Qn, resolveDynamicReferences as Qo, redactedDeleteAddressFields as Qr, replacementSidesForLog as Qs, licensedNameHolder as Qt, validateContainerRepoName as Qu, STREAM_TAGS_KEY as R, LAMBDA_PERMISSION_STATEMENT_KEYS as Ra, malformedResourceEntriesWarning as Rc, deleteSupersededEntry as Ri, findHandledUnwrittenCreateOnly as Rl, constructPathOf as Rn, isWaitAbandonedError as Ro, seedsDeleteFirstGuard as Rr, recordedReferenceRegions as Rs, S3_AUTO_DELETE_OBJECTS_TAG as Rt, isCfnTemplateAssetPath as Ru, hasPendingMovesOut as S, PRE_DELETE_SNAPSHOT_TYPES as Sa, maskedPropertyFingerprint as Sc, carriedExportAliasExposure as Si, malformedResourcesWarning as Sl, isHandledOrphan as Sn, setLocalCustomResourceRuntimeEnabled as So, withUnprovenUnsettled as Sr, coerceParameterTypedValue as Ss, DYNAMODB_DELETE_DEADLINE_MARGIN_MS as St, purgeNoncurrentKeyVersions as Su, refusePendingMovesOut as T, effectiveDeletionPolicy as Ta, malformedOrphanRecordsRefusalMessage as Tc, isWholeDynamicReferenceValue as Ti, refuseMalformedResourcesForDestroy as Tl, sameJournaledOrphans as Tn, CloudControlProvider as To, equalModuloMask as Tr, AWS_NO_VALUE as Ts, beginDeleteWait as Tt, synthesizedStacks as Tu, reverseMapStreamPolicy as U, efsPolicyMatchesDeclared as Ua, refuseMalformedResourceEntriesForDestroy as Uc, supersededHolderOf as Ui, withoutUnwrittenSdkUnwiredProperties as Ul, movedToHint as Un, poisonRenderedSpellingsCollidingIn as Uo, recheckFailedPlan as Ur, carriesFetchableDynamicReference as Us, readRefactorMarker as Ut, AssetModeResolver as Uu, planStreamMemberOps as V, declaredMemberDocument as Va, refuseMalformedResourceEntries as Vc, supersededAfterRollback as Vi, withoutAcceptedSdkUnwiredProperties as Vl, findRefactorHints as Vn, isSelectOutOfBounds as Vo, isReplacementOrphan as Vr, getAccountInfo as Vs, keptForRetainedRecord as Vt, warnAbsoluteAssetPath as Vu, streamDeclaresPolicy as W, lambdaPermissionMatchesDeclared as Wa, refuseMalformedResourceEntriesForImport as Wc, supersededResourcesOf as Wi, NO_CC_HANDLERS_REASON as Wl, rollbackOrphanIds as Wn, stackIdTailOf as Wo, recordUnderIdIsNotOwn as Wr, isNamelessDynamicReferenceError as Ws, readRefactorMarkerOnce as Wt, ensureAssetStorage as Wu, clearTagWrites as X, attemptedPolicyDocument as Xa, malformedResourcePropertiesWarning as Xc, findNestedStackTypeChanges as Xi, isKnownTokenFreeState as Xl, isPairableType as Xn, secretSegmentsOfState as Xo, REDACTED_DELETE_ADDRESS_SKIP_REASON as Xr, containsIntrinsic as Xs, macWriteOnlyKeys as Xt, readBootstrapMarkerBody as Xu, TAGS_BASELINE_REREAD_DELAYS_MS as Y, warnUnsettledMember as Ya, malformedDriftResourcePropertiesWarning as Yc, withPreviousPolicies as Yi, splitImportedOps as Yl, differingRemedy as Yn, secretPhysicalIdSegment as Yo, readsRegeneratingSecret as Yr, INTRINSIC_KEYS as Ys, updateRefactorMarker as Yt, parseBootstrapMarker as Yu, declaredTagsReadback as Z, policyContentKey as Za, refuseMalformedResourceProperties as Zc, bold as Zi, readOnlyStateVersionOf as Zl, looselyEqual as Zn, withSecretPhysicalIdsMaskedInState as Zo, isRedactedRecordedValue as Zr, markNewValueKnownAfterDeploy as Zs, readsOnlyNoEchoParameters as Zt, validateAssetBucketName as Zu, conditionFingerprint as _, secretNamedRecordNeedles as _a, movedMaskedProperties as _c, displayTextOrWithheld as _i, refuseMalformedOutputsForDestroy as _l, getCurrentNestedStackContext as _n, customResourceStackName as _o, replayRollback as _r, s3BucketArn as _s, planIndexContributorInsightsOps as _t, templateIdentity as _u, scanActiveConsumers as a, noEchoExactEchoLeavesOf as aa, isStatefulRecreateTargetSync as ac, nullPrototypeRecord as ad, nameScopeOf as ai, malformedOrphansRefusalMessage as al, resolvePendingCloudControlRequests as an, classifyHandleUrl as ao, recordedRuleIdOf as ar, isIamRoleArn as as, planTimeToLive as at, isAccessDenied$1 as au, readRecordedConditionVerdicts as b, extractDeploymentEventError as ba, passedParameterClassesOf as bc, secretBearingStateKeyWarning as bi, refuseDivergentRecordRegionForDestroy as bl, dropFailedCommands as bn, localCustomResourceCommand as bo, recordAfterRollbackUpdate as br, s3BucketRegionalDomainName as bs, reverseMapTableContributorInsights as bt, ssmResolvedValueType as bu, nestedSsmNameDeferredNote as c, createReadOnlyAttributeHealerFactory as ca, coerceWarmThroughput as cc, assemblyPathEscape as cd, retiredNameGenerationsLeaving as ci, refuseMalformedOrphansForDestroy as cl, displacedPhysicalIdShown as cn, applyCustomResourceResponseExpiration as co, siblingOwnedSgRuleIdentities as cr, AWS_CREDENTIAL_ENV_KEYS as cs, planVectorIndexUpdates as ct, withStackInstanceIdWithheld as cu, slashedSsmNameHealAdoptedNote as d, maskEventTextWithBoundBags as da, toFiniteNumber as dc, namesTheSameDirectory as dd, inheritProducerRegions as di, malformedExportSourceWarning as dl, nestedChildStackName as dn, TemplateNoEchoReresolver as do, SG_RULE_ID_PATTERN as dr, envCredentialsAreAssumedRole as ds, vectorIndexesSettled as dt, stringifyValue as du, green as ea, findReplacedReadersOfRecreateTargets as ec, getCdkdAssetBucketName as ed, segmentCleanupOptions as ei, refuseMalformedResourcePropertiesForExport as el, chunks as en, ccBrokenReason as eo, propertiesChangedReason as er, refuseUnreadableCdkCrossAccountRefs as es, settleWrittenTags as et, rebuildClientForBucketRegion as eu, slashedSsmNameHealNote as f, namingSecretsWithRecordedNoEcho as fa, getSettledWriteOnlyPropertyPaths as fc, renderAssemblyPathEscape as fd, computeParameterTaint as fi, malformedLocalOutputsWarning as fl, recordDisplacedSkips as fn, readsNoEchoDeleteValues as fo, cfnIngressPortValue as fr, classifyRecordedSecretRegion as fs, vectorIndexesShapeDetail as ft, missingStateBucketRemedy as fu, makeCanonicalizePropertiesFn as g, secretNamedAttributeNamesOf as ga, maskedPropertyFingerprintsOf as gc, WITHHELD_NAME_DISPLAY as gi, refuseMalformedOutputs as gl, collectNestedChildUnaddressed as gn, NO_LOCAL_CUSTOM_RESOURCES_FLAG as go, replayFailedOperations as gr, isUnexposedRecordedIdentity as gs, planContributorInsightsOp as gt, renderNestedTemplateTreeDefect as gu, inheritedProvenanceForChildDiff as h, secretNamePrintingBags as ha, inputFingerprinter as hc, resolveBucketRegion as hd, resourcesNamingDeclaredParameter as hi, refuseMalformedNestedChildOutputs as hl, withNestedRevertRun as hn, withPrintingSecrets as ho, canonicalizeIpProtocolValue as hr, regionLessSecretName as hs, indexDeclaresContributorInsights as ht, listNestedTemplateRows as hu, mergeNoChangeOutputs as i, noEchoComparisonForTemplate as ia, isStatefulRecreateTargetForReplace as ic, hasPlainPrototype as id, nameGenerationHighWaterOf as ii, hasReadableOrphans as il, pendingRequestCount as in, WaitConditionSignalStore as io, stripSiblingOwnedParentMembers as ir, explicitRoleArnOrThrow as is, isTtlRateLimited as it, crossPrefixDeniedWarning as iu, recordedProtectionNote as j, collectGroupsAddedBySiblings as ja, refuseMalformedOrphansForOrphan as jc, DEFAULT_RESOURCE_TIMEOUT_MS as ji, withheldAccountClause as jl, crossStackReadsForPartialSave as jn, RollbackInlinePolicyWriters as jo, replacementCreateRoutesToCloudControl as jr, parseWebACLArn as js, INDEX_SETTLE_POLL_INTERVAL_MS as jt, isDefaultBootstrapRepoName as ju, diffSecurity as k, createPreDeleteFinalSnapshot as ka, refuseMalformedOrphanRecords as kc, isExportAliasCollision as ki, JSON_LISTING_HOLE_VALUE as kl, DeploymentEventsReader as kn, assertRecordedIdentity as ko, updatePartialReason as kr, lacksRecordedRefArn as ks, resolveDynamoDbDeleteBudgetMs as kt, flattenAssetPlaceholders as ku, nestedSsmNameRowNote as l, completedReplayEntries as la, isWarmThroughputDecrease as lc, describeFileReadFailure as ld, withNameGenerationReached as li, repairMalformedOrphansForReadOnly as ll, dropSettledNestedJournals as ln, customResourceResponseExpirationWarning as lo, siblingRecordedSgRuleIds as lr, applyCallerIdentityCredentials as ls, readbackVectorIndexes as lt, isSecretValuedAttribute as lu, crossStackOutputProvenanceSource as m, secretNamePrintingBag as ma, tryGetTopLevelWriteOnlyProperties as mc, clearBucketRegionCache as md, reachableDivergentParameters as mi, malformedOutputsWarning as ml, revertedNestedRowIds as mn, getCurrentResourceSecrets as mo, sgProtocolKey as mr, producerRegionsFromState as ms, contributorInsightsRefusals as mt, isAbsoluteAssetPath as mu, isSecretBearingReferenceString as n, yellow as na, shownType as nc, defineOwnKey as nd, orphanNeedsIdentity as ni, repairMalformedResourcePropertiesForReadOnly as nl, lookupEachName as nn, wouldReturnToSdkProvider as no, referencedLogicalIds as nr, assertFlagRoleArn as ns, takeTagWrite as nt, CrossPrefixScanCache as nu, inRunStackKey as o, noEchoParameterNamesOf as oa, renderStatefulReason as oc, ownValue as od, retiredAfterRollback as oi, malformedOrphansWarning as ol, NESTED_PENDING_PARENT_REASON as on, evaluateSignals as oo, sgRuleOwnershipIdentity as or, parseIamRoleArn as os, readTtlSpec as ot, isNotImplemented as ou, slashedSsmNameHealPendingNote as p, orphanRecordsPrintingBag as pa, getTopLevelKeysHoldingUnreadableCreateOnly as pc, resolveAssemblyPath as pd, namesAnyDeclaredParameter as pi, malformedOutputsRefusalMessage as pl, revertNestedChildFromJournal as pn, isCustomResourceType as po, recordedSgRuleId as pr, classifyReplaySecretRegion as ps, CONTRIBUTOR_INSIGHTS_KEY as pt, findNestedTemplateTreeDefect as pu, streamPolicyMatchesDeclared as q, reReadUntilSettled as qa, repairMalformedResourceEntriesForReadOnly as qc, snapshotSegmentSurvivors as qi, TemplateParser as ql, changedReferencePath as qn, displayPhysicalId as qo, computeImplicitDeleteEdges as qr, withSharedDrainBudget as qs, refuseRefactorMarker as qt, isCrossRegionRedirect as qu, keptWholeReasonText as r, noEchoAttributeNamesOf as ra, MULTI_REGION_RECREATE_BLOCKED_TYPES as rc, hasOwnKey as rd, nameGenerationCarriedFrom as ri, UNREADABLE_ORPHANS_CONTAINER_ROW as rl, withApiLimit as rn, LEGACY_HANDLE_ID_PREFIX as ro, siblingOwnedRevertDesired as rr, assertSendableRoleArn as rs, isTtlAlreadyDisabled as rt, applyCrossPrefixScan as ru, checkNestedSsmNames as s, withAttemptedItemsMasked as sa, WARM_THROUGHPUT_MEMBERS as sc, absoluteAssemblyPathEscape as sd, retiredNameGenerationsAfter as si, refuseMalformedOrphans as sl, displacedOpClause as sn, CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID as so, sgSiblingDecidedById as sr, sendableAssumeRoleCommand as ss, sendTtlWaitingOutRateLimit as st, stackInstanceIdOf as su, DeployEngine as t, red as ta, isPlainReferenceTo as tc, getCdkdContainerRepoName as td, removeProtectionTypeList as ti, refuseMalformedResourcePropertiesForOrphan as tl, isAccessDeniedError as tn, isCustomResource as to, proposeRenames as tr, applyRoleArnIfSet as ts, tagsMatchDeclared as tt, CrossPrefixReadError as tu, healSlashedSsmParameterNames as u, journaledOrphanPrintingBag as ua, toCfnInteger as uc, displayAssemblyPath as ud, getCurrentProducerRegions as ui, malformedExportNamesWarning as ul, getNestedRevertRun as un, responsePresignClient as uo, withoutSiblingOwnedSgRules as ur, callerEnvCredentials as us, vectorIndexesForCreate as ut, isSensitiveAttributeName as uu, conditionInputsFrom as v, stateSecretNameNeedles as va, parameterInputsFor as vc, exportAliasCollisionScrubWarning as vi, repairMalformedOutputsForReadOnly as vl, withNestedStackContext as vn, customResourcesFailedWithoutApp as vo, DELETED_RESOURCE_REMEDY as vr, s3BucketDomainName as vs, readContributorInsightsSpec as vt, SSM_PARAMETER_VALUE_PREFIX as vu, pendingMovesRefusalMessage as w, ccRoutedInstanceTakesNoSnapshot as wa, isReadableOrphanRecord as wc, exportNameSecretExposure as wi, refuseMalformedResourcesForDeploy as wl, loadJournaledOrphans as wn, waitForLambdaFunctionActive as wo, equalModuloMarkedMask as wr, parameterTypeMayLoseSecretIdentity as ws, DYNAMODB_DELETE_POLL_COST_MS as wt, rememberSynthesizedStacks as wu, childTemplateLoader as x, ATOMIC_FINAL_SNAPSHOT_TYPES as xa, declaresNoEcho as xc, secretSafeKeyDisplay as xi, malformedRenderedContainersWarning as xl, dropFailedHint as xn, localCustomResourceRuntimeActive as xo, settleUnsettledPrevious as xr, s3BucketWebsiteUrl as xs, stripIndexContributorInsights as xt, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as xu, parentSuppliedValues as y, storedSecretNameNeedles as ya, maskedInputProof as yc, secretBearing as yi, STATE_REGION_DIVERGED as yl, deleteJournaledOrphans as yn, customResourcesRunWithoutApp as yo, buildReadCurrentStateContext as yr, s3BucketDualStackDomainName as ys, reverseMapIndexContributorInsights as yt, isListParameterType as yu, declaredStreamPolicyMember as z, OWN_WRITE_REREAD_DELAYS_MS as za, malformedScrubResourceEntriesRefusalMessage as zc, holdsSupersededResources as zi, findSdkUnwiredProperties as zl, findDestructiveChanges as zn, markWaitAbandoned as zo, demoteSupersededOrphans as zr, referenceProvenanceOf as zs, hasCdkAutoDeleteTag as zt, parseAssetManifestBody as zu };
54489
+ //# sourceMappingURL=deploy-engine-BjSv27_M.js.map