@cdkd/cli 0.340.0 → 0.341.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 (36) hide show
  1. package/dist/{ambient-client-defaults-D2df_dIB.js → ambient-client-defaults-CtGTOtn9.js} +2 -2
  2. package/dist/{ambient-client-defaults-D2df_dIB.js.map → ambient-client-defaults-CtGTOtn9.js.map} +1 -1
  3. package/dist/{asg-provider-DrQNWTtu.js → asg-provider-BT_0gh9s.js} +5 -5
  4. package/dist/{asg-provider-DrQNWTtu.js.map → asg-provider-BT_0gh9s.js.map} +1 -1
  5. package/dist/{aws-failure-text-FKztQiaJ.js → aws-failure-text-zxW2CTmF.js} +149 -9
  6. package/dist/aws-failure-text-zxW2CTmF.js.map +1 -0
  7. package/dist/cli.js +2 -2
  8. package/dist/{db-instance-modify-retry-BJSwxkSE.js → db-instance-modify-retry-CCbm-DKl.js} +4 -4
  9. package/dist/{db-instance-modify-retry-BJSwxkSE.js.map → db-instance-modify-retry-CCbm-DKl.js.map} +1 -1
  10. package/dist/{deploy-engine-Bn_aBFb7.js → deploy-engine-BZSAOzE6.js} +4158 -4085
  11. package/dist/deploy-engine-BZSAOzE6.js.map +1 -0
  12. package/dist/{ecr-uri-B5zqA138.js → ecr-uri-DmkrTyRF.js} +3 -3
  13. package/dist/{ecr-uri-B5zqA138.js.map → ecr-uri-DmkrTyRF.js.map} +1 -1
  14. package/dist/{iam-role-provider-CRHaUz5M.js → iam-role-provider-CbUqsAAi.js} +5 -5
  15. package/dist/{iam-role-provider-CRHaUz5M.js.map → iam-role-provider-CbUqsAAi.js.map} +1 -1
  16. package/dist/index.js +4 -4
  17. package/dist/{neptune-provider-BL93NXUx.js → neptune-provider-DlQ-_thp.js} +6 -6
  18. package/dist/{neptune-provider-BL93NXUx.js.map → neptune-provider-DlQ-_thp.js.map} +1 -1
  19. package/dist/{program-CuJKRAac.js → program-7VC8uSCL.js} +17 -10
  20. package/dist/program-7VC8uSCL.js.map +1 -0
  21. package/dist/{provider-classes-CRZ8a4sy.js → provider-classes-0cQAzv7Y.js} +282 -153
  22. package/dist/provider-classes-0cQAzv7Y.js.map +1 -0
  23. package/dist/{rds-provider-B-LP69hz.js → rds-provider-CaaoK9Yu.js} +202 -49
  24. package/dist/rds-provider-CaaoK9Yu.js.map +1 -0
  25. package/dist/{read-replica-DblnJp2B.js → read-replica-DyG0ZkQJ.js} +3 -3
  26. package/dist/{read-replica-DblnJp2B.js.map → read-replica-DyG0ZkQJ.js.map} +1 -1
  27. package/dist/{update-removal-DTvJXMeM.js → update-removal-CNj3wKPR.js} +3 -3
  28. package/dist/{update-removal-DTvJXMeM.js.map → update-removal-CNj3wKPR.js.map} +1 -1
  29. package/dist/{version-Y2LIzQUU.js → version-B7cmr9JA.js} +2 -2
  30. package/dist/{version-Y2LIzQUU.js.map → version-B7cmr9JA.js.map} +1 -1
  31. package/package.json +1 -1
  32. package/dist/aws-failure-text-FKztQiaJ.js.map +0 -1
  33. package/dist/deploy-engine-Bn_aBFb7.js.map +0 -1
  34. package/dist/program-CuJKRAac.js.map +0 -1
  35. package/dist/provider-classes-CRZ8a4sy.js.map +0 -1
  36. package/dist/rds-provider-B-LP69hz.js.map +0 -1
@@ -1,15 +1,15 @@
1
- import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-CRHaUz5M.js";
2
- import { $ as safeMsg, E as generateResourceNameWithFallback, J as displaySafe, M as getCurrentStackInstanceId, O as recordedGeneratedNameKept, P as isBeforeStateRead, Q as plainIdentOr, T as generateResourceName, V as SECRET_REF_MAX_CODE_POINTS, W as asIsMessage, X as isPasteableIdent, Y as displayStackName, a as safeStringify, i as isAwsAuthoredFailure, n as describeAwsFailure, q as displayIdent, r as describeAwsStatusReason, s as getLogger, t as VERBOSE_POINTER, y as generatedNameFor } from "./aws-failure-text-FKztQiaJ.js";
1
+ import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-CbUqsAAi.js";
2
+ import { A as requireConfigString, C as configBooleanRefusal, D as replayWarn, E as readConfigString, F as generateResourceName, H as getCurrentStackInstanceId, I as generateResourceNameWithFallback, O as requireConfigArray, R as recordedGeneratedNameKept, S as coerceCfnInteger, T as configStringRefusal, U as getCurrentStackName, W as isBeforeStateRead, Z as SECRET_REF_MAX_CODE_POINTS, a as safeStringify, at as displayStackName, ct as plainIdentOr, et as asIsMessage, i as isAwsAuthoredFailure, it as displaySafe, k as requireConfigObject, lt as safeMsg, n as describeAwsFailure, ot as isPasteableIdent, r as describeAwsStatusReason, rt as displayIdent, s as getLogger, t as VERBOSE_POINTER, w as configIntegerRefusal, x as coerceCfnBoolean, y as generatedNameFor } from "./aws-failure-text-zxW2CTmF.js";
3
3
  import { d as withApiGatewayPacing, l as s3ClientDefaults, r as getAwsClients } from "./aws-clients-D3Z_tFc1.js";
