@cdkd/cli 0.358.4 → 0.358.6

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 (54) hide show
  1. package/dist/{ambient-client-defaults-CcCQuSZx.js → ambient-client-defaults-XFcZ_IMI.js} +3 -3
  2. package/dist/{ambient-client-defaults-CcCQuSZx.js.map → ambient-client-defaults-XFcZ_IMI.js.map} +1 -1
  3. package/dist/{asg-provider-BYsZoqmF.js → asg-provider-BP8oMti2.js} +6 -6
  4. package/dist/{asg-provider-BYsZoqmF.js.map → asg-provider-BP8oMti2.js.map} +1 -1
  5. package/dist/cli.js +3 -3
  6. package/dist/{custom-resource-runtime-vUQQgT6M.js → custom-resource-runtime-QfoyaxPW.js} +6 -6
  7. package/dist/{custom-resource-runtime-vUQQgT6M.js.map → custom-resource-runtime-QfoyaxPW.js.map} +1 -1
  8. package/dist/{db-associated-roles-D1kkpP0k.js → db-associated-roles-5I6qQ0C6.js} +2 -2
  9. package/dist/{db-associated-roles-D1kkpP0k.js.map → db-associated-roles-5I6qQ0C6.js.map} +1 -1
  10. package/dist/{delete-started-joCwegKq.js → delete-started-B3fWZ4t9.js} +4 -4
  11. package/dist/{delete-started-joCwegKq.js.map → delete-started-B3fWZ4t9.js.map} +1 -1
  12. package/dist/{deploy-engine-CilA7v8d.js → deploy-engine-DwpkRhxS.js} +399 -244
  13. package/dist/deploy-engine-DwpkRhxS.js.map +1 -0
  14. package/dist/{diff-calculator-Bjr0sh-h.js → diff-calculator-Drt5nkqk.js} +12 -12
  15. package/dist/{diff-calculator-Bjr0sh-h.js.map → diff-calculator-Drt5nkqk.js.map} +1 -1
  16. package/dist/{ec2-termination-protection-Gdl3Djvt.js → ec2-termination-protection-CEAH5-4N.js} +6 -6
  17. package/dist/{ec2-termination-protection-Gdl3Djvt.js.map → ec2-termination-protection-CEAH5-4N.js.map} +1 -1
  18. package/dist/{ecr-uri-BhoeLkz2.js → ecr-uri-CsP8Bfa_.js} +2 -2
  19. package/dist/{ecr-uri-BhoeLkz2.js.map → ecr-uri-CsP8Bfa_.js.map} +1 -1
  20. package/dist/{expected-bucket-owner-CIiqUDil.js → expected-bucket-owner-Lk8hXI9d.js} +2 -2
  21. package/dist/{expected-bucket-owner-CIiqUDil.js.map → expected-bucket-owner-Lk8hXI9d.js.map} +1 -1
  22. package/dist/{iam-role-provider-gS0g_h2H.js → iam-role-provider-B6iCxpQV.js} +8 -8
  23. package/dist/{iam-role-provider-gS0g_h2H.js.map → iam-role-provider-B6iCxpQV.js.map} +1 -1
  24. package/dist/{image-plan-hSzmMXmK.js → image-plan-D-54O-Nq.js} +8 -8
  25. package/dist/{image-plan-hSzmMXmK.js.map → image-plan-D-54O-Nq.js.map} +1 -1
  26. package/dist/index.d.ts +15 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +5 -5
  29. package/dist/{logger-ZjhMP0A2.js → logger-jcgg96uu.js} +2 -2
  30. package/dist/{logger-ZjhMP0A2.js.map → logger-jcgg96uu.js.map} +1 -1
  31. package/dist/{neptune-provider-D3O8Y0lx.js → neptune-provider-CpoLlf2R.js} +7 -7
  32. package/dist/{neptune-provider-D3O8Y0lx.js.map → neptune-provider-CpoLlf2R.js.map} +1 -1
  33. package/dist/{program-MndcrrWf.js → program-DDysnPS0.js} +708 -47
  34. package/dist/program-DDysnPS0.js.map +1 -0
  35. package/dist/{provider-classes-KrOpD8Sp.js → provider-classes-CwIe3PGY.js} +453 -649
  36. package/dist/provider-classes-CwIe3PGY.js.map +1 -0
  37. package/dist/{rds-provider-Q_PZr6mn.js → rds-provider-DJtzCaTQ.js} +10 -10
  38. package/dist/{rds-provider-Q_PZr6mn.js.map → rds-provider-DJtzCaTQ.js.map} +1 -1
  39. package/dist/{read-replica-DyQpEv77.js → read-replica-eSaw4q1p.js} +3 -3
  40. package/dist/{read-replica-DyQpEv77.js.map → read-replica-eSaw4q1p.js.map} +1 -1
  41. package/dist/{replacement-rules-BdvFwhmu.js → replacement-rules-DOyuWYSl.js} +3 -3
  42. package/dist/{replacement-rules-BdvFwhmu.js.map → replacement-rules-DOyuWYSl.js.map} +1 -1
  43. package/dist/{resource-deadline-CKaftDB_.js → resource-deadline-Cd5Jfimc.js} +4 -4
  44. package/dist/{resource-deadline-CKaftDB_.js.map → resource-deadline-Cd5Jfimc.js.map} +1 -1
  45. package/dist/{restore-source-guard-eOILAZqS.js → restore-source-guard-YKb1WUF2.js} +4 -4
  46. package/dist/{restore-source-guard-eOILAZqS.js.map → restore-source-guard-YKb1WUF2.js.map} +1 -1
  47. package/dist/{run-cli-PZtAEtYO.js → run-cli-CyokhRcp.js} +2 -2
  48. package/dist/{run-cli-PZtAEtYO.js.map → run-cli-CyokhRcp.js.map} +1 -1
  49. package/dist/{version-DiwszmmI.js → version-DKW7jD3V.js} +2 -2
  50. package/dist/{version-DiwszmmI.js.map → version-DKW7jD3V.js.map} +1 -1
  51. package/package.json +1 -1
  52. package/dist/deploy-engine-CilA7v8d.js.map +0 -1
  53. package/dist/program-MndcrrWf.js.map +0 -1
  54. package/dist/provider-classes-KrOpD8Sp.js.map +0 -1
@@ -1,21 +1,21 @@
1
- import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-gS0g_h2H.js";
2
- import { A as configStringRefusal, B as generateResourceName, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, J as getCurrentStackName, M as replayWarn, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, U as recordedGeneratedNameKept, V as generateResourceNameWithFallback, Y as isBeforeStateRead, c as VERBOSE_POINTER, d as describeAwsStatusReason, f as isAwsAuthoredFailure, g as verbosePointerTail, h as verbosePointerSentence, j as readConfigString, k as configIntegerRefusal, n as getLogger, p as safeStringify, q as getCurrentStackInstanceId, u as describeAwsFailure, w as generatedNameFor } from "./logger-ZjhMP0A2.js";
1
+ import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-B6iCxpQV.js";
2
+ import { A as configStringRefusal, B as generateResourceName, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, J as getCurrentStackName, M as replayWarn, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, U as recordedGeneratedNameKept, V as generateResourceNameWithFallback, Y as isBeforeStateRead, c as VERBOSE_POINTER, d as describeAwsStatusReason, f as isAwsAuthoredFailure, g as verbosePointerTail, h as verbosePointerSentence, j as readConfigString, k as configIntegerRefusal, n as getLogger, p as safeStringify, q as getCurrentStackInstanceId, u as describeAwsFailure, w as generatedNameFor } from "./logger-jcgg96uu.js";
3
3
  import { d as withApiGatewayPacing, l as s3ClientDefaults, r as getAwsClients } from "./aws-clients-DOkPjjAW.js";
4
- import { D as markReplayMayCollide, E as markNameCollision, F as isAmbiguousOutcomeError, G as markRedactedCause, I as isExplicitDenyError, K as wrapMaskedAwsError, M as explicitDenyPolicyKind, O as relayedNameCollision, Q as AccountIdUnavailableError, R as isRetryableTransientError, U as isThrottlingError, V as THROTTLING_ERROR_NAMES, W as markNonRetryable, _ as ResourceUpdateNotSupportedError, at as ProvisioningError, et as CdkdError, i as credentialFingerprint, n as ambientCredentialConfig, r as clientDefaultsFor, t as ambientClientDefaults, x as hasReplayMayCollide, z as isTransientServerError } from "./ambient-client-defaults-CcCQuSZx.js";
5
- import { $ as deleteWithProtectionCompensation, $t as markAuxiliaryFailure, A as ambiguousAttemptLead, At as canonicalizeRoute53QueryName, B as isPlainImportValue, Bt as createMaskedRetryLogger, Ct as protectedReplacementAdvice, D as AmbiguousCreateLatch, E as AMBIGUOUS_LATCH_TTL_MS, F as setBounded, Ft as packCompositeId, G as remedyLogicalId, H as normalizeAwsTagsToCfn, Ht as maskDeep, I as withoutServerErrorRetries, J as RESOURCE_NOT_FOUND, K as resolveExplicitPhysicalId, L as VALUE_NOT_SHOWN, Lt as segmentAfterAnchor, M as isInsideWindow, Mt as compositeIdSeparatorRefusal, N as replayFollowedAmbiguousAttempt, Nt as compositeIdSkipResult, O as CREATION_DATE_SKEW_MARGIN_MS, Ot as isInterruptedWaitError, P as replayedSendWindow, Pt as logicalIdShown, R as importRemedyCommand, Rt as stateOrphanRecordRemedy, S as readPrincipalLists, St as pasteableAwsCommand, U as quotedRemedyLogicalId, Ut as maskerOrIdentity, V as isQuotableImportValue, Vt as isSecretDerivedValue, W as refusalTypeShown, Wt as withDerivedNameMasks, Y as assertRegionMatch, Z as markNotGone, Zt as isAuxiliaryFailure, _n as injectiveKey, a as clearOnUpdateRemoval, at as PROTECTION_FLIP_RETRY_WAIT_MS, b as holdsSecretDerivedEntry, bt as WITHHELD_AWS_COMMAND, c as removedTemplateKeys, ct as isProceedDbStatus, dt as ProtectionFlipRegistry, en as markCreatedBeforeFailure, et as logGroupProtectionSite, ft as isTerminalDeleteFailure, g as retractCreatedResource, gn as withPasteableAwsProfile, gt as ElapsedBudgetRegistry, ht as ElapsedBudget, it as userPoolProtectionSite, j as createAttemptKey, jt as compositeIdFormatMessage, k as RecentIdSet, kt as startInterruptWatch, l as withRemovalDefaults, lt as isTerminalDbWaitStatus, m as reportCreatedResource, n as enclosingDeadlineRemainingMs, nt as rdsFamilyProtectionSite, ot as deleteAfterProtectionFlipWithFinalSnapshot, pt as protectionFlipKey, q as DriftReadRefusedError, qt as clearCreatedBeforeFailure, t as enclosingDeadlineExpired, tn as markSupersedesEarlierCreate, tt as observeThenDisableProtection, vn as injectiveKeyPrefix, w as recordedPrincipalsRepair, wt as renderDisableCommand, x as onlySecretDerived, xt as isAwsCliLiteral, y as SECRET_DERIVED_READ_LIVE, yt as UNNAMEABLE_ID_CLAUSE, z as isPlainImportJson, zt as createMaskedLogSinks } from "./resource-deadline-CKaftDB_.js";
6
- import { A as displayStackName, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, T as asIsMessage, _ as shellQuote, c as deployReplaceCommand, d as pasteableCommand, j as isPasteableIdent, k as displaySafe, l as hasClauseBreak, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, u as isInertUnquoted, v as withheldTargetClause } from "./version-DiwszmmI.js";
7
- import { gt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted } from "./delete-started-joCwegKq.js";
8
- import { _ as warnUnsettledMember, a as resolveSecretDerivedPrincipals, b as verbatimEchoDriftKeys, c as SNS_DEFAULT_POLICY_ID, d as efsPolicyMatchesDeclared, f as lambdaPermissionMatchesDeclared, g as settleDeclaredMember, h as reReadUntilSettled, i as isResolvableSecretPrincipalList, l as declaredMemberDocument, m as policyDocumentMatchesDeclared, n as runDestroyForStack, o as KMS_DEFAULT_KEY_POLICY_ID, p as memberReadFailure, r as holdsUnprovenSecretPrincipalToken, s as OWN_WRITE_REREAD_DELAYS_MS, t as canonicalizeIpv4Cidr, u as declaredPolicyDocument, v as attemptedPolicyDocument, y as policyContentKey } from "./program-MndcrrWf.js";
9
- import { $ as sendTtlWaitingOutRateLimit, $a as markWaitAbandoned, $i as secretNamedAttributeNamesOf, $n as sgProtocolKey, $o as getAccountInfo, Ao as s3BucketDomainName, At as S3_AUTO_DELETE_OBJECTS_TAG, B as declaredStreamTagsMember, Br as redactedDeleteAddressSkip, Ci as getStackRecords, Cl as stringifyValue, Cs as toFiniteNumber, Ct as INDEX_SETTLE_POLL_INTERVAL_MS, Dc as refuseMalformedNestedChildOutputs, Dl as listNestedTemplateRows, Dt as relayedIndexBusyDelete, El as isAbsoluteAssetPath, Et as maskedLogger, Fl as decodeListingKey, G as streamDeclaresTags, Gt as chunks, Ha as waitForLambdaFunctionActive, Hc as accountArgs, I as DynamoDBGlobalTableProvider, J as streamTagsMatchDeclared, Jt as withApiLimit, K as streamMemberRefusals, Kt as isAccessDeniedError, L as STREAM_POLICY_KEY, Lc as refuseMalformedResourcesForDestroy, Lr as REDACTED_DELETE_ADDRESS_SKIP_REASON, Ma as getCurrentResourceSecrets, Mo as s3BucketRegionalDomainName, Ms as passedParameterClassesOf, Mt as isTruthyCfnBoolean, No as s3BucketWebsiteUrl, Ol as renderNestedTemplateTreeDefect, Ot as waitForIndexesSettled, Q as readTtlSpec, Qn as cfnIngressPortValue, R as STREAM_TAGS_KEY, Rr as isRedactedRecordedValue, Ss as toCfnInteger, St as DELETE_INDEX_WAIT_PROCEED_NOTE, Su as displayAssemblyPath, Ti as replacedDeleteFailureVerdict, Tl as findNestedTemplateTreeDefect, Tt as deleteTableWithIndexBusyRetry, Tu as resolveAssemblyPath, U as reverseMapStreamPolicy, Uc as withheldAccountClause, Uo as parseWebACLArn, V as planStreamMemberOps, W as streamDeclaresPolicy, Wa as waitForGoneAfterDelete, X as isTtlRateLimited, Xa as withIndeterminateGuard, Xn as siblingOwnedSgRuleIdentities, Y as isTtlAlreadyDisabled, Ya as deleteSkipReason, Z as planTimeToLive, Zc as findSdkUnwiredProperties, Zn as withoutSiblingOwnedSgRules, Zr as getCurrentProducerRegions, _a as isStoredExpression, _t as beginDeleteWait, ao as isSettledInstanceState, at as CONTRIBUTOR_INSIGHTS_KEY, br as acquireIdempotencyToken, bs as coerceWarmThroughput$1, bt as resolveDynamoDbDeleteBudgetClock, cn as getCurrentNestedStackContext, cr as calculateResourceDrift, ct as planContributorInsightsOp, dt as reverseMapIndexContributorInsights, el as withoutSdkUnwiredProperties, er as canonicalizeIpProtocolValue, et as planVectorIndexUpdates, ft as reverseMapTableContributorInsights, ga as collectPrincipalsAttachingPolicy, gr as earliestDefined, gt as DYNAMODB_DELETE_POLL_COST_MS, ha as collectManagedPolicyArnsAttachedBySiblings, ht as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, in as revertNestedChildFromJournal, it as vectorIndexesShapeDetail, jo as s3BucketDualStackDomainName, jt as hasCdkAutoDeleteTag, ko as s3BucketArn, kt as ECR_AUTO_DELETE_IMAGES_TAG, ln as withNestedStackContext, lt as planIndexContributorInsightsOps, ma as collectGroupsAddedBySiblings, mt as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, nt as vectorIndexesForCreate, oo as APPSYNC_APIKEY_ARN_RESOURCE_PATH, ot as contributorInsightsRefusals, pt as stripIndexContributorInsights, q as streamPolicyMatchesDeclared, ql as rewriteTemplateAssetReferences, qo as outputReferenceProvenanceOf, qt as lookupEachName, rt as vectorIndexesSettled, so as maskedSecretSegment, st as indexDeclaresContributorInsights, t as DeployEngine, tn as getNestedRevertRun, tt as readbackVectorIndexes, ut as readContributorInsightsSpec, va as withoutSiblingAttachedArns, vr as reserveStackCreateToken, vt as compensateRemovedDeletionProtection, wt as TABLE_INDEX_NOUN, wu as renderAssemblyPathEscape, xi as awaitInFlightSibling, xs as isWarmThroughputDecrease, xt as resolveDynamoDbDeleteBudgetMs, xu as describeFileReadFailure, ya as withoutSiblingOwned, ys as WARM_THROUGHPUT_MEMBERS, yt as deleteBudgetKey, z as declaredStreamPolicyMember, zr as redactedDeleteAddressFields } from "./deploy-engine-CilA7v8d.js";
10
- import { _ as isUsableAttemptedName, c as planTagDiff, d as tagMapAsList, f as tagPlanWarning, g as stringifyIfAssigned, h as definedAttributes, i as refuseRestoreFromItself, l as readTagList, m as modifyDbInstanceWhenAvailable, o as DBPROXY_TAGS_WHAT, p as isModifyNotAvailableRefusal, s as DBPROXY_TAG_OPTIONS, u as refuseMalformedDesiredTags } from "./restore-source-guard-eOILAZqS.js";
11
- import { A as withRetry, U as timePhase, _ as unchangedBehindSecretReference, a as reDisableInstanceApiTermination, d as markRefusedBeforeApplying, g as onlySecretReferencesDiffer, i as observeThenDisableInstanceApiTermination, l as getPriorAttempts, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, r as isTerminationProtectionPropagationError, s as resolvedResourceTimeoutMs } from "./ec2-termination-protection-Gdl3Djvt.js";
4
+ import { D as markReplayMayCollide, E as markNameCollision, F as isAmbiguousOutcomeError, G as markRedactedCause, I as isExplicitDenyError, K as wrapMaskedAwsError, M as explicitDenyPolicyKind, O as relayedNameCollision, Q as AccountIdUnavailableError, R as isRetryableTransientError, U as isThrottlingError, V as THROTTLING_ERROR_NAMES, W as markNonRetryable, _ as ResourceUpdateNotSupportedError, at as ProvisioningError, et as CdkdError, i as credentialFingerprint, n as ambientCredentialConfig, r as clientDefaultsFor, t as ambientClientDefaults, x as hasReplayMayCollide, z as isTransientServerError } from "./ambient-client-defaults-XFcZ_IMI.js";
5
+ import { $ as deleteWithProtectionCompensation, $t as markAuxiliaryFailure, A as ambiguousAttemptLead, At as canonicalizeRoute53QueryName, B as isPlainImportValue, Bt as createMaskedRetryLogger, Ct as protectedReplacementAdvice, D as AmbiguousCreateLatch, E as AMBIGUOUS_LATCH_TTL_MS, F as setBounded, Ft as packCompositeId, G as remedyLogicalId, H as normalizeAwsTagsToCfn, Ht as maskDeep, I as withoutServerErrorRetries, J as RESOURCE_NOT_FOUND, K as resolveExplicitPhysicalId, L as VALUE_NOT_SHOWN, Lt as segmentAfterAnchor, M as isInsideWindow, Mt as compositeIdSeparatorRefusal, N as replayFollowedAmbiguousAttempt, Nt as compositeIdSkipResult, O as CREATION_DATE_SKEW_MARGIN_MS, Ot as isInterruptedWaitError, P as replayedSendWindow, Pt as logicalIdShown, R as importRemedyCommand, Rt as stateOrphanRecordRemedy, S as readPrincipalLists, St as pasteableAwsCommand, U as quotedRemedyLogicalId, Ut as maskerOrIdentity, V as isQuotableImportValue, Vt as isSecretDerivedValue, W as refusalTypeShown, Wt as withDerivedNameMasks, Y as assertRegionMatch, Z as markNotGone, Zt as isAuxiliaryFailure, _n as injectiveKey, a as clearOnUpdateRemoval, at as PROTECTION_FLIP_RETRY_WAIT_MS, b as holdsSecretDerivedEntry, bt as WITHHELD_AWS_COMMAND, c as removedTemplateKeys, ct as isProceedDbStatus, dt as ProtectionFlipRegistry, en as markCreatedBeforeFailure, et as logGroupProtectionSite, ft as isTerminalDeleteFailure, g as retractCreatedResource, gn as withPasteableAwsProfile, gt as ElapsedBudgetRegistry, ht as ElapsedBudget, it as userPoolProtectionSite, j as createAttemptKey, jt as compositeIdFormatMessage, k as RecentIdSet, kt as startInterruptWatch, l as withRemovalDefaults, lt as isTerminalDbWaitStatus, m as reportCreatedResource, n as enclosingDeadlineRemainingMs, nt as rdsFamilyProtectionSite, ot as deleteAfterProtectionFlipWithFinalSnapshot, pt as protectionFlipKey, q as DriftReadRefusedError, qt as clearCreatedBeforeFailure, t as enclosingDeadlineExpired, tn as markSupersedesEarlierCreate, tt as observeThenDisableProtection, vn as injectiveKeyPrefix, w as recordedPrincipalsRepair, wt as renderDisableCommand, x as onlySecretDerived, xt as isAwsCliLiteral, y as SECRET_DERIVED_READ_LIVE, yt as UNNAMEABLE_ID_CLAUSE, z as isPlainImportJson, zt as createMaskedLogSinks } from "./resource-deadline-Cd5Jfimc.js";
6
+ import { A as displayStackName, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, T as asIsMessage, _ as shellQuote, c as deployReplaceCommand, d as pasteableCommand, j as isPasteableIdent, k as displaySafe, l as hasClauseBreak, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, u as isInertUnquoted, v as withheldTargetClause } from "./version-DKW7jD3V.js";
7
+ import { gt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted } from "./delete-started-B3fWZ4t9.js";
8
+ import { A as configItemId, B as SNS_DEFAULT_POLICY_ID, C as effectiveAnalyticsItem, D as eventBridgeEnabledOf, E as effectiveNotificationConfiguration, F as manualBucketDeletionClause, G as memberReadFailure, H as declaredPolicyDocument, I as mergeLegacySingular, J as settleDeclaredMember, K as policyDocumentMatchesDeclared, L as shownLifecycleRuleId, M as declaresNestedObjectLock, N as describeValue$1, O as caughtErrorName, P as isPlainObject$3, R as KMS_DEFAULT_KEY_POLICY_ID, S as EVENTBRIDGE_CONFIG_PATH, T as effectiveInventoryItem, U as efsPolicyMatchesDeclared, V as declaredMemberDocument, W as lambdaPermissionMatchesDeclared, X as attemptedPolicyDocument, Y as warnUnsettledMember, Z as policyContentKey, _ as canonicalizeItemList, a as resolveSecretDerivedPrincipals, b as lifecycleUsesFilterForm, c as lifecycleSettleTarget, d as takeLifecycleWrite, f as LIFECYCLE_DEFAULT_STATUS, g as canonicalizeBlock, h as LIFECYCLE_TAG_FILTERS_PATH, i as isResolvableSecretPrincipalList, j as declaresBucketObjectLock, k as coerceCfnNumber, l as recordLifecycleWrite, m as LIFECYCLE_RULE_PATH, n as runDestroyForStack, o as LIFECYCLE_BASELINE_REREAD_DELAYS_MS, p as LIFECYCLE_FILTER_PATH, q as reReadUntilSettled, r as holdsUnprovenSecretPrincipalToken, s as clearLifecycleWritesOf, t as canonicalizeIpv4Cidr, u as settleLifecycleRead, v as effectiveLifecycleConfiguration, w as effectiveIntelligentTieringItem, x as parseCfnTimestamp, y as lifecycleRuleScope, z as OWN_WRITE_REREAD_DELAYS_MS } from "./program-DDysnPS0.js";
9
+ import { $ as sendTtlWaitingOutRateLimit, $c as findSdkUnwiredProperties, $n as sgProtocolKey, Al as renderNestedTemplateTreeDefect, At as S3_AUTO_DELETE_OBJECTS_TAG, B as declaredStreamTagsMember, Ci as replacedDeleteFailureVerdict, Cs as isWarmThroughputDecrease, Ct as INDEX_SETTLE_POLL_INTERVAL_MS, Cu as describeFileReadFailure, Dl as findNestedTemplateTreeDefect, Dt as relayedIndexBusyDelete, Du as resolveAssemblyPath, Et as maskedLogger, Eu as renderAssemblyPathEscape, Fo as s3BucketWebsiteUrl, Fr as REDACTED_DELETE_ADDRESS_SKIP_REASON, G as streamDeclaresTags, Gc as withheldAccountClause, Go as parseWebACLArn, Gt as chunks, I as DynamoDBGlobalTableProvider, Ir as isRedactedRecordedValue, J as streamTagsMatchDeclared, Jt as withApiLimit, K as streamMemberRefusals, Ka as waitForGoneAfterDelete, Kt as isAccessDeniedError, L as STREAM_POLICY_KEY, Ll as decodeListingKey, Lr as redactedDeleteAddressFields, Mo as s3BucketDomainName, Mt as isTruthyCfnBoolean, No as s3BucketDualStackDomainName, Ol as isAbsoluteAssetPath, Ot as waitForIndexesSettled, Pa as getCurrentResourceSecrets, Po as s3BucketRegionalDomainName, Ps as passedParameterClassesOf, Q as readTtlSpec, Qa as withIndeterminateGuard, Qn as cfnIngressPortValue, R as STREAM_TAGS_KEY, Rr as redactedDeleteAddressSkip, Ss as coerceWarmThroughput$1, St as DELETE_INDEX_WAIT_PROCEED_NOTE, Tl as stringifyValue, Ts as toFiniteNumber, Tt as deleteTableWithIndexBusyRetry, U as reverseMapStreamPolicy, V as planStreamMemberOps, W as streamDeclaresPolicy, Wa as waitForLambdaFunctionActive, Wc as accountArgs, X as isTtlRateLimited, Xn as siblingOwnedSgRuleIdentities, Y as isTtlAlreadyDisabled, Yl as rewriteTemplateAssetReferences, Yo as outputReferenceProvenanceOf, Yr as getCurrentProducerRegions, Z as planTimeToLive, Za as deleteSkipReason, Zn as withoutSiblingOwnedSgRules, _a as collectManagedPolicyArnsAttachedBySiblings, _r as earliestDefined, _t as beginDeleteWait, at as CONTRIBUTOR_INSIGHTS_KEY, ba as withoutSiblingAttachedArns, bt as resolveDynamoDbDeleteBudgetClock, cn as getCurrentNestedStackContext, co as APPSYNC_APIKEY_ARN_RESOURCE_PATH, cr as calculateResourceDrift, ct as planContributorInsightsOp, dt as reverseMapIndexContributorInsights, er as canonicalizeIpProtocolValue, et as planVectorIndexUpdates, fr as verbatimEchoDriftKeys, ft as reverseMapTableContributorInsights, ga as collectGroupsAddedBySiblings, gt as DYNAMODB_DELETE_POLL_COST_MS, ht as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, in as revertNestedChildFromJournal, it as vectorIndexesShapeDetail, jo as s3BucketArn, jt as hasCdkAutoDeleteTag, kc as refuseMalformedNestedChildOutputs, kl as listNestedTemplateRows, kt as ECR_AUTO_DELETE_IMAGES_TAG, ln as withNestedStackContext, lo as maskedSecretSegment, lt as planIndexContributorInsightsOps, mt as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, nl as withoutSdkUnwiredProperties, nt as vectorIndexesForCreate, ot as contributorInsightsRefusals, pt as stripIndexContributorInsights, q as streamPolicyMatchesDeclared, qt as lookupEachName, rt as vectorIndexesSettled, so as isSettledInstanceState, st as indexDeclaresContributorInsights, t as DeployEngine, ta as secretNamedAttributeNamesOf, tn as getNestedRevertRun, to as markWaitAbandoned, ts as getAccountInfo, tt as readbackVectorIndexes, ut as readContributorInsightsSpec, va as collectPrincipalsAttachingPolicy, vt as compensateRemovedDeletionProtection, ws as toCfnInteger, wt as TABLE_INDEX_NOUN, wu as displayAssemblyPath, xa as withoutSiblingOwned, xi as getStackRecords, xr as acquireIdempotencyToken, xs as WARM_THROUGHPUT_MEMBERS, xt as resolveDynamoDbDeleteBudgetMs, ya as isStoredExpression, yi as awaitInFlightSibling, yr as reserveStackCreateToken, yt as deleteBudgetKey, z as declaredStreamPolicyMember, zc as refuseMalformedResourcesForDestroy } from "./deploy-engine-DwpkRhxS.js";
10
+ import { _ as isUsableAttemptedName, c as planTagDiff, d as tagMapAsList, f as tagPlanWarning, g as stringifyIfAssigned, h as definedAttributes, i as refuseRestoreFromItself, l as readTagList, m as modifyDbInstanceWhenAvailable, o as DBPROXY_TAGS_WHAT, p as isModifyNotAvailableRefusal, s as DBPROXY_TAG_OPTIONS, u as refuseMalformedDesiredTags } from "./restore-source-guard-YKb1WUF2.js";
11
+ import { A as withRetry, U as timePhase, _ as unchangedBehindSecretReference, a as reDisableInstanceApiTermination, d as markRefusedBeforeApplying, g as onlySecretReferencesDiffer, i as observeThenDisableInstanceApiTermination, l as getPriorAttempts, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, r as isTerminationProtectionPropagationError, s as resolvedResourceTimeoutMs } from "./ec2-termination-protection-CEAH5-4N.js";
12
12
  import { n as canonicalizeRegion, r as derivePartitionAndUrlSuffix } from "./aws-partition-DA0r2sr-.js";
