@cdkd/cli 0.364.0 → 0.365.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/{ambient-client-defaults-BKnLt9R9.js → ambient-client-defaults-AnEvWPy0.js} +3 -3
  2. package/dist/{ambient-client-defaults-BKnLt9R9.js.map → ambient-client-defaults-AnEvWPy0.js.map} +1 -1
  3. package/dist/{asg-provider-D-wGQIgg.js → asg-provider-BzCU3XtA.js} +20 -13
  4. package/dist/{asg-provider-D-wGQIgg.js.map → asg-provider-BzCU3XtA.js.map} +1 -1
  5. package/dist/cli.js +3 -3
  6. package/dist/{custom-resource-runtime-BDRipTIL.js → custom-resource-runtime-SB_NsQMH.js} +6 -6
  7. package/dist/{custom-resource-runtime-BDRipTIL.js.map → custom-resource-runtime-SB_NsQMH.js.map} +1 -1
  8. package/dist/{db-associated-roles-cQd3Zmr5.js → db-associated-roles-D1wmFO_Y.js} +2 -2
  9. package/dist/{db-associated-roles-cQd3Zmr5.js.map → db-associated-roles-D1wmFO_Y.js.map} +1 -1
  10. package/dist/{delete-started-DHQvQxWa.js → delete-started-BJNrzLUk.js} +6 -6
  11. package/dist/{delete-started-DHQvQxWa.js.map → delete-started-BJNrzLUk.js.map} +1 -1
  12. package/dist/{deploy-engine-9rzhYsZc.js → deploy-engine-BSqVfcSN.js} +420 -141
  13. package/dist/deploy-engine-BSqVfcSN.js.map +1 -0
  14. package/dist/{ec2-termination-protection-Dttj-XrE.js → ec2-termination-protection-ekOvhSp9.js} +6 -6
  15. package/dist/{ec2-termination-protection-Dttj-XrE.js.map → ec2-termination-protection-ekOvhSp9.js.map} +1 -1
  16. package/dist/{ecr-uri-BYWBRpzv.js → ecr-uri-VpDi19pi.js} +2 -2
  17. package/dist/{ecr-uri-BYWBRpzv.js.map → ecr-uri-VpDi19pi.js.map} +1 -1
  18. package/dist/{expected-bucket-owner-DWEAlmAk.js → expected-bucket-owner-CmPtCsrQ.js} +2 -2
  19. package/dist/{expected-bucket-owner-DWEAlmAk.js.map → expected-bucket-owner-CmPtCsrQ.js.map} +1 -1
  20. package/dist/{iam-role-provider-fCKVbuHw.js → iam-role-provider-Ct6UbKFo.js} +132 -50
  21. package/dist/iam-role-provider-Ct6UbKFo.js.map +1 -0
  22. package/dist/{image-plan-XyUNOBmz.js → image-plan-gTOaUUbI.js} +8 -8
  23. package/dist/{image-plan-XyUNOBmz.js.map → image-plan-gTOaUUbI.js.map} +1 -1
  24. package/dist/index.d.ts +2 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +5 -5
  27. package/dist/{logger-xueeC0uS.js → logger-IBUeRw1z.js} +2 -2
  28. package/dist/{logger-xueeC0uS.js.map → logger-IBUeRw1z.js.map} +1 -1
  29. package/dist/{neptune-provider-ClN-LvMb.js → neptune-provider-QgaV_sKy.js} +14 -7
  30. package/dist/{neptune-provider-ClN-LvMb.js.map → neptune-provider-QgaV_sKy.js.map} +1 -1
  31. package/dist/{program-Dz-HwMKe.js → program-tHhew1Z5.js} +192 -33
  32. package/dist/program-tHhew1Z5.js.map +1 -0
  33. package/dist/{provider-classes-Bmipcl6d.js → provider-classes-DTMnDVMz.js} +1863 -805
  34. package/dist/provider-classes-DTMnDVMz.js.map +1 -0
  35. package/dist/{rds-provider-X8pB7V-7.js → rds-provider-D2dkhl8m.js} +17 -10
  36. package/dist/rds-provider-D2dkhl8m.js.map +1 -0
  37. package/dist/{read-replica-B9F3-d8h.js → read-replica-CfbVMoYV.js} +3 -3
  38. package/dist/{read-replica-B9F3-d8h.js.map → read-replica-CfbVMoYV.js.map} +1 -1
  39. package/dist/{replacement-rules-TNt9wPax.js → replacement-rules-BiIOJMA-.js} +5 -4
  40. package/dist/{replacement-rules-TNt9wPax.js.map → replacement-rules-BiIOJMA-.js.map} +1 -1
  41. package/dist/{resource-deadline-CUApArbf.js → resource-deadline-BSpNiiNd.js} +34 -5
  42. package/dist/resource-deadline-BSpNiiNd.js.map +1 -0
  43. package/dist/{restore-source-guard-jCM5yJzQ.js → restore-source-guard-Be6A_rNB.js} +4 -4
  44. package/dist/{restore-source-guard-jCM5yJzQ.js.map → restore-source-guard-Be6A_rNB.js.map} +1 -1
  45. package/dist/{run-cli-BDjbpUsh.js → run-cli-BkrNHPD5.js} +2 -2
  46. package/dist/{run-cli-BDjbpUsh.js.map → run-cli-BkrNHPD5.js.map} +1 -1
  47. package/dist/{settle-own-write-members-CSkozE9A.js → settle-own-write-members-BqAKt1e7.js} +12 -12
  48. package/dist/{settle-own-write-members-CSkozE9A.js.map → settle-own-write-members-BqAKt1e7.js.map} +1 -1
  49. package/dist/{version-BXn3jGiB.js → version-0AMFL2lR.js} +2 -2
  50. package/dist/{version-BXn3jGiB.js.map → version-0AMFL2lR.js.map} +1 -1
  51. package/package.json +2 -2
  52. package/dist/deploy-engine-9rzhYsZc.js.map +0 -1
  53. package/dist/iam-role-provider-fCKVbuHw.js.map +0 -1
  54. package/dist/program-Dz-HwMKe.js.map +0 -1
  55. package/dist/provider-classes-Bmipcl6d.js.map +0 -1
  56. package/dist/rds-provider-X8pB7V-7.js.map +0 -1
  57. package/dist/resource-deadline-CUApArbf.js.map +0 -1
@@ -1,36 +1,36 @@
1
- import { a as restoreOwnWriteRemovals, c as MANAGED_POLICY_OWNER, d as verifyInlinePolicyPrincipals, f as verifyOwnIdentityBeforeUpdate, h as IamCreateClientCache, i as recordOwnWriteRemoval, l as assertInlinePolicyAttachTargets, m as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, o as takeOwnWriteRemovals, p as iamEntityLeftByThisCreate, r as clearOwnWriteRemovals, s as InlinePolicyPrincipalMismatchError, t as IAMRoleProvider, u as compareMembershipWrites } from "./iam-role-provider-fCKVbuHw.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-xueeC0uS.js";
1
+ import { _ as isEntityAlreadyExists, a as stackOwnHolders, c as restoreOwnWriteRemovals, d as MANAGED_POLICY_OWNER, f as assertInlinePolicyAttachTargets, g as iamEntityLeftByThisCreate, h as verifyOwnIdentityBeforeUpdate, i as isStackOwnHolder, l as takeOwnWriteRemovals, m as verifyInlinePolicyPrincipals, n as collectInlinePolicyNamesManagedBySiblings, o as clearOwnWriteRemovals, p as compareMembershipWrites, r as heldText, s as recordOwnWriteRemoval, t as IAMRoleProvider, u as InlinePolicyPrincipalMismatchError, v as IamCreateClientCache } from "./iam-role-provider-Ct6UbKFo.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-IBUeRw1z.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, 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-BKnLt9R9.js";
5
- import { $ as isProceedDbStatus, $t as markAuxiliaryFailure, A as assertRegionMatch, At as canonicalizeRoute53QueryName, B as resolveExplicitPhysicalId, Bt as createMaskedRetryLogger, C as isInsideWindow, Ct as SECRET_DERIVED_READ_LIVE, D as withoutServerErrorRetries, E as setBounded, Et as readPrincipalLists, F as isQuotableImportValue, Ft as packCompositeId, G as logGroupProtectionSite, H as markNotGone, Ht as maskDeep, I as normalizeAwsTagsToCfn, K as observeThenDisableProtection, L as quotedRemedyLogicalId, Lt as segmentAfterAnchor, M as importRemedyCommand, Mt as compositeIdSeparatorRefusal, N as isPlainImportJson, Nt as compositeIdSkipResult, O as DriftReadRefusedError, Ot as recordedPrincipalsRepair, P as isPlainImportValue, Pt as logicalIdShown, R as refusalTypeShown, Rt as stateOrphanRecordRemedy, S as createAttemptKey, T as replayedSendWindow, Tt as onlySecretDerived, Ut as maskerOrIdentity, Vt as isSecretDerivedValue, W as deleteWithProtectionCompensation, Wt as withDerivedNameMasks, X as PROTECTION_FLIP_RETRY_WAIT_MS, Y as userPoolProtectionSite, Z as deleteAfterProtectionFlipWithFinalSnapshot, Zt as isAuxiliaryFailure, _ as AMBIGUOUS_LATCH_TTL_MS, _n as withPasteableAwsProfile, a as clearOnUpdateRemoval, b as RecentIdSet, bt as startInterruptWatch, c as removedTemplateKeys, dt as WITHHELD_AWS_COMMAND, en as markCreatedBeforeFailure, et as isTerminalDbWaitStatus, ft as isAwsCliLiteral, g as retractCreatedResource, ht as renderDisableCommand, it as protectionFlipKey, j as VALUE_NOT_SHOWN, jt as compositeIdFormatMessage, k as RESOURCE_NOT_FOUND, l as withRemovalDefaults, m as reportCreatedResource, mt as protectedReplacementAdvice, n as enclosingDeadlineRemainingMs, nt as ProtectionFlipRegistry, ot as ElapsedBudget, pt as pasteableAwsCommand, q as rdsFamilyProtectionSite, qt as clearCreatedBeforeFailure, rt as isTerminalDeleteFailure, st as ElapsedBudgetRegistry, t as enclosingDeadlineExpired, tn as markSupersedesEarlierCreate, ut as UNNAMEABLE_ID_CLAUSE, v as AmbiguousCreateLatch, vn as injectiveKey, w as replayFollowedAmbiguousAttempt, wt as holdsSecretDerivedEntry, x as ambiguousAttemptLead, y as CREATION_DATE_SKEW_MARGIN_MS, yn as injectiveKeyPrefix, yt as isInterruptedWaitError, z as remedyLogicalId, zt as createMaskedLogSinks } from "./resource-deadline-CUApArbf.js";
6
- import { A as displayStackName, L as truncateCodePoints, 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-BXn3jGiB.js";
7
- import { Ct as RecordedIdentityMismatchError, Mt as identityTimestamp, Ot as recordedIdentityId, Rt as isoTimestampAttribute, St as RecordedIdentityError, bt as lookupEachName, gt as deniedIdentityReadRefusal, kt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted, vt as chunks, wt as assertRecordedIdentity, xt as withApiLimit, yt as isAccessDeniedError } from "./delete-started-DHQvQxWa.js";
8
- import { $ as effectiveInventoryItem, A as tagListsMatch, B as LIFECYCLE_DEFAULT_STATUS, C as reconcileSgRules, D as singleSecurityGroupRuleId, E as sgRuleKey, F as clearLifecycleWritesOf, G as canonicalizeItemList, H as LIFECYCLE_RULE_PATH, I as lifecycleSettleTarget, J as lifecycleUsesFilterForm, K as effectiveLifecycleConfiguration, L as recordLifecycleWrite, M as sgRemovalRuleKey, N as sgRuleListMember, O as stackIngressRuleHolder, P as LIFECYCLE_BASELINE_REREAD_DELAYS_MS, Q as effectiveIntelligentTieringItem, R as settleLifecycleRead, S as narrowIngressIpProtocol, T as securityGroupRuleMatchesCfnIngress, U as LIFECYCLE_TAG_FILTERS_PATH, V as LIFECYCLE_FILTER_PATH, W as canonicalizeBlock, X as EVENTBRIDGE_CONFIG_PATH, Y as parseCfnTimestamp, Z as effectiveAnalyticsItem, _ as flattenIpPermissions, a as resolveSecretDerivedPrincipals, at as declaresBucketObjectLock, b as isDefaultEgressRule, c as readSgIngressById, ct as isPlainObject$5, d as SG_RULE_PAGE_SIZE, dt as shownLifecycleRuleId, et as effectiveNotificationConfiguration, f as authorizeDefinitelyNotApplied, g as descriptionKey, h as comparableIngressIdentity, i as isResolvableSecretPrincipalList, it as configItemId, j as markCopiesAgreed, k as survivingRecordOfRuleId, l as siblingIdOwnedSgRules, lt as manualBucketDeletionClause, m as canonicalizeSgRuleProtocol, n as runDestroyForStack, nt as caughtErrorName, o as refuseRevertRevokingSiblingRules, ot as declaresNestedObjectLock, p as canonicalizeSgInlineRuleProtocols, q as lifecycleRuleScope, r as holdsUnprovenSecretPrincipalToken, rt as coerceCfnNumber, s as sgRuleDiffKey, st as describeValue$1, t as canonicalizeIpv4Cidr, tt as eventBridgeEnabledOf, u as SG_READBACK_RETRY_DELAY_MS, ut as mergeLegacySingular, v as ingressRuleIdentity, w as securityGroupReadbackDelays, x as isResendableSocketFailure, y as isConnectTimeout, z as takeLifecycleWrite } from "./program-Dz-HwMKe.js";
9
- import { $ as recordTagWrite, $a as settleDeclaredMember, $r as REDACTED_DELETE_ADDRESS_SKIP_REASON, Aa as collectGroupsAddedBySiblings, Ao as waitForLambdaFunctionActive, At as resolveDynamoDbDeleteBudgetMs, B as declaredStreamTagsMember, Bt as hasCdkAutoDeleteTag, Ct as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, Cu as isAbsoluteAssetPath, Dr as calculateResourceDrift, Ds as parseWebACLArn, Dt as compensateRemovedDeletionProtection, Et as beginDeleteWait, Fa as withoutSiblingOwned, Fl as withheldAccountClause, Fr as earliestDefined, Ft as maskedLogger, G as streamDeclaresTags, Ga as SNS_DEFAULT_POLICY_ID, Gi as replacedDeleteFailureVerdict, Ha as KMS_DEFAULT_KEY_POLICY_ID, I as DynamoDBGlobalTableProvider, Ia as awaitInFlightSibling, It as relayedIndexBusyDelete, J as streamTagsMatchDeclared, Ja as efsPolicyMatchesDeclared, K as streamMemberRefusals, Ka as declaredMemberDocument, Kl as withoutSdkUnwiredProperties, L as STREAM_POLICY_KEY, Lo as deleteSkipReason, Lr as reserveStackCreateToken, Ls as getAccountInfo, Lt as waitForIndexesSettled, Ma as collectPrincipalsAttachingPolicy, Mo as waitForGoneAfterDelete, Mt as INDEX_SETTLE_POLL_INTERVAL_MS, Mu as decodeListingKey, Na as isStoredExpression, Nt as TABLE_INDEX_NOUN, Ot as deleteBudgetKey, Pa as withoutSiblingAttachedArns, Pl as accountArgs, Pt as deleteTableWithIndexBusyRetry, Q as isDynamoDBTableArnIn, Qa as reReadUntilSettled, R as STREAM_TAGS_KEY, Ra as getStackRecords, Ro as withIndeterminateGuard, Rt as ECR_AUTO_DELETE_IMAGES_TAG, Sd as resolveAssemblyPath, St as stripIndexContributorInsights, Su as findNestedTemplateTreeDefect, Tt as DYNAMODB_DELETE_POLL_COST_MS, Tu as renderNestedTemplateTreeDefect, U as reverseMapStreamPolicy, Ul as findSdkUnwiredProperties, V as planStreamMemberOps, Vo as markWaitAbandoned, Vt as isTruthyCfnBoolean, W as streamDeclaresPolicy, Wa as OWN_WRITE_REREAD_DELAYS_MS, Wu as rewriteTemplateAssetReferences, X as clearTagWrites, Xa as memberReadFailure, Xs as LEGACY_HANDLE_ID_PREFIX, Y as TAGS_BASELINE_REREAD_DELAYS_MS, Ya as lambdaPermissionMatchesDeclared, Za as policyDocumentMatchesDeclared, Zs as isLegacyHandleId, _n as getCurrentNestedStackContext, _s as s3BucketWebsiteUrl, _t as planContributorInsightsOp, ac as WARM_THROUGHPUT_MEMBERS, at as planTimeToLive, bo as getCurrentResourceSecrets, bt as reverseMapIndexContributorInsights, bu as stringifyValue, cc as toCfnInteger, ct as planVectorIndexUpdates, do as evaluateSignals, dr as withoutSiblingOwnedSgRules, dt as vectorIndexesSettled, ei as isRedactedRecordedValue, eo as warnUnsettledMember, et as settleWrittenTags, eu as normalizeRecordName, fc as maskedSecretSegment, fr as SG_RULE_ID_PATTERN, ft as vectorIndexesShapeDetail, gs as s3BucketRegionalDomainName, gt as indexDeclaresContributorInsights, ha as secretNamedAttributeNamesOf, hr as sgProtocolKey, hs as s3BucketDualStackDomainName, ht as contributorInsightsRefusals, it as isTtlRateLimited, ja as collectManagedPolicyArnsAttachedBySiblings, js as outputReferenceProvenanceOf, jt as DELETE_INDEX_WAIT_PROCEED_NOTE, kl as refuseMalformedResourcesForDestroy, kt as resolveDynamoDbDeleteBudgetClock, lc as toFiniteNumber, lo as WaitConditionSignalStore, lr as siblingOwnedSgRuleIdentities, lt as readbackVectorIndexes, mr as recordedSgRuleId, ms as s3BucketDomainName, mt as completeTableContributorInsightsBaseline, ni as redactedDeleteAddressSkip, nn as licensedNameHolder, no as attemptedPolicyDocument, nt as takeTagWrite, oc as coerceWarmThroughput$1, ot as readTtlSpec, pi as getCurrentProducerRegions, pn as revertNestedChildFromJournal, pr as cfnIngressPortValue, ps as s3BucketArn, pt as CONTRIBUTOR_INSIGHTS_KEY, q as streamPolicyMatchesDeclared, qa as declaredPolicyDocument, qo as isSettledInstanceState, ro as policyContentKey, rt as isTtlAlreadyDisabled, sc as isWarmThroughputDecrease, st as sendTtlWaitingOutRateLimit, t as DeployEngine, ti as redactedDeleteAddressFields, to as verbatimEchoDriftKeys, tu as planSubscriptionAttributes, uc as APPSYNC_APIKEY_ARN_RESOURCE_PATH, un as getNestedRevertRun, uo as classifyHandleUrl, ut as vectorIndexesForCreate, vd as describeFileReadFailure, vn as withNestedStackContext, vt as planIndexContributorInsightsOps, wc as passedParameterClassesOf, wt as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, wu as listNestedTemplateRows, xd as renderAssemblyPathEscape, xt as reverseMapTableContributorInsights, yd as displayAssemblyPath, yl as refuseMalformedNestedChildOutputs, yt as readContributorInsightsSpec, z as declaredStreamPolicyMember, zr as acquireIdempotencyToken, zt as S3_AUTO_DELETE_OBJECTS_TAG } from "./deploy-engine-9rzhYsZc.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-jCM5yJzQ.js";
11
- import { W as timePhase, _ as onlySecretReferencesDiffer, a as reDisableInstanceApiTermination, c as resolvedResourceTimeoutMs, f as markRefusedBeforeApplying, i as observeThenDisableInstanceApiTermination, j as withRetry, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, r as isTerminationProtectionPropagationError, s as resolvedPerTypeResourceTimeoutMs, u as getPriorAttempts, v as unchangedBehindSecretReference } from "./ec2-termination-protection-Dttj-XrE.js";
12
- import { a as principalOwnWriteMembers, c as stringListMember, n as declaredStringList, o as settleOwnWriteMembers } from "./settle-own-write-members-CSkozE9A.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, 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-AnEvWPy0.js";
5
+ import { $t as isAuxiliaryFailure, A as assertRegionMatch, At as recordedPrincipalsRepair, B as remedyLogicalId, Bt as stateOrphanRecordRemedy, C as isInsideWindow, D as withoutServerErrorRetries, Dt as onlySecretDerived, E as setBounded, Et as holdsSecretDerivedEntry, F as isPlainImportValue, Ft as compositeIdSkipResult, G as deleteWithProtectionCompensation, Gt as maskerOrIdentity, Ht as createMaskedRetryLogger, I as isQuotableImportValue, It as logicalIdShown, J as rdsFamilyProtectionSite, K as logGroupProtectionSite, Kt as withDerivedNameMasks, L as normalizeAwsTagsToCfn, Lt as packCompositeId, M as VALUE_NOT_SHOWN, Mt as canonicalizeRoute53QueryName, N as importRemedyCommand, Nt as compositeIdFormatMessage, O as DriftReadRefusedError, Ot as readPrincipalLists, P as isPlainImportJson, Pt as compositeIdSeparatorRefusal, Q as deleteAfterProtectionFlipWithFinalSnapshot, R as quotedRemedyLogicalId, S as createAttemptKey, T as replayedSendWindow, Tt as diffPrincipalNames, U as markNotGone, Ut as isSecretDerivedValue, V as resolveExplicitPhysicalId, Vt as createMaskedLogSinks, Wt as maskDeep, X as userPoolProtectionSite, Yt as clearCreatedBeforeFailure, Z as PROTECTION_FLIP_RETRY_WAIT_MS, _ as AMBIGUOUS_LATCH_TTL_MS, a as clearOnUpdateRemoval, at as protectionFlipKey, b as RecentIdSet, bn as injectiveKey, bt as isInterruptedWaitError, c as removedTemplateKeys, ct as ElapsedBudgetRegistry, dt as UNNAMEABLE_ID_CLAUSE, et as isProceedDbStatus, ft as WITHHELD_AWS_COMMAND, g as retractCreatedResource, gt as renderDisableCommand, ht as protectedReplacementAdvice, it as isTerminalDeleteFailure, j as holderRefusalRun, k as RESOURCE_NOT_FOUND, l as withRemovalDefaults, m as reportCreatedResource, mt as pasteableAwsCommand, n as enclosingDeadlineRemainingMs, nn as markCreatedBeforeFailure, pt as isAwsCliLiteral, q as observeThenDisableProtection, rn as markSupersedesEarlierCreate, rt as ProtectionFlipRegistry, st as ElapsedBudget, t as enclosingDeadlineExpired, tn as markAuxiliaryFailure, tt as isTerminalDbWaitStatus, v as AmbiguousCreateLatch, w as replayFollowedAmbiguousAttempt, wt as SECRET_DERIVED_READ_LIVE, x as ambiguousAttemptLead, xn as injectiveKeyPrefix, xt as startInterruptWatch, y as CREATION_DATE_SKEW_MARGIN_MS, yn as withPasteableAwsProfile, z as refusalTypeShown, zt as segmentAfterAnchor } from "./resource-deadline-BSpNiiNd.js";
6
+ import { A as displayStackName, L as truncateCodePoints, 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-0AMFL2lR.js";
7
+ import { Ct as RecordedIdentityMismatchError, Mt as identityTimestamp, Ot as recordedIdentityId, Rt as isoTimestampAttribute, St as RecordedIdentityError, bt as lookupEachName, gt as deniedIdentityReadRefusal, kt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted, vt as chunks, wt as assertRecordedIdentity, xt as withApiLimit, yt as isAccessDeniedError } from "./delete-started-BJNrzLUk.js";
8
+ import { $ as effectiveInventoryItem, A as tagListsMatch, B as LIFECYCLE_DEFAULT_STATUS, C as reconcileSgRules, D as singleSecurityGroupRuleId, E as sgRuleKey, F as clearLifecycleWritesOf, G as canonicalizeItemList, H as LIFECYCLE_RULE_PATH, I as lifecycleSettleTarget, J as lifecycleUsesFilterForm, K as effectiveLifecycleConfiguration, L as recordLifecycleWrite, M as sgRemovalRuleKey, N as sgRuleListMember, O as stackIngressRuleHolder, P as LIFECYCLE_BASELINE_REREAD_DELAYS_MS, Q as effectiveIntelligentTieringItem, R as settleLifecycleRead, S as narrowIngressIpProtocol, T as securityGroupRuleMatchesCfnIngress, U as LIFECYCLE_TAG_FILTERS_PATH, V as LIFECYCLE_FILTER_PATH, W as canonicalizeBlock, X as EVENTBRIDGE_CONFIG_PATH, Y as parseCfnTimestamp, Z as effectiveAnalyticsItem, _ as flattenIpPermissions, a as resolveSecretDerivedPrincipals, at as declaresBucketObjectLock, b as isDefaultEgressRule, c as readSgIngressById, ct as isPlainObject$5, d as SG_RULE_PAGE_SIZE, dt as shownLifecycleRuleId, et as effectiveNotificationConfiguration, f as authorizeDefinitelyNotApplied, g as descriptionKey, h as comparableIngressIdentity, i as isResolvableSecretPrincipalList, it as configItemId, j as markCopiesAgreed, k as survivingRecordOfRuleId, l as siblingIdOwnedSgRules, lt as manualBucketDeletionClause, m as canonicalizeSgRuleProtocol, n as runDestroyForStack, nt as caughtErrorName, o as refuseRevertRevokingSiblingRules, ot as declaresNestedObjectLock, p as canonicalizeSgInlineRuleProtocols, q as lifecycleRuleScope, r as holdsUnprovenSecretPrincipalToken, rt as coerceCfnNumber, s as sgRuleDiffKey, st as describeValue$1, t as canonicalizeIpv4Cidr, tt as eventBridgeEnabledOf, u as SG_READBACK_RETRY_DELAY_MS, ut as mergeLegacySingular, v as ingressRuleIdentity, w as securityGroupReadbackDelays, x as isResendableSocketFailure, y as isConnectTimeout, z as takeLifecycleWrite } from "./program-tHhew1Z5.js";
9
+ import { $ as recordTagWrite, $a as reReadUntilSettled, $r as REDACTED_DELETE_ADDRESS_SKIP_REASON, Al as refuseMalformedResourcesForDestroy, At as resolveDynamoDbDeleteBudgetMs, B as declaredStreamTagsMember, Bt as hasCdkAutoDeleteTag, Cd as resolveAssemblyPath, Ct as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, Cu as findNestedTemplateTreeDefect, Dr as calculateResourceDrift, Dt as compensateRemovedDeletionProtection, Et as beginDeleteWait, Eu as renderNestedTemplateTreeDefect, Fa as withoutSiblingAttachedArns, Fl as accountArgs, Fr as earliestDefined, Ft as maskedLogger, G as streamDeclaresTags, Ga as OWN_WRITE_REREAD_DELAYS_MS, Gu as rewriteTemplateAssetReferences, Ho as markWaitAbandoned, I as DynamoDBGlobalTableProvider, Ia as withoutSiblingOwned, Il as withheldAccountClause, It as relayedIndexBusyDelete, J as streamTagsMatchDeclared, Ja as declaredPolicyDocument, Jo as isSettledInstanceState, K as streamMemberRefusals, Ka as SNS_DEFAULT_POLICY_ID, Ki as replacedDeleteFailureVerdict, L as STREAM_POLICY_KEY, La as awaitInFlightSibling, Lr as reserveStackCreateToken, Lt as waitForIndexesSettled, Ma as collectManagedPolicyArnsAttachedBySiblings, Ms as outputReferenceProvenanceOf, Mt as INDEX_SETTLE_POLL_INTERVAL_MS, Na as collectPrincipalsAttachingPolicy, No as waitForGoneAfterDelete, Nt as TABLE_INDEX_NOUN, Nu as decodeListingKey, Os as parseWebACLArn, Ot as deleteBudgetKey, Pa as isStoredExpression, Pt as deleteTableWithIndexBusyRetry, Q as isDynamoDBTableArnIn, Qa as policyDocumentMatchesDeclared, Qs as isLegacyHandleId, R as STREAM_TAGS_KEY, Ro as deleteSkipReason, Rs as getAccountInfo, Rt as ECR_AUTO_DELETE_IMAGES_TAG, Sd as renderAssemblyPathEscape, St as stripIndexContributorInsights, Tc as passedParameterClassesOf, Tt as DYNAMODB_DELETE_POLL_COST_MS, Tu as listNestedTemplateRows, U as reverseMapStreamPolicy, Ua as KMS_DEFAULT_KEY_POLICY_ID, V as planStreamMemberOps, Vt as isTruthyCfnBoolean, W as streamDeclaresPolicy, Wl as findSdkUnwiredProperties, X as clearTagWrites, Xa as lambdaPermissionMatchesDeclared, Y as TAGS_BASELINE_REREAD_DELAYS_MS, Ya as efsPolicyMatchesDeclared, Za as memberReadFailure, Zs as LEGACY_HANDLE_ID_PREFIX, _n as getCurrentNestedStackContext, _s as s3BucketRegionalDomainName, _t as planContributorInsightsOp, at as planTimeToLive, bd as displayAssemblyPath, bl as refuseMalformedNestedChildOutputs, bt as reverseMapIndexContributorInsights, cc as isWarmThroughputDecrease, ct as planVectorIndexUpdates, dc as APPSYNC_APIKEY_ARN_RESOURCE_PATH, do as classifyHandleUrl, dr as withoutSiblingOwnedSgRules, dt as vectorIndexesSettled, ei as isRedactedRecordedValue, eo as settleDeclaredMember, et as settleWrittenTags, fo as evaluateSignals, fr as SG_RULE_ID_PATTERN, ft as vectorIndexesShapeDetail, ga as secretNamedAttributeNamesOf, gs as s3BucketDualStackDomainName, gt as indexDeclaresContributorInsights, hr as sgProtocolKey, hs as s3BucketDomainName, ht as contributorInsightsRefusals, io as policyContentKey, it as isTtlRateLimited, ja as collectGroupsAddedBySiblings, jo as waitForLambdaFunctionActive, jt as DELETE_INDEX_WAIT_PROCEED_NOTE, kt as resolveDynamoDbDeleteBudgetClock, lc as toCfnInteger, lr as siblingOwnedSgRuleIdentities, lt as readbackVectorIndexes, mr as recordedSgRuleId, ms as s3BucketArn, mt as completeTableContributorInsightsBaseline, ni as redactedDeleteAddressSkip, nn as licensedNameHolder, no as verbatimEchoDriftKeys, nt as takeTagWrite, nu as planSubscriptionAttributes, oc as WARM_THROUGHPUT_MEMBERS, ot as readTtlSpec, pc as maskedSecretSegment, pi as getCurrentProducerRegions, pn as revertNestedChildFromJournal, pr as cfnIngressPortValue, pt as CONTRIBUTOR_INSIGHTS_KEY, q as streamPolicyMatchesDeclared, qa as declaredMemberDocument, ql as withoutSdkUnwiredProperties, ro as attemptedPolicyDocument, rt as isTtlAlreadyDisabled, sc as coerceWarmThroughput$1, st as sendTtlWaitingOutRateLimit, t as DeployEngine, ti as redactedDeleteAddressFields, to as warnUnsettledMember, tu as normalizeRecordName, uc as toFiniteNumber, un as getNestedRevertRun, uo as WaitConditionSignalStore, ut as vectorIndexesForCreate, vn as withNestedStackContext, vs as s3BucketWebsiteUrl, vt as planIndexContributorInsightsOps, wt as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, wu as isAbsoluteAssetPath, xo as getCurrentResourceSecrets, xt as reverseMapTableContributorInsights, xu as stringifyValue, yd as describeFileReadFailure, yt as readContributorInsightsSpec, z as declaredStreamPolicyMember, za as getStackRecords, zo as withIndeterminateGuard, zr as acquireIdempotencyToken, zt as S3_AUTO_DELETE_OBJECTS_TAG } from "./deploy-engine-BSqVfcSN.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-Be6A_rNB.js";
11
+ import { W as timePhase, _ as onlySecretReferencesDiffer, a as reDisableInstanceApiTermination, c as resolvedResourceTimeoutMs, f as markRefusedBeforeApplying, i as observeThenDisableInstanceApiTermination, j as withRetry, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, r as isTerminationProtectionPropagationError, s as resolvedPerTypeResourceTimeoutMs, u as getPriorAttempts, v as unchangedBehindSecretReference } from "./ec2-termination-protection-ekOvhSp9.js";
12
+ import { a as principalOwnWriteMembers, c as stringListMember, n as declaredStringList, o as settleOwnWriteMembers } from "./settle-own-write-members-BqAKt1e7.js";
13
13
  import { n as canonicalizeRegion, r as derivePartitionAndUrlSuffix } from "./aws-partition-DA0r2sr-.js";
14
14
  import { f as ambientRegion, r as awsEndpointOverrideActive } from "./aws-client-defaults-DAebi99J.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-TNt9wPax.js";
16
- import { RDSProvider } from "./rds-provider-X8pB7V-7.js";
17
- import { NeptuneProvider } from "./neptune-provider-ClN-LvMb.js";
18
- import { ASGProvider } from "./asg-provider-D-wGQIgg.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-BiIOJMA-.js";
16
+ import { RDSProvider } from "./rds-provider-D2dkhl8m.js";
17
+ import { NeptuneProvider } from "./neptune-provider-QgaV_sKy.js";
18
+ import { ASGProvider } from "./asg-provider-BzCU3XtA.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
- 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";
21
+ import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteConflictException, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetLoginProfileCommand, 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";
22
22
  import { CreateQueueCommand, DeleteQueueCommand, GetQueueAttributesCommand, GetQueueUrlCommand, ListQueueTagsCommand, QueueDoesNotExist, SQSClient, SetQueueAttributesCommand, TagQueueCommand, UntagQueueCommand } from "@aws-sdk/client-sqs";
23
23
  import { AuthorizationErrorException, CreateTopicCommand, DeleteTopicCommand, GetSubscriptionAttributesCommand, GetTopicAttributesCommand, InvalidParameterException, ListSubscriptionsByTopicCommand, ListTagsForResourceCommand, ListTopicsCommand, NotFoundException, SNSClient, SetSubscriptionAttributesCommand, SetTopicAttributesCommand, SubscribeCommand, TagResourceCommand, UnsubscribeCommand, UntagResourceCommand } from "@aws-sdk/client-sns";
24
- import { AddPermissionCommand, CreateEventSourceMappingCommand, CreateFunctionCommand, CreateFunctionUrlConfigCommand, DeleteEventSourceMappingCommand, DeleteFunctionCodeSigningConfigCommand, DeleteFunctionCommand, DeleteFunctionConcurrencyCommand, DeleteFunctionEventInvokeConfigCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCodeSigningConfigCommand, GetFunctionCommand, GetFunctionConcurrencyCommand, GetFunctionConfigurationCommand, GetFunctionEventInvokeConfigCommand, GetFunctionRecursionConfigCommand, GetFunctionScalingConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, GetRuntimeManagementConfigCommand, LambdaClient, ListEventSourceMappingsCommand, ListLayerVersionsCommand, ListTagsCommand, PublishLayerVersionCommand, PublishVersionCommand, PutFunctionCodeSigningConfigCommand, PutFunctionConcurrencyCommand, PutFunctionEventInvokeConfigCommand, PutFunctionRecursionConfigCommand, PutFunctionScalingConfigCommand, PutRuntimeManagementConfigCommand, RemovePermissionCommand, ResourceNotFoundException, TagResourceCommand as TagResourceCommand$1, UntagResourceCommand as UntagResourceCommand$1, UpdateEventSourceMappingCommand, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, UpdateFunctionUrlConfigCommand, waitUntilFunctionActiveV2, waitUntilFunctionUpdatedV2 } from "@aws-sdk/client-lambda";
24
+ import { AddPermissionCommand, CodeSigningConfigNotFoundException, CreateEventSourceMappingCommand, CreateFunctionCommand, CreateFunctionUrlConfigCommand, DeleteEventSourceMappingCommand, DeleteFunctionCodeSigningConfigCommand, DeleteFunctionCommand, DeleteFunctionConcurrencyCommand, DeleteFunctionEventInvokeConfigCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCodeSigningConfigCommand, GetFunctionCommand, GetFunctionConcurrencyCommand, GetFunctionConfigurationCommand, GetFunctionEventInvokeConfigCommand, GetFunctionRecursionConfigCommand, GetFunctionScalingConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, GetRuntimeManagementConfigCommand, LambdaClient, ListEventSourceMappingsCommand, ListLayerVersionsCommand, ListTagsCommand, PublishLayerVersionCommand, PublishVersionCommand, PutFunctionCodeSigningConfigCommand, PutFunctionConcurrencyCommand, PutFunctionEventInvokeConfigCommand, PutFunctionRecursionConfigCommand, PutFunctionScalingConfigCommand, PutRuntimeManagementConfigCommand, RemovePermissionCommand, ResourceNotFoundException, TagResourceCommand as TagResourceCommand$1, UntagResourceCommand as UntagResourceCommand$1, UpdateEventSourceMappingCommand, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, UpdateFunctionUrlConfigCommand, waitUntilFunctionActiveV2, waitUntilFunctionUpdatedV2 } from "@aws-sdk/client-lambda";
25
25
  import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
26
26
  import { AllocateAddressCommand, AssociateAddressCommand, AssociateIamInstanceProfileCommand, AssociateNatGatewayAddressCommand, AssociateRouteTableCommand, AssociateSubnetCidrBlockCommand, AttachInternetGatewayCommand, AttachVolumeCommand, AttachVpnGatewayCommand, AuthorizeSecurityGroupEgressCommand, AuthorizeSecurityGroupIngressCommand, CreateInternetGatewayCommand, CreateNatGatewayCommand, CreateNetworkAclCommand, CreateNetworkAclEntryCommand, CreateRouteCommand, CreateRouteTableCommand, CreateSecurityGroupCommand, CreateSubnetCommand, CreateTagsCommand, CreateVpcCommand, DeleteInternetGatewayCommand, DeleteNatGatewayCommand, DeleteNetworkAclCommand, DeleteNetworkAclEntryCommand, DeleteNetworkInterfaceCommand, DeleteRouteCommand, DeleteRouteTableCommand, DeleteSecurityGroupCommand, DeleteSubnetCommand, DeleteTagsCommand, DeleteVpcCommand, DescribeAddressesCommand, DescribeAvailabilityZonesCommand, DescribeIamInstanceProfileAssociationsCommand, DescribeInstanceAttributeCommand, DescribeInstanceCreditSpecificationsCommand, DescribeInstancesCommand, DescribeInternetGatewaysCommand, DescribeNatGatewaysCommand, DescribeNetworkAclsCommand, DescribeNetworkInterfacesCommand, DescribeRouteTablesCommand, DescribeSecurityGroupRulesCommand, DescribeSecurityGroupsCommand, DescribeSubnetsCommand, DescribeVolumesCommand, DescribeVpcAttributeCommand, DescribeVpcsCommand, DescribeVpnGatewaysCommand, DetachInternetGatewayCommand, DetachVolumeCommand, DetachVpnGatewayCommand, DisassociateAddressCommand, DisassociateIamInstanceProfileCommand, DisassociateNatGatewayAddressCommand, DisassociateRouteTableCommand, DisassociateSubnetCidrBlockCommand, EC2Client, GetIpamPoolAllocationsCommand, ModifyInstanceAttributeCommand, ModifyInstanceCreditSpecificationCommand, ModifyInstanceMetadataOptionsCommand, ModifyInstancePlacementCommand, ModifyPrivateDnsNameOptionsCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, ModifyVpcTenancyCommand, MonitorInstancesCommand, ReleaseAddressCommand, ReplaceIamInstanceProfileAssociationCommand, ReplaceNetworkAclAssociationCommand, ReplaceNetworkAclEntryCommand, ReplaceRouteCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, StartInstancesCommand, StopInstancesCommand, TerminateInstancesCommand, UnmonitorInstancesCommand, UpdateSecurityGroupRuleDescriptionsEgressCommand, UpdateSecurityGroupRuleDescriptionsIngressCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
27
- import { CreateTableCommand, DeleteResourcePolicyCommand, DeleteTableCommand, DescribeContinuousBackupsCommand, DescribeContributorInsightsCommand, DescribeKinesisStreamingDestinationCommand, DescribeTableCommand, DescribeTimeToLiveCommand, DisableKinesisStreamingDestinationCommand, DynamoDBClient, EnableKinesisStreamingDestinationCommand, GetResourcePolicyCommand, ListTagsOfResourceCommand, PolicyNotFoundException, PutResourcePolicyCommand, ResourceNotFoundException as ResourceNotFoundException$1, TagResourceCommand as TagResourceCommand$2, UntagResourceCommand as UntagResourceCommand$2, UpdateContinuousBackupsCommand, UpdateContributorInsightsCommand, UpdateKinesisStreamingDestinationCommand, UpdateTableCommand, UpdateTimeToLiveCommand } from "@aws-sdk/client-dynamodb";
27
+ import { CreateTableCommand, DeleteResourcePolicyCommand, DeleteTableCommand, DescribeContinuousBackupsCommand, DescribeContributorInsightsCommand, DescribeKinesisStreamingDestinationCommand, DescribeTableCommand, DescribeTimeToLiveCommand, DisableKinesisStreamingDestinationCommand, DynamoDBClient, EnableKinesisStreamingDestinationCommand, GetResourcePolicyCommand, ListTagsOfResourceCommand, PolicyNotFoundException, PutResourcePolicyCommand, ResourceNotFoundException as ResourceNotFoundException$1, TableNotFoundException, TagResourceCommand as TagResourceCommand$2, UntagResourceCommand as UntagResourceCommand$2, UpdateContinuousBackupsCommand, UpdateContributorInsightsCommand, UpdateKinesisStreamingDestinationCommand, UpdateTableCommand, UpdateTimeToLiveCommand } from "@aws-sdk/client-dynamodb";
28
28
  import { APIGatewayClient, CreateAuthorizerCommand, CreateDeploymentCommand, CreateResourceCommand, CreateRestApiCommand, CreateStageCommand, DeleteAuthorizerCommand, DeleteDeploymentCommand, DeleteIntegrationCommand, DeleteIntegrationResponseCommand, DeleteMethodCommand, DeleteMethodResponseCommand, DeleteResourceCommand, DeleteRestApiCommand, DeleteStageCommand, GetAccountCommand, GetAuthorizerCommand, GetAuthorizersCommand, GetDeploymentCommand, GetDeploymentsCommand, GetMethodCommand, GetResourceCommand, GetRestApiCommand, GetRestApisCommand, GetStageCommand, ImportRestApiCommand, NotFoundException as NotFoundException$1, PutIntegrationCommand, PutIntegrationResponseCommand, PutMethodCommand, PutMethodResponseCommand, PutRestApiCommand, TagResourceCommand as TagResourceCommand$3, UntagResourceCommand as UntagResourceCommand$3, UpdateAccountCommand, UpdateAuthorizerCommand, UpdateDeploymentCommand, UpdateMethodCommand, UpdateRestApiCommand, UpdateStageCommand } from "@aws-sdk/client-api-gateway";
29
29
  import { CreateArchiveCommand, CreateEventBusCommand, DeleteArchiveCommand, DeleteEventBusCommand, DeleteRuleCommand, DescribeArchiveCommand, DescribeEventBusCommand, DescribeRuleCommand, EventBridgeClient, ListRulesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$1, ListTargetsByRuleCommand, PutPermissionCommand, PutRuleCommand, PutTargetsCommand, RemoveTargetsCommand, ResourceNotFoundException as ResourceNotFoundException$2, TagResourceCommand as TagResourceCommand$4, UntagResourceCommand as UntagResourceCommand$4, UpdateArchiveCommand, UpdateEventBusCommand } from "@aws-sdk/client-eventbridge";
30
30
  import { CreateSecretCommand, DeleteSecretCommand, DescribeSecretCommand, RemoveRegionsFromReplicationCommand, ReplicateSecretToRegionsCommand, ResourceNotFoundException as ResourceNotFoundException$3, SecretsManagerClient, TagResourceCommand as TagResourceCommand$5, UntagResourceCommand as UntagResourceCommand$5, UpdateSecretCommand } from "@aws-sdk/client-secrets-manager";
31
31
  import { AddTagsToResourceCommand, CreateAssociationCommand, DeleteAssociationCommand, DeleteParameterCommand, DescribeAssociationCommand, DescribeParametersCommand, GetParameterCommand, ListAssociationsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$2, ParameterNotFound, PutParameterCommand, RemoveTagsFromResourceCommand, SSMClient } from "@aws-sdk/client-ssm";
32
- import { CloudFrontClient, CreateCloudFrontOriginAccessIdentityCommand, CreateDistributionCommand, CreateDistributionWithTagsCommand, CreateOriginAccessControlCommand, DeleteCloudFrontOriginAccessIdentityCommand, DeleteDistributionCommand, DeleteOriginAccessControlCommand, DistributionAlreadyExists, GetCloudFrontOriginAccessIdentityCommand, GetDistributionCommand, GetDistributionConfigCommand, GetOriginAccessControlCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$3, NoSuchCloudFrontOriginAccessIdentity, NoSuchDistribution, NoSuchOriginAccessControl, TagResourceCommand as TagResourceCommand$6, UntagResourceCommand as UntagResourceCommand$6, UpdateCloudFrontOriginAccessIdentityCommand, UpdateDistributionCommand, UpdateOriginAccessControlCommand } from "@aws-sdk/client-cloudfront";
33
- import { CloudWatchClient, DeleteAlarmsCommand, DeleteAnomalyDetectorCommand, DescribeAlarmsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$4, PutAnomalyDetectorCommand, PutMetricAlarmCommand, ResourceNotFoundException as ResourceNotFoundException$4, TagResourceCommand as TagResourceCommand$7, UntagResourceCommand as UntagResourceCommand$7 } from "@aws-sdk/client-cloudwatch";
32
+ import { CloudFrontClient, CreateCloudFrontOriginAccessIdentityCommand, CreateDistributionCommand, CreateDistributionWithTagsCommand, CreateOriginAccessControlCommand, DeleteCloudFrontOriginAccessIdentityCommand, DeleteDistributionCommand, DeleteOriginAccessControlCommand, DistributionAlreadyExists, GetCloudFrontOriginAccessIdentityCommand, GetDistributionCommand, GetDistributionConfigCommand, GetOriginAccessControlCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$3, NoSuchCloudFrontOriginAccessIdentity, NoSuchDistribution, NoSuchOriginAccessControl, NoSuchResource, TagResourceCommand as TagResourceCommand$6, UntagResourceCommand as UntagResourceCommand$6, UpdateCloudFrontOriginAccessIdentityCommand, UpdateDistributionCommand, UpdateOriginAccessControlCommand } from "@aws-sdk/client-cloudfront";
33
+ import { CloudWatchClient, DeleteAlarmsCommand, DeleteAnomalyDetectorCommand, DescribeAlarmsCommand, DescribeAnomalyDetectorsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$4, PutAnomalyDetectorCommand, PutMetricAlarmCommand, ResourceNotFoundException as ResourceNotFoundException$4, TagResourceCommand as TagResourceCommand$7, UntagResourceCommand as UntagResourceCommand$7 } from "@aws-sdk/client-cloudwatch";
34
34
  import { AssociateKmsKeyCommand, CloudWatchLogsClient, CreateDeliveryCommand, CreateLogGroupCommand, DeleteDataProtectionPolicyCommand, DeleteDeliveryCommand, DeleteDeliveryDestinationCommand, DeleteDeliveryDestinationPolicyCommand, DeleteDeliverySourceCommand, DeleteIndexPolicyCommand, DeleteLogGroupCommand, DeleteRetentionPolicyCommand, DescribeDeliveriesCommand, DescribeIndexPoliciesCommand, DescribeLogGroupsCommand, DisassociateKmsKeyCommand, GetDataProtectionPolicyCommand, GetDeliveryCommand, GetDeliveryDestinationCommand, GetDeliveryDestinationPolicyCommand, GetDeliverySourceCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$5, PutBearerTokenAuthenticationCommand, PutDataProtectionPolicyCommand, PutDeliveryDestinationCommand, PutDeliveryDestinationPolicyCommand, PutDeliverySourceCommand, PutIndexPolicyCommand, PutLogGroupDeletionProtectionCommand, PutRetentionPolicyCommand, ResourceAlreadyExistsException, ResourceNotFoundException as ResourceNotFoundException$5, TagResourceCommand as TagResourceCommand$8, UntagResourceCommand as UntagResourceCommand$8, UpdateDeliveryConfigurationCommand } from "@aws-sdk/client-cloudwatch-logs";
35
35
  import { BedrockAgentCoreControlClient, CreateAgentRuntimeCommand, CreateEvaluatorCommand, DeleteAgentRuntimeCommand, DeleteEvaluatorCommand, GetAgentRuntimeCommand, GetBrowserCommand, GetCodeInterpreterCommand, GetEvaluatorCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$6, ResourceNotFoundException as ResourceNotFoundException$6, TagResourceCommand as TagResourceCommand$9, UntagResourceCommand as UntagResourceCommand$9, UpdateAgentRuntimeCommand, UpdateEvaluatorCommand } from "@aws-sdk/client-bedrock-agentcore-control";
36
36
  import { AddTagsToResourceCommand as AddTagsToResourceCommand$1, CreateCacheClusterCommand, CreateCacheSubnetGroupCommand, DeleteCacheClusterCommand, DeleteCacheSubnetGroupCommand, DescribeCacheClustersCommand, DescribeCacheSubnetGroupsCommand, ElastiCacheClient, ListTagsForResourceCommand as ListTagsForResourceCommand$7, ModifyCacheClusterCommand, ModifyCacheSubnetGroupCommand, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$1 } from "@aws-sdk/client-elasticache";
@@ -43,7 +43,7 @@ import * as fs from "node:fs";
43
43
  import * as path from "node:path";
44
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
- 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";
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, UnsupportedOperationException, UntagResourceCommand as UntagResourceCommand$12, UpdateAliasCommand, UpdateKeyDescriptionCommand } from "@aws-sdk/client-kms";
47
47
  import { isDeepStrictEqual } from "node:util";
48
48
  import { AddTagsToResourceCommand as AddTagsToResourceCommand$2, CreateDBProxyCommand, CreateDBProxyEndpointCommand, DBProxyEndpointNotFoundFault, DBProxyNotFoundFault, DBProxyTargetGroupNotFoundFault, DBProxyTargetNotFoundFault, DeleteDBProxyCommand, DeleteDBProxyEndpointCommand, DeregisterDBProxyTargetsCommand, DescribeDBProxiesCommand, DescribeDBProxyEndpointsCommand, DescribeDBProxyTargetGroupsCommand, DescribeDBProxyTargetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$10, ModifyDBProxyCommand, ModifyDBProxyEndpointCommand, ModifyDBProxyTargetGroupCommand, RDSClient, RegisterDBProxyTargetsCommand, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$2 } from "@aws-sdk/client-rds";
49
49
  import { isIPv6 } from "node:net";
@@ -56,21 +56,21 @@ import { AddTagsToResourceCommand as AddTagsToResourceCommand$3, CreateDBCluster
56
56
  import { AppConfigClient, CreateEnvironmentCommand, DeleteEnvironmentCommand, GetEnvironmentCommand, TagResourceCommand as TagResourceCommand$17, UntagResourceCommand as UntagResourceCommand$17, UpdateEnvironmentCommand } from "@aws-sdk/client-appconfig";
57
57
  import { CreateWebACLCommand, DeleteWebACLCommand, GetWebACLCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$14, TagResourceCommand as TagResourceCommand$18, UntagResourceCommand as UntagResourceCommand$18, UpdateWebACLCommand, WAFNonexistentItemException, WAFV2Client } from "@aws-sdk/client-wafv2";
58
58
  import { AddCustomAttributesCommand, CognitoIdentityProviderClient, CreateUserPoolCommand, DeleteUserPoolCommand, DescribeUserPoolCommand, GetUserPoolMfaConfigCommand, ListUserPoolsCommand, ResourceNotFoundException as ResourceNotFoundException$11, SetUserPoolMfaConfigCommand, UntagResourceCommand as UntagResourceCommand$19, UpdateUserPoolCommand } from "@aws-sdk/client-cognito-identity-provider";
59
- import { CreateHttpNamespaceCommand, CreatePrivateDnsNamespaceCommand, CreatePublicDnsNamespaceCommand, CreateServiceCommand as CreateServiceCommand$1, DeleteNamespaceCommand, DeleteServiceAttributesCommand, DeleteServiceCommand as DeleteServiceCommand$1, GetNamespaceCommand, GetOperationCommand, GetServiceAttributesCommand, GetServiceCommand, ListNamespacesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$15, NamespaceNotFound, ResourceInUse, ServiceDiscoveryClient, ServiceNotFound, TagResourceCommand as TagResourceCommand$19, UntagResourceCommand as UntagResourceCommand$20, UpdateHttpNamespaceCommand, UpdatePrivateDnsNamespaceCommand, UpdatePublicDnsNamespaceCommand, UpdateServiceAttributesCommand, UpdateServiceCommand as UpdateServiceCommand$1 } from "@aws-sdk/client-servicediscovery";
59
+ import { CreateHttpNamespaceCommand, CreatePrivateDnsNamespaceCommand, CreatePublicDnsNamespaceCommand, CreateServiceCommand as CreateServiceCommand$1, DeleteNamespaceCommand, DeleteServiceAttributesCommand, DeleteServiceCommand as DeleteServiceCommand$1, GetNamespaceCommand, GetOperationCommand, GetServiceAttributesCommand, GetServiceCommand, ListNamespacesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$15, NamespaceNotFound, ResourceInUse, ResourceNotFoundException as ResourceNotFoundException$12, ServiceDiscoveryClient, ServiceNotFound, TagResourceCommand as TagResourceCommand$19, UntagResourceCommand as UntagResourceCommand$20, UpdateHttpNamespaceCommand, UpdatePrivateDnsNamespaceCommand, UpdatePublicDnsNamespaceCommand, UpdateServiceAttributesCommand, UpdateServiceCommand as UpdateServiceCommand$1 } from "@aws-sdk/client-servicediscovery";
60
60
  import { AppSyncClient, CreateApiKeyCommand, CreateDataSourceCommand, CreateGraphqlApiCommand, CreateResolverCommand, DeleteApiKeyCommand, DeleteDataSourceCommand, DeleteGraphqlApiCommand, DeleteResolverCommand, GetDataSourceCommand, GetGraphqlApiCommand, GetGraphqlApiEnvironmentVariablesCommand, GetIntrospectionSchemaCommand, GetResolverCommand, ListApiKeysCommand, ListGraphqlApisCommand, NotFoundException as NotFoundException$4, PutGraphqlApiEnvironmentVariablesCommand, StartSchemaCreationCommand, TagResourceCommand as TagResourceCommand$20, UntagResourceCommand as UntagResourceCommand$21, UpdateApiKeyCommand, UpdateDataSourceCommand, UpdateGraphqlApiCommand, UpdateResolverCommand } from "@aws-sdk/client-appsync";
61
61
  import { ConcurrentModificationException, CrawlerRunningException, CreateConnectionCommand, CreateCrawlerCommand, CreateDatabaseCommand, CreateJobCommand, CreateSecurityConfigurationCommand, CreateTableCommand as CreateTableCommand$1, CreateTriggerCommand, CreateWorkflowCommand, DeleteConnectionCommand, DeleteCrawlerCommand, DeleteDatabaseCommand, DeleteJobCommand, DeleteSecurityConfigurationCommand, DeleteTableCommand as DeleteTableCommand$1, DeleteTriggerCommand, DeleteWorkflowCommand, EntityNotFoundException, GetConnectionCommand, GetCrawlerCommand, GetDatabaseCommand, GetJobCommand, GetSecurityConfigurationCommand, GetTableCommand, GetTagsCommand, GetTriggerCommand, GetWorkflowCommand, GlueClient, StartCrawlerScheduleCommand, StartTriggerCommand, StopCrawlerCommand, StopCrawlerScheduleCommand, StopTriggerCommand, TagResourceCommand as TagResourceCommand$21, UntagResourceCommand as UntagResourceCommand$22, UpdateConnectionCommand, UpdateCrawlerCommand, UpdateDatabaseCommand, UpdateJobCommand, UpdateTableCommand as UpdateTableCommand$1, UpdateTriggerCommand, UpdateWorkflowCommand } from "@aws-sdk/client-glue";
62
62
  import { BudgetsClient, CreateBudgetCommand, CreateNotificationCommand, CreateSubscriberCommand, DeleteBudgetCommand, DeleteNotificationCommand, DeleteSubscriberCommand, DescribeBudgetCommand, DescribeNotificationsForBudgetCommand, DescribeSubscribersForNotificationCommand, DuplicateRecordException, ListTagsForResourceCommand as ListTagsForResourceCommand$16, NotFoundException as NotFoundException$5, TagResourceCommand as TagResourceCommand$22, UntagResourceCommand as UntagResourceCommand$23, UpdateBudgetCommand } from "@aws-sdk/client-budgets";
63
- import { AddTagsToStreamCommand, CreateStreamCommand, DecreaseStreamRetentionPeriodCommand, DeleteStreamCommand, DeregisterStreamConsumerCommand, DescribeStreamCommand, DescribeStreamConsumerCommand, DescribeStreamSummaryCommand, DisableEnhancedMonitoringCommand, EnableEnhancedMonitoringCommand, IncreaseStreamRetentionPeriodCommand, KinesisClient, ListTagsForResourceCommand as ListTagsForResourceCommand$17, ListTagsForStreamCommand, RegisterStreamConsumerCommand, RemoveTagsFromStreamCommand, ResourceNotFoundException as ResourceNotFoundException$12, StartStreamEncryptionCommand, StopStreamEncryptionCommand, TagResourceCommand as TagResourceCommand$23, UntagResourceCommand as UntagResourceCommand$24, UpdateMaxRecordSizeCommand, UpdateShardCountCommand, UpdateStreamModeCommand, UpdateStreamRecordDistributionStrategyCommand } from "@aws-sdk/client-kinesis";
64
- import { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, ListSchedulesCommand, ResourceNotFoundException as ResourceNotFoundException$13, SchedulerClient, UpdateScheduleCommand } from "@aws-sdk/client-scheduler";
63
+ import { AddTagsToStreamCommand, CreateStreamCommand, DecreaseStreamRetentionPeriodCommand, DeleteStreamCommand, DeregisterStreamConsumerCommand, DescribeStreamCommand, DescribeStreamConsumerCommand, DescribeStreamSummaryCommand, DisableEnhancedMonitoringCommand, EnableEnhancedMonitoringCommand, IncreaseStreamRetentionPeriodCommand, KinesisClient, ListTagsForResourceCommand as ListTagsForResourceCommand$17, ListTagsForStreamCommand, RegisterStreamConsumerCommand, RemoveTagsFromStreamCommand, ResourceNotFoundException as ResourceNotFoundException$13, StartStreamEncryptionCommand, StopStreamEncryptionCommand, TagResourceCommand as TagResourceCommand$23, UntagResourceCommand as UntagResourceCommand$24, UpdateMaxRecordSizeCommand, UpdateShardCountCommand, UpdateStreamModeCommand, UpdateStreamRecordDistributionStrategyCommand } from "@aws-sdk/client-kinesis";
64
+ import { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, ListSchedulesCommand, ResourceNotFoundException as ResourceNotFoundException$14, SchedulerClient, UpdateScheduleCommand } from "@aws-sdk/client-scheduler";
65
65
  import { CreatePipeCommand, DeletePipeCommand, DescribePipeCommand, NotFoundException as NotFoundException$6, PipesClient, TagResourceCommand as TagResourceCommand$24, UntagResourceCommand as UntagResourceCommand$25, UpdatePipeCommand } from "@aws-sdk/client-pipes";
66
- import { AccessPointAlreadyExists, AccessPointNotFound, CreateAccessPointCommand, CreateFileSystemCommand, CreateMountTargetCommand, DeleteAccessPointCommand, DeleteFileSystemCommand, DeleteFileSystemPolicyCommand, DeleteMountTargetCommand, DescribeAccessPointsCommand, DescribeBackupPolicyCommand, DescribeFileSystemPolicyCommand, DescribeFileSystemsCommand, DescribeLifecycleConfigurationCommand, DescribeMountTargetSecurityGroupsCommand, DescribeMountTargetsCommand, EFSClient, FileSystemAlreadyExists, FileSystemNotFound, ModifyMountTargetSecurityGroupsCommand, MountTargetNotFound, PutBackupPolicyCommand, PutFileSystemPolicyCommand, PutLifecycleConfigurationCommand, TagResourceCommand as TagResourceCommand$25, UntagResourceCommand as UntagResourceCommand$26, UpdateFileSystemCommand, UpdateFileSystemProtectionCommand } from "@aws-sdk/client-efs";
66
+ import { AccessPointAlreadyExists, AccessPointNotFound, CreateAccessPointCommand, CreateFileSystemCommand, CreateMountTargetCommand, DeleteAccessPointCommand, DeleteFileSystemCommand, DeleteFileSystemPolicyCommand, DeleteMountTargetCommand, DeleteReplicationConfigurationCommand, DescribeAccessPointsCommand, DescribeBackupPolicyCommand, DescribeFileSystemPolicyCommand, DescribeFileSystemsCommand, DescribeLifecycleConfigurationCommand, DescribeMountTargetSecurityGroupsCommand, DescribeMountTargetsCommand, DescribeReplicationConfigurationsCommand, EFSClient, FileSystemAlreadyExists, FileSystemNotFound, ModifyMountTargetSecurityGroupsCommand, MountTargetNotFound, PutBackupPolicyCommand, PutFileSystemPolicyCommand, PutLifecycleConfigurationCommand, TagResourceCommand as TagResourceCommand$25, UntagResourceCommand as UntagResourceCommand$26, UpdateFileSystemCommand, UpdateFileSystemProtectionCommand } from "@aws-sdk/client-efs";
67
67
  import { AssociateFileSystemAliasesCommand, CreateFileSystemCommand as CreateFileSystemCommand$1, CreateFileSystemFromBackupCommand, DeleteFileSystemCommand as DeleteFileSystemCommand$1, DescribeFileSystemAliasesCommand, DescribeFileSystemsCommand as DescribeFileSystemsCommand$1, DisassociateFileSystemAliasesCommand, FSxClient, FileSystemNotFound as FileSystemNotFound$1, TagResourceCommand as TagResourceCommand$26, UntagResourceCommand as UntagResourceCommand$27, UpdateFileSystemCommand as UpdateFileSystemCommand$1 } from "@aws-sdk/client-fsx";
68
68
  import { AddInstanceFleetCommand, AddInstanceGroupsCommand, AddTagsCommand as AddTagsCommand$1, DescribeClusterCommand, EMRClient, InvalidRequestException, ListClustersCommand, ListInstanceFleetsCommand, ListInstanceGroupsCommand, ModifyClusterCommand, ModifyInstanceFleetCommand, ModifyInstanceGroupsCommand, PutAutoScalingPolicyCommand, PutAutoTerminationPolicyCommand, PutManagedScalingPolicyCommand, RemoveAutoScalingPolicyCommand, RemoveAutoTerminationPolicyCommand, RemoveManagedScalingPolicyCommand, RemoveTagsCommand as RemoveTagsCommand$1, RunJobFlowCommand, SetTerminationProtectionCommand, SetUnhealthyNodeReplacementCommand, SetVisibleToAllUsersCommand, TerminateJobFlowsCommand } from "@aws-sdk/client-emr";
69
- import { CreateDeliveryStreamCommand, DeleteDeliveryStreamCommand, DescribeDeliveryStreamCommand, FirehoseClient, ListTagsForDeliveryStreamCommand, ResourceNotFoundException as ResourceNotFoundException$14, StartDeliveryStreamEncryptionCommand, StopDeliveryStreamEncryptionCommand, TagDeliveryStreamCommand, UntagDeliveryStreamCommand, UpdateDestinationCommand } from "@aws-sdk/client-firehose";
70
- import { AddTagsCommand as AddTagsCommand$2, CloudTrailClient, CreateTrailCommand, DeleteTrailCommand, GetEventConfigurationCommand, GetEventSelectorsCommand, GetInsightSelectorsCommand, GetTrailCommand, GetTrailStatusCommand, ListTagsCommand as ListTagsCommand$2, PutEventConfigurationCommand, PutEventSelectorsCommand, PutInsightSelectorsCommand, RemoveTagsCommand as RemoveTagsCommand$2, StartLoggingCommand, StopLoggingCommand, TrailNotFoundException, UpdateTrailCommand } from "@aws-sdk/client-cloudtrail";
71
- import { BatchGetProjectsCommand, CodeBuildClient, CreateProjectCommand, CreateWebhookCommand, DeleteProjectCommand, DeleteWebhookCommand, ResourceNotFoundException as ResourceNotFoundException$15, UpdateProjectCommand, UpdateProjectVisibilityCommand, UpdateWebhookCommand } from "@aws-sdk/client-codebuild";
69
+ import { CreateDeliveryStreamCommand, DeleteDeliveryStreamCommand, DescribeDeliveryStreamCommand, FirehoseClient, ListTagsForDeliveryStreamCommand, ResourceNotFoundException as ResourceNotFoundException$15, StartDeliveryStreamEncryptionCommand, StopDeliveryStreamEncryptionCommand, TagDeliveryStreamCommand, UntagDeliveryStreamCommand, UpdateDestinationCommand } from "@aws-sdk/client-firehose";
70
+ import { AddTagsCommand as AddTagsCommand$2, CloudTrailClient, CreateTrailCommand, DeleteTrailCommand, GetEventConfigurationCommand, GetEventSelectorsCommand, GetInsightSelectorsCommand, GetTrailCommand, GetTrailStatusCommand, InsightNotEnabledException, ListTagsCommand as ListTagsCommand$2, PutEventConfigurationCommand, PutEventSelectorsCommand, PutInsightSelectorsCommand, RemoveTagsCommand as RemoveTagsCommand$2, ResourceNotFoundException as ResourceNotFoundException$16, StartLoggingCommand, StopLoggingCommand, TrailNotFoundException, UpdateTrailCommand } from "@aws-sdk/client-cloudtrail";
71
+ import { BatchGetProjectsCommand, CodeBuildClient, CreateProjectCommand, CreateWebhookCommand, DeleteProjectCommand, DeleteWebhookCommand, ResourceNotFoundException as ResourceNotFoundException$17, UpdateProjectCommand, UpdateProjectVisibilityCommand, UpdateWebhookCommand } from "@aws-sdk/client-codebuild";
72
72
  import { CodeCommitClient, CreateCommitCommand, CreateRepositoryCommand as CreateRepositoryCommand$1, DeleteRepositoryCommand as DeleteRepositoryCommand$1, GetRepositoryCommand, GetRepositoryTriggersCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$18, PutRepositoryTriggersCommand, RepositoryDoesNotExistException, TagResourceCommand as TagResourceCommand$27, UntagResourceCommand as UntagResourceCommand$28, UpdateRepositoryDescriptionCommand, UpdateRepositoryEncryptionKeyCommand, UpdateRepositoryNameCommand } from "@aws-sdk/client-codecommit";
73
- import { CreateLifecyclePolicyCommand, DLMClient, DeleteLifecyclePolicyCommand as DeleteLifecyclePolicyCommand$1, GetLifecyclePoliciesCommand, GetLifecyclePolicyCommand as GetLifecyclePolicyCommand$1, ResourceNotFoundException as ResourceNotFoundException$16, TagResourceCommand as TagResourceCommand$28, UntagResourceCommand as UntagResourceCommand$29, UpdateLifecyclePolicyCommand } from "@aws-sdk/client-dlm";
73
+ import { CreateLifecyclePolicyCommand, DLMClient, DeleteLifecyclePolicyCommand as DeleteLifecyclePolicyCommand$1, GetLifecyclePoliciesCommand, GetLifecyclePolicyCommand as GetLifecyclePolicyCommand$1, ResourceNotFoundException as ResourceNotFoundException$18, TagResourceCommand as TagResourceCommand$28, UntagResourceCommand as UntagResourceCommand$29, UpdateLifecyclePolicyCommand } from "@aws-sdk/client-dlm";
74
74
  import { CreateVectorBucketCommand, DeleteIndexCommand, DeleteVectorBucketCommand, GetVectorBucketCommand, ListIndexesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$19, S3VectorsClient, TagResourceCommand as TagResourceCommand$29, UntagResourceCommand as UntagResourceCommand$30 } from "@aws-sdk/client-s3vectors";
75
75
  import { CreateNamespaceCommand, CreateTableBucketCommand, CreateTableCommand as CreateTableCommand$2, DeleteNamespaceCommand as DeleteNamespaceCommand$1, DeleteTableBucketCommand, DeleteTableBucketMetricsConfigurationCommand, DeleteTableBucketReplicationCommand, DeleteTableCommand as DeleteTableCommand$2, GetNamespaceCommand as GetNamespaceCommand$1, GetTableBucketCommand, GetTableBucketEncryptionCommand, GetTableBucketLoggingCommand, GetTableBucketMaintenanceConfigurationCommand, GetTableBucketMetricsConfigurationCommand, GetTableBucketReplicationCommand, GetTableBucketStorageClassCommand, GetTableCommand as GetTableCommand$1, GetTableMaintenanceConfigurationCommand, ListNamespacesCommand as ListNamespacesCommand$1, ListTableBucketsCommand, ListTablesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$20, NotFoundException as NotFoundException$7, PutTableBucketEncryptionCommand, PutTableBucketLoggingCommand, PutTableBucketMaintenanceConfigurationCommand, PutTableBucketMetricsConfigurationCommand, PutTableBucketReplicationCommand, PutTableBucketStorageClassCommand, PutTableMaintenanceConfigurationCommand, RenameTableCommand, S3TablesClient, TagResourceCommand as TagResourceCommand$30, UntagResourceCommand as UntagResourceCommand$31 } from "@aws-sdk/client-s3tables";
76
76
 
@@ -649,7 +649,7 @@ async function deleteImpl$40(logicalId, physicalId, resourceType, properties, co
649
649
 
650
650
  // src/provisioning/providers/iam-policy/read-state.ts
651
651
  const TARGET_READ_CONCURRENCY = 5;
652
- async function readCurrentState$41(physicalId, logicalId, _resourceType, properties, context) {
652
+ async function readCurrentState$43(physicalId, logicalId, _resourceType, properties, context) {
653
653
  if (!properties) return void 0;
654
654
  const policyDocument = properties["PolicyDocument"];
655
655
  if (!policyDocument) return void 0;
@@ -832,7 +832,7 @@ var IAMPolicyProvider = class {
832
832
  return deleteImpl$40.call(this, logicalId, physicalId, resourceType, properties, context);
833
833
  }
834
834
  readCurrentState(physicalId, logicalId, resourceType, properties, context) {
835
- return readCurrentState$41.call(this, physicalId, logicalId, resourceType, properties, context);
835
+ return readCurrentState$43.call(this, physicalId, logicalId, resourceType, properties, context);
836
836
  }
837
837
  decodePolicyDocument(raw) {
838
838
  return decodePolicyDocument.call(this, raw);
@@ -1071,9 +1071,9 @@ async function update$41(logicalId, physicalId, resourceType, properties, previo
1071
1071
  }
1072
1072
  const unmatched = [];
1073
1073
  for (const kind of liveKinds) {
1074
- const desired = newPrincipals.lists[kind] ?? [];
1075
- oldLists[kind] = live[kind].filter((name) => desired.includes(name));
1076
- if (live[kind].some((name) => !desired.includes(name))) unmatched.push(kind);
1074
+ const desired = new Set((newPrincipals.lists[kind] ?? []).map((n) => n.toLowerCase()));
1075
+ oldLists[kind] = live[kind].filter((name) => desired.has(name.toLowerCase()));
1076
+ if (live[kind].some((name) => !desired.has(name.toLowerCase()))) unmatched.push(kind);
1077
1077
  }
1078
1078
  if (unmatched.length > 0) log.warn(`The recorded ${unmatched.join(" / ")} of IAM managed policy ${logicalId} is secret-derived, and IAM lists attachments the template does not name: cdkd detaches none of them, since IAM's list includes attachments made elsewhere. Detach by hand any that this list used to name.`);
1079
1079
  }
@@ -1154,9 +1154,8 @@ function principalListsDiffer(desired, previous) {
1154
1154
  "Roles",
1155
1155
  "Users"
1156
1156
  ].some((kind) => {
1157
- const a = new Set(desired[kind] ?? []);
1158
- const b = new Set(previous[kind] ?? []);
1159
- return a.size !== b.size || [...a].some((name) => !b.has(name));
1157
+ const { added, removed } = diffPrincipalNames(desired[kind], previous[kind]);
1158
+ return added.length > 0 || removed.length > 0;
1160
1159
  });
1161
1160
  }
1162
1161
 
@@ -1205,7 +1204,7 @@ async function deleteImpl$39(logicalId, physicalId, resourceType, _properties, c
1205
1204
 
1206
1205
  // src/provisioning/providers/iam-managed-policy/read-state.ts
1207
1206
  const AWS_MANAGED_POLICY_ARN_RE = /^arn:aws[a-z0-9-]*:iam::aws:/;
1208
- async function readCurrentState$40(physicalId, logicalId, _resourceType, properties, context) {
1207
+ async function readCurrentState$42(physicalId, logicalId, _resourceType, properties, context) {
1209
1208
  const removed = context?.afterOwnWrite === true ? takeOwnWriteRemovals("AWS::IAM::ManagedPolicy", physicalId) : void 0;
1210
1209
  let policy;
1211
1210
  try {
@@ -1319,7 +1318,7 @@ function managedPolicyOwnWriteMembers(physicalId, properties, context, removed)
1319
1318
  const round = served[key]++;
1320
1319
  rounds[round] ??= readAttachments.call(this, physicalId, properties, context);
1321
1320
  return { value: (await rounds[round])[key] };
1322
- }, gone));
1321
+ }, gone, (entry) => entry.toLowerCase()));
1323
1322
  }
1324
1323
  return members;
1325
1324
  }
@@ -1416,7 +1415,7 @@ var IAMManagedPolicyProvider = class {
1416
1415
  ] : [];
1417
1416
  }
1418
1417
  readCurrentState(physicalId, logicalId, resourceType, properties, context) {
1419
- return readCurrentState$40.call(this, physicalId, logicalId, resourceType, properties, context);
1418
+ return readCurrentState$42.call(this, physicalId, logicalId, resourceType, properties, context);
1420
1419
  }
1421
1420
  import(input) {
1422
1421
  return importImpl$39.call(this, input);
@@ -1468,8 +1467,21 @@ var IAMManagedPolicyProvider = class {
1468
1467
  });
1469
1468
  }
1470
1469
  async comparePrincipalChanges(logicalId, policyArn, desired, recorded, log) {
1471
- const added = principalPairs(desired).filter(([kind, name]) => !principalPairs(recorded).some(([k, n]) => k === kind && n === name));
1472
- const leaving = principalPairs(recorded).filter(([kind, name]) => !principalPairs(desired).some(([k, n]) => k === kind && n === name));
1470
+ const diffs = {
1471
+ Groups: diffPrincipalNames(desired.Groups, recorded.Groups),
1472
+ Roles: diffPrincipalNames(desired.Roles, recorded.Roles),
1473
+ Users: diffPrincipalNames(desired.Users, recorded.Users)
1474
+ };
1475
+ const added = principalPairs({
1476
+ Groups: diffs.Groups.added,
1477
+ Roles: diffs.Roles.added,
1478
+ Users: diffs.Users.added
1479
+ });
1480
+ const leaving = principalPairs({
1481
+ Groups: diffs.Groups.removed,
1482
+ Roles: diffs.Roles.removed,
1483
+ Users: diffs.Users.removed
1484
+ });
1473
1485
  const verdicts = await verifyInlinePolicyPrincipals({
1474
1486
  client: this.iamClient,
1475
1487
  principals: leaving,
@@ -1520,20 +1532,17 @@ var IAMManagedPolicyProvider = class {
1520
1532
  async updatePrincipals(policyArn, newGroups, oldGroups, newRoles, oldRoles, newUsers, oldUsers, log, strangers = /* @__PURE__ */ new Set()) {
1521
1533
  const { value: v } = log;
1522
1534
  clearOwnWriteRemovals(MANAGED_POLICY_TYPE, policyArn);
1523
- const newGroupSet = new Set(newGroups || []);
1524
- const oldGroupSet = new Set(oldGroups || []);
1525
- const newRoleSet = new Set(newRoles || []);
1526
- const oldRoleSet = new Set(oldRoles || []);
1527
- const newUserSet = new Set(newUsers || []);
1528
- const oldUserSet = new Set(oldUsers || []);
1529
- for (const g of newGroupSet) if (!oldGroupSet.has(g)) {
1535
+ const groups = diffPrincipalNames(newGroups, oldGroups);
1536
+ const roles = diffPrincipalNames(newRoles, oldRoles);
1537
+ const users = diffPrincipalNames(newUsers, oldUsers);
1538
+ for (const g of groups.added) {
1530
1539
  await this.iamClient.send(new AttachGroupPolicyCommand({
1531
1540
  GroupName: g,
1532
1541
  PolicyArn: policyArn
1533
1542
  }));
1534
1543
  log.debug(`Attached ${v(policyArn)} to group ${v(g)}`);
1535
1544
  }
1536
- for (const g of oldGroupSet) if (!newGroupSet.has(g)) {
1545
+ for (const g of groups.removed) {
1537
1546
  if (strangers.has(injectiveKey("group", g))) continue;
1538
1547
  try {
1539
1548
  await this.iamClient.send(new DetachGroupPolicyCommand({
@@ -1546,14 +1555,14 @@ var IAMManagedPolicyProvider = class {
1546
1555
  }
1547
1556
  recordOwnWriteRemoval(MANAGED_POLICY_TYPE, policyArn, "Groups", g);
1548
1557
  }
1549
- for (const r of newRoleSet) if (!oldRoleSet.has(r)) {
1558
+ for (const r of roles.added) {
1550
1559
  await this.iamClient.send(new AttachRolePolicyCommand({
1551
1560
  RoleName: r,
1552
1561
  PolicyArn: policyArn
1553
1562
  }));
1554
1563
  log.debug(`Attached ${v(policyArn)} to role ${v(r)}`);
1555
1564
  }
1556
- for (const r of oldRoleSet) if (!newRoleSet.has(r)) {
1565
+ for (const r of roles.removed) {
1557
1566
  if (strangers.has(injectiveKey("role", r))) continue;
1558
1567
  try {
1559
1568
  await this.iamClient.send(new DetachRolePolicyCommand({
@@ -1566,14 +1575,14 @@ var IAMManagedPolicyProvider = class {
1566
1575
  }
1567
1576
  recordOwnWriteRemoval(MANAGED_POLICY_TYPE, policyArn, "Roles", r);
1568
1577
  }
1569
- for (const u of newUserSet) if (!oldUserSet.has(u)) {
1578
+ for (const u of users.added) {
1570
1579
  await this.iamClient.send(new AttachUserPolicyCommand({
1571
1580
  UserName: u,
1572
1581
  PolicyArn: policyArn
1573
1582
  }));
1574
1583
  log.debug(`Attached ${v(policyArn)} to user ${v(u)}`);
1575
1584
  }
1576
- for (const u of oldUserSet) if (!newUserSet.has(u)) {
1585
+ for (const u of users.removed) {
1577
1586
  if (strangers.has(injectiveKey("user", u))) continue;
1578
1587
  try {
1579
1588
  await this.iamClient.send(new DetachUserPolicyCommand({
@@ -1903,8 +1912,7 @@ var IAMInstanceProfileProvider = class {
1903
1912
  const which = [..."malformed" in newPrincipals ? ["desired Roles"] : [], ..."malformed" in oldPrincipals ? ["recorded Roles"] : []];
1904
1913
  throw new ProvisioningError(`${which.join(" / ")} of IAM instance profile ${logicalId} is not a list of IAM role names — no role was added or removed` + ("malformed" in oldPrincipals ? `: ${recordedPrincipalsRepair(oldPrincipals.malformed, oldPrincipals.secretDerived, "role names", SECRET_DERIVED_READ_LIVE)}` : ""), resourceType, logicalId, physicalId);
1905
1914
  }
1906
- const newRoles = newPrincipals.lists.Roles ?? [];
1907
- const oldRoles = oldPrincipals.lists.Roles ?? [];
1915
+ const roles = diffPrincipalNames(newPrincipals.lists.Roles, oldPrincipals.lists.Roles);
1908
1916
  try {
1909
1917
  const ownRead = await verifyOwnIdentityBeforeUpdate({
1910
1918
  label: "IAM instance profile",
@@ -1920,11 +1928,12 @@ var IAMInstanceProfileProvider = class {
1920
1928
  client: this.iamClient,
1921
1929
  logicalId,
1922
1930
  physicalId,
1923
- added: newRoles.filter((r) => !oldRoles.includes(r)),
1924
- removed: oldRoles.filter((r) => !newRoles.includes(r)),
1931
+ added: roles.added,
1932
+ removed: roles.removed,
1925
1933
  warn: (message) => log.warn(message)
1926
1934
  });
1927
- for (const roleName of oldRoles) if (!newRoles.includes(roleName) && !skipRemoval(roleName)) {
1935
+ for (const roleName of roles.removed) {
1936
+ if (skipRemoval(roleName)) continue;
1928
1937
  try {
1929
1938
  await this.iamClient.send(new RemoveRoleFromInstanceProfileCommand({
1930
1939
  InstanceProfileName: physicalId,
@@ -1937,7 +1946,7 @@ var IAMInstanceProfileProvider = class {
1937
1946
  }
1938
1947
  recordOwnWriteRemoval(INSTANCE_PROFILE_TYPE, physicalId, "Roles", roleName);
1939
1948
  }
1940
- for (const roleName of newRoles) if (!oldRoles.includes(roleName)) {
1949
+ for (const roleName of roles.added) {
1941
1950
  try {
1942
1951
  await this.iamClient.send(new AddRoleToInstanceProfileCommand({
1943
1952
  InstanceProfileName: physicalId,
@@ -1970,7 +1979,7 @@ var IAMInstanceProfileProvider = class {
1970
1979
  const name = error?.name;
1971
1980
  if (name !== "LimitExceededException" && name !== "EntityAlreadyExistsException") return false;
1972
1981
  try {
1973
- return ((await this.iamClient.send(new GetInstanceProfileCommand({ InstanceProfileName: profileName }))).InstanceProfile?.Roles ?? []).some((r) => r.RoleName === roleName);
1982
+ return ((await this.iamClient.send(new GetInstanceProfileCommand({ InstanceProfileName: profileName }))).InstanceProfile?.Roles ?? []).some((r) => r.RoleName?.toLowerCase() === roleName.toLowerCase());
1974
1983
  } catch {
1975
1984
  return false;
1976
1985
  }
@@ -2088,7 +2097,7 @@ var IAMInstanceProfileProvider = class {
2088
2097
  if (declared !== void 0 || (removed?.size ?? 0) > 0) await settleOwnWriteMembers(result, [stringListMember("Roles", declared ?? [], async () => {
2089
2098
  const resp = await this.iamClient.send(new GetInstanceProfileCommand({ InstanceProfileName: physicalId }));
2090
2099
  return resp.InstanceProfile ? { value: profileRoleNames(resp.InstanceProfile) } : "failed";
2091
- }, removed)], this.ownWriteRereadDelaysMs, (key) => warnUnsettledMember(this.logger, logicalId, "AWS::IAM::InstanceProfile", key));
2100
+ }, removed, (entry) => entry.toLowerCase())], this.ownWriteRereadDelaysMs, (key) => warnUnsettledMember(this.logger, logicalId, "AWS::IAM::InstanceProfile", key));
2092
2101
  return result;
2093
2102
  }
2094
2103
  async import(input) {
@@ -2693,6 +2702,7 @@ async function updateUser(logicalId, physicalId, resourceType, properties, previ
2693
2702
  const { value: v } = log;
2694
2703
  log.debug(`Updating IAM user ${logicalId}: ${v(physicalId)}`);
2695
2704
  refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
2705
+ refuseLoginProfileWithoutPassword(properties, previousProperties, resourceType, logicalId, physicalId);
2696
2706
  clearOwnWriteRemovals(USER_TYPE, physicalId);
2697
2707
  const groups = await readPrincipalSides({
2698
2708
  desired: { Groups: properties["Groups"] },
@@ -2724,8 +2734,7 @@ async function updateUser(logicalId, physicalId, resourceType, properties, previ
2724
2734
  read: () => this.iamClient.send(new GetUserCommand({ UserName: physicalId })),
2725
2735
  idOf: (response) => response.User?.UserId
2726
2736
  });
2727
- const nextGroups = new Set(groups.next.Groups ?? []);
2728
- const prevGroups = new Set(groups.prev.Groups ?? []);
2737
+ const groupDiff = diffPrincipalNames(groups.next.Groups, groups.prev.Groups);
2729
2738
  const skipRemoval = await compareMembershipWrites({
2730
2739
  client: this.iamClient,
2731
2740
  owner: {
@@ -2735,8 +2744,8 @@ async function updateUser(logicalId, physicalId, resourceType, properties, previ
2735
2744
  },
2736
2745
  logicalId,
2737
2746
  physicalId,
2738
- adds: [...nextGroups].filter((g) => !prevGroups.has(g)).map((g) => [["group", g]]),
2739
- removes: [...prevGroups].filter((g) => !nextGroups.has(g)).map((g) => [["group", g]]),
2747
+ adds: groupDiff.added.map((g) => [["group", g]]),
2748
+ removes: groupDiff.removed.map((g) => [["group", g]]),
2740
2749
  operation: "update",
2741
2750
  warn: (message) => log.warn(message)
2742
2751
  });
@@ -2774,21 +2783,25 @@ async function updateUser(logicalId, physicalId, resourceType, properties, previ
2774
2783
  PasswordResetRequired: newLoginProfile.PasswordResetRequired ?? false
2775
2784
  }));
2776
2785
  log.debug(`Created login profile for user ${v(physicalId)}`);
2777
- } else if (newLoginProfile && oldLoginProfile && (newLoginProfile.Password !== oldLoginProfile.Password || (newLoginProfile.PasswordResetRequired ?? false) !== (oldLoginProfile.PasswordResetRequired ?? false))) {
2786
+ } else if (newLoginProfile && oldLoginProfile && (loginPasswordChanged(newLoginProfile, oldLoginProfile) || (newLoginProfile.PasswordResetRequired ?? false) !== (oldLoginProfile.PasswordResetRequired ?? false))) {
2778
2787
  await this.iamClient.send(new UpdateLoginProfileCommand({
2779
2788
  UserName: physicalId,
2780
- Password: newLoginProfile.Password,
2789
+ ...loginPasswordChanged(newLoginProfile, oldLoginProfile) && { Password: newLoginProfile.Password },
2781
2790
  PasswordResetRequired: newLoginProfile.PasswordResetRequired ?? false
2782
2791
  }));
2783
2792
  log.debug(`Updated login profile for user ${v(physicalId)}`);
2784
- } else if (!newLoginProfile && oldLoginProfile) try {
2785
- await this.iamClient.send(new DeleteLoginProfileCommand({ UserName: physicalId }));
2786
- log.debug(`Deleted login profile for user ${v(physicalId)}`);
2787
- } catch (error) {
2788
- if (!(error instanceof NoSuchEntityException)) throw error;
2793
+ } else if (!newLoginProfile && oldLoginProfile) {
2794
+ try {
2795
+ await this.iamClient.send(new DeleteLoginProfileCommand({ UserName: physicalId }));
2796
+ log.debug(`Deleted login profile for user ${v(physicalId)}`);
2797
+ } catch (error) {
2798
+ if (!(error instanceof NoSuchEntityException)) throw error;
2799
+ }
2800
+ recordOwnWriteRemoval(USER_TYPE, physicalId, "LoginProfile", "LoginProfile");
2789
2801
  }
2790
2802
  await this.updateUserManagedPolicies(physicalId, properties["ManagedPolicyArns"], previousProperties["ManagedPolicyArns"], log);
2791
- await this.updateUserGroups(physicalId, groups.next.Groups, groups.prev.Groups?.filter((g) => !skipRemoval([["group", g]])), log);
2803
+ const skippedGroups = new Set(groupDiff.removed.filter((g) => skipRemoval([["group", g]])).map((g) => g.toLowerCase()));
2804
+ await this.updateUserGroups(physicalId, groups.next.Groups, groups.prev.Groups?.filter((g) => !skippedGroups.has(g.toLowerCase())), log);
2792
2805
  await this.updateUserInlinePolicies(physicalId, properties["Policies"], previousProperties["Policies"], log, claimed);
2793
2806
  const getUserResponse = (pathMoved ? void 0 : ownRead) ?? await this.iamClient.send(new GetUserCommand({ UserName: physicalId }));
2794
2807
  return {
@@ -2856,16 +2869,15 @@ async function updateUserManagedPolicies(userName, newPolicies, oldPolicies, log
2856
2869
  }
2857
2870
  async function updateUserGroups(userName, newGroups, oldGroups, log) {
2858
2871
  const { value: v } = log;
2859
- const newSet = new Set(newGroups || []);
2860
- const oldSet = new Set(oldGroups || []);
2861
- for (const groupName of newSet) if (!oldSet.has(groupName)) {
2872
+ const { added, removed } = diffPrincipalNames(newGroups, oldGroups);
2873
+ for (const groupName of added) {
2862
2874
  await this.iamClient.send(new AddUserToGroupCommand({
2863
2875
  UserName: userName,
2864
2876
  GroupName: groupName
2865
2877
  }));
2866
2878
  log.debug(`Added user ${v(userName)} to group ${v(groupName)}`);
2867
2879
  }
2868
- for (const groupName of oldSet) if (!newSet.has(groupName)) {
2880
+ for (const groupName of removed) {
2869
2881
  try {
2870
2882
  await this.iamClient.send(new RemoveUserFromGroupCommand({
2871
2883
  UserName: userName,
@@ -2908,6 +2920,14 @@ async function updateUserInlinePolicies(userName, newPolicies, oldPolicies, log,
2908
2920
  recordOwnWriteRemoval(USER_TYPE, userName, "Policies", policyName);
2909
2921
  }
2910
2922
  }
2923
+ function loginPasswordChanged(next, previous) {
2924
+ return next.Password !== void 0 && previous.Password !== void 0 && next.Password !== previous.Password;
2925
+ }
2926
+ function refuseLoginProfileWithoutPassword(properties, previousProperties, resourceType, logicalId, physicalId) {
2927
+ const next = properties["LoginProfile"];
2928
+ if (!next || previousProperties["LoginProfile"] || next.Password != null) return;
2929
+ throw markNonRetryable(new ProvisioningError(`Cannot create the login profile of IAM user ${logicalId}: there is no password to send (it is write-only, so a drift readback carries none). An unchanged deploy does not create it either, since the state record still holds the login profile: create it outside cdkd with IAM CreateLoginProfile, or remove LoginProfile from the template, deploy, then add it back and deploy again. If the template declares no LoginProfile (the profile was recorded by drift --accept), record its removal with drift --accept instead.`, resourceType, logicalId, physicalId));
2930
+ }
2911
2931
 
2912
2932
  // src/provisioning/providers/iam-user-group/user-delete.ts
2913
2933
  async function deleteUser(logicalId, physicalId, resourceType, context) {
@@ -3194,9 +3214,13 @@ async function deleteGroup(logicalId, physicalId, resourceType, context) {
3194
3214
  const progress = { stripped: false };
3195
3215
  try {
3196
3216
  let members = [];
3217
+ let membersTruncated = false;
3218
+ let stepZeroGroupId;
3197
3219
  const readGroup = async () => {
3198
3220
  const response = await this.iamClient.send(new GetGroupCommand({ GroupName: physicalId }));
3199
3221
  members = response.Users ?? [];
3222
+ stepZeroGroupId = response.Group?.GroupId;
3223
+ membersTruncated = response.IsTruncated === true;
3200
3224
  return response.Group?.GroupName?.toLowerCase() === physicalId.toLowerCase() ? response.Group.GroupId : void 0;
3201
3225
  };
3202
3226
  await assertRecordedIdentity({
@@ -3208,12 +3232,53 @@ async function deleteGroup(logicalId, physicalId, resourceType, context) {
3208
3232
  reread: readGroup,
3209
3233
  context
3210
3234
  });
3235
+ const sameGroup = (read) => {
3236
+ if (stepZeroGroupId !== void 0 && read.Group?.GroupId !== stepZeroGroupId) {
3237
+ const refusal = markNonRetryable(new RecordedIdentityError(log.mask(`Failed to delete IAM group ${logicalId}: DeleteGroup on ${physicalId} was refused (DeleteConflict), and the group now holding that name is not the one this delete read before it (its GroupId differs). cdkd sends it no delete and keeps the record. Leave that group alone; if the group cdkd created is gone, drop the record with ${stateOrphanRecordRemedy(context, logicalId)}.`), resourceType, logicalId, physicalId));
3238
+ throw progress.stripped ? markDeleteStarted(refusal) : refusal;
3239
+ }
3240
+ };
3241
+ const refuseHeld = (held, cause) => {
3242
+ const run = holderRefusalRun(context);
3243
+ const refusal = markNonRetryable(new ProvisioningError(log.mask(`Failed to delete IAM group ${logicalId}: group ${physicalId} still has user(s) ${heldText(held)}, whose membership this ${run.noun} did not remove (a user added outside the stack, one retained by a DeletionPolicy, or a stack user whose own delete has not finished yet). Matching CloudFormation (DeleteConflict), cdkd does not remove them from the group. If a named user is one of this stack's users, ${run.rerun} once its delete finishes. Otherwise, if they no longer need the group, remove them (aws iam remove-user-from-group --group-name <group> --user-name <user>), then ${run.again}.`), resourceType, logicalId, physicalId, cause));
3244
+ MEMBER_REFUSALS.add(refusal);
3245
+ throw refusal;
3246
+ };
3247
+ let ownMembers = [];
3248
+ if (context?.stackHoldersStillAttached === true) {
3249
+ const own = stackOwnHolders(resourceType, physicalId);
3250
+ const isOwn = (user) => user.UserName !== void 0 && isStackOwnHolder(own, user.UserName, user.UserId);
3251
+ let read = {
3252
+ users: members,
3253
+ truncated: membersTruncated
3254
+ };
3255
+ const foreign = await settledMembers.call(this, physicalId, members, membersTruncated, sameGroup, (user) => !isOwn(user), (page) => read = page);
3256
+ if (foreign !== "empty") refuseHeld(foreign);
3257
+ if (read.truncated) refuseHeld({
3258
+ names: [],
3259
+ truncated: true
3260
+ });
3261
+ ownMembers = read.users.filter(isOwn);
3262
+ }
3211
3263
  await this.detachAllGroupPolicies(physicalId, log, progress);
3212
3264
  await this.deleteAllGroupInlinePolicies(physicalId, log, progress);
3213
- await this.removeAllUsersFromGroup(physicalId, log, progress, members);
3214
- await this.iamClient.send(new DeleteGroupCommand({ GroupName: physicalId }));
3265
+ if (ownMembers.length > 0) await this.removeAllUsersFromGroup(physicalId, log, progress, ownMembers);
3266
+ for (let attempt = 1;; attempt++) try {
3267
+ await this.iamClient.send(new DeleteGroupCommand({ GroupName: physicalId }));
3268
+ break;
3269
+ } catch (error) {
3270
+ if (!(error instanceof DeleteConflictException)) throw error;
3271
+ const held = await (attempt === 1 ? settledMembers.call(this, physicalId, members, membersTruncated, sameGroup) : currentMembers.call(this, physicalId, sameGroup)).catch((readError) => {
3272
+ if (readError instanceof NoSuchEntityException || readError instanceof RecordedIdentityError) throw readError;
3273
+ log.debug(`Could not read the members of group ${v(physicalId)} after DeleteGroup was refused: ${readError instanceof Error ? readError.name : typeof readError}`);
3274
+ });
3275
+ if (held === "empty" && attempt === 1) continue;
3276
+ if (held === void 0 || held === "empty") throw error;
3277
+ refuseHeld(held, error);
3278
+ }
3215
3279
  log.debug(`Successfully deleted IAM group ${logicalId}`);
3216
3280
  } catch (error) {
3281
+ if (error instanceof Error && MEMBER_REFUSALS.has(error)) throw progress.stripped ? markDeleteStarted(error) : error;
3217
3282
  if (error instanceof NoSuchEntityException) {
3218
3283
  const clientRegion = await this.iamClient.config.region();
3219
3284
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
@@ -3227,6 +3292,64 @@ async function deleteGroup(logicalId, physicalId, resourceType, context) {
3227
3292
  throw progress.stripped ? markDeleteStarted(failure) : failure;
3228
3293
  }
3229
3294
  }
3295
+ const MEMBER_REFUSALS = /* @__PURE__ */ new WeakSet();
3296
+ const HELD_NAME_LIMIT$1 = 5;
3297
+ const HELD_POLL_MS$1 = 2e3;
3298
+ const HELD_STABLE_POLLS$1 = 5;
3299
+ const HELD_MAX_POLLS$1 = 30;
3300
+ async function settledMembers(groupName, firstRead, firstTruncated, sameGroup, counts = () => true, onRead) {
3301
+ let held = {
3302
+ names: memberNames(firstRead.filter(counts)),
3303
+ truncated: firstTruncated
3304
+ };
3305
+ if (held.names.length === 0) return "empty";
3306
+ const key = (h) => JSON.stringify([h.names, h.truncated]);
3307
+ let unchanged = 0;
3308
+ for (let poll = 0; poll < HELD_MAX_POLLS$1 && unchanged < HELD_STABLE_POLLS$1; poll++) {
3309
+ await new Promise((resolve) => setTimeout(resolve, HELD_POLL_MS$1));
3310
+ const read = await this.iamClient.send(new GetGroupCommand({ GroupName: groupName }));
3311
+ sameGroup(read);
3312
+ onRead?.({
3313
+ users: read.Users ?? [],
3314
+ truncated: read.IsTruncated === true
3315
+ });
3316
+ const next = {
3317
+ names: memberNames((read.Users ?? []).filter(counts)),
3318
+ truncated: read.IsTruncated === true
3319
+ };
3320
+ if (next.names.length === 0) return "empty";
3321
+ unchanged = key(next) === key(held) ? unchanged + 1 : 0;
3322
+ held = next;
3323
+ }
3324
+ return confirmedMembers.call(this, groupName, held);
3325
+ }
3326
+ async function currentMembers(groupName, sameGroup) {
3327
+ const read = await this.iamClient.send(new GetGroupCommand({ GroupName: groupName }));
3328
+ sameGroup(read);
3329
+ const held = {
3330
+ names: memberNames(read.Users),
3331
+ truncated: read.IsTruncated === true
3332
+ };
3333
+ if (held.names.length === 0) return "empty";
3334
+ return confirmedMembers.call(this, groupName, held);
3335
+ }
3336
+ function memberNames(users) {
3337
+ return (users ?? []).map((user) => user.UserName).filter((n) => !!n);
3338
+ }
3339
+ async function confirmedMembers(groupName, held) {
3340
+ const names = [];
3341
+ for (const name of held.names) try {
3342
+ const groups = await this.iamClient.send(new ListGroupsForUserCommand({ UserName: name }));
3343
+ if ((groups.Groups ?? []).some((group) => group.GroupName?.toLowerCase() === groupName.toLowerCase()) || groups.IsTruncated === true) names.push(name);
3344
+ } catch (error) {
3345
+ if (!(error instanceof NoSuchEntityException)) names.push(name);
3346
+ }
3347
+ if (names.length === 0) return "empty";
3348
+ return {
3349
+ names: names.slice(0, HELD_NAME_LIMIT$1),
3350
+ truncated: names.length > HELD_NAME_LIMIT$1 || held.truncated
3351
+ };
3352
+ }
3230
3353
  async function detachAllGroupPolicies(groupName, log, progress) {
3231
3354
  const { value: v } = log;
3232
3355
  try {
@@ -3394,15 +3517,16 @@ async function updateUserToGroupAddition(logicalId, physicalId, resourceType, pr
3394
3517
  const newUsers = new Set(users.next.Users ?? []);
3395
3518
  const oldGroupName = previousProperties["GroupName"];
3396
3519
  const oldUsers = new Set(users.prev.Users ?? []);
3397
- const groupMoved = Boolean(oldGroupName) && oldGroupName !== groupName;
3520
+ const groupMoved = Boolean(oldGroupName) && oldGroupName.toLowerCase() !== groupName?.toLowerCase();
3521
+ const { added, removed } = diffPrincipalNames(users.next.Users, users.prev.Users);
3398
3522
  try {
3399
3523
  const skipRemoval = await compareMembershipWrites({
3400
3524
  client: this.iamClient,
3401
3525
  owner: MEMBERSHIP_OWNER,
3402
3526
  logicalId,
3403
3527
  physicalId,
3404
- adds: [...newUsers].filter((user) => groupMoved || !oldUsers.has(user)).map((user) => membership(groupName, user)),
3405
- removes: [...oldUsers].filter((user) => groupMoved || !newUsers.has(user)).map((user) => membership(groupMoved ? oldGroupName : groupName, user)),
3528
+ adds: (groupMoved ? [...newUsers] : added).map((user) => membership(groupName, user)),
3529
+ removes: (groupMoved ? [...oldUsers] : removed).map((user) => membership(groupMoved ? oldGroupName : groupName, user)),
3406
3530
  operation: "update",
3407
3531
  warn: (message) => log.warn(message)
3408
3532
  });
@@ -3423,14 +3547,14 @@ async function updateUserToGroupAddition(logicalId, physicalId, resourceType, pr
3423
3547
  UserName: userName
3424
3548
  }));
3425
3549
  } else {
3426
- for (const userName of newUsers) if (!oldUsers.has(userName)) {
3550
+ for (const userName of added) {
3427
3551
  await this.iamClient.send(new AddUserToGroupCommand({
3428
3552
  GroupName: groupName,
3429
3553
  UserName: userName
3430
3554
  }));
3431
3555
  log.debug(`Added user ${v(userName)} to group ${v(groupName)}`);
3432
3556
  }
3433
- for (const userName of oldUsers) if (!newUsers.has(userName) && !skipRemoval(membership(groupName, userName))) try {
3557
+ for (const userName of removed) if (!skipRemoval(membership(groupName, userName))) try {
3434
3558
  await this.iamClient.send(new RemoveUserFromGroupCommand({
3435
3559
  GroupName: groupName,
3436
3560
  UserName: userName
@@ -3605,16 +3729,66 @@ async function readIdIfExists(resourceType, name) {
3605
3729
  if (token === void 0) throw new Error(`IAM returned no ${noun === "user" ? "UserId" : "GroupId"}`);
3606
3730
  return token;
3607
3731
  }
3608
- async function readCurrentState$39(physicalId, logicalId, resourceType, properties, context) {
3732
+ async function readCurrentState$41(physicalId, logicalId, resourceType, properties, context) {
3609
3733
  switch (resourceType) {
3610
3734
  case "AWS::IAM::User": return this.readUserCurrentState(physicalId, properties, context, logicalId);
3611
3735
  case "AWS::IAM::Group": return this.readGroupCurrentState(physicalId, properties, context, logicalId);
3612
- case "AWS::IAM::UserToGroupAddition": return;
3736
+ case "AWS::IAM::UserToGroupAddition": return readUserToGroupAdditionState.call(this, logicalId, properties, context);
3613
3737
  default:
3614
3738
  this.logger.debug(`readCurrentState: unsupported resource type ${resourceType} for ${logicalId}`);
3615
3739
  return;
3616
3740
  }
3617
3741
  }
3742
+ async function readUserToGroupAdditionState(logicalId, properties, context) {
3743
+ const groupName = properties?.["GroupName"];
3744
+ if (typeof groupName !== "string" || !isUserOrGroupName("AWS::IAM::Group", groupName)) return;
3745
+ const read = readPrincipalLists({ Users: properties?.["Users"] });
3746
+ const declared = "malformed" in read ? void 0 : read.lists.Users;
3747
+ if (declared === void 0 || !declared.every((u) => isUserOrGroupName("AWS::IAM::User", u))) return;
3748
+ const fold = (name) => name.toLowerCase();
3749
+ const wanted = fold(groupName);
3750
+ const isMember = async (userName) => {
3751
+ let marker;
3752
+ try {
3753
+ do {
3754
+ const resp = await this.iamClient.send(new ListGroupsForUserCommand({
3755
+ UserName: userName,
3756
+ ...marker && { Marker: marker }
3757
+ }));
3758
+ if ((resp.Groups ?? []).some((g) => g.GroupName && fold(g.GroupName) === wanted)) return true;
3759
+ marker = resp.IsTruncated === true ? resp.Marker : void 0;
3760
+ } while (marker);
3761
+ } catch (err) {
3762
+ if (err instanceof NoSuchEntityException) return false;
3763
+ throw err;
3764
+ }
3765
+ return false;
3766
+ };
3767
+ const readUsers = async () => {
3768
+ const members = await Promise.all(declared.map(isMember));
3769
+ return declared.filter((_, i) => members[i]);
3770
+ };
3771
+ const groupGone = async () => {
3772
+ try {
3773
+ await this.iamClient.send(new GetGroupCommand({
3774
+ GroupName: groupName,
3775
+ MaxItems: 1
3776
+ }));
3777
+ return false;
3778
+ } catch (err) {
3779
+ if (err instanceof NoSuchEntityException) return true;
3780
+ throw err;
3781
+ }
3782
+ };
3783
+ const users = await readUsers();
3784
+ if (users.length === 0 && declared.length > 0 && await groupGone()) return RESOURCE_NOT_FOUND;
3785
+ const result = {
3786
+ GroupName: groupName,
3787
+ Users: users
3788
+ };
3789
+ if (context?.afterOwnWrite === true) await settleOwnWriteMembers(result, [stringListMember("Users", declared, async () => ({ value: await readUsers() }), void 0, fold)], this.ownWriteRereadDelaysMs, (key) => warnUnsettledMember(this.logger, logicalId, "AWS::IAM::UserToGroupAddition", key));
3790
+ return result;
3791
+ }
3618
3792
  async function readUserCurrentState(physicalId, properties, context, logicalId = physicalId) {
3619
3793
  const removed = context?.afterOwnWrite === true ? takeOwnWriteRemovals("AWS::IAM::User", physicalId) : void 0;
3620
3794
  let user;
@@ -3629,6 +3803,13 @@ async function readUserCurrentState(physicalId, properties, context, logicalId =
3629
3803
  if (user.UserName !== void 0) result["UserName"] = user.UserName;
3630
3804
  if (user.Path !== void 0) result["Path"] = user.Path;
3631
3805
  result["PermissionsBoundary"] = user.PermissionsBoundary?.PermissionsBoundaryArn ?? "";
3806
+ const ownWrite = context?.afterOwnWrite === true;
3807
+ const tags = readbackUserTags(user.Tags, properties, ownWrite);
3808
+ if (tags !== void 0) result["Tags"] = tags;
3809
+ if (properties?.["LoginProfile"] != null) {
3810
+ const profile = await readLoginProfile.call(this, physicalId, properties, ownWrite);
3811
+ if (profile !== void 0) result["LoginProfile"] = profile;
3812
+ } else result["LoginProfile"] = await readUndeclaredLoginProfile.call(this, physicalId, ownWrite && removed?.has("LoginProfile") === true);
3632
3813
  const reads = userMemberReads.call(this, physicalId, properties, context);
3633
3814
  try {
3634
3815
  result["ManagedPolicyArns"] = await reads.managedPolicyArns();
@@ -3656,6 +3837,45 @@ async function readUserCurrentState(physicalId, properties, context, logicalId =
3656
3837
  }, removed), this.ownWriteRereadDelaysMs, (key) => warnUnsettledMember(this.logger, logicalId, "AWS::IAM::User", key));
3657
3838
  return result;
3658
3839
  }
3840
+ function readbackUserTags(awsTags, properties, afterOwnWrite) {
3841
+ const tags = normalizeAwsTagsToCfn(awsTags);
3842
+ const declared = properties?.["Tags"];
3843
+ if (afterOwnWrite && properties !== void 0 && declared == null) return void 0;
3844
+ const bag = afterOwnWrite && Array.isArray(declared) && !sameTagSet(tags, declared) ? declared : tags;
3845
+ return bag.length > 0 ? bag : void 0;
3846
+ }
3847
+ function sameTagSet(a, b) {
3848
+ const pairs = (list) => JSON.stringify(list.map((entry) => {
3849
+ const tag = entry ?? {};
3850
+ return JSON.stringify([tag["Key"], tag["Value"] ?? ""]);
3851
+ }).sort());
3852
+ return pairs(a) === pairs(b);
3853
+ }
3854
+ async function readLoginProfile(userName, properties, afterOwnWrite) {
3855
+ const declared = properties["LoginProfile"];
3856
+ const declaredShape = { PasswordResetRequired: coerceCfnBoolean(declared["PasswordResetRequired"]) === true };
3857
+ let read;
3858
+ try {
3859
+ read = { PasswordResetRequired: (await this.iamClient.send(new GetLoginProfileCommand({ UserName: userName }))).LoginProfile?.PasswordResetRequired === true || declaredShape.PasswordResetRequired };
3860
+ } catch (err) {
3861
+ if (!(err instanceof NoSuchEntityException)) throw err;
3862
+ }
3863
+ if (!afterOwnWrite) return read;
3864
+ return read?.["PasswordResetRequired"] === declaredShape.PasswordResetRequired ? read : declaredShape;
3865
+ }
3866
+ async function readUndeclaredLoginProfile(userName, removedByOwnWrite) {
3867
+ if (removedByOwnWrite) return null;
3868
+ try {
3869
+ await this.iamClient.send(new GetLoginProfileCommand({ UserName: userName }));
3870
+ return {};
3871
+ } catch (err) {
3872
+ if (err instanceof NoSuchEntityException) return null;
3873
+ throw err;
3874
+ }
3875
+ }
3876
+ function getDriftUnknownPaths$13(resourceType) {
3877
+ return resourceType === "AWS::IAM::User" ? ["LoginProfile.Password"] : [];
3878
+ }
3659
3879
  function userMemberReads(physicalId, properties, context) {
3660
3880
  return {
3661
3881
  managedPolicyArns: async () => {
@@ -3934,8 +4154,11 @@ var IAMUserGroupProvider = class {
3934
4154
  getDriftUnorderedPaths(resourceType) {
3935
4155
  return resourceType === "AWS::IAM::User" ? ["Groups"] : [];
3936
4156
  }
4157
+ getDriftUnknownPaths(resourceType) {
4158
+ return getDriftUnknownPaths$13.call(this, resourceType);
4159
+ }
3937
4160
  readCurrentState(physicalId, logicalId, resourceType, properties, context) {
3938
- return readCurrentState$39.call(this, physicalId, logicalId, resourceType, properties, context);
4161
+ return readCurrentState$41.call(this, physicalId, logicalId, resourceType, properties, context);
3939
4162
  }
3940
4163
  readUserCurrentState(physicalId, properties, context, logicalId) {
3941
4164
  return readUserCurrentState.call(this, physicalId, properties, context, logicalId);
@@ -4082,310 +4305,6 @@ function bucketNameRefusal(properties) {
4082
4305
  if (properties["BucketNamespace"] !== "account-regional") return "sets BucketNamePrefix, which is only supported with BucketNamespace: account-regional";
4083
4306
  }
4084
4307
 
4085
- // src/provisioning/providers/s3-bucket/apply-core.ts
4086
- async function applyVersioning(bucketName, versioningConfig, onUnusable) {
4087
- if (onUnusable) {
4088
- const refusal = configStringRefusal(versioningConfig, "Status", "Suspended", "AWS::S3::Bucket VersioningConfiguration");
4089
- if (refusal !== void 0) {
4090
- onUnusable(`${refusal}. No PutBucketVersioning is issued rather than applying the Suspended default, which would turn object versioning OFF on an existing bucket (on a replayed create it means the bucket is left unversioned); the same value is REFUSED on a template-path create`);
4091
- return false;
4092
- }
4093
- }
4094
- const status = readConfigString(versioningConfig, "Status", "Suspended", "AWS::S3::Bucket VersioningConfiguration");
4095
- await this.s3Client.send(new PutBucketVersioningCommand({
4096
- Bucket: bucketName,
4097
- VersioningConfiguration: { Status: status }
4098
- }));
4099
- this.logger.debug(`Applied versioning (${this.shown(status)}) to bucket ${this.shown(bucketName)}`);
4100
- return true;
4101
- }
4102
- async function applyTags$1(bucketName, tags) {
4103
- await this.s3Client.send(new PutBucketTaggingCommand({
4104
- Bucket: bucketName,
4105
- Tagging: { TagSet: tags }
4106
- }));
4107
- this.logger.debug(`Applied ${tags.length} tags to bucket ${this.shown(bucketName)}`);
4108
- }
4109
- async function applyTagDiff$20(bucketName, resourceType, logicalId, oldTagsRaw, newTagsRaw, abacEnabled = false) {
4110
- const plan = planTagDiff(oldTagsRaw, newTagsRaw);
4111
- const desiredRead = readTagList(newTagsRaw, "desired");
4112
- const desired = desiredRead.kind === "tags" ? desiredRead.tags : [];
4113
- const recordedRead = readTagList(oldTagsRaw, "recorded");
4114
- const recordHidesKeys = plan.recordedUnreadable || Array.isArray(oldTagsRaw) && recordedRead.kind === "tags" && recordedRead.tags.length !== oldTagsRaw.length;
4115
- let tagSet;
4116
- if (recordHidesKeys) {
4117
- const tagWarning = tagPlanWarning(plan, resourceType, logicalId);
4118
- if (tagWarning !== void 0) this.logger.warn(tagWarning);
4119
- const live = await this.readTags(bucketName);
4120
- const named = /* @__PURE__ */ new Set([...desired.map((t) => t.Key), ...plan.remove]);
4121
- tagSet = [...desired, ...live.filter((t) => !named.has(t.Key))];
4122
- const toMap = (tags) => new Map(tags.map((t) => [t.Key, t.Value]));
4123
- const liveMap = toMap(live);
4124
- const nextMap = toMap(tagSet);
4125
- if (liveMap.size === nextMap.size && [...nextMap].every(([k, v]) => liveMap.has(k) && liveMap.get(k) === v)) return;
4126
- } else {
4127
- if (plan.set.size === 0 && plan.remove.length === 0) return;
4128
- tagSet = desired;
4129
- }
4130
- if (abacEnabled) {
4131
- await this.replaceAbacBucketTags(bucketName, tagSet);
4132
- return;
4133
- }
4134
- if (tagSet.length === 0) {
4135
- try {
4136
- await this.s3Client.send(new DeleteBucketTaggingCommand({ Bucket: bucketName }));
4137
- this.logger.debug(`Cleared tags from bucket ${this.shown(bucketName)}`);
4138
- } catch (err) {
4139
- if (err.name === "NoSuchTagSet") return;
4140
- throw err;
4141
- }
4142
- return;
4143
- }
4144
- await this.s3Client.send(new PutBucketTaggingCommand({
4145
- Bucket: bucketName,
4146
- Tagging: { TagSet: tagSet }
4147
- }));
4148
- this.logger.debug(`Replaced tag set on bucket ${this.shown(bucketName)} (${tagSet.length} tags)`);
4149
- }
4150
- async function replaceAbacBucketTags(bucketName, tagSet) {
4151
- const keep = new Set(tagSet.map((t) => t.Key));
4152
- const stale = (await this.readTags(bucketName)).map((t) => t.Key).filter((key) => !keep.has(key));
4153
- const client = new S3ControlClient({
4154
- ...clientDefaultsFor(this.credentialConfig),
4155
- region: await this.getRegion()
4156
- });
4157
- try {
4158
- const AccountId = (await getAccountInfo()).accountId;
4159
- const ResourceArn = s3BucketArn(bucketName, await this.getRegion());
4160
- if (stale.length > 0) await client.send(new UntagResourceCommand$13({
4161
- AccountId,
4162
- ResourceArn,
4163
- TagKeys: stale
4164
- }));
4165
- if (tagSet.length > 0) await client.send(new TagResourceCommand$13({
4166
- AccountId,
4167
- ResourceArn,
4168
- Tags: tagSet
4169
- }));
4170
- } finally {
4171
- client.destroy();
4172
- }
4173
- this.logger.debug(safeMsg`Replaced tag set on ABAC bucket ${this.shown(bucketName)}`);
4174
- }
4175
- async function applyAbacStatus(bucketName, status) {
4176
- await this.s3Client.send(new PutBucketAbacCommand({
4177
- Bucket: bucketName,
4178
- AbacStatus: { Status: status }
4179
- }));
4180
- this.logger.debug(safeMsg`Applied AbacStatus to bucket ${this.shown(bucketName)}`);
4181
- }
4182
- async function accountRegionalBucketName(prefix) {
4183
- return `${prefix}-${(await getAccountInfo()).accountId}-${canonicalizeRegion(await this.getRegion())}-an`;
4184
- }
4185
- async function createMetadataConfiguration(bucketName, desired, stateBorne) {
4186
- const MetadataConfiguration = metadataConfigurationToSdk(desired);
4187
- try {
4188
- await this.s3Client.send(new CreateBucketMetadataConfigurationCommand({
4189
- Bucket: bucketName,
4190
- MetadataConfiguration
4191
- }));
4192
- } catch (err) {
4193
- if (err.name !== "MetadataConfigurationAlreadyExists") throw err;
4194
- const live = await this.readMetadataConfigurationResult(bucketName).catch(() => void 0);
4195
- if (live === void 0) throw err;
4196
- return this.convergeMetadataConfiguration(bucketName, desired, live, stateBorne);
4197
- }
4198
- await this.waitForMetadataTables(bucketName, MetadataConfiguration, stateBorne);
4199
- return true;
4200
- }
4201
- async function convergeMetadataConfiguration(bucketName, desired, live, stateBorne) {
4202
- const sent = metadataConfigurationToSdk(desired);
4203
- if (sent.JournalTableConfiguration?.EncryptionConfiguration || sent.InventoryTableConfiguration?.EncryptionConfiguration || sent.AnnotationTableConfiguration?.EncryptionConfiguration) this.logger.warn(safeMsg`Bucket ${this.shown(bucketName)} already holds an S3 Metadata configuration, and S3 never returns a table's encryption, so the declared EncryptionConfiguration is unverified and may not be the one in effect`);
4204
- const enabledATable = await this.applyMetadataConfigurationDiff(bucketName, desired, metadataConfigurationFromSdk(live), true, true);
4205
- await this.waitForMetadataTables(bucketName, sent, stateBorne);
4206
- return enabledATable;
4207
- }
4208
- async function applyMetadataConfigurationDiff(bucketName, desiredRaw, previousRaw, stateBorne, refuseOnly) {
4209
- const desired = metadataBag(desiredRaw);
4210
- const previous = metadataBag(previousRaw);
4211
- if (desired === void 0) {
4212
- if (previous === void 0) return false;
4213
- try {
4214
- await this.s3Client.send(new DeleteBucketMetadataConfigurationCommand({ Bucket: bucketName }));
4215
- } catch (err) {
4216
- if (err.name !== "MetadataConfigurationNotFound") throw err;
4217
- }
4218
- return false;
4219
- }
4220
- if (previous === void 0) {
4221
- if (refuseOnly) return false;
4222
- return this.createMetadataConfiguration(bucketName, desired, stateBorne);
4223
- }
4224
- const next = metadataConfigurationToSdk(desired);
4225
- const prev = metadataConfigurationToSdk(previous);
4226
- const differs = (a, b) => JSON.stringify(a) !== JSON.stringify(b);
4227
- const refuseEncryptionChange = (member, a, b) => {
4228
- if (!stateBorne && differs(a, b)) throw new Error(`Bucket ${this.shown(bucketName)}: changing MetadataConfiguration.${member}.EncryptionConfiguration is not supported once the table exists. Revert it, or re-create the table: remove MetadataConfiguration, deploy, delete the table with aws s3tables delete-table, then add it back with the new encryption`);
4229
- };
4230
- const nextJournal = next.JournalTableConfiguration;
4231
- const prevJournal = prev.JournalTableConfiguration;
4232
- refuseEncryptionChange("JournalTableConfiguration", prevJournal?.EncryptionConfiguration, nextJournal?.EncryptionConfiguration);
4233
- const nextInventory = next.InventoryTableConfiguration;
4234
- const prevInventory = prev.InventoryTableConfiguration;
4235
- const nextInventoryState = nextInventory?.ConfigurationState ?? "DISABLED";
4236
- const prevInventoryState = prevInventory?.ConfigurationState ?? "DISABLED";
4237
- if (nextInventoryState === "ENABLED" && prevInventoryState === "ENABLED") refuseEncryptionChange("InventoryTableConfiguration", prevInventory?.EncryptionConfiguration, nextInventory?.EncryptionConfiguration);
4238
- const nextAnnotation = next.AnnotationTableConfiguration;
4239
- const prevAnnotation = prev.AnnotationTableConfiguration;
4240
- const nextAnnotationState = nextAnnotation?.ConfigurationState ?? "DISABLED";
4241
- const prevAnnotationState = prevAnnotation?.ConfigurationState ?? "DISABLED";
4242
- const annotationStaysOn = nextAnnotationState === "ENABLED" && prevAnnotationState === "ENABLED";
4243
- if (annotationStaysOn) refuseEncryptionChange("AnnotationTableConfiguration", prevAnnotation?.EncryptionConfiguration, nextAnnotation?.EncryptionConfiguration);
4244
- let enabledATable = false;
4245
- if (differs(prevJournal?.RecordExpiration, nextJournal?.RecordExpiration)) await this.s3Client.send(new UpdateBucketMetadataJournalTableConfigurationCommand({
4246
- Bucket: bucketName,
4247
- JournalTableConfiguration: { RecordExpiration: nextJournal?.RecordExpiration }
4248
- }));
4249
- if (nextInventoryState !== prevInventoryState) {
4250
- const on = nextInventoryState === METADATA_TABLE_ENABLED;
4251
- await this.s3Client.send(new UpdateBucketMetadataInventoryTableConfigurationCommand({
4252
- Bucket: bucketName,
4253
- InventoryTableConfiguration: {
4254
- ConfigurationState: nextInventoryState,
4255
- ...on && nextInventory?.EncryptionConfiguration ? { EncryptionConfiguration: nextInventory.EncryptionConfiguration } : {}
4256
- }
4257
- }));
4258
- enabledATable ||= on;
4259
- }
4260
- if (nextAnnotationState !== prevAnnotationState || annotationStaysOn && nextAnnotation?.Role !== prevAnnotation?.Role) {
4261
- const on = nextAnnotationState === METADATA_TABLE_ENABLED;
4262
- await this.s3Client.send(new UpdateBucketMetadataAnnotationTableConfigurationCommand({
4263
- Bucket: bucketName,
4264
- AnnotationTableConfiguration: {
4265
- ConfigurationState: nextAnnotationState,
4266
- ...on && nextAnnotation?.EncryptionConfiguration ? { EncryptionConfiguration: nextAnnotation.EncryptionConfiguration } : {},
4267
- ...on && nextAnnotation?.Role !== void 0 ? { Role: nextAnnotation.Role } : {}
4268
- }
4269
- }));
4270
- enabledATable ||= on;
4271
- }
4272
- if (enabledATable && !refuseOnly) await this.waitForMetadataTables(bucketName, next, stateBorne);
4273
- return enabledATable;
4274
- }
4275
- async function waitForMetadataTables(bucketName, sent, stateBorne) {
4276
- const deadline = Date.now() + METADATA_TABLE_BUDGET_MS;
4277
- const warned = /* @__PURE__ */ new Set();
4278
- for (;;) {
4279
- let result;
4280
- try {
4281
- result = await this.readMetadataConfigurationResult(bucketName);
4282
- } catch (err) {
4283
- if (!stateBorne) throw err;
4284
- this.logger.warn(safeMsg`Could not read the S3 Metadata tables of ${this.shown(bucketName)} (${caughtErrorName(err)}); not waiting for them`);
4285
- return;
4286
- }
4287
- const tables = [
4288
- [
4289
- "journal",
4290
- true,
4291
- result?.JournalTableConfigurationResult
4292
- ],
4293
- [
4294
- "inventory",
4295
- sent.InventoryTableConfiguration?.ConfigurationState === METADATA_TABLE_ENABLED,
4296
- result?.InventoryTableConfigurationResult
4297
- ],
4298
- [
4299
- "annotation",
4300
- sent.AnnotationTableConfiguration?.ConfigurationState === METADATA_TABLE_ENABLED,
4301
- result?.AnnotationTableConfigurationResult
4302
- ]
4303
- ];
4304
- let pending;
4305
- for (const [name, wanted, table] of tables) {
4306
- if (!wanted) continue;
4307
- if (table?.TableStatus === "FAILED") {
4308
- if (!warned.has(name)) {
4309
- warned.add(name);
4310
- this.warnMetadataTableFailed(bucketName, name, table);
4311
- }
4312
- continue;
4313
- }
4314
- if (table?.TableArn === void 0) pending = `the ${name} table`;
4315
- }
4316
- if (pending === void 0) return;
4317
- if (Date.now() >= deadline) {
4318
- this.logger.warn(safeMsg`Gave up waiting for ${pending} of bucket ${this.shown(bucketName)}'s S3 Metadata configuration; it may still finish, and an Fn::GetAtt on its ARN fails until then. Read it with aws s3api get-bucket-metadata-configuration`);
4319
- return;
4320
- }
4321
- await new Promise((r) => setTimeout(r, METADATA_TABLE_POLL_MS));
4322
- }
4323
- }
4324
- function warnMetadataTableFailed(bucketName, name, table) {
4325
- const reason = describeAwsStatusReason({
4326
- code: table.Error?.ErrorCode,
4327
- message: table.Error?.ErrorMessage
4328
- }, "S3 gave no reason.");
4329
- const noArn = table.TableArn === void 0 ? " It has no ARN, so an Fn::GetAtt on its TableArn fails." : "";
4330
- this.logger.debug(safeMsg`S3 Metadata ${name} table: ${this.maskRaw(reason.detail)}`);
4331
- this.logger.warn(safeMsg`The S3 Metadata ${name} table of bucket ${this.shown(bucketName)} FAILED: ${reason.summary} The deploy continues, but this table records nothing.${noArn} When a table left by an earlier bucket of this name is the cause, delete it with aws s3tables delete-table --table-bucket-arn <the account's aws-s3 table bucket> --namespace b_${this.shown(bucketName)} --name ${name}, then deploy without MetadataConfiguration and add it back`);
4332
- }
4333
- async function readMetadataConfigurationResult(bucket) {
4334
- try {
4335
- return (await this.s3Client.send(new GetBucketMetadataConfigurationCommand({ Bucket: bucket }))).GetBucketMetadataConfigurationResult?.MetadataConfigurationResult;
4336
- } catch (err) {
4337
- if (err.name === "MetadataConfigurationNotFound") return void 0;
4338
- throw err;
4339
- }
4340
- }
4341
- async function readMetadataForDrift(bucket) {
4342
- try {
4343
- return await this.readMetadataConfigurationResult(bucket);
4344
- } catch (err) {
4345
- this.logger.debug(safeMsg`Could not read S3 Metadata of ${this.shown(bucket)} (${caughtErrorName(err)})`);
4346
- return "unread";
4347
- }
4348
- }
4349
- async function readMetadataAttributesAfterWrites(bucket, context) {
4350
- try {
4351
- return await this.readMetadataAttributes(bucket);
4352
- } catch (err) {
4353
- const readback = context !== void 0 && "desiredFromAwsReadback" in context ? context.desiredFromAwsReadback : void 0;
4354
- if (context?.replayingState !== true && readback !== true) throw err;
4355
- this.logger.warn(safeMsg`Could not read the S3 Metadata attributes of ${this.shown(bucket)} (${caughtErrorName(err)}); an Fn::GetAtt on them fails until the next deploy records them`);
4356
- return {};
4357
- }
4358
- }
4359
- async function readMetadataAttributes(bucket) {
4360
- const result = await this.readMetadataConfigurationResult(bucket);
4361
- return result ? metadataAttributesFromSdk(result) : {};
4362
- }
4363
- async function applyCorsConfiguration(bucketName, corsConfig) {
4364
- const corsRules = corsConfig.CorsRules.map((rule) => ({
4365
- ID: rule["Id"],
4366
- AllowedHeaders: rule["AllowedHeaders"],
4367
- AllowedMethods: rule["AllowedMethods"],
4368
- AllowedOrigins: rule["AllowedOrigins"],
4369
- ExposeHeaders: rule["ExposedHeaders"],
4370
- MaxAgeSeconds: rule["MaxAge"]
4371
- }));
4372
- await this.s3Client.send(new PutBucketCorsCommand({
4373
- Bucket: bucketName,
4374
- CORSConfiguration: { CORSRules: corsRules }
4375
- }));
4376
- this.logger.debug(`Applied CORS configuration to bucket ${this.shown(bucketName)}`);
4377
- }
4378
- function skipOnUnusableConfigString(container, key, fallback, containerPath, skipClause, onUnusable) {
4379
- if (!onUnusable) return false;
4380
- const refusal = configStringRefusal(container, key, fallback, containerPath);
4381
- if (refusal === void 0) return false;
4382
- onUnusable(`${refusal}. ${skipClause}; the same value is REFUSED on a template-path create`);
4383
- return true;
4384
- }
4385
- function readSubstitutedConfigString(container, key, fallback, containerPath, options) {
4386
- return readConfigString(container, key, fallback, containerPath, options);
4387
- }
4388
-
4389
4308
  // src/provisioning/providers/s3-bucket/read-state-lists.ts
4390
4309
  function emitNotificationEvents(target, events) {
4391
4310
  if (events === void 0) return;
@@ -4537,14 +4456,18 @@ async function readObjectLock(bucket) {
4537
4456
  throw err;
4538
4457
  }
4539
4458
  }
4540
- async function readAbacStatus(bucket) {
4459
+ async function readAbacStatus(bucket, strict = false) {
4541
4460
  try {
4542
4461
  return (await this.s3Client.send(new GetBucketAbacCommand({ Bucket: bucket }))).AbacStatus?.Status ?? "Disabled";
4543
4462
  } catch (err) {
4463
+ if (strict && !isBucketGone(err)) throw err;
4544
4464
  this.logger.debug(safeMsg`Could not read AbacStatus of ${this.shown(bucket)} (${caughtErrorName(err)})`);
4545
4465
  return;
4546
4466
  }
4547
4467
  }
4468
+ function isBucketGone(err) {
4469
+ return err instanceof NoSuchBucket || err?.name === "NoSuchBucket";
4470
+ }
4548
4471
  async function readAccelerate(bucket) {
4549
4472
  return { AccelerationStatus: (await this.s3Client.send(new GetBucketAccelerateConfigurationCommand({ Bucket: bucket }))).Status ?? "Suspended" };
4550
4473
  }
@@ -4696,6 +4619,311 @@ function inventorySdkToCfn(c) {
4696
4619
  return out;
4697
4620
  }
4698
4621
 
4622
+ // src/provisioning/providers/s3-bucket/apply-core.ts
4623
+ async function applyVersioning(bucketName, versioningConfig, onUnusable) {
4624
+ if (onUnusable) {
4625
+ const refusal = configStringRefusal(versioningConfig, "Status", "Suspended", "AWS::S3::Bucket VersioningConfiguration");
4626
+ if (refusal !== void 0) {
4627
+ onUnusable(`${refusal}. No PutBucketVersioning is issued rather than applying the Suspended default, which would turn object versioning OFF on an existing bucket (on a replayed create it means the bucket is left unversioned); the same value is REFUSED on a template-path create`);
4628
+ return false;
4629
+ }
4630
+ }
4631
+ const status = readConfigString(versioningConfig, "Status", "Suspended", "AWS::S3::Bucket VersioningConfiguration");
4632
+ await this.s3Client.send(new PutBucketVersioningCommand({
4633
+ Bucket: bucketName,
4634
+ VersioningConfiguration: { Status: status }
4635
+ }));
4636
+ this.logger.debug(`Applied versioning (${this.shown(status)}) to bucket ${this.shown(bucketName)}`);
4637
+ return true;
4638
+ }
4639
+ async function applyTags$1(bucketName, tags) {
4640
+ await this.s3Client.send(new PutBucketTaggingCommand({
4641
+ Bucket: bucketName,
4642
+ Tagging: { TagSet: tags }
4643
+ }));
4644
+ this.logger.debug(`Applied ${tags.length} tags to bucket ${this.shown(bucketName)}`);
4645
+ }
4646
+ async function applyTagDiff$20(bucketName, resourceType, logicalId, oldTagsRaw, newTagsRaw, abacEnabled = false) {
4647
+ const plan = planTagDiff(oldTagsRaw, newTagsRaw);
4648
+ const desiredRead = readTagList(newTagsRaw, "desired");
4649
+ const desired = desiredRead.kind === "tags" ? desiredRead.tags : [];
4650
+ const recordedRead = readTagList(oldTagsRaw, "recorded");
4651
+ const recordHidesKeys = plan.recordedUnreadable || Array.isArray(oldTagsRaw) && recordedRead.kind === "tags" && recordedRead.tags.length !== oldTagsRaw.length;
4652
+ let tagSet;
4653
+ if (recordHidesKeys) {
4654
+ const tagWarning = tagPlanWarning(plan, resourceType, logicalId);
4655
+ if (tagWarning !== void 0) this.logger.warn(tagWarning);
4656
+ const live = await this.readTags(bucketName);
4657
+ const named = /* @__PURE__ */ new Set([...desired.map((t) => t.Key), ...plan.remove]);
4658
+ tagSet = [...desired, ...live.filter((t) => !named.has(t.Key))];
4659
+ const toMap = (tags) => new Map(tags.map((t) => [t.Key, t.Value]));
4660
+ const liveMap = toMap(live);
4661
+ const nextMap = toMap(tagSet);
4662
+ if (liveMap.size === nextMap.size && [...nextMap].every(([k, v]) => liveMap.has(k) && liveMap.get(k) === v)) return;
4663
+ } else {
4664
+ if (plan.set.size === 0 && plan.remove.length === 0) return;
4665
+ tagSet = desired;
4666
+ }
4667
+ if (abacEnabled) {
4668
+ await this.replaceAbacBucketTags(bucketName, tagSet);
4669
+ return;
4670
+ }
4671
+ if (tagSet.length === 0) {
4672
+ try {
4673
+ await this.s3Client.send(new DeleteBucketTaggingCommand({ Bucket: bucketName }));
4674
+ this.logger.debug(`Cleared tags from bucket ${this.shown(bucketName)}`);
4675
+ } catch (err) {
4676
+ if (err.name === "NoSuchTagSet") return;
4677
+ throw err;
4678
+ }
4679
+ return;
4680
+ }
4681
+ await this.s3Client.send(new PutBucketTaggingCommand({
4682
+ Bucket: bucketName,
4683
+ Tagging: { TagSet: tagSet }
4684
+ }));
4685
+ this.logger.debug(`Replaced tag set on bucket ${this.shown(bucketName)} (${tagSet.length} tags)`);
4686
+ }
4687
+ async function replaceAbacBucketTags(bucketName, tagSet) {
4688
+ const keep = new Set(tagSet.map((t) => t.Key));
4689
+ const stale = (await this.readTags(bucketName)).map((t) => t.Key).filter((key) => !keep.has(key));
4690
+ const client = new S3ControlClient({
4691
+ ...clientDefaultsFor(this.credentialConfig),
4692
+ region: await this.getRegion()
4693
+ });
4694
+ try {
4695
+ const AccountId = (await getAccountInfo()).accountId;
4696
+ const ResourceArn = s3BucketArn(bucketName, await this.getRegion());
4697
+ if (stale.length > 0) await client.send(new UntagResourceCommand$13({
4698
+ AccountId,
4699
+ ResourceArn,
4700
+ TagKeys: stale
4701
+ }));
4702
+ if (tagSet.length > 0) await client.send(new TagResourceCommand$13({
4703
+ AccountId,
4704
+ ResourceArn,
4705
+ Tags: tagSet
4706
+ }));
4707
+ } finally {
4708
+ client.destroy();
4709
+ }
4710
+ this.logger.debug(safeMsg`Replaced tag set on ABAC bucket ${this.shown(bucketName)}`);
4711
+ }
4712
+ async function applyAbacStatus(bucketName, status) {
4713
+ await this.s3Client.send(new PutBucketAbacCommand({
4714
+ Bucket: bucketName,
4715
+ AbacStatus: { Status: status }
4716
+ }));
4717
+ this.logger.debug(safeMsg`Applied AbacStatus to bucket ${this.shown(bucketName)}`);
4718
+ }
4719
+ async function accountRegionalBucketName(prefix) {
4720
+ return `${prefix}-${(await getAccountInfo()).accountId}-${canonicalizeRegion(await this.getRegion())}-an`;
4721
+ }
4722
+ async function createMetadataConfiguration(bucketName, desired, stateBorne) {
4723
+ const MetadataConfiguration = metadataConfigurationToSdk(desired);
4724
+ try {
4725
+ await this.s3Client.send(new CreateBucketMetadataConfigurationCommand({
4726
+ Bucket: bucketName,
4727
+ MetadataConfiguration
4728
+ }));
4729
+ } catch (err) {
4730
+ if (err.name !== "MetadataConfigurationAlreadyExists") throw err;
4731
+ const live = await this.readMetadataConfigurationResult(bucketName).catch(() => void 0);
4732
+ if (live === void 0) throw err;
4733
+ return this.convergeMetadataConfiguration(bucketName, desired, live, stateBorne);
4734
+ }
4735
+ await this.waitForMetadataTables(bucketName, MetadataConfiguration, stateBorne);
4736
+ return true;
4737
+ }
4738
+ async function convergeMetadataConfiguration(bucketName, desired, live, stateBorne) {
4739
+ const sent = metadataConfigurationToSdk(desired);
4740
+ if (sent.JournalTableConfiguration?.EncryptionConfiguration || sent.InventoryTableConfiguration?.EncryptionConfiguration || sent.AnnotationTableConfiguration?.EncryptionConfiguration) this.logger.warn(safeMsg`Bucket ${this.shown(bucketName)} already holds an S3 Metadata configuration, and S3 never returns a table's encryption, so the declared EncryptionConfiguration is unverified and may not be the one in effect`);
4741
+ const enabledATable = await this.applyMetadataConfigurationDiff(bucketName, desired, metadataConfigurationFromSdk(live), true, true);
4742
+ await this.waitForMetadataTables(bucketName, sent, stateBorne);
4743
+ return enabledATable;
4744
+ }
4745
+ async function applyMetadataConfigurationDiff(bucketName, desiredRaw, previousRaw, stateBorne, refuseOnly) {
4746
+ const desired = metadataBag(desiredRaw);
4747
+ const previous = metadataBag(previousRaw);
4748
+ if (desired === void 0) {
4749
+ if (previous === void 0) return false;
4750
+ try {
4751
+ await this.s3Client.send(new DeleteBucketMetadataConfigurationCommand({ Bucket: bucketName }));
4752
+ } catch (err) {
4753
+ if (err.name !== "MetadataConfigurationNotFound") throw err;
4754
+ }
4755
+ return false;
4756
+ }
4757
+ if (previous === void 0) {
4758
+ if (refuseOnly) return false;
4759
+ return this.createMetadataConfiguration(bucketName, desired, stateBorne);
4760
+ }
4761
+ const next = metadataConfigurationToSdk(desired);
4762
+ const prev = metadataConfigurationToSdk(previous);
4763
+ const differs = (a, b) => JSON.stringify(a) !== JSON.stringify(b);
4764
+ const refuseEncryptionChange = (member, a, b) => {
4765
+ if (!stateBorne && differs(a, b)) throw new Error(`Bucket ${this.shown(bucketName)}: changing MetadataConfiguration.${member}.EncryptionConfiguration is not supported once the table exists. Revert it, or re-create the table: remove MetadataConfiguration, deploy, delete the table with aws s3tables delete-table, then add it back with the new encryption`);
4766
+ };
4767
+ const nextJournal = next.JournalTableConfiguration;
4768
+ const prevJournal = prev.JournalTableConfiguration;
4769
+ refuseEncryptionChange("JournalTableConfiguration", prevJournal?.EncryptionConfiguration, nextJournal?.EncryptionConfiguration);
4770
+ const nextInventory = next.InventoryTableConfiguration;
4771
+ const prevInventory = prev.InventoryTableConfiguration;
4772
+ const nextInventoryState = nextInventory?.ConfigurationState ?? "DISABLED";
4773
+ const prevInventoryState = prevInventory?.ConfigurationState ?? "DISABLED";
4774
+ if (nextInventoryState === "ENABLED" && prevInventoryState === "ENABLED") refuseEncryptionChange("InventoryTableConfiguration", prevInventory?.EncryptionConfiguration, nextInventory?.EncryptionConfiguration);
4775
+ const nextAnnotation = next.AnnotationTableConfiguration;
4776
+ const prevAnnotation = prev.AnnotationTableConfiguration;
4777
+ const nextAnnotationState = nextAnnotation?.ConfigurationState ?? "DISABLED";
4778
+ const prevAnnotationState = prevAnnotation?.ConfigurationState ?? "DISABLED";
4779
+ const annotationStaysOn = nextAnnotationState === "ENABLED" && prevAnnotationState === "ENABLED";
4780
+ if (annotationStaysOn) refuseEncryptionChange("AnnotationTableConfiguration", prevAnnotation?.EncryptionConfiguration, nextAnnotation?.EncryptionConfiguration);
4781
+ let enabledATable = false;
4782
+ if (differs(prevJournal?.RecordExpiration, nextJournal?.RecordExpiration)) await this.s3Client.send(new UpdateBucketMetadataJournalTableConfigurationCommand({
4783
+ Bucket: bucketName,
4784
+ JournalTableConfiguration: { RecordExpiration: nextJournal?.RecordExpiration }
4785
+ }));
4786
+ if (nextInventoryState !== prevInventoryState) {
4787
+ const on = nextInventoryState === METADATA_TABLE_ENABLED;
4788
+ await this.s3Client.send(new UpdateBucketMetadataInventoryTableConfigurationCommand({
4789
+ Bucket: bucketName,
4790
+ InventoryTableConfiguration: {
4791
+ ConfigurationState: nextInventoryState,
4792
+ ...on && nextInventory?.EncryptionConfiguration ? { EncryptionConfiguration: nextInventory.EncryptionConfiguration } : {}
4793
+ }
4794
+ }));
4795
+ enabledATable ||= on;
4796
+ }
4797
+ if (nextAnnotationState !== prevAnnotationState || annotationStaysOn && nextAnnotation?.Role !== prevAnnotation?.Role) {
4798
+ const on = nextAnnotationState === METADATA_TABLE_ENABLED;
4799
+ await this.s3Client.send(new UpdateBucketMetadataAnnotationTableConfigurationCommand({
4800
+ Bucket: bucketName,
4801
+ AnnotationTableConfiguration: {
4802
+ ConfigurationState: nextAnnotationState,
4803
+ ...on && nextAnnotation?.EncryptionConfiguration ? { EncryptionConfiguration: nextAnnotation.EncryptionConfiguration } : {},
4804
+ ...on && nextAnnotation?.Role !== void 0 ? { Role: nextAnnotation.Role } : {}
4805
+ }
4806
+ }));
4807
+ enabledATable ||= on;
4808
+ }
4809
+ if (enabledATable && !refuseOnly) await this.waitForMetadataTables(bucketName, next, stateBorne);
4810
+ return enabledATable;
4811
+ }
4812
+ async function waitForMetadataTables(bucketName, sent, stateBorne) {
4813
+ const deadline = Date.now() + METADATA_TABLE_BUDGET_MS;
4814
+ const warned = /* @__PURE__ */ new Set();
4815
+ for (;;) {
4816
+ let result;
4817
+ try {
4818
+ result = await this.readMetadataConfigurationResult(bucketName);
4819
+ } catch (err) {
4820
+ if (!stateBorne) throw err;
4821
+ this.logger.warn(safeMsg`Could not read the S3 Metadata tables of ${this.shown(bucketName)} (${caughtErrorName(err)}); not waiting for them`);
4822
+ return;
4823
+ }
4824
+ const tables = [
4825
+ [
4826
+ "journal",
4827
+ true,
4828
+ result?.JournalTableConfigurationResult
4829
+ ],
4830
+ [
4831
+ "inventory",
4832
+ sent.InventoryTableConfiguration?.ConfigurationState === METADATA_TABLE_ENABLED,
4833
+ result?.InventoryTableConfigurationResult
4834
+ ],
4835
+ [
4836
+ "annotation",
4837
+ sent.AnnotationTableConfiguration?.ConfigurationState === METADATA_TABLE_ENABLED,
4838
+ result?.AnnotationTableConfigurationResult
4839
+ ]
4840
+ ];
4841
+ let pending;
4842
+ for (const [name, wanted, table] of tables) {
4843
+ if (!wanted) continue;
4844
+ if (table?.TableStatus === "FAILED") {
4845
+ if (!warned.has(name)) {
4846
+ warned.add(name);
4847
+ this.warnMetadataTableFailed(bucketName, name, table);
4848
+ }
4849
+ continue;
4850
+ }
4851
+ if (table?.TableArn === void 0) pending = `the ${name} table`;
4852
+ }
4853
+ if (pending === void 0) return;
4854
+ if (Date.now() >= deadline) {
4855
+ this.logger.warn(safeMsg`Gave up waiting for ${pending} of bucket ${this.shown(bucketName)}'s S3 Metadata configuration; it may still finish, and an Fn::GetAtt on its ARN fails until then. Read it with aws s3api get-bucket-metadata-configuration`);
4856
+ return;
4857
+ }
4858
+ await new Promise((r) => setTimeout(r, METADATA_TABLE_POLL_MS));
4859
+ }
4860
+ }
4861
+ function warnMetadataTableFailed(bucketName, name, table) {
4862
+ const reason = describeAwsStatusReason({
4863
+ code: table.Error?.ErrorCode,
4864
+ message: table.Error?.ErrorMessage
4865
+ }, "S3 gave no reason.");
4866
+ const noArn = table.TableArn === void 0 ? " It has no ARN, so an Fn::GetAtt on its TableArn fails." : "";
4867
+ this.logger.debug(safeMsg`S3 Metadata ${name} table: ${this.maskRaw(reason.detail)}`);
4868
+ this.logger.warn(safeMsg`The S3 Metadata ${name} table of bucket ${this.shown(bucketName)} FAILED: ${reason.summary} The deploy continues, but this table records nothing.${noArn} When a table left by an earlier bucket of this name is the cause, delete it with aws s3tables delete-table --table-bucket-arn <the account's aws-s3 table bucket> --namespace b_${this.shown(bucketName)} --name ${name}, then deploy without MetadataConfiguration and add it back`);
4869
+ }
4870
+ async function readMetadataConfigurationResult(bucket) {
4871
+ try {
4872
+ return (await this.s3Client.send(new GetBucketMetadataConfigurationCommand({ Bucket: bucket }))).GetBucketMetadataConfigurationResult?.MetadataConfigurationResult;
4873
+ } catch (err) {
4874
+ if (err.name === "MetadataConfigurationNotFound") return void 0;
4875
+ throw err;
4876
+ }
4877
+ }
4878
+ async function readMetadataForDrift(bucket, strict = false) {
4879
+ try {
4880
+ return await this.readMetadataConfigurationResult(bucket);
4881
+ } catch (err) {
4882
+ if (strict && !isBucketGone(err)) throw err;
4883
+ this.logger.debug(safeMsg`Could not read S3 Metadata of ${this.shown(bucket)} (${caughtErrorName(err)})`);
4884
+ return "unread";
4885
+ }
4886
+ }
4887
+ async function readMetadataAttributesAfterWrites(bucket, context) {
4888
+ try {
4889
+ return await this.readMetadataAttributes(bucket);
4890
+ } catch (err) {
4891
+ const readback = context !== void 0 && "desiredFromAwsReadback" in context ? context.desiredFromAwsReadback : void 0;
4892
+ if (context?.replayingState !== true && readback !== true) throw err;
4893
+ this.logger.warn(safeMsg`Could not read the S3 Metadata attributes of ${this.shown(bucket)} (${caughtErrorName(err)}); an Fn::GetAtt on them fails until the next deploy records them`);
4894
+ return {};
4895
+ }
4896
+ }
4897
+ async function readMetadataAttributes(bucket) {
4898
+ const result = await this.readMetadataConfigurationResult(bucket);
4899
+ return result ? metadataAttributesFromSdk(result) : {};
4900
+ }
4901
+ async function applyCorsConfiguration(bucketName, corsConfig) {
4902
+ const corsRules = corsConfig.CorsRules.map((rule) => ({
4903
+ ID: rule["Id"],
4904
+ AllowedHeaders: rule["AllowedHeaders"],
4905
+ AllowedMethods: rule["AllowedMethods"],
4906
+ AllowedOrigins: rule["AllowedOrigins"],
4907
+ ExposeHeaders: rule["ExposedHeaders"],
4908
+ MaxAgeSeconds: rule["MaxAge"]
4909
+ }));
4910
+ await this.s3Client.send(new PutBucketCorsCommand({
4911
+ Bucket: bucketName,
4912
+ CORSConfiguration: { CORSRules: corsRules }
4913
+ }));
4914
+ this.logger.debug(`Applied CORS configuration to bucket ${this.shown(bucketName)}`);
4915
+ }
4916
+ function skipOnUnusableConfigString(container, key, fallback, containerPath, skipClause, onUnusable) {
4917
+ if (!onUnusable) return false;
4918
+ const refusal = configStringRefusal(container, key, fallback, containerPath);
4919
+ if (refusal === void 0) return false;
4920
+ onUnusable(`${refusal}. ${skipClause}; the same value is REFUSED on a template-path create`);
4921
+ return true;
4922
+ }
4923
+ function readSubstitutedConfigString(container, key, fallback, containerPath, options) {
4924
+ return readConfigString(container, key, fallback, containerPath, options);
4925
+ }
4926
+
4699
4927
  // src/provisioning/providers/s3-bucket/sub-config.ts
4700
4928
  function emptyListConfigToUndefined(config, listKey) {
4701
4929
  if (config === void 0 || config === null) return void 0;
@@ -6428,7 +6656,7 @@ async function replacedSurvivorIdentity(physicalId, resourceType, context) {
6428
6656
  }
6429
6657
 
6430
6658
  // src/provisioning/providers/s3-bucket/read-state.ts
6431
- async function readCurrentState$38(physicalId, logicalId, _resourceType, _properties, context) {
6659
+ async function readCurrentState$40(physicalId, logicalId, _resourceType, _properties, context) {
6432
6660
  const headAttempts = context?.afterOwnWrite === true ? 5 : 1;
6433
6661
  for (let attempt = 1;; attempt++) try {
6434
6662
  await this.s3Client.send(new HeadBucketCommand({ Bucket: physicalId }));
@@ -6465,8 +6693,8 @@ async function readCurrentState$38(physicalId, logicalId, _resourceType, _proper
6465
6693
  this.readAnalyticsList(physicalId),
6466
6694
  this.readIntelligentTieringList(physicalId),
6467
6695
  this.readInventoryList(physicalId),
6468
- this.readAbacStatus(physicalId),
6469
- this.readMetadataForDrift(physicalId)
6696
+ this.readAbacStatus(physicalId, true),
6697
+ this.readMetadataForDrift(physicalId, true)
6470
6698
  ]);
6471
6699
  return {
6472
6700
  BucketName: physicalId,
@@ -6796,8 +7024,8 @@ var S3BucketProvider = class {
6796
7024
  readMetadataConfigurationResult(bucket) {
6797
7025
  return readMetadataConfigurationResult.call(this, bucket);
6798
7026
  }
6799
- readMetadataForDrift(bucket) {
6800
- return readMetadataForDrift.call(this, bucket);
7027
+ readMetadataForDrift(bucket, strict = false) {
7028
+ return readMetadataForDrift.call(this, bucket, strict);
6801
7029
  }
6802
7030
  readMetadataAttributesAfterWrites(bucket, context) {
6803
7031
  return readMetadataAttributesAfterWrites.call(this, bucket, context);
@@ -6953,7 +7181,7 @@ var S3BucketProvider = class {
6953
7181
  return canonicalizeDesiredProperties$3.call(this, resourceType, properties);
6954
7182
  }
6955
7183
  readCurrentState(physicalId, logicalId, _resourceType, _properties, context) {
6956
- return readCurrentState$38.call(this, physicalId, logicalId, _resourceType, _properties, context);
7184
+ return readCurrentState$40.call(this, physicalId, logicalId, _resourceType, _properties, context);
6957
7185
  }
6958
7186
  getDriftAbsentMeansDefaultKeys(_resourceType, properties) {
6959
7187
  return getDriftAbsentMeansDefaultKeys.call(this, _resourceType, properties);
@@ -7010,8 +7238,8 @@ var S3BucketProvider = class {
7010
7238
  readObjectLock(bucket) {
7011
7239
  return readObjectLock.call(this, bucket);
7012
7240
  }
7013
- readAbacStatus(bucket) {
7014
- return readAbacStatus.call(this, bucket);
7241
+ readAbacStatus(bucket, strict = false) {
7242
+ return readAbacStatus.call(this, bucket, strict);
7015
7243
  }
7016
7244
  readAccelerate(bucket) {
7017
7245
  return readAccelerate.call(this, bucket);
@@ -8588,7 +8816,7 @@ async function deleteImpl$36(logicalId, physicalId, resourceType, _properties, c
8588
8816
  }
8589
8817
 
8590
8818
  // src/provisioning/providers/sns-topic/read-state.ts
8591
- async function readCurrentState$37(physicalId, _logicalId, _resourceType, properties) {
8819
+ async function readCurrentState$39(physicalId, _logicalId, _resourceType, properties) {
8592
8820
  let attrs;
8593
8821
  try {
8594
8822
  attrs = (await this.snsClient.send(new GetTopicAttributesCommand({ TopicArn: physicalId }))).Attributes;
@@ -8759,7 +8987,7 @@ var SNSTopicProvider = class {
8759
8987
  }
8760
8988
  }
8761
8989
  readCurrentState(physicalId, logicalId, resourceType, properties) {
8762
- return readCurrentState$37.call(this, physicalId, logicalId, resourceType, properties);
8990
+ return readCurrentState$39.call(this, physicalId, logicalId, resourceType, properties);
8763
8991
  }
8764
8992
  getDriftUnknownPaths() {
8765
8993
  return [];
@@ -9665,6 +9893,7 @@ async function create$36(logicalId, resourceType, properties, context) {
9665
9893
  TenancyConfig: properties["TenancyConfig"],
9666
9894
  CodeSigningConfigArn: properties["CodeSigningConfigArn"],
9667
9895
  RuntimeConfig: properties["RuntimeConfig"],
9896
+ AcceleratorConfig: properties["AcceleratorConfig"],
9668
9897
  Tags: tags,
9669
9898
  ...capacityProviderConfig !== void 0 && {
9670
9899
  CapacityProviderConfig: capacityProviderConfig,
@@ -9882,9 +10111,14 @@ async function update$37(logicalId, physicalId, resourceType, properties, previo
9882
10111
  physicalId
9883
10112
  }, log.warn);
9884
10113
  if (properties["Runtime"] === "custom" && properties["RuntimeConfig"] == null && previousProperties["RuntimeConfig"] != null) {
9885
- const message = `Lambda function ${logicalId} keeps Runtime 'custom' without RuntimeConfig: AWS keeps the live RuntimeConfig, and refuses a 'custom' function without one. Keep the property, or change Runtime to remove it.`;
9886
- if (context?.replayingState === true) log.warn(message);
9887
- else throw markNonRetryable(new ProvisioningError(message, resourceType, logicalId, physicalId));
10114
+ const head = `Lambda function ${logicalId} keeps Runtime 'custom' without RuntimeConfig`;
10115
+ if (context?.replayingState === true) log.warn(`${head}: the live RuntimeConfig stays on AWS, so this replay leaves it in place; the next deploy or drift check shows it.`);
10116
+ else throw markNonRetryable(new ProvisioningError(`${head}: AWS keeps the live RuntimeConfig, and refuses a 'custom' function without one. Keep the property, or change Runtime to remove it.`, resourceType, logicalId, physicalId));
10117
+ }
10118
+ if (properties["AcceleratorConfig"] == null && previousProperties["AcceleratorConfig"] != null) {
10119
+ const head = `Lambda function ${logicalId} cannot lose its AcceleratorConfig`;
10120
+ if (context?.replayingState === true) log.warn(`${head}: the live AcceleratorConfig stays on AWS, so this replay leaves it in place; the next deploy or drift check shows it.`);
10121
+ else throw markNonRetryable(new ProvisioningError(`${head}: UpdateFunctionConfiguration has no value that removes it. Keep the property, or replace the function under a new logical id.`, resourceType, logicalId, physicalId));
9888
10122
  }
9889
10123
  try {
9890
10124
  const desiredCapacity = properties["CapacityProviderConfig"];
@@ -9928,7 +10162,8 @@ async function update$37(logicalId, physicalId, resourceType, properties, previo
9928
10162
  "LoggingConfig",
9929
10163
  "DurableConfig",
9930
10164
  "CapacityProviderConfig",
9931
- "RuntimeConfig"
10165
+ "RuntimeConfig",
10166
+ "AcceleratorConfig"
9932
10167
  ];
9933
10168
  const changedConfigFields = [];
9934
10169
  for (const field of configFields) {
@@ -9957,7 +10192,8 @@ async function update$37(logicalId, physicalId, resourceType, properties, previo
9957
10192
  LoggingConfig: properties["LoggingConfig"],
9958
10193
  DurableConfig: properties["DurableConfig"],
9959
10194
  CapacityProviderConfig: capacityProviderConfigForUpdate(capacityNeverApplied ? void 0 : desiredCapacity),
9960
- RuntimeConfig: properties["RuntimeConfig"]
10195
+ RuntimeConfig: properties["RuntimeConfig"],
10196
+ AcceleratorConfig: properties["AcceleratorConfig"]
9961
10197
  };
9962
10198
  for (const field of changedConfigFields) markUnsettled(field);
9963
10199
  await sendOnceActive(() => this.lambdaClient.send(new UpdateFunctionConfigurationCommand(configParams)));
@@ -10463,6 +10699,9 @@ async function importImpl$35(input) {
10463
10699
  }
10464
10700
 
10465
10701
  // src/provisioning/providers/lambda-function/read-state.ts
10702
+ function settingAbsent(error) {
10703
+ return error instanceof ResourceNotFoundException;
10704
+ }
10466
10705
  async function readUnsettled$7(physicalId, logicalId, resourceType, names) {
10467
10706
  const live = await this.readCurrentState(physicalId, logicalId, resourceType);
10468
10707
  if (typeof live !== "object" || live === null) return live;
@@ -10507,7 +10746,7 @@ async function unsettledInTransition$6(physicalId, _logicalId, _resourceType, na
10507
10746
  return names;
10508
10747
  }
10509
10748
  }
10510
- async function readCurrentState$36(physicalId, _logicalId, _resourceType) {
10749
+ async function readCurrentState$38(physicalId, _logicalId, _resourceType) {
10511
10750
  try {
10512
10751
  const resp = await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: physicalId }));
10513
10752
  const cfg = resp.Configuration;
@@ -10567,6 +10806,7 @@ async function readCurrentState$36(physicalId, _logicalId, _resourceType) {
10567
10806
  if (cfg.RuntimeConfig.RuntimeAlias !== void 0) rc["RuntimeAlias"] = cfg.RuntimeConfig.RuntimeAlias;
10568
10807
  if (Object.keys(rc).length > 0) result["RuntimeConfig"] = rc;
10569
10808
  }
10809
+ if (cfg.AcceleratorConfig?.AcceleratorMemorySize !== void 0) result["AcceleratorConfig"] = { AcceleratorMemorySize: cfg.AcceleratorConfig.AcceleratorMemorySize };
10570
10810
  if (cfg.CapacityProviderConfig !== void 0) {
10571
10811
  result["CapacityProviderConfig"] = cfg.CapacityProviderConfig;
10572
10812
  try {
@@ -10577,7 +10817,7 @@ async function readCurrentState$36(physicalId, _logicalId, _resourceType) {
10577
10817
  const live = scaling.RequestedFunctionScalingConfig ?? scaling.AppliedFunctionScalingConfig;
10578
10818
  if (live !== void 0) result["FunctionScalingConfig"] = live;
10579
10819
  } catch (scalingErr) {
10580
- if (!(scalingErr instanceof ResourceNotFoundException)) this.logger.warn(safeMsg`GetFunctionScalingConfig failed for ${physicalId} — FunctionScalingConfig omitted from the drift snapshot (may surface as a false removal): ${describeAwsFailure(scalingErr).summary}`);
10820
+ if (!settingAbsent(scalingErr)) throw scalingErr;
10581
10821
  }
10582
10822
  }
10583
10823
  result["Tags"] = normalizeAwsTagsToCfn(resp.Tags);
@@ -10585,13 +10825,13 @@ async function readCurrentState$36(physicalId, _logicalId, _resourceType) {
10585
10825
  const rlResp = await this.lambdaClient.send(new GetFunctionRecursionConfigCommand({ FunctionName: physicalId }));
10586
10826
  if (rlResp.RecursiveLoop !== void 0) result["RecursiveLoop"] = rlResp.RecursiveLoop;
10587
10827
  } catch (rlErr) {
10588
- if (!(rlErr instanceof ResourceNotFoundException)) this.logger.debug(`GetFunctionRecursionConfig failed for ${physicalId}: ${describeAwsFailure(rlErr).detail}`);
10828
+ if (!settingAbsent(rlErr)) throw rlErr;
10589
10829
  }
10590
10830
  try {
10591
10831
  const pcResp = await this.lambdaClient.send(new GetFunctionConcurrencyCommand({ FunctionName: physicalId }));
10592
10832
  if (pcResp.ReservedConcurrentExecutions !== void 0) result["ReservedConcurrentExecutions"] = pcResp.ReservedConcurrentExecutions;
10593
10833
  } catch (pcErr) {
10594
- if (!(pcErr instanceof ResourceNotFoundException)) this.logger.debug(`GetFunctionConcurrency failed for ${physicalId}: ${describeAwsFailure(pcErr).detail}`);
10834
+ if (!settingAbsent(pcErr)) throw pcErr;
10595
10835
  }
10596
10836
  if (cfg.PackageType !== "Image") {
10597
10837
  try {
@@ -10602,13 +10842,13 @@ async function readCurrentState$36(physicalId, _logicalId, _resourceType) {
10602
10842
  result["RuntimeManagementConfig"] = rm;
10603
10843
  }
10604
10844
  } catch (rmErr) {
10605
- if (!(rmErr instanceof ResourceNotFoundException)) this.logger.warn(`GetRuntimeManagementConfig failed for ${physicalId} — RuntimeManagementConfig omitted from the drift snapshot (may surface as a false removal): ${describeAwsFailure(rmErr).detail}`);
10845
+ if (!settingAbsent(rmErr)) throw rmErr;
10606
10846
  }
10607
10847
  try {
10608
10848
  const csResp = await this.lambdaClient.send(new GetFunctionCodeSigningConfigCommand({ FunctionName: physicalId }));
10609
10849
  if (csResp.CodeSigningConfigArn !== void 0) result["CodeSigningConfigArn"] = csResp.CodeSigningConfigArn;
10610
10850
  } catch (csErr) {
10611
- if (!(csErr instanceof ResourceNotFoundException)) this.logger.warn(`GetFunctionCodeSigningConfig failed for ${physicalId} — CodeSigningConfigArn omitted from the drift snapshot (may surface as a false removal): ${describeAwsFailure(csErr).detail}`);
10851
+ if (!settingAbsent(csErr) && !(csErr instanceof CodeSigningConfigNotFoundException)) throw csErr;
10612
10852
  }
10613
10853
  }
10614
10854
  return result;
@@ -10656,7 +10896,8 @@ var LambdaFunctionProvider = class {
10656
10896
  "CapacityProviderConfig",
10657
10897
  "FunctionScalingConfig",
10658
10898
  "PublishToLatestPublished",
10659
- "RuntimeConfig"
10899
+ "RuntimeConfig",
10900
+ "AcceleratorConfig"
10660
10901
  ])]]);
10661
10902
  removalDefaults = /* @__PURE__ */ new Map([["AWS::Lambda::Function", /* @__PURE__ */ new Map([
10662
10903
  ["Timeout", 3],
@@ -10691,7 +10932,8 @@ var LambdaFunctionProvider = class {
10691
10932
  "CapacityProviderConfig",
10692
10933
  "FunctionScalingConfig",
10693
10934
  "PublishToLatestPublished",
10694
- "RuntimeConfig"
10935
+ "RuntimeConfig",
10936
+ "AcceleratorConfig"
10695
10937
  ])]]);
10696
10938
  cleanupDeleteRetryDelayMs = 2e3;
10697
10939
  eniWaitTimeoutMs = 6e5;
@@ -10806,7 +11048,7 @@ var LambdaFunctionProvider = class {
10806
11048
  return unsettledInTransition$6.call(this, physicalId, _logicalId, _resourceType, names);
10807
11049
  }
10808
11050
  readCurrentState(physicalId, _logicalId, _resourceType) {
10809
- return readCurrentState$36.call(this, physicalId, _logicalId, _resourceType);
11051
+ return readCurrentState$38.call(this, physicalId, _logicalId, _resourceType);
10810
11052
  }
10811
11053
  getDriftUnknownPaths() {
10812
11054
  return [
@@ -11036,6 +11278,10 @@ var LambdaPermissionProvider = class {
11036
11278
  if (sourceAccount !== void 0) result["SourceAccount"] = Array.isArray(sourceAccount) ? sourceAccount[0] : sourceAccount;
11037
11279
  const orgId = condition["StringEquals"]?.["aws:PrincipalOrgID"];
11038
11280
  if (orgId !== void 0) result["PrincipalOrgID"] = Array.isArray(orgId) ? orgId[0] : orgId;
11281
+ const token = condition["StringEquals"]?.["lambda:EventSourceToken"];
11282
+ if (token !== void 0) result["EventSourceToken"] = Array.isArray(token) ? token[0] : token;
11283
+ const urlAuthType = condition["StringEquals"]?.["lambda:FunctionUrlAuthType"];
11284
+ if (urlAuthType !== void 0) result["FunctionUrlAuthType"] = Array.isArray(urlAuthType) ? urlAuthType[0] : urlAuthType;
11039
11285
  if (condition["Bool"]?.["lambda:InvokedViaFunctionUrl"] === "true") result["InvokedViaFunctionUrl"] = true;
11040
11286
  }
11041
11287
  return result;
@@ -11796,7 +12042,7 @@ async function deleteImpl$34(logicalId, physicalId, resourceType, properties, co
11796
12042
  }
11797
12043
 
11798
12044
  // src/provisioning/providers/lambda-eventsource/read-state.ts
11799
- async function readCurrentState$35(physicalId, _logicalId, _resourceType, properties) {
12045
+ async function readCurrentState$37(physicalId, _logicalId, _resourceType, properties) {
11800
12046
  let resp;
11801
12047
  try {
11802
12048
  resp = await this.lambdaClient.send(new GetEventSourceMappingCommand({ UUID: physicalId }));
@@ -11853,6 +12099,7 @@ async function readCurrentState$35(physicalId, _logicalId, _resourceType, proper
11853
12099
  })).sort((a, b) => a.Key.localeCompare(b.Key));
11854
12100
  } catch (err) {
11855
12101
  if (err instanceof ResourceNotFoundException) return RESOURCE_NOT_FOUND;
12102
+ throw err;
11856
12103
  }
11857
12104
  result["Tags"] = tags;
11858
12105
  return result;
@@ -12006,7 +12253,7 @@ var LambdaEventSourceMappingProvider = class {
12006
12253
  return deleteImpl$34.call(this, logicalId, physicalId, resourceType, properties, context);
12007
12254
  }
12008
12255
  readCurrentState(physicalId, logicalId, resourceType, properties) {
12009
- return readCurrentState$35.call(this, physicalId, logicalId, resourceType, properties);
12256
+ return readCurrentState$37.call(this, physicalId, logicalId, resourceType, properties);
12010
12257
  }
12011
12258
  canonicalizeDriftPair(resourceType, baseline, aws, properties) {
12012
12259
  return canonicalizeDriftPair$6.call(this, resourceType, baseline, aws, properties);
@@ -15326,7 +15573,7 @@ async function waitForKinesisDestinationSettled(tableName, streamArn, expectedPr
15326
15573
  function isTransientStreamReadFailure(err) {
15327
15574
  return isThrottlingError(err) || isTransientServerError(err) || isAmbiguousOutcomeError(err) || err instanceof ResourceNotFoundException$1;
15328
15575
  }
15329
- async function readCurrentState$34(physicalId, logicalId, _resourceType, properties, context) {
15576
+ async function readCurrentState$36(physicalId, logicalId, _resourceType, properties, context) {
15330
15577
  try {
15331
15578
  const table = (await this.dynamoDBClient.send(new DescribeTableCommand({ TableName: physicalId }))).Table;
15332
15579
  if (!table) return void 0;
@@ -15425,7 +15672,7 @@ async function readPointInTimeRecovery(physicalId, strict = false) {
15425
15672
  if (pitrStatus === "ENABLED" && pitrDesc?.RecoveryPeriodInDays !== void 0) pitr["RecoveryPeriodInDays"] = pitrDesc.RecoveryPeriodInDays;
15426
15673
  return pitr;
15427
15674
  } catch (err) {
15428
- if (strict) throw err;
15675
+ if (strict || !(err instanceof TableNotFoundException)) throw err;
15429
15676
  this.logger.debug(`Could not read PointInTimeRecovery for ${physicalId}: ${describeAwsFailure(err).detail}`);
15430
15677
  return;
15431
15678
  }
@@ -15439,12 +15686,12 @@ async function readTimeToLive(physicalId, strict = false) {
15439
15686
  };
15440
15687
  return;
15441
15688
  } catch (err) {
15442
- if (strict) throw err;
15689
+ if (strict || !(err instanceof ResourceNotFoundException$1)) throw err;
15443
15690
  this.logger.debug(`Could not read TimeToLive for ${physicalId}: ${describeAwsFailure(err).detail}`);
15444
15691
  return;
15445
15692
  }
15446
15693
  }
15447
- async function readTableResourcePolicy(physicalId, tableArn, strict = false, settle) {
15694
+ async function readTableResourcePolicy(physicalId, tableArn, _strict = false, settle) {
15448
15695
  const declared = settle !== void 0 && streamDeclaresPolicy(settle.desired);
15449
15696
  const afterOwnWrite = settle?.afterOwnWrite === true;
15450
15697
  let lastPolicy;
@@ -15474,7 +15721,7 @@ async function readTableResourcePolicy(physicalId, tableArn, strict = false, set
15474
15721
  return declaredStreamPolicyMember(settle?.desired);
15475
15722
  }
15476
15723
  if (declared && answered) return reverseMapStreamPolicy(lastPolicy, settle?.desired);
15477
- if (strict && !(err instanceof ResourceNotFoundException$1) && !(err instanceof PolicyNotFoundException)) throw err;
15724
+ if (!(err instanceof ResourceNotFoundException$1) && !(err instanceof PolicyNotFoundException)) throw err;
15478
15725
  if (!(err instanceof ResourceNotFoundException$1)) this.logger.debug(`Could not read ResourcePolicy for ${physicalId}: ${describeAwsFailure(err).detail}`);
15479
15726
  return;
15480
15727
  }
@@ -15487,7 +15734,7 @@ async function readKinesisStreamSpecification(physicalId, strict = false) {
15487
15734
  if (active.ApproximateCreationDateTimePrecision !== void 0) kspec["ApproximateCreationDateTimePrecision"] = active.ApproximateCreationDateTimePrecision;
15488
15735
  return kspec;
15489
15736
  } catch (err) {
15490
- if (strict) throw err;
15737
+ if (strict || !(err instanceof ResourceNotFoundException$1)) throw err;
15491
15738
  this.logger.debug(`Could not read KinesisStreamingDestination for ${physicalId}: ${describeAwsFailure(err).detail}`);
15492
15739
  return;
15493
15740
  }
@@ -15497,7 +15744,7 @@ async function readTableContributorInsights(physicalId, strict = false) {
15497
15744
  const ciResp = await this.dynamoDBClient.send(new DescribeContributorInsightsCommand({ TableName: physicalId }));
15498
15745
  return reverseMapTableContributorInsights(ciResp.ContributorInsightsStatus, ciResp.ContributorInsightsMode);
15499
15746
  } catch (err) {
15500
- if (strict) throw err;
15747
+ if (strict || !(err instanceof ResourceNotFoundException$1)) throw err;
15501
15748
  this.logger.debug(`Could not read ContributorInsights for ${physicalId}: ${describeAwsFailure(err).detail}`);
15502
15749
  return;
15503
15750
  }
@@ -15519,6 +15766,7 @@ async function readIndexContributorInsights(physicalId, result, properties, bagI
15519
15766
  const block = reverseMapIndexContributorInsights(indexResp.ContributorInsightsStatus, indexResp.ContributorInsightsMode, desiredEntry?.[CONTRIBUTOR_INSIGHTS_KEY]);
15520
15767
  if (block !== void 0) emitted[CONTRIBUTOR_INSIGHTS_KEY] = block;
15521
15768
  } catch (err) {
15769
+ if (!(err instanceof ResourceNotFoundException$1)) throw err;
15522
15770
  this.logger.debug(`Could not read ContributorInsights for index ${indexName} of ${physicalId}: ${describeAwsFailure(err).detail}`);
15523
15771
  }
15524
15772
  }
@@ -15562,6 +15810,7 @@ async function readStreamMembers(tableName, streamArn, desiredBlock, streamBlock
15562
15810
  this.logger.debug(`Could not read the stream ResourcePolicy for ${tableName}: ${describeAwsFailure(err).detail}`);
15563
15811
  if (afterOwnWrite && isTransientStreamReadFailure(err)) keepDeclared(STREAM_POLICY_KEY, "the read failed transiently");
15564
15812
  else if (afterOwnWrite && lastPolicy !== void 0 && lastPolicy !== "") keepDeclared(STREAM_POLICY_KEY, "the read failed after an unsettled answer");
15813
+ else if (!(err instanceof ResourceNotFoundException$1)) throw err;
15565
15814
  }
15566
15815
  }
15567
15816
  if (streamDeclaresTags(desiredBlock)) {
@@ -15589,6 +15838,7 @@ async function readStreamMembers(tableName, streamArn, desiredBlock, streamBlock
15589
15838
  this.logger.debug(`Could not read the stream Tags for ${tableName}: ${describeAwsFailure(err).detail}`);
15590
15839
  if (afterOwnWrite && lastTags.length > 0) streamBlock[STREAM_TAGS_KEY] = lastTags;
15591
15840
  else if (afterOwnWrite && isTransientStreamReadFailure(err)) keepDeclared(STREAM_TAGS_KEY, "the read failed transiently");
15841
+ else if (!(err instanceof ResourceNotFoundException$1)) throw err;
15592
15842
  }
15593
15843
  }
15594
15844
  }
@@ -16497,7 +16747,7 @@ var DynamoDBTableProvider = class {
16497
16747
  return unsettledInTransition$5.call(this, physicalId, _logicalId, _resourceType, names);
16498
16748
  }
16499
16749
  async readCurrentState(physicalId, _logicalId, _resourceType, properties, context) {
16500
- return readCurrentState$34.call(this, physicalId, _logicalId, _resourceType, properties, context);
16750
+ return readCurrentState$36.call(this, physicalId, _logicalId, _resourceType, properties, context);
16501
16751
  }
16502
16752
  readTableTags(...args) {
16503
16753
  return readTableTags.call(this, ...args);
@@ -17067,12 +17317,20 @@ async function getAttribute$13(physicalId, _resourceType, attributeName) {
17067
17317
  if (attributeName !== "Arn") return;
17068
17318
  return this.buildArn(physicalId);
17069
17319
  }
17320
+ function isStandardClassOnly(err) {
17321
+ const e = err;
17322
+ return e?.name === "ValidationException" && typeof e.message === "string" && e.message.includes("only supported on the Standard log class");
17323
+ }
17324
+ function isResourceNotFound(err) {
17325
+ return err instanceof ResourceNotFoundException$5 || err?.name === "ResourceNotFoundException";
17326
+ }
17070
17327
  async function readDataProtectionPolicy(physicalId) {
17071
17328
  let document;
17072
17329
  try {
17073
17330
  document = (await this.logsClient.send(new GetDataProtectionPolicyCommand({ logGroupIdentifier: physicalId }))).policyDocument;
17074
17331
  } catch (err) {
17075
- return memberReadFailure(err);
17332
+ if (isResourceNotFound(err)) return "refused";
17333
+ throw err;
17076
17334
  }
17077
17335
  if (!document) return "absent";
17078
17336
  try {
@@ -17081,7 +17339,7 @@ async function readDataProtectionPolicy(physicalId) {
17081
17339
  return { value: document };
17082
17340
  }
17083
17341
  }
17084
- async function readCurrentState$33(physicalId, logicalId, _resourceType, properties, context) {
17342
+ async function readCurrentState$35(physicalId, logicalId, _resourceType, properties, context) {
17085
17343
  try {
17086
17344
  const found = (await this.logsClient.send(new DescribeLogGroupsCommand({ logGroupNamePrefix: physicalId }))).logGroups?.find((g) => g.logGroupName === physicalId);
17087
17345
  if (!found) return RESOURCE_NOT_FOUND;
@@ -17104,9 +17362,31 @@ async function readCurrentState$33(physicalId, logicalId, _resourceType, propert
17104
17362
  }
17105
17363
  }
17106
17364
  result["Tags"] = tags;
17107
- let dpp = await readDataProtectionPolicy.call(this, physicalId);
17365
+ const notStandard = found.logGroupClass !== void 0 && found.logGroupClass !== "STANDARD";
17366
+ const standardOnly = (err) => notStandard && isStandardClassOnly(err);
17367
+ let dpp;
17368
+ let dppError;
17369
+ let dppFailed = false;
17370
+ try {
17371
+ dpp = await readDataProtectionPolicy.call(this, physicalId);
17372
+ } catch (err) {
17373
+ if (standardOnly(err)) dpp = "refused";
17374
+ else {
17375
+ dpp = memberReadFailure(err);
17376
+ dppError = err;
17377
+ dppFailed = true;
17378
+ }
17379
+ }
17108
17380
  const declared = context?.afterOwnWrite === true ? declaredMemberDocument(properties?.["DataProtectionPolicy"]) : void 0;
17109
- if (declared !== void 0) dpp = await settleDeclaredMember(dpp, () => readDataProtectionPolicy.call(this, physicalId), (document) => policyDocumentMatchesDeclared(document, declared), declared, this.ownWriteRereadDelaysMs, () => warnUnsettledMember(this.logger, logicalId, "AWS::Logs::LogGroup", "DataProtectionPolicy"));
17381
+ if (declared !== void 0) dpp = await settleDeclaredMember(dpp, async () => {
17382
+ try {
17383
+ return await readDataProtectionPolicy.call(this, physicalId);
17384
+ } catch (err) {
17385
+ if (standardOnly(err)) return "refused";
17386
+ throw err;
17387
+ }
17388
+ }, (document) => policyDocumentMatchesDeclared(document, declared), declared, this.ownWriteRereadDelaysMs, () => warnUnsettledMember(this.logger, logicalId, "AWS::Logs::LogGroup", "DataProtectionPolicy"));
17389
+ if (dppFailed && (dpp === "failed" || dpp === "refused")) throw dppError;
17110
17390
  result["DataProtectionPolicy"] = typeof dpp === "object" ? dpp.value : "";
17111
17391
  let fieldIndexPolicies = [];
17112
17392
  try {
@@ -17118,7 +17398,9 @@ async function readCurrentState$33(physicalId, logicalId, _resourceType, propert
17118
17398
  return p.policyDocument;
17119
17399
  }
17120
17400
  }).filter((p) => p !== void 0);
17121
- } catch {}
17401
+ } catch (err) {
17402
+ if (!isResourceNotFound(err) && !standardOnly(err)) throw err;
17403
+ }
17122
17404
  result["FieldIndexPolicies"] = fieldIndexPolicies;
17123
17405
  return result;
17124
17406
  } catch (err) {
@@ -17225,7 +17507,7 @@ var LogsLogGroupProvider = class {
17225
17507
  return getAttribute$13.call(this, physicalId, _resourceType, attributeName);
17226
17508
  }
17227
17509
  readCurrentState(physicalId, _logicalId, _resourceType, properties, context) {
17228
- return readCurrentState$33.call(this, physicalId, _logicalId, _resourceType, properties, context);
17510
+ return readCurrentState$35.call(this, physicalId, _logicalId, _resourceType, properties, context);
17229
17511
  }
17230
17512
  import(input) {
17231
17513
  return importImpl$33.call(this, input);
@@ -18187,6 +18469,7 @@ var CloudWatchAlarmProvider = class {
18187
18469
  const tagsResp = await this.cloudWatchClient.send(new ListTagsForResourceCommand$4({ ResourceARN: alarm.AlarmArn }));
18188
18470
  result["Tags"] = normalizeAwsTagsToCfn(tagsResp.Tags);
18189
18471
  } catch (err) {
18472
+ if (!this.isNotFound(err)) throw err;
18190
18473
  this.logger.debug(`CloudWatch ListTagsForResource(${alarm.AlarmArn}) failed: ${describeAwsFailure(err).detail}`);
18191
18474
  }
18192
18475
  return result;
@@ -18351,6 +18634,68 @@ var CloudWatchAnomalyDetectorProvider = class {
18351
18634
  if (ID_ATTRIBUTES.includes(attributeName)) return physicalId;
18352
18635
  throw new ProvisioningError(`Unknown attribute ${attributeName} for ${resourceType} (only 'AnomalyDetectorId' and 'Id' are defined)`, resourceType, logicalId, physicalId);
18353
18636
  }
18637
+ async readCurrentState(_physicalId, logicalId, resourceType, properties, context) {
18638
+ if (resourceType !== "AWS::CloudWatch::AnomalyDetector" || !properties) return void 0;
18639
+ const descriptor = {
18640
+ Namespace: properties["Namespace"],
18641
+ MetricName: properties["MetricName"],
18642
+ Stat: properties["Stat"],
18643
+ Dimensions: properties["Dimensions"],
18644
+ SingleMetricAnomalyDetector: properties["SingleMetricAnomalyDetector"],
18645
+ MetricMathAnomalyDetector: properties["MetricMathAnomalyDetector"]
18646
+ };
18647
+ if (holdsSecretDerivedEntry(descriptor)) return void 0;
18648
+ if (!hasDescriptor(buildDeleteParams(properties))) return void 0;
18649
+ const readOnce = async () => {
18650
+ const detector = await this.findDetector(properties);
18651
+ return detector === void 0 ? RESOURCE_NOT_FOUND : readbackOf(detector, properties);
18652
+ };
18653
+ if (context?.afterOwnWrite !== true) return readOnce();
18654
+ const declared = declaredConfiguration(properties);
18655
+ const { answer, settled } = await reReadUntilSettled(readOnce, (a) => a !== RESOURCE_NOT_FOUND && sameConfiguration(a["Configuration"], declared), this.ownWriteRereadDelaysMs);
18656
+ if (!settled && answer !== RESOURCE_NOT_FOUND) warnUnsettledMember(this.logger, logicalId, resourceType, "Configuration");
18657
+ return answer;
18658
+ }
18659
+ ownWriteRereadDelaysMs = OWN_WRITE_REREAD_DELAYS_MS;
18660
+ async findDetector(properties) {
18661
+ const recordedSingle = properties["SingleMetricAnomalyDetector"];
18662
+ const math = properties["MetricMathAnomalyDetector"];
18663
+ const isMath = math !== void 0 && recordedSingle === void 0;
18664
+ const ns = recordedSingle?.["Namespace"] ?? properties["Namespace"];
18665
+ const metric = recordedSingle?.["MetricName"] ?? properties["MetricName"];
18666
+ const input = isMath ? { AnomalyDetectorTypes: ["METRIC_MATH"] } : {
18667
+ AnomalyDetectorTypes: ["SINGLE_METRIC"],
18668
+ ...typeof ns === "string" && { Namespace: ns },
18669
+ ...typeof metric === "string" && { MetricName: metric }
18670
+ };
18671
+ const all = [];
18672
+ let nextToken;
18673
+ do {
18674
+ const resp = await this.cloudWatchClient.send(new DescribeAnomalyDetectorsCommand({
18675
+ ...input,
18676
+ ...nextToken && { NextToken: nextToken }
18677
+ }));
18678
+ all.push(...resp.AnomalyDetectors ?? []);
18679
+ nextToken = resp.NextToken;
18680
+ } while (nextToken);
18681
+ if (isMath) {
18682
+ const queries = math["MetricDataQueries"];
18683
+ return all.find((d) => leavesMatch(queries, d.MetricMathAnomalyDetector?.MetricDataQueries));
18684
+ }
18685
+ const stat = recordedSingle?.["Stat"] ?? properties["Stat"];
18686
+ const dims = recordedSingle?.["Dimensions"] ?? properties["Dimensions"];
18687
+ const account = recordedSingle?.["AccountId"];
18688
+ const matches = all.filter((d) => {
18689
+ const live = liveSingle(d);
18690
+ return scalarText(live.Namespace) === scalarText(ns) && scalarText(live.MetricName) === scalarText(metric) && scalarText(live.Stat) === scalarText(stat) && leavesMatch(dims ?? [], live.Dimensions ?? []);
18691
+ });
18692
+ const noAccount = matches.find((d) => liveSingle(d).AccountId === void 0);
18693
+ if (account === void 0) return noAccount ?? matches[0];
18694
+ const exact = matches.find((d) => scalarText(liveSingle(d).AccountId) === scalarText(account));
18695
+ if (exact !== void 0 || noAccount === void 0) return exact;
18696
+ const identity = await getAwsClients().sts.send(new GetCallerIdentityCommand({}));
18697
+ return identity.Account !== void 0 && identity.Account === scalarText(account) ? noAccount : void 0;
18698
+ }
18354
18699
  async import(input) {
18355
18700
  if (input.knownPhysicalId) return {
18356
18701
  physicalId: input.knownPhysicalId,
@@ -18399,6 +18744,110 @@ function buildDeleteParams(properties) {
18399
18744
  if (properties["Dimensions"] !== void 0) params.Dimensions = properties["Dimensions"];
18400
18745
  return params;
18401
18746
  }
18747
+ function liveSingle(d) {
18748
+ return d.SingleMetricAnomalyDetector ?? {
18749
+ Namespace: d.Namespace,
18750
+ MetricName: d.MetricName,
18751
+ Stat: d.Stat,
18752
+ Dimensions: d.Dimensions
18753
+ };
18754
+ }
18755
+ function isDimensionList(value) {
18756
+ return Array.isArray(value) && value.every((e) => typeof e === "object" && e !== null && "Name" in e && "Value" in e);
18757
+ }
18758
+ const byName = (list) => [...list].sort((a, b) => String(a["Name"]).localeCompare(String(b["Name"])));
18759
+ function leavesMatch(recorded, live) {
18760
+ if (recorded === void 0 || recorded === null) return true;
18761
+ if (Array.isArray(recorded)) {
18762
+ if (!Array.isArray(live) || live.length !== recorded.length) return false;
18763
+ const [r, l] = isDimensionList(recorded) && isDimensionList(live) ? [byName(recorded), byName(live)] : [recorded, live];
18764
+ return r.every((entry, i) => leavesMatch(entry, l[i]));
18765
+ }
18766
+ if (typeof recorded === "object") {
18767
+ if (typeof live !== "object" || live === null) return false;
18768
+ return Object.entries(recorded).every(([k, v]) => {
18769
+ const at = live[k];
18770
+ if (at === void 0 && OPTIONAL_QUERY_MEMBERS.has(k)) return true;
18771
+ return leavesMatch(v, at);
18772
+ });
18773
+ }
18774
+ return live !== void 0 && live !== null && scalarText(recorded) === scalarText(live);
18775
+ }
18776
+ const OPTIONAL_QUERY_MEMBERS = /* @__PURE__ */ new Set([
18777
+ "Label",
18778
+ "Period",
18779
+ "ReturnData",
18780
+ "Unit"
18781
+ ]);
18782
+ function scalarText(value) {
18783
+ if (value === void 0 || value === null) return "";
18784
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return String(value);
18785
+ return JSON.stringify(value);
18786
+ }
18787
+ function projectOnto(recorded, live) {
18788
+ if (Array.isArray(recorded) && Array.isArray(live)) {
18789
+ if (isDimensionList(recorded) && isDimensionList(live)) return recorded.map((r) => {
18790
+ const hit = live.find((l) => String(l["Name"]) === String(r["Name"]));
18791
+ return hit === void 0 ? void 0 : {
18792
+ Name: hit["Name"],
18793
+ Value: hit["Value"]
18794
+ };
18795
+ });
18796
+ return recorded.map((entry, i) => projectOnto(entry, live[i]));
18797
+ }
18798
+ if (typeof recorded === "object" && recorded !== null && typeof live === "object" && live !== null) {
18799
+ const out = {};
18800
+ for (const key of Object.keys(recorded)) {
18801
+ const value = live[key];
18802
+ if (value !== void 0) out[key] = projectOnto(recorded[key], value);
18803
+ }
18804
+ return out;
18805
+ }
18806
+ return live;
18807
+ }
18808
+ function rangeTime(live, recorded) {
18809
+ if (!(live instanceof Date)) return void 0;
18810
+ if (typeof recorded === "string" && parseCfnTimestamp(recorded).getTime() === live.getTime()) return recorded;
18811
+ return live.toISOString().slice(0, 19);
18812
+ }
18813
+ function configurationOf$2(live, recorded) {
18814
+ const rec = recorded ?? {};
18815
+ const recRanges = Array.isArray(rec["ExcludedTimeRanges"]) ? rec["ExcludedTimeRanges"] : [];
18816
+ const out = {};
18817
+ if (live?.MetricTimezone !== void 0) out["MetricTimeZone"] = live.MetricTimezone;
18818
+ const ranges = live?.ExcludedTimeRanges ?? [];
18819
+ if (ranges.length > 0 || rec["ExcludedTimeRanges"] !== void 0) out["ExcludedTimeRanges"] = ranges.map((r, i) => ({
18820
+ StartTime: rangeTime(r.StartTime, recRanges[i]?.["StartTime"]),
18821
+ EndTime: rangeTime(r.EndTime, recRanges[i]?.["EndTime"])
18822
+ }));
18823
+ return out;
18824
+ }
18825
+ function declaredConfiguration(properties) {
18826
+ const rec = properties["Configuration"] ?? {};
18827
+ const out = {};
18828
+ if (rec["MetricTimeZone"] !== void 0) out["MetricTimeZone"] = rec["MetricTimeZone"];
18829
+ if (Array.isArray(rec["ExcludedTimeRanges"])) out["ExcludedTimeRanges"] = rec["ExcludedTimeRanges"];
18830
+ return out;
18831
+ }
18832
+ function sameConfiguration(read, declared) {
18833
+ const r = read ?? {};
18834
+ if (r["MetricTimeZone"] !== declared["MetricTimeZone"]) return false;
18835
+ const instants = (v) => JSON.stringify((Array.isArray(v) ? v : []).map((range) => ["StartTime", "EndTime"].map((k) => typeof range[k] === "string" ? parseCfnTimestamp(range[k]).getTime() : range[k])));
18836
+ return instants(r["ExcludedTimeRanges"]) === instants(declared["ExcludedTimeRanges"]);
18837
+ }
18838
+ function readbackOf(d, properties) {
18839
+ const out = {};
18840
+ const single = liveSingle(d);
18841
+ if (properties["SingleMetricAnomalyDetector"] !== void 0) out["SingleMetricAnomalyDetector"] = projectOnto(properties["SingleMetricAnomalyDetector"], single);
18842
+ if (properties["MetricMathAnomalyDetector"] !== void 0) out["MetricMathAnomalyDetector"] = projectOnto(properties["MetricMathAnomalyDetector"], d.MetricMathAnomalyDetector);
18843
+ if (properties["Namespace"] !== void 0) out["Namespace"] = single.Namespace;
18844
+ if (properties["MetricName"] !== void 0) out["MetricName"] = single.MetricName;
18845
+ if (properties["Stat"] !== void 0) out["Stat"] = single.Stat;
18846
+ if (properties["Dimensions"] !== void 0) out["Dimensions"] = projectOnto(properties["Dimensions"], single.Dimensions ?? []);
18847
+ out["Configuration"] = configurationOf$2(d.Configuration, properties["Configuration"]);
18848
+ if (d.MetricCharacteristics !== void 0) out["MetricCharacteristics"] = d.MetricCharacteristics.PeriodicSpikes === void 0 ? {} : { PeriodicSpikes: d.MetricCharacteristics.PeriodicSpikes };
18849
+ return out;
18850
+ }
18402
18851
  function toDate(value, mask) {
18403
18852
  if (value === void 0) return void 0;
18404
18853
  if (value instanceof Date) return value;
@@ -18779,7 +19228,7 @@ function generateSecretString(config, options) {
18779
19228
  }
18780
19229
 
18781
19230
  // src/provisioning/providers/secretsmanager-secret/read-state.ts
18782
- async function readCurrentState$32(physicalId, logicalId, _resourceType, properties, context) {
19231
+ async function readCurrentState$34(physicalId, logicalId, _resourceType, properties, context) {
18783
19232
  const tagsWritten = context?.afterOwnWrite === true ? takeTagWrite("AWS::SecretsManager::Secret", physicalId) : void 0;
18784
19233
  const tagsSettle = properties !== void 0 && Object.keys(properties).length > 0 ? tagsWritten : void 0;
18785
19234
  try {
@@ -18908,7 +19357,7 @@ var SecretsManagerSecretProvider = class {
18908
19357
  return generateSecretString.call(this, config, options);
18909
19358
  }
18910
19359
  readCurrentState(physicalId, logicalId, resourceType, properties, context) {
18911
- return readCurrentState$32.call(this, physicalId, logicalId, resourceType, properties, context);
19360
+ return readCurrentState$34.call(this, physicalId, logicalId, resourceType, properties, context);
18912
19361
  }
18913
19362
  tagsBaselineRereadDelaysMs = TAGS_BASELINE_REREAD_DELAYS_MS;
18914
19363
  settleSecretTags(...args) {
@@ -19043,7 +19492,7 @@ async function deleteImpl$31(logicalId, physicalId, resourceType, _properties, c
19043
19492
  }
19044
19493
 
19045
19494
  // src/provisioning/providers/ssm-parameter/read-state.ts
19046
- async function readCurrentState$31(physicalId, _logicalId, _resourceType) {
19495
+ async function readCurrentState$33(physicalId, _logicalId, _resourceType) {
19047
19496
  let getResp;
19048
19497
  try {
19049
19498
  getResp = await this.ssmClient.send(new GetParameterCommand({
@@ -19060,28 +19509,23 @@ async function readCurrentState$31(physicalId, _logicalId, _resourceType) {
19060
19509
  if (param.Type !== void 0) result["Type"] = param.Type;
19061
19510
  if (param.Value !== void 0) result["Value"] = param.Value;
19062
19511
  if (param.DataType !== void 0) result["DataType"] = param.DataType;
19063
- let policiesEmitted = false;
19064
- try {
19065
- const meta = (await this.ssmClient.send(new DescribeParametersCommand({ ParameterFilters: [{
19066
- Key: "Name",
19067
- Values: [physicalId]
19068
- }] }))).Parameters?.[0];
19069
- result["Description"] = meta?.Description ?? "";
19070
- result["AllowedPattern"] = meta?.AllowedPattern ?? "";
19071
- if (meta?.Tier !== void 0) result["Tier"] = meta.Tier;
19072
- const parsedPolicies = [];
19073
- for (const p of meta?.Policies ?? []) {
19074
- if (!p.PolicyText) continue;
19075
- try {
19076
- parsedPolicies.push(JSON.parse(p.PolicyText));
19077
- } catch {
19078
- parsedPolicies.push(p.PolicyText);
19079
- }
19512
+ const meta = (await this.ssmClient.send(new DescribeParametersCommand({ ParameterFilters: [{
19513
+ Key: "Name",
19514
+ Values: [physicalId]
19515
+ }] }))).Parameters?.[0];
19516
+ result["Description"] = meta?.Description ?? "";
19517
+ result["AllowedPattern"] = meta?.AllowedPattern ?? "";
19518
+ if (meta?.Tier !== void 0) result["Tier"] = meta.Tier;
19519
+ const parsedPolicies = [];
19520
+ for (const p of meta?.Policies ?? []) {
19521
+ if (!p.PolicyText) continue;
19522
+ try {
19523
+ parsedPolicies.push(JSON.parse(p.PolicyText));
19524
+ } catch {
19525
+ parsedPolicies.push(p.PolicyText);
19080
19526
  }
19081
- result["Policies"] = parsedPolicies;
19082
- policiesEmitted = true;
19083
- } catch {}
19084
- if (!policiesEmitted) result["Policies"] = [];
19527
+ }
19528
+ result["Policies"] = parsedPolicies;
19085
19529
  try {
19086
19530
  const tagsResp = await this.ssmClient.send(new ListTagsForResourceCommand$2({
19087
19531
  ResourceType: "Parameter",
@@ -19089,7 +19533,9 @@ async function readCurrentState$31(physicalId, _logicalId, _resourceType) {
19089
19533
  }));
19090
19534
  const tagArr = normalizeAwsTagsToCfn(tagsResp.TagList);
19091
19535
  result["Tags"] = Object.fromEntries(tagArr.map((t) => [t.Key, t.Value]));
19092
- } catch {}
19536
+ } catch (err) {
19537
+ if (err.name !== "InvalidResourceId") throw err;
19538
+ }
19093
19539
  return result;
19094
19540
  }
19095
19541
 
@@ -19223,7 +19669,7 @@ var SSMParameterProvider = class SSMParameterProvider {
19223
19669
  return deleteImpl$31.call(this, logicalId, physicalId, resourceType, properties, context);
19224
19670
  }
19225
19671
  readCurrentState(physicalId, logicalId, resourceType) {
19226
- return readCurrentState$31.call(this, physicalId, logicalId, resourceType);
19672
+ return readCurrentState$33.call(this, physicalId, logicalId, resourceType);
19227
19673
  }
19228
19674
  refuseUnwritableParameterId(input, explicit) {
19229
19675
  return refuseUnwritableParameterId.call(this, input, explicit);
@@ -24252,6 +24698,7 @@ function planInstanceMemberUpdates(logicalId, physicalId, resourceType, properti
24252
24698
  };
24253
24699
  }
24254
24700
  }
24701
+ if (plan.securityGroups === void 0 && changed("SecurityGroups", (a, b) => sameStringSet(a, b))) throw refusedBeforeApplying(new ResourceUpdateNotSupportedError(resourceType, logicalId, `replace the instance (${deployReplaceCommand()}). SecurityGroups names the groups only when the instance is launched, and CloudFormation creates a new instance for this change`));
24255
24702
  const beforeBdm = previousProperties["BlockDeviceMappings"];
24256
24703
  const afterBdm = properties["BlockDeviceMappings"];
24257
24704
  if (afterBdm !== void 0 && (context?.changedProperties === void 0 || context.changedProperties.has("BlockDeviceMappings")) && blockDeviceMappingsDifferOnlyInDeleteOnTermination(beforeBdm, afterBdm)) {
@@ -25140,35 +25587,30 @@ async function deleteInstanceSsmAssociationsBestEffort(logicalId, instanceId, do
25140
25587
  }
25141
25588
  }
25142
25589
  async function readInstanceSsmAssociations(instanceId, declared) {
25143
- try {
25144
- const listed = await this.listInstanceSsmAssociations(instanceId, declared.map((d) => d.DocumentName));
25145
- const out = [];
25146
- for (const a of listed) {
25147
- let resp;
25148
- try {
25149
- resp = await this.awsClients.ssm.send(new DescribeAssociationCommand({ AssociationId: a.AssociationId }));
25150
- } catch (error) {
25151
- if (isNamedError(error, ASSOCIATION_GONE_NAMES)) continue;
25152
- throw error;
25153
- }
25154
- const description = resp.AssociationDescription;
25155
- const name = description?.Name ?? a.Name;
25156
- const match = declared.find((d) => ssmDocumentName(d.DocumentName) === ssmDocumentName(name));
25157
- const params = description?.Parameters ?? {};
25158
- const order = match?.parameterKeys ?? [];
25159
- const keys = [...order.filter((k) => k in params), ...Object.keys(params).filter((k) => !order.includes(k)).sort()];
25160
- const entry = { DocumentName: match?.DocumentName ?? name };
25161
- if (keys.length > 0 || match?.declaresParameters === true) entry["AssociationParameters"] = keys.map((Key) => ({
25162
- Key,
25163
- Value: params[Key] ?? []
25164
- }));
25165
- out.push(entry);
25590
+ const listed = await this.listInstanceSsmAssociations(instanceId, declared.map((d) => d.DocumentName));
25591
+ const out = [];
25592
+ for (const a of listed) {
25593
+ let resp;
25594
+ try {
25595
+ resp = await this.awsClients.ssm.send(new DescribeAssociationCommand({ AssociationId: a.AssociationId }));
25596
+ } catch (error) {
25597
+ if (isNamedError(error, ASSOCIATION_GONE_NAMES)) continue;
25598
+ throw error;
25166
25599
  }
25167
- return out;
25168
- } catch (error) {
25169
- this.logger.debug(safeMsg`ListAssociations / DescribeAssociation for ${instanceId} failed: ${describeAwsFailure(error).summary}`);
25170
- return;
25600
+ const description = resp.AssociationDescription;
25601
+ const name = description?.Name ?? a.Name;
25602
+ const match = declared.find((d) => ssmDocumentName(d.DocumentName) === ssmDocumentName(name));
25603
+ const params = description?.Parameters ?? {};
25604
+ const order = match?.parameterKeys ?? [];
25605
+ const keys = [...order.filter((k) => k in params), ...Object.keys(params).filter((k) => !order.includes(k)).sort()];
25606
+ const entry = { DocumentName: match?.DocumentName ?? name };
25607
+ if (keys.length > 0 || match?.declaresParameters === true) entry["AssociationParameters"] = keys.map((Key) => ({
25608
+ Key,
25609
+ Value: params[Key] ?? []
25610
+ }));
25611
+ out.push(entry);
25171
25612
  }
25613
+ return out;
25172
25614
  }
25173
25615
  async function ssmRemedyRegion(expectedRegion) {
25174
25616
  const recorded = expectedRegion?.trim();
@@ -25565,16 +26007,53 @@ const tagsErrorsMethods = {
25565
26007
  isNotFoundError: isNotFoundError$3
25566
26008
  };
25567
26009
 
26010
+ // src/provisioning/declared-order.ts
26011
+ function inDeclaredOrder(live, keyOf, declaredKeys) {
26012
+ if (declaredKeys === void 0) return [...live];
26013
+ const taken = /* @__PURE__ */ new Set();
26014
+ const out = [];
26015
+ for (const key of declaredKeys) {
26016
+ if (typeof key !== "string") continue;
26017
+ const index = live.findIndex((entry, i) => !taken.has(i) && keyOf(entry) === key);
26018
+ if (index < 0) continue;
26019
+ taken.add(index);
26020
+ out.push(live[index]);
26021
+ }
26022
+ live.forEach((entry, i) => {
26023
+ if (!taken.has(i)) out.push(entry);
26024
+ });
26025
+ return out;
26026
+ }
26027
+
25568
26028
  // src/provisioning/providers/ec2/read-instance-state.ts
26029
+ const INVALID_INSTANCE_NOT_FOUND = /* @__PURE__ */ new Set(["InvalidInstanceID.NotFound"]);
26030
+ const INVALID_VOLUME_NOT_FOUND = /* @__PURE__ */ new Set(["InvalidVolume.NotFound"]);
26031
+ const CREDIT_SPECIFICATION_NOT_APPLICABLE = /* @__PURE__ */ new Set(["InvalidInstanceID.NotFound", "UnsupportedOperation"]);
25569
26032
  async function readInstanceCurrentState(physicalId, properties) {
25570
26033
  const instance = (await this.ec2Client.send(new DescribeInstancesCommand({ InstanceIds: [physicalId] }))).Reservations?.[0]?.Instances?.[0];
25571
26034
  if (!instance || instance.State?.Name === "terminated" || instance.State?.Name === "shutting-down") return RESOURCE_NOT_FOUND;
26035
+ try {
26036
+ return await readInstanceDetails.call(this, physicalId, instance, properties);
26037
+ } catch (err) {
26038
+ if (!isNamedError(err, INVALID_INSTANCE_NOT_FOUND)) markInstanceSubReadFailure(err);
26039
+ throw err;
26040
+ }
26041
+ }
26042
+ const instanceSubReadFailures = /* @__PURE__ */ new WeakSet();
26043
+ function markInstanceSubReadFailure(err) {
26044
+ if (typeof err === "object" && err !== null) instanceSubReadFailures.add(err);
26045
+ }
26046
+ function isInstanceSubReadFailure(err) {
26047
+ return typeof err === "object" && err !== null && instanceSubReadFailures.has(err);
26048
+ }
26049
+ async function readInstanceDetails(physicalId, instance, properties) {
25572
26050
  const result = {};
25573
26051
  if (instance.ImageId !== void 0) result["ImageId"] = instance.ImageId;
25574
26052
  if (instance.InstanceType !== void 0) result["InstanceType"] = instance.InstanceType;
25575
26053
  if (instance.KeyName !== void 0) result["KeyName"] = instance.KeyName;
25576
26054
  if (instance.SubnetId !== void 0) result["SubnetId"] = instance.SubnetId;
25577
26055
  result["SecurityGroupIds"] = (instance.SecurityGroups ?? []).map((g) => g.GroupId).filter((id) => typeof id === "string").sort();
26056
+ if (properties?.["SecurityGroups"] != null) result["SecurityGroups"] = inDeclaredOrder((instance.SecurityGroups ?? []).flatMap((g) => typeof g.GroupName === "string" ? [g.GroupName] : []), (name) => name, Array.isArray(properties["SecurityGroups"]) ? properties["SecurityGroups"] : void 0);
25578
26057
  if (instance.PrivateIpAddress !== void 0) result["PrivateIpAddress"] = instance.PrivateIpAddress;
25579
26058
  if (instance.SourceDestCheck !== void 0) result["SourceDestCheck"] = instance.SourceDestCheck;
25580
26059
  if (instance.Placement?.AvailabilityZone !== void 0) result["AvailabilityZone"] = instance.Placement.AvailabilityZone;
@@ -25618,15 +26097,12 @@ async function readInstanceCurrentState(physicalId, properties) {
25618
26097
  for (const [key, value] of placementReads) if (typeof value === "string" && value !== "") result[key] = value;
25619
26098
  if (instance.EnclaveOptions?.Enabled !== void 0) result["EnclaveOptions"] = { Enabled: instance.EnclaveOptions.Enabled };
25620
26099
  if (instance.IamInstanceProfile?.Arn !== void 0) result["IamInstanceProfile"] = instance.IamInstanceProfile.Arn;
25621
- else if (process.env["CDKD_NO_WAIT"] === "true" && instance.State?.Name === "pending") try {
26100
+ else if (process.env["CDKD_NO_WAIT"] === "true" && instance.State?.Name === "pending") {
25622
26101
  const live = (await this.ec2Client.send(new DescribeIamInstanceProfileAssociationsCommand({ Filters: [{
25623
26102
  Name: "instance-id",
25624
26103
  Values: [physicalId]
25625
26104
  }] }))).IamInstanceProfileAssociations?.find((a) => a.State === "associated" || a.State === "associating");
25626
26105
  if (live?.IamInstanceProfile?.Arn !== void 0) result["IamInstanceProfile"] = live.IamInstanceProfile.Arn;
25627
- } catch (error) {
25628
- const backfillHead = `Could not backfill IamInstanceProfile for ${physicalId} during the --no-wait capture: `;
25629
- this.logger.warn(`${backfillHead}${this.warnFailureSentence(backfillHead, error, (t) => t)} The field is omitted from the observed snapshot.`);
25630
26106
  }
25631
26107
  const volumeIds = (instance.BlockDeviceMappings ?? []).filter((m) => m.Ebs?.VolumeId !== void 0).map((m) => m.Ebs.VolumeId);
25632
26108
  let volumesById = /* @__PURE__ */ new Map();
@@ -25634,7 +26110,7 @@ async function readInstanceCurrentState(physicalId, properties) {
25634
26110
  const volResp = await this.ec2Client.send(new DescribeVolumesCommand({ VolumeIds: volumeIds }));
25635
26111
  for (const v of volResp.Volumes ?? []) if (v.VolumeId !== void 0) volumesById.set(v.VolumeId, v);
25636
26112
  } catch (err) {
25637
- this.logger.debug(`DescribeVolumes(${volumeIds.join(",")}) failed: ${describeAwsFailure(err).detail}`);
26113
+ if (!isNamedError(err, INVALID_VOLUME_NOT_FOUND)) throw err;
25638
26114
  volumesById = /* @__PURE__ */ new Map();
25639
26115
  }
25640
26116
  const blockMappings = [];
@@ -25668,10 +26144,7 @@ async function readInstanceCurrentState(physicalId, properties) {
25668
26144
  VolumeId: m.Ebs.VolumeId
25669
26145
  }));
25670
26146
  }
25671
- if (Array.isArray(properties?.["SsmAssociations"]) && instanceSsmAssociationsRefusal(properties["SsmAssociations"], "AWS::EC2::Instance") === void 0) {
25672
- const read = await this.readInstanceSsmAssociations(physicalId, instanceSsmAssociationEntries(properties["SsmAssociations"]));
25673
- if (read !== void 0) result["SsmAssociations"] = read;
25674
- }
26147
+ if (Array.isArray(properties?.["SsmAssociations"]) && instanceSsmAssociationsRefusal(properties["SsmAssociations"], "AWS::EC2::Instance") === void 0) result["SsmAssociations"] = await this.readInstanceSsmAssociations(physicalId, instanceSsmAssociationEntries(properties["SsmAssociations"]));
25675
26148
  result["Tags"] = normalizeAwsTagsToCfn(instance.Tags);
25676
26149
  try {
25677
26150
  const attrResp = await this.ec2Client.send(new DescribeInstanceAttributeCommand({
@@ -25680,7 +26153,14 @@ async function readInstanceCurrentState(physicalId, properties) {
25680
26153
  }));
25681
26154
  if (attrResp.DisableApiTermination?.Value !== void 0) result["DisableApiTermination"] = attrResp.DisableApiTermination.Value;
25682
26155
  } catch (err) {
25683
- this.logger.debug(`DescribeInstanceAttribute(disableApiTermination, ${physicalId}) failed: ${describeAwsFailure(err).detail}`);
26156
+ if (!isNamedError(err, INVALID_INSTANCE_NOT_FOUND)) throw err;
26157
+ }
26158
+ if (properties?.["UserData"] != null && !carriesSecretMask(properties["UserData"])) {
26159
+ const attrResp = await this.ec2Client.send(new DescribeInstanceAttributeCommand({
26160
+ InstanceId: physicalId,
26161
+ Attribute: "userData"
26162
+ }));
26163
+ if (attrResp.UserData?.Value !== void 0) result["UserData"] = attrResp.UserData.Value;
25684
26164
  }
25685
26165
  if (properties?.["InstanceInitiatedShutdownBehavior"] !== void 0) try {
25686
26166
  const attrResp = await this.ec2Client.send(new DescribeInstanceAttributeCommand({
@@ -25689,13 +26169,13 @@ async function readInstanceCurrentState(physicalId, properties) {
25689
26169
  }));
25690
26170
  if (attrResp.InstanceInitiatedShutdownBehavior?.Value !== void 0) result["InstanceInitiatedShutdownBehavior"] = attrResp.InstanceInitiatedShutdownBehavior.Value;
25691
26171
  } catch (err) {
25692
- this.logger.debug(safeMsg`DescribeInstanceAttribute(instanceInitiatedShutdownBehavior, ${physicalId}) failed: ${describeAwsFailure(err).detail}`);
26172
+ if (!isNamedError(err, INVALID_INSTANCE_NOT_FOUND)) throw err;
25693
26173
  }
25694
26174
  try {
25695
26175
  const cpuCredits = (await this.ec2Client.send(new DescribeInstanceCreditSpecificationsCommand({ InstanceIds: [physicalId] }))).InstanceCreditSpecifications?.[0]?.CpuCredits;
25696
26176
  if (cpuCredits !== void 0) result["CreditSpecification"] = { CPUCredits: cpuCredits };
25697
26177
  } catch (err) {
25698
- this.logger.debug(`DescribeInstanceCreditSpecifications(${physicalId}) failed: ${describeAwsFailure(err).detail}`);
26178
+ if (!isNamedError(err, CREDIT_SPECIFICATION_NOT_APPLICABLE)) throw err;
25699
26179
  }
25700
26180
  return result;
25701
26181
  }
@@ -25788,7 +26268,7 @@ function canonicalizeUnsettledProperties$1(resourceType, properties) {
25788
26268
  [key]: canonical
25789
26269
  };
25790
26270
  }
25791
- async function readCurrentState$30(physicalId, logicalId, resourceType, properties, context) {
26271
+ async function readCurrentState$32(physicalId, logicalId, resourceType, properties, context) {
25792
26272
  const attempts = context?.afterOwnWrite === true ? 5 : 1;
25793
26273
  for (let attempt = 1;; attempt++) {
25794
26274
  const read = await this.readCurrentStateOnce(physicalId, logicalId, resourceType, properties, context);
@@ -25797,17 +26277,18 @@ async function readCurrentState$30(physicalId, logicalId, resourceType, properti
25797
26277
  }
25798
26278
  }
25799
26279
  async function readCurrentStateOnce(physicalId, logicalId, resourceType, properties, context) {
26280
+ const ownWrite = context?.afterOwnWrite === true;
25800
26281
  try {
25801
26282
  switch (resourceType) {
25802
- case "AWS::EC2::VPC": return await this.readVpcCurrentState(physicalId, properties);
25803
- case "AWS::EC2::Subnet": return await this.readSubnetCurrentState(physicalId, void 0, properties);
25804
- case "AWS::EC2::InternetGateway": return await this.readInternetGatewayCurrentState(physicalId);
25805
- case "AWS::EC2::NatGateway": return await this.readNatGatewayCurrentState(physicalId, properties);
25806
- case "AWS::EC2::RouteTable": return await this.readRouteTableCurrentState(physicalId);
26283
+ case "AWS::EC2::VPC": return await this.readVpcCurrentState(physicalId, properties, ownWrite);
26284
+ case "AWS::EC2::Subnet": return await this.readSubnetCurrentState(physicalId, void 0, properties, ownWrite);
26285
+ case "AWS::EC2::InternetGateway": return await this.readInternetGatewayCurrentState(physicalId, properties, ownWrite);
26286
+ case "AWS::EC2::NatGateway": return await this.readNatGatewayCurrentState(physicalId, properties, ownWrite);
26287
+ case "AWS::EC2::RouteTable": return await this.readRouteTableCurrentState(physicalId, properties, ownWrite);
25807
26288
  case "AWS::EC2::SecurityGroup": return await this.readSecurityGroupCurrentState(physicalId, properties, context);
25808
26289
  case "AWS::EC2::Instance": return await this.readInstanceCurrentState(physicalId, properties);
25809
- case "AWS::EC2::NetworkAcl": return await this.readNetworkAclCurrentState(physicalId);
25810
- case "AWS::EC2::EIP": return await this.readEipCurrentState(physicalId, properties, context?.afterOwnWrite === true);
26290
+ case "AWS::EC2::NetworkAcl": return await this.readNetworkAclCurrentState(physicalId, properties, ownWrite);
26291
+ case "AWS::EC2::EIP": return await this.readEipCurrentState(physicalId, properties, ownWrite);
25811
26292
  case "AWS::EC2::VPCGatewayAttachment": return await this.readVpcGatewayAttachmentCurrentState(physicalId, properties);
25812
26293
  case "AWS::EC2::Route": return await this.readRouteCurrentState(physicalId);
25813
26294
  case "AWS::EC2::SubnetRouteTableAssociation": return await this.readSubnetRouteTableAssociationCurrentState(physicalId);
@@ -25819,6 +26300,7 @@ async function readCurrentStateOnce(physicalId, logicalId, resourceType, propert
25819
26300
  return;
25820
26301
  }
25821
26302
  } catch (err) {
26303
+ if (isInstanceSubReadFailure(err)) throw err;
25822
26304
  if (isEc2NotFoundCode(err)) return RESOURCE_NOT_FOUND;
25823
26305
  if (this.isNotFoundError(err)) return void 0;
25824
26306
  throw err;
@@ -25833,7 +26315,8 @@ function getDriftUnknownPaths$10(resourceType, properties) {
25833
26315
  "Ipv6AddressCount",
25834
26316
  "Ipv6Addresses",
25835
26317
  "LaunchTemplate",
25836
- "LicenseSpecifications"
26318
+ "LicenseSpecifications",
26319
+ ...carriesSecretMask(properties?.["UserData"]) ? ["UserData"] : []
25837
26320
  ];
25838
26321
  case "AWS::EC2::VPC": {
25839
26322
  const control = properties?.["VpcEncryptionControl"];
@@ -25909,14 +26392,93 @@ const driftMethods = {
25909
26392
  readUnsettled: readUnsettled$5,
25910
26393
  canonicalizeDriftPair: canonicalizeDriftPair$4,
25911
26394
  canonicalizeUnsettledProperties: canonicalizeUnsettledProperties$1,
25912
- readCurrentState: readCurrentState$30,
26395
+ readCurrentState: readCurrentState$32,
25913
26396
  readCurrentStateOnce,
25914
26397
  getDriftUnknownPaths: getDriftUnknownPaths$10,
25915
26398
  canonicalizeDesiredProperties: canonicalizeDesiredProperties$2
25916
26399
  };
25917
26400
 
26401
+ // src/provisioning/providers/ec2/read-network-state.ts
26402
+ function readbackEc2Tags(awsTags, properties, afterOwnWrite) {
26403
+ const tags = normalizeAwsTagsToCfn(awsTags);
26404
+ const declared = properties?.["Tags"];
26405
+ if (afterOwnWrite && properties !== void 0 && declared == null) return void 0;
26406
+ const bag = afterOwnWrite && Array.isArray(declared) && !tagListsMatch(tags, declared) ? declared : tags;
26407
+ return bag.length > 0 ? bag : void 0;
26408
+ }
26409
+ async function readInternetGatewayCurrentState(physicalId, properties, afterOwnWrite = false) {
26410
+ const igw = (await this.ec2Client.send(new DescribeInternetGatewaysCommand({ InternetGatewayIds: [physicalId] }))).InternetGateways?.[0];
26411
+ if (!igw) return RESOURCE_NOT_FOUND;
26412
+ const result = {};
26413
+ const tags = readbackEc2Tags(igw.Tags, properties, afterOwnWrite);
26414
+ if (tags !== void 0) result["Tags"] = tags;
26415
+ return result;
26416
+ }
26417
+ async function readNatGatewayCurrentState(physicalId, properties, afterOwnWrite = false) {
26418
+ const gw = (await this.ec2Client.send(new DescribeNatGatewaysCommand({ NatGatewayIds: [physicalId] }))).NatGateways?.find((g) => g.State !== "deleted" && g.State !== "deleting");
26419
+ if (!gw) return RESOURCE_NOT_FOUND;
26420
+ const result = {};
26421
+ if (gw.SubnetId !== void 0) result["SubnetId"] = gw.SubnetId;
26422
+ if (gw.ConnectivityType !== void 0) result["ConnectivityType"] = gw.ConnectivityType;
26423
+ const regional = gw.AvailabilityMode === "regional";
26424
+ const primary = gw.NatGatewayAddresses?.find((a) => a.IsPrimary === true) ?? gw.NatGatewayAddresses?.[0];
26425
+ if (primary?.AllocationId !== void 0 && (!regional || properties?.["AllocationId"] != null)) result["AllocationId"] = primary.AllocationId;
26426
+ if (primary?.PrivateIp !== void 0 && (!regional || properties?.["PrivateIpAddress"] != null)) result["PrivateIpAddress"] = primary.PrivateIp;
26427
+ if (!regional) Object.assign(result, natSecondaryAddresses(gw.NatGatewayAddresses ?? [], primary, properties));
26428
+ if (gw.AvailabilityMode !== void 0) result["AvailabilityMode"] = gw.AvailabilityMode;
26429
+ if (gw.VpcId !== void 0) result["VpcId"] = gw.VpcId;
26430
+ if (gw.AvailabilityMode === "regional" && gw.AutoProvisionZones === "disabled") {
26431
+ const recorded = readNatZoneAddresses(properties?.["AvailabilityZoneAddresses"]);
26432
+ result["AvailabilityZoneAddresses"] = readbackNatZoneAddresses(gw.NatGatewayAddresses ?? [], recorded.kind === "usable" ? recorded.entries : []);
26433
+ }
26434
+ const tags = readbackEc2Tags(gw.Tags, properties, afterOwnWrite);
26435
+ if (tags !== void 0) result["Tags"] = tags;
26436
+ return result;
26437
+ }
26438
+ const LEAVING_ADDRESS_STATUSES = /* @__PURE__ */ new Set([
26439
+ "unassigning",
26440
+ "disassociating",
26441
+ "failed"
26442
+ ]);
26443
+ function natSecondaryAddresses(addresses, primary, properties) {
26444
+ const secondary = addresses.filter((a) => a !== primary && !LEAVING_ADDRESS_STATUSES.has(a.Status ?? ""));
26445
+ const declared = (key) => {
26446
+ const value = properties?.[key];
26447
+ return Array.isArray(value) ? value : void 0;
26448
+ };
26449
+ const out = {};
26450
+ if (properties?.["SecondaryAllocationIds"] != null) out["SecondaryAllocationIds"] = inDeclaredOrder(secondary.flatMap((a) => a.AllocationId !== void 0 ? [a.AllocationId] : []), (id) => id, declared("SecondaryAllocationIds"));
26451
+ if (properties?.["SecondaryPrivateIpAddresses"] != null) out["SecondaryPrivateIpAddresses"] = inDeclaredOrder(secondary.flatMap((a) => a.PrivateIp !== void 0 ? [a.PrivateIp] : []), (ip) => ip, declared("SecondaryPrivateIpAddresses"));
26452
+ if (properties?.["SecondaryPrivateIpAddressCount"] != null) out["SecondaryPrivateIpAddressCount"] = secondary.filter((a) => a.PrivateIp !== void 0).length;
26453
+ return out;
26454
+ }
26455
+ async function readRouteTableCurrentState(physicalId, properties, afterOwnWrite = false) {
26456
+ const rt = (await this.ec2Client.send(new DescribeRouteTablesCommand({ RouteTableIds: [physicalId] }))).RouteTables?.[0];
26457
+ if (!rt) return RESOURCE_NOT_FOUND;
26458
+ const result = {};
26459
+ if (rt.VpcId !== void 0) result["VpcId"] = rt.VpcId;
26460
+ const tags = readbackEc2Tags(rt.Tags, properties, afterOwnWrite);
26461
+ if (tags !== void 0) result["Tags"] = tags;
26462
+ return result;
26463
+ }
26464
+ async function readNetworkAclCurrentState(physicalId, properties, afterOwnWrite = false) {
26465
+ const acl = (await this.ec2Client.send(new DescribeNetworkAclsCommand({ NetworkAclIds: [physicalId] }))).NetworkAcls?.[0];
26466
+ if (!acl) return RESOURCE_NOT_FOUND;
26467
+ const result = {};
26468
+ if (acl.VpcId !== void 0) result["VpcId"] = acl.VpcId;
26469
+ const tags = readbackEc2Tags(acl.Tags, properties, afterOwnWrite);
26470
+ if (tags !== void 0) result["Tags"] = tags;
26471
+ return result;
26472
+ }
26473
+ const readNetworkStateMethods = {
26474
+ readInternetGatewayCurrentState,
26475
+ readNatGatewayCurrentState,
26476
+ readRouteTableCurrentState,
26477
+ readNetworkAclCurrentState
26478
+ };
26479
+
25918
26480
  // src/provisioning/providers/ec2/read-state.ts
25919
- async function readVpcCurrentState(physicalId, properties) {
26481
+ async function readVpcCurrentState(physicalId, properties, afterOwnWrite = false) {
25920
26482
  const vpc = (await this.ec2Client.send(new DescribeVpcsCommand({ VpcIds: [physicalId] }))).Vpcs?.[0];
25921
26483
  if (!vpc) return RESOURCE_NOT_FOUND;
25922
26484
  const result = {};
@@ -25937,6 +26499,8 @@ async function readVpcCurrentState(physicalId, properties) {
25937
26499
  }
25938
26500
  result["VpcEncryptionControl"] = out;
25939
26501
  }
26502
+ const tags = readbackEc2Tags(vpc.Tags, properties, afterOwnWrite);
26503
+ if (tags !== void 0) result["Tags"] = tags;
25940
26504
  try {
25941
26505
  const dnsHost = await this.ec2Client.send(new DescribeVpcAttributeCommand({
25942
26506
  VpcId: physicalId,
@@ -25957,7 +26521,7 @@ async function readVpcCurrentState(physicalId, properties) {
25957
26521
  }
25958
26522
  return result;
25959
26523
  }
25960
- async function readSubnetCurrentState(physicalId, unsettledNames, properties) {
26524
+ async function readSubnetCurrentState(physicalId, unsettledNames, properties, afterOwnWrite = false) {
25961
26525
  const subnet = (await this.ec2Client.send(new DescribeSubnetsCommand({ SubnetIds: [physicalId] }))).Subnets?.[0];
25962
26526
  if (!subnet) return RESOURCE_NOT_FOUND;
25963
26527
  if (unsettledNames?.has("Ipv6CidrBlock") && this.subnetIpv6InTransition(subnet)) throw new Error("Subnet IPv6 association is still in transition; retry after it has settled");
@@ -25983,28 +26547,8 @@ async function readSubnetCurrentState(physicalId, unsettledNames, properties) {
25983
26547
  for (const { member } of SUBNET_PRIVATE_DNS_MEMBERS) if (dns[member] !== void 0) block[member] = dns[member];
25984
26548
  result["PrivateDnsNameOptionsOnLaunch"] = block;
25985
26549
  }
25986
- return result;
25987
- }
25988
- async function readInternetGatewayCurrentState(physicalId) {
25989
- if (!(await this.ec2Client.send(new DescribeInternetGatewaysCommand({ InternetGatewayIds: [physicalId] }))).InternetGateways?.[0]) return RESOURCE_NOT_FOUND;
25990
- return {};
25991
- }
25992
- async function readNatGatewayCurrentState(physicalId, properties) {
25993
- const gw = (await this.ec2Client.send(new DescribeNatGatewaysCommand({ NatGatewayIds: [physicalId] }))).NatGateways?.find((g) => g.State !== "deleted" && g.State !== "deleting");
25994
- if (!gw) return RESOURCE_NOT_FOUND;
25995
- const result = {};
25996
- if (gw.SubnetId !== void 0) result["SubnetId"] = gw.SubnetId;
25997
- if (gw.ConnectivityType !== void 0) result["ConnectivityType"] = gw.ConnectivityType;
25998
- const regional = gw.AvailabilityMode === "regional";
25999
- const primary = gw.NatGatewayAddresses?.find((a) => a.IsPrimary === true) ?? gw.NatGatewayAddresses?.[0];
26000
- if (primary?.AllocationId !== void 0 && (!regional || properties?.["AllocationId"] != null)) result["AllocationId"] = primary.AllocationId;
26001
- if (primary?.PrivateIp !== void 0 && (!regional || properties?.["PrivateIpAddress"] != null)) result["PrivateIpAddress"] = primary.PrivateIp;
26002
- if (gw.AvailabilityMode !== void 0) result["AvailabilityMode"] = gw.AvailabilityMode;
26003
- if (gw.VpcId !== void 0) result["VpcId"] = gw.VpcId;
26004
- if (gw.AvailabilityMode === "regional" && gw.AutoProvisionZones === "disabled") {
26005
- const recorded = readNatZoneAddresses(properties?.["AvailabilityZoneAddresses"]);
26006
- result["AvailabilityZoneAddresses"] = readbackNatZoneAddresses(gw.NatGatewayAddresses ?? [], recorded.kind === "usable" ? recorded.entries : []);
26007
- }
26550
+ const tags = readbackEc2Tags(subnet.Tags, properties, afterOwnWrite);
26551
+ if (tags !== void 0) result["Tags"] = tags;
26008
26552
  return result;
26009
26553
  }
26010
26554
  async function readEipCurrentState(physicalId, properties, afterOwnWrite) {
@@ -26017,17 +26561,8 @@ async function readEipCurrentState(physicalId, properties, afterOwnWrite) {
26017
26561
  if (addr.InstanceId !== void 0 && properties?.["InstanceId"] != null) result["InstanceId"] = addr.InstanceId;
26018
26562
  if (addr.NetworkBorderGroup !== void 0) result["NetworkBorderGroup"] = addr.NetworkBorderGroup;
26019
26563
  if (addr.PublicIpv4Pool !== void 0) result["PublicIpv4Pool"] = addr.PublicIpv4Pool;
26020
- const tags = normalizeAwsTagsToCfn(addr.Tags);
26021
- const declared = properties?.["Tags"];
26022
- const bag = afterOwnWrite && Array.isArray(declared) && !tagListsMatch(tags, declared) ? declared : tags;
26023
- if (bag.length > 0) result["Tags"] = bag;
26024
- return result;
26025
- }
26026
- async function readRouteTableCurrentState(physicalId) {
26027
- const rt = (await this.ec2Client.send(new DescribeRouteTablesCommand({ RouteTableIds: [physicalId] }))).RouteTables?.[0];
26028
- if (!rt) return RESOURCE_NOT_FOUND;
26029
- const result = {};
26030
- if (rt.VpcId !== void 0) result["VpcId"] = rt.VpcId;
26564
+ const tags = readbackEc2Tags(addr.Tags, properties, afterOwnWrite);
26565
+ if (tags !== void 0) result["Tags"] = tags;
26031
26566
  return result;
26032
26567
  }
26033
26568
  async function readSecurityGroupCurrentState(physicalId, properties, context) {
@@ -26071,20 +26606,12 @@ function sgRuleLists(sg, physicalId, properties, context, idOwned) {
26071
26606
  const stateIngress = Array.isArray(properties?.["SecurityGroupIngress"]) ? properties["SecurityGroupIngress"] : void 0;
26072
26607
  const ingressRules = withoutSiblingOwnedSgRules(flattenIpPermissions(sg.IpPermissions ?? [], "ingress"), owned("ingress"), "ingress");
26073
26608
  const stateEgress = Array.isArray(properties?.["SecurityGroupEgress"]) ? properties["SecurityGroupEgress"] : void 0;
26074
- let egressRules = withoutSiblingOwnedSgRules(flattenIpPermissions(sg.IpPermissionsEgress ?? [], "egress"), owned("egress"), "egress");
26075
- if (stateEgress === void 0) egressRules = egressRules.filter((r) => !isDefaultEgressRule(r));
26609
+ const egressRules = withoutSiblingOwnedSgRules(flattenIpPermissions(sg.IpPermissionsEgress ?? [], "egress"), owned("egress"), "egress");
26076
26610
  return {
26077
26611
  SecurityGroupIngress: reconcileSgRules(ingressRules, stateIngress, "ingress"),
26078
26612
  SecurityGroupEgress: reconcileSgRules(egressRules, stateEgress, "egress")
26079
26613
  };
26080
26614
  }
26081
- async function readNetworkAclCurrentState(physicalId) {
26082
- const acl = (await this.ec2Client.send(new DescribeNetworkAclsCommand({ NetworkAclIds: [physicalId] }))).NetworkAcls?.[0];
26083
- if (!acl) return RESOURCE_NOT_FOUND;
26084
- const result = {};
26085
- if (acl.VpcId !== void 0) result["VpcId"] = acl.VpcId;
26086
- return result;
26087
- }
26088
26615
  async function readVpcGatewayAttachmentCurrentState(physicalId, properties) {
26089
26616
  const parts = physicalId.split("|");
26090
26617
  const [first, vpcId] = parts;
@@ -26224,6 +26751,7 @@ async function readSgIngressByIdentity(groupId, flat, properties, context) {
26224
26751
  try {
26225
26752
  owned = (await this.ec2Client.send(new DescribeSecurityGroupRulesCommand({ SecurityGroupRuleIds: [recordedId] }))).SecurityGroupRules?.find((r) => r.SecurityGroupRuleId === recordedId);
26226
26753
  } catch (err) {
26754
+ if (!(isEc2NotFoundCode(err) || err?.name === "InvalidSecurityGroupRuleId.Malformed")) throw err;
26227
26755
  this.logger.debug(safeMsg`readCurrentState: recorded rule ${recordedId} could not be read (${describeAwsFailure(err).summary}); the ingress rule stays unknown`);
26228
26756
  return;
26229
26757
  }
@@ -26292,12 +26820,8 @@ async function readSubnetNetworkAclAssociationCurrentState(physicalId) {
26292
26820
  const readStateMethods = {
26293
26821
  readVpcCurrentState,
26294
26822
  readSubnetCurrentState,
26295
- readInternetGatewayCurrentState,
26296
- readNatGatewayCurrentState,
26297
26823
  readEipCurrentState,
26298
- readRouteTableCurrentState,
26299
26824
  readSecurityGroupCurrentState,
26300
- readNetworkAclCurrentState,
26301
26825
  readVpcGatewayAttachmentCurrentState,
26302
26826
  readRouteCurrentState,
26303
26827
  readSubnetRouteTableAssociationCurrentState,
@@ -26845,6 +27369,7 @@ for (const methods of [
26845
27369
  tagsErrorsMethods,
26846
27370
  driftMethods,
26847
27371
  readStateMethods,
27372
+ readNetworkStateMethods,
26848
27373
  readInstanceStateMethods,
26849
27374
  verifyExplicitMethods
26850
27375
  ]) for (const [name, value] of Object.entries(methods)) Object.defineProperty(EC2Provider.prototype, name, {
@@ -28800,7 +29325,7 @@ function getDriftUnorderedPaths$6(resourceType) {
28800
29325
  if (resourceType === "AWS::ApiGateway::RestApi") return ["BinaryMediaTypes"];
28801
29326
  return [];
28802
29327
  }
28803
- async function readCurrentState$29(physicalId, _logicalId, resourceType, properties) {
29328
+ async function readCurrentState$31(physicalId, _logicalId, resourceType, properties) {
28804
29329
  switch (resourceType) {
28805
29330
  case "AWS::ApiGateway::Account": return this.readCurrentStateAccount();
28806
29331
  case "AWS::ApiGateway::Method": return this.readCurrentStateMethod(physicalId);
@@ -29204,7 +29729,7 @@ var ApiGatewayProvider = class {
29204
29729
  }
29205
29730
  readCurrentState(physicalId, _logicalId, resourceType, properties, context) {
29206
29731
  if (resourceType === "AWS::ApiGateway::RestApi") return this.readCurrentStateRestApi(physicalId, properties, context, _logicalId);
29207
- return readCurrentState$29.call(this, physicalId, _logicalId, resourceType, properties);
29732
+ return readCurrentState$31.call(this, physicalId, _logicalId, resourceType, properties);
29208
29733
  }
29209
29734
  readCurrentStateAuthorizer(physicalId, properties) {
29210
29735
  return readCurrentStateAuthorizer.call(this, physicalId, properties);
@@ -29365,7 +29890,7 @@ async function canonicalizeDriftPair$3(resourceType, baseline, aws, properties =
29365
29890
  aws
29366
29891
  };
29367
29892
  }
29368
- async function readCurrentState$28(physicalId, _logicalId, resourceType, properties) {
29893
+ async function readCurrentState$30(physicalId, _logicalId, resourceType, properties) {
29369
29894
  switch (resourceType) {
29370
29895
  case "AWS::ApiGatewayV2::Api": return this.readApi(physicalId);
29371
29896
  case "AWS::ApiGatewayV2::Stage": return this.readStage(physicalId, properties);
@@ -30780,7 +31305,7 @@ var ApiGatewayV2Provider = class {
30780
31305
  return canonicalizeDriftPair$3.call(this, resourceType, baseline, aws, properties);
30781
31306
  }
30782
31307
  readCurrentState(physicalId, _logicalId, resourceType, properties) {
30783
- return readCurrentState$28.call(this, physicalId, _logicalId, resourceType, properties);
31308
+ return readCurrentState$30.call(this, physicalId, _logicalId, resourceType, properties);
30784
31309
  }
30785
31310
  readApi(physicalId) {
30786
31311
  return readApi.call(this, physicalId);
@@ -31460,7 +31985,7 @@ async function waitForDistributionStable(distributionId, expectedEnabled) {
31460
31985
  }
31461
31986
 
31462
31987
  // src/provisioning/providers/cloudfront-distribution/read-state.ts
31463
- async function readCurrentState$27(physicalId, _logicalId, resourceType, _properties) {
31988
+ async function readCurrentState$29(physicalId, _logicalId, resourceType, _properties) {
31464
31989
  if (resourceType !== "AWS::CloudFront::Distribution") return void 0;
31465
31990
  let config;
31466
31991
  try {
@@ -31481,6 +32006,7 @@ async function readCurrentState$27(physicalId, _logicalId, resourceType, _proper
31481
32006
  if (cfnTags.length > 0) result["Tags"] = cfnTags;
31482
32007
  }
31483
32008
  } catch (error) {
32009
+ if (!(error instanceof NoSuchDistribution) && !(error instanceof NoSuchResource)) throw error;
31484
32010
  this.logger.debug(`Tag read for CloudFront Distribution ${physicalId} failed during drift read: ${describeAwsFailure(error).detail}`);
31485
32011
  }
31486
32012
  return result;
@@ -31951,7 +32477,7 @@ var CloudFrontDistributionProvider = class {
31951
32477
  return deleteImpl$27.call(this, logicalId, physicalId, resourceType, _properties, context);
31952
32478
  }
31953
32479
  readCurrentState(physicalId, _logicalId, resourceType, _properties) {
31954
- return readCurrentState$27.call(this, physicalId, _logicalId, resourceType, _properties);
32480
+ return readCurrentState$29.call(this, physicalId, _logicalId, resourceType, _properties);
31955
32481
  }
31956
32482
  getDriftUnknownPaths(resourceType) {
31957
32483
  return getDriftUnknownPaths$7.call(this, resourceType);
@@ -32054,7 +32580,7 @@ function isUserTagKey(key) {
32054
32580
  }
32055
32581
 
32056
32582
  // src/provisioning/providers/agentcore-runtime/read-state.ts
32057
- async function readCurrentState$26(physicalId, _logicalId, _resourceType) {
32583
+ async function readCurrentState$28(physicalId, _logicalId, _resourceType) {
32058
32584
  let resp;
32059
32585
  try {
32060
32586
  resp = await this.client.send(new GetAgentRuntimeCommand({ agentRuntimeId: physicalId }));
@@ -32087,6 +32613,7 @@ async function readCurrentState$26(physicalId, _logicalId, _resourceType) {
32087
32613
  const tagsResp = await this.client.send(new ListTagsForResourceCommand$6({ resourceArn: resp.agentRuntimeArn }));
32088
32614
  result["Tags"] = Object.fromEntries(Object.entries(tagsResp.tags ?? {}).filter(([k]) => isUserTagKey(k)));
32089
32615
  } catch (err) {
32616
+ if (!(err instanceof ResourceNotFoundException$6)) throw err;
32090
32617
  this.logger.debug(safeMsg`Failed to read tags for runtime ${physicalId}: ${describeAwsFailure(err).detail}`);
32091
32618
  }
32092
32619
  return result;
@@ -32470,7 +32997,7 @@ var AgentCoreRuntimeProvider = class {
32470
32997
  }
32471
32998
  }
32472
32999
  readCurrentState(physicalId, logicalId, resourceType) {
32473
- return readCurrentState$26.call(this, physicalId, logicalId, resourceType);
33000
+ return readCurrentState$28.call(this, physicalId, logicalId, resourceType);
32474
33001
  }
32475
33002
  import(input) {
32476
33003
  return importImpl$27.call(this, input);
@@ -32817,6 +33344,7 @@ var AgentCoreEvaluatorProvider = class {
32817
33344
  try {
32818
33345
  result["Tags"] = tagMapToCfnList((await this.client.send(new ListTagsForResourceCommand$6({ resourceArn: physicalId }))).tags ?? {});
32819
33346
  } catch (err) {
33347
+ if (!(err instanceof ResourceNotFoundException$6)) throw err;
32820
33348
  this.logger.debug(`Failed to read tags for evaluator ${physicalId}: ${describeAwsFailure(err).detail}`);
32821
33349
  }
32822
33350
  return result;
@@ -32966,7 +33494,7 @@ async function applyTagDiff$12(stateMachineArn, resourceType, logicalId, oldTags
32966
33494
  }
32967
33495
 
32968
33496
  // src/provisioning/providers/stepfunctions/read-state.ts
32969
- async function readCurrentState$25(physicalId, _logicalId, _resourceType) {
33497
+ async function readCurrentState$27(physicalId, _logicalId, _resourceType) {
32970
33498
  let resp;
32971
33499
  try {
32972
33500
  resp = await this.getClient().send(new DescribeStateMachineCommand({ stateMachineArn: physicalId }));
@@ -33233,7 +33761,7 @@ var StepFunctionsProvider = class {
33233
33761
  return [...new Set(aliases)];
33234
33762
  }
33235
33763
  readCurrentState(physicalId, _logicalId, _resourceType) {
33236
- return readCurrentState$25.call(this, physicalId, _logicalId, _resourceType);
33764
+ return readCurrentState$27.call(this, physicalId, _logicalId, _resourceType);
33237
33765
  }
33238
33766
  generatedCreateName(_resourceType, logicalId, properties) {
33239
33767
  if (properties["StateMachineName"]) return void 0;
@@ -34953,7 +35481,7 @@ function getDriftUnknownPaths$6(resourceType) {
34953
35481
  ];
34954
35482
  return [];
34955
35483
  }
34956
- async function readCurrentState$24(physicalId, _logicalId, resourceType) {
35484
+ async function readCurrentState$26(physicalId, _logicalId, resourceType) {
34957
35485
  switch (resourceType) {
34958
35486
  case "AWS::ECS::Cluster": return this.readCurrentStateCluster(physicalId);
34959
35487
  case "AWS::ECS::Service": return this.readCurrentStateService(physicalId);
@@ -34974,7 +35502,7 @@ async function readCurrentStateCluster(physicalId) {
34974
35502
  }));
34975
35503
  } catch (err) {
34976
35504
  if (isEcsErrorNamed(err, ["ClusterNotFoundException"])) return RESOURCE_NOT_FOUND;
34977
- return;
35505
+ throw err;
34978
35506
  }
34979
35507
  const c = resp.clusters?.[0];
34980
35508
  if (!c || !c.clusterName) return describeListedNothingGone(resp.failures) ? RESOURCE_NOT_FOUND : void 0;
@@ -35010,12 +35538,12 @@ async function readCurrentStateService(physicalId) {
35010
35538
  include: ["TAGS"]
35011
35539
  }));
35012
35540
  } catch (err) {
35013
- if (cluster !== void 0 && isEcsErrorNamed(err, [
35541
+ if (isEcsErrorNamed(err, [
35014
35542
  "ClusterNotFoundException",
35015
35543
  "ServiceNotFoundException",
35016
35544
  "ServiceNotActiveException"
35017
- ])) return RESOURCE_NOT_FOUND;
35018
- return;
35545
+ ])) return cluster !== void 0 ? RESOURCE_NOT_FOUND : void 0;
35546
+ throw err;
35019
35547
  }
35020
35548
  const s = resp.services?.[0];
35021
35549
  if (!s || !s.serviceName) return cluster !== void 0 && describeListedNothingGone(resp.failures) ? RESOURCE_NOT_FOUND : void 0;
@@ -35062,7 +35590,7 @@ async function readCurrentStateTaskDefinition(physicalId) {
35062
35590
  }));
35063
35591
  } catch (err) {
35064
35592
  if (isTaskDefinitionMissingError(err)) return RESOURCE_NOT_FOUND;
35065
- return;
35593
+ throw err;
35066
35594
  }
35067
35595
  const td = resp.taskDefinition;
35068
35596
  if (!td) return void 0;
@@ -35480,7 +36008,7 @@ var ECSProvider = class {
35480
36008
  return getDriftUnknownPaths$6.call(this, resourceType);
35481
36009
  }
35482
36010
  readCurrentState(physicalId, _logicalId, resourceType) {
35483
- return readCurrentState$24.call(this, physicalId, _logicalId, resourceType);
36011
+ return readCurrentState$26.call(this, physicalId, _logicalId, resourceType);
35484
36012
  }
35485
36013
  readCurrentStateCluster(physicalId) {
35486
36014
  return readCurrentStateCluster.call(this, physicalId);
@@ -36080,10 +36608,12 @@ async function updateLoadBalancer(logicalId, physicalId, resourceType, propertie
36080
36608
  const oldIpv6SourceNat = previousProperties["EnablePrefixForIpv6SourceNat"];
36081
36609
  const subnetsChanged = JSON.stringify(newSubnets) !== JSON.stringify(oldSubnets);
36082
36610
  const mappingsChanged = JSON.stringify(newMappings) !== JSON.stringify(oldMappings);
36083
- if (subnetsChanged || mappingsChanged || newIpv6SourceNat !== void 0 && newIpv6SourceNat !== oldIpv6SourceNat) {
36611
+ const ipv6SourceNatChanged = newIpv6SourceNat !== void 0 && newIpv6SourceNat !== oldIpv6SourceNat;
36612
+ const sendMappings = newMappings !== void 0 && newMappings.length > 0 && (mappingsChanged || !subnetsChanged);
36613
+ if (subnetsChanged || mappingsChanged || ipv6SourceNatChanged) {
36084
36614
  await this.getClient().send(new SetSubnetsCommand({
36085
36615
  LoadBalancerArn: physicalId,
36086
- ...newMappings && newMappings.length > 0 ? { SubnetMappings: newMappings } : { Subnets: newSubnets },
36616
+ ...sendMappings ? { SubnetMappings: newMappings } : { Subnets: newSubnets },
36087
36617
  ...newIpv6SourceNat !== void 0 && { EnablePrefixForIpv6SourceNat: newIpv6SourceNat }
36088
36618
  }));
36089
36619
  this.logger.debug(`Updated Subnets / SubnetMappings for ${logicalId}`);
@@ -36627,15 +37157,15 @@ function convertCertificates(certificates) {
36627
37157
  }
36628
37158
 
36629
37159
  // src/provisioning/providers/elbv2/read-state.ts
36630
- async function readCurrentState$23(physicalId, _logicalId, resourceType) {
37160
+ async function readCurrentState$25(physicalId, _logicalId, resourceType, properties) {
36631
37161
  switch (resourceType) {
36632
- case "AWS::ElasticLoadBalancingV2::LoadBalancer": return this.readLoadBalancer(physicalId);
37162
+ case "AWS::ElasticLoadBalancingV2::LoadBalancer": return this.readLoadBalancer(physicalId, properties);
36633
37163
  case "AWS::ElasticLoadBalancingV2::TargetGroup": return this.readTargetGroup(physicalId);
36634
37164
  case "AWS::ElasticLoadBalancingV2::Listener": return this.readListener(physicalId);
36635
37165
  default: return;
36636
37166
  }
36637
37167
  }
36638
- async function readLoadBalancer(physicalId) {
37168
+ async function readLoadBalancer(physicalId, properties) {
36639
37169
  let lb;
36640
37170
  try {
36641
37171
  lb = (await this.getClient().send(new DescribeLoadBalancersCommand({ LoadBalancerArns: [physicalId] }))).LoadBalancers?.[0];
@@ -36648,6 +37178,7 @@ async function readLoadBalancer(physicalId) {
36648
37178
  const result = {};
36649
37179
  if (lb.LoadBalancerName !== void 0) result["Name"] = lb.LoadBalancerName;
36650
37180
  result["Subnets"] = (lb.AvailabilityZones ?? []).map((az) => az.SubnetId).filter((id) => !!id);
37181
+ if (properties?.["SubnetMappings"] != null) result["SubnetMappings"] = readbackSubnetMappings(lb.AvailabilityZones ?? [], properties["SubnetMappings"]);
36651
37182
  result["SecurityGroups"] = lb.SecurityGroups ? [...lb.SecurityGroups] : [];
36652
37183
  if (lb.Scheme !== void 0) result["Scheme"] = lb.Scheme;
36653
37184
  if (lb.Type !== void 0) result["Type"] = lb.Type;
@@ -36661,6 +37192,7 @@ async function readLoadBalancer(physicalId) {
36661
37192
  } catch (err) {
36662
37193
  if (isElbv2NotFoundName(err)) return RESOURCE_NOT_FOUND;
36663
37194
  if (this.isNotFoundError(err)) return void 0;
37195
+ if (lb.Type !== "gateway") throw err;
36664
37196
  }
36665
37197
  try {
36666
37198
  result["LoadBalancerAttributes"] = ((await this.getClient().send(new DescribeLoadBalancerAttributesCommand({ LoadBalancerArn: physicalId }))).Attributes ?? []).filter((a) => typeof a.Key === "string" && typeof a.Value === "string").map((a) => ({
@@ -36670,10 +37202,36 @@ async function readLoadBalancer(physicalId) {
36670
37202
  } catch (err) {
36671
37203
  if (isElbv2NotFoundName(err)) return RESOURCE_NOT_FOUND;
36672
37204
  if (this.isNotFoundError(err)) return void 0;
37205
+ throw err;
36673
37206
  }
36674
37207
  await this.attachTags(result, physicalId);
36675
37208
  return result;
36676
37209
  }
37210
+ const SUBNET_MAPPING_ADDRESS_MEMBERS = [
37211
+ "AllocationId",
37212
+ "PrivateIPv4Address",
37213
+ "IPv6Address"
37214
+ ];
37215
+ function readbackSubnetMappings(zones, declared) {
37216
+ const declaredEntries = (Array.isArray(declared) ? declared : []).filter((entry) => entry !== null && typeof entry === "object" && !Array.isArray(entry));
37217
+ const mappings = zones.flatMap((zone) => {
37218
+ if (zone.SubnetId === void 0) return [];
37219
+ const want = declaredEntries.find((entry) => entry["SubnetId"] === zone.SubnetId);
37220
+ const mapping = { SubnetId: zone.SubnetId };
37221
+ if (want === void 0) return [mapping];
37222
+ for (const member of SUBNET_MAPPING_ADDRESS_MEMBERS) {
37223
+ if (want[member] == null) continue;
37224
+ const value = zone.LoadBalancerAddresses?.find((a) => a[member] !== void 0)?.[member];
37225
+ if (value !== void 0) mapping[member] = value;
37226
+ }
37227
+ if (want["SourceNatIpv6Prefix"] != null) {
37228
+ const prefix = zone.SourceNatIpv6Prefixes?.[0];
37229
+ if (prefix !== void 0) mapping["SourceNatIpv6Prefix"] = want["SourceNatIpv6Prefix"] === "auto_assigned" ? "auto_assigned" : prefix;
37230
+ }
37231
+ return [mapping];
37232
+ });
37233
+ return inDeclaredOrder(mappings, (mapping) => mapping["SubnetId"], declaredEntries.map((entry) => entry["SubnetId"]));
37234
+ }
36677
37235
  async function readTargetGroup(physicalId) {
36678
37236
  let tg;
36679
37237
  try {
@@ -36713,6 +37271,7 @@ async function readTargetGroup(physicalId) {
36713
37271
  } catch (err) {
36714
37272
  if (isElbv2NotFoundName(err)) return RESOURCE_NOT_FOUND;
36715
37273
  if (this.isNotFoundError(err)) return void 0;
37274
+ throw err;
36716
37275
  }
36717
37276
  await this.attachRegisteredTargets(result, physicalId);
36718
37277
  await this.attachTags(result, physicalId);
@@ -36740,7 +37299,7 @@ async function attachRegisteredTargets(result, targetGroupArn) {
36740
37299
  }
36741
37300
  result["Targets"] = targets;
36742
37301
  } catch (err) {
36743
- this.logger.debug(`ELBv2 DescribeTargetHealth(${targetGroupArn}) failed: ${describeAwsFailure(err).detail}`);
37302
+ if (!isElbv2NotFoundName(err)) throw err;
36744
37303
  }
36745
37304
  }
36746
37305
  function getDriftUnknownPaths$5(resourceType, properties) {
@@ -36826,6 +37385,7 @@ async function readListener(physicalId) {
36826
37385
  } catch (err) {
36827
37386
  if (isElbv2NotFoundName(err)) return RESOURCE_NOT_FOUND;
36828
37387
  if (this.isNotFoundError(err)) return void 0;
37388
+ throw err;
36829
37389
  }
36830
37390
  await this.attachTags(result, physicalId);
36831
37391
  return result;
@@ -36835,7 +37395,7 @@ async function attachTags$2(result, arn) {
36835
37395
  const tagDesc = (await this.getClient().send(new DescribeTagsCommand({ ResourceArns: [arn] }))).TagDescriptions?.[0];
36836
37396
  result["Tags"] = normalizeAwsTagsToCfn(tagDesc?.Tags);
36837
37397
  } catch (err) {
36838
- this.logger.debug(`ELBv2 DescribeTags(${arn}) failed: ${describeAwsFailure(err).detail}`);
37398
+ if (!isElbv2NotFoundName(err)) throw err;
36839
37399
  }
36840
37400
  }
36841
37401
 
@@ -37140,11 +37700,11 @@ var ELBv2Provider = class {
37140
37700
  convertCertificates(certificates) {
37141
37701
  return convertCertificates.call(this, certificates);
37142
37702
  }
37143
- readCurrentState(physicalId, _logicalId, resourceType) {
37144
- return readCurrentState$23.call(this, physicalId, _logicalId, resourceType);
37703
+ readCurrentState(physicalId, _logicalId, resourceType, properties) {
37704
+ return readCurrentState$25.call(this, physicalId, _logicalId, resourceType, properties);
37145
37705
  }
37146
- readLoadBalancer(physicalId) {
37147
- return readLoadBalancer.call(this, physicalId);
37706
+ readLoadBalancer(physicalId, properties) {
37707
+ return readLoadBalancer.call(this, physicalId, properties);
37148
37708
  }
37149
37709
  readTargetGroup(physicalId) {
37150
37710
  return readTargetGroup.call(this, physicalId);
@@ -37536,7 +38096,7 @@ async function importImpl$23(input) {
37536
38096
  if (explicit) return this.buildImportResult(explicit);
37537
38097
  return null;
37538
38098
  }
37539
- async function readCurrentState$22(physicalId) {
38099
+ async function readCurrentState$24(physicalId) {
37540
38100
  const client = this.getClient();
37541
38101
  let proxy;
37542
38102
  try {
@@ -37572,6 +38132,7 @@ async function readCurrentState$22(physicalId) {
37572
38132
  const tagResp = await client.send(new ListTagsForResourceCommand$10({ ResourceName: p.DBProxyArn }));
37573
38133
  result["Tags"] = normalizeAwsTagsToCfn(tagResp.TagList ?? []);
37574
38134
  } catch (error) {
38135
+ if (!(error instanceof DBProxyNotFoundFault)) throw error;
37575
38136
  this.logger.debug(`ListTagsForResource failed for ${physicalId}: ${describeAwsFailure(error).detail}`);
37576
38137
  result["Tags"] = [];
37577
38138
  }
@@ -37661,7 +38222,7 @@ var RDSDBProxyProvider = class {
37661
38222
  return importImpl$23.call(this, input);
37662
38223
  }
37663
38224
  readCurrentState(physicalId) {
37664
- return readCurrentState$22.call(this, physicalId);
38225
+ return readCurrentState$24.call(this, physicalId);
37665
38226
  }
37666
38227
  applyTagDiff(physicalId, oldTags, newTags, resourceType, logicalId, maskSecrets) {
37667
38228
  return applyTagDiff$9.call(this, physicalId, oldTags, newTags, resourceType, logicalId, maskSecrets);
@@ -37938,6 +38499,7 @@ var RDSDBProxyEndpointProvider = class {
37938
38499
  const tagResp = await client.send(new ListTagsForResourceCommand$10({ ResourceName: e.DBProxyEndpointArn }));
37939
38500
  result["Tags"] = normalizeAwsTagsToCfn(tagResp.TagList ?? []);
37940
38501
  } catch (error) {
38502
+ if (!(error instanceof DBProxyEndpointNotFoundFault) && !(error instanceof DBProxyNotFoundFault)) throw error;
37941
38503
  this.logger.debug(`ListTagsForResource failed for ${physicalId}: ${describeAwsFailure(error).detail}`);
37942
38504
  result["Tags"] = [];
37943
38505
  }
@@ -38382,7 +38944,7 @@ async function importImpl$22(input) {
38382
38944
  };
38383
38945
  return null;
38384
38946
  }
38385
- async function readCurrentState$21(physicalId, _logicalId, _resourceType, properties) {
38947
+ async function readCurrentState$23(physicalId, _logicalId, _resourceType, properties) {
38386
38948
  const dbProxyName = readProxyName(properties["DBProxyName"]);
38387
38949
  const targetGroupName = requireConfigString(properties["TargetGroupName"], "default", "AWS::RDS::DBProxyTargetGroup TargetGroupName", { onUnusable: (message) => this.logger.warn(message) });
38388
38950
  if (!dbProxyName) return;
@@ -38426,6 +38988,7 @@ async function readCurrentState$21(physicalId, _logicalId, _resourceType, proper
38426
38988
  const tagResp = await client.send(new ListTagsForResourceCommand$10({ ResourceName: physicalId }));
38427
38989
  result["Tags"] = normalizeAwsTagsToCfn(tagResp.TagList ?? []);
38428
38990
  } catch (error) {
38991
+ if (!(error instanceof DBProxyTargetGroupNotFoundFault) && !(error instanceof DBProxyNotFoundFault)) throw error;
38429
38992
  this.logger.debug(safeMsg`ListTagsForResource failed for ${physicalId}: ${describeAwsFailure(error).detail}`);
38430
38993
  }
38431
38994
  return result;
@@ -38473,7 +39036,7 @@ var RDSDBProxyTargetGroupProvider = class {
38473
39036
  return importImpl$22.call(this, input);
38474
39037
  }
38475
39038
  readCurrentState(physicalId, _logicalId, _resourceType, properties) {
38476
- return readCurrentState$21.call(this, physicalId, _logicalId, _resourceType, properties);
39039
+ return readCurrentState$23.call(this, physicalId, _logicalId, _resourceType, properties);
38477
39040
  }
38478
39041
  async retireRegistrationAfterFailedCreate(original, dbProxyName, targetGroupName, dbClusterIdentifiers, dbInstanceIdentifiers, maskSecrets, leftBehind) {
38479
39042
  const clusters = dbClusterIdentifiers?.length ? dbClusterIdentifiers : void 0;
@@ -38633,11 +39196,18 @@ async function applyDocDBTagDiff(client, logger, arn, resourceType, logicalId, o
38633
39196
  logger.debug(safeMsg`Added/updated ${tagsToAdd.length} tag(s) on DocDB resource ${arn}`);
38634
39197
  }
38635
39198
  }
39199
+ const DOCDB_TAGGED_RESOURCE_NOT_FOUND_FAULTS = /* @__PURE__ */ new Set([
39200
+ "DBInstanceNotFoundFault",
39201
+ "DBClusterNotFoundFault",
39202
+ "DBSubnetGroupNotFoundFault"
39203
+ ]);
38636
39204
  async function attachDocDBTags(client, logger, result, arn) {
38637
39205
  try {
38638
39206
  const tagsResp = await client.send(new ListTagsForResourceCommand$13({ ResourceName: arn }));
38639
39207
  result["Tags"] = normalizeAwsTagsToCfn(tagsResp.TagList);
38640
39208
  } catch (err) {
39209
+ const name = err?.name;
39210
+ if (typeof name !== "string" || !DOCDB_TAGGED_RESOURCE_NOT_FOUND_FAULTS.has(name)) throw err;
38641
39211
  logger.debug(safeMsg`DocDB ListTagsForResource(${arn}) failed: ${describeAwsFailure(err).detail}`);
38642
39212
  }
38643
39213
  }
@@ -39899,7 +40469,7 @@ async function unsettledInTransition$3(physicalId, _logicalId, resourceType, nam
39899
40469
  return names;
39900
40470
  }
39901
40471
  }
39902
- async function readCurrentState$20(physicalId, _logicalId, resourceType) {
40472
+ async function readCurrentState$22(physicalId, _logicalId, resourceType) {
39903
40473
  switch (resourceType) {
39904
40474
  case "AWS::DocDB::DBInstance": return this.readCurrentStateDBInstance(physicalId);
39905
40475
  case "AWS::DocDB::DBCluster": return this.readCurrentStateDBCluster(physicalId);
@@ -40234,7 +40804,7 @@ var DocDBProvider = class {
40234
40804
  return importImpl$21.call(this, input);
40235
40805
  }
40236
40806
  readCurrentState(physicalId, _logicalId, resourceType) {
40237
- return readCurrentState$20.call(this, physicalId, _logicalId, resourceType);
40807
+ return readCurrentState$22.call(this, physicalId, _logicalId, resourceType);
40238
40808
  }
40239
40809
  readCurrentStateDBInstance(physicalId) {
40240
40810
  return readCurrentStateDBInstance.call(this, physicalId);
@@ -41760,6 +42330,10 @@ async function deleteRecordSetGroup(logicalId, physicalId, resourceType, propert
41760
42330
  throw this.wrapDeleteError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete record set group ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
41761
42331
  }
41762
42332
  }
42333
+ const HOSTED_ZONE_LOOKUP_FAILED$1 = Symbol.for("cdkd.route53.hostedZoneLookupFailed");
42334
+ function isHostedZoneLookupFailure$1(err) {
42335
+ return typeof err === "object" && err !== null && err[HOSTED_ZONE_LOOKUP_FAILED$1] === true;
42336
+ }
41763
42337
  async function readRecordSetGroup(physicalId, logicalId, properties) {
41764
42338
  const parsed = groupRecordSets(properties);
41765
42339
  if ("refusal" in parsed) return void 0;
@@ -41768,7 +42342,8 @@ async function readRecordSetGroup(physicalId, logicalId, properties) {
41768
42342
  let hostedZoneId;
41769
42343
  try {
41770
42344
  hostedZoneId = await existingGroupZone.call(this, physicalId, zoneProps.zone, logicalId, RECORD_SET_GROUP_TYPE);
41771
- } catch {
42345
+ } catch (err) {
42346
+ if (!(err instanceof ProvisioningError) || isHostedZoneLookupFailure$1(err)) throw err;
41772
42347
  return;
41773
42348
  }
41774
42349
  const observed = [];
@@ -42034,6 +42609,7 @@ async function resolveHostedZoneId(properties, logicalId, resourceType, physical
42034
42609
  let lookupErrorCause;
42035
42610
  let lookupErrorShown;
42036
42611
  let lookupErrorRedacted = false;
42612
+ let lookupFailed = false;
42037
42613
  const narrowing = options?.requirePrivateZone !== void 0;
42038
42614
  const hostedZoneName = properties["HostedZoneName"];
42039
42615
  if (typeof hostedZoneName === "string" && hostedZoneName) {
@@ -42051,6 +42627,7 @@ async function resolveHostedZoneId(properties, logicalId, resourceType, physical
42051
42627
  const sawLaterName = zones.some((z) => normalizeRecordName(z.Name ?? "") !== normalizedName);
42052
42628
  absenceIsSound = !hostedZoneName.includes("\\") && (narrowing ? sawLaterName || response.IsTruncated !== true : zones.length > 0 || response.IsTruncated !== true);
42053
42629
  } catch (error) {
42630
+ lookupFailed = true;
42054
42631
  const failure = describeAwsFailure(error);
42055
42632
  lookupErrorMessage = failure.detail;
42056
42633
  lookupErrorCause = error instanceof Error ? error : void 0;
@@ -42071,8 +42648,13 @@ async function resolveHostedZoneId(properties, logicalId, resourceType, physical
42071
42648
  }
42072
42649
  }
42073
42650
  const unresolved = new ProvisioningError(lookupErrorMessage ? `Could not resolve HostedZoneName "${String(hostedZoneName)}" for ${subject.noun} ${logicalId}: ${lookupErrorShown}` : typeof hostedZoneName === "string" && hostedZoneName ? `Could not determine whether HostedZoneName ${zoneNameShown(hostedZoneName)} exists for ${subject.noun} ${logicalIdShown(logicalId)} — the hosted-zone listing ended before the name could be resolved either way, so cdkd will not assume it is absent. ${subject.remedy}.` : `Either HostedZoneId or HostedZoneName is required for ${subject.noun} ${logicalId}`, resourceType, logicalId, physicalId, lookupErrorCause);
42651
+ if (lookupFailed) Object.defineProperty(unresolved, HOSTED_ZONE_LOOKUP_FAILED, { value: true });
42074
42652
  throw lookupErrorMessage && lookupErrorRedacted ? markRedactedCause(unresolved) : unresolved;
42075
42653
  }
42654
+ const HOSTED_ZONE_LOOKUP_FAILED = Symbol.for("cdkd.route53.hostedZoneLookupFailed");
42655
+ function isHostedZoneLookupFailure(err) {
42656
+ return typeof err === "object" && err !== null && err[HOSTED_ZONE_LOOKUP_FAILED] === true;
42657
+ }
42076
42658
  async function resolveRecordSetIdentity(physicalId, properties, options) {
42077
42659
  const composite = parseRecordSetCompositeId(physicalId);
42078
42660
  if (composite && (properties ? this.compositeAgreesWithTemplate(composite, properties) : !composite.nameCarriesSeparator)) return composite;
@@ -42087,13 +42669,14 @@ async function resolveRecordSetIdentity(physicalId, properties, options) {
42087
42669
  type
42088
42670
  };
42089
42671
  } catch (err) {
42672
+ if (!(err instanceof ProvisioningError) || isHostedZoneLookupFailure(err)) throw err;
42090
42673
  this.logger.debug(`Cannot resolve record-set identity for '${physicalId}': ${describeAwsFailure(err).detail}`);
42091
42674
  return;
42092
42675
  }
42093
42676
  }
42094
42677
 
42095
42678
  // src/provisioning/providers/route53/read-state.ts
42096
- async function readCurrentState$19(physicalId, _logicalId, resourceType, properties) {
42679
+ async function readCurrentState$21(physicalId, _logicalId, resourceType, properties) {
42097
42680
  switch (resourceType) {
42098
42681
  case "AWS::Route53::HostedZone": return this.readHostedZone(physicalId, properties);
42099
42682
  case "AWS::Route53::RecordSet": return this.readRecordSet(physicalId, properties);
@@ -42157,6 +42740,7 @@ async function readHostedZone(physicalId, properties, throwOnFailedQueryLoggingR
42157
42740
  }));
42158
42741
  result["HostedZoneTags"] = normalizeAwsTagsToCfn(tagsResp.ResourceTagSet?.Tags);
42159
42742
  } catch (err) {
42743
+ if (!(err instanceof Error && err.name === "NoSuchHostedZone")) throw err;
42160
42744
  this.logger.debug(`Route53 ListTagsForResource(${idTail}) failed: ${describeAwsFailure(err).detail}`);
42161
42745
  }
42162
42746
  try {
@@ -42165,7 +42749,7 @@ async function readHostedZone(physicalId, properties, throwOnFailedQueryLoggingR
42165
42749
  else result["QueryLoggingConfig"] = {};
42166
42750
  } catch (err) {
42167
42751
  this.logger.debug(`Route53 ListQueryLoggingConfigs(${idTail}) failed: ${describeAwsFailure(err).detail}`);
42168
- if (throwOnFailedQueryLoggingRead) throw err;
42752
+ if (throwOnFailedQueryLoggingRead || !(err instanceof Error && err.name === "NoSuchHostedZone")) throw err;
42169
42753
  result["QueryLoggingConfig"] = {};
42170
42754
  }
42171
42755
  return result;
@@ -42561,7 +43145,7 @@ var Route53Provider = class {
42561
43145
  return resolveRecordSetIdentity.call(this, physicalId, properties, options);
42562
43146
  }
42563
43147
  readCurrentState(physicalId, _logicalId, resourceType, properties) {
42564
- return readCurrentState$19.call(this, physicalId, _logicalId, resourceType, properties);
43148
+ return readCurrentState$21.call(this, physicalId, _logicalId, resourceType, properties);
42565
43149
  }
42566
43150
  readUnsettled(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
42567
43151
  return readUnsettled$3.call(this, physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems);
@@ -42962,7 +43546,7 @@ async function deleteImpl$20(logicalId, physicalId, resourceType, _properties, c
42962
43546
  }
42963
43547
 
42964
43548
  // src/provisioning/providers/wafv2/read-state.ts
42965
- async function readCurrentState$18(physicalId, _logicalId, _resourceType, properties) {
43549
+ async function readCurrentState$20(physicalId, _logicalId, _resourceType, properties) {
42966
43550
  const { id, name, scope } = parseWebACLArn(physicalId);
42967
43551
  if (!id || !name) return void 0;
42968
43552
  let webACL;
@@ -42997,6 +43581,7 @@ async function readCurrentState$18(physicalId, _logicalId, _resourceType, proper
42997
43581
  const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$14({ ResourceARN: physicalId }));
42998
43582
  result["Tags"] = normalizeAwsTagsToCfn(tagsResp.TagInfoForResource?.TagList);
42999
43583
  } catch (err) {
43584
+ if (!(err instanceof WAFNonexistentItemException)) throw err;
43000
43585
  this.logger.debug(`WAFv2 ListTagsForResource(${physicalId}) failed: ${describeAwsFailure(err).detail}`);
43001
43586
  }
43002
43587
  return result;
@@ -43089,7 +43674,7 @@ var WAFv2WebACLProvider = class {
43089
43674
  return applyTagDiff$8.call(this, arn, resourceType, logicalId, oldTagsRaw, newTagsRaw);
43090
43675
  }
43091
43676
  readCurrentState(physicalId, logicalId, resourceType, properties) {
43092
- return readCurrentState$18.call(this, physicalId, logicalId, resourceType, properties);
43677
+ return readCurrentState$20.call(this, physicalId, logicalId, resourceType, properties);
43093
43678
  }
43094
43679
  import(input) {
43095
43680
  return importImpl$19.call(this, input);
@@ -43354,7 +43939,7 @@ function canonicalizeDesiredProperties$1(resourceType, properties) {
43354
43939
  if (resourceType !== "AWS::Cognito::UserPool") return properties;
43355
43940
  return narrowMfaConfiguration(properties);
43356
43941
  }
43357
- async function readCurrentState$17(physicalId, _logicalId, resourceType) {
43942
+ async function readCurrentState$19(physicalId, _logicalId, resourceType) {
43358
43943
  if (resourceType !== "AWS::Cognito::UserPool") return void 0;
43359
43944
  let resp;
43360
43945
  try {
@@ -43410,6 +43995,7 @@ async function readCurrentState$17(physicalId, _logicalId, resourceType) {
43410
43995
  result["WebAuthnUserVerification"] = mfa.WebAuthnConfiguration?.UserVerification ?? "";
43411
43996
  result["WebAuthnFactorConfiguration"] = mfa.WebAuthnConfiguration?.FactorConfiguration ?? "";
43412
43997
  } catch (mfaErr) {
43998
+ if (!(mfaErr instanceof ResourceNotFoundException$11)) throw mfaErr;
43413
43999
  this.logger.debug(`GetUserPoolMfaConfig failed for ${physicalId}, skipping MFA-derived drift keys: ${describeAwsFailure(mfaErr).detail}`);
43414
44000
  }
43415
44001
  return result;
@@ -44394,7 +44980,7 @@ var CognitoUserPoolProvider = class {
44394
44980
  return warnGuardLeftOn.call(this, physicalId, pool, mask, error, echoError);
44395
44981
  }
44396
44982
  readCurrentState(physicalId, _logicalId, resourceType) {
44397
- return readCurrentState$17.call(this, physicalId, _logicalId, resourceType);
44983
+ return readCurrentState$19.call(this, physicalId, _logicalId, resourceType);
44398
44984
  }
44399
44985
  userPoolAttributes(userPoolId, arn) {
44400
44986
  return userPoolAttributes.call(this, userPoolId, arn);
@@ -44873,14 +45459,14 @@ async function applyTagDiff$7(arn, resourceType, logicalId, oldTagsRaw, newTagsR
44873
45459
  }
44874
45460
 
44875
45461
  // src/provisioning/providers/elasticache/read-state.ts
44876
- async function readCurrentState$16(physicalId, _logicalId, resourceType) {
45462
+ async function readCurrentState$18(physicalId, _logicalId, resourceType, properties) {
44877
45463
  switch (resourceType) {
44878
- case "AWS::ElastiCache::CacheCluster": return this.readCacheCluster(physicalId);
45464
+ case "AWS::ElastiCache::CacheCluster": return this.readCacheCluster(physicalId, properties);
44879
45465
  case "AWS::ElastiCache::SubnetGroup": return this.readSubnetGroup(physicalId);
44880
45466
  default: return;
44881
45467
  }
44882
45468
  }
44883
- async function readCacheCluster(physicalId) {
45469
+ async function readCacheCluster(physicalId, properties) {
44884
45470
  let cluster;
44885
45471
  try {
44886
45472
  cluster = (await this.getClient().send(new DescribeCacheClustersCommand({
@@ -44912,9 +45498,32 @@ async function readCacheCluster(physicalId) {
44912
45498
  if (cluster.Engine === "redis" && cluster.TransitEncryptionEnabled !== void 0) result["TransitEncryptionEnabled"] = cluster.TransitEncryptionEnabled;
44913
45499
  if (cluster.CacheNodes?.[0]?.Endpoint?.Port !== void 0) result["Port"] = cluster.CacheNodes[0].Endpoint.Port;
44914
45500
  result["VpcSecurityGroupIds"] = (cluster.SecurityGroups ?? []).map((sg) => sg.SecurityGroupId).filter((id) => !!id);
45501
+ result["LogDeliveryConfigurations"] = readbackLogDelivery(cluster.LogDeliveryConfigurations ?? [], properties?.["LogDeliveryConfigurations"]);
45502
+ const declaredZones = properties?.["PreferredAvailabilityZones"];
45503
+ if (Array.isArray(declaredZones)) result["PreferredAvailabilityZones"] = inDeclaredOrder((cluster.CacheNodes ?? []).flatMap((node) => node.CacheNodeStatus !== "deleting" && node.CustomerAvailabilityZone !== void 0 ? [node.CustomerAvailabilityZone] : []), (zone) => zone, declaredZones);
44915
45504
  if (cluster.ARN) await this.attachTags(result, cluster.ARN);
44916
45505
  return result;
44917
45506
  }
45507
+ const LEAVING_LOG_DELIVERY_STATUSES = /* @__PURE__ */ new Set(["disabling"]);
45508
+ function readbackLogDelivery(live, declared) {
45509
+ const entries = live.filter((config) => !LEAVING_LOG_DELIVERY_STATUSES.has(config.Status ?? "")).map((config) => {
45510
+ const entry = {};
45511
+ if (config.LogType !== void 0) entry["LogType"] = config.LogType;
45512
+ if (config.DestinationType !== void 0) entry["DestinationType"] = config.DestinationType;
45513
+ const details = config.DestinationDetails;
45514
+ if (details !== void 0) {
45515
+ const out = {};
45516
+ const logGroup = details.CloudWatchLogsDetails?.LogGroup;
45517
+ if (logGroup !== void 0) out["CloudWatchLogsDetails"] = { LogGroup: logGroup };
45518
+ const stream = details.KinesisFirehoseDetails?.DeliveryStream;
45519
+ if (stream !== void 0) out["KinesisFirehoseDetails"] = { DeliveryStream: stream };
45520
+ entry["DestinationDetails"] = out;
45521
+ }
45522
+ if (config.LogFormat !== void 0) entry["LogFormat"] = config.LogFormat;
45523
+ return entry;
45524
+ });
45525
+ return inDeclaredOrder(entries, (entry) => entry["LogType"], Array.isArray(declared) ? declared.map((d) => d !== null && typeof d === "object" ? d["LogType"] : d) : void 0);
45526
+ }
44918
45527
  async function readSubnetGroup(physicalId) {
44919
45528
  let group;
44920
45529
  try {
@@ -44935,11 +45544,14 @@ async function readSubnetGroup(physicalId) {
44935
45544
  if (group.ARN) await this.attachTags(result, group.ARN);
44936
45545
  return result;
44937
45546
  }
45547
+ const TAGGED_RESOURCE_NOT_FOUND_FAULTS = /* @__PURE__ */ new Set(["CacheClusterNotFoundFault", "CacheSubnetGroupNotFoundFault"]);
44938
45548
  async function attachTags$1(result, arn) {
44939
45549
  try {
44940
45550
  const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$7({ ResourceName: arn }));
44941
45551
  result["Tags"] = normalizeAwsTagsToCfn(tagsResp.TagList);
44942
45552
  } catch (err) {
45553
+ const name = err?.name;
45554
+ if (typeof name !== "string" || !TAGGED_RESOURCE_NOT_FOUND_FAULTS.has(name)) throw err;
44943
45555
  this.logger.debug(`ElastiCache ListTagsForResource(${arn}) failed: ${describeAwsFailure(err).detail}`);
44944
45556
  }
44945
45557
  }
@@ -45126,13 +45738,17 @@ var ElastiCacheProvider = class {
45126
45738
  return new Promise((resolve) => setTimeout(resolve, ms));
45127
45739
  }
45128
45740
  getDriftUnknownPaths(resourceType) {
45129
- return resourceType === "AWS::ElastiCache::CacheCluster" ? ["SnapshotArns", "SnapshotName"] : [];
45741
+ return resourceType === "AWS::ElastiCache::CacheCluster" ? [
45742
+ "SnapshotArns",
45743
+ "SnapshotName",
45744
+ "AZMode"
45745
+ ] : [];
45130
45746
  }
45131
- readCurrentState(physicalId, _logicalId, resourceType) {
45132
- return readCurrentState$16.call(this, physicalId, _logicalId, resourceType);
45747
+ readCurrentState(physicalId, _logicalId, resourceType, properties) {
45748
+ return readCurrentState$18.call(this, physicalId, _logicalId, resourceType, properties);
45133
45749
  }
45134
- readCacheCluster(physicalId) {
45135
- return readCacheCluster.call(this, physicalId);
45750
+ readCacheCluster(physicalId, properties) {
45751
+ return readCacheCluster.call(this, physicalId, properties);
45136
45752
  }
45137
45753
  readSubnetGroup(physicalId) {
45138
45754
  return readSubnetGroup.call(this, physicalId);
@@ -45930,7 +46546,7 @@ async function readServiceIdForIdentity(serviceId) {
45930
46546
  if (typeof response.Service?.Id !== "string") throw new Error("GetService did not return the service asked for");
45931
46547
  return response.Service.Id;
45932
46548
  }
45933
- async function readCurrentState$15(physicalId, _logicalId, resourceType) {
46549
+ async function readCurrentState$17(physicalId, _logicalId, resourceType) {
45934
46550
  switch (resourceType) {
45935
46551
  case "AWS::ServiceDiscovery::PrivateDnsNamespace":
45936
46552
  case "AWS::ServiceDiscovery::PublicDnsNamespace": return this.readNamespace(physicalId, { includeProperties: true });
@@ -45983,6 +46599,7 @@ async function readService(physicalId) {
45983
46599
  try {
45984
46600
  result["ServiceAttributes"] = (await this.getClient().send(new GetServiceAttributesCommand({ ServiceId: physicalId }))).ServiceAttributes?.Attributes ?? {};
45985
46601
  } catch (err) {
46602
+ if (!(err instanceof ServiceNotFound)) throw err;
45986
46603
  this.logger.debug(`ServiceDiscovery GetServiceAttributes(${physicalId}) failed: ${describeAwsFailure(err).detail}`);
45987
46604
  }
45988
46605
  if (svc.Arn) await this.attachTags(result, svc.Arn);
@@ -46002,6 +46619,7 @@ async function attachTags(result, arn) {
46002
46619
  const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$15({ ResourceARN: arn }));
46003
46620
  result["Tags"] = normalizeAwsTagsToCfn(tagsResp.Tags);
46004
46621
  } catch (err) {
46622
+ if (!(err instanceof ResourceNotFoundException$12)) throw err;
46005
46623
  this.logger.debug(`ServiceDiscovery ListTagsForResource(${arn}) failed: ${describeAwsFailure(err).detail}`);
46006
46624
  }
46007
46625
  }
@@ -46224,7 +46842,7 @@ var ServiceDiscoveryProvider = class {
46224
46842
  return readServiceIdForIdentity.call(this, serviceId);
46225
46843
  }
46226
46844
  readCurrentState(physicalId, _logicalId, resourceType) {
46227
- return readCurrentState$15.call(this, physicalId, _logicalId, resourceType);
46845
+ return readCurrentState$17.call(this, physicalId, _logicalId, resourceType);
46228
46846
  }
46229
46847
  getDriftUnknownPaths(resourceType) {
46230
46848
  return getDriftUnknownPaths$3.call(this, resourceType);
@@ -47581,7 +48199,7 @@ function isNotFoundError(error) {
47581
48199
  }
47582
48200
 
47583
48201
  // src/provisioning/providers/appsync/read-state.ts
47584
- async function readCurrentState$14(physicalId, _logicalId, resourceType, properties) {
48202
+ async function readCurrentState$16(physicalId, _logicalId, resourceType, properties) {
47585
48203
  switch (resourceType) {
47586
48204
  case "AWS::AppSync::GraphQLApi": return this.readGraphQLApi(physicalId);
47587
48205
  case "AWS::AppSync::DataSource": return this.readDataSource(physicalId);
@@ -47692,7 +48310,8 @@ async function readGraphQLApi(physicalId) {
47692
48310
  const envResp = await this.getClient().send(new GetGraphqlApiEnvironmentVariablesCommand({ apiId: physicalId }));
47693
48311
  if (envResp.environmentVariables !== void 0) result["EnvironmentVariables"] = envResp.environmentVariables;
47694
48312
  } catch (err) {
47695
- this.logger.warn(`Could not read AppSync GraphqlApi ${physicalId} environment variables (drift on that property will not be reported): ${describeAwsFailure(err).detail}`);
48313
+ if (!(err instanceof NotFoundException$4)) throw err;
48314
+ this.logger.debug(`AppSync GraphqlApi ${physicalId} environment variables read answered NotFoundException: ${describeAwsFailure(err).detail}`);
47696
48315
  }
47697
48316
  return result;
47698
48317
  }
@@ -48159,7 +48778,7 @@ var AppSyncProvider = class {
48159
48778
  return isNotFoundError.call(this, error);
48160
48779
  }
48161
48780
  readCurrentState(physicalId, _logicalId, resourceType, properties) {
48162
- return readCurrentState$14.call(this, physicalId, _logicalId, resourceType, properties);
48781
+ return readCurrentState$16.call(this, physicalId, _logicalId, resourceType, properties);
48163
48782
  }
48164
48783
  canonicalizeSdl(sdl, source) {
48165
48784
  return canonicalizeSdl.call(this, sdl, source);
@@ -51333,14 +51952,19 @@ async function readCurrentStateKey(physicalId, properties, context, logicalId =
51333
51952
  if (md.Origin !== void 0) result["Origin"] = md.Origin;
51334
51953
  if (md.KeyId) {
51335
51954
  let keyPolicy;
51955
+ let keyPolicyError;
51956
+ let keyPolicyFailed = false;
51336
51957
  try {
51337
51958
  keyPolicy = await readKeyPolicy.call(this, md.KeyId);
51338
51959
  } catch (err) {
51339
51960
  if (err instanceof NotFoundException$2) return RESOURCE_NOT_FOUND;
51340
51961
  keyPolicy = memberReadFailure(err);
51962
+ keyPolicyError = err;
51963
+ keyPolicyFailed = true;
51341
51964
  }
51342
51965
  const declared = context?.afterOwnWrite === true ? declaredMemberDocument(properties?.["KeyPolicy"]) : void 0;
51343
51966
  if (declared !== void 0) keyPolicy = await settleKeyPolicy.call(this, md.KeyId, logicalId, keyPolicy, declared);
51967
+ if (keyPolicyFailed && (keyPolicy === "failed" || keyPolicy === "refused")) throw keyPolicyError;
51344
51968
  if (typeof keyPolicy === "object") result["KeyPolicy"] = keyPolicy.value;
51345
51969
  if (md.KeySpec === void 0 || md.KeySpec === "SYMMETRIC_DEFAULT") try {
51346
51970
  const rotationResp = await this.getClient().send(new GetKeyRotationStatusCommand({ KeyId: md.KeyId }));
@@ -51348,12 +51972,14 @@ async function readCurrentStateKey(physicalId, properties, context, logicalId =
51348
51972
  if (rotationResp.RotationPeriodInDays !== void 0) result["RotationPeriodInDays"] = rotationResp.RotationPeriodInDays;
51349
51973
  } catch (err) {
51350
51974
  if (err instanceof NotFoundException$2) return RESOURCE_NOT_FOUND;
51975
+ if (!(err instanceof UnsupportedOperationException)) throw err;
51351
51976
  }
51352
51977
  try {
51353
51978
  const tagsResp = await this.getClient().send(new ListResourceTagsCommand({ KeyId: md.KeyId }));
51354
51979
  result["Tags"] = normalizeAwsTagsToCfn(tagsResp.Tags);
51355
51980
  } catch (err) {
51356
51981
  if (err instanceof NotFoundException$2) return RESOURCE_NOT_FOUND;
51982
+ throw err;
51357
51983
  }
51358
51984
  }
51359
51985
  return result;
@@ -51937,7 +52563,7 @@ async function deleteImpl$15(logicalId, physicalId, resourceType, _properties, c
51937
52563
  }
51938
52564
 
51939
52565
  // src/provisioning/providers/budgets-budget/read-state.ts
51940
- async function readCurrentState$13(physicalId, _logicalId, resourceType, properties) {
52566
+ async function readCurrentState$15(physicalId, _logicalId, resourceType, properties) {
51941
52567
  if (resourceType !== "AWS::Budgets::Budget") return void 0;
51942
52568
  const accountId = await this.resolveAccountId();
51943
52569
  const client = this.getClient();
@@ -52288,7 +52914,7 @@ var BudgetsBudgetProvider = class {
52288
52914
  }
52289
52915
  }
52290
52916
  readCurrentState(physicalId, logicalId, resourceType, properties) {
52291
- return readCurrentState$13.call(this, physicalId, logicalId, resourceType, properties);
52917
+ return readCurrentState$15.call(this, physicalId, logicalId, resourceType, properties);
52292
52918
  }
52293
52919
  listNotifications(accountId, budgetName) {
52294
52920
  return listNotifications.call(this, accountId, budgetName);
@@ -52353,7 +52979,7 @@ async function readStreamArnIfExists(streamName) {
52353
52979
  try {
52354
52980
  response = await this.getClient().send(new DescribeStreamSummaryCommand({ StreamName: streamName }));
52355
52981
  } catch (error) {
52356
- if (error instanceof ResourceNotFoundException$12) return void 0;
52982
+ if (error instanceof ResourceNotFoundException$13) return void 0;
52357
52983
  throw error;
52358
52984
  }
52359
52985
  const arn = response.StreamDescriptionSummary?.StreamARN;
@@ -52364,7 +52990,7 @@ async function readStreamStatusForDelete(streamName) {
52364
52990
  try {
52365
52991
  return (await this.getClient().send(new DescribeStreamSummaryCommand({ StreamName: streamName }))).StreamDescriptionSummary?.StreamStatus ?? "UNKNOWN";
52366
52992
  } catch (error) {
52367
- if (error instanceof ResourceNotFoundException$12) return void 0;
52993
+ if (error instanceof ResourceNotFoundException$13) return void 0;
52368
52994
  throw error;
52369
52995
  }
52370
52996
  }
@@ -52847,7 +53473,7 @@ async function deleteImpl$14(logicalId, physicalId, resourceType, _properties, c
52847
53473
  EnforceConsumerDeletion: true
52848
53474
  }));
52849
53475
  } catch (error) {
52850
- if (error instanceof ResourceNotFoundException$12) {
53476
+ if (error instanceof ResourceNotFoundException$13) {
52851
53477
  const clientRegion = await this.getClient().config.region();
52852
53478
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
52853
53479
  if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` Kinesis stream ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
@@ -52887,7 +53513,7 @@ async function resourceIdentity$1(physicalId, _resourceType, context) {
52887
53513
  try {
52888
53514
  response = await this.getClient().send(new DescribeStreamSummaryCommand({ StreamName: physicalId }));
52889
53515
  } catch (error) {
52890
- if (error instanceof ResourceNotFoundException$12) return RESOURCE_NOT_FOUND;
53516
+ if (error instanceof ResourceNotFoundException$13) return RESOURCE_NOT_FOUND;
52891
53517
  throw error;
52892
53518
  }
52893
53519
  const arn = response.StreamDescriptionSummary?.StreamARN;
@@ -52940,13 +53566,13 @@ async function unsettledInTransition$2(physicalId, _logicalId, _resourceType, na
52940
53566
  return names;
52941
53567
  }
52942
53568
  }
52943
- async function readCurrentState$12(physicalId, _logicalId, resourceType, _properties) {
53569
+ async function readCurrentState$14(physicalId, _logicalId, resourceType, _properties) {
52944
53570
  if (resourceType !== "AWS::Kinesis::Stream") return void 0;
52945
53571
  let stream;
52946
53572
  try {
52947
53573
  stream = (await this.getClient().send(new DescribeStreamCommand({ StreamName: physicalId }))).StreamDescription;
52948
53574
  } catch (err) {
52949
- if (err instanceof ResourceNotFoundException$12) return RESOURCE_NOT_FOUND;
53575
+ if (err instanceof ResourceNotFoundException$13) return RESOURCE_NOT_FOUND;
52950
53576
  throw err;
52951
53577
  }
52952
53578
  if (!stream) return void 0;
@@ -52969,15 +53595,15 @@ async function readCurrentState$12(physicalId, _logicalId, resourceType, _proper
52969
53595
  const strategy = summaryResp.StreamDescriptionSummary?.RecordDistributionStrategy;
52970
53596
  if (strategy !== void 0) result["RecordDistributionStrategy"] = strategy;
52971
53597
  } catch (err) {
52972
- if (err instanceof ResourceNotFoundException$12) return RESOURCE_NOT_FOUND;
53598
+ if (err instanceof ResourceNotFoundException$13) return RESOURCE_NOT_FOUND;
52973
53599
  throw err;
52974
53600
  }
52975
53601
  try {
52976
53602
  const tagsResp = await this.getClient().send(new ListTagsForStreamCommand({ StreamName: physicalId }));
52977
53603
  result["Tags"] = normalizeAwsTagsToCfn(tagsResp.Tags);
52978
53604
  } catch (err) {
52979
- if (err instanceof ResourceNotFoundException$12) return RESOURCE_NOT_FOUND;
52980
- this.logger.debug(`Kinesis ListTagsForStream(${physicalId}) failed: ${describeAwsFailure(err).detail}`);
53605
+ if (err instanceof ResourceNotFoundException$13) return RESOURCE_NOT_FOUND;
53606
+ throw err;
52981
53607
  }
52982
53608
  return result;
52983
53609
  }
@@ -52992,7 +53618,7 @@ async function importImpl$12(input) {
52992
53618
  attributes: streamAttributes(response.StreamDescriptionSummary)
52993
53619
  };
52994
53620
  } catch (err) {
52995
- if (err instanceof ResourceNotFoundException$12) return null;
53621
+ if (err instanceof ResourceNotFoundException$13) return null;
52996
53622
  throw err;
52997
53623
  }
52998
53624
  return null;
@@ -53071,7 +53697,7 @@ var KinesisStreamProvider = class {
53071
53697
  return unsettledInTransition$2.call(this, physicalId, _logicalId, _resourceType, names);
53072
53698
  }
53073
53699
  readCurrentState(physicalId, _logicalId, resourceType, _properties) {
53074
- return readCurrentState$12.call(this, physicalId, _logicalId, resourceType, _properties);
53700
+ return readCurrentState$14.call(this, physicalId, _logicalId, resourceType, _properties);
53075
53701
  }
53076
53702
  import(input) {
53077
53703
  return importImpl$12.call(this, input);
@@ -53224,7 +53850,7 @@ var KinesisStreamConsumerProvider = class {
53224
53850
  await this.getClient().send(new DeregisterStreamConsumerCommand({ ConsumerARN: physicalId }));
53225
53851
  this.logger.debug(`Successfully deregistered Kinesis stream consumer ${logicalId}`);
53226
53852
  } catch (error) {
53227
- if (error instanceof ResourceNotFoundException$12) {
53853
+ if (error instanceof ResourceNotFoundException$13) {
53228
53854
  const clientRegion = await this.getClient().config.region();
53229
53855
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
53230
53856
  this.logger.debug(`Kinesis stream consumer ${physicalId} not found, skipping`);
@@ -53253,7 +53879,7 @@ var KinesisStreamConsumerProvider = class {
53253
53879
  try {
53254
53880
  desc = (await this.getClient().send(new DescribeStreamConsumerCommand({ ConsumerARN: physicalId }))).ConsumerDescription;
53255
53881
  } catch (err) {
53256
- if (err instanceof ResourceNotFoundException$12) return RESOURCE_NOT_FOUND;
53882
+ if (err instanceof ResourceNotFoundException$13) return RESOURCE_NOT_FOUND;
53257
53883
  throw err;
53258
53884
  }
53259
53885
  if (!desc) return void 0;
@@ -53264,9 +53890,8 @@ var KinesisStreamConsumerProvider = class {
53264
53890
  const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$17({ ResourceARN: physicalId }));
53265
53891
  result["Tags"] = normalizeAwsTagsToCfn(tagsResp.Tags);
53266
53892
  } catch (err) {
53267
- if (err instanceof ResourceNotFoundException$12) return RESOURCE_NOT_FOUND;
53268
- this.logger.debug(`ListTagsForResource(${physicalId}) failed: ${describeAwsFailure(err).detail}`);
53269
- result["Tags"] = [];
53893
+ if (err instanceof ResourceNotFoundException$13) return RESOURCE_NOT_FOUND;
53894
+ throw err;
53270
53895
  }
53271
53896
  return result;
53272
53897
  }
@@ -53435,7 +54060,7 @@ async function creationDateBestEffort(logicalId, name, groupName) {
53435
54060
  for (let attempt = 0;; attempt++) try {
53436
54061
  return (await this.readIdentity(name, groupName)).creation;
53437
54062
  } catch (error) {
53438
- const transient = error instanceof ResourceNotFoundException$13 || isThrottlingError(error);
54063
+ const transient = error instanceof ResourceNotFoundException$14 || isThrottlingError(error);
53439
54064
  const delay = this.readBackDelaysMs[attempt];
53440
54065
  if (transient && delay !== void 0) {
53441
54066
  await this.sleep(delay);
@@ -53486,7 +54111,7 @@ async function confirmRecordedSchedule(logicalId, physicalId, resourceType, grou
53486
54111
  try {
53487
54112
  live = await this.readIdentity(physicalId, groupName);
53488
54113
  } catch (error) {
53489
- if (error instanceof ResourceNotFoundException$13) return "absent";
54114
+ if (error instanceof ResourceNotFoundException$14) return "absent";
53490
54115
  throw this.wrapUnconfirmedGroupError(logicalId, physicalId, resourceType, error, mask);
53491
54116
  }
53492
54117
  if (sameRecordedDate(live, recorded) && !sameRecordedIdentity(live, recorded)) this.refuseUnconfirmed(logicalId, physicalId, resourceType, "holds a schedule of this name that carries the recorded creation date but not the recorded target or role (edited outside cdkd?)", false, `restore them, or drop the record with ${pasteableCommand("cdkd orphan", [{ hole: "constructPath" }]).command} and deploy again`);
@@ -53583,7 +54208,7 @@ async function deleteByRecordedIdentity(logicalId, physicalId, resourceType, rec
53583
54208
  try {
53584
54209
  live = await this.readIdentity(physicalId, group);
53585
54210
  } catch (error) {
53586
- if (error instanceof ResourceNotFoundException$13) continue;
54211
+ if (error instanceof ResourceNotFoundException$14) continue;
53587
54212
  throw wrapDeleteError("reading a schedule of its name", error);
53588
54213
  }
53589
54214
  if (sameRecordedIdentity(live, recorded)) matches.push(group);
@@ -53619,7 +54244,7 @@ async function deleteByRecordedIdentity(logicalId, physicalId, resourceType, rec
53619
54244
  }));
53620
54245
  this.logger.debug(safeMsg`Deleted Schedule ${logicalId} (found by its recorded creation date)`);
53621
54246
  } catch (error) {
53622
- if (error instanceof ResourceNotFoundException$13) return;
54247
+ if (error instanceof ResourceNotFoundException$14) return;
53623
54248
  throw wrapDeleteError("the delete", error);
53624
54249
  }
53625
54250
  }
@@ -53649,7 +54274,7 @@ async function deleteImpl$13(logicalId, physicalId, resourceType, properties, co
53649
54274
  }));
53650
54275
  this.logger.debug(`Deleted Schedule ${logicalId}`);
53651
54276
  } catch (error) {
53652
- if (error instanceof ResourceNotFoundException$13) {
54277
+ if (error instanceof ResourceNotFoundException$14) {
53653
54278
  const clientRegion = await this.getClient().config.region();
53654
54279
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
53655
54280
  this.logger.debug(`Schedule ${logicalId} already deleted (not found), treating as success`);
@@ -53667,11 +54292,11 @@ async function getAttribute$4(physicalId, resourceType, attributeName, logicalId
53667
54292
  return (await this.getClient().send(new GetScheduleCommand({ Name: physicalId }))).Arn;
53668
54293
  } catch (error) {
53669
54294
  const cause = error instanceof Error ? error : void 0;
53670
- const customGroupHint = error instanceof ResourceNotFoundException$13 ? " Schedules in a custom group cannot be looked up by bare name; the Arn is normally served from cdkd state attributes." : "";
54295
+ const customGroupHint = error instanceof ResourceNotFoundException$14 ? " Schedules in a custom group cannot be looked up by bare name; the Arn is normally served from cdkd state attributes." : "";
53671
54296
  throw this.wrapCaughtError(void 0, error, (text) => new ProvisioningError(`Failed to resolve Arn for Schedule ${physicalId}: ${text}${text.endsWith(".") ? "" : "."}${customGroupHint}`, resourceType, logicalId, physicalId, cause));
53672
54297
  }
53673
54298
  }
53674
- async function readCurrentState$11(physicalId, _logicalId, _resourceType, properties) {
54299
+ async function readCurrentState$13(physicalId, _logicalId, _resourceType, properties) {
53675
54300
  const groupName = this.groupNameOf(properties);
53676
54301
  try {
53677
54302
  const response = await this.getClient().send(new GetScheduleCommand({
@@ -53693,7 +54318,7 @@ async function readCurrentState$11(physicalId, _logicalId, _resourceType, proper
53693
54318
  ...response.Target !== void 0 && { Target: this.toCfnTarget(response.Target) }
53694
54319
  };
53695
54320
  } catch (error) {
53696
- if (error instanceof ResourceNotFoundException$13) return RESOURCE_NOT_FOUND;
54321
+ if (error instanceof ResourceNotFoundException$14) return RESOURCE_NOT_FOUND;
53697
54322
  throw error;
53698
54323
  }
53699
54324
  }
@@ -53714,7 +54339,7 @@ async function importImpl$11(input) {
53714
54339
  }
53715
54340
  };
53716
54341
  } catch (error) {
53717
- if (error instanceof ResourceNotFoundException$13) return null;
54342
+ if (error instanceof ResourceNotFoundException$14) return null;
53718
54343
  throw error;
53719
54344
  }
53720
54345
  }
@@ -53801,7 +54426,7 @@ var SchedulerScheduleProvider = class {
53801
54426
  return getAttribute$4.call(this, physicalId, resourceType, attributeName, logicalId);
53802
54427
  }
53803
54428
  readCurrentState(physicalId, _logicalId, _resourceType, properties) {
53804
- return readCurrentState$11.call(this, physicalId, _logicalId, _resourceType, properties);
54429
+ return readCurrentState$13.call(this, physicalId, _logicalId, _resourceType, properties);
53805
54430
  }
53806
54431
  import(input) {
53807
54432
  return importImpl$11.call(this, input);
@@ -54316,7 +54941,7 @@ async function getAttribute$3(physicalId, resourceType, attributeName, logicalId
54316
54941
  }
54317
54942
  return this.attributesOf(response)[attributeName];
54318
54943
  }
54319
- async function readCurrentState$10(physicalId, _logicalId, _resourceType) {
54944
+ async function readCurrentState$12(physicalId, _logicalId, _resourceType) {
54320
54945
  let r;
54321
54946
  try {
54322
54947
  r = await this.describe(physicalId);
@@ -54469,7 +55094,7 @@ var PipesPipeProvider = class {
54469
55094
  return getAttribute$3.call(this, physicalId, resourceType, attributeName, logicalId);
54470
55095
  }
54471
55096
  readCurrentState(physicalId, _logicalId, _resourceType) {
54472
- return readCurrentState$10.call(this, physicalId, _logicalId, _resourceType);
55097
+ return readCurrentState$12.call(this, physicalId, _logicalId, _resourceType);
54473
55098
  }
54474
55099
  getDriftUnknownPaths() {
54475
55100
  return ["SourceParameters", "TargetParameters"];
@@ -54610,7 +55235,7 @@ async function retryOnTransientControlPlane(op, label, log, maxAttempts = 8) {
54610
55235
  delayMs = Math.min(delayMs * 2, 3e4);
54611
55236
  }
54612
55237
  }
54613
- async function readCurrentState$9(physicalId, _logicalId, resourceType) {
55238
+ async function readCurrentState$11(physicalId, _logicalId, resourceType) {
54614
55239
  switch (resourceType) {
54615
55240
  case "AWS::EFS::FileSystem": return this.readFileSystem(physicalId);
54616
55241
  case "AWS::EFS::AccessPoint": return this.readAccessPoint(physicalId);
@@ -54739,12 +55364,71 @@ async function applyFileSystemProtection(fileSystemId, spec, log) {
54739
55364
  })), `set FileSystemProtection on ${fileSystemId}`, log);
54740
55365
  log.debug(`Set ReplicationOverwriteProtection=${log.value(protection)} on EFS FileSystem ${fileSystemId}`);
54741
55366
  }
55367
+ const REPLICATION_TEARDOWN_WAIT = {
55368
+ intervalMs: 15e3,
55369
+ attempts: 60
55370
+ };
55371
+ async function sleepUnlessInterrupted(ms, watch) {
55372
+ for (let left = ms;; left -= 1e3) {
55373
+ if (watch.isInterrupted()) throw watch.onInterrupted();
55374
+ if (left <= 0) return;
55375
+ await new Promise((resolve) => setTimeout(resolve, Math.min(1e3, left)));
55376
+ }
55377
+ }
55378
+ function isReplicationRefusal(error) {
55379
+ const e = error;
55380
+ return e?.name === "FileSystemInUse" && typeof e.message === "string" && /replication/i.test(e.message);
55381
+ }
55382
+ async function deleteOwnReplication(fileSystemId) {
55383
+ const own = ((await this.getClient().send(new DescribeReplicationConfigurationsCommand({ FileSystemId: fileSystemId })).catch(() => void 0))?.Replications ?? []).find((r) => r.SourceFileSystemId === fileSystemId);
55384
+ if (!own) return false;
55385
+ const destinations = own.Destinations ?? [];
55386
+ if (destinations.length > 0 && destinations.every((d) => d.Status === "DELETING")) return true;
55387
+ try {
55388
+ await this.getClient().send(new DeleteReplicationConfigurationCommand({ SourceFileSystemId: fileSystemId }));
55389
+ } catch (error) {
55390
+ if (error?.name !== "ReplicationNotFound") throw error;
55391
+ }
55392
+ this.logger.debug(safeMsg`Deleted the replication configuration of EFS FileSystem ${fileSystemId} before deleting it`);
55393
+ return true;
55394
+ }
54742
55395
  async function deleteFileSystem(logicalId, physicalId, resourceType, context) {
54743
55396
  this.logger.debug(`Deleting EFS FileSystem ${logicalId}: ${physicalId}`);
55397
+ const send = () => this.getClient().send(new DeleteFileSystemCommand({ FileSystemId: physicalId }));
55398
+ let replicationDeleted = false;
54744
55399
  try {
54745
- await this.getClient().send(new DeleteFileSystemCommand({ FileSystemId: physicalId }));
55400
+ try {
55401
+ await send();
55402
+ } catch (error) {
55403
+ if (!isReplicationRefusal(error)) throw error;
55404
+ replicationDeleted = await deleteOwnReplication.call(this, physicalId);
55405
+ if (!replicationDeleted) throw error;
55406
+ const watch = startInterruptWatch(`EFS FileSystem ${logicalId} (replication teardown)`);
55407
+ const deadline = Date.now() + enclosingDeadlineRemainingMs();
55408
+ let lastRefusal = error;
55409
+ try {
55410
+ for (let attempt = 1; attempt <= REPLICATION_TEARDOWN_WAIT.attempts; attempt++) {
55411
+ const left = deadline - Date.now();
55412
+ if (left <= 0 || enclosingDeadlineExpired()) break;
55413
+ await sleepUnlessInterrupted(Math.min(REPLICATION_TEARDOWN_WAIT.intervalMs, left), watch);
55414
+ if (enclosingDeadlineExpired()) break;
55415
+ try {
55416
+ await send();
55417
+ lastRefusal = void 0;
55418
+ break;
55419
+ } catch (retryError) {
55420
+ if (!isReplicationRefusal(retryError)) throw retryError;
55421
+ lastRefusal = retryError;
55422
+ }
55423
+ }
55424
+ if (lastRefusal !== void 0) throw lastRefusal;
55425
+ } finally {
55426
+ watch.dispose();
55427
+ }
55428
+ }
54746
55429
  this.logger.debug(`Successfully deleted EFS FileSystem ${logicalId}`);
54747
55430
  } catch (error) {
55431
+ if (isInterruptedWaitError(error)) throw replicationDeleted ? markDeleteStarted(error) : error;
54748
55432
  if (error instanceof FileSystemNotFound) {
54749
55433
  const clientRegion = await this.getClient().config.region();
54750
55434
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
@@ -54753,7 +55437,9 @@ async function deleteFileSystem(logicalId, physicalId, resourceType, context) {
54753
55437
  }
54754
55438
  const cause = error instanceof Error ? error : void 0;
54755
55439
  const log = createMaskedLogSinks(this.logger, context?.maskSecrets);
54756
- throw this.wrapDeleteError(log, error, (text) => new ProvisioningError(`Failed to delete EFS FileSystem ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
55440
+ const step = replicationDeleted && isReplicationRefusal(error) ? " (its replication configuration was deleted, and the teardown had not finished; re-run destroy once it has)" : "";
55441
+ const thrown = this.wrapDeleteError(log, error, (text) => new ProvisioningError(`Failed to delete EFS FileSystem ${logicalId}: ${text}${step}`, resourceType, logicalId, physicalId, cause));
55442
+ throw replicationDeleted ? markDeleteStarted(thrown) : thrown;
54757
55443
  }
54758
55444
  }
54759
55445
 
@@ -55263,23 +55949,30 @@ async function readFileSystem(physicalId, properties, context, logicalId = physi
55263
55949
  });
55264
55950
  } catch (err) {
55265
55951
  if (err instanceof FileSystemNotFound) return RESOURCE_NOT_FOUND;
55266
- if (err.name !== "PolicyNotFound") {}
55952
+ if (err.name !== "PolicyNotFound") throw err;
55267
55953
  }
55268
55954
  try {
55269
55955
  const resp = await this.getClient().send(new DescribeBackupPolicyCommand({ FileSystemId: physicalId }));
55270
55956
  if (resp.BackupPolicy?.Status !== void 0) result["BackupPolicy"] = { Status: resp.BackupPolicy.Status };
55271
55957
  } catch (err) {
55272
55958
  if (err instanceof FileSystemNotFound) return RESOURCE_NOT_FOUND;
55959
+ const name = err.name;
55960
+ if (name !== "PolicyNotFound" && name !== "ValidationException") throw err;
55273
55961
  }
55274
55962
  let policy;
55963
+ let policyError;
55964
+ let policyFailed = false;
55275
55965
  try {
55276
55966
  policy = await readFileSystemPolicy.call(this, physicalId);
55277
55967
  } catch (err) {
55278
55968
  if (err instanceof FileSystemNotFound) return RESOURCE_NOT_FOUND;
55279
55969
  policy = memberReadFailure(err);
55970
+ policyError = err;
55971
+ policyFailed = true;
55280
55972
  }
55281
55973
  const declared = context?.afterOwnWrite === true ? declaredMemberDocument(properties?.["FileSystemPolicy"]) : void 0;
55282
55974
  if (declared !== void 0) policy = await settleDeclaredMember(policy, () => readFileSystemPolicy.call(this, physicalId), (document) => efsPolicyMatchesDeclared(document, declared, physicalId), declared, this.ownWriteRereadDelaysMs, () => warnUnsettledMember(this.logger, logicalId, "AWS::EFS::FileSystem", "FileSystemPolicy"));
55975
+ if (policyFailed && (policy === "failed" || policy === "refused")) throw policyError;
55283
55976
  if (typeof policy === "object") result["FileSystemPolicy"] = policy.value;
55284
55977
  result["FileSystemTags"] = normalizeAwsTagsToCfn(fs.Tags);
55285
55978
  return result;
@@ -55341,7 +56034,9 @@ async function readMountTarget(physicalId) {
55341
56034
  let securityGroups = [];
55342
56035
  try {
55343
56036
  securityGroups = ((await this.getClient().send(new DescribeMountTargetSecurityGroupsCommand({ MountTargetId: physicalId }))).SecurityGroups ?? []).filter((s) => typeof s === "string");
55344
- } catch {}
56037
+ } catch (err) {
56038
+ if (!(err instanceof MountTargetNotFound)) throw err;
56039
+ }
55345
56040
  result["SecurityGroups"] = securityGroups;
55346
56041
  return result;
55347
56042
  }
@@ -55525,7 +56220,7 @@ var EFSProvider = class {
55525
56220
  }
55526
56221
  readCurrentState(physicalId, _logicalId, resourceType, properties, context) {
55527
56222
  if (resourceType === "AWS::EFS::FileSystem") return this.readFileSystem(physicalId, properties, context, _logicalId);
55528
- return readCurrentState$9.call(this, physicalId, _logicalId, resourceType);
56223
+ return readCurrentState$11.call(this, physicalId, _logicalId, resourceType);
55529
56224
  }
55530
56225
  readFileSystem(physicalId, properties, context, logicalId) {
55531
56226
  return readFileSystem.call(this, physicalId, properties, context, logicalId);
@@ -56703,7 +57398,7 @@ function getDriftUnorderedPaths(resourceType) {
56703
57398
  if (resourceType !== "AWS::FSx::FileSystem") return [];
56704
57399
  return ["WindowsConfiguration.Aliases"];
56705
57400
  }
56706
- async function readCurrentState$8(physicalId, _logicalId, resourceType) {
57401
+ async function readCurrentState$10(physicalId, _logicalId, resourceType) {
56707
57402
  if (resourceType !== "AWS::FSx::FileSystem") return void 0;
56708
57403
  let fs;
56709
57404
  let listed;
@@ -56948,7 +57643,7 @@ var FSxFileSystemProvider = class {
56948
57643
  return getDriftUnorderedPaths.call(this, resourceType);
56949
57644
  }
56950
57645
  readCurrentState(physicalId, _logicalId, resourceType) {
56951
- return readCurrentState$8.call(this, physicalId, _logicalId, resourceType);
57646
+ return readCurrentState$10.call(this, physicalId, _logicalId, resourceType);
56952
57647
  }
56953
57648
  import(input) {
56954
57649
  return importImpl$8.call(this, input);
@@ -57392,6 +58087,126 @@ function toAutoTerminationPolicy(config) {
57392
58087
  return { IdleTimeout: toNumber$2(config["IdleTimeout"]) };
57393
58088
  }
57394
58089
 
58090
+ // src/provisioning/providers/emr-instance-group-config/remove-scaling-policy.ts
58091
+ async function removeScalingPolicyForDelete(client, clusterId, instanceGroupId) {
58092
+ try {
58093
+ await client.send(new RemoveAutoScalingPolicyCommand({
58094
+ ClusterId: clusterId,
58095
+ InstanceGroupId: instanceGroupId
58096
+ }));
58097
+ return true;
58098
+ } catch (error) {
58099
+ const e = error;
58100
+ if (e?.name === "ValidationException" && typeof e.message === "string" && /policy was not found/i.test(e.message)) return false;
58101
+ throw error;
58102
+ }
58103
+ }
58104
+
58105
+ // src/provisioning/providers/emr-instance-group-config/read-state.ts
58106
+ const CLUSTER_ID$1 = /^j-[A-Z0-9]+$/;
58107
+ async function readCurrentState$9(physicalId, resourceType, properties) {
58108
+ if (resourceType !== "AWS::EMR::InstanceGroupConfig") return void 0;
58109
+ const clusterId = properties?.["JobFlowId"];
58110
+ if (typeof clusterId !== "string" || !CLUSTER_ID$1.test(clusterId)) return void 0;
58111
+ let group;
58112
+ try {
58113
+ let marker;
58114
+ do {
58115
+ const resp = await this.getClient().send(new ListInstanceGroupsCommand({
58116
+ ClusterId: clusterId,
58117
+ ...marker && { Marker: marker }
58118
+ }));
58119
+ group = (resp.InstanceGroups ?? []).find((g) => g.Id === physicalId);
58120
+ marker = group === void 0 ? resp.Marker : void 0;
58121
+ } while (marker);
58122
+ } catch (error) {
58123
+ if (error instanceof InvalidRequestException) return void 0;
58124
+ throw error;
58125
+ }
58126
+ const state = group?.Status?.State;
58127
+ if (group === void 0 || state === "TERMINATED" || state === "ENDED") return RESOURCE_NOT_FOUND;
58128
+ const out = { JobFlowId: clusterId };
58129
+ if (group.InstanceGroupType !== void 0) out["InstanceRole"] = group.InstanceGroupType;
58130
+ if (group.InstanceType !== void 0) out["InstanceType"] = group.InstanceType;
58131
+ if (group.RequestedInstanceCount !== void 0) out["InstanceCount"] = group.RequestedInstanceCount;
58132
+ if (group.Name !== void 0) out["Name"] = group.Name;
58133
+ if (group.Market !== void 0) out["Market"] = group.Market;
58134
+ if (group.BidPrice !== void 0) out["BidPrice"] = group.BidPrice;
58135
+ if (group.CustomAmiId !== void 0) out["CustomAmiId"] = group.CustomAmiId;
58136
+ if (group.Configurations !== void 0 && group.Configurations.length > 0) out["Configurations"] = group.Configurations.map(configurationOf$1);
58137
+ const ebs = ebsConfigurationOf$1(group.EbsBlockDevices, group.EbsOptimized);
58138
+ if (ebs !== void 0) out["EbsConfiguration"] = ebs;
58139
+ if (group.AutoScalingPolicy !== void 0) out["AutoScalingPolicy"] = definedOnly$1({
58140
+ Constraints: group.AutoScalingPolicy.Constraints,
58141
+ Rules: group.AutoScalingPolicy.Rules
58142
+ });
58143
+ return out;
58144
+ }
58145
+ function definedOnly$1(value) {
58146
+ if (Array.isArray(value)) return value.map(definedOnly$1);
58147
+ if (typeof value !== "object" || value === null) return value;
58148
+ return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0).map(([k, v]) => [k, definedOnly$1(v)]));
58149
+ }
58150
+ function configurationOf$1(c) {
58151
+ const out = {};
58152
+ if (c.Classification !== void 0) out["Classification"] = c.Classification;
58153
+ if (c.Properties !== void 0) out["ConfigurationProperties"] = { ...c.Properties };
58154
+ if (c.Configurations !== void 0 && c.Configurations.length > 0) out["Configurations"] = c.Configurations.map(configurationOf$1);
58155
+ return out;
58156
+ }
58157
+ function ebsConfigurationOf$1(devices, ebsOptimized) {
58158
+ const configs = [];
58159
+ for (const device of devices ?? []) {
58160
+ const spec = definedOnly$1({
58161
+ VolumeType: device.VolumeSpecification?.VolumeType,
58162
+ SizeInGB: device.VolumeSpecification?.SizeInGB,
58163
+ Iops: device.VolumeSpecification?.Iops,
58164
+ Throughput: device.VolumeSpecification?.Throughput
58165
+ });
58166
+ const last = configs[configs.length - 1];
58167
+ if (last !== void 0 && JSON.stringify(last.VolumeSpecification) === JSON.stringify(spec)) last.VolumesPerInstance += 1;
58168
+ else configs.push({
58169
+ VolumeSpecification: spec,
58170
+ VolumesPerInstance: 1
58171
+ });
58172
+ }
58173
+ if (configs.length === 0 && ebsOptimized === void 0) return void 0;
58174
+ const out = {};
58175
+ if (configs.length > 0) out["EbsBlockDeviceConfigs"] = configs;
58176
+ if (ebsOptimized !== void 0) out["EbsOptimized"] = ebsOptimized;
58177
+ return out;
58178
+ }
58179
+
58180
+ // src/provisioning/providers/emr-instance-group-config/find-group.ts
58181
+ async function findGroupForPoll(clusterId, groupId, transientState, maxConsecutiveTransient = 5) {
58182
+ try {
58183
+ let marker;
58184
+ do {
58185
+ const resp = await this.getClient().send(new ListInstanceGroupsCommand({
58186
+ ClusterId: clusterId,
58187
+ ...marker && { Marker: marker }
58188
+ }));
58189
+ const found = (resp.InstanceGroups ?? []).find((g) => g.Id === groupId);
58190
+ if (found) {
58191
+ transientState.count = 0;
58192
+ return found;
58193
+ }
58194
+ marker = resp.Marker;
58195
+ } while (marker);
58196
+ transientState.count = 0;
58197
+ return;
58198
+ } catch (error) {
58199
+ const name = error instanceof Error ? error.name : "";
58200
+ const msg = describeAwsFailure(error).detail;
58201
+ if ((name === "ThrottlingException" || name === "InternalServerException" || name === "InternalServerError" || name === "TimeoutError" || /rate exceeded|too many requests|throttl|timed? ?out|ECONNRESET|EPIPE|socket hang up/i.test(msg)) && transientState.count < maxConsecutiveTransient) {
58202
+ transientState.count += 1;
58203
+ this.logger.debug(safeMsg`Transient ListInstanceGroups error while polling ${groupId} (${transientState.count}/${maxConsecutiveTransient}): ${msg} — retrying`);
58204
+ return;
58205
+ }
58206
+ throw error;
58207
+ }
58208
+ }
58209
+
57395
58210
  // src/provisioning/providers/emr-instance-group-config-provider.ts
57396
58211
  const DEFAULT_MAX_WAIT_MS$1 = 36e5;
57397
58212
  const DEFAULT_POLL_INTERVAL_MS$1 = 15e3;
@@ -57662,6 +58477,16 @@ var EMRInstanceGroupConfigProvider = class {
57662
58477
  const jobFlowId = properties?.["JobFlowId"];
57663
58478
  if (role === "TASK" && jobFlowId && isRedactedRecordedValue(jobFlowId)) this.logger.warn(safeMsg`EMR instance group ${logicalId}: JobFlowId is redacted in state, so the ` + "best-effort scale-to-0 was not attempted — its instances are released when the parent cluster terminates");
57664
58479
  else if (role === "TASK" && jobFlowId) {
58480
+ if (properties?.["AutoScalingPolicy"] !== void 0) try {
58481
+ await removeScalingPolicyForDelete(this.getClient(), jobFlowId, physicalId);
58482
+ } catch (error) {
58483
+ if (error instanceof InvalidRequestException) this.logger.debug(safeMsg`EMR instance group ${physicalId} policy removal skipped (cluster/group gone)`);
58484
+ else {
58485
+ const head = safeMsg`Removing the automatic scaling policy of EMR instance group ${physicalId} failed: `;
58486
+ const text = this.cleanupFailureText(head, error, context?.maskSecrets);
58487
+ this.logger.warn(maskerOrIdentity(context?.maskSecrets)(safeMsg`${head}${text}`));
58488
+ }
58489
+ }
57665
58490
  try {
57666
58491
  await this.getClient().send(new ModifyInstanceGroupsCommand({
57667
58492
  ClusterId: jobFlowId,
@@ -57715,6 +58540,9 @@ var EMRInstanceGroupConfigProvider = class {
57715
58540
  }
57716
58541
  throw new ProvisioningError(`Timed out waiting for EMR instance group ${groupId} to reach RUNNING with ${expectedCount} instance(s) (${Math.round(this.maxWaitMs / 6e4)} min)`, resourceType, logicalId, groupId);
57717
58542
  }
58543
+ readCurrentState(physicalId, _logicalId, resourceType, properties) {
58544
+ return readCurrentState$9.call(this, physicalId, resourceType, properties);
58545
+ }
57718
58546
  async readUnsettled(physicalId, logicalId, resourceType, _names, recordedProperties) {
57719
58547
  const jobFlowId = recordedProperties?.["JobFlowId"];
57720
58548
  if (typeof jobFlowId !== "string" || jobFlowId === "") throw new ProvisioningError(`EMR InstanceGroupConfig ${logicalId} has no JobFlowId (the cluster id) recorded, so cdkd cannot read the group to converge what an earlier failed update left unsettled`, resourceType, logicalId, physicalId);
@@ -57736,33 +58564,8 @@ var EMRInstanceGroupConfigProvider = class {
57736
58564
  return /* @__PURE__ */ new Set(["InstanceCount"]);
57737
58565
  }
57738
58566
  }
57739
- async findGroupForPoll(clusterId, groupId, transientState, maxConsecutiveTransient = 5) {
57740
- try {
57741
- let marker;
57742
- do {
57743
- const resp = await this.getClient().send(new ListInstanceGroupsCommand({
57744
- ClusterId: clusterId,
57745
- ...marker && { Marker: marker }
57746
- }));
57747
- const found = (resp.InstanceGroups ?? []).find((g) => g.Id === groupId);
57748
- if (found) {
57749
- transientState.count = 0;
57750
- return found;
57751
- }
57752
- marker = resp.Marker;
57753
- } while (marker);
57754
- transientState.count = 0;
57755
- return;
57756
- } catch (error) {
57757
- const name = error instanceof Error ? error.name : "";
57758
- const msg = describeAwsFailure(error).detail;
57759
- if ((name === "ThrottlingException" || name === "InternalServerException" || name === "InternalServerError" || name === "TimeoutError" || /rate exceeded|too many requests|throttl|timed? ?out|ECONNRESET|EPIPE|socket hang up/i.test(msg)) && transientState.count < maxConsecutiveTransient) {
57760
- transientState.count += 1;
57761
- this.logger.debug(`Transient ListInstanceGroups error while polling ${groupId} (${transientState.count}/${maxConsecutiveTransient}): ${msg} — retrying`);
57762
- return;
57763
- }
57764
- throw error;
57765
- }
58567
+ findGroupForPoll(clusterId, groupId, transientState, maxConsecutiveTransient) {
58568
+ return findGroupForPoll.call(this, clusterId, groupId, transientState, maxConsecutiveTransient);
57766
58569
  }
57767
58570
  };
57768
58571
 
@@ -57980,6 +58783,97 @@ async function deleteImpl$9(logicalId, physicalId, resourceType, properties, con
57980
58783
  this.logger.debug(`EMR instance fleet ${physicalId} (type ${fleetType ?? "unknown"}) has no standalone delete API; its instances are released when the parent cluster terminates. Removing cdkd state only.`);
57981
58784
  }
57982
58785
 
58786
+ // src/provisioning/providers/emr-instance-fleet-config/read-state.ts
58787
+ const CLUSTER_ID = /^j-[A-Z0-9]+$/;
58788
+ async function readCurrentState$8(physicalId, _logicalId, resourceType, properties) {
58789
+ if (resourceType !== "AWS::EMR::InstanceFleetConfig") return void 0;
58790
+ const clusterId = properties?.["ClusterId"];
58791
+ if (typeof clusterId !== "string" || !CLUSTER_ID.test(clusterId)) return void 0;
58792
+ let fleet;
58793
+ try {
58794
+ let marker;
58795
+ do {
58796
+ const resp = await this.getClient().send(new ListInstanceFleetsCommand({
58797
+ ClusterId: clusterId,
58798
+ ...marker && { Marker: marker }
58799
+ }));
58800
+ fleet = (resp.InstanceFleets ?? []).find((f) => f.Id === physicalId);
58801
+ marker = fleet === void 0 ? resp.Marker : void 0;
58802
+ } while (marker);
58803
+ } catch (error) {
58804
+ if (error instanceof InvalidRequestException) return void 0;
58805
+ throw error;
58806
+ }
58807
+ if (fleet === void 0 || fleet.Status?.State === "TERMINATED") return RESOURCE_NOT_FOUND;
58808
+ const out = { ClusterId: clusterId };
58809
+ if (fleet.InstanceFleetType !== void 0) out["InstanceFleetType"] = fleet.InstanceFleetType;
58810
+ if (fleet.Name !== void 0) out["Name"] = fleet.Name;
58811
+ if (fleet.TargetOnDemandCapacity !== void 0) out["TargetOnDemandCapacity"] = fleet.TargetOnDemandCapacity;
58812
+ if (fleet.TargetSpotCapacity !== void 0) out["TargetSpotCapacity"] = fleet.TargetSpotCapacity;
58813
+ if (fleet.InstanceTypeSpecifications !== void 0) out["InstanceTypeConfigs"] = inRecordedOrder(fleet.InstanceTypeSpecifications.map(instanceTypeConfigOf), properties?.["InstanceTypeConfigs"]);
58814
+ if (fleet.LaunchSpecifications !== void 0) out["LaunchSpecifications"] = definedOnly(fleet.LaunchSpecifications);
58815
+ if (fleet.ResizeSpecifications !== void 0) out["ResizeSpecifications"] = definedOnly(fleet.ResizeSpecifications);
58816
+ return out;
58817
+ }
58818
+ function definedOnly(value) {
58819
+ if (Array.isArray(value)) return value.map(definedOnly);
58820
+ if (typeof value !== "object" || value === null) return value;
58821
+ return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0).map(([k, v]) => [k, definedOnly(v)]));
58822
+ }
58823
+ function instanceTypeConfigOf(spec) {
58824
+ const out = {};
58825
+ if (spec.InstanceType !== void 0) out["InstanceType"] = spec.InstanceType;
58826
+ if (spec.WeightedCapacity !== void 0) out["WeightedCapacity"] = spec.WeightedCapacity;
58827
+ if (spec.BidPrice !== void 0) out["BidPrice"] = spec.BidPrice;
58828
+ if (spec.BidPriceAsPercentageOfOnDemandPrice !== void 0) out["BidPriceAsPercentageOfOnDemandPrice"] = spec.BidPriceAsPercentageOfOnDemandPrice;
58829
+ if (spec.CustomAmiId !== void 0) out["CustomAmiId"] = spec.CustomAmiId;
58830
+ if (spec.Priority !== void 0) out["Priority"] = spec.Priority;
58831
+ if (spec.Configurations !== void 0 && spec.Configurations.length > 0) out["Configurations"] = spec.Configurations.map(configurationOf);
58832
+ const ebs = ebsConfigurationOf(spec.EbsBlockDevices, spec.EbsOptimized);
58833
+ if (ebs !== void 0) out["EbsConfiguration"] = ebs;
58834
+ return out;
58835
+ }
58836
+ function configurationOf(c) {
58837
+ const out = {};
58838
+ if (c.Classification !== void 0) out["Classification"] = c.Classification;
58839
+ if (c.Properties !== void 0) out["ConfigurationProperties"] = { ...c.Properties };
58840
+ if (c.Configurations !== void 0 && c.Configurations.length > 0) out["Configurations"] = c.Configurations.map(configurationOf);
58841
+ return out;
58842
+ }
58843
+ function ebsConfigurationOf(devices, ebsOptimized) {
58844
+ const configs = [];
58845
+ for (const device of devices ?? []) {
58846
+ const spec = definedOnly({
58847
+ VolumeType: device.VolumeSpecification?.VolumeType,
58848
+ SizeInGB: device.VolumeSpecification?.SizeInGB,
58849
+ Iops: device.VolumeSpecification?.Iops,
58850
+ Throughput: device.VolumeSpecification?.Throughput
58851
+ });
58852
+ const last = configs[configs.length - 1];
58853
+ if (last !== void 0 && JSON.stringify(last.VolumeSpecification) === JSON.stringify(spec)) last.VolumesPerInstance += 1;
58854
+ else configs.push({
58855
+ VolumeSpecification: spec,
58856
+ VolumesPerInstance: 1
58857
+ });
58858
+ }
58859
+ if (configs.length === 0 && ebsOptimized === void 0) return void 0;
58860
+ const out = {};
58861
+ if (configs.length > 0) out["EbsBlockDeviceConfigs"] = configs;
58862
+ if (ebsOptimized !== void 0) out["EbsOptimized"] = ebsOptimized;
58863
+ return out;
58864
+ }
58865
+ function inRecordedOrder(read, recorded) {
58866
+ if (!Array.isArray(recorded)) return read;
58867
+ const left = [...read];
58868
+ const out = [];
58869
+ for (const entry of recorded) {
58870
+ const type = entry?.["InstanceType"];
58871
+ const i = left.findIndex((r) => r["InstanceType"] === type);
58872
+ if (i >= 0) out.push(...left.splice(i, 1));
58873
+ }
58874
+ return [...out, ...left];
58875
+ }
58876
+
57983
58877
  // src/provisioning/providers/emr-instance-fleet-config/wait.ts
57984
58878
  function targetCapacities(properties) {
57985
58879
  return {
@@ -58134,6 +59028,9 @@ var EMRInstanceFleetConfigProvider = class {
58134
59028
  async getAttribute(physicalId, _resourceType, attributeName) {
58135
59029
  if (attributeName === "Id" || attributeName === "InstanceFleetId") return physicalId;
58136
59030
  }
59031
+ readCurrentState(physicalId, logicalId, resourceType, properties) {
59032
+ return readCurrentState$8.call(this, physicalId, logicalId, resourceType, properties);
59033
+ }
58137
59034
  targetCapacities(properties) {
58138
59035
  return targetCapacities.call(this, properties);
58139
59036
  }
@@ -59657,7 +60554,7 @@ async function deleteImpl$7(logicalId, physicalId, resourceType, _properties, co
59657
60554
  try {
59658
60555
  await this.getClient().send(new DeleteDeliveryStreamCommand({ DeliveryStreamName: physicalId }));
59659
60556
  } catch (error) {
59660
- if (error instanceof ResourceNotFoundException$14) {
60557
+ if (error instanceof ResourceNotFoundException$15) {
59661
60558
  const clientRegion = await this.getClient().config.region();
59662
60559
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
59663
60560
  this.logger.debug(`Firehose delivery stream ${physicalId} does not exist, skipping deletion`);
@@ -59682,7 +60579,7 @@ async function readDeliveryStreamStatusForDelete(streamName) {
59682
60579
  try {
59683
60580
  return (await this.getClient().send(new DescribeDeliveryStreamCommand({ DeliveryStreamName: streamName }))).DeliveryStreamDescription?.DeliveryStreamStatus ?? "UNKNOWN";
59684
60581
  } catch (error) {
59685
- if (error instanceof ResourceNotFoundException$14) return void 0;
60582
+ if (error instanceof ResourceNotFoundException$15) return void 0;
59686
60583
  throw error;
59687
60584
  }
59688
60585
  }
@@ -60043,7 +60940,7 @@ async function readCurrentState$6(physicalId, _logicalId, _resourceType, propert
60043
60940
  try {
60044
60941
  desc = (await this.getClient().send(new DescribeDeliveryStreamCommand({ DeliveryStreamName: physicalId }))).DeliveryStreamDescription;
60045
60942
  } catch (err) {
60046
- if (err instanceof ResourceNotFoundException$14) return RESOURCE_NOT_FOUND;
60943
+ if (err instanceof ResourceNotFoundException$15) return RESOURCE_NOT_FOUND;
60047
60944
  throw err;
60048
60945
  }
60049
60946
  if (!desc) return void 0;
@@ -60076,9 +60973,8 @@ async function readCurrentState$6(physicalId, _logicalId, _resourceType, propert
60076
60973
  const tagsResp = await this.getClient().send(new ListTagsForDeliveryStreamCommand({ DeliveryStreamName: physicalId }));
60077
60974
  result["Tags"] = normalizeAwsTagsToCfn(tagsResp.Tags);
60078
60975
  } catch (err) {
60079
- if (err instanceof ResourceNotFoundException$14) return RESOURCE_NOT_FOUND;
60080
- this.logger.debug(`Firehose ListTagsForDeliveryStream(${physicalId}) failed: ${describeAwsFailure(err).detail}`);
60081
- result["Tags"] = [];
60976
+ if (err instanceof ResourceNotFoundException$15) return RESOURCE_NOT_FOUND;
60977
+ throw err;
60082
60978
  }
60083
60979
  return result;
60084
60980
  }
@@ -60094,7 +60990,7 @@ async function importImpl$6(input) {
60094
60990
  attributes: {}
60095
60991
  };
60096
60992
  } catch (err) {
60097
- if (err instanceof ResourceNotFoundException$14) return null;
60993
+ if (err instanceof ResourceNotFoundException$15) return null;
60098
60994
  throw err;
60099
60995
  }
60100
60996
  return null;
@@ -60644,15 +61540,6 @@ async function update$6(logicalId, physicalId, resourceType, properties, previou
60644
61540
  throw this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to update CloudTrail Trail ${logicalId}: ${text}` + (appliedBeforeFailure.length > 0 ? ` (selector/aggregation writes already applied before this failure: ${appliedBeforeFailure.join("; ")})` : ""), resourceType, logicalId, physicalId, cause));
60645
61541
  }
60646
61542
  }
60647
- async function readLiveForRecord(physicalId, resourceType) {
60648
- try {
60649
- const live = await this.readCurrentState(physicalId, "", resourceType);
60650
- return live !== void 0 && live !== RESOURCE_NOT_FOUND ? live : void 0;
60651
- } catch (error) {
60652
- this.logger.debug(safeMsg`CloudTrail read-back for the record failed: ${describeAwsFailure(error).detail}`);
60653
- return;
60654
- }
60655
- }
60656
61543
 
60657
61544
  // src/provisioning/providers/cloudtrail/delete.ts
60658
61545
  async function deleteImpl$6(logicalId, physicalId, resourceType, properties, context) {
@@ -60739,35 +61626,60 @@ async function readCurrentState$5(physicalId, _logicalId, _resourceType) {
60739
61626
  result["RecursiveLogging"] = trail.RecursiveLogging ?? true;
60740
61627
  try {
60741
61628
  result["IsLogging"] = (await this.getClient().send(new GetTrailStatusCommand({ Name: physicalId }))).IsLogging ?? false;
60742
- } catch {}
60743
- try {
60744
- const sel = await this.getClient().send(new GetEventSelectorsCommand({ TrailName: physicalId }));
60745
- const hasAdvanced = Array.isArray(sel.AdvancedEventSelectors) && sel.AdvancedEventSelectors.length > 0;
60746
- if (!hasAdvanced) result["EventSelectors"] = (sel.EventSelectors ?? []).map((es) => es);
60747
- result["AdvancedEventSelectors"] = hasAdvanced ? advancedSelectorsToCfn(sel.AdvancedEventSelectors ?? []) : [];
60748
- } catch {}
61629
+ } catch (err) {
61630
+ if (!(err instanceof TrailNotFoundException)) throw err;
61631
+ }
61632
+ await readSelectorBlocks.call(this, physicalId, result);
60749
61633
  let insightSelectors = [];
60750
61634
  try {
60751
61635
  insightSelectors = ((await this.getClient().send(new GetInsightSelectorsCommand({ TrailName: physicalId }))).InsightSelectors ?? []).map((s) => ({ ...s.InsightType !== void 0 && { InsightType: s.InsightType } }));
60752
- } catch {}
61636
+ } catch (err) {
61637
+ if (!(err instanceof InsightNotEnabledException || err instanceof TrailNotFoundException)) throw err;
61638
+ }
60753
61639
  result["InsightSelectors"] = insightSelectors;
60754
61640
  let tags = [];
60755
61641
  if (trail.TrailARN) try {
60756
61642
  const tagsResp = await this.getClient().send(new ListTagsCommand$2({ ResourceIdList: [trail.TrailARN] }));
60757
61643
  tags = normalizeAwsTagsToCfn(tagsResp.ResourceTagList?.[0]?.TagsList);
60758
61644
  } catch (err) {
60759
- this.logger.debug(`CloudTrail ListTags(${trail.TrailARN}) failed: ${describeAwsFailure(err).detail}`);
61645
+ if (!(err instanceof ResourceNotFoundException$16)) throw err;
60760
61646
  }
60761
61647
  result["Tags"] = tags;
61648
+ await readAggregationBlock.call(this, physicalId, result);
61649
+ return result;
61650
+ }
61651
+ async function readSelectorBlocks(physicalId, result) {
61652
+ try {
61653
+ const sel = await this.getClient().send(new GetEventSelectorsCommand({ TrailName: physicalId }));
61654
+ const hasAdvanced = Array.isArray(sel.AdvancedEventSelectors) && sel.AdvancedEventSelectors.length > 0;
61655
+ if (!hasAdvanced) result["EventSelectors"] = (sel.EventSelectors ?? []).map((es) => es);
61656
+ result["AdvancedEventSelectors"] = hasAdvanced ? advancedSelectorsToCfn(sel.AdvancedEventSelectors ?? []) : [];
61657
+ } catch (err) {
61658
+ if (!(err instanceof TrailNotFoundException)) throw err;
61659
+ }
61660
+ }
61661
+ async function readAggregationBlock(physicalId, result) {
60762
61662
  try {
60763
61663
  result["AggregationConfigurations"] = ((await this.getClient().send(new GetEventConfigurationCommand({ TrailName: physicalId }))).AggregationConfigurations ?? []).map((a) => ({
60764
61664
  ...a.EventCategory !== void 0 && { EventCategory: a.EventCategory },
60765
61665
  ...a.Templates !== void 0 && { Templates: a.Templates }
60766
61666
  }));
60767
61667
  } catch (err) {
60768
- this.logger.debug(safeMsg`CloudTrail GetEventConfiguration(${physicalId}) failed: ${describeAwsFailure(err).detail}`);
61668
+ if (!(err instanceof TrailNotFoundException)) throw err;
60769
61669
  }
60770
- return result;
61670
+ }
61671
+ async function readLiveForRecord(physicalId, _resourceType) {
61672
+ const live = {};
61673
+ const reads = [["EventSelectors / AdvancedEventSelectors", () => readSelectorBlocks.call(this, physicalId, live)], ["AggregationConfigurations", () => readAggregationBlock.call(this, physicalId, live)]];
61674
+ for (const [keys, read] of reads) try {
61675
+ await read();
61676
+ } catch (error) {
61677
+ const name = error?.name;
61678
+ const errorClass = typeof name === "string" && /^[A-Za-z0-9_]{1,64}$/.test(name) ? name : "Error";
61679
+ this.logger.warn(safeMsg`CloudTrail read-back of ${keys} for the record failed (${errorClass}); a skipped block among them is left out of the record.`);
61680
+ this.logger.debug(safeMsg`CloudTrail read-back of ${keys} failed: ${describeAwsFailure(error).detail}`);
61681
+ }
61682
+ return live;
60771
61683
  }
60772
61684
  async function importImpl$5(input) {
60773
61685
  const explicit = resolveExplicitPhysicalId(input, "TrailName");
@@ -61300,7 +62212,7 @@ async function deleteImpl$5(logicalId, physicalId, resourceType, _properties, co
61300
62212
  await this.getClient().send(new DeleteProjectCommand({ name: physicalId }));
61301
62213
  this.logger.debug(`Successfully deleted CodeBuild Project ${logicalId}`);
61302
62214
  } catch (error) {
61303
- if (error instanceof ResourceNotFoundException$15) {
62215
+ if (error instanceof ResourceNotFoundException$17) {
61304
62216
  const clientRegion = await this.getClient().config.region();
61305
62217
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
61306
62218
  this.logger.debug(`CodeBuild Project ${physicalId} does not exist, skipping deletion`);
@@ -61326,7 +62238,7 @@ async function readProject(physicalId) {
61326
62238
  try {
61327
62239
  project = (await this.getClient().send(new BatchGetProjectsCommand({ names: [physicalId] }))).projects?.[0];
61328
62240
  } catch (err) {
61329
- if (err instanceof ResourceNotFoundException$15) return RESOURCE_NOT_FOUND;
62241
+ if (err instanceof ResourceNotFoundException$17) return RESOURCE_NOT_FOUND;
61330
62242
  throw err;
61331
62243
  }
61332
62244
  if (!project) return RESOURCE_NOT_FOUND;
@@ -61501,7 +62413,7 @@ async function importImpl$4(input) {
61501
62413
  attributes: {}
61502
62414
  } : null;
61503
62415
  } catch (err) {
61504
- if (err instanceof ResourceNotFoundException$15) return null;
62416
+ if (err instanceof ResourceNotFoundException$17) return null;
61505
62417
  throw err;
61506
62418
  }
61507
62419
  return null;
@@ -62354,7 +63266,7 @@ var DLMLifecyclePolicyProvider = class {
62354
63266
  created = detail.Policy?.DateCreated;
62355
63267
  defaultType = detail.Policy?.PolicyDetails?.ResourceType;
62356
63268
  } catch (error) {
62357
- if (error instanceof ResourceNotFoundException$16) continue;
63269
+ if (error instanceof ResourceNotFoundException$18) continue;
62358
63270
  throw error;
62359
63271
  }
62360
63272
  if (isDefault && defaultType !== void 0 && defaultType !== input.DefaultPolicy) continue;
@@ -62482,7 +63394,7 @@ var DLMLifecyclePolicyProvider = class {
62482
63394
  await this.getClient().send(new DeleteLifecyclePolicyCommand$1({ PolicyId: physicalId }));
62483
63395
  this.logger.debug(`Successfully deleted DLM Lifecycle Policy ${logicalId}`);
62484
63396
  } catch (error) {
62485
- if (error instanceof ResourceNotFoundException$16) {
63397
+ if (error instanceof ResourceNotFoundException$18) {
62486
63398
  const clientRegion = await this.getClient().config.region();
62487
63399
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
62488
63400
  this.logger.debug(`DLM Lifecycle Policy ${physicalId} does not exist, skipping deletion`);
@@ -62514,7 +63426,7 @@ var DLMLifecyclePolicyProvider = class {
62514
63426
  Tags: normalizeAwsTagsToCfn(policy.Tags)
62515
63427
  };
62516
63428
  } catch (error) {
62517
- if (error instanceof ResourceNotFoundException$16) return RESOURCE_NOT_FOUND;
63429
+ if (error instanceof ResourceNotFoundException$18) return RESOURCE_NOT_FOUND;
62518
63430
  throw error;
62519
63431
  }
62520
63432
  }
@@ -62538,7 +63450,7 @@ var DLMLifecyclePolicyProvider = class {
62538
63450
  attributes: response.Policy.PolicyArn ? { Arn: response.Policy.PolicyArn } : {}
62539
63451
  } : null;
62540
63452
  } catch (err) {
62541
- if (err instanceof ResourceNotFoundException$16) return null;
63453
+ if (err instanceof ResourceNotFoundException$18) return null;
62542
63454
  throw err;
62543
63455
  }
62544
63456
  return null;
@@ -62552,7 +63464,7 @@ function vectorBucketAttributes(vectorBucketArn, creationTime) {
62552
63464
  CreationTime: isoTimestampAttribute(creationTime)
62553
63465
  });
62554
63466
  }
62555
- var S3VectorsProvider = class {
63467
+ var S3VectorsProvider = class S3VectorsProvider {
62556
63468
  client;
62557
63469
  createClient;
62558
63470
  providerRegion = ambientRegion();
@@ -62685,22 +63597,63 @@ var S3VectorsProvider = class {
62685
63597
  }
62686
63598
  async deleteVectorBucket(logicalId, physicalId, resourceType, context) {
62687
63599
  this.logger.debug(`Deleting S3 VectorBucket ${logicalId}: ${physicalId}`);
62688
- try {
63600
+ const allowEmpty = context?.forceDataDelete === true;
63601
+ if (allowEmpty) try {
62689
63602
  await this.emptyVectorBucket(logicalId, physicalId);
63603
+ } catch (error) {
63604
+ return this.failVectorBucketDelete(logicalId, physicalId, resourceType, error, context);
63605
+ }
63606
+ for (let attempt = 1;; attempt++) try {
62690
63607
  await this.getClient().send(new DeleteVectorBucketCommand({ vectorBucketName: physicalId }));
62691
63608
  this.logger.debug(`Successfully deleted S3 VectorBucket ${logicalId}`);
63609
+ return;
62692
63610
  } catch (error) {
62693
- if (this.isNotFoundError(error)) {
62694
- const clientRegion = await this.getClient().config.region();
62695
- assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
62696
- this.logger.debug(`S3 VectorBucket ${physicalId} does not exist, skipping deletion`);
62697
- return;
62698
- }
62699
- const cause = error instanceof Error ? error : void 0;
62700
- const thrown = this.wrapCaughtError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to delete S3 VectorBucket ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
62701
- throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
63611
+ if (this.isNotFoundError(error) || allowEmpty || attempt > 1) return this.failVectorBucketDelete(logicalId, physicalId, resourceType, error, context);
63612
+ const held = await this.settledHeldIndexes(physicalId).catch((listError) => {
63613
+ this.logger.debug(safeMsg`Could not list S3 VectorBucket ${logicalId}'s indexes after its delete failed: ${listError instanceof Error ? listError.name : typeof listError}`);
63614
+ });
63615
+ if (held === "empty") continue;
63616
+ if (held !== void 0) throw markNonRetryable(new ProvisioningError(maskerOrIdentity(context?.maskSecrets)(`Failed to delete S3 VectorBucket ${logicalId}: vector bucket ${physicalId} is not empty: it holds vector index(es) ${held.names.join(", ")}${held.truncated ? ", and more" : ""}. This operation did not delete them: they were created outside the stack, or retained by a DeletionPolicy. Matching CloudFormation, cdkd does not delete them. Delete them first (aws s3vectors delete-index) and retry the operation; a replacement deletes them only under --force-stateful-recreation.`), resourceType, logicalId, physicalId, error instanceof Error ? error : void 0));
63617
+ return this.failVectorBucketDelete(logicalId, physicalId, resourceType, error, context);
62702
63618
  }
62703
63619
  }
63620
+ async failVectorBucketDelete(logicalId, physicalId, resourceType, error, context) {
63621
+ if (this.isNotFoundError(error)) {
63622
+ const clientRegion = await this.getClient().config.region();
63623
+ assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
63624
+ this.logger.debug(`S3 VectorBucket ${physicalId} does not exist, skipping deletion`);
63625
+ return;
63626
+ }
63627
+ const cause = error instanceof Error ? error : void 0;
63628
+ const thrown = this.wrapCaughtError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to delete S3 VectorBucket ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
63629
+ throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
63630
+ }
63631
+ async listHeldIndexes(vectorBucketName) {
63632
+ const limit = 5;
63633
+ const page = await this.getClient().send(new ListIndexesCommand({ vectorBucketName }));
63634
+ const names = (page.indexes ?? []).map((index) => index.indexName).filter((name) => !!name);
63635
+ return {
63636
+ names: names.slice(0, limit),
63637
+ truncated: names.length > limit || !!page.nextToken
63638
+ };
63639
+ }
63640
+ static HELD_POLL_MS = 2e3;
63641
+ static HELD_STABLE_POLLS = 5;
63642
+ static HELD_MAX_POLLS = 30;
63643
+ async settledHeldIndexes(vectorBucketName) {
63644
+ const key = (held) => JSON.stringify([held.names, held.truncated]);
63645
+ let held = await this.listHeldIndexes(vectorBucketName);
63646
+ if (held.names.length === 0) return "empty";
63647
+ let unchanged = 0;
63648
+ for (let poll = 0; poll < S3VectorsProvider.HELD_MAX_POLLS && unchanged < S3VectorsProvider.HELD_STABLE_POLLS; poll++) {
63649
+ await new Promise((resolve) => setTimeout(resolve, S3VectorsProvider.HELD_POLL_MS));
63650
+ const next = await this.listHeldIndexes(vectorBucketName);
63651
+ if (next.names.length === 0) return "empty";
63652
+ unchanged = key(next) === key(held) ? unchanged + 1 : 0;
63653
+ held = next;
63654
+ }
63655
+ return held;
63656
+ }
62704
63657
  async emptyVectorBucket(logicalId, vectorBucketName) {
62705
63658
  let nextToken;
62706
63659
  do {
@@ -62742,6 +63695,7 @@ var S3VectorsProvider = class {
62742
63695
  const tagsResp = await this.getClient().send(new ListTagsForResourceCommand$19({ resourceArn: bucket.vectorBucketArn }));
62743
63696
  result["Tags"] = normalizeAwsTagsToCfn(tagsResp.tags);
62744
63697
  } catch (err) {
63698
+ if (!this.isNotFoundError(err)) throw err;
62745
63699
  this.logger.debug(`S3Vectors ListTagsForResource(${bucket.vectorBucketArn}) failed: ${describeAwsFailure(err).detail}`);
62746
63700
  result["Tags"] = [];
62747
63701
  }
@@ -64151,21 +65105,79 @@ async function deleteBucketConfig(tableBucketARN, command) {
64151
65105
  }
64152
65106
  async function deleteTableBucket(logicalId, physicalId, resourceType, context) {
64153
65107
  this.logger.debug(`Deleting S3 Table Bucket ${logicalId}: ${physicalId}`);
64154
- try {
65108
+ const allowEmpty = context?.forceDataDelete === true;
65109
+ if (allowEmpty) try {
64155
65110
  await this.emptyTableBucket(physicalId);
65111
+ } catch (error) {
65112
+ return failTableBucketDelete.call(this, logicalId, physicalId, resourceType, error, context);
65113
+ }
65114
+ for (let attempt = 1;; attempt++) try {
64156
65115
  await this.getClient().send(new DeleteTableBucketCommand({ tableBucketARN: physicalId }));
64157
65116
  this.logger.debug(`Successfully deleted S3 Table Bucket ${logicalId}`);
65117
+ return;
64158
65118
  } catch (error) {
64159
- if (error instanceof NotFoundException$7) {
64160
- const clientRegion = await this.getClient().config.region();
64161
- assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
64162
- this.logger.debug(`S3 Table Bucket ${physicalId} does not exist, skipping deletion`);
64163
- return;
65119
+ if (error instanceof NotFoundException$7 || allowEmpty || attempt > 1) return failTableBucketDelete.call(this, logicalId, physicalId, resourceType, error, context);
65120
+ const held = await settledTableBucketContents.call(this, physicalId).catch((listError) => {
65121
+ this.logger.debug(safeMsg`Could not list S3 Table Bucket ${logicalId} after its delete failed: ${listError instanceof Error ? listError.name : typeof listError}`);
65122
+ });
65123
+ if (held === "empty") continue;
65124
+ if (held !== void 0) {
65125
+ const mask = context?.maskSecrets ?? ((text) => text);
65126
+ throw markNonRetryable(new ProvisioningError(mask(`Failed to delete S3 Table Bucket ${logicalId}: table bucket ${physicalId} is not empty: it holds ${describeTableBucketContents(held)}. This operation did not delete them: they were created outside the stack, or retained by a DeletionPolicy. Matching CloudFormation, cdkd does not delete them. Delete them first (aws s3tables delete-table, then aws s3tables delete-namespace) and retry the operation; a replacement deletes them only under --force-stateful-recreation.`), resourceType, logicalId, physicalId, error instanceof Error ? error : void 0));
64164
65127
  }
64165
- const cause = error instanceof Error ? error : void 0;
64166
- const thrown = this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete S3 Table Bucket ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
64167
- throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
65128
+ return failTableBucketDelete.call(this, logicalId, physicalId, resourceType, error, context);
65129
+ }
65130
+ }
65131
+ async function failTableBucketDelete(logicalId, physicalId, resourceType, error, context) {
65132
+ if (error instanceof NotFoundException$7) {
65133
+ const clientRegion = await this.getClient().config.region();
65134
+ assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
65135
+ this.logger.debug(`S3 Table Bucket ${physicalId} does not exist, skipping deletion`);
65136
+ return;
64168
65137
  }
65138
+ const cause = error instanceof Error ? error : void 0;
65139
+ const thrown = this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete S3 Table Bucket ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
65140
+ throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
65141
+ }
65142
+ const HELD_NAME_LIMIT = 5;
65143
+ const HELD_POLL_MS = 2e3;
65144
+ const HELD_STABLE_POLLS = 5;
65145
+ const HELD_MAX_POLLS = 30;
65146
+ async function listTableBucketContents(tableBucketARN) {
65147
+ const namespaces = await this.getClient().send(new ListNamespacesCommand$1({ tableBucketARN }));
65148
+ const namespaceNames = (namespaces.namespaces ?? []).map((ns) => ns.namespace?.[0]).filter((name) => !!name);
65149
+ const tables = await this.getClient().send(new ListTablesCommand({ tableBucketARN }));
65150
+ const tableNames = (tables.tables ?? []).filter((table) => !!table.name).map((table) => `${table.namespace?.[0] ?? "?"}.${table.name}`);
65151
+ return {
65152
+ namespaces: namespaceNames.slice(0, HELD_NAME_LIMIT),
65153
+ tables: tableNames.slice(0, HELD_NAME_LIMIT),
65154
+ truncated: namespaceNames.length > HELD_NAME_LIMIT || tableNames.length > HELD_NAME_LIMIT || !!namespaces.continuationToken || !!tables.continuationToken
65155
+ };
65156
+ }
65157
+ async function settledTableBucketContents(tableBucketARN) {
65158
+ const isEmpty = (held) => held.namespaces.length === 0 && held.tables.length === 0;
65159
+ const key = (held) => JSON.stringify([
65160
+ held.namespaces,
65161
+ held.tables,
65162
+ held.truncated
65163
+ ]);
65164
+ let held = await listTableBucketContents.call(this, tableBucketARN);
65165
+ if (isEmpty(held)) return "empty";
65166
+ let unchanged = 0;
65167
+ for (let poll = 0; poll < HELD_MAX_POLLS && unchanged < HELD_STABLE_POLLS; poll++) {
65168
+ await new Promise((resolve) => setTimeout(resolve, HELD_POLL_MS));
65169
+ const next = await listTableBucketContents.call(this, tableBucketARN);
65170
+ if (isEmpty(next)) return "empty";
65171
+ unchanged = key(next) === key(held) ? unchanged + 1 : 0;
65172
+ held = next;
65173
+ }
65174
+ return held;
65175
+ }
65176
+ function describeTableBucketContents(held) {
65177
+ const parts = [];
65178
+ if (held.tables.length > 0) parts.push(`table(s) ${held.tables.join(", ")}`);
65179
+ if (held.namespaces.length > 0) parts.push(`namespace(s) ${held.namespaces.join(", ")}`);
65180
+ return `${parts.join("; ")}${held.truncated ? ", and more" : ""}`;
64169
65181
  }
64170
65182
  async function emptyTableBucket(tableBucketARN) {
64171
65183
  this.logger.debug(`Emptying table bucket ${tableBucketARN}`);
@@ -64214,64 +65226,6 @@ async function emptyTableBucket(tableBucketARN) {
64214
65226
  } while (namespaceContinuationToken);
64215
65227
  }
64216
65228
 
64217
- // src/provisioning/providers/s3-tables/namespace.ts
64218
- async function createNamespace(logicalId, resourceType, properties, context) {
64219
- this.logger.debug(`Creating S3 Tables Namespace ${logicalId}`);
64220
- const tableBucketARN = properties["TableBucketARN"];
64221
- if (!tableBucketARN) throw new ProvisioningError(`TableBucketARN is required for S3 Tables Namespace ${logicalId}`, resourceType, logicalId);
64222
- const rawNs = properties["Namespace"];
64223
- let namespaceName;
64224
- if (Array.isArray(rawNs) && rawNs.length > 0 && typeof rawNs[0] === "string") namespaceName = rawNs[0];
64225
- else if (typeof rawNs === "string" && rawNs.length > 0) namespaceName = rawNs;
64226
- if (!namespaceName) throw new ProvisioningError(`Namespace is required for S3 Tables Namespace ${logicalId}`, resourceType, logicalId);
64227
- const physicalId = packCompositeId(resourceType, logicalId, [{
64228
- name: "tableBucketARN",
64229
- value: tableBucketARN
64230
- }, {
64231
- name: "namespace",
64232
- value: namespaceName
64233
- }], {
64234
- maskSecrets: context?.maskSecrets,
64235
- ...context?.replayingState === true && { onRefusal: (message) => this.logger.warn(message) }
64236
- });
64237
- try {
64238
- await this.getCreateClient().send(new CreateNamespaceCommand({
64239
- tableBucketARN,
64240
- namespace: [namespaceName]
64241
- }));
64242
- this.logger.debug(`Successfully created S3 Tables Namespace ${logicalId}: ${physicalId}`);
64243
- return {
64244
- physicalId,
64245
- attributes: {}
64246
- };
64247
- } catch (error) {
64248
- const cause = error instanceof Error ? error : void 0;
64249
- throw this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to create S3 Tables Namespace ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause));
64250
- }
64251
- }
64252
- async function deleteNamespace(logicalId, physicalId, resourceType, context) {
64253
- this.logger.debug(`Deleting S3 Tables Namespace ${logicalId}: ${physicalId}`);
64254
- const [tableBucketARN, namespaceName] = physicalId.split("|");
64255
- if (!tableBucketARN || !namespaceName) throw new ProvisioningError(compositeIdFormatMessage(S3_TABLES_NAMESPACE_ID_FORMAT, logicalId, physicalId), resourceType, logicalId, physicalId);
64256
- try {
64257
- await this.getClient().send(new DeleteNamespaceCommand$1({
64258
- tableBucketARN,
64259
- namespace: namespaceName
64260
- }));
64261
- this.logger.debug(`Successfully deleted S3 Tables Namespace ${logicalId}`);
64262
- } catch (error) {
64263
- if (error instanceof NotFoundException$7) {
64264
- const clientRegion = await this.getClient().config.region();
64265
- assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
64266
- this.logger.debug(`S3 Tables Namespace ${physicalId} does not exist, skipping deletion`);
64267
- return;
64268
- }
64269
- const cause = error instanceof Error ? error : void 0;
64270
- const thrown = this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete S3 Tables Namespace ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
64271
- throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
64272
- }
64273
- }
64274
-
64275
65229
  // src/provisioning/providers/s3-tables/table.ts
64276
65230
  async function createTable(logicalId, resourceType, properties, context) {
64277
65231
  this.logger.debug(`Creating S3 Tables Table ${logicalId}`);
@@ -64381,7 +65335,6 @@ async function deleteTable(logicalId, physicalId, resourceType, context) {
64381
65335
  namespace,
64382
65336
  name
64383
65337
  }));
64384
- this.logger.debug(`Successfully deleted S3 Tables Table ${logicalId}`);
64385
65338
  } catch (error) {
64386
65339
  if (error instanceof NotFoundException$7) {
64387
65340
  const clientRegion = await this.getClient().config.region();
@@ -64393,6 +65346,36 @@ async function deleteTable(logicalId, physicalId, resourceType, context) {
64393
65346
  const thrown = this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete S3 Tables Table ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
64394
65347
  throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
64395
65348
  }
65349
+ await waitForGoneAfterDelete({
65350
+ what: safeMsg`S3 Tables Table ${physicalId}`,
65351
+ resourceType,
65352
+ describe: () => tableStillListed.call(this, tableBucketARN, namespace, name),
65353
+ consequence: "Its table bucket's delete may be refused as not empty while the table is still listed; run the destroy again once it is gone.",
65354
+ logger: this.logger,
65355
+ pollIntervalMs: S3_TABLES_CHILD_GONE_POLL_MS,
65356
+ maxWaitMs: S3_TABLES_CHILD_GONE_MAX_WAIT_MS
65357
+ });
65358
+ this.logger.debug(`Successfully deleted S3 Tables Table ${logicalId}`);
65359
+ }
65360
+ const S3_TABLES_CHILD_GONE_POLL_MS = 2e3;
65361
+ const S3_TABLES_CHILD_GONE_MAX_WAIT_MS = 12e4;
65362
+ async function tableStillListed(tableBucketARN, namespace, name) {
65363
+ let continuationToken;
65364
+ try {
65365
+ do {
65366
+ const page = await this.getClient().send(new ListTablesCommand({
65367
+ tableBucketARN,
65368
+ namespace,
65369
+ prefix: name,
65370
+ continuationToken
65371
+ }));
65372
+ if ((page.tables ?? []).some((table) => table.name === name)) return "listed";
65373
+ continuationToken = page.continuationToken;
65374
+ } while (continuationToken);
65375
+ } catch (error) {
65376
+ if (error instanceof NotFoundException$7) return void 0;
65377
+ throw error;
65378
+ }
64396
65379
  }
64397
65380
  async function planTableRename(logicalId, physicalId, resourceType, properties, mask) {
64398
65381
  const desiredString = (key, value) => {
@@ -64460,6 +65443,90 @@ async function lookupTableArn(tableBucketARN, namespace, name) {
64460
65443
  }
64461
65444
  }
64462
65445
 
65446
+ // src/provisioning/providers/s3-tables/namespace.ts
65447
+ async function createNamespace(logicalId, resourceType, properties, context) {
65448
+ this.logger.debug(`Creating S3 Tables Namespace ${logicalId}`);
65449
+ const tableBucketARN = properties["TableBucketARN"];
65450
+ if (!tableBucketARN) throw new ProvisioningError(`TableBucketARN is required for S3 Tables Namespace ${logicalId}`, resourceType, logicalId);
65451
+ const rawNs = properties["Namespace"];
65452
+ let namespaceName;
65453
+ if (Array.isArray(rawNs) && rawNs.length > 0 && typeof rawNs[0] === "string") namespaceName = rawNs[0];
65454
+ else if (typeof rawNs === "string" && rawNs.length > 0) namespaceName = rawNs;
65455
+ if (!namespaceName) throw new ProvisioningError(`Namespace is required for S3 Tables Namespace ${logicalId}`, resourceType, logicalId);
65456
+ const physicalId = packCompositeId(resourceType, logicalId, [{
65457
+ name: "tableBucketARN",
65458
+ value: tableBucketARN
65459
+ }, {
65460
+ name: "namespace",
65461
+ value: namespaceName
65462
+ }], {
65463
+ maskSecrets: context?.maskSecrets,
65464
+ ...context?.replayingState === true && { onRefusal: (message) => this.logger.warn(message) }
65465
+ });
65466
+ try {
65467
+ await this.getCreateClient().send(new CreateNamespaceCommand({
65468
+ tableBucketARN,
65469
+ namespace: [namespaceName]
65470
+ }));
65471
+ this.logger.debug(`Successfully created S3 Tables Namespace ${logicalId}: ${physicalId}`);
65472
+ return {
65473
+ physicalId,
65474
+ attributes: {}
65475
+ };
65476
+ } catch (error) {
65477
+ const cause = error instanceof Error ? error : void 0;
65478
+ throw this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to create S3 Tables Namespace ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause));
65479
+ }
65480
+ }
65481
+ async function deleteNamespace(logicalId, physicalId, resourceType, context) {
65482
+ this.logger.debug(`Deleting S3 Tables Namespace ${logicalId}: ${physicalId}`);
65483
+ const [tableBucketARN, namespaceName] = physicalId.split("|");
65484
+ if (!tableBucketARN || !namespaceName) throw new ProvisioningError(compositeIdFormatMessage(S3_TABLES_NAMESPACE_ID_FORMAT, logicalId, physicalId), resourceType, logicalId, physicalId);
65485
+ try {
65486
+ await this.getClient().send(new DeleteNamespaceCommand$1({
65487
+ tableBucketARN,
65488
+ namespace: namespaceName
65489
+ }));
65490
+ } catch (error) {
65491
+ if (error instanceof NotFoundException$7) {
65492
+ const clientRegion = await this.getClient().config.region();
65493
+ assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
65494
+ this.logger.debug(`S3 Tables Namespace ${physicalId} does not exist, skipping deletion`);
65495
+ return;
65496
+ }
65497
+ const cause = error instanceof Error ? error : void 0;
65498
+ const thrown = this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete S3 Tables Namespace ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
65499
+ throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
65500
+ }
65501
+ await waitForGoneAfterDelete({
65502
+ what: safeMsg`S3 Tables Namespace ${physicalId}`,
65503
+ resourceType,
65504
+ describe: () => namespaceStillListed.call(this, tableBucketARN, namespaceName),
65505
+ consequence: "Its table bucket's delete may be refused as not empty while the namespace is still listed; run the destroy again once it is gone.",
65506
+ logger: this.logger,
65507
+ pollIntervalMs: S3_TABLES_CHILD_GONE_POLL_MS,
65508
+ maxWaitMs: S3_TABLES_CHILD_GONE_MAX_WAIT_MS
65509
+ });
65510
+ this.logger.debug(`Successfully deleted S3 Tables Namespace ${logicalId}`);
65511
+ }
65512
+ async function namespaceStillListed(tableBucketARN, namespaceName) {
65513
+ let continuationToken;
65514
+ try {
65515
+ do {
65516
+ const page = await this.getClient().send(new ListNamespacesCommand$1({
65517
+ tableBucketARN,
65518
+ prefix: namespaceName,
65519
+ continuationToken
65520
+ }));
65521
+ if ((page.namespaces ?? []).some((ns) => ns.namespace?.[0] === namespaceName)) return "listed";
65522
+ continuationToken = page.continuationToken;
65523
+ } while (continuationToken);
65524
+ } catch (error) {
65525
+ if (error instanceof NotFoundException$7) return void 0;
65526
+ throw error;
65527
+ }
65528
+ }
65529
+
64463
65530
  // src/provisioning/providers/s3-tables/read-state.ts
64464
65531
  async function readCurrentState$2(physicalId, logicalId, resourceType) {
64465
65532
  switch (resourceType) {
@@ -64531,7 +65598,7 @@ async function readTableBucketConfigs(tableBucketARN, strict = false) {
64531
65598
  }, "absent", strict);
64532
65599
  return out;
64533
65600
  }
64534
- async function readConfig(out, key, read, notFound, strict = false) {
65601
+ async function readConfig(out, key, read, notFound, _strict = false) {
64535
65602
  try {
64536
65603
  const value = await read();
64537
65604
  if (value !== void 0) out[key] = value;
@@ -64540,8 +65607,7 @@ async function readConfig(out, key, read, notFound, strict = false) {
64540
65607
  if (notFound !== "absent") out[key] = notFound;
64541
65608
  return;
64542
65609
  }
64543
- if (strict) throw err;
64544
- this.logger.debug(safeMsg`readCurrentState: reading ${key} failed: ${describeAwsFailure(err).detail} — leaving it out`);
65610
+ throw err;
64545
65611
  }
64546
65612
  }
64547
65613
  async function readNamespaceCurrentState(physicalId) {
@@ -64584,13 +65650,7 @@ async function resolveTableParts(physicalId) {
64584
65650
  }
64585
65651
  }
64586
65652
  async function readTableCurrentState(physicalId) {
64587
- let resolved;
64588
- try {
64589
- resolved = await this.resolveTableParts(physicalId);
64590
- } catch (err) {
64591
- this.logger.warn(`S3 Tables Table ${physicalId}: could not resolve its identity for drift (${describeAwsFailure(err).detail}); reporting drift as unknown.`);
64592
- return;
64593
- }
65653
+ const resolved = await this.resolveTableParts(physicalId);
64594
65654
  if (resolved === "not-found") return RESOURCE_NOT_FOUND;
64595
65655
  if (resolved === "unparseable") return void 0;
64596
65656
  const { tableBucketARN, namespace, name } = resolved;
@@ -64624,7 +65684,7 @@ async function readTableCurrentState(physicalId) {
64624
65684
  }));
64625
65685
  return result;
64626
65686
  }
64627
- async function readTableMaintenance(physicalId, table, strict = false) {
65687
+ async function readTableMaintenance(_physicalId, table, _strict = false) {
64628
65688
  const result = {};
64629
65689
  let maintenance;
64630
65690
  let maintenanceRead = true;
@@ -64632,10 +65692,7 @@ async function readTableMaintenance(physicalId, table, strict = false) {
64632
65692
  maintenance = (await this.getClient().send(new GetTableMaintenanceConfigurationCommand(table))).configuration;
64633
65693
  } catch (err) {
64634
65694
  maintenanceRead = err instanceof NotFoundException$7;
64635
- if (!maintenanceRead) {
64636
- if (strict) throw err;
64637
- this.logger.debug(safeMsg`readCurrentState: reading the maintenance configuration of ${physicalId} failed: ` + safeMsg`${describeAwsFailure(err).detail} — leaving Compaction / SnapshotManagement out`);
64638
- }
65695
+ if (!maintenanceRead) throw err;
64639
65696
  }
64640
65697
  if (maintenanceRead) {
64641
65698
  const compaction = maintenance?.icebergCompaction;
@@ -64853,6 +65910,7 @@ async function readTagsBestEffort(resourceArn) {
64853
65910
  });
64854
65911
  return out;
64855
65912
  } catch (err) {
65913
+ if (!(err instanceof NotFoundException$7)) throw err;
64856
65914
  this.logger.debug(`readTagsBestEffort: ListTagsForResource failed for ${resourceArn}: ${describeAwsFailure(err).detail} — emitting Tags: []`);
64857
65915
  return [];
64858
65916
  }
@@ -66611,4 +67669,4 @@ var ACMCertificateProvider = class {
66611
67669
  };
66612
67670
 
66613
67671
  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, WaitConditionProvider };
66614
- //# sourceMappingURL=provider-classes-Bmipcl6d.js.map
67672
+ //# sourceMappingURL=provider-classes-DTMnDVMz.js.map