4
- import { B as THROTTLING_ERROR_NAMES, D as relayedNameCollision, E as markReplayMayCollide, F as isExplicitDenyError, G as wrapMaskedAwsError, H as isThrottlingError, L as isRetryableTransientError, P as isAmbiguousOutcomeError, Q as CdkdError, R as isTransientServerError, T as markNameCollision, U as markNonRetryable, V as isMarkedNonRetryable, W as markRedactedCause, X as AccountIdUnavailableError, _t as plainOrDescribed, bt as shellQuote, ft as commandHole, g as ResourceUpdateNotSupportedError, ht as pasteableCommand, i as credentialFingerprint, j as explicitDenyPolicyKind, mt as isInertUnquoted, n as ambientCredentialConfig, pt as hasClauseBreak, r as clientDefaultsFor, rt as ProvisioningError, t as ambientClientDefaults, xt as withheldTargetClause } from "./ambient-client-defaults-D2df_dIB.js";
5
- import { $ as deleteAfterProtectionFlipWithFinalSnapshot, A as setBounded, At as segmentAfterAnchor, B as resolveExplicitPhysicalId, Bt as clearCreatedBeforeFailure, C as AmbiguousCreateLatch, Ct as canonicalizeRoute53QueryName, D as isInsideWindow, Dt as logicalIdShown, E as createAttemptKey, Et as compositeIdSkipResult, F as isQuotableImportValue, Ft as maskDeep, H as assertRegionMatch, I as normalizeAwsTagsToCfn, It as maskerOrIdentity, J as observeThenDisableProtection, Jt as markSupersedesEarlierCreate, K as deleteWithProtectionCompensation, Kt as markAuxiliaryFailure, L as quotedRemedyLogicalId, Lt as withDerivedNameMasks, M as VALUE_NOT_SHOWN, Mt as createMaskedLogSinks, N as isPlainImportJson, Nt as createMaskedRetryLogger, O as replayFollowedAmbiguousAttempt, Ot as packCompositeId, P as isPlainImportValue, Pt as isSecretDerivedValue, Q as PROTECTION_FLIP_RETRY_WAIT_MS, R as refusalTypeShown, S as AMBIGUOUS_LATCH_TTL_MS, St as startInterruptWatch, T as ambiguousAttemptLead, Tt as compositeIdSeparatorRefusal, V as RESOURCE_NOT_FOUND, W as markNotGone, Wt as isAuxiliaryFailure, Y as rdsFamilyProtectionSite, Z as userPoolProtectionSite, _ as onlySecretDerived, _t as renderDisableCommand, a as withRemovalDefaults, at as isTerminalDeleteFailure, b as recordedPrincipalsRepair, cn as injectiveKeyPrefix, ct as ElapsedBudget, f as retractCreatedResource, fn as withPasteableAwsProfile, ft as UNNAMEABLE_ID_CLAUSE, g as holdsSecretDerivedEntry, gt as protectedReplacementAdvice, h as SECRET_DERIVED_READ_LIVE, ht as pasteableAwsCommand, i as removedTemplateKeys, it as ProtectionFlipRegistry, j as withoutServerErrorRetries, jt as stateOrphanRecordRemedy, k as replayedSendWindow, lt as ElapsedBudgetRegistry, mt as isAwsCliLiteral, nt as isTerminalDbWaitStatus, ot as protectionFlipKey, pt as WITHHELD_AWS_COMMAND, q as logGroupProtectionSite, qt as markCreatedBeforeFailure, sn as injectiveKey, t as clearOnUpdateRemoval, tt as isProceedDbStatus, u as reportCreatedResource, v as readPrincipalLists, w as RecentIdSet, wt as compositeIdFormatMessage, xt as isInterruptedWaitError, z as remedyLogicalId } from "./update-removal-DTvJXMeM.js";
6
- import { $ as readTtlSpec, $d as renderAssemblyPathEscape, $i as definedAttributes, $o as toCfnInteger, $r as awaitInFlightSibling, Al as dynamicReferenceTokens, Ao as getAccountInfo, At as ECR_AUTO_DELETE_IMAGES_TAG, B as STREAM_TAGS_KEY, Ba as reEnableInstanceApiTermination, Bc as ecsServiceLaunchTypeSetOrChanged, Bi as maskedSecretSegment, Ca as waitForLambdaFunctionActive, Ct as DELETE_INDEX_WAIT_PROCEED_NOTE, Do as outputReferenceProvenanceOf, Dt as maskedLogger, Ea as resolvedResourceTimeoutMs, Et as deleteTableWithIndexBusyRetry, Fc as withoutSdkUnwiredProperties, Ft as enclosingDeadlineRemainingMs, G as streamDeclaresPolicy, H as declaredStreamTagsMember, Ha as unchangedBehindSecretReference, Hc as canonicalLambdaFunctionName, Hl as carriesSecretMask, Ia as ec2InstanceProtectionSite, Id as canonicalizeRegion, Il as recoverMaskedOutput, J as streamPolicyMatchesDeclared, Ja as isSettledInstanceState, Jt as getPriorAttempts, K as streamDeclaresTags, La as isTerminationProtectionPropagationError, Ld as derivePartitionAndUrlSuffix, Ll as physicalNameCopiesOf, Mt as hasCdkAutoDeleteTag, Na as deleteSkipReason, Nc as findSdkUnwiredProperties, Nd as decodeListingKey, Nt as isTruthyCfnBoolean, Oa as slowCcOperationTimeoutMs, Ol as withoutPhysicalNameCopies, Ot as relayedIndexBusyDelete, Pa as withIndeterminateGuard, Pi as secretNamedAttributeNamesOf, Pt as enclosingDeadlineExpired, Pu as rewriteTemplateAssetReferences, Q as planTimeToLive, Qd as displayAssemblyPath, Qo as isWarmThroughputDecrease, R as DynamoDBGlobalTableProvider, Ra as observeThenDisableInstanceApiTermination, Rc as blockDeviceMappingsDifferOnlyInDeleteOnTermination, Rl as recordAttributeIdCopy, Ro as isUsableAttemptedName, S as renderNestedTemplateTreeDefect, St as resolveDynamoDbDeleteBudgetMs, Ta as waitForGoneAfterDelete, Tc as withheldAccountClause, To as parseWebACLArn, Tt as TABLE_INDEX_NOUN, U as planStreamMemberOps, Uc as lambdaFunctionNameForMask, V as declaredStreamPolicyMember, Va as onlySecretReferencesDiffer, Vc as emrClusterInstancesReplaced, W as reverseMapStreamPolicy, Wc as sameLambdaFunctionAddress, X as isTtlAlreadyDisabled, Xo as WARM_THROUGHPUT_MEMBERS, Y as streamTagsMatchDeclared, Yt as markRefusedBeforeApplying, Z as isTtlRateLimited, Zd as describeFileReadFailure, Zo as coerceWarmThroughput$1, _r as isRedactedRecordedValue, _t as DYNAMODB_DELETE_POLL_COST_MS, _u as timePhase, a as withApiLimit, aa as refuseMalformedDesiredTags, as as configStringRefusal, at as vectorIndexesShapeDetail, b as isAbsoluteAssetPath, bt as deleteBudgetKey, ca as isRefusedByName, cl as markSameGenerationBag, cs as requireConfigArray, ct as indexDeclaresContributorInsights, dl as snapshotPassProvenance, dn as withNestedStackContext, dt as readContributorInsightsSpec, ea as stringifyIfAssigned, ef as resolveAssemblyPath, er as earliestDefined, es as toFiniteNumber, et as sendTtlWaitingOutRateLimit, fo as s3BucketArn, ft as reverseMapIndexContributorInsights, go as s3BucketWebsiteUrl, gr as REDACTED_DELETE_ADDRESS_SKIP_REASON, gs as passedParameterClassesOf, gt as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, ho as s3BucketRegionalDomainName, ht as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, i as lookupEachName, ia as readTagList, ir as acquireIdempotencyToken, is as configIntegerRefusal, it as vectorIndexesSettled, jt as S3_AUTO_DELETE_OBJECTS_TAG, kr as getCurrentProducerRegions, kt as waitForIndexesSettled, ku as stringifyValue, la as markDeleteStarted, lc as refuseMalformedNestedChildOutputs, ll as redactForState, ls as requireConfigObject, lt as planContributorInsightsOp, mi as refuseRestoreFromItself, ml as hasMaskableValues, mo as s3BucketDualStackDomainName, ms as withRetry, mt as stripIndexContributorInsights, n as chunks, na as DBPROXY_TAG_OPTIONS, nl as passedNoEchoParametersOf, nr as reserveStackCreateToken, ns as coerceCfnInteger, nt as readbackVectorIndexes, oa as tagMapAsList, on as revertNestedChildFromJournal, os as readConfigString, ot as CONTRIBUTOR_INSIGHTS_KEY, po as s3BucketDomainName, pt as reverseMapTableContributorInsights, q as streamMemberRefusals, r as isAccessDeniedError, ra as planTagDiff, ri as replacedDeleteFailureVerdict, rn as getNestedRevertRun, rs as configBooleanRefusal, rt as vectorIndexesForCreate, sa as tagPlanWarning, ss as replayWarn, st as contributorInsightsRefusals, t as DeployEngine, ta as DBPROXY_TAGS_WHAT, ti as getStackRecords, ts as coerceCfnBoolean, tt as planVectorIndexUpdates, ul as recordReferenceProvenanceEntry, un as getCurrentNestedStackContext, us as requireConfigString, ut as planIndexContributorInsightsOps, vr as redactedDeleteAddressFields, vt as beginDeleteWait, wc as accountArgs, wt as INDEX_SETTLE_POLL_INTERVAL_MS, x as listNestedTemplateRows, xa as getCurrentResourceSecrets, xt as resolveDynamoDbDeleteBudgetClock, y as findNestedTemplateTreeDefect, yc as refuseMalformedResourcesForDestroy, yr as redactedDeleteAddressSkip, yt as compensateRemovedDeletionProtection, z as STREAM_POLICY_KEY, za as reDisableInstanceApiTermination, zi as APPSYNC_APIKEY_ARN_RESOURCE_PATH } from "./deploy-engine-Bn_aBFb7.js";
7
- import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, t as canonicalizeIpv4Cidr } from "./program-CuJKRAac.js";
4
+ import { B as THROTTLING_ERROR_NAMES, D as relayedNameCollision, E as markReplayMayCollide, F as isExplicitDenyError, G as wrapMaskedAwsError, H as isThrottlingError, L as isRetryableTransientError, P as isAmbiguousOutcomeError, Q as CdkdError, R as isTransientServerError, T as markNameCollision, U as markNonRetryable, V as isMarkedNonRetryable, W as markRedactedCause, X as AccountIdUnavailableError, _t as plainOrDescribed, bt as shellQuote, ft as commandHole, g as ResourceUpdateNotSupportedError, ht as pasteableCommand, i as credentialFingerprint, j as explicitDenyPolicyKind, mt as isInertUnquoted, n as ambientCredentialConfig, pt as hasClauseBreak, r as clientDefaultsFor, rt as ProvisioningError, t as ambientClientDefaults, xt as withheldTargetClause } from "./ambient-client-defaults-CtGTOtn9.js";
5
+ import { $ as deleteAfterProtectionFlipWithFinalSnapshot, A as setBounded, At as segmentAfterAnchor, B as resolveExplicitPhysicalId, Bt as clearCreatedBeforeFailure, C as AmbiguousCreateLatch, Ct as canonicalizeRoute53QueryName, D as isInsideWindow, Dt as logicalIdShown, E as createAttemptKey, Et as compositeIdSkipResult, F as isQuotableImportValue, Ft as maskDeep, H as assertRegionMatch, I as normalizeAwsTagsToCfn, It as maskerOrIdentity, J as observeThenDisableProtection, Jt as markSupersedesEarlierCreate, K as deleteWithProtectionCompensation, Kt as markAuxiliaryFailure, L as quotedRemedyLogicalId, Lt as withDerivedNameMasks, M as VALUE_NOT_SHOWN, Mt as createMaskedLogSinks, N as isPlainImportJson, Nt as createMaskedRetryLogger, O as replayFollowedAmbiguousAttempt, Ot as packCompositeId, P as isPlainImportValue, Pt as isSecretDerivedValue, Q as PROTECTION_FLIP_RETRY_WAIT_MS, R as refusalTypeShown, S as AMBIGUOUS_LATCH_TTL_MS, St as startInterruptWatch, T as ambiguousAttemptLead, Tt as compositeIdSeparatorRefusal, V as RESOURCE_NOT_FOUND, W as markNotGone, Wt as isAuxiliaryFailure, Y as rdsFamilyProtectionSite, Z as userPoolProtectionSite, _ as onlySecretDerived, _t as renderDisableCommand, a as withRemovalDefaults, at as isTerminalDeleteFailure, b as recordedPrincipalsRepair, cn as injectiveKeyPrefix, ct as ElapsedBudget, f as retractCreatedResource, fn as withPasteableAwsProfile, ft as UNNAMEABLE_ID_CLAUSE, g as holdsSecretDerivedEntry, gt as protectedReplacementAdvice, h as SECRET_DERIVED_READ_LIVE, ht as pasteableAwsCommand, i as removedTemplateKeys, it as ProtectionFlipRegistry, j as withoutServerErrorRetries, jt as stateOrphanRecordRemedy, k as replayedSendWindow, lt as ElapsedBudgetRegistry, mt as isAwsCliLiteral, nt as isTerminalDbWaitStatus, ot as protectionFlipKey, pt as WITHHELD_AWS_COMMAND, q as logGroupProtectionSite, qt as markCreatedBeforeFailure, sn as injectiveKey, t as clearOnUpdateRemoval, tt as isProceedDbStatus, u as reportCreatedResource, v as readPrincipalLists, w as RecentIdSet, wt as compositeIdFormatMessage, xt as isInterruptedWaitError, z as remedyLogicalId } from "./update-removal-CNj3wKPR.js";
6
+ import { $ as vectorIndexesForCreate, $o as coerceWarmThroughput$1, Aa as slowCcOperationTimeoutMs, Ac as blockDeviceMappingsDifferOnlyInDeleteOnTermination, Al as recordAttributeIdCopy, At as enclosingDeadlineExpired, B as reverseMapStreamPolicy, Ba as observeThenDisableInstanceApiTermination, Bo as isUsableAttemptedName, Ca as getCurrentResourceSecrets, Ct as maskedLogger, Da as waitForGoneAfterDelete, Dc as withoutSdkUnwiredProperties, Do as parseWebACLArn, Dt as S3_AUTO_DELETE_OBJECTS_TAG, Et as ECR_AUTO_DELETE_IMAGES_TAG, Eu as rewriteTemplateAssetReferences, F as STREAM_POLICY_KEY, Fa as deleteSkipReason, Fc as lambdaFunctionNameForMask, G as streamTagsMatchDeclared, Gd as renderAssemblyPathEscape, Gt as markRefusedBeforeApplying, H as streamDeclaresTags, Ha as reEnableInstanceApiTermination, Hi as maskedSecretSegment, I as STREAM_TAGS_KEY, Ia as withIndeterminateGuard, Ic as sameLambdaFunctionAddress, Ii as secretNamedAttributeNamesOf, J as planTimeToLive, Jc as passedNoEchoParametersOf, Jt as isAccessDeniedError, K as isTtlAlreadyDisabled, Kd as resolveAssemblyPath, L as declaredStreamPolicyMember, Mc as ecsServiceLaunchTypeSetOrChanged, Mo as getAccountInfo, Nc as emrClusterInstancesReplaced, Oa as resolvedResourceTimeoutMs, Od as canonicalizeRegion, Ol as recoverMaskedOutput, Ot as hasCdkAutoDeleteTag, P as DynamoDBGlobalTableProvider, Pc as canonicalLambdaFunctionName, Pl as carriesSecretMask, Q as readbackVectorIndexes, Qo as WARM_THROUGHPUT_MEMBERS, R as declaredStreamTagsMember, Ra as ec2InstanceProtectionSite, Sl as dynamicReferenceTokens, St as deleteTableWithIndexBusyRetry, Ta as waitForLambdaFunctionActive, Tc as findSdkUnwiredProperties, Td as decodeListingKey, Tt as waitForIndexesSettled, U as streamMemberRefusals, Ua as onlySecretReferencesDiffer, Ud as describeFileReadFailure, V as streamDeclaresPolicy, Va as reDisableInstanceApiTermination, Vi as APPSYNC_APIKEY_ARN_RESOURCE_PATH, W as streamPolicyMatchesDeclared, Wa as unchangedBehindSecretReference, Wd as displayAssemblyPath, Wt as getPriorAttempts, X as sendTtlWaitingOutRateLimit, Xa as isSettledInstanceState, Xt as withApiLimit, Y as readTtlSpec, Yt as lookupEachName, Z as planVectorIndexUpdates, _ as listNestedTemplateRows, _c as withheldAccountClause, _o as s3BucketRegionalDomainName, _t as resolveDynamoDbDeleteBudgetClock, aa as planTagDiff, ai as replacedDeleteFailureVerdict, ar as acquireIdempotencyToken, at as planContributorInsightsOp, bl as withoutPhysicalNameCopies, br as redactedDeleteAddressFields, bt as INDEX_SETTLE_POLL_INTERVAL_MS, ca as tagMapAsList, cs as passedParameterClassesOf, ct as reverseMapIndexContributorInsights, da as markDeleteStarted, dc as refuseMalformedResourcesForDestroy, dn as withNestedStackContext, dt as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, el as markSameGenerationBag, es as isWarmThroughputDecrease, et as vectorIndexesSettled, ft as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, g as isAbsoluteAssetPath, gc as accountArgs, gi as refuseRestoreFromItself, go as s3BucketDualStackDomainName, gt as deleteBudgetKey, h as findNestedTemplateTreeDefect, ho as s3BucketDomainName, ht as compensateRemovedDeletionProtection, ia as DBPROXY_TAG_OPTIONS, it as indexDeclaresContributorInsights, jr as getCurrentProducerRegions, jt as enclosingDeadlineRemainingMs, kd as derivePartitionAndUrlSuffix, kl as physicalNameCopiesOf, ko as outputReferenceProvenanceOf, kt as isTruthyCfnBoolean, la as tagPlanWarning, lt as reverseMapTableContributorInsights, lu as timePhase, mo as s3BucketArn, mt as beginDeleteWait, na as stringifyIfAssigned, nl as recordReferenceProvenanceEntry, ns as toFiniteNumber, nt as CONTRIBUTOR_INSIGHTS_KEY, oa as readTagList, ol as hasMaskableValues, on as revertNestedChildFromJournal, os as withRetry, ot as planIndexContributorInsightsOps, pt as DYNAMODB_DELETE_POLL_COST_MS, q as isTtlRateLimited, qt as chunks, ra as DBPROXY_TAGS_WHAT, ri as getStackRecords, rl as snapshotPassProvenance, rn as getNestedRevertRun, rr as reserveStackCreateToken, rt as contributorInsightsRefusals, sa as refuseMalformedDesiredTags, st as readContributorInsightsSpec, t as DeployEngine, ta as definedAttributes, tc as refuseMalformedNestedChildOutputs, ti as awaitInFlightSibling, tl as redactForState, tr as earliestDefined, ts as toCfnInteger, tt as vectorIndexesShapeDetail, ua as isRefusedByName, un as getCurrentNestedStackContext, ut as stripIndexContributorInsights, v as renderNestedTemplateTreeDefect, vo as s3BucketWebsiteUrl, vr as REDACTED_DELETE_ADDRESS_SKIP_REASON, vt as resolveDynamoDbDeleteBudgetMs, wt as relayedIndexBusyDelete, xr as redactedDeleteAddressSkip, xt as TABLE_INDEX_NOUN, xu as stringifyValue, yr as isRedactedRecordedValue, yt as DELETE_INDEX_WAIT_PROCEED_NOTE, z as planStreamMemberOps, za as isTerminationProtectionPropagationError } from "./deploy-engine-BZSAOzE6.js";
7
+ import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, t as canonicalizeIpv4Cidr } from "./program-7VC8uSCL.js";
8
8
  import { c as ambientRegion } from "./aws-client-defaults-BLXFsfMa.js";