13
13
  import { f as ambientRegion, r as awsEndpointOverrideActive } from "./aws-client-defaults-DAebi99J.js";
14
- import { n as planSubscriptionAttributes } from "./diff-calculator-Bjr0sh-h.js";
15
- import { $ as snapshotPassProvenance, At as withoutPhysicalNameCopies, C as passedNoEchoParametersOf, I as markSameGenerationBag, Nt as dynamicReferenceTokens, W as redactForState, Z as recordReferenceProvenanceEntry, a as emrClusterInstancesReplaced, cn as recordAttributeIdCopy, i as ecsServiceLaunchTypeSetOrChanged, it as hasMaskableValues, l as sameLambdaFunctionAddress, mn as carriesSecretMask, n as blockDeviceMappingsDifferOnlyInDeleteOnTermination, o as canonicalLambdaFunctionName, on as recoverMaskedOutput, s as lambdaFunctionNameForMask, sn as physicalNameCopiesOf } from "./replacement-rules-BdvFwhmu.js";
16
- import { RDSProvider } from "./rds-provider-Q_PZr6mn.js";
17
- import { NeptuneProvider } from "./neptune-provider-D3O8Y0lx.js";
18
- import { ASGProvider } from "./asg-provider-BYsZoqmF.js";
14
+ import { n as planSubscriptionAttributes } from "./diff-calculator-Drt5nkqk.js";
15
+ import { $ as snapshotPassProvenance, At as withoutPhysicalNameCopies, C as passedNoEchoParametersOf, I as markSameGenerationBag, Nt as dynamicReferenceTokens, W as redactForState, Z as recordReferenceProvenanceEntry, a as emrClusterInstancesReplaced, cn as recordAttributeIdCopy, i as ecsServiceLaunchTypeSetOrChanged, it as hasMaskableValues, l as sameLambdaFunctionAddress, mn as carriesSecretMask, n as blockDeviceMappingsDifferOnlyInDeleteOnTermination, o as canonicalLambdaFunctionName, on as recoverMaskedOutput, s as lambdaFunctionNameForMask, sn as physicalNameCopiesOf } from "./replacement-rules-DOyuWYSl.js";
16
+ import { RDSProvider } from "./rds-provider-DJtzCaTQ.js";
17
+ import { NeptuneProvider } from "./neptune-provider-CpoLlf2R.js";
18
+ import { ASGProvider } from "./asg-provider-BP8oMti2.js";
19
19
  import { createHash, randomUUID } from "node:crypto";
20
20
  import { CreateBucketCommand, CreateBucketMetadataConfigurationCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetadataConfigurationCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAbacCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketMetadataConfigurationCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListBucketsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAbacCommand, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, UpdateBucketMetadataAnnotationTableConfigurationCommand, UpdateBucketMetadataInventoryTableConfigurationCommand, UpdateBucketMetadataJournalTableConfigurationCommand } from "@aws-sdk/client-s3";
21
21
  import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetPolicyCommand, GetPolicyVersionCommand, GetRolePolicyCommand, GetUserCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListAttachedGroupPoliciesCommand, ListAttachedUserPoliciesCommand, ListEntitiesForPolicyCommand, ListGroupPoliciesCommand, ListGroupsForUserCommand, ListPoliciesCommand, ListPolicyTagsCommand, ListPolicyVersionsCommand, ListUserPoliciesCommand, NoSuchEntityException, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPermissionsBoundaryCommand, PutUserPolicyCommand, RemoveRoleFromInstanceProfileCommand, RemoveUserFromGroupCommand, TagPolicyCommand, TagUserCommand, UntagPolicyCommand, UntagUserCommand, UpdateAccessKeyCommand, UpdateGroupCommand, UpdateLoginProfileCommand, UpdateUserCommand } from "@aws-sdk/client-iam";