9
- import { RDSProvider } from "./rds-provider-B-LP69hz.js";
10
- import { n as modifyDbInstanceWhenAvailable, t as isModifyNotAvailableRefusal } from "./db-instance-modify-retry-BJSwxkSE.js";
11
- import { NeptuneProvider } from "./neptune-provider-BL93NXUx.js";
12
- import { ASGProvider } from "./asg-provider-DrQNWTtu.js";
9
+ import { RDSProvider } from "./rds-provider-CaaoK9Yu.js";
10
+ import { n as modifyDbInstanceWhenAvailable, t as isModifyNotAvailableRefusal } from "./db-instance-modify-retry-CCbm-DKl.js";
11
+ import { NeptuneProvider } from "./neptune-provider-DlQ-_thp.js";
12
+ import { ASGProvider } from "./asg-provider-BT_0gh9s.js";
13
13
  import { createHash, randomUUID } from "node:crypto";
14
14
  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";
15
15
  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";
@@ -46,7 +46,7 @@ import * as zlib from "node:zlib";
46
46
  import { ApiGatewayV2Client, CreateApiCommand, CreateAuthorizerCommand as CreateAuthorizerCommand$1, CreateIntegrationCommand, CreateRouteCommand as CreateRouteCommand$1, CreateStageCommand as CreateStageCommand$1, DeleteAccessLogSettingsCommand, DeleteApiCommand, DeleteAuthorizerCommand as DeleteAuthorizerCommand$1, DeleteCorsConfigurationCommand, DeleteIntegrationCommand as DeleteIntegrationCommand$1, DeleteRouteCommand as DeleteRouteCommand$1, DeleteRouteRequestParameterCommand, DeleteRouteSettingsCommand, DeleteStageCommand as DeleteStageCommand$1, GetApiCommand, GetApisCommand, GetAuthorizerCommand as GetAuthorizerCommand$1, GetAuthorizersCommand as GetAuthorizersCommand$1, GetIntegrationCommand, GetIntegrationsCommand, GetRouteCommand, GetStageCommand as GetStageCommand$1, NotFoundException as NotFoundException$3, TagResourceCommand as TagResourceCommand$14, UntagResourceCommand as UntagResourceCommand$14, UpdateApiCommand, UpdateAuthorizerCommand as UpdateAuthorizerCommand$1, UpdateIntegrationCommand, UpdateRouteCommand, UpdateStageCommand as UpdateStageCommand$1 } from "@aws-sdk/client-apigatewayv2";
47
47
  import { CreateStateMachineCommand, DeleteStateMachineCommand, DescribeStateMachineCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$12, SFNClient, StateMachineDoesNotExist, TagResourceCommand as TagResourceCommand$15, UntagResourceCommand as UntagResourceCommand$15, UpdateStateMachineCommand } from "@aws-sdk/client-sfn";
48
48
  import { CreateClusterCommand, CreateServiceCommand, DeleteClusterCommand, DeleteServiceCommand, DeregisterTaskDefinitionCommand, DescribeClustersCommand, DescribeServicesCommand, DescribeTaskDefinitionCommand, ECSClient, ListTaskDefinitionsCommand, PutClusterCapacityProvidersCommand, RegisterTaskDefinitionCommand, TagResourceCommand as TagResourceCommand$16, UntagResourceCommand as UntagResourceCommand$16, UpdateClusterCommand, UpdateServiceCommand, waitUntilServicesStable } from "@aws-sdk/client-ecs";
49
- import { AddTagsToResourceCommand as AddTagsToResourceCommand$3, CreateDBClusterCommand as CreateDBClusterCommand$1, CreateDBInstanceCommand as CreateDBInstanceCommand$1, CreateDBSubnetGroupCommand as CreateDBSubnetGroupCommand$1, DeleteDBClusterCommand as DeleteDBClusterCommand$1, DeleteDBInstanceCommand as DeleteDBInstanceCommand$1, DeleteDBSubnetGroupCommand as DeleteDBSubnetGroupCommand$1, DescribeDBClusterSnapshotsCommand, DescribeDBClustersCommand as DescribeDBClustersCommand$1, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DescribeDBSubnetGroupsCommand as DescribeDBSubnetGroupsCommand$1, DescribeGlobalClustersCommand as DescribeGlobalClustersCommand$1, DocDBClient, ListTagsForResourceCommand as ListTagsForResourceCommand$13, ModifyDBClusterCommand as ModifyDBClusterCommand$1, ModifyDBInstanceCommand as ModifyDBInstanceCommand$1, ModifyDBSubnetGroupCommand as ModifyDBSubnetGroupCommand$1, RemoveFromGlobalClusterCommand as RemoveFromGlobalClusterCommand$1, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$3, RestoreDBClusterFromSnapshotCommand, RestoreDBClusterToPointInTimeCommand as RestoreDBClusterToPointInTimeCommand$1 } from "@aws-sdk/client-docdb";
49
+ import { AddTagsToResourceCommand as AddTagsToResourceCommand$3, CreateDBClusterCommand as CreateDBClusterCommand$1, CreateDBInstanceCommand as CreateDBInstanceCommand$1, CreateDBSubnetGroupCommand as CreateDBSubnetGroupCommand$1, DeleteDBClusterCommand as DeleteDBClusterCommand$1, DeleteDBInstanceCommand as DeleteDBInstanceCommand$1, DeleteDBSubnetGroupCommand as DeleteDBSubnetGroupCommand$1, DescribeDBClusterSnapshotsCommand as DescribeDBClusterSnapshotsCommand$1, DescribeDBClustersCommand as DescribeDBClustersCommand$1, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DescribeDBSubnetGroupsCommand as DescribeDBSubnetGroupsCommand$1, DescribeGlobalClustersCommand as DescribeGlobalClustersCommand$1, DocDBClient, ListTagsForResourceCommand as ListTagsForResourceCommand$13, ModifyDBClusterCommand as ModifyDBClusterCommand$1, ModifyDBInstanceCommand as ModifyDBInstanceCommand$1, ModifyDBSubnetGroupCommand as ModifyDBSubnetGroupCommand$1, RemoveFromGlobalClusterCommand as RemoveFromGlobalClusterCommand$1, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$3, RestoreDBClusterFromSnapshotCommand as RestoreDBClusterFromSnapshotCommand$1, RestoreDBClusterToPointInTimeCommand as RestoreDBClusterToPointInTimeCommand$1 } from "@aws-sdk/client-docdb";
50
50
  import { AppConfigClient, CreateEnvironmentCommand, DeleteEnvironmentCommand, GetEnvironmentCommand, TagResourceCommand as TagResourceCommand$17, UntagResourceCommand as UntagResourceCommand$17, UpdateEnvironmentCommand } from "@aws-sdk/client-appconfig";