@@ -41,7 +41,7 @@ import { CreateWebFunctionEndpointCommand, CreateWebFunctionRevisionCommand, Del
41
41
  import { CreateNetworkConnectorCommand, DeleteNetworkConnectorCommand, GetNetworkConnectorCommand, LambdaCoreClient, ResourceNotFoundException as ResourceNotFoundException$10, UpdateNetworkConnectorCommand } from "@aws-sdk/client-lambda-core";
42
42
  import * as fs from "node:fs";
43
43
  import * as path from "node:path";
44
- import { CreateRepositoryCommand, DeleteLifecyclePolicyCommand, DeleteRepositoryCommand, DeleteRepositoryPolicyCommand, DescribeRepositoriesCommand, ECRClient, GetLifecyclePolicyCommand, LifecyclePolicyNotFoundException, ListTagsForResourceCommand as ListTagsForResourceCommand$9, PutImageScanningConfigurationCommand, PutImageTagMutabilityCommand, PutLifecyclePolicyCommand, RepositoryNotEmptyException, RepositoryNotFoundException, SetRepositoryPolicyCommand, TagResourceCommand as TagResourceCommand$11, UntagResourceCommand as UntagResourceCommand$11 } from "@aws-sdk/client-ecr";
44
+ import { CreateRepositoryCommand, DeleteLifecyclePolicyCommand, DeleteRepositoryCommand, DeleteRepositoryPolicyCommand, DescribeRepositoriesCommand, ECRClient, GetLifecyclePolicyCommand, GetRepositoryPolicyCommand, LifecyclePolicyNotFoundException, ListTagsForResourceCommand as ListTagsForResourceCommand$9, PutImageScanningConfigurationCommand, PutImageTagMutabilityCommand, PutLifecyclePolicyCommand, RepositoryNotEmptyException, RepositoryNotFoundException, RepositoryPolicyNotFoundException, SetRepositoryPolicyCommand, TagResourceCommand as TagResourceCommand$11, UntagResourceCommand as UntagResourceCommand$11 } from "@aws-sdk/client-ecr";
45
45
  import { AddTagsCommand, CreateListenerCommand, CreateLoadBalancerCommand, CreateTargetGroupCommand, DeleteListenerCommand, DeleteLoadBalancerCommand, DeleteTargetGroupCommand, DeregisterTargetsCommand, DescribeCapacityReservationCommand, DescribeListenerAttributesCommand, DescribeListenersCommand, DescribeLoadBalancerAttributesCommand, DescribeLoadBalancersCommand, DescribeTagsCommand, DescribeTargetGroupAttributesCommand, DescribeTargetGroupsCommand, DescribeTargetHealthCommand, ElasticLoadBalancingV2Client, ModifyCapacityReservationCommand, ModifyIpPoolsCommand, ModifyListenerAttributesCommand, ModifyListenerCommand, ModifyLoadBalancerAttributesCommand, ModifyTargetGroupAttributesCommand, ModifyTargetGroupCommand, RegisterTargetsCommand, RemoveTagsCommand, SetIpAddressTypeCommand, SetSecurityGroupsCommand, SetSubnetsCommand, waitUntilLoadBalancerAvailable } from "@aws-sdk/client-elastic-load-balancing-v2";
46
46
  import { CreateAliasCommand, CreateKeyCommand, DeleteAliasCommand, DescribeKeyCommand, DisableKeyCommand, DisableKeyRotationCommand, DisabledException, EnableKeyCommand, EnableKeyRotationCommand, GetKeyPolicyCommand, GetKeyRotationStatusCommand, KMSClient, ListAliasesCommand, ListKeysCommand, ListResourceTagsCommand, NotFoundException as NotFoundException$2, PutKeyPolicyCommand, ScheduleKeyDeletionCommand, TagResourceCommand as TagResourceCommand$12, UntagResourceCommand as UntagResourceCommand$12, UpdateAliasCommand, UpdateKeyDescriptionCommand } from "@aws-sdk/client-kms";
47
47
  import { isDeepStrictEqual } from "node:util";
@@ -236,6 +236,14 @@ async function detachPartialPolicy(logicalId, policyName, attached, sinks, maskS
236
236
  if (failed.length > 0) log.warn(`Failed to detach the partially-created IAM policy ${logicalId} (${v(policyName)}) after its create failed; cdkd has no record of it, so it stays attached and granting until it is removed by hand${withheld && verbosePointerSentence() ? ` (${VERBOSE_POINTER.replace(/\.$/, "")})` : ""}: ${failed.join("; ")}`);
237
237
  }
238
238
 
239
+ // src/provisioning/revert-no-replace.ts
240
+ function isDriftRevert(context) {
241
+ return context?.desiredFromAwsReadback === true;
242
+ }
243
+ function revertReplacementRefusal(resourceType, logicalId, reason) {
244
+ return new ResourceUpdateNotSupportedError(resourceType, logicalId, `${reason}, so reverting it would replace it, and a drift revert never replaces a resource. Nothing was changed; re-deploy with ${deployReplaceCommand()} to replace it`);
245
+ }
246
+
239
247
  // src/provisioning/providers/iam-policy/update.ts
240
248
  async function update$42(logicalId, physicalId, resourceType, properties, previousProperties, context) {
241
249
  const oldPolicyName = physicalId.includes(":") ? physicalId.split(":")[0] : physicalId;
@@ -251,6 +259,7 @@ async function update$42(logicalId, physicalId, resourceType, properties, previo
251
259
  logicalId,
252
260
  options: { maxLength: 64 }
253
261
  }) ? oldPolicyName : derivedPolicyName;
262
+ if (isDriftRevert(context) && newPolicyName !== oldPolicyName) throw revertReplacementRefusal(resourceType, logicalId, "its PolicyName differs from the name the policy is recorded under");
254
263
  const recordedPolicyName = previousProperties["PolicyName"];
255
264
  const oldPolicyNames = [...new Set([oldPolicyName, recordedPolicyName].filter((name) => typeof name === "string" && IAM_POLICY_NAME.test(name)))];
256
265
  const newTargets = readPolicyTargetLists(properties);
@@ -342,7 +351,7 @@ async function update$42(logicalId, physicalId, resourceType, properties, previo
342
351
  }
343
352
  log.debug(`Successfully updated IAM policy ${logicalId}`);
344
353
  return {
345
- physicalId: newPolicyName,
354
+ physicalId: isDriftRevert(context) ? physicalId : newPolicyName,
346
355
  wasReplaced: false,
347
356
  attributes: { PolicyName: newPolicyName }
348
357
  };
@@ -528,7 +537,7 @@ async function deleteImpl$40(logicalId, physicalId, resourceType, properties, co
528
537
 
529
538
  // src/provisioning/providers/iam-policy/read-state.ts
530
539
  const TARGET_READ_CONCURRENCY = 5;
531
- async function readCurrentState$40(physicalId, _logicalId, _resourceType, properties, context) {
540
+ async function readCurrentState$41(physicalId, _logicalId, _resourceType, properties, context) {
532
541
  if (!properties) return void 0;
533
542
  const policyDocument = properties["PolicyDocument"];
534
543
  if (!policyDocument) return void 0;
@@ -680,7 +689,7 @@ var IAMPolicyProvider = class {
680
689
  return deleteImpl$40.call(this, logicalId, physicalId, resourceType, properties, context);
681
690
  }
682
691
  readCurrentState(physicalId, logicalId, resourceType, properties, context) {
683
- return readCurrentState$40.call(this, physicalId, logicalId, resourceType, properties, context);
692
+ return readCurrentState$41.call(this, physicalId, logicalId, resourceType, properties, context);
684
693
  }
685
694
  decodePolicyDocument(raw) {
686
695
  return decodePolicyDocument.call(this, raw);
@@ -1040,7 +1049,7 @@ async function deleteImpl$39(logicalId, physicalId, resourceType, _properties, c
1040
1049
 
1041
1050
  // src/provisioning/providers/iam-managed-policy/read-state.ts
1042
1051
  const AWS_MANAGED_POLICY_ARN_RE = /^arn:aws[a-z0-9-]*:iam::aws:/;
1043
- async function readCurrentState$39(physicalId, _logicalId, _resourceType, properties, context) {
1052
+ async function readCurrentState$40(physicalId, _logicalId, _resourceType, properties, context) {
1044
1053
  let policy;
1045
1054
  try {
1046
1055
  policy = (await this.iamClient.send(new GetPolicyCommand({ PolicyArn: physicalId }))).Policy;
@@ -1188,7 +1197,7 @@ var IAMManagedPolicyProvider = class {
1188
1197
  }
1189
1198
  }
1190
1199
  readCurrentState(physicalId, logicalId, resourceType, properties, context) {
1191
- return readCurrentState$39.call(this, physicalId, logicalId, resourceType, properties, context);
1200
+ return readCurrentState$40.call(this, physicalId, logicalId, resourceType, properties, context);
1192
1201
  }
1193
1202
  import(input) {
1194
1203
  return importImpl$39.call(this, input);
@@ -3078,7 +3087,7 @@ async function readIdIfExists(resourceType, name) {
3078
3087
  if (token === void 0) throw new Error(`IAM returned no ${noun === "user" ? "UserId" : "GroupId"}`);
3079
3088
  return token;
3080
3089
  }
3081
- async function readCurrentState$38(physicalId, logicalId, resourceType, properties, context) {
3090
+ async function readCurrentState$39(physicalId, logicalId, resourceType, properties, context) {
3082
3091
  switch (resourceType) {
3083
3092
  case "AWS::IAM::User": return this.readUserCurrentState(physicalId, properties, context);
3084
3093
  case "AWS::IAM::Group": return this.readGroupCurrentState(physicalId, properties, context);
@@ -3367,7 +3376,7 @@ var IAMUserGroupProvider = class {
3367
3376
  return readIdIfExists.call(this, resourceType, name);
3368
3377
  }
3369
3378
  readCurrentState(physicalId, logicalId, resourceType, properties, context) {
3370
- return readCurrentState$38.call(this, physicalId, logicalId, resourceType, properties, context);
3379
+ return readCurrentState$39.call(this, physicalId, logicalId, resourceType, properties, context);
3371
3380
  }
3372
3381
  readUserCurrentState(physicalId, properties, context) {
3373
3382
  return readUserCurrentState.call(this, physicalId, properties, context);
@@ -3392,62 +3401,6 @@ var IAMUserGroupProvider = class {
3392
3401
  }
3393
3402
  };
3394
3403
 
3395
- // src/provisioning/providers/s3-bucket/shared.ts
3396
- function manualBucketDeletionClause(bucketName, maskSecrets, journaled) {
3397
- const command = renderDisableCommand({
3398
- before: "aws s3api delete-bucket --bucket",
3399
- identifier: bucketName,
3400
- maskSecrets
3401
- });
3402
- const lead = journaled ? `Outside a rollback's re-create, the failed deploy's rollback journal records the bucket for ${proseQuoted(cdkdRemedy("cdkd rollback", "--revert-failed"), "`")}; otherwise delete it yourself before the next deploy` : "Manual deletion may be required before the next deploy";
3403
- return command ? `${lead}: ${command}` : `${lead}, via the console: the bucket name cannot be reproduced safely on a command line, so any command shown here could act on a different bucket or run part of the name as shell.`;
3404
- }
3405
- function configItemId(item) {
3406
- if (!isPlainObject$3(item)) return void 0;
3407
- const id = item["Id"];
3408
- if (typeof id === "string") return id;
3409
- if (typeof id === "number" && Number.isFinite(id)) return String(id);
3410
- }
3411
- function declaresBucketObjectLock(properties) {
3412
- return properties["ObjectLockEnabled"] === true || properties["ObjectLockEnabled"] === "true";
3413
- }
3414
- function declaresNestedObjectLock(properties) {
3415
- return properties["ObjectLockConfiguration"]?.["ObjectLockEnabled"] === "Enabled";
3416
- }
3417
- function caughtErrorName(error) {
3418
- const name = error?.name;
3419
- return typeof name === "string" && name !== "" ? name : "unknown error";
3420
- }
3421
- function isPlainObject$3(value) {
3422
- return typeof value === "object" && value !== null && !Array.isArray(value);
3423
- }
3424
- function describeValue$1(value, maskSecrets = (text) => text) {
3425
- if (value === null) return "null";
3426
- if (Array.isArray(value)) return "an array";
3427
- if (typeof value === "string") return `a string ${displaySafe(JSON.stringify(maskDeep(value, maskSecrets)))}`;
3428
- if (isPlainObject$3(value)) return `an object with keys [${Object.keys(value).map((key) => displaySafe(maskSecrets(key))).join(", ")}]`;
3429
- return `a ${typeof value} (${maskSecrets(String(value))})`;
3430
- }
3431
- function coerceCfnNumber(value) {
3432
- if (typeof value !== "number" && typeof value !== "string") return void 0;
3433
- if (value === "") return void 0;
3434
- const n = Number(value);
3435
- return Number.isFinite(n) ? n : void 0;
3436
- }
3437
- function mergeLegacySingular(plural, singular, onCollision) {
3438
- const out = (Array.isArray(plural) ? plural : []).filter(isPlainObject$3);
3439
- if (!isPlainObject$3(singular)) return out;
3440
- const sc = singular["StorageClass"];
3441
- if (typeof sc === "string" && out.some((e) => e["StorageClass"] === sc)) {
3442
- onCollision(sc);
3443
- return out;
3444
- }
3445
- return [...out, singular];
3446
- }
3447
- function shownLifecycleRuleId(id) {
3448
- return id === void 0 || id === null || id === "" ? "(no Id)" : displayIdent(id);
3449
- }
3450
-
3451
3404
  // src/provisioning/providers/s3-bucket/metadata.ts
3452
3405
  const ABAC_DISABLED = "Disabled";
3453
3406
  const ABAC_ENABLED = "Enabled";
@@ -4184,384 +4137,6 @@ function inventorySdkToCfn(c) {
4184
4137
  return out;
4185
4138
  }
4186
4139
 
4187
- // src/provisioning/providers/s3-bucket/effective-items.ts
4188
- function effectiveS3BucketDestination(declared, sentFormat) {
4189
- if (!isPlainObject$3(declared)) return declared;
4190
- if (!declared["BucketArn"]) return declared;
4191
- const out = { BucketArn: declared["BucketArn"] };
4192
- if (declared["BucketAccountId"] !== void 0) out["BucketAccountId"] = declared["BucketAccountId"];
4193
- out["Format"] = sentFormat ?? declaredOrDefault(declared, "Format", "CSV");
4194
- if (declared["Prefix"] !== void 0) out["Prefix"] = declared["Prefix"];
4195
- return sameScalarRecord(out, declared) ? declared : out;
4196
- }
4197
- function declaredOrDefault(container, key, fallback) {
4198
- return key in container ? container[key] : fallback;
4199
- }
4200
- const INVENTORY_DESTINATION_DEFAULT_FORMAT = "CSV";
4201
- const INVENTORY_DEFAULT_ENABLED = true;
4202
- const INVENTORY_DEFAULT_INCLUDED_OBJECT_VERSIONS = "All";
4203
- const ANALYTICS_DEFAULT_OUTPUT_SCHEMA_VERSION = "V_1";
4204
- function sameScalarRecord(a, b) {
4205
- const aKeys = Object.keys(a);
4206
- if (aKeys.length !== Object.keys(b).length) return false;
4207
- return aKeys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && Object.is(a[k], b[k]));
4208
- }
4209
- const INVENTORY_DEFAULT_SCHEDULE_FREQUENCY = "Weekly";
4210
- function effectiveInventoryItem(item, sent) {
4211
- const patch = {};
4212
- const declaredEnabled = item["Enabled"];
4213
- if (declaredEnabled === void 0) patch["Enabled"] = true;
4214
- else {
4215
- const coercedEnabled = coerceCfnBoolean(declaredEnabled);
4216
- if (coercedEnabled !== void 0 && !Object.is(declaredEnabled, coercedEnabled)) patch["Enabled"] = coercedEnabled;
4217
- }
4218
- if (item["IncludedObjectVersions"] === void 0) patch["IncludedObjectVersions"] = "All";
4219
- const declaredSchedule = item["Schedule"];
4220
- const declaresScheduleFrequency = item["ScheduleFrequency"] !== void 0;
4221
- const scheduleFrequencyUsable = declaresScheduleFrequency && configStringRefusal(item, "ScheduleFrequency", "Weekly", "AWS::S3::Bucket InventoryConfigurations[]") === void 0;
4222
- const scheduleContainerUsable = configStringRefusal(declaredSchedule, "Frequency", INVENTORY_DEFAULT_SCHEDULE_FREQUENCY, "AWS::S3::Bucket InventoryConfigurations[].Schedule") === void 0;
4223
- const canFoldSchedule = sent?.frequency !== void 0 || scheduleFrequencyUsable || !declaresScheduleFrequency && scheduleContainerUsable;
4224
- if (canFoldSchedule) {
4225
- const declaredFrequency = declaresScheduleFrequency ? item["ScheduleFrequency"] : isPlainObject$3(declaredSchedule) && declaredSchedule["Frequency"] !== void 0 ? declaredSchedule["Frequency"] : INVENTORY_DEFAULT_SCHEDULE_FREQUENCY;
4226
- const frequency = sent?.frequency ?? declaredFrequency;
4227
- if (!Object.is(item["ScheduleFrequency"], frequency)) patch["ScheduleFrequency"] = frequency;
4228
- }
4229
- const destination = effectiveS3BucketDestination(item["Destination"], sent?.format);
4230
- if (destination !== item["Destination"]) patch["Destination"] = destination;
4231
- const dropsSchedule = declaredSchedule !== void 0 && canFoldSchedule;
4232
- if (!dropsSchedule && Object.keys(patch).length === 0) return item;
4233
- const out = {
4234
- ...item,
4235
- ...patch
4236
- };
4237
- if (dropsSchedule) delete out["Schedule"];
4238
- return out;
4239
- }
4240
- function effectiveAnalyticsItem(item, sent) {
4241
- const storageClassAnalysis = item["StorageClassAnalysis"];
4242
- if (!isPlainObject$3(storageClassAnalysis)) return item;
4243
- const dataExport = storageClassAnalysis["DataExport"];
4244
- if (!isPlainObject$3(dataExport)) return item;
4245
- const patch = {};
4246
- const outputSchemaVersion = sent?.outputSchemaVersion ?? declaredOrDefault(dataExport, "OutputSchemaVersion", "V_1");
4247
- if (!Object.is(dataExport["OutputSchemaVersion"], outputSchemaVersion)) patch["OutputSchemaVersion"] = outputSchemaVersion;
4248
- const destination = effectiveS3BucketDestination(dataExport["Destination"], sent?.format);
4249
- if (destination !== dataExport["Destination"]) patch["Destination"] = destination;
4250
- if (Object.keys(patch).length === 0) return item;
4251
- return {
4252
- ...item,
4253
- StorageClassAnalysis: {
4254
- ...storageClassAnalysis,
4255
- DataExport: {
4256
- ...dataExport,
4257
- ...patch
4258
- }
4259
- }
4260
- };
4261
- }
4262
- const INTELLIGENT_TIERING_DEFAULT_STATUS = "Enabled";
4263
- function effectiveIntelligentTieringItem(item) {
4264
- if (item["Status"] !== void 0) return item;
4265
- return {
4266
- ...item,
4267
- Status: INTELLIGENT_TIERING_DEFAULT_STATUS
4268
- };
4269
- }
4270
- function foldToleratedAliases(bag, aliases) {
4271
- let out;
4272
- for (const [emitted, tolerated] of aliases) {
4273
- if (bag[tolerated] === void 0) continue;
4274
- out ??= { ...bag };
4275
- out[emitted] = bag[emitted] ?? bag[tolerated];
4276
- delete out[tolerated];
4277
- }
4278
- return out ?? bag;
4279
- }
4280
- const TRANSITION_DATE_KEY = "TransitionDate";
4281
- const TRANSITION_ALIASES = [["TransitionInDays", "Days"], ["TransitionDate", "Date"]];
4282
- const EVENTBRIDGE_CONFIG_PATH = "AWS::S3::Bucket NotificationConfiguration.EventBridgeConfiguration";
4283
- const EVENTBRIDGE_CONFIG_KEY = "EventBridgeConfiguration";
4284
- const EVENTBRIDGE_DEFAULT_ENABLED = true;
4285
- function eventBridgeEnabledOf(eb) {
4286
- const declared = isPlainObject$3(eb) ? eb["EventBridgeEnabled"] : void 0;
4287
- return coerceCfnBoolean(declared) ?? true;
4288
- }
4289
- const NOTIFICATION_LIST_KEYS = [
4290
- "TopicConfigurations",
4291
- "QueueConfigurations",
4292
- "LambdaConfigurations"
4293
- ];
4294
- function dropEmptyNotificationFamilies(config) {
4295
- let out;
4296
- for (const listKey of NOTIFICATION_LIST_KEYS) {
4297
- const list = config[listKey];
4298
- if (!Array.isArray(list) || list.length > 0) continue;
4299
- out ??= { ...config };
4300
- delete out[listKey];
4301
- }
4302
- return out ?? config;
4303
- }
4304
- function foldNotificationEvents(item) {
4305
- const events = item["Events"];
4306
- if (events === void 0) return item;
4307
- const out = { ...item };
4308
- if (item["Event"] === void 0) {
4309
- if (!Array.isArray(events) || events.length !== 1) return item;
4310
- out["Event"] = events[0];
4311
- }
4312
- delete out["Events"];
4313
- return out;
4314
- }
4315
- function effectiveNotificationConfiguration(config) {
4316
- if (!isPlainObject$3(config)) return config;
4317
- let out = config;
4318
- for (const listKey of NOTIFICATION_LIST_KEYS) out = canonicalizeItemList(out, listKey, foldNotificationEvents);
4319
- out = dropEmptyNotificationFamilies(out);
4320
- return foldEventBridgeConfiguration(out);
4321
- }
4322
- function foldEventBridgeConfiguration(config) {
4323
- const eb = config[EVENTBRIDGE_CONFIG_KEY];
4324
- if (eb === void 0) return config;
4325
- if (eb !== null && configBooleanRefusal(eb, "EventBridgeEnabled", "AWS::S3::Bucket NotificationConfiguration.EventBridgeConfiguration")) return config;
4326
- const enabled = eb === null ? false : eventBridgeEnabledOf(eb);
4327
- const declared = isPlainObject$3(eb) ? eb["EventBridgeEnabled"] : void 0;
4328
- if (isPlainObject$3(eb) && Object.keys(eb).length === 1 && Object.is(declared, enabled)) return config;
4329
- return {
4330
- ...config,
4331
- [EVENTBRIDGE_CONFIG_KEY]: { EventBridgeEnabled: enabled }
4332
- };
4333
- }
4334
-
4335
- // src/utils/cfn-timestamp.ts
4336
- const OFFSETLESS_DATE_TIME = /^\d{4}-\d{2}-\d{2}[Tt ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/;
4337
- function parseCfnTimestamp(value) {
4338
- return new Date(OFFSETLESS_DATE_TIME.test(value) ? `${value}Z` : value);
4339
- }
4340
-
4341
- // src/provisioning/providers/s3-bucket/lifecycle-fold.ts
4342
- const LIFECYCLE_RULE_PATH = "AWS::S3::Bucket LifecycleConfiguration.Rules[]";
4343
- const LIFECYCLE_FILTER_PATH = `${LIFECYCLE_RULE_PATH}.Filter`;
4344
- const LIFECYCLE_TAG_FILTERS_PATH = `${LIFECYCLE_RULE_PATH}.TagFilters`;
4345
- const LIFECYCLE_DEFAULT_STATUS = "Enabled";
4346
- const LIFECYCLE_STATUS_KEY = "Status";
4347
- function lifecycleRuleScope(rule) {
4348
- const filter = rule["Filter"];
4349
- return {
4350
- prefix: filter?.["Prefix"] ?? rule["Prefix"],
4351
- tagFilters: filter?.["TagFilters"] ?? rule["TagFilters"],
4352
- sizeGt: filter?.["ObjectSizeGreaterThan"] ?? rule["ObjectSizeGreaterThan"],
4353
- sizeLt: filter?.["ObjectSizeLessThan"] ?? rule["ObjectSizeLessThan"]
4354
- };
4355
- }
4356
- function lifecycleRuleIsPlainPrefixOnly(rule) {
4357
- if (rule["Filter"] != null) return false;
4358
- const s = lifecycleRuleScope(rule);
4359
- return s.prefix !== void 0 && (s.tagFilters == null || s.tagFilters.length === 0) && s.sizeGt === void 0 && s.sizeLt === void 0;
4360
- }
4361
- function lifecycleUsesFilterForm(rules) {
4362
- return !rules.every(lifecycleRuleIsPlainPrefixOnly);
4363
- }
4364
- const IGNORE_REFUSAL_MESSAGE = () => {};
4365
- function lifecycleRuleRefused(rule) {
4366
- const rawFilter = rule["Filter"];
4367
- if (rawFilter != null && requireConfigObject(rawFilter, "AWS::S3::Bucket LifecycleConfiguration.Rules[].Filter", { onUnusable: IGNORE_REFUSAL_MESSAGE }) === void 0) return true;
4368
- const rawTagFilters = rawFilter?.["TagFilters"] ?? rule["TagFilters"];
4369
- if (rawTagFilters != null && requireConfigArray(rawTagFilters, "AWS::S3::Bucket LifecycleConfiguration.Rules[].TagFilters", { onUnusable: IGNORE_REFUSAL_MESSAGE }) === void 0) return true;
4370
- return configStringRefusal(rule, "Status", LIFECYCLE_DEFAULT_STATUS, LIFECYCLE_RULE_PATH) !== void 0;
4371
- }
4372
- function deepSameValue(a, b) {
4373
- if (Object.is(a, b)) return true;
4374
- if (Array.isArray(a) || Array.isArray(b)) {
4375
- if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
4376
- return a.every((element, index) => deepSameValue(element, b[index]));
4377
- }
4378
- if (isPlainObject$3(a) && isPlainObject$3(b)) {
4379
- const keysA = Object.keys(a);
4380
- if (keysA.length !== Object.keys(b).length) return false;
4381
- return keysA.every((key) => Object.hasOwn(b, key) && deepSameValue(a[key], b[key]));
4382
- }
4383
- return false;
4384
- }
4385
- const TIMEZONE_INDEPENDENT_DATE = /^\d{4}-\d{2}-\d{2}([Tt ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})?)?$/;
4386
- function cfnDateToIso(value) {
4387
- let parsed;
4388
- if (typeof value === "string") {
4389
- if (!TIMEZONE_INDEPENDENT_DATE.test(value)) return void 0;
4390
- parsed = parseCfnTimestamp(value);
4391
- } else if (typeof value === "number") parsed = new Date(value);
4392
- else return;
4393
- return Number.isNaN(parsed.getTime()) ? void 0 : parsed.toISOString();
4394
- }
4395
- const LEGACY_SINGULAR_TRANSITIONS = [["Transitions", "Transition"], ["NoncurrentVersionTransitions", "NoncurrentVersionTransition"]];
4396
- function foldLegacySingularTransitions(rule) {
4397
- let out;
4398
- for (const [pluralKey, singularKey] of LEGACY_SINGULAR_TRANSITIONS) {
4399
- const singular = rule[singularKey];
4400
- const hasSingular = isPlainObject$3(singular);
4401
- const plural = rule[pluralKey];
4402
- const needsFilter = Array.isArray(plural) && plural.some((element) => !isPlainObject$3(element));
4403
- if (!hasSingular && !needsFilter) continue;
4404
- let collided = false;
4405
- const merged = mergeLegacySingular(plural, hasSingular ? singular : void 0, () => {
4406
- collided = true;
4407
- });
4408
- out ??= { ...rule };
4409
- if (collided) {
4410
- if (needsFilter) out[pluralKey] = merged;
4411
- continue;
4412
- }
4413
- out[pluralKey] = merged;
4414
- if (hasSingular) delete out[singularKey];
4415
- }
4416
- return out ?? rule;
4417
- }
4418
- function foldTransitionDate(item) {
4419
- const declared = item[TRANSITION_DATE_KEY];
4420
- if (!declared) return item;
4421
- const iso = cfnDateToIso(declared);
4422
- if (iso === void 0 || iso === declared) return item;
4423
- const out = { ...item };
4424
- out[TRANSITION_DATE_KEY] = iso;
4425
- return out;
4426
- }
4427
- function dropEmptyTransitionLists(rule) {
4428
- let out;
4429
- for (const [pluralKey] of LEGACY_SINGULAR_TRANSITIONS) {
4430
- const list = rule[pluralKey];
4431
- if (!Array.isArray(list) || list.length > 0) continue;
4432
- out ??= { ...rule };
4433
- delete out[pluralKey];
4434
- }
4435
- return out ?? rule;
4436
- }
4437
- function foldLifecycleExpiration(rule) {
4438
- const declaredMarker = rule["ExpiredObjectDeleteMarker"];
4439
- const ruleLevelMarker = coerceCfnBoolean(declaredMarker);
4440
- if (declaredMarker !== void 0 && ruleLevelMarker === void 0) return rule;
4441
- if (rule["ExpirationInDays"] === void 0 && rule["ExpirationDate"] === void 0 && rule["Expiration"] === void 0 && declaredMarker === void 0) return rule;
4442
- const expiration = rule["ExpirationInDays"] || rule["ExpirationDate"] || rule["Expiration"];
4443
- let days;
4444
- let date;
4445
- let marker;
4446
- if (typeof expiration === "number") days = expiration;
4447
- else if (typeof expiration === "string") {
4448
- const iso = cfnDateToIso(expiration);
4449
- if (iso === void 0) return rule;
4450
- date = iso;
4451
- } else if (isPlainObject$3(expiration)) {
4452
- if (expiration["Days"] !== void 0) days = expiration["Days"];
4453
- if (expiration["Date"]) {
4454
- const iso = cfnDateToIso(expiration["Date"]);
4455
- if (iso === void 0) return rule;
4456
- date = iso;
4457
- }
4458
- const nested = expiration["ExpiredObjectDeleteMarker"];
4459
- if (nested !== void 0) {
4460
- if (typeof nested !== "boolean") return rule;
4461
- marker = nested;
4462
- }
4463
- } else if (expiration) return rule;
4464
- if (ruleLevelMarker === true) {
4465
- if (days !== void 0 || date !== void 0) return rule;
4466
- days = void 0;
4467
- date = void 0;
4468
- marker = true;
4469
- }
4470
- const out = { ...rule };
4471
- delete out["ExpirationInDays"];
4472
- delete out["ExpirationDate"];
4473
- delete out["Expiration"];
4474
- delete out["ExpiredObjectDeleteMarker"];
4475
- if (days !== void 0) out["ExpirationInDays"] = days;
4476
- if (date !== void 0) out["ExpirationDate"] = date;
4477
- if (marker !== void 0) out["ExpiredObjectDeleteMarker"] = marker;
4478
- return out;
4479
- }
4480
- function foldNoncurrentVersionExpiration(rule) {
4481
- const legacy = rule["NoncurrentVersionExpirationInDays"];
4482
- if (legacy === void 0) return rule;
4483
- const declaredObject = rule["NoncurrentVersionExpiration"];
4484
- if (declaredObject !== void 0 && !isPlainObject$3(declaredObject)) return rule;
4485
- const out = { ...rule };
4486
- delete out["NoncurrentVersionExpirationInDays"];
4487
- if (isPlainObject$3(declaredObject)) return out;
4488
- const days = coerceCfnNumber(legacy);
4489
- if (days === void 0) return rule;
4490
- out["NoncurrentVersionExpiration"] = { NoncurrentDays: days };
4491
- return out;
4492
- }
4493
- function foldLifecycleScope(rule, useFilterForm) {
4494
- const { prefix, tagFilters, sizeGt, sizeLt } = lifecycleRuleScope(rule);
4495
- const hasTags = tagFilters != null && tagFilters.length > 0;
4496
- const componentCount = (hasTags ? 1 : 0) + (prefix !== void 0 ? 1 : 0) + (sizeGt !== void 0 ? 1 : 0) + (sizeLt !== void 0 ? 1 : 0);
4497
- let filter;
4498
- if (componentCount > 1) {
4499
- filter = {};
4500
- if (prefix !== void 0) filter["Prefix"] = prefix;
4501
- if (hasTags) filter["TagFilters"] = tagFilters;
4502
- if (sizeGt !== void 0) filter["ObjectSizeGreaterThan"] = sizeGt;
4503
- if (sizeLt !== void 0) filter["ObjectSizeLessThan"] = sizeLt;
4504
- } else if (hasTags) filter = { TagFilters: tagFilters };
4505
- else if (sizeGt !== void 0) filter = { ObjectSizeGreaterThan: sizeGt };
4506
- else if (sizeLt !== void 0) filter = { ObjectSizeLessThan: sizeLt };
4507
- else if (useFilterForm) filter = { Prefix: prefix ?? "" };
4508
- const out = { ...rule };
4509
- delete out["Filter"];
4510
- delete out["Prefix"];
4511
- delete out["TagFilters"];
4512
- delete out["ObjectSizeGreaterThan"];
4513
- delete out["ObjectSizeLessThan"];
4514
- if (filter !== void 0) out["Filter"] = filter;
4515
- else if (prefix !== void 0) out["Prefix"] = prefix;
4516
- return out;
4517
- }
4518
- function effectiveLifecycleConfiguration(config) {
4519
- if (!isPlainObject$3(config)) return config;
4520
- const rules = config["Rules"];
4521
- if (!Array.isArray(rules)) return config;
4522
- const objectRules = rules.filter(isPlainObject$3);
4523
- if (objectRules.length !== rules.length || objectRules.length === 0) return config;
4524
- if (objectRules.some(lifecycleRuleRefused)) return config;
4525
- const useFilterForm = lifecycleUsesFilterForm(objectRules);
4526
- return canonicalizeItemList(config, "Rules", (rule) => effectiveLifecycleRule(rule, useFilterForm));
4527
- }
4528
- function effectiveLifecycleRule(rule, useFilterForm) {
4529
- let out = foldLegacySingularTransitions(rule);
4530
- out = canonicalizeItemList(out, "Transitions", (t) => foldTransitionDate(foldToleratedAliases(t, TRANSITION_ALIASES)));
4531
- out = dropEmptyTransitionLists(out);
4532
- out = foldLifecycleExpiration(out);
4533
- out = foldNoncurrentVersionExpiration(out);
4534
- out = foldLifecycleScope(out, useFilterForm);
4535
- if (out["Status"] === void 0) {
4536
- const withStatus = { ...out };
4537
- withStatus[LIFECYCLE_STATUS_KEY] = LIFECYCLE_DEFAULT_STATUS;
4538
- out = withStatus;
4539
- }
4540
- return deepSameValue(rule, out) ? rule : out;
4541
- }
4542
- function canonicalizeBlock(properties, key, fold) {
4543
- const folded = fold(properties[key]);
4544
- return folded === properties[key] ? properties : {
4545
- ...properties,
4546
- [key]: folded
4547
- };
4548
- }
4549
- function canonicalizeItemList(properties, key, fold) {
4550
- const list = properties[key];
4551
- if (!Array.isArray(list)) return properties;
4552
- let changed = false;
4553
- const mapped = list.map((element) => {
4554
- if (!isPlainObject$3(element)) return element;
4555
- const next = fold(element);
4556
- if (next !== element) changed = true;
4557
- return next;
4558
- });
4559
- return changed ? {
4560
- ...properties,
4561
- [key]: mapped
4562
- } : properties;
4563
- }
4564
-
4565
4140
  // src/provisioning/providers/s3-bucket/sub-config.ts
4566
4141
  function emptyListConfigToUndefined(config, listKey) {
4567
4142
  if (config === void 0 || config === null) return void 0;
@@ -5069,6 +4644,7 @@ async function applyLifecycleConfiguration(bucketName, lifecycleConfig, onUnusab
5069
4644
  LifecycleConfiguration: { Rules: rules },
5070
4645
  TransitionDefaultMinimumObjectSize: lifecycleConfig["TransitionDefaultMinimumObjectSize"]
5071
4646
  }));
4647
+ recordLifecycleWrite(this, bucketName, "put");
5072
4648
  this.logger.debug(`Applied lifecycle configuration to bucket ${this.shown(bucketName)}`);
5073
4649
  return true;
5074
4650
  }
@@ -5696,6 +5272,7 @@ async function applySubConfigDiffs(bucketName, properties, previousProperties, c
5696
5272
  if (!cfg.Rules || !Array.isArray(cfg.Rules) || cfg.Rules.length === 0) {
5697
5273
  if (context?.desiredFromAwsReadback === true) {
5698
5274
  await this.s3Client.send(new DeleteBucketLifecycleCommand({ Bucket: bucketName }));
5275
+ recordLifecycleWrite(this, bucketName, "delete");
5699
5276
  this.logger.debug(`Deleted lifecycle configuration on bucket ${this.shown(bucketName)} (reverting to an unset baseline)`);
5700
5277
  return;
5701
5278
  }
@@ -5706,6 +5283,7 @@ async function applySubConfigDiffs(bucketName, properties, previousProperties, c
5706
5283
  else recordEffectiveFold("LifecycleConfiguration", effectiveLifecycleConfiguration(cfg));
5707
5284
  }, async () => {
5708
5285
  await this.s3Client.send(new DeleteBucketLifecycleCommand({ Bucket: bucketName }));
5286
+ recordLifecycleWrite(this, bucketName, "delete");
5709
5287
  this.logger.debug(`Deleted lifecycle configuration on bucket ${this.shown(bucketName)}`);
5710
5288
  });
5711
5289
  await this.diffSubConfig(bucketName, previousProperties["CorsConfiguration"], properties["CorsConfiguration"], async (cfg) => {
@@ -5836,7 +5414,13 @@ async function applySubConfigDiffs(bucketName, properties, previousProperties, c
5836
5414
  async function update$39(logicalId, physicalId, resourceType, properties, previousProperties, context) {
5837
5415
  if (this.opMask === void 0) {
5838
5416
  const sinks = withDerivedNameMasks(this.logger, createMaskedLogSinks(this.logger, context?.maskSecrets), [[previousProperties["BucketName"], physicalId], [previousProperties["BucketNamePrefix"], physicalId]]);
5839
- return this.maskedView(sinks).update(logicalId, physicalId, resourceType, properties, previousProperties, context);
5417
+ const view = this.maskedView(sinks);
5418
+ try {
5419
+ return await view.update(logicalId, physicalId, resourceType, properties, previousProperties, context);
5420
+ } catch (err) {
5421
+ clearLifecycleWritesOf(view);
5422
+ throw err;
5423
+ }
5840
5424
  }
5841
5425
  this.logger.debug(`Updating S3 bucket ${displaySafe(logicalId)}: ${this.shown(physicalId)}`);
5842
5426
  refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
@@ -6064,7 +5648,13 @@ async function create$38(logicalId, resourceType, properties, context) {
6064
5648
  const prefix = properties["BucketNamePrefix"];
6065
5649
  const derivedName = typeof prefix === "string" && prefix !== "" && bucketNameRefusal(properties) === void 0 ? await this.accountRegionalBucketName(prefix) : void 0;
6066
5650
  const view = withDerivedNameMasks(this.logger, sinks, [[prefix, derivedName]]);
6067
- return this.maskedView(view).create(logicalId, resourceType, properties, context);
5651
+ const opView = this.maskedView(view);
5652
+ try {
5653
+ return await opView.create(logicalId, resourceType, properties, context);
5654
+ } catch (err) {
5655
+ clearLifecycleWritesOf(opView);
5656
+ throw err;
5657
+ }
6068
5658
  }
6069
5659
  this.logger.debug(`Creating S3 bucket ${displaySafe(logicalId)}`);
6070
5660
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
@@ -6236,8 +5826,49 @@ async function create$38(logicalId, resourceType, properties, context) {
6236
5826
  }
6237
5827
  }
6238
5828
 
5829
+ // src/provisioning/providers/s3-bucket/survivor-identity.ts
5830
+ const UNKNOWN = { kind: "unknown" };
5831
+ async function replacedSurvivorIdentity(physicalId, resourceType, context) {
5832
+ try {
5833
+ if (resourceType !== "AWS::S3::Bucket" || !isPlainBucketName(physicalId)) return UNKNOWN;
5834
+ const want = canonicalizeRegion(context.expectedRegion);
5835
+ if (canonicalizeRegion(await this.getRegion()) !== want) return UNKNOWN;
5836
+ const probe = await this.probeBucketRegion(physicalId);
5837
+ if (probe.kind === "absent") return { kind: "gone" };
5838
+ const started = Date.now();
5839
+ for (let attempt = 0; attempt < 3; attempt++) {
5840
+ if (attempt > 0) {
5841
+ if (Date.now() - started > 6e3) break;
5842
+ await new Promise((r) => setTimeout(r, BUCKET_LIST_IDENTITY_DELAY_MS));
5843
+ }
5844
+ const listed = await this.listOwnedBucket(physicalId);
5845
+ if ("unknown" in listed) return UNKNOWN;
5846
+ if (listed.bucket === void 0) continue;
5847
+ if (probe.kind !== "region") return {
5848
+ kind: "owned",
5849
+ identity: void 0
5850
+ };
5851
+ if (probe.region !== want) return {
5852
+ kind: "foreign",
5853
+ seen: "other-region"
5854
+ };
5855
+ const created = listed.bucket.CreationDate;
5856
+ return {
5857
+ kind: "owned",
5858
+ identity: created instanceof Date && !Number.isNaN(created.getTime()) ? `${want}|${created.toISOString()}` : void 0
5859
+ };
5860
+ }
5861
+ return probe.kind === "region" || probe.kind === "indeterminate" && probe.errorName === "AccessDenied" ? {
5862
+ kind: "foreign",
5863
+ seen: "other-account"
5864
+ } : UNKNOWN;
5865
+ } catch {
5866
+ return UNKNOWN;
5867
+ }
5868
+ }
5869
+
6239
5870
  // src/provisioning/providers/s3-bucket/read-state.ts
6240
- async function readCurrentState$37(physicalId, logicalId, _resourceType, _properties, context) {
5871
+ async function readCurrentState$38(physicalId, logicalId, _resourceType, _properties, context) {
6241
5872
  const headAttempts = context?.afterOwnWrite === true ? 5 : 1;
6242
5873
  for (let attempt = 1;; attempt++) try {
6243
5874
  await this.s3Client.send(new HeadBucketCommand({ Bucket: physicalId }));
@@ -6254,13 +5885,15 @@ async function readCurrentState$37(physicalId, logicalId, _resourceType, _proper
6254
5885
  }
6255
5886
  throw err;
6256
5887
  }
5888
+ const lifecycleWrite = context?.afterOwnWrite === true ? takeLifecycleWrite(this.s3Client, physicalId) : void 0;
5889
+ const lifecycleDeclared = lifecycleSettleTarget(lifecycleWrite, _properties, () => warnUnsettledMember(this.logger, logicalId, "AWS::S3::Bucket", "LifecycleConfiguration"));
6257
5890
  const [versioning, encryption, ownership, pab, tags, lifecycle, cors, website, logging, notification, replication, objectLock, accelerate, metrics, analytics, intelligentTier, inventory, abac, metadata] = await Promise.all([
6258
5891
  this.readVersioning(physicalId),
6259
5892
  this.readEncryption(physicalId),
6260
5893
  this.readOwnershipControls(physicalId),
6261
5894
  this.readPublicAccessBlock(physicalId),
6262
5895
  this.readTags(physicalId),
6263
- this.readLifecycle(physicalId),
5896
+ lifecycleDeclared === void 0 ? this.readLifecycle(physicalId) : this.readLifecycleBaseline(physicalId, lifecycleDeclared),
6264
5897
  this.readCors(physicalId),
6265
5898
  this.readWebsite(physicalId),
6266
5899
  this.readLogging(physicalId),
@@ -6282,7 +5915,7 @@ async function readCurrentState$37(physicalId, logicalId, _resourceType, _proper
6282
5915
  OwnershipControls: ownership,
6283
5916
  PublicAccessBlockConfiguration: pab,
6284
5917
  Tags: tags,
6285
- LifecycleConfiguration: lifecycle,
5918
+ ...lifecycle !== void 0 ? { LifecycleConfiguration: lifecycle } : {},
6286
5919
  CorsConfiguration: cors,
6287
5920
  WebsiteConfiguration: website,
6288
5921
  LoggingConfiguration: logging,
@@ -6760,7 +6393,7 @@ var S3BucketProvider = class {
6760
6393
  return canonicalizeDesiredProperties$3.call(this, resourceType, properties);
6761
6394
  }
6762
6395
  readCurrentState(physicalId, logicalId, _resourceType, _properties, context) {
6763
- return readCurrentState$37.call(this, physicalId, logicalId, _resourceType, _properties, context);
6396
+ return readCurrentState$38.call(this, physicalId, logicalId, _resourceType, _properties, context);
6764
6397
  }
6765
6398
  getDriftAbsentMeansDefaultKeys(_resourceType, properties) {
6766
6399
  return getDriftAbsentMeansDefaultKeys.call(this, _resourceType, properties);
@@ -6786,6 +6419,10 @@ var S3BucketProvider = class {
6786
6419
  readLifecycle(bucket) {
6787
6420
  return readLifecycle$1.call(this, bucket);
6788
6421
  }
6422
+ lifecycleBaselineRereadDelaysMs = LIFECYCLE_BASELINE_REREAD_DELAYS_MS;
6423
+ readLifecycleBaseline(bucket, declared) {
6424
+ return settleLifecycleRead(() => this.readLifecycle(bucket), declared, this.lifecycleBaselineRereadDelaysMs);
6425
+ }
6789
6426
  readCors(bucket) {
6790
6427
  return readCors.call(this, bucket);
6791
6428
  }
@@ -6849,6 +6486,9 @@ var S3BucketProvider = class {
6849
6486
  resourceIdentity(physicalId, resourceType, context) {
6850
6487
  return resourceIdentity$6.call(this, physicalId, resourceType, context);
6851
6488
  }
6489
+ replacedSurvivorIdentity(physicalId, resourceType, context) {
6490
+ return replacedSurvivorIdentity.call(this, physicalId, resourceType, context);
6491
+ }
6852
6492
  generatedCreateName(_resourceType, logicalId, properties) {
6853
6493
  return generatedCreateName$3.call(this, _resourceType, logicalId, properties);
6854
6494
  }
@@ -6904,10 +6544,14 @@ function withoutInsecureTransportDenies(document) {
6904
6544
  };
6905
6545
  const kept = statements.filter((statement) => !isInsecureTransportDeny(statement));
6906
6546
  const dropped = statements.length - kept.length;
6907
- if (dropped === 0 || kept.length === 0) return {
6547
+ if (dropped === 0) return {
6908
6548
  document,
6909
6549
  dropped: 0
6910
6550
  };
6551
+ if (kept.length === 0) return {
6552
+ document: void 0,
6553
+ dropped
6554
+ };
6911
6555
  return {
6912
6556
  document: {
6913
6557
  ...parsed,
@@ -6920,19 +6564,37 @@ function sentPolicyDocument(document) {
6920
6564
  if (!awsEndpointOverrideActive()) return document;
6921
6565
  return withoutInsecureTransportDenies(document).document;
6922
6566
  }
6567
+ function sendsNoPolicy(document) {
6568
+ return document != null && sentPolicyDocument(document) === void 0;
6569
+ }
6923
6570
  function policyDocumentForEmulator(document, resourceType, logicalId) {
6924
6571
  if (!awsEndpointOverrideActive()) return document;
6925
6572
  const { document: sent, dropped } = withoutInsecureTransportDenies(document);
6926
6573
  if (dropped === 0) return document;
6927
6574
  const what = dropped === 1 ? "a Deny statement" : `${dropped} Deny statements`;
6928
- getLogger().warn(safeMsg`--aws-emulator: left ${what} on aws:SecureTransport out of ${logicalId} (${resourceType}): AWS Emulator does not evaluate that key, so the statement would deny every request; on AWS it never matches an HTTPS request. The state record keeps the templated policy.`);
6575
+ const outcome = sent === void 0 ? ", which leaves no statement, so no policy is set" : "";
6576
+ getLogger().warn(safeMsg`--aws-emulator: left ${what} on aws:SecureTransport out of ${logicalId} (${resourceType})${outcome}: AWS Emulator does not evaluate that key, so the statement would deny every request; on AWS it never matches an HTTPS request. The state record keeps the templated policy.`);
6929
6577
  return sent;
6930
6578
  }
6931
6579
  function serializeResourcePolicy(document, resourceType, logicalId) {
6932
6580
  const sent = policyDocumentForEmulator(document, resourceType, logicalId);
6581
+ if (sent === void 0) return void 0;
6933
6582
  return typeof sent === "string" ? sent : JSON.stringify(sent);
6934
6583
  }
6935
6584
 
6585
+ // src/provisioning/s3-bucket-policy-helpers.ts
6586
+ function isS3BucketName(value) {
6587
+ if (value.length < 3 || value.length > 63) return false;
6588
+ if (!/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(value)) return false;
6589
+ if (value.includes("..")) return false;
6590
+ if (value.startsWith("xn--")) return false;
6591
+ if (value.endsWith("-s3alias") || value.endsWith("--ol-s3")) return false;
6592
+ return true;
6593
+ }
6594
+ function ownPolicyHolder(logicalId, bucketName) {
6595
+ for (const [otherId, record] of getStackRecords()?.live() ?? []) if (otherId !== logicalId && record.resourceType === "AWS::S3::BucketPolicy" && record.physicalId === bucketName) return otherId;
6596
+ }
6597
+
6936
6598
  // src/provisioning/providers/s3-bucket-policy-provider.ts
6937
6599
  const OAI_USER_ARN_RE = /^arn:aws[a-z-]*:iam::cloudfront:user\/CloudFront Origin Access Identity ([A-Z0-9]+)$/;
6938
6600
  const IAM_UNIQUE_ID_RE = /^AIDA[A-Z0-9]{12,}$/;
@@ -6991,7 +6653,18 @@ var S3BucketPolicyProvider = class {
6991
6653
  } catch (error) {
6992
6654
  throw this.wrapOperationError("create", logicalId, resourceType, bucketName, error, context?.maskSecrets);
6993
6655
  }
6994
- await this.decideOnExistingPolicy(logicalId, resourceType, bucketName, policyDoc, existing, context?.replayingState === true, mask);
6656
+ await this.decideOnExistingPolicy(logicalId, resourceType, bucketName, policyDoc ?? (typeof policyDocument === "string" ? policyDocument : JSON.stringify(policyDocument)), existing, context?.replayingState === true, mask);
6657
+ if (policyDoc === void 0) {
6658
+ if (existing.kind === "present") try {
6659
+ await this.s3Client.send(new DeleteBucketPolicyCommand({ Bucket: bucketName }));
6660
+ } catch (error) {
6661
+ if (error.name !== "NoSuchBucketPolicy") throw this.wrapOperationError("create", logicalId, resourceType, bucketName, error, context?.maskSecrets);
6662
+ }
6663
+ return {
6664
+ physicalId: bucketName,
6665
+ attributes: {}
6666
+ };
6667
+ }
6995
6668
  try {
6996
6669
  await this.s3Client.send(new PutBucketPolicyCommand({
6997
6670
  Bucket: bucketName,
@@ -7016,7 +6689,12 @@ var S3BucketPolicyProvider = class {
7016
6689
  if (!policyDocument) throw new ProvisioningError(`PolicyDocument is required for S3 bucket policy ${logicalId}`, resourceType, logicalId, physicalId);
7017
6690
  try {
7018
6691
  const policyDoc = serializeResourcePolicy(policyDocument, resourceType, logicalId);
7019
- await this.s3Client.send(new PutBucketPolicyCommand({
6692
+ if (policyDoc === void 0) try {
6693
+ await this.s3Client.send(new DeleteBucketPolicyCommand({ Bucket: bucketName }));
6694
+ } catch (error) {
6695
+ if (error.name !== "NoSuchBucketPolicy") throw error;
6696
+ }
6697
+ else await this.s3Client.send(new PutBucketPolicyCommand({
7020
6698
  Bucket: bucketName,
7021
6699
  Policy: policyDoc
7022
6700
  }));
@@ -7173,7 +6851,10 @@ var S3BucketPolicyProvider = class {
7173
6851
  policyJson = (await this.s3Client.send(new GetBucketPolicyCommand({ Bucket: physicalId }))).Policy;
7174
6852
  } catch (err) {
7175
6853
  if (err instanceof NoSuchBucket) return RESOURCE_NOT_FOUND;
7176
- if (err.name === "NoSuchBucketPolicy") return RESOURCE_NOT_FOUND;
6854
+ if (err.name === "NoSuchBucketPolicy") {
6855
+ if (properties !== void 0 && sendsNoPolicy(properties["PolicyDocument"])) return { ...properties };
6856
+ return RESOURCE_NOT_FOUND;
6857
+ }
7177
6858
  throw err;
7178
6859
  }
7179
6860
  if (!policyJson) return void 0;
@@ -7240,17 +6921,6 @@ var S3BucketPolicyProvider = class {
7240
6921
  throw new Error(`Cannot determine bucket name for ${refusalTypeShown(input.resourceType)} ${logicalIdShown(input.logicalId)}.${knownNote}${bucketNote} Re-run with --resource ${remedyLogicalId(input.logicalId)}=${commandHole("bucketName")} (e.g. my-bucket-12345) to point cdkd at the bucket this policy is attached to.`);
7241
6922
  }
7242
6923
  };
7243
- function isS3BucketName(value) {
7244
- if (value.length < 3 || value.length > 63) return false;
7245
- if (!/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(value)) return false;
7246
- if (value.includes("..")) return false;
7247
- if (value.startsWith("xn--")) return false;
7248
- if (value.endsWith("-s3alias") || value.endsWith("--ol-s3")) return false;
7249
- return true;
7250
- }
7251
- function ownPolicyHolder(logicalId, bucketName) {
7252
- for (const [otherId, record] of getStackRecords()?.live() ?? []) if (otherId !== logicalId && record.resourceType === "AWS::S3::BucketPolicy" && record.physicalId === bucketName) return otherId;
7253
- }
7254
6924
 
7255
6925
  // src/provisioning/providers/sqs-queue-provider.ts
7256
6926
  function serializeRedrivePolicy(value) {
@@ -7612,7 +7282,7 @@ var SQSQueuePolicyProvider = class {
7612
7282
  this.logger.debug(`Setting policy for queue: ${queueUrl}`);
7613
7283
  await this.sqsClient.send(new SetQueueAttributesCommand({
7614
7284
  QueueUrl: queueUrl,
7615
- Attributes: { Policy: policyDoc }
7285
+ Attributes: { Policy: policyDoc ?? "" }
7616
7286
  }));
7617
7287
  applied.push(queueUrl);
7618
7288
  }
@@ -7642,7 +7312,7 @@ var SQSQueuePolicyProvider = class {
7642
7312
  this.logger.debug(`Updating policy for queue: ${queueUrl}`);
7643
7313
  await this.sqsClient.send(new SetQueueAttributesCommand({
7644
7314
  QueueUrl: queueUrl,
7645
- Attributes: { Policy: policyDoc }
7315
+ Attributes: { Policy: policyDoc ?? "" }
7646
7316
  }));
7647
7317
  }
7648
7318
  for (const queueUrl of removed) await this.clearQueuePolicy(queueUrl, resourceType, logicalId, context?.expectedRegion, "pre-update");
@@ -7757,6 +7427,7 @@ var SQSQueuePolicyProvider = class {
7757
7427
  async queuesCarryingDocument(candidates, document, logicalId) {
7758
7428
  const carrying = [];
7759
7429
  if (candidates.length === 0) return carrying;
7430
+ if (sendsNoPolicy(document)) return carrying;
7760
7431
  const reference = policyReference(sentPolicyDocument(document));
7761
7432
  if (reference === void 0) {
7762
7433
  this.logger.warn(safeMsg`The queues ${candidates.join(", ")} listed by ${logicalId} were not checked (no policy document recorded to compare with) and may still carry its policy.`);
@@ -7790,6 +7461,10 @@ var SQSQueuePolicyProvider = class {
7790
7461
  }
7791
7462
  }
7792
7463
  async readCurrentState(physicalId, _logicalId, _resourceType, properties, context) {
7464
+ if (properties !== void 0 && sendsNoPolicy(properties["PolicyDocument"])) {
7465
+ const read = await this.readQueuePolicy(physicalId);
7466
+ return read === RESOURCE_NOT_FOUND ? { ...properties } : read;
7467
+ }
7793
7468
  const declared = context?.afterOwnWrite === true ? declaredPolicyDocument(properties) : void 0;
7794
7469
  if (declared === void 0) return this.readQueuePolicy(physicalId);
7795
7470
  const queueCount = splitQueueUrls(physicalId).length;
@@ -8330,7 +8005,7 @@ async function deleteImpl$36(logicalId, physicalId, resourceType, _properties, c
8330
8005
  }
8331
8006
 
8332
8007
  // src/provisioning/providers/sns-topic/read-state.ts
8333
- async function readCurrentState$36(physicalId, _logicalId, _resourceType, properties) {
8008
+ async function readCurrentState$37(physicalId, _logicalId, _resourceType, properties) {
8334
8009
  let attrs;
8335
8010
  try {
8336
8011
  attrs = (await this.snsClient.send(new GetTopicAttributesCommand({ TopicArn: physicalId }))).Attributes;
@@ -8501,7 +8176,7 @@ var SNSTopicProvider = class {
8501
8176
  }
8502
8177
  }
8503
8178
  readCurrentState(physicalId, logicalId, resourceType, properties) {
8504
- return readCurrentState$36.call(this, physicalId, logicalId, resourceType, properties);
8179
+ return readCurrentState$37.call(this, physicalId, logicalId, resourceType, properties);
8505
8180
  }
8506
8181
  getDriftUnknownPaths() {
8507
8182
  return [];
@@ -8597,7 +8272,10 @@ var SNSSubscriptionProvider = class {
8597
8272
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
8598
8273
  this.logger.debug(`Updating SNS subscription ${logicalId}: ${physicalId}`);
8599
8274
  const plan = await this.planInPlaceUpdate(logicalId, physicalId, resourceType, properties, context);
8600
- if (plan === void 0) return this.replace(logicalId, physicalId, resourceType, properties, context);
8275
+ if (!Array.isArray(plan)) {
8276
+ if (isDriftRevert(context)) throw revertReplacementRefusal(resourceType, logicalId, plan.replace);
8277
+ return this.replace(logicalId, physicalId, resourceType, properties, context);
8278
+ }
8601
8279
  const mask = maskerOrIdentity(context?.maskSecrets);
8602
8280
  for (const [name, value] of plan) try {
8603
8281
  await this.snsClient.send(new SetSubscriptionAttributesCommand({
@@ -8617,21 +8295,22 @@ var SNSSubscriptionProvider = class {
8617
8295
  };
8618
8296
  }
8619
8297
  async planInPlaceUpdate(logicalId, physicalId, resourceType, properties, context) {
8620
- if (physicalId === "PendingConfirmation" || physicalId === "pending confirmation") return;
8298
+ if (physicalId === "PendingConfirmation" || physicalId === "pending confirmation") return { replace: "its record names the PendingConfirmation placeholder, not a subscription" };
8621
8299
  let current;
8622
8300
  try {
8623
8301
  current = (await this.snsClient.send(new GetSubscriptionAttributesCommand({ SubscriptionArn: physicalId })))?.Attributes;
8624
8302
  } catch (error) {
8625
- if (error instanceof NotFoundException) return void 0;
8303
+ if (error instanceof NotFoundException) return { replace: "AWS no longer has the subscription" };
8626
8304
  throw this.wrapMaskedAwsCallError(maskerOrIdentity(context?.maskSecrets), error, `Failed to update SNS subscription ${logicalId}: could not read its attributes`, resourceType, logicalId, physicalId);
8627
8305
  }
8628
- if (current === void 0 || current["PendingConfirmation"] === "true") return void 0;
8306
+ if (current === void 0) return { replace: "AWS returned no attributes for it" };
8307
+ if (current["PendingConfirmation"] === "true") return { replace: "the subscription is still PendingConfirmation" };
8629
8308
  for (const field of CREATE_ONLY_FIELDS) {
8630
8309
  const desired = properties[field];
8631
- if (desired !== void 0 && stringifyValue(desired) !== current[field]) return void 0;
8310
+ if (desired !== void 0 && stringifyValue(desired) !== current[field]) return { replace: `its ${field} differs from the live subscription's` };
8632
8311
  }
8633
8312
  const planned = planSubscriptionAttributes(current, properties);
8634
- return planned.kind === "replace" ? void 0 : planned.calls;
8313
+ return planned.kind === "replace" ? { replace: planned.reason } : planned.calls;
8635
8314
  }
8636
8315
  wrapMaskedAwsCallError(mask, error, prefix, resourceType, logicalId, physicalId) {
8637
8316
  const build = (text) => new ProvisioningError(`${prefix}: ${text}`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
@@ -8740,10 +8419,45 @@ function isPendingConfirmationError(error) {
8740
8419
  return error instanceof InvalidParameterException && error.message.toLowerCase().includes("pending confirmation");
8741
8420
  }
8742
8421
 
8743
- // src/provisioning/providers/sns-topic-policy-provider.ts
8422
+ // src/provisioning/sns-default-topic-policy.ts
8744
8423
  function isSnsDefaultPolicy(document) {
8745
8424
  return typeof document === "object" && document !== null && document["Id"] === "__default_policy_ID";
8746
8425
  }
8426
+ function isSnsTopicArn(value) {
8427
+ return /^arn:[a-z0-9-]+:sns:[a-z0-9-]+:\d{12}:[\w.-]+$/.test(value);
8428
+ }
8429
+ function defaultTopicPolicy(topicArn) {
8430
+ if (!isSnsTopicArn(topicArn)) return void 0;
8431
+ const account = topicArn.split(":")[4];
8432
+ return JSON.stringify({
8433
+ Version: "2008-10-17",
8434
+ Id: "__default_policy_ID",
8435
+ Statement: [{
8436
+ Sid: "__default_statement_ID",
8437
+ Effect: "Allow",
8438
+ Principal: { AWS: "*" },
8439
+ Action: [
8440
+ "SNS:GetTopicAttributes",
8441
+ "SNS:SetTopicAttributes",
8442
+ "SNS:AddPermission",
8443
+ "SNS:RemovePermission",
8444
+ "SNS:DeleteTopic",
8445
+ "SNS:Subscribe",
8446
+ "SNS:ListSubscriptionsByTopic",
8447
+ "SNS:Publish"
8448
+ ],
8449
+ Resource: topicArn,
8450
+ Condition: { StringEquals: { "AWS:SourceOwner": account } }
8451
+ }]
8452
+ });
8453
+ }
8454
+ function defaultTopicPolicyOrThrow(topicArn, resourceType, logicalId) {
8455
+ const defaultPolicy = defaultTopicPolicy(topicArn);
8456
+ if (defaultPolicy === void 0) throw new ProvisioningError(`Cannot set SNS topic policy ${logicalId} on ${topicArn}: not an SNS topic ARN`, resourceType, logicalId, topicArn);
8457
+ return defaultPolicy;
8458
+ }
8459
+
8460
+ // src/provisioning/providers/sns-topic-policy-provider.ts
8747
8461
  const TOPIC_POLICY_UNREADABLE_SKIP_REASON = "the policy of a topic it wrote could not be read, so whether that topic still carries it is unknown";
8748
8462
  const TOPIC_POLICY_UNRESOLVED_DOCUMENT_SKIP_REASON = "the policy document it attempted could not be resolved right now to compare its topics with";
8749
8463
  const TOPIC_POLICY_MISMATCH_LEFT_REASON = "a topic it wrote carries a policy that does not match the document it attempted, so that topic was not reset";
@@ -8762,7 +8476,7 @@ var SNSTopicPolicyProvider = class {
8762
8476
  const applied = [];
8763
8477
  try {
8764
8478
  for (const topicArn of topics) {
8765
- await this.setTopicPolicy(topicArn, policyDoc);
8479
+ await this.setTopicPolicy(topicArn, policyDoc ?? defaultTopicPolicyOrThrow(topicArn, resourceType, logicalId));
8766
8480
  applied.push(topicArn);
8767
8481
  }
8768
8482
  this.logger.debug(`Successfully created SNS topic policy ${logicalId}`);
@@ -8795,7 +8509,7 @@ var SNSTopicPolicyProvider = class {
8795
8509
  }
8796
8510
  const removed = [...dropped.filter((arn) => isSnsTopicArn(arn)), ...listedOnly];
8797
8511
  try {
8798
- for (const topicArn of topics) await this.setTopicPolicy(topicArn, policyDoc);
8512
+ for (const topicArn of topics) await this.setTopicPolicy(topicArn, policyDoc ?? defaultTopicPolicyOrThrow(topicArn, resourceType, logicalId));
8799
8513
  for (const topicArn of removed) await this.resetTopicPolicy(topicArn, resourceType, logicalId, context?.expectedRegion, "not-found", mask);
8800
8514
  this.logger.debug(`Successfully updated SNS topic policy ${logicalId}`);
8801
8515
  return {
@@ -8845,6 +8559,10 @@ var SNSTopicPolicyProvider = class {
8845
8559
  };
8846
8560
  }
8847
8561
  const document = attempted.document;
8562
+ if (sendsNoPolicy(document)) {
8563
+ this.logger.debug(safeMsg`${logicalId} set no policy of its own; nothing to reset`);
8564
+ return;
8565
+ }
8848
8566
  const reference = policyContentKey(sentPolicyDocument(document));
8849
8567
  const fresh = new Set((context.writtenThisRun ?? []).flatMap((r) => r.resourceType === resourceType && typeof r.physicalId === "string" ? [...splitTopicArns(r.physicalId), ...listedTopics(r.properties !== null && typeof r.properties === "object" ? r.properties : {})] : []));
8850
8568
  let unreadable = false;
@@ -8921,6 +8639,7 @@ var SNSTopicPolicyProvider = class {
8921
8639
  }
8922
8640
  async topicsCarryingDocument(candidates, document, logicalId, mask) {
8923
8641
  if (candidates.length === 0) return [];
8642
+ if (sendsNoPolicy(document)) return [];
8924
8643
  const sent = sentPolicyDocument(document);
8925
8644
  let reference;
8926
8645
  if (typeof sent === "string" && sent.length > 0) reference = canonicalPolicy(sent);
@@ -8955,6 +8674,10 @@ var SNSTopicPolicyProvider = class {
8955
8674
  }
8956
8675
  }
8957
8676
  async readCurrentState(physicalId, _logicalId, _resourceType, properties, context) {
8677
+ if (properties !== void 0 && sendsNoPolicy(properties["PolicyDocument"])) {
8678
+ const read = await this.readTopicPolicy(physicalId);
8679
+ return read !== void 0 && read !== RESOURCE_NOT_FOUND && isSnsDefaultPolicy(read["PolicyDocument"]) ? { ...properties } : read;
8680
+ }
8958
8681
  const declared = context?.afterOwnWrite === true ? declaredPolicyDocument(properties) : void 0;
8959
8682
  if (declared === void 0) return this.readTopicPolicy(physicalId);
8960
8683
  const { answer, settled } = await reReadUntilSettled(() => this.readTopicPolicy(physicalId), (read) => read !== void 0 && read !== RESOURCE_NOT_FOUND && policyDocumentMatchesDeclared(read["PolicyDocument"], declared), this.ownWriteRereadDelaysMs);
@@ -9007,9 +8730,6 @@ var SNSTopicPolicyProvider = class {
9007
8730
  }));
9008
8731
  }
9009
8732
  };
9010
- function isSnsTopicArn(value) {
9011
- return /^arn:[a-z0-9-]+:sns:[a-z0-9-]+:\d{12}:[\w.-]+$/.test(value);
9012
- }
9013
8733
  function isSnsTopicArnList(value) {
9014
8734
  const segments = value.split(",");
9015
8735
  if (segments.length === 0) return false;
@@ -9025,31 +8745,6 @@ function listedTopics(bag) {
9025
8745
  for (const entry of listed) if (typeof entry === "string" && isSnsTopicArn(entry) && !out.includes(entry)) out.push(entry);
9026
8746
  return out;
9027
8747
  }
9028
- function defaultTopicPolicy(topicArn) {
9029
- if (!isSnsTopicArn(topicArn)) return void 0;
9030
- const account = topicArn.split(":")[4];
9031
- return JSON.stringify({
9032
- Version: "2008-10-17",
9033
- Id: "__default_policy_ID",
9034
- Statement: [{
9035
- Sid: "__default_statement_ID",
9036
- Effect: "Allow",
9037
- Principal: { AWS: "*" },
9038
- Action: [
9039
- "SNS:GetTopicAttributes",
9040
- "SNS:SetTopicAttributes",
9041
- "SNS:AddPermission",
9042
- "SNS:RemovePermission",
9043
- "SNS:DeleteTopic",
9044
- "SNS:Subscribe",
9045
- "SNS:ListSubscriptionsByTopic",
9046
- "SNS:Publish"
9047
- ],
9048
- Resource: topicArn,
9049
- Condition: { StringEquals: { "AWS:SourceOwner": account } }
9050
- }]
9051
- });
9052
- }
9053
8748
  function canonicalJson$1(value) {
9054
8749
  const sortKeys = (v) => {
9055
8750
  if (Array.isArray(v)) return v.map(sortKeys);
@@ -10175,7 +9870,7 @@ async function unsettledInTransition$6(physicalId, _logicalId, _resourceType, na
10175
9870
  return names;
10176
9871
  }
10177
9872
  }
10178
- async function readCurrentState$35(physicalId, _logicalId, _resourceType) {
9873
+ async function readCurrentState$36(physicalId, _logicalId, _resourceType) {
10179
9874
  try {
10180
9875
  const resp = await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: physicalId }));
10181
9876
  const cfg = resp.Configuration;
@@ -10474,7 +10169,7 @@ var LambdaFunctionProvider = class {
10474
10169
  return unsettledInTransition$6.call(this, physicalId, _logicalId, _resourceType, names);
10475
10170
  }
10476
10171
  readCurrentState(physicalId, _logicalId, _resourceType) {
10477
- return readCurrentState$35.call(this, physicalId, _logicalId, _resourceType);
10172
+ return readCurrentState$36.call(this, physicalId, _logicalId, _resourceType);
10478
10173
  }
10479
10174
  getDriftUnknownPaths() {
10480
10175
  return [
@@ -10579,6 +10274,7 @@ var LambdaPermissionProvider = class {
10579
10274
  ...functionNamePairs(properties["FunctionName"])
10580
10275
  ]);
10581
10276
  log.debug(`Updating Lambda permission ${logicalId}: ${physicalId}`);
10277
+ if (isDriftRevert(context)) throw revertReplacementRefusal(resourceType, logicalId, "a Lambda permission has no update API and is changed only by removing and re-adding its statement");
10582
10278
  try {
10583
10279
  const oldFunctionName = previousProperties["FunctionName"] || properties["FunctionName"];
10584
10280
  const oldStatementId = physicalId.includes("|") ? physicalId.split("|").pop() : physicalId;
@@ -11445,7 +11141,7 @@ async function deleteImpl$34(logicalId, physicalId, resourceType, properties, co
11445
11141
  }
11446
11142
 
11447
11143
  // src/provisioning/providers/lambda-eventsource/read-state.ts
11448
- async function readCurrentState$34(physicalId, _logicalId, _resourceType, properties) {
11144
+ async function readCurrentState$35(physicalId, _logicalId, _resourceType, properties) {
11449
11145
  let resp;
11450
11146
  try {
11451
11147
  resp = await this.lambdaClient.send(new GetEventSourceMappingCommand({ UUID: physicalId }));
@@ -11655,7 +11351,7 @@ var LambdaEventSourceMappingProvider = class {
11655
11351
  return deleteImpl$34.call(this, logicalId, physicalId, resourceType, properties, context);
11656
11352
  }
11657
11353
  readCurrentState(physicalId, logicalId, resourceType, properties) {
11658
- return readCurrentState$34.call(this, physicalId, logicalId, resourceType, properties);
11354
+ return readCurrentState$35.call(this, physicalId, logicalId, resourceType, properties);
11659
11355
  }
11660
11356
  canonicalizeDriftPair(resourceType, baseline, aws, properties) {
11661
11357
  return canonicalizeDriftPair$5.call(this, resourceType, baseline, aws, properties);
@@ -14930,7 +14626,7 @@ async function waitForKinesisDestinationSettled(tableName, streamArn, expectedPr
14930
14626
  function isTransientStreamReadFailure(err) {
14931
14627
  return isThrottlingError(err) || isTransientServerError(err) || isAmbiguousOutcomeError(err) || err instanceof ResourceNotFoundException$1;
14932
14628
  }
14933
- async function readCurrentState$33(physicalId, _logicalId, _resourceType, properties, context) {
14629
+ async function readCurrentState$34(physicalId, _logicalId, _resourceType, properties, context) {
14934
14630
  try {
14935
14631
  const table = (await this.dynamoDBClient.send(new DescribeTableCommand({ TableName: physicalId }))).Table;
14936
14632
  if (!table) return void 0;
@@ -16095,7 +15791,7 @@ var DynamoDBTableProvider = class {
16095
15791
  return unsettledInTransition$5.call(this, physicalId, _logicalId, _resourceType, names);
16096
15792
  }
16097
15793
  async readCurrentState(physicalId, _logicalId, _resourceType, properties, context) {
16098
- return readCurrentState$33.call(this, physicalId, _logicalId, _resourceType, properties, context);
15794
+ return readCurrentState$34.call(this, physicalId, _logicalId, _resourceType, properties, context);
16099
15795
  }
16100
15796
  readTableTags(...args) {
16101
15797
  return readTableTags.call(this, ...args);
@@ -16571,7 +16267,7 @@ async function readDataProtectionPolicy(physicalId) {
16571
16267
  return { value: document };
16572
16268
  }
16573
16269
  }
16574
- async function readCurrentState$32(physicalId, logicalId, _resourceType, properties, context) {
16270
+ async function readCurrentState$33(physicalId, logicalId, _resourceType, properties, context) {
16575
16271
  try {
16576
16272
  const found = (await this.logsClient.send(new DescribeLogGroupsCommand({ logGroupNamePrefix: physicalId }))).logGroups?.find((g) => g.logGroupName === physicalId);
16577
16273
  if (!found) return RESOURCE_NOT_FOUND;
@@ -16702,7 +16398,7 @@ var LogsLogGroupProvider = class {
16702
16398
  return getAttribute$13.call(this, physicalId, _resourceType, attributeName);
16703
16399
  }
16704
16400
  readCurrentState(physicalId, _logicalId, _resourceType, properties, context) {
16705
- return readCurrentState$32.call(this, physicalId, _logicalId, _resourceType, properties, context);
16401
+ return readCurrentState$33.call(this, physicalId, _logicalId, _resourceType, properties, context);
16706
16402
  }
16707
16403
  import(input) {
16708
16404
  return importImpl$33.call(this, input);
@@ -18249,7 +17945,7 @@ function generateSecretString(config, options) {
18249
17945
  }
18250
17946
 
18251
17947
  // src/provisioning/providers/secretsmanager-secret/read-state.ts
18252
- async function readCurrentState$31(physicalId, _logicalId, _resourceType) {
17948
+ async function readCurrentState$32(physicalId, _logicalId, _resourceType) {
18253
17949
  try {
18254
17950
  const resp = await this.smClient.send(new DescribeSecretCommand({ SecretId: physicalId }));
18255
17951
  const result = {};
@@ -18372,7 +18068,7 @@ var SecretsManagerSecretProvider = class {
18372
18068
  return generateSecretString.call(this, config, options);
18373
18069
  }
18374
18070
  readCurrentState(physicalId, logicalId, resourceType) {
18375
- return readCurrentState$31.call(this, physicalId, logicalId, resourceType);
18071
+ return readCurrentState$32.call(this, physicalId, logicalId, resourceType);
18376
18072
  }
18377
18073
  getDriftUnknownPaths() {
18378
18074
  return ["SecretString", "GenerateSecretString"];
@@ -18503,7 +18199,7 @@ async function deleteImpl$31(logicalId, physicalId, resourceType, _properties, c
18503
18199
  }
18504
18200
 
18505
18201
  // src/provisioning/providers/ssm-parameter/read-state.ts
18506
- async function readCurrentState$30(physicalId, _logicalId, _resourceType) {
18202
+ async function readCurrentState$31(physicalId, _logicalId, _resourceType) {
18507
18203
  let getResp;
18508
18204
  try {
18509
18205
  getResp = await this.ssmClient.send(new GetParameterCommand({
@@ -18683,7 +18379,7 @@ var SSMParameterProvider = class SSMParameterProvider {
18683
18379
  return deleteImpl$31.call(this, logicalId, physicalId, resourceType, properties, context);
18684
18380
  }
18685
18381
  readCurrentState(physicalId, logicalId, resourceType) {
18686
- return readCurrentState$30.call(this, physicalId, logicalId, resourceType);
18382
+ return readCurrentState$31.call(this, physicalId, logicalId, resourceType);
18687
18383
  }
18688
18384
  refuseUnwritableParameterId(input, explicit) {
18689
18385
  return refuseUnwritableParameterId.call(this, input, explicit);
@@ -20427,7 +20123,7 @@ async function applyUpdate$3(logicalId, physicalId, resourceType, properties, pr
20427
20123
  case "AWS::EC2::Route": return this.updateRoute(logicalId, physicalId, resourceType, properties, previousProperties, context);
20428
20124
  case "AWS::EC2::SubnetRouteTableAssociation": return this.updateSubnetRouteTableAssociation(logicalId, physicalId);
20429
20125
  case "AWS::EC2::SecurityGroup": return this.updateSecurityGroup(logicalId, physicalId, resourceType, properties, previousProperties, context);
20430
- case "AWS::EC2::SecurityGroupIngress": return this.updateSecurityGroupIngress(logicalId, physicalId, resourceType, properties, previousProperties, context?.maskSecrets, context?.replayingState === true, context?.recordedAttributes);
20126
+ case "AWS::EC2::SecurityGroupIngress": return this.updateSecurityGroupIngress(logicalId, physicalId, resourceType, properties, previousProperties, context?.maskSecrets, context?.replayingState === true, context?.recordedAttributes, context?.desiredFromAwsReadback === true);
20431
20127
  case "AWS::EC2::Instance": return this.updateInstance(logicalId, physicalId, resourceType, properties, previousProperties, context);
20432
20128
  case "AWS::EC2::NetworkAclEntry": return this.updateNetworkAclEntry(logicalId, physicalId, resourceType, properties, previousProperties, context);
20433
20129
  case "AWS::EC2::SubnetNetworkAclAssociation": throw new ResourceUpdateNotSupportedError(resourceType, logicalId, `AWS provides no in-place Update API for this EC2 sub-resource type; every property change requires Delete + Create. Re-deploy with ${deployReplaceCommand()}, or destroy + redeploy`);
@@ -22418,6 +22114,7 @@ async function updateRoute$1(logicalId, physicalId, resourceType, properties, pr
22418
22114
  throw this.wrapCaughtError(maskerOrIdentity(maskSecrets), error, (text) => new ProvisioningError(`Failed to update Route ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
22419
22115
  }
22420
22116
  }
22117
+ if (isDriftRevert(context)) throw revertReplacementRefusal(resourceType, logicalId, "its route table or destination differs from the route its physical id names");
22421
22118
  try {
22422
22119
  await this.deleteRoute(logicalId, physicalId, resourceType, maskSecrets ? { maskSecrets } : void 0);
22423
22120
  const createResult = await this.createRoute(logicalId, resourceType, properties, (message) => this.logger.warn(message), maskSecrets);
@@ -23070,7 +22767,7 @@ async function lookupIngressRuleId(logicalId, groupId, properties) {
23070
22767
  return;
23071
22768
  }
23072
22769
  }
23073
- async function updateSecurityGroupIngress(logicalId, physicalId, resourceType, properties, previousProperties, maskSecrets, replayingState = false, recordedAttributes) {
22770
+ async function updateSecurityGroupIngress(logicalId, physicalId, resourceType, properties, previousProperties, maskSecrets, replayingState = false, recordedAttributes, driftRevert = false) {
23074
22771
  this.logger.debug(`Updating SecurityGroupIngress ${logicalId}: ${physicalId}`);
23075
22772
  if (JSON.stringify(properties) === JSON.stringify(previousProperties)) {
23076
22773
  if (!replayingState) return {
@@ -23121,6 +22818,7 @@ async function updateSecurityGroupIngress(logicalId, physicalId, resourceType, p
23121
22818
  ...narrowed !== properties && { effectiveProperties: narrowed }
23122
22819
  };
23123
22820
  }
22821
+ if (driftRevert) throw revertReplacementRefusal(resourceType, logicalId, "the rule cannot reach its record in place (the live rule's protocol, ports or source differ from it, AWS no longer has the rule, or its recorded description is redacted)");
23124
22822
  try {
23125
22823
  if (keptFor !== void 0) this.logger.info(safeMsg`SecurityGroupIngress ${logicalId}: its previous rule is also held by ${keptFor} of this stack, so the update left it in place`);
23126
22824
  const revoked = keptFor !== void 0 ? void 0 : await this.deleteSecurityGroupIngress(logicalId, physicalId, resourceType, previousProperties, recordedAttributes || maskSecrets ? {
@@ -25436,7 +25134,7 @@ function canonicalizeUnsettledProperties$1(resourceType, properties) {
25436
25134
  [key]: canonical
25437
25135
  };
25438
25136
  }
25439
- async function readCurrentState$29(physicalId, logicalId, resourceType, properties, context) {
25137
+ async function readCurrentState$30(physicalId, logicalId, resourceType, properties, context) {
25440
25138
  const attempts = context?.afterOwnWrite === true ? 5 : 1;
25441
25139
  for (let attempt = 1;; attempt++) {
25442
25140
  const read = await this.readCurrentStateOnce(physicalId, logicalId, resourceType, properties, context);
@@ -25557,7 +25255,7 @@ const driftMethods = {
25557
25255
  readUnsettled: readUnsettled$5,
25558
25256
  canonicalizeDriftPair: canonicalizeDriftPair$3,
25559
25257
  canonicalizeUnsettledProperties: canonicalizeUnsettledProperties$1,
25560
- readCurrentState: readCurrentState$29,
25258
+ readCurrentState: readCurrentState$30,
25561
25259
  readCurrentStateOnce,
25562
25260
  getDriftUnknownPaths: getDriftUnknownPaths$10,
25563
25261
  canonicalizeDesiredProperties: canonicalizeDesiredProperties$2
@@ -27321,7 +27019,7 @@ async function update$30(logicalId, physicalId, resourceType, properties, previo
27321
27019
  properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
27322
27020
  return this.updateAccount(logicalId, physicalId, resourceType, properties, log);
27323
27021
  case "AWS::ApiGateway::Authorizer": return this.updateAuthorizer(logicalId, physicalId, resourceType, properties, previousProperties, log);
27324
- case "AWS::ApiGateway::Resource": return this.updateResource(logicalId, physicalId, resourceType, properties, previousProperties, log);
27022
+ case "AWS::ApiGateway::Resource": return this.updateResource(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true);
27325
27023
  case "AWS::ApiGateway::Deployment": return this.updateDeployment(logicalId, physicalId, resourceType, properties, previousProperties, log);
27326
27024
  case "AWS::ApiGateway::Stage": return this.updateStage(logicalId, physicalId, resourceType, properties, previousProperties, stageSinks$1(this.logger, context, [[properties["StageName"], physicalId], [previousProperties["StageName"], physicalId]]));
27327
27025
  case "AWS::ApiGateway::Method": return this.updateMethod(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true);
@@ -27649,11 +27347,12 @@ async function createResource(logicalId, resourceType, properties, log) {
27649
27347
  throw this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to create API Gateway Resource ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause));
27650
27348
  }
27651
27349
  }
27652
- async function updateResource(logicalId, physicalId, resourceType, properties, previousProperties, log) {
27350
+ async function updateResource(logicalId, physicalId, resourceType, properties, previousProperties, log, driftRevert = false) {
27653
27351
  log.debug(`Updating API Gateway Resource ${logicalId}: ${physicalId}`);
27654
27352
  const newPathPart = properties["PathPart"];
27655
27353
  const oldPathPart = previousProperties["PathPart"];
27656
27354
  if (newPathPart !== oldPathPart) {
27355
+ if (driftRevert) throw revertReplacementRefusal(resourceType, logicalId, "its PathPart differs from the live resource's, and cdkd would re-create the resource to revert it");
27657
27356
  log.debug(`PathPart changed from "${log.value(oldPathPart)}" to "${log.value(newPathPart)}", replacing resource`);
27658
27357
  const createResult = await this.createResource(logicalId, resourceType, properties, log);
27659
27358
  let orphanReason;
@@ -28360,7 +28059,7 @@ function getDriftUnorderedPaths$6(resourceType) {
28360
28059
  if (resourceType === "AWS::ApiGateway::RestApi") return ["BinaryMediaTypes"];
28361
28060
  return [];
28362
28061
  }
28363
- async function readCurrentState$28(physicalId, _logicalId, resourceType, properties) {
28062
+ async function readCurrentState$29(physicalId, _logicalId, resourceType, properties) {
28364
28063
  switch (resourceType) {
28365
28064
  case "AWS::ApiGateway::Account": return this.readCurrentStateAccount();
28366
28065
  case "AWS::ApiGateway::Method": return this.readCurrentStateMethod(physicalId);
@@ -28666,8 +28365,8 @@ var ApiGatewayProvider = class {
28666
28365
  createResource(logicalId, resourceType, properties, log) {
28667
28366
  return createResource.call(this, logicalId, resourceType, properties, log);
28668
28367
  }
28669
- updateResource(logicalId, physicalId, resourceType, properties, previousProperties, log) {
28670
- return updateResource.call(this, logicalId, physicalId, resourceType, properties, previousProperties, log);
28368
+ updateResource(logicalId, physicalId, resourceType, properties, previousProperties, log, driftRevert = false) {
28369
+ return updateResource.call(this, logicalId, physicalId, resourceType, properties, previousProperties, log, driftRevert);
28671
28370
  }
28672
28371
  deleteResource(logicalId, physicalId, resourceType, properties, context) {
28673
28372
  return deleteResource.call(this, logicalId, physicalId, resourceType, properties, context);
@@ -28753,7 +28452,7 @@ var ApiGatewayProvider = class {
28753
28452
  }
28754
28453
  readCurrentState(physicalId, _logicalId, resourceType, properties, context) {
28755
28454
  if (resourceType === "AWS::ApiGateway::RestApi") return this.readCurrentStateRestApi(physicalId, properties, context, _logicalId);
28756
- return readCurrentState$28.call(this, physicalId, _logicalId, resourceType, properties);
28455
+ return readCurrentState$29.call(this, physicalId, _logicalId, resourceType, properties);
28757
28456
  }
28758
28457
  readCurrentStateAuthorizer(physicalId, properties) {
28759
28458
  return readCurrentStateAuthorizer.call(this, physicalId, properties);
@@ -28914,7 +28613,7 @@ async function canonicalizeDriftPair$2(resourceType, baseline, aws, properties =
28914
28613
  aws
28915
28614
  };
28916
28615
  }
28917
- async function readCurrentState$27(physicalId, _logicalId, resourceType, properties) {
28616
+ async function readCurrentState$28(physicalId, _logicalId, resourceType, properties) {
28918
28617
  switch (resourceType) {
28919
28618
  case "AWS::ApiGatewayV2::Api": return this.readApi(physicalId);
28920
28619
  case "AWS::ApiGatewayV2::Stage": return this.readStage(physicalId, properties);
@@ -30329,7 +30028,7 @@ var ApiGatewayV2Provider = class {
30329
30028
  return canonicalizeDriftPair$2.call(this, resourceType, baseline, aws, properties);
30330
30029
  }
30331
30030
  readCurrentState(physicalId, _logicalId, resourceType, properties) {
30332
- return readCurrentState$27.call(this, physicalId, _logicalId, resourceType, properties);
30031
+ return readCurrentState$28.call(this, physicalId, _logicalId, resourceType, properties);
30333
30032
  }
30334
30033
  readApi(physicalId) {
30335
30034
  return readApi.call(this, physicalId);
@@ -31009,7 +30708,7 @@ async function waitForDistributionStable(distributionId, expectedEnabled) {
31009
30708
  }
31010
30709
 
31011
30710
  // src/provisioning/providers/cloudfront-distribution/read-state.ts
31012
- async function readCurrentState$26(physicalId, _logicalId, resourceType, _properties) {
30711
+ async function readCurrentState$27(physicalId, _logicalId, resourceType, _properties) {
31013
30712
  if (resourceType !== "AWS::CloudFront::Distribution") return void 0;
31014
30713
  let config;
31015
30714
  try {
@@ -31500,7 +31199,7 @@ var CloudFrontDistributionProvider = class {
31500
31199
  return deleteImpl$27.call(this, logicalId, physicalId, resourceType, _properties, context);
31501
31200
  }
31502
31201
  readCurrentState(physicalId, _logicalId, resourceType, _properties) {
31503
- return readCurrentState$26.call(this, physicalId, _logicalId, resourceType, _properties);
31202
+ return readCurrentState$27.call(this, physicalId, _logicalId, resourceType, _properties);
31504
31203
  }
31505
31204
  getDriftUnknownPaths(resourceType) {
31506
31205
  return getDriftUnknownPaths$7.call(this, resourceType);
@@ -31603,7 +31302,7 @@ function isUserTagKey(key) {
31603
31302
  }
31604
31303
 
31605
31304
  // src/provisioning/providers/agentcore-runtime/read-state.ts
31606
- async function readCurrentState$25(physicalId, _logicalId, _resourceType) {
31305
+ async function readCurrentState$26(physicalId, _logicalId, _resourceType) {
31607
31306
  let resp;
31608
31307
  try {
31609
31308
  resp = await this.client.send(new GetAgentRuntimeCommand({ agentRuntimeId: physicalId }));
@@ -31630,6 +31329,8 @@ async function readCurrentState$25(physicalId, _logicalId, _resourceType) {
31630
31329
  result["FilesystemConfigurations"] = resp.filesystemConfigurations !== void 0 ? camelToPascalCaseKeys(resp.filesystemConfigurations, SDK_MAP_KEYS) : [];
31631
31330
  result["CapacityProviderConfiguration"] = resp.capacityProviderConfiguration !== void 0 ? camelToPascalCaseKeys(resp.capacityProviderConfiguration, SDK_MAP_KEYS) : {};
31632
31331
  result["PlatformVersion"] = resp.platformVersion ?? "";
31332
+ result["HooksConfiguration"] = resp.hooksConfiguration !== void 0 ? camelToPascalCaseKeys(resp.hooksConfiguration, SDK_MAP_KEYS) : {};
31333
+ result["ResourceConfigurations"] = resp.resourceConfigurations !== void 0 ? camelToPascalCaseKeys(resp.resourceConfigurations, SDK_MAP_KEYS) : [];
31633
31334
  if (resp.agentRuntimeArn) try {
31634
31335
  const tagsResp = await this.client.send(new ListTagsForResourceCommand$6({ resourceArn: resp.agentRuntimeArn }));
31635
31336
  result["Tags"] = Object.fromEntries(Object.entries(tagsResp.tags ?? {}).filter(([k]) => isUserTagKey(k)));
@@ -31764,6 +31465,10 @@ function writeSharedRuntimeMembers(input, properties) {
31764
31465
  if (isNonEmptyObject(capacityProvider)) input["capacityProviderConfiguration"] = pascalToCamelCaseKeys(capacityProvider, CFN_MAP_KEYS);
31765
31466
  const platformVersion = properties["PlatformVersion"];
31766
31467
  if (platformVersion !== void 0 && platformVersion !== null && platformVersion !== "") input["platformVersion"] = platformVersion;
31468
+ const hooks = properties["HooksConfiguration"];
31469
+ if (isNonEmptyObject(hooks)) input["hooksConfiguration"] = pascalToCamelCaseKeys(hooks, CFN_MAP_KEYS);
31470
+ const resources = properties["ResourceConfigurations"];
31471
+ if (Array.isArray(resources) && resources.length > 0) input["resourceConfigurations"] = pascalToCamelCaseKeys(resources, CFN_MAP_KEYS);
31767
31472
  }
31768
31473
  var AgentCoreRuntimeProvider = class {
31769
31474
  client;
@@ -31816,6 +31521,8 @@ var AgentCoreRuntimeProvider = class {
31816
31521
  "FilesystemConfigurations",
31817
31522
  "CapacityProviderConfiguration",
31818
31523
  "PlatformVersion",
31524
+ "HooksConfiguration",
31525
+ "ResourceConfigurations",
31819
31526
  "Tags"
31820
31527
  ])]]);
31821
31528
  constructor() {
@@ -31902,7 +31609,7 @@ var AgentCoreRuntimeProvider = class {
31902
31609
  };
31903
31610
  if (properties["AgentRuntimeArtifact"] !== void 0) input["agentRuntimeArtifact"] = pascalToCamelCaseKeys(properties["AgentRuntimeArtifact"], CFN_MAP_KEYS);
31904
31611
  if (properties["NetworkConfiguration"] !== void 0) input["networkConfiguration"] = pascalToCamelCaseKeys(properties["NetworkConfiguration"], CFN_MAP_KEYS);
31905
- if (properties["Description"] !== void 0) input["description"] = properties["Description"];
31612
+ if (properties["Description"] !== void 0 && properties["Description"] !== "") input["description"] = properties["Description"];
31906
31613
  if (properties["AuthorizerConfiguration"] !== void 0) input["authorizerConfiguration"] = pascalToCamelCaseKeys(properties["AuthorizerConfiguration"], CFN_MAP_KEYS);
31907
31614
  if (properties["ProtocolConfiguration"] !== void 0) {
31908
31615
  const proto = properties["ProtocolConfiguration"];
@@ -32011,7 +31718,7 @@ var AgentCoreRuntimeProvider = class {
32011
31718
  }
32012
31719
  }
32013
31720
  readCurrentState(physicalId, logicalId, resourceType) {
32014
- return readCurrentState$25.call(this, physicalId, logicalId, resourceType);
31721
+ return readCurrentState$26.call(this, physicalId, logicalId, resourceType);
32015
31722
  }
32016
31723
  import(input) {
32017
31724
  return importImpl$27.call(this, input);
@@ -32506,7 +32213,7 @@ async function applyTagDiff$12(stateMachineArn, resourceType, logicalId, oldTags
32506
32213
  }
32507
32214
 
32508
32215
  // src/provisioning/providers/stepfunctions/read-state.ts
32509
- async function readCurrentState$24(physicalId, _logicalId, _resourceType) {
32216
+ async function readCurrentState$25(physicalId, _logicalId, _resourceType) {
32510
32217
  let resp;
32511
32218
  try {
32512
32219
  resp = await this.getClient().send(new DescribeStateMachineCommand({ stateMachineArn: physicalId }));
@@ -32744,7 +32451,7 @@ var StepFunctionsProvider = class {
32744
32451
  return [...new Set(aliases)];
32745
32452
  }
32746
32453
  readCurrentState(physicalId, _logicalId, _resourceType) {
32747
- return readCurrentState$24.call(this, physicalId, _logicalId, _resourceType);
32454
+ return readCurrentState$25.call(this, physicalId, _logicalId, _resourceType);
32748
32455
  }
32749
32456
  generatedCreateName(_resourceType, logicalId, properties) {
32750
32457
  if (properties["StateMachineName"]) return void 0;
@@ -33400,13 +33107,13 @@ function createServiceOutcomeUnknown(error) {
33400
33107
  }
33401
33108
  async function settleAmbiguousCreateService(attempt, log) {
33402
33109
  try {
33403
- return await settle.call(this, attempt, log);
33110
+ return await settle$1.call(this, attempt, log);
33404
33111
  } catch (error) {
33405
33112
  log.debug(`Looking for ECS service ${attempt.logicalId} after its ambiguous CreateService failure failed: ${describeAwsFailure(error).detail}`);
33406
33113
  return;
33407
33114
  }
33408
33115
  }
33409
- async function settle(attempt, log) {
33116
+ async function settle$1(attempt, log) {
33410
33117
  const { logicalId, cluster, serviceName, createError } = attempt;
33411
33118
  if (!createServiceOutcomeUnknown(createError)) return void 0;
33412
33119
  if (attempt.heldBefore === "held") {
@@ -34452,7 +34159,7 @@ function getDriftUnknownPaths$6(resourceType) {
34452
34159
  ];
34453
34160
  return [];
34454
34161
  }
34455
- async function readCurrentState$23(physicalId, _logicalId, resourceType) {
34162
+ async function readCurrentState$24(physicalId, _logicalId, resourceType) {
34456
34163
  switch (resourceType) {
34457
34164
  case "AWS::ECS::Cluster": return this.readCurrentStateCluster(physicalId);
34458
34165
  case "AWS::ECS::Service": return this.readCurrentStateService(physicalId);
@@ -34979,7 +34686,7 @@ var ECSProvider = class {
34979
34686
  return getDriftUnknownPaths$6.call(this, resourceType);
34980
34687
  }
34981
34688
  readCurrentState(physicalId, _logicalId, resourceType) {
34982
- return readCurrentState$23.call(this, physicalId, _logicalId, resourceType);
34689
+ return readCurrentState$24.call(this, physicalId, _logicalId, resourceType);
34983
34690
  }
34984
34691
  readCurrentStateCluster(physicalId) {
34985
34692
  return readCurrentStateCluster.call(this, physicalId);
@@ -36126,7 +35833,7 @@ function convertCertificates(certificates) {
36126
35833
  }
36127
35834
 
36128
35835
  // src/provisioning/providers/elbv2/read-state.ts
36129
- async function readCurrentState$22(physicalId, _logicalId, resourceType) {
35836
+ async function readCurrentState$23(physicalId, _logicalId, resourceType) {
36130
35837
  switch (resourceType) {
36131
35838
  case "AWS::ElasticLoadBalancingV2::LoadBalancer": return this.readLoadBalancer(physicalId);
36132
35839
  case "AWS::ElasticLoadBalancingV2::TargetGroup": return this.readTargetGroup(physicalId);
@@ -36640,7 +36347,7 @@ var ELBv2Provider = class {
36640
36347
  return convertCertificates.call(this, certificates);
36641
36348
  }
36642
36349
  readCurrentState(physicalId, _logicalId, resourceType) {
36643
- return readCurrentState$22.call(this, physicalId, _logicalId, resourceType);
36350
+ return readCurrentState$23.call(this, physicalId, _logicalId, resourceType);
36644
36351
  }
36645
36352
  readLoadBalancer(physicalId) {
36646
36353
  return readLoadBalancer.call(this, physicalId);
@@ -37035,7 +36742,7 @@ async function importImpl$23(input) {
37035
36742
  if (explicit) return this.buildImportResult(explicit);
37036
36743
  return null;
37037
36744
  }
37038
- async function readCurrentState$21(physicalId) {
36745
+ async function readCurrentState$22(physicalId) {
37039
36746
  const client = this.getClient();
37040
36747
  let proxy;
37041
36748
  try {
@@ -37160,7 +36867,7 @@ var RDSDBProxyProvider = class {
37160
36867
  return importImpl$23.call(this, input);
37161
36868
  }
37162
36869
  readCurrentState(physicalId) {
37163
- return readCurrentState$21.call(this, physicalId);
36870
+ return readCurrentState$22.call(this, physicalId);
37164
36871
  }
37165
36872
  applyTagDiff(physicalId, oldTags, newTags, resourceType, logicalId, maskSecrets) {
37166
36873
  return applyTagDiff$9.call(this, physicalId, oldTags, newTags, resourceType, logicalId, maskSecrets);
@@ -37881,7 +37588,7 @@ async function importImpl$22(input) {
37881
37588
  };
37882
37589
  return null;
37883
37590
  }
37884
- async function readCurrentState$20(physicalId, _logicalId, _resourceType, properties) {
37591
+ async function readCurrentState$21(physicalId, _logicalId, _resourceType, properties) {
37885
37592
  const dbProxyName = readProxyName(properties["DBProxyName"]);
37886
37593
  const targetGroupName = requireConfigString(properties["TargetGroupName"], "default", "AWS::RDS::DBProxyTargetGroup TargetGroupName", { onUnusable: (message) => this.logger.warn(message) });
37887
37594
  if (!dbProxyName) return;
@@ -37972,7 +37679,7 @@ var RDSDBProxyTargetGroupProvider = class {
37972
37679
  return importImpl$22.call(this, input);
37973
37680
  }
37974
37681
  readCurrentState(physicalId, _logicalId, _resourceType, properties) {
37975
- return readCurrentState$20.call(this, physicalId, _logicalId, _resourceType, properties);
37682
+ return readCurrentState$21.call(this, physicalId, _logicalId, _resourceType, properties);
37976
37683
  }
37977
37684
  async retireRegistrationAfterFailedCreate(original, dbProxyName, targetGroupName, dbClusterIdentifiers, dbInstanceIdentifiers, maskSecrets, leftBehind) {
37978
37685
  const clusters = dbClusterIdentifiers?.length ? dbClusterIdentifiers : void 0;
@@ -39398,7 +39105,7 @@ async function unsettledInTransition$3(physicalId, _logicalId, resourceType, nam
39398
39105
  return names;
39399
39106
  }
39400
39107
  }
39401
- async function readCurrentState$19(physicalId, _logicalId, resourceType) {
39108
+ async function readCurrentState$20(physicalId, _logicalId, resourceType) {
39402
39109
  switch (resourceType) {
39403
39110
  case "AWS::DocDB::DBInstance": return this.readCurrentStateDBInstance(physicalId);
39404
39111
  case "AWS::DocDB::DBCluster": return this.readCurrentStateDBCluster(physicalId);
@@ -39733,7 +39440,7 @@ var DocDBProvider = class {
39733
39440
  return importImpl$21.call(this, input);
39734
39441
  }
39735
39442
  readCurrentState(physicalId, _logicalId, resourceType) {
39736
- return readCurrentState$19.call(this, physicalId, _logicalId, resourceType);
39443
+ return readCurrentState$20.call(this, physicalId, _logicalId, resourceType);
39737
39444
  }
39738
39445
  readCurrentStateDBInstance(physicalId) {
39739
39446
  return readCurrentStateDBInstance.call(this, physicalId);
@@ -40773,7 +40480,7 @@ async function updateRecordSet(logicalId, physicalId, resourceType, properties,
40773
40480
  }));
40774
40481
  this.logger.debug(`Successfully updated record set ${logicalId}`);
40775
40482
  return {
40776
- physicalId: compositeId,
40483
+ physicalId: context?.desiredFromAwsReadback === true ? physicalId : compositeId,
40777
40484
  wasReplaced: identityChanged,
40778
40485
  attributes: {}
40779
40486
  };
@@ -41541,7 +41248,7 @@ async function resolveRecordSetIdentity(physicalId, properties, options) {
41541
41248
  }
41542
41249
 
41543
41250
  // src/provisioning/providers/route53/read-state.ts
41544
- async function readCurrentState$18(physicalId, _logicalId, resourceType, properties) {
41251
+ async function readCurrentState$19(physicalId, _logicalId, resourceType, properties) {
41545
41252
  switch (resourceType) {
41546
41253
  case "AWS::Route53::HostedZone": return this.readHostedZone(physicalId, properties);
41547
41254
  case "AWS::Route53::RecordSet": return this.readRecordSet(physicalId, properties);
@@ -41953,7 +41660,7 @@ var Route53Provider = class {
41953
41660
  return resolveRecordSetIdentity.call(this, physicalId, properties, options);
41954
41661
  }
41955
41662
  readCurrentState(physicalId, _logicalId, resourceType, properties) {
41956
- return readCurrentState$18.call(this, physicalId, _logicalId, resourceType, properties);
41663
+ return readCurrentState$19.call(this, physicalId, _logicalId, resourceType, properties);
41957
41664
  }
41958
41665
  readUnsettled(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
41959
41666
  return readUnsettled$3.call(this, physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems);
@@ -42354,7 +42061,7 @@ async function deleteImpl$20(logicalId, physicalId, resourceType, _properties, c
42354
42061
  }
42355
42062
 
42356
42063
  // src/provisioning/providers/wafv2/read-state.ts
42357
- async function readCurrentState$17(physicalId, _logicalId, _resourceType, properties) {
42064
+ async function readCurrentState$18(physicalId, _logicalId, _resourceType, properties) {
42358
42065
  const { id, name, scope } = parseWebACLArn(physicalId);
42359
42066
  if (!id || !name) return void 0;
42360
42067
  let webACL;
@@ -42481,7 +42188,7 @@ var WAFv2WebACLProvider = class {
42481
42188
  return applyTagDiff$8.call(this, arn, resourceType, logicalId, oldTagsRaw, newTagsRaw);
42482
42189
  }
42483
42190
  readCurrentState(physicalId, logicalId, resourceType, properties) {
42484
- return readCurrentState$17.call(this, physicalId, logicalId, resourceType, properties);
42191
+ return readCurrentState$18.call(this, physicalId, logicalId, resourceType, properties);
42485
42192
  }
42486
42193
  import(input) {
42487
42194
  return importImpl$19.call(this, input);
@@ -42746,7 +42453,7 @@ function canonicalizeDesiredProperties$1(resourceType, properties) {
42746
42453
  if (resourceType !== "AWS::Cognito::UserPool") return properties;
42747
42454
  return narrowMfaConfiguration(properties);
42748
42455
  }
42749
- async function readCurrentState$16(physicalId, _logicalId, resourceType) {
42456
+ async function readCurrentState$17(physicalId, _logicalId, resourceType) {
42750
42457
  if (resourceType !== "AWS::Cognito::UserPool") return void 0;
42751
42458
  let resp;
42752
42459
  try {
@@ -42788,6 +42495,7 @@ async function readCurrentState$16(physicalId, _logicalId, resourceType) {
42788
42495
  result["UserPoolTier"] = pool.UserPoolTier ?? "ESSENTIALS";
42789
42496
  if (pool.KeyConfiguration) result["KeyConfiguration"] = pool.KeyConfiguration;
42790
42497
  if (pool.IssuerConfiguration) result["IssuerConfiguration"] = pool.IssuerConfiguration;
42498
+ if (pool.DcrConfiguration) result["DcrConfiguration"] = pool.DcrConfiguration;
42791
42499
  try {
42792
42500
  const mfa = await this.getClient().send(new GetUserPoolMfaConfigCommand({ UserPoolId: physicalId }));
42793
42501
  const enabledMfas = [];
@@ -43071,6 +42779,7 @@ async function create$19(logicalId, resourceType, properties, context) {
43071
42779
  if (properties["UserPoolTier"]) createParams.UserPoolTier = properties["UserPoolTier"];
43072
42780
  if (properties["KeyConfiguration"]) createParams.KeyConfiguration = properties["KeyConfiguration"];
43073
42781
  if (properties["IssuerConfiguration"]) createParams.IssuerConfiguration = properties["IssuerConfiguration"];
42782
+ if (properties["DcrConfiguration"]) createParams.DcrConfiguration = properties["DcrConfiguration"];
43074
42783
  const orphanWindow = createUserPoolLatch.take(logicalId);
43075
42784
  if (orphanWindow !== void 0) await this.reportPossibleOrphanPools(logicalId, poolName, orphanWindow, createMaskedLogSinks(this.logger, context?.maskSecrets));
43076
42785
  let created;
@@ -43191,6 +42900,9 @@ function warnOnUnremovablePoliciesSubKeys(physicalId, properties, previousProper
43191
42900
  this.logger.warn(`UserPool ${physicalId}: the desired configuration no longer declares Policies.${subKey}, and no UpdateUserPool input can express that removal — omitting the sub-key PRESERVES the live value, so the pool keeps its current ${label}. CloudFormation is the same no-op on the identical template edit, so cdkd deliberately sends no reset. To change the live value, declare Policies.${subKey} explicitly with the intended configuration (${reset}).`);
43192
42901
  }
43193
42902
  }
42903
+ function sendsMessageMember(value) {
42904
+ return value !== void 0 && value !== "";
42905
+ }
43194
42906
  function warnOnKeptRemovedMembers(logicalId, physicalId, properties, previousProperties) {
43195
42907
  for (const [member, unset] of Object.entries(KEPT_ON_REMOVAL_MEMBERS)) {
43196
42908
  if (!declaresMember(previousProperties[member], unset)) continue;
@@ -43198,6 +42910,10 @@ function warnOnKeptRemovedMembers(logicalId, physicalId, properties, previousPro
43198
42910
  this.logger.warn(safeMsg`Cognito User Pool ${logicalId} (${physicalId}): the template no longer declares ` + safeMsg`${member}, and UpdateUserPool keeps a member it omits, so the pool keeps its ` + safeMsg`current ${member}. CloudFormation keeps it on the same edit too, so cdkd sends ` + safeMsg`no reset. To change it, declare ${member} with the value you want.`);
43199
42911
  }
43200
42912
  }
42913
+ function dcrConfigurationUpdate(properties, previousProperties) {
42914
+ if (properties["DcrConfiguration"]) return properties["DcrConfiguration"];
42915
+ if (previousProperties["DcrConfiguration"]) return { EnableStatus: "Disabled" };
42916
+ }
43201
42917
  async function update$19(logicalId, physicalId, resourceType, properties, previousProperties, context) {
43202
42918
  this.logger.debug(`Updating Cognito User Pool ${logicalId}: ${physicalId}`);
43203
42919
  const stateBorneDesired = context?.replayingState === true || context?.desiredFromAwsReadback === true;
@@ -43251,13 +42967,15 @@ async function update$19(logicalId, physicalId, resourceType, properties, previo
43251
42967
  if (properties["VerificationMessageTemplate"]) updateParams.VerificationMessageTemplate = properties["VerificationMessageTemplate"];
43252
42968
  if (properties["DeviceConfiguration"]) updateParams.DeviceConfiguration = properties["DeviceConfiguration"];
43253
42969
  if (properties["UserPoolAddOns"] && !isEmptyObjectPlaceholder(properties["UserPoolAddOns"])) updateParams.UserPoolAddOns = properties["UserPoolAddOns"];
43254
- if (properties["EmailVerificationMessage"] !== void 0) updateParams.EmailVerificationMessage = properties["EmailVerificationMessage"];
43255
- if (properties["EmailVerificationSubject"] !== void 0) updateParams.EmailVerificationSubject = properties["EmailVerificationSubject"];
43256
- if (properties["SmsAuthenticationMessage"] !== void 0) updateParams.SmsAuthenticationMessage = properties["SmsAuthenticationMessage"];
43257
- if (properties["SmsVerificationMessage"] !== void 0) updateParams.SmsVerificationMessage = properties["SmsVerificationMessage"];
42970
+ if (sendsMessageMember(properties["EmailVerificationMessage"])) updateParams.EmailVerificationMessage = properties["EmailVerificationMessage"];
42971
+ if (sendsMessageMember(properties["EmailVerificationSubject"])) updateParams.EmailVerificationSubject = properties["EmailVerificationSubject"];
42972
+ if (sendsMessageMember(properties["SmsAuthenticationMessage"])) updateParams.SmsAuthenticationMessage = properties["SmsAuthenticationMessage"];
42973
+ if (sendsMessageMember(properties["SmsVerificationMessage"])) updateParams.SmsVerificationMessage = properties["SmsVerificationMessage"];
43258
42974
  if (properties["UserPoolTier"]) updateParams.UserPoolTier = properties["UserPoolTier"];
43259
42975
  if (properties["KeyConfiguration"]) updateParams.KeyConfiguration = properties["KeyConfiguration"];
43260
42976
  if (properties["IssuerConfiguration"]) updateParams.IssuerConfiguration = properties["IssuerConfiguration"];
42977
+ const dcr = dcrConfigurationUpdate(properties, previousProperties);
42978
+ if (dcr) updateParams.DcrConfiguration = dcr;
43261
42979
  const mfaOptions = {
43262
42980
  ...liveMfa?.value !== void 0 ? { liveMfaConfiguration: liveMfa.value } : {},
43263
42981
  ...liveMfa?.failed === true ? { liveReadFailed: true } : {},
@@ -43670,6 +43388,7 @@ var CognitoUserPoolProvider = class {
43670
43388
  "UserPoolTier",
43671
43389
  "KeyConfiguration",
43672
43390
  "IssuerConfiguration",
43391
+ "DcrConfiguration",
43673
43392
  "EnabledMfas",
43674
43393
  "EmailAuthenticationMessage",
43675
43394
  "EmailAuthenticationSubject",
@@ -43774,7 +43493,7 @@ var CognitoUserPoolProvider = class {
43774
43493
  return warnGuardLeftOn.call(this, physicalId, pool, mask, error, echoError);
43775
43494
  }
43776
43495
  readCurrentState(physicalId, _logicalId, resourceType) {
43777
- return readCurrentState$16.call(this, physicalId, _logicalId, resourceType);
43496
+ return readCurrentState$17.call(this, physicalId, _logicalId, resourceType);
43778
43497
  }
43779
43498
  userPoolAttributes(userPoolId, arn) {
43780
43499
  return userPoolAttributes.call(this, userPoolId, arn);
@@ -44253,7 +43972,7 @@ async function applyTagDiff$7(arn, resourceType, logicalId, oldTagsRaw, newTagsR
44253
43972
  }
44254
43973
 
44255
43974
  // src/provisioning/providers/elasticache/read-state.ts
44256
- async function readCurrentState$15(physicalId, _logicalId, resourceType) {
43975
+ async function readCurrentState$16(physicalId, _logicalId, resourceType) {
44257
43976
  switch (resourceType) {
44258
43977
  case "AWS::ElastiCache::CacheCluster": return this.readCacheCluster(physicalId);
44259
43978
  case "AWS::ElastiCache::SubnetGroup": return this.readSubnetGroup(physicalId);
@@ -44509,7 +44228,7 @@ var ElastiCacheProvider = class {
44509
44228
  return resourceType === "AWS::ElastiCache::CacheCluster" ? ["SnapshotArns", "SnapshotName"] : [];
44510
44229
  }
44511
44230
  readCurrentState(physicalId, _logicalId, resourceType) {
44512
- return readCurrentState$15.call(this, physicalId, _logicalId, resourceType);
44231
+ return readCurrentState$16.call(this, physicalId, _logicalId, resourceType);
44513
44232
  }
44514
44233
  readCacheCluster(physicalId) {
44515
44234
  return readCacheCluster.call(this, physicalId);
@@ -45310,7 +45029,7 @@ async function readServiceIdForIdentity(serviceId) {
45310
45029
  if (typeof response.Service?.Id !== "string") throw new Error("GetService did not return the service asked for");
45311
45030
  return response.Service.Id;
45312
45031
  }
45313
- async function readCurrentState$14(physicalId, _logicalId, resourceType) {
45032
+ async function readCurrentState$15(physicalId, _logicalId, resourceType) {
45314
45033
  switch (resourceType) {
45315
45034
  case "AWS::ServiceDiscovery::PrivateDnsNamespace":
45316
45035
  case "AWS::ServiceDiscovery::PublicDnsNamespace": return this.readNamespace(physicalId, { includeProperties: true });
@@ -45604,7 +45323,7 @@ var ServiceDiscoveryProvider = class {
45604
45323
  return readServiceIdForIdentity.call(this, serviceId);
45605
45324
  }
45606
45325
  readCurrentState(physicalId, _logicalId, resourceType) {
45607
- return readCurrentState$14.call(this, physicalId, _logicalId, resourceType);
45326
+ return readCurrentState$15.call(this, physicalId, _logicalId, resourceType);
45608
45327
  }
45609
45328
  getDriftUnknownPaths(resourceType) {
45610
45329
  return getDriftUnknownPaths$3.call(this, resourceType);
@@ -46961,7 +46680,7 @@ function isNotFoundError(error) {
46961
46680
  }
46962
46681
 
46963
46682
  // src/provisioning/providers/appsync/read-state.ts
46964
- async function readCurrentState$13(physicalId, _logicalId, resourceType, properties) {
46683
+ async function readCurrentState$14(physicalId, _logicalId, resourceType, properties) {
46965
46684
  switch (resourceType) {
46966
46685
  case "AWS::AppSync::GraphQLApi": return this.readGraphQLApi(physicalId);
46967
46686
  case "AWS::AppSync::DataSource": return this.readDataSource(physicalId);
@@ -47523,7 +47242,7 @@ var AppSyncProvider = class {
47523
47242
  return isNotFoundError.call(this, error);
47524
47243
  }
47525
47244
  readCurrentState(physicalId, _logicalId, resourceType, properties) {
47526
- return readCurrentState$13.call(this, physicalId, _logicalId, resourceType, properties);
47245
+ return readCurrentState$14.call(this, physicalId, _logicalId, resourceType, properties);
47527
47246
  }
47528
47247
  canonicalizeSdl(sdl, source) {
47529
47248
  return canonicalizeSdl.call(this, sdl, source);
@@ -51301,7 +51020,7 @@ async function deleteImpl$15(logicalId, physicalId, resourceType, _properties, c
51301
51020
  }
51302
51021
 
51303
51022
  // src/provisioning/providers/budgets-budget/read-state.ts
51304
- async function readCurrentState$12(physicalId, _logicalId, resourceType, properties) {
51023
+ async function readCurrentState$13(physicalId, _logicalId, resourceType, properties) {
51305
51024
  if (resourceType !== "AWS::Budgets::Budget") return void 0;
51306
51025
  const accountId = await this.resolveAccountId();
51307
51026
  const client = this.getClient();
@@ -51652,7 +51371,7 @@ var BudgetsBudgetProvider = class {
51652
51371
  }
51653
51372
  }
51654
51373
  readCurrentState(physicalId, logicalId, resourceType, properties) {
51655
- return readCurrentState$12.call(this, physicalId, logicalId, resourceType, properties);
51374
+ return readCurrentState$13.call(this, physicalId, logicalId, resourceType, properties);
51656
51375
  }
51657
51376
  listNotifications(accountId, budgetName) {
51658
51377
  return listNotifications.call(this, accountId, budgetName);
@@ -52304,7 +52023,7 @@ async function unsettledInTransition$2(physicalId, _logicalId, _resourceType, na
52304
52023
  return names;
52305
52024
  }
52306
52025
  }
52307
- async function readCurrentState$11(physicalId, _logicalId, resourceType, _properties) {
52026
+ async function readCurrentState$12(physicalId, _logicalId, resourceType, _properties) {
52308
52027
  if (resourceType !== "AWS::Kinesis::Stream") return void 0;
52309
52028
  let stream;
52310
52029
  try {
@@ -52435,7 +52154,7 @@ var KinesisStreamProvider = class {
52435
52154
  return unsettledInTransition$2.call(this, physicalId, _logicalId, _resourceType, names);
52436
52155
  }
52437
52156
  readCurrentState(physicalId, _logicalId, resourceType, _properties) {
52438
- return readCurrentState$11.call(this, physicalId, _logicalId, resourceType, _properties);
52157
+ return readCurrentState$12.call(this, physicalId, _logicalId, resourceType, _properties);
52439
52158
  }
52440
52159
  import(input) {
52441
52160
  return importImpl$12.call(this, input);
@@ -53035,7 +52754,7 @@ async function getAttribute$4(physicalId, resourceType, attributeName, logicalId
53035
52754
  throw this.wrapCaughtError(void 0, error, (text) => new ProvisioningError(`Failed to resolve Arn for Schedule ${physicalId}: ${text}${text.endsWith(".") ? "" : "."}${customGroupHint}`, resourceType, logicalId, physicalId, cause));
53036
52755
  }
53037
52756
  }
53038
- async function readCurrentState$10(physicalId, _logicalId, _resourceType, properties) {
52757
+ async function readCurrentState$11(physicalId, _logicalId, _resourceType, properties) {
53039
52758
  const groupName = this.groupNameOf(properties);
53040
52759
  try {
53041
52760
  const response = await this.getClient().send(new GetScheduleCommand({
@@ -53165,7 +52884,7 @@ var SchedulerScheduleProvider = class {
53165
52884
  return getAttribute$4.call(this, physicalId, resourceType, attributeName, logicalId);
53166
52885
  }
53167
52886
  readCurrentState(physicalId, _logicalId, _resourceType, properties) {
53168
- return readCurrentState$10.call(this, physicalId, _logicalId, _resourceType, properties);
52887
+ return readCurrentState$11.call(this, physicalId, _logicalId, _resourceType, properties);
53169
52888
  }
53170
52889
  import(input) {
53171
52890
  return importImpl$11.call(this, input);
@@ -53680,7 +53399,7 @@ async function getAttribute$3(physicalId, resourceType, attributeName, logicalId
53680
53399
  }
53681
53400
  return this.attributesOf(response)[attributeName];
53682
53401
  }
53683
- async function readCurrentState$9(physicalId, _logicalId, _resourceType) {
53402
+ async function readCurrentState$10(physicalId, _logicalId, _resourceType) {
53684
53403
  let r;
53685
53404
  try {
53686
53405
  r = await this.describe(physicalId);
@@ -53833,7 +53552,7 @@ var PipesPipeProvider = class {
53833
53552
  return getAttribute$3.call(this, physicalId, resourceType, attributeName, logicalId);
53834
53553
  }
53835
53554
  readCurrentState(physicalId, _logicalId, _resourceType) {
53836
- return readCurrentState$9.call(this, physicalId, _logicalId, _resourceType);
53555
+ return readCurrentState$10.call(this, physicalId, _logicalId, _resourceType);
53837
53556
  }
53838
53557
  getDriftUnknownPaths() {
53839
53558
  return ["SourceParameters", "TargetParameters"];
@@ -53974,7 +53693,7 @@ async function retryOnTransientControlPlane(op, label, log, maxAttempts = 8) {
53974
53693
  delayMs = Math.min(delayMs * 2, 3e4);
53975
53694
  }
53976
53695
  }
53977
- async function readCurrentState$8(physicalId, _logicalId, resourceType) {
53696
+ async function readCurrentState$9(physicalId, _logicalId, resourceType) {
53978
53697
  switch (resourceType) {
53979
53698
  case "AWS::EFS::FileSystem": return this.readFileSystem(physicalId);
53980
53699
  case "AWS::EFS::AccessPoint": return this.readAccessPoint(physicalId);
@@ -54888,7 +54607,7 @@ var EFSProvider = class {
54888
54607
  }
54889
54608
  readCurrentState(physicalId, _logicalId, resourceType, properties, context) {
54890
54609
  if (resourceType === "AWS::EFS::FileSystem") return this.readFileSystem(physicalId, properties, context, _logicalId);
54891
- return readCurrentState$8.call(this, physicalId, _logicalId, resourceType);
54610
+ return readCurrentState$9.call(this, physicalId, _logicalId, resourceType);
54892
54611
  }
54893
54612
  readFileSystem(physicalId, properties, context, logicalId) {
54894
54613
  return readFileSystem.call(this, physicalId, properties, context, logicalId);
@@ -56066,7 +55785,7 @@ function getDriftUnorderedPaths(resourceType) {
56066
55785
  if (resourceType !== "AWS::FSx::FileSystem") return [];
56067
55786
  return ["WindowsConfiguration.Aliases"];
56068
55787
  }
56069
- async function readCurrentState$7(physicalId, _logicalId, resourceType) {
55788
+ async function readCurrentState$8(physicalId, _logicalId, resourceType) {
56070
55789
  if (resourceType !== "AWS::FSx::FileSystem") return void 0;
56071
55790
  let fs;
56072
55791
  let listed;
@@ -56311,7 +56030,7 @@ var FSxFileSystemProvider = class {
56311
56030
  return getDriftUnorderedPaths.call(this, resourceType);
56312
56031
  }
56313
56032
  readCurrentState(physicalId, _logicalId, resourceType) {
56314
- return readCurrentState$7.call(this, physicalId, _logicalId, resourceType);
56033
+ return readCurrentState$8.call(this, physicalId, _logicalId, resourceType);
56315
56034
  }
56316
56035
  import(input) {
56317
56036
  return importImpl$8.call(this, input);
@@ -57963,7 +57682,7 @@ async function describeClusterOrUndefined(clusterId) {
57963
57682
  throw err;
57964
57683
  }
57965
57684
  }
57966
- async function readCurrentState$6(physicalId, _logicalId, _resourceType) {
57685
+ async function readCurrentState$7(physicalId, _logicalId, _resourceType) {
57967
57686
  const cluster = await this.describeClusterOrUndefined(physicalId);
57968
57687
  if (!cluster) return void 0;
57969
57688
  if (cluster.Status?.State && TERMINAL_STATES.has(cluster.Status.State)) return RESOURCE_NOT_FOUND;
@@ -58226,7 +57945,7 @@ var EMRClusterProvider = class {
58226
57945
  return describeClusterOrUndefined.call(this, clusterId);
58227
57946
  }
58228
57947
  readCurrentState(physicalId, _logicalId, _resourceType) {
58229
- return readCurrentState$6.call(this, physicalId, _logicalId, _resourceType);
57948
+ return readCurrentState$7.call(this, physicalId, _logicalId, _resourceType);
58230
57949
  }
58231
57950
  getDriftUnknownPaths(_resourceType) {
58232
57951
  return [
@@ -59401,7 +59120,7 @@ async function unsettledInTransition(physicalId, _logicalId, _resourceType, name
59401
59120
  return /* @__PURE__ */ new Set([ENCRYPTION_KEY]);
59402
59121
  }
59403
59122
  }
59404
- async function readCurrentState$5(physicalId, _logicalId, _resourceType, properties) {
59123
+ async function readCurrentState$6(physicalId, _logicalId, _resourceType, properties) {
59405
59124
  let desc;
59406
59125
  try {
59407
59126
  desc = (await this.getClient().send(new DescribeDeliveryStreamCommand({ DeliveryStreamName: physicalId }))).DeliveryStreamDescription;
@@ -59609,7 +59328,7 @@ var FirehoseProvider = class {
59609
59328
  return unsettledInTransition.call(this, physicalId, _logicalId, _resourceType, names);
59610
59329
  }
59611
59330
  readCurrentState(physicalId, _logicalId, _resourceType, properties) {
59612
- return readCurrentState$5.call(this, physicalId, _logicalId, _resourceType, properties);
59331
+ return readCurrentState$6.call(this, physicalId, _logicalId, _resourceType, properties);
59613
59332
  }
59614
59333
  getDriftUnknownPaths() {
59615
59334
  return getDriftUnknownPaths.call(this);
@@ -60078,7 +59797,7 @@ async function applyTagDiff(trailArn, resourceType, logicalId, oldTagsRaw, newTa
60078
59797
  }
60079
59798
 
60080
59799
  // src/provisioning/providers/cloudtrail/read-state.ts
60081
- async function readCurrentState$4(physicalId, _logicalId, _resourceType) {
59800
+ async function readCurrentState$5(physicalId, _logicalId, _resourceType) {
60082
59801
  let trail;
60083
59802
  try {
60084
59803
  trail = (await this.getClient().send(new GetTrailCommand({ Name: physicalId }))).Trail;
@@ -60235,7 +59954,7 @@ var CloudTrailProvider = class {
60235
59954
  return applyTagDiff.call(this, trailArn, resourceType, logicalId, oldTagsRaw, newTagsRaw);
60236
59955
  }
60237
59956
  readCurrentState(physicalId, _logicalId, _resourceType) {
60238
- return readCurrentState$4.call(this, physicalId, _logicalId, _resourceType);
59957
+ return readCurrentState$5.call(this, physicalId, _logicalId, _resourceType);
60239
59958
  }
60240
59959
  import(input) {
60241
59960
  return importImpl$5.call(this, input);
@@ -60676,7 +60395,7 @@ async function deleteImpl$5(logicalId, physicalId, resourceType, _properties, co
60676
60395
  }
60677
60396
 
60678
60397
  // src/provisioning/providers/codebuild/read-state.ts
60679
- async function readCurrentState$3(physicalId, logicalId, _resourceType, properties, context) {
60398
+ async function readCurrentState$4(physicalId, logicalId, _resourceType, properties, context) {
60680
60399
  const read = await readProject.call(this, physicalId);
60681
60400
  const declared = context?.afterOwnWrite === true ? properties?.["Visibility"] : void 0;
60682
60401
  if (typeof declared !== "string" || declared === "" || read === RESOURCE_NOT_FOUND) return read;
@@ -60966,7 +60685,7 @@ var CodeBuildProvider = class {
60966
60685
  return Promise.resolve(attributeName);
60967
60686
  }
60968
60687
  readCurrentState(physicalId, _logicalId, _resourceType, properties, context) {
60969
- return readCurrentState$3.call(this, physicalId, _logicalId, _resourceType, properties, context);
60688
+ return readCurrentState$4.call(this, physicalId, _logicalId, _resourceType, properties, context);
60970
60689
  }
60971
60690
  getDriftUnknownPaths() {
60972
60691
  return ["Source.Auth", "Triggers"];
@@ -61406,7 +61125,7 @@ function proceedUnconfirmed(logicalId, reason) {
61406
61125
  }
61407
61126
 
61408
61127
  // src/provisioning/providers/codecommit-repository/read-state.ts
61409
- async function readCurrentState$2(physicalId, _logicalId, _resourceType) {
61128
+ async function readCurrentState$3(physicalId, _logicalId, _resourceType) {
61410
61129
  let metadata;
61411
61130
  try {
61412
61131
  metadata = await this.getRepositoryMetadata(physicalId);
@@ -61548,7 +61267,7 @@ var CodeCommitRepositoryProvider = class {
61548
61267
  }
61549
61268
  }
61550
61269
  readCurrentState(physicalId, _logicalId, _resourceType) {
61551
- return readCurrentState$2.call(this, physicalId, _logicalId, _resourceType);
61270
+ return readCurrentState$3.call(this, physicalId, _logicalId, _resourceType);
61552
61271
  }
61553
61272
  getDriftUnknownPaths(_resourceType) {
61554
61273
  return ["Code", "Triggers"];
@@ -63770,7 +63489,7 @@ async function lookupTableArn(tableBucketARN, namespace, name) {
63770
63489
  }
63771
63490
 
63772
63491
  // src/provisioning/providers/s3-tables/read-state.ts
63773
- async function readCurrentState$1(physicalId, logicalId, resourceType) {
63492
+ async function readCurrentState$2(physicalId, logicalId, resourceType) {
63774
63493
  switch (resourceType) {
63775
63494
  case "AWS::S3Tables::TableBucket": return this.readTableBucketCurrentState(physicalId);
63776
63495
  case "AWS::S3Tables::Namespace": return this.readNamespaceCurrentState(physicalId);
@@ -64322,7 +64041,7 @@ var S3TablesProvider = class {
64322
64041
  return createTable.call(this, logicalId, resourceType, properties, context);
64323
64042
  }
64324
64043
  readCurrentState(physicalId, logicalId, resourceType) {
64325
- return readCurrentState$1.call(this, physicalId, logicalId, resourceType);
64044
+ return readCurrentState$2.call(this, physicalId, logicalId, resourceType);
64326
64045
  }
64327
64046
  readTableBucketCurrentState(physicalId) {
64328
64047
  return readTableBucketCurrentState.call(this, physicalId);
@@ -64386,12 +64105,117 @@ var S3TablesProvider = class {
64386
64105
  }
64387
64106
  };
64388
64107
 
64108
+ // src/provisioning/providers/ecr/read-state.ts
64109
+ const REPOSITORY_TYPE = "AWS::ECR::Repository";
64110
+ function toCfnTagMutabilityExclusionFilters(sdk) {
64111
+ if (!sdk || sdk.length === 0) return void 0;
64112
+ return sdk.map((f) => ({
64113
+ ...f.filterType !== void 0 && { ImageTagMutabilityExclusionFilterType: f.filterType },
64114
+ ...f.filter !== void 0 && { ImageTagMutabilityExclusionFilterValue: f.filter }
64115
+ }));
64116
+ }
64117
+ async function readRepositoryPolicy(repositoryName) {
64118
+ let policyText;
64119
+ try {
64120
+ policyText = (await this.getClient().send(new GetRepositoryPolicyCommand({ repositoryName }))).policyText;
64121
+ } catch (err) {
64122
+ if (err instanceof RepositoryPolicyNotFoundException) return "absent";
64123
+ throw err;
64124
+ }
64125
+ if (!policyText) return "absent";
64126
+ try {
64127
+ return { value: JSON.parse(policyText) };
64128
+ } catch {
64129
+ return { value: policyText };
64130
+ }
64131
+ }
64132
+ async function readPolicyMember(repositoryName, logicalId, properties, context) {
64133
+ const declared = declaredMemberDocument(properties?.["RepositoryPolicyText"]);
64134
+ if (declared === void 0) return void 0;
64135
+ if (context?.afterOwnWrite !== true) {
64136
+ const read = await readRepositoryPolicy.call(this, repositoryName);
64137
+ return typeof read === "object" ? read : void 0;
64138
+ }
64139
+ let firstError;
64140
+ let first;
64141
+ try {
64142
+ first = await readRepositoryPolicy.call(this, repositoryName);
64143
+ } catch (err) {
64144
+ if (err instanceof RepositoryNotFoundException) throw err;
64145
+ firstError = err;
64146
+ first = memberReadFailure(err);
64147
+ }
64148
+ const settled = await settleDeclaredMember(first, () => readRepositoryPolicy.call(this, repositoryName), (document) => policyDocumentMatchesDeclared(document, declared), declared, this.ownWriteRereadDelaysMs, () => warnUnsettledMember(this.logger, logicalId, REPOSITORY_TYPE, "RepositoryPolicyText"));
64149
+ if (settled === "failed" || settled === "refused") throw firstError;
64150
+ return typeof settled === "object" ? settled : void 0;
64151
+ }
64152
+ function settle(promise) {
64153
+ return promise.then((value) => ({
64154
+ ok: true,
64155
+ value
64156
+ }), (error) => ({
64157
+ ok: false,
64158
+ error
64159
+ }));
64160
+ }
64161
+ async function readCurrentState$1(physicalId, logicalId, properties, context) {
64162
+ let repo;
64163
+ try {
64164
+ repo = await this.getClient().send(new DescribeRepositoriesCommand({ repositoryNames: [physicalId] }));
64165
+ } catch (err) {
64166
+ if (err instanceof RepositoryNotFoundException) return RESOURCE_NOT_FOUND;
64167
+ throw err;
64168
+ }
64169
+ const r = repo.repositories?.[0];
64170
+ if (!r) return RESOURCE_NOT_FOUND;
64171
+ const result = {};
64172
+ if (r.repositoryName !== void 0) result["RepositoryName"] = r.repositoryName;
64173
+ if (r.imageTagMutability !== void 0) result["ImageTagMutability"] = r.imageTagMutability;
64174
+ const cfnExclusionFilters = toCfnTagMutabilityExclusionFilters(r.imageTagMutabilityExclusionFilters);
64175
+ if (cfnExclusionFilters) result["ImageTagMutabilityExclusionFilters"] = cfnExclusionFilters;
64176
+ result["ImageScanningConfiguration"] = { ScanOnPush: r.imageScanningConfiguration?.scanOnPush ?? false };
64177
+ {
64178
+ const encType = r.encryptionConfiguration?.encryptionType ?? "AES256";
64179
+ const enc = { EncryptionType: encType };
64180
+ if (encType === "KMS" && r.encryptionConfiguration?.kmsKey) enc["KmsKey"] = r.encryptionConfiguration.kmsKey;
64181
+ result["EncryptionConfiguration"] = enc;
64182
+ }
64183
+ const client = this.getClient();
64184
+ const readLifecycle = async () => {
64185
+ try {
64186
+ return (await client.send(new GetLifecyclePolicyCommand({ repositoryName: physicalId }))).lifecyclePolicyText;
64187
+ } catch (err) {
64188
+ if (err instanceof LifecyclePolicyNotFoundException) return void 0;
64189
+ throw err;
64190
+ }
64191
+ };
64192
+ const arn = r.repositoryArn;
64193
+ const readTags = async () => arn === void 0 || arn === "" ? void 0 : normalizeAwsTagsToCfn((await client.send(new ListTagsForResourceCommand$9({ resourceArn: arn }))).tags);
64194
+ const [lifecycle, policy, tags] = await Promise.all([
64195
+ settle(readLifecycle()),
64196
+ settle(readPolicyMember.call(this, physicalId, logicalId, properties, context)),
64197
+ settle(readTags())
64198
+ ]);
64199
+ const reads = [
64200
+ lifecycle,
64201
+ policy,
64202
+ tags
64203
+ ];
64204
+ if (reads.some((s) => !s.ok && s.error instanceof RepositoryNotFoundException)) return RESOURCE_NOT_FOUND;
64205
+ for (const s of reads) if (!s.ok) throw s.error;
64206
+ if (lifecycle.ok && lifecycle.value) result["LifecyclePolicy"] = { LifecyclePolicyText: lifecycle.value };
64207
+ if (policy.ok && policy.value !== void 0) result["RepositoryPolicyText"] = policy.value.value;
64208
+ if (tags.ok && tags.value !== void 0) result["Tags"] = tags.value;
64209
+ return result;
64210
+ }
64211
+
64389
64212
  // src/provisioning/providers/ecr-provider.ts
64390
64213
  var ECRProvider = class {
64391
64214
  client;
64392
64215
  createClient;
64393
64216
  providerRegion = ambientRegion();
64394
64217
  logger = getLogger().child("ECRProvider");
64218
+ ownWriteRereadDelaysMs = OWN_WRITE_REREAD_DELAYS_MS;
64395
64219
  handledProperties = /* @__PURE__ */ new Map([["AWS::ECR::Repository", /* @__PURE__ */ new Set([
64396
64220
  "RepositoryName",
64397
64221
  "ImageScanningConfiguration",
@@ -64439,13 +64263,6 @@ var ECRProvider = class {
64439
64263
  };
64440
64264
  });
64441
64265
  }
64442
- toCfnTagMutabilityExclusionFilters(sdk) {
64443
- if (!sdk || sdk.length === 0) return void 0;
64444
- return sdk.map((f) => ({
64445
- ...f.filterType !== void 0 && { ImageTagMutabilityExclusionFilterType: f.filterType },
64446
- ...f.filter !== void 0 && { ImageTagMutabilityExclusionFilterValue: f.filter }
64447
- }));
64448
- }
64449
64266
  async create(logicalId, resourceType, properties, context) {
64450
64267
  this.logger.debug(`Creating ECR Repository ${logicalId}`);
64451
64268
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
@@ -64626,43 +64443,22 @@ var ECRProvider = class {
64626
64443
  throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
64627
64444
  }
64628
64445
  }
64629
- async readCurrentState(physicalId, _logicalId, _resourceType) {
64630
- let repo;
64631
- try {
64632
- repo = await this.getClient().send(new DescribeRepositoriesCommand({ repositoryNames: [physicalId] }));
64633
- } catch (err) {
64634
- if (err instanceof RepositoryNotFoundException) return RESOURCE_NOT_FOUND;
64635
- throw err;
64636
- }
64637
- const r = repo.repositories?.[0];
64638
- if (!r) return RESOURCE_NOT_FOUND;
64639
- const result = {};
64640
- if (r.repositoryName !== void 0) result["RepositoryName"] = r.repositoryName;
64641
- if (r.imageTagMutability !== void 0) result["ImageTagMutability"] = r.imageTagMutability;
64642
- const cfnExclusionFilters = this.toCfnTagMutabilityExclusionFilters(r.imageTagMutabilityExclusionFilters);
64643
- if (cfnExclusionFilters) result["ImageTagMutabilityExclusionFilters"] = cfnExclusionFilters;
64644
- result["ImageScanningConfiguration"] = { ScanOnPush: r.imageScanningConfiguration?.scanOnPush ?? false };
64645
- {
64646
- const encType = r.encryptionConfiguration?.encryptionType ?? "AES256";
64647
- const enc = { EncryptionType: encType };
64648
- if (encType === "KMS" && r.encryptionConfiguration?.kmsKey) enc["KmsKey"] = r.encryptionConfiguration.kmsKey;
64649
- result["EncryptionConfiguration"] = enc;
64650
- }
64651
- try {
64652
- const lp = await this.getClient().send(new GetLifecyclePolicyCommand({ repositoryName: physicalId }));
64653
- if (lp.lifecyclePolicyText) result["LifecyclePolicy"] = { LifecyclePolicyText: lp.lifecyclePolicyText };
64654
- } catch (err) {
64655
- if (err instanceof RepositoryNotFoundException) return RESOURCE_NOT_FOUND;
64656
- if (!(err instanceof LifecyclePolicyNotFoundException)) throw err;
64657
- }
64658
- if (r.repositoryArn) try {
64659
- const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$9({ resourceArn: r.repositoryArn }));
64660
- result["Tags"] = normalizeAwsTagsToCfn(tagsResp.tags);
64661
- } catch (err) {
64662
- if (err instanceof RepositoryNotFoundException) return RESOURCE_NOT_FOUND;
64663
- throw err;
64664
- }
64665
- return result;
64446
+ readCurrentState(physicalId, logicalId, _resourceType, properties, context) {
64447
+ return readCurrentState$1.call(this, physicalId, logicalId, properties, context);
64448
+ }
64449
+ getDriftUnknownPaths(resourceType) {
64450
+ return resourceType === "AWS::ECR::Repository" ? ["EmptyOnDelete"] : [];
64451
+ }
64452
+ canonicalizeDriftProperties(resourceType, properties) {
64453
+ if (resourceType !== "AWS::ECR::Repository") return properties;
64454
+ const policy = properties["RepositoryPolicyText"];
64455
+ if (typeof policy !== "string") return properties;
64456
+ const parsed = declaredMemberDocument(policy);
64457
+ if (typeof parsed !== "object" || parsed === null) return properties;
64458
+ return {
64459
+ ...properties,
64460
+ RepositoryPolicyText: parsed
64461
+ };
64666
64462
  }
64667
64463
  async import(input) {
64668
64464
  const explicit = resolveExplicitPhysicalId(input, "RepositoryName");
@@ -65272,6 +65068,12 @@ async function cleanupRequestedCertificate(certificateArn, logicalId, idempotenc
65272
65068
  }
65273
65069
 
65274
65070
  // src/provisioning/providers/acm-certificate/update.ts
65071
+ function sameNamesWithDomain(properties) {
65072
+ const sans = properties["SubjectAlternativeNames"];
65073
+ const names = new Set(Array.isArray(sans) ? sans : sans === void 0 ? [] : [sans]);
65074
+ names.add(properties["DomainName"]);
65075
+ return JSON.stringify([...names].map((n) => JSON.stringify(n)).sort());
65076
+ }
65275
65077
  async function update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
65276
65078
  this.logger.debug(`Updating ACM certificate ${logicalId}: ${physicalId}`);
65277
65079
  properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
@@ -65288,6 +65090,7 @@ async function update(logicalId, physicalId, resourceType, properties, previousP
65288
65090
  let changedImmutable;
65289
65091
  for (const k of immutableFields) {
65290
65092
  if (JSON.stringify(properties[k]) === JSON.stringify(previousProperties[k])) continue;
65093
+ if (k === "SubjectAlternativeNames" && isDriftRevert(context) && sameNamesWithDomain(properties) === sameNamesWithDomain(previousProperties)) continue;
65291
65094
  if (k === "CertificateExport" && (properties[k] ?? "DISABLED") === (previousProperties[k] ?? "DISABLED")) continue;
65292
65095
  if (await unchangedBehindSecretReference({
65293
65096
  resourceType,
@@ -65300,6 +65103,7 @@ async function update(logicalId, physicalId, resourceType, properties, previousP
65300
65103
  break;
65301
65104
  }
65302
65105
  if (changedImmutable) {
65106
+ if (isDriftRevert(context)) throw revertReplacementRefusal(resourceType, logicalId, `its ${changedImmutable} differs from the live certificate's and cannot change in place`);
65303
65107
  this.logger.debug(`${changedImmutable} changed, replacing ACM certificate: ${physicalId}`);
65304
65108
  const createResult = await this.create(logicalId, resourceType, properties, context?.maskSecrets ? { maskSecrets: context.maskSecrets } : void 0);
65305
65109
  let orphanReason;
@@ -65600,4 +65404,4 @@ var ACMCertificateProvider = class {
65600
65404
  };
65601
65405
 
65602
65406
  export { ACMCertificateProvider, ASGProvider, AgentCoreBrowserProvider, AgentCoreCodeInterpreterProvider, AgentCoreEvaluatorProvider, AgentCoreRuntimeProvider, ApiGatewayProvider, ApiGatewayV2Provider, AppConfigEnvironmentProvider, AppSyncProvider, BudgetsBudgetProvider, CloudFrontDistributionProvider, CloudFrontOACProvider, CloudFrontOAIProvider, CloudTrailProvider, CloudWatchAlarmProvider, CloudWatchAnomalyDetectorProvider, CodeBuildProvider, CodeCommitRepositoryProvider, CognitoUserPoolProvider, DLMLifecyclePolicyProvider, DocDBProvider, DocDBSubnetGroupProvider, DynamoDBGlobalTableProvider, DynamoDBTableProvider, EC2Provider, ECRProvider, ECSProvider, EFSProvider, ELBv2Provider, EMRClusterProvider, EMRInstanceFleetConfigProvider, EMRInstanceGroupConfigProvider, ElastiCacheProvider, EventBridgeArchiveProvider, EventBridgeBusProvider, EventBridgeRuleProvider, FSxFileSystemProvider, FirehoseProvider, GlueConnectionProvider, GlueCrawlerProvider, GlueJobProvider, GlueProvider, GlueSecurityConfigurationProvider, GlueTriggerProvider, GlueWorkflowProvider, IAMAccessKeyProvider, IAMInstanceProfileProvider, IAMManagedPolicyProvider, IAMPolicyProvider, IAMRoleProvider, IAMUserGroupProvider, KMSProvider, KinesisStreamConsumerProvider, KinesisStreamProvider, LambdaEventInvokeConfigProvider, LambdaEventSourceMappingProvider, LambdaFunctionProvider, LambdaLayerVersionProvider, LambdaMicrovmImageProvider, LambdaNetworkConnectorProvider, LambdaPermissionProvider, LambdaUrlProvider, LambdaWebFunctionEndpointProvider, LambdaWebFunctionRevisionProvider, LogsDeliveryDestinationProvider, LogsDeliveryProvider, LogsDeliverySourceProvider, LogsLogGroupProvider, NeptuneProvider, NestedStackProvider, PipesPipeProvider, RDSDBProxyEndpointProvider, RDSDBProxyProvider, RDSDBProxyTargetGroupProvider, RDSProvider, Route53Provider, S3BucketPolicyProvider, S3BucketProvider, S3DirectoryBucketProvider, S3TablesProvider, S3VectorsProvider, SNSSubscriptionProvider, SNSTopicPolicyProvider, SNSTopicProvider, SQSQueuePolicyProvider, SQSQueueProvider, SSMParameterProvider, SchedulerScheduleProvider, SecretsManagerSecretProvider, ServiceDiscoveryProvider, StepFunctionsProvider, WAFv2WebACLProvider, WaitConditionHandleProvider };
65603
- //# sourceMappingURL=provider-classes-KrOpD8Sp.js.map
65407
+ //# sourceMappingURL=provider-classes-CwIe3PGY.js.map