51
51
  import { CreateWebACLCommand, DeleteWebACLCommand, GetWebACLCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$14, TagResourceCommand as TagResourceCommand$18, UntagResourceCommand as UntagResourceCommand$18, UpdateWebACLCommand, WAFNonexistentItemException, WAFV2Client } from "@aws-sdk/client-wafv2";
52
52
  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";
@@ -6702,10 +6702,143 @@ var S3BucketProvider = class {
6702
6702
  }
6703
6703
  };
6704
6704
 
6705
+ // src/provisioning/policy-document-content.ts
6706
+ const MASK = "***";
6707
+ const PERMANENT_CDKD_CODES = /* @__PURE__ */ new Set(["ROLLBACK_SECRET_TOKEN_SCAN_MISMATCH"]);
6708
+ const MARKED_PERMANENT_CODE_PREFIXES = ["INTRINSIC_RESOLUTION_REFUSAL", "ROLLBACK_SECRET_REGION_AMBIGUOUS"];
6709
+ const NOT_FOUND_ERROR_NAMES = /* @__PURE__ */ new Set([
6710
+ "ResourceNotFoundException",
6711
+ "ParameterNotFound",
6712
+ "ParameterVersionNotFound"
6713
+ ]);
6714
+ function holdsUnresolvedValue(document) {
6715
+ let root = document;
6716
+ if (typeof document === "string") try {
6717
+ root = JSON.parse(document);
6718
+ } catch {
6719
+ root = document;
6720
+ }
6721
+ const walk = (v) => {
6722
+ if (typeof v === "string") return v === MASK || v.includes("{{resolve:");
6723
+ if (Array.isArray(v)) return v.some(walk);
6724
+ if (v !== null && typeof v === "object") return Object.values(v).some(walk);
6725
+ return false;
6726
+ };
6727
+ return walk(root);
6728
+ }
6729
+ function isPermanentResolutionError(error) {
6730
+ let current = error;
6731
+ for (let depth = 0; depth < 5 && current != null; depth++) {
6732
+ const e = current;
6733
+ if (typeof e.name === "string" && NOT_FOUND_ERROR_NAMES.has(e.name)) return true;
6734
+ if (typeof e.code === "string") {
6735
+ if (PERMANENT_CDKD_CODES.has(e.code)) return true;
6736
+ const code = e.code;
6737
+ if (MARKED_PERMANENT_CODE_PREFIXES.some((p) => code.startsWith(p)) && isMarkedNonRetryable(current)) return true;
6738
+ }
6739
+ if (typeof e.message === "string" && e.message.startsWith("Dynamic reference: ")) return true;
6740
+ current = e.cause;
6741
+ }
6742
+ return false;
6743
+ }
6744
+ function errorName(error) {
6745
+ const name = error?.name;
6746
+ return typeof name === "string" && /^[\w.-]{1,128}$/.test(name) ? name : "error";
6747
+ }
6748
+ async function attemptedPolicyDocument(recorded, resolve) {
6749
+ let document = recorded;
6750
+ if (resolve) try {
6751
+ document = await resolve();
6752
+ } catch (error) {
6753
+ return isPermanentResolutionError(error) ? {
6754
+ kind: "unusable",
6755
+ why: "a secret it references does not exist or cannot be used"
6756
+ } : {
6757
+ kind: "retry",
6758
+ errorName: errorName(error)
6759
+ };
6760
+ }
6761
+ if (!(typeof document === "string" && document.length > 0 || document !== null && typeof document === "object")) return {
6762
+ kind: "unusable",
6763
+ why: "no policy document it attempted is recorded"
6764
+ };
6765
+ if (holdsUnresolvedValue(document)) return {
6766
+ kind: "unusable",
6767
+ why: "its policy document still holds a secret reference or masked value"
6768
+ };
6769
+ return {
6770
+ kind: "document",
6771
+ document
6772
+ };
6773
+ }
6774
+ const ACCOUNT_ID = /^\d{12}$/;
6775
+ const ACCOUNT_ROOT_ARN = /^arn:[a-z-]+:iam::(\d{12}):root$/;
6776
+ const LIST_KEYS = [
6777
+ "Action",
6778
+ "NotAction",
6779
+ "Resource",
6780
+ "NotResource"
6781
+ ];
6782
+ const PRINCIPAL_KEYS = ["Principal", "NotPrincipal"];
6783
+ function unwrapSingle(value) {
6784
+ return Array.isArray(value) && value.length === 1 ? value[0] : value;
6785
+ }
6786
+ function accountKey(value) {
6787
+ if (typeof value !== "string") return value;
6788
+ if (ACCOUNT_ID.test(value)) return `account:${value}`;
6789
+ const m = ACCOUNT_ROOT_ARN.exec(value);
6790
+ return m ? `account:${m[1]}` : value;
6791
+ }
6792
+ const ANYONE = "anyone:*";
6793
+ function normalizePrincipal(principal) {
6794
+ if (principal === "*") return ANYONE;
6795
+ if (principal === null || typeof principal !== "object" || Array.isArray(principal)) return principal;
6796
+ const keys = Object.keys(principal);
6797
+ if (keys.length === 1 && keys[0] === "AWS" && unwrapSingle(principal["AWS"]) === "*") return ANYONE;
6798
+ const out = {};
6799
+ for (const [key, raw] of Object.entries(principal)) out[key] = unwrapSingle(key === "AWS" ? Array.isArray(raw) ? raw.map(accountKey) : accountKey(raw) : raw);
6800
+ return out;
6801
+ }
6802
+ function normalizeStatement(statement) {
6803
+ if (statement === null || typeof statement !== "object" || Array.isArray(statement)) return statement;
6804
+ const out = { ...statement };
6805
+ for (const key of LIST_KEYS) if (Object.prototype.hasOwnProperty.call(out, key)) out[key] = unwrapSingle(out[key]);
6806
+ for (const key of PRINCIPAL_KEYS) if (Object.prototype.hasOwnProperty.call(out, key)) out[key] = normalizePrincipal(out[key]);
6807
+ return out;
6808
+ }
6809
+ function canonicalJson$3(value) {
6810
+ const sortKeys = (v) => {
6811
+ if (Array.isArray(v)) return v.map(sortKeys);
6812
+ if (v !== null && typeof v === "object") {
6813
+ const out = Object.create(null);
6814
+ for (const key of Object.keys(v).sort()) out[key] = sortKeys(v[key]);
6815
+ return out;
6816
+ }
6817
+ return v;
6818
+ };
6819
+ return JSON.stringify(sortKeys(value));
6820
+ }
6821
+ function policyContentKey(document) {
6822
+ let value = document;
6823
+ if (typeof document === "string") try {
6824
+ value = JSON.parse(document);
6825
+ } catch {
6826
+ return `raw:${document}`;
6827
+ }
6828
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
6829
+ const doc = { ...value };
6830
+ if (Object.prototype.hasOwnProperty.call(doc, "Statement")) doc["Statement"] = (Array.isArray(doc["Statement"]) ? doc["Statement"] : [doc["Statement"]]).map(normalizeStatement);
6831
+ value = doc;
6832
+ }
6833
+ return canonicalJson$3(value);
6834
+ }
6835
+
6705
6836
  // src/provisioning/providers/s3-bucket-policy-provider.ts
6706
6837
  const OAI_USER_ARN_RE = /^arn:aws[a-z-]*:iam::cloudfront:user\/CloudFront Origin Access Identity ([A-Z0-9]+)$/;
6707
- const IAM_UNIQUE_ID_RE = /^A[A-Z0-9]{15,}$/;
6838
+ const IAM_UNIQUE_ID_RE = /^AIDA[A-Z0-9]{12,}$/;
6708
6839
  const oaiCanonicalUserIdCache = /* @__PURE__ */ new Map();
6840
+ const POLICY_RECHECKS = 3;
6841
+ const POLICY_RECHECK_DELAY_MS = 5e3;
6709
6842
  function buildSiblingOaiCanonicalMap(context) {
6710
6843
  const map = /* @__PURE__ */ new Map();
6711
6844
  for (const sib of Object.values(context?.siblings ?? {})) {
@@ -6721,10 +6854,11 @@ function extractStatements(policyDoc) {
6721
6854
  return (Array.isArray(stmt) ? stmt : stmt ? [stmt] : []).filter((s) => !!s && typeof s === "object" && !Array.isArray(s));
6722
6855
  }
6723
6856
  function findTemplateCanonicalUser(awsStmt, templateStmts) {
6857
+ const one = (v) => Array.isArray(v) && v.length === 1 ? v[0] : v;
6724
6858
  const key = (s) => JSON.stringify([
6725
6859
  s["Effect"],
6726
- s["Action"],
6727
- s["Resource"]
6860
+ one(s["Action"]),
6861
+ one(s["Resource"])
6728
6862
  ]);
6729
6863
  const want = key(awsStmt);
6730
6864
  const matches = templateStmts.filter((t) => key(t) === want);
@@ -6737,6 +6871,7 @@ function findTemplateCanonicalUser(awsStmt, templateStmts) {
6737
6871
  var S3BucketPolicyProvider = class {
6738
6872
  s3Client;
6739
6873
  logger = getLogger().child("S3BucketPolicyProvider");
6874
+ sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
6740
6875
  handledProperties = /* @__PURE__ */ new Map([["AWS::S3::BucketPolicy", /* @__PURE__ */ new Set(["Bucket", "PolicyDocument"])]]);
6741
6876
  constructor() {
6742
6877
  const awsClients = getAwsClients();
@@ -6748,8 +6883,16 @@ var S3BucketPolicyProvider = class {
6748
6883
  const policyDocument = properties["PolicyDocument"];
6749
6884
  if (!bucketName) throw new ProvisioningError(`Bucket is required for S3 bucket policy ${logicalId}`, resourceType, logicalId);
6750
6885
  if (!policyDocument) throw new ProvisioningError(`PolicyDocument is required for S3 bucket policy ${logicalId}`, resourceType, logicalId);
6886
+ const mask = context?.maskSecrets ?? ((t) => t);
6887
+ const policyDoc = typeof policyDocument === "string" ? policyDocument : JSON.stringify(policyDocument);
6888
+ let existing;
6889
+ try {
6890
+ existing = await this.probeExistingPolicy(bucketName);
6891
+ } catch (error) {
6892
+ throw this.wrapOperationError("create", logicalId, resourceType, bucketName, error, context?.maskSecrets);
6893
+ }
6894
+ await this.decideOnExistingPolicy(logicalId, resourceType, bucketName, policyDoc, existing, context?.replayingState === true, mask);
6751
6895
  try {
6752
- const policyDoc = typeof policyDocument === "string" ? policyDocument : JSON.stringify(policyDocument);
6753
6896
  await this.s3Client.send(new PutBucketPolicyCommand({
6754
6897
  Bucket: bucketName,
6755
6898
  Policy: policyDoc
@@ -6760,6 +6903,7 @@ var S3BucketPolicyProvider = class {
6760
6903
  attributes: {}
6761
6904
  };
6762
6905
  } catch (error) {
6906
+ if (isAmbiguousOutcomeError(error)) getPriorAttempts(logicalId)?.notePossiblyLanded();
6763
6907
  throw this.wrapOperationError("create", logicalId, resourceType, bucketName, error, context?.maskSecrets);
6764
6908
  }
6765
6909
  }
@@ -6811,6 +6955,107 @@ var S3BucketPolicyProvider = class {
6811
6955
  throw this.wrapOperationError("delete", logicalId, resourceType, physicalId, error, context?.maskSecrets);
6812
6956
  }
6813
6957
  }
6958
+ async probeExistingPolicy(bucketName) {
6959
+ try {
6960
+ const resp = await this.s3Client.send(new GetBucketPolicyCommand({ Bucket: bucketName }));
6961
+ return resp.Policy ? {
6962
+ kind: "present",
6963
+ policy: resp.Policy
6964
+ } : { kind: "absent" };
6965
+ } catch (error) {
6966
+ const name = error !== null && typeof error === "object" ? error.name : void 0;
6967
+ if (name === "NoSuchBucketPolicy" || name === "NoSuchBucket") return { kind: "absent" };
6968
+ if (name === "AccessDenied") return {
6969
+ kind: "unreadable",
6970
+ error
6971
+ };
6972
+ throw error;
6973
+ }
6974
+ }
6975
+ async decideOnExistingPolicy(logicalId, resourceType, bucketName, policyDoc, existing, replayingState, mask) {
6976
+ if (existing.kind === "absent") return;
6977
+ const bucketShown = mask(bucketName);
6978
+ if (existing.kind === "unreadable") {
6979
+ const failure = describeAwsFailure(existing.error);
6980
+ this.logger.debug(safeMsg`S3 bucket policy ${logicalId}: GetBucketPolicy on ${bucketShown} failed: ${mask(failure.detail)}`);
6981
+ this.logger.warn(safeMsg`S3 bucket policy ${logicalId}: could not read the policy bucket ${bucketShown} already holds (${mask(failure.summary)}), so cdkd cannot tell whether this create replaces a policy it does not own; creating it anyway. Grant s3:GetBucketPolicy to the deploying principal to enable this check.`);
6982
+ return;
6983
+ }
6984
+ if (replayingState) {
6985
+ this.logger.warn(safeMsg`S3 bucket policy ${logicalId}: the rollback replay restores the recorded policy on bucket ${bucketShown}, replacing the policy attached there since.`);
6986
+ return;
6987
+ }
6988
+ const lookup = getPriorAttempts(logicalId);
6989
+ const ownAttemptMayHaveLanded = lookup?.possiblyLanded() === true;
6990
+ const refuse = (text) => {
6991
+ const refusal = markNonRetryable(new ProvisioningError(mask(`Failed to create S3 bucket policy ${logicalId}: The bucket policy already exists on bucket ${bucketShown}. ${text}` + (ownAttemptMayHaveLanded ? " An earlier attempt of this create got no definite answer from AWS, but the policy the bucket holds differs from the one it sent." : "")), resourceType, logicalId, bucketName));
6992
+ throw ownAttemptMayHaveLanded ? refusal : markRefusedBeforeApplying(refusal);
6993
+ };
6994
+ const holderId = ownPolicyHolder(logicalId, bucketName);
6995
+ const holder = holderId === void 0 ? void 0 : logicalIdShown(holderId);
6996
+ if (holder !== void 0) refuse(`This stack's ${holder} already holds the policy on that bucket: a BucketPolicy construct moved or renamed gets a new logical id, which is created before the old one is deleted. Nothing was sent. ` + (getCurrentStackName()?.includes("~") === true ? "Deploy" : `Move the record with 'cdkd refactor', or deploy`) + ` the removal of ${holder} first. Do not delete or import the existing policy: the removal of ${holder} would then delete it, leaving the bucket with no policy.`);
6997
+ let livePolicy = existing.policy;
6998
+ for (let recheck = 0;; recheck++) {
6999
+ if (await this.isOwnLeftover(logicalId, bucketName, policyDoc, livePolicy, ownAttemptMayHaveLanded, lookup, bucketShown, mask)) return;
7000
+ if (recheck >= POLICY_RECHECKS) break;
7001
+ await this.sleep(POLICY_RECHECK_DELAY_MS);
7002
+ let again;
7003
+ try {
7004
+ again = await this.probeExistingPolicy(bucketName);
7005
+ } catch (error) {
7006
+ this.logger.debug(safeMsg`S3 bucket policy ${logicalId}: re-reading the policy on ${bucketShown} failed: ${mask(describeAwsFailure(error).detail)}`);
7007
+ break;
7008
+ }
7009
+ if (again.kind === "absent") return;
7010
+ if (again.kind === "unreadable") break;
7011
+ livePolicy = again.policy;
7012
+ }
7013
+ const bucketArg = bucketShown === bucketName && isS3BucketName(bucketName) ? bucketName : "<bucketName>";
7014
+ const stackName = getCurrentStackName();
7015
+ refuse(`cdkd does not overwrite it: PutBucketPolicy replaces the whole policy, so the statements its owner attached (a log-delivery service's grant, for example) would be dropped, and CloudFormation refuses this create the same way. Nothing was sent. Either remove the existing policy if nothing relies on it ('aws s3api delete-bucket-policy --bucket ${bucketArg}')${stackName !== void 0 && stackName.includes("~") ? "" : `, or merge its statements into this resource's PolicyDocument and adopt it into the stack with 'cdkd import ${stackName !== void 0 && isPasteableIdent(stackName) ? stackName : "<stackName>"} --resource ${remedyLogicalId(logicalId)}=${bucketArg}'`}, then re-deploy.`);
7016
+ }
7017
+ async isOwnLeftover(logicalId, bucketName, policyDoc, livePolicy, ownAttemptMayHaveLanded, lookup, bucketShown, mask) {
7018
+ if (ownAttemptMayHaveLanded && await this.livePolicyKey(livePolicy, policyDoc) === policyContentKey(policyDoc)) {
7019
+ this.logger.debug(safeMsg`S3 bucket policy ${logicalId}: an earlier attempt of this create attached the policy; re-sending it`);
7020
+ return true;
7021
+ }
7022
+ if (lookup === void 0) return false;
7023
+ let attempts;
7024
+ try {
7025
+ attempts = await lookup.attempts();
7026
+ } catch (error) {
7027
+ this.logger.debug(safeMsg`S3 bucket policy ${logicalId}: rollback journal read failed: ${mask(describeAwsFailure(error).detail)}`);
7028
+ return false;
7029
+ }
7030
+ for (const bag of attempts) {
7031
+ const attempted = bag["PolicyDocument"];
7032
+ if (bag["Bucket"] !== bucketName || attempted == null) continue;
7033
+ if (await this.livePolicyKey(livePolicy, attempted) === policyContentKey(attempted)) {
7034
+ this.logger.info(safeMsg`S3 bucket policy ${logicalId}: the policy on bucket ${bucketShown} is the one this stack's rollback journal shows an earlier deploy of it attempted; replacing it`);
7035
+ return true;
7036
+ }
7037
+ }
7038
+ return false;
7039
+ }
7040
+ async livePolicyKey(livePolicy, reference) {
7041
+ let live;
7042
+ let ref = reference;
7043
+ try {
7044
+ live = JSON.parse(livePolicy);
7045
+ if (typeof ref === "string") ref = JSON.parse(ref);
7046
+ } catch {
7047
+ return policyContentKey(livePolicy);
7048
+ }
7049
+ const siblings = {};
7050
+ for (const [id, record] of getStackRecords()?.live() ?? []) siblings[id] = {
7051
+ resourceType: record.resourceType,
7052
+ physicalId: record.physicalId,
7053
+ properties: {},
7054
+ ...record.attributes !== void 0 && { attributes: record.attributes }
7055
+ };
7056
+ await this.normalizeOaiPrincipals(live, { PolicyDocument: ref }, { siblings });
7057
+ return policyContentKey(live);
7058
+ }
6814
7059
  wrapOperationError(operation, logicalId, resourceType, physicalId, error, maskSecrets) {
6815
7060
  const mask = maskSecrets ?? ((t) => t);
6816
7061
  const cause = error instanceof Error ? error : void 0;
@@ -6903,6 +7148,9 @@ function isS3BucketName(value) {
6903
7148
  if (value.endsWith("-s3alias") || value.endsWith("--ol-s3")) return false;
6904
7149
  return true;
6905
7150
  }
7151
+ function ownPolicyHolder(logicalId, bucketName) {
7152
+ for (const [otherId, record] of getStackRecords()?.live() ?? []) if (otherId !== logicalId && record.resourceType === "AWS::S3::BucketPolicy" && record.physicalId === bucketName) return otherId;
7153
+ }
6906
7154
 
6907
7155
  // src/provisioning/providers/sqs-queue-provider.ts
6908
7156
  function serializeRedrivePolicy(value) {
@@ -6971,7 +7219,11 @@ var SQSQueueProvider = class {
6971
7219
  }
6972
7220
  generatedCreateName(_resourceType, logicalId, properties) {
6973
7221
  if (properties["QueueName"]) return void 0;
6974
- return generatedNameFor("AWS::SQS::Queue", logicalId);
7222
+ return generatedNameFor("AWS::SQS::Queue", logicalId, { properties });
7223
+ }
7224
+ lookupNeedsResolvedProperties(_resourceType, properties) {
7225
+ const fifo = properties["FifoQueue"];
7226
+ return fifo !== void 0 && fifo !== null && coerceCfnBoolean(fifo) === void 0;
6975
7227
  }
6976
7228
  async holderCreatedAt(_resourceType, physicalId) {
6977
7229
  const resp = await this.sqsClient.send(new GetQueueAttributesCommand({
@@ -7001,6 +7253,7 @@ var SQSQueueProvider = class {
7001
7253
  const value = properties[cdkKey];
7002
7254
  if (cdkKey === "RedrivePolicy" && typeof value === "object") attributes[sqsKey] = serializeRedrivePolicy(value);
7003
7255
  else if (cdkKey === "RedriveAllowPolicy") attributes[sqsKey] = serializeRedriveAllowPolicy(value);
7256
+ else if (cdkKey === "FifoQueue" && coerceCfnBoolean(value) !== void 0) attributes[sqsKey] = String(coerceCfnBoolean(value));
7004
7257
  else attributes[sqsKey] = stringifyValue(value);
7005
7258
  }
7006
7259
  const tags = {};
@@ -7052,7 +7305,7 @@ var SQSQueueProvider = class {
7052
7305
  QueueUrl: physicalId,
7053
7306
  AttributeNames: ["QueueArn"]
7054
7307
  }));
7055
- const queueName = properties["QueueName"] || physicalId.split("/").pop() || generatedNameFor("AWS::SQS::Queue", logicalId);
7308
+ const queueName = properties["QueueName"] || physicalId.split("/").pop() || generatedNameFor("AWS::SQS::Queue", logicalId, { properties });
7056
7309
  return {
7057
7310
  physicalId,
7058
7311
  wasReplaced: false,
@@ -7232,137 +7485,6 @@ var SQSQueueProvider = class {
7232
7485
  }
7233
7486
  };
7234
7487
 
7235
- // src/provisioning/policy-document-content.ts
7236
- const MASK = "***";
7237
- const PERMANENT_CDKD_CODES = /* @__PURE__ */ new Set(["ROLLBACK_SECRET_TOKEN_SCAN_MISMATCH"]);
7238
- const MARKED_PERMANENT_CODE_PREFIXES = ["INTRINSIC_RESOLUTION_REFUSAL", "ROLLBACK_SECRET_REGION_AMBIGUOUS"];
7239
- const NOT_FOUND_ERROR_NAMES = /* @__PURE__ */ new Set([
7240
- "ResourceNotFoundException",
7241
- "ParameterNotFound",
7242
- "ParameterVersionNotFound"
7243
- ]);
7244
- function holdsUnresolvedValue(document) {
7245
- let root = document;
7246
- if (typeof document === "string") try {
7247
- root = JSON.parse(document);
7248
- } catch {
7249
- root = document;
7250
- }
7251
- const walk = (v) => {
7252
- if (typeof v === "string") return v === MASK || v.includes("{{resolve:");
7253
- if (Array.isArray(v)) return v.some(walk);
7254
- if (v !== null && typeof v === "object") return Object.values(v).some(walk);
7255
- return false;
7256
- };
7257
- return walk(root);
7258
- }
7259
- function isPermanentResolutionError(error) {
7260
- let current = error;
7261
- for (let depth = 0; depth < 5 && current != null; depth++) {
7262
- const e = current;
7263
- if (typeof e.name === "string" && NOT_FOUND_ERROR_NAMES.has(e.name)) return true;
7264
- if (typeof e.code === "string") {
7265
- if (PERMANENT_CDKD_CODES.has(e.code)) return true;
7266
- const code = e.code;
7267
- if (MARKED_PERMANENT_CODE_PREFIXES.some((p) => code.startsWith(p)) && isMarkedNonRetryable(current)) return true;
7268
- }
7269
- if (typeof e.message === "string" && e.message.startsWith("Dynamic reference: ")) return true;
7270
- current = e.cause;
7271
- }
7272
- return false;
7273
- }
7274
- function errorName(error) {
7275
- const name = error?.name;
7276
- return typeof name === "string" && /^[\w.-]{1,128}$/.test(name) ? name : "error";
7277
- }
7278
- async function attemptedPolicyDocument(recorded, resolve) {
7279
- let document = recorded;
7280
- if (resolve) try {
7281
- document = await resolve();
7282
- } catch (error) {
7283
- return isPermanentResolutionError(error) ? {
7284
- kind: "unusable",
7285
- why: "a secret it references does not exist or cannot be used"
7286
- } : {
7287
- kind: "retry",
7288
- errorName: errorName(error)
7289
- };
7290
- }
7291
- if (!(typeof document === "string" && document.length > 0 || document !== null && typeof document === "object")) return {
7292
- kind: "unusable",
7293
- why: "no policy document it attempted is recorded"
7294
- };
7295
- if (holdsUnresolvedValue(document)) return {
7296
- kind: "unusable",
7297
- why: "its policy document still holds a secret reference or masked value"
7298
- };
7299
- return {
7300
- kind: "document",
7301
- document
7302
- };
7303
- }
7304
- const ACCOUNT_ID = /^\d{12}$/;
7305
- const ACCOUNT_ROOT_ARN = /^arn:[a-z-]+:iam::(\d{12}):root$/;
7306
- const LIST_KEYS = [
7307
- "Action",
7308
- "NotAction",
7309
- "Resource",
7310
- "NotResource"
7311
- ];
7312
- const PRINCIPAL_KEYS = ["Principal", "NotPrincipal"];
7313
- function unwrapSingle(value) {
7314
- return Array.isArray(value) && value.length === 1 ? value[0] : value;
7315
- }
7316
- function accountKey(value) {
7317
- if (typeof value !== "string") return value;
7318
- if (ACCOUNT_ID.test(value)) return `account:${value}`;
7319
- const m = ACCOUNT_ROOT_ARN.exec(value);
7320
- return m ? `account:${m[1]}` : value;
7321
- }
7322
- const ANYONE = "anyone:*";
7323
- function normalizePrincipal(principal) {
7324
- if (principal === "*") return ANYONE;
7325
- if (principal === null || typeof principal !== "object" || Array.isArray(principal)) return principal;
7326
- const keys = Object.keys(principal);
7327
- if (keys.length === 1 && keys[0] === "AWS" && unwrapSingle(principal["AWS"]) === "*") return ANYONE;
7328
- const out = {};
7329
- for (const [key, raw] of Object.entries(principal)) out[key] = unwrapSingle(key === "AWS" ? Array.isArray(raw) ? raw.map(accountKey) : accountKey(raw) : raw);
7330
- return out;
7331
- }
7332
- function normalizeStatement(statement) {
7333
- if (statement === null || typeof statement !== "object" || Array.isArray(statement)) return statement;
7334
- const out = { ...statement };
7335
- for (const key of LIST_KEYS) if (Object.prototype.hasOwnProperty.call(out, key)) out[key] = unwrapSingle(out[key]);
7336
- for (const key of PRINCIPAL_KEYS) if (Object.prototype.hasOwnProperty.call(out, key)) out[key] = normalizePrincipal(out[key]);
7337
- return out;
7338
- }
7339
- function canonicalJson$3(value) {
7340
- const sortKeys = (v) => {
7341
- if (Array.isArray(v)) return v.map(sortKeys);
7342
- if (v !== null && typeof v === "object") {
7343
- const out = Object.create(null);
7344
- for (const key of Object.keys(v).sort()) out[key] = sortKeys(v[key]);
7345
- return out;
7346
- }
7347
- return v;
7348
- };
7349
- return JSON.stringify(sortKeys(value));
7350
- }
7351
- function policyContentKey(document) {
7352
- let value = document;
7353
- if (typeof document === "string") try {
7354
- value = JSON.parse(document);
7355
- } catch {
7356
- return `raw:${document}`;
7357
- }
7358
- if (value !== null && typeof value === "object" && !Array.isArray(value)) {
7359
- const doc = { ...value };
7360
- if (Object.prototype.hasOwnProperty.call(doc, "Statement")) doc["Statement"] = (Array.isArray(doc["Statement"]) ? doc["Statement"] : [doc["Statement"]]).map(normalizeStatement);
7361
- value = doc;
7362
- }
7363
- return canonicalJson$3(value);
7364
- }
7365
-
7366
7488
  // src/provisioning/providers/sqs-queue-policy-provider.ts
7367
7489
  const QUEUE_POLICY_UNREADABLE_SKIP_REASON = "the policy of a queue it wrote could not be read, so whether that queue still carries it is unknown";
7368
7490
  const QUEUE_POLICY_UNRESOLVED_DOCUMENT_SKIP_REASON = "the policy document it attempted could not be resolved right now to compare its queues with";
@@ -7827,7 +7949,10 @@ async function create$37(logicalId, resourceType, properties, context) {
7827
7949
  let leftBehindArn;
7828
7950
  try {
7829
7951
  const topicAttributes = {};
7830
- if (properties["FifoTopic"]) topicAttributes["FifoTopic"] = stringifyValue(properties["FifoTopic"]);
7952
+ if (properties["FifoTopic"]) {
7953
+ const fifo = coerceCfnBoolean(properties["FifoTopic"]);
7954
+ topicAttributes["FifoTopic"] = fifo === void 0 ? stringifyValue(properties["FifoTopic"]) : String(fifo);
7955
+ }
7831
7956
  if (properties["ContentBasedDeduplication"]) topicAttributes["ContentBasedDeduplication"] = stringifyValue(properties["ContentBasedDeduplication"]);
7832
7957
  if (properties["DisplayName"]) topicAttributes["DisplayName"] = properties["DisplayName"];
7833
7958
  if (properties["KmsMasterKeyId"]) topicAttributes["KmsMasterKeyId"] = properties["KmsMasterKeyId"];
@@ -8265,7 +8390,11 @@ var SNSTopicProvider = class {
8265
8390
  }
8266
8391
  generatedCreateName(_resourceType, logicalId, properties) {
8267
8392
  if (properties["TopicName"]) return void 0;
8268
- return generatedNameFor("AWS::SNS::Topic", logicalId);
8393
+ return generatedNameFor("AWS::SNS::Topic", logicalId, { properties });
8394
+ }
8395
+ lookupNeedsResolvedProperties(_resourceType, properties) {
8396
+ const fifo = properties["FifoTopic"];
8397
+ return fifo !== void 0 && fifo !== null && coerceCfnBoolean(fifo) === void 0;
8269
8398
  }
8270
8399
  import(input) {
8271
8400
  return importImpl$36.call(this, input);
@@ -36018,7 +36147,7 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
36018
36147
  ManageMasterUserPassword: managedPassword,
36019
36148
  MasterUserSecretKmsKeyId: properties["MasterUserSecretKmsKeyId"],
36020
36149
  ...globalClusterId !== void 0 && { GlobalClusterIdentifier: globalClusterId }
36021
- })) : restore.kind === "snapshot" ? this.getCreateClient().send(new RestoreDBClusterFromSnapshotCommand({
36150
+ })) : restore.kind === "snapshot" ? this.getCreateClient().send(new RestoreDBClusterFromSnapshotCommand$1({
36022
36151
  ...sharedInput,
36023
36152
  SnapshotIdentifier: restore.snapshotIdentifier,
36024
36153
  Engine: "docdb",
@@ -36060,7 +36189,7 @@ async function refuseUnencryptedRestoreSource(properties, restore, resourceType,
36060
36189
  let encrypted;
36061
36190
  try {
36062
36191
  if (restore.kind === "snapshot") {
36063
- const snapshot = (await this.getClient().send(new DescribeDBClusterSnapshotsCommand({
36192
+ const snapshot = (await this.getClient().send(new DescribeDBClusterSnapshotsCommand$1({
36064
36193
  DBClusterSnapshotIdentifier: restore.snapshotIdentifier,
36065
36194
  IncludeShared: true,
36066
36195
  IncludePublic: true
@@ -62188,4 +62317,4 @@ var ACMCertificateProvider = class {
62188
62317
  };
62189
62318
 
62190
62319
  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, 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, 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 };
62191
- //# sourceMappingURL=provider-classes-CRZ8a4sy.js.map
62320
+ //# sourceMappingURL=provider-classes-0cQAzv7Y.js.map