@go-to-k/cdkd 0.316.0 → 0.318.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 (32) hide show
  1. package/dist/{asg-provider-DOLuhiky.js → asg-provider-kV8DYFjT.js} +3 -3
  2. package/dist/{asg-provider-DOLuhiky.js.map → asg-provider-kV8DYFjT.js.map} +1 -1
  3. package/dist/{aws-clients-CGZAQ1gS.js → aws-clients-DWpHZk2l.js} +2 -1
  4. package/dist/aws-clients-DWpHZk2l.js.map +1 -0
  5. package/dist/cli.js +2 -2
  6. package/dist/{created-resource-sink-B9OCHRr_.js → created-resource-sink-BpB3iPvn.js} +10 -3
  7. package/dist/{created-resource-sink-B9OCHRr_.js.map → created-resource-sink-BpB3iPvn.js.map} +1 -1
  8. package/dist/{db-instance-modify-retry-DQTozL4b.js → db-instance-modify-retry-CspmK57I.js} +2 -2
  9. package/dist/{db-instance-modify-retry-DQTozL4b.js.map → db-instance-modify-retry-CspmK57I.js.map} +1 -1
  10. package/dist/{deploy-engine-NYjdxQWe.js → deploy-engine-BnEvzfon.js} +26 -20
  11. package/dist/deploy-engine-BnEvzfon.js.map +1 -0
  12. package/dist/{iam-role-provider-Ddo7WwEs.js → iam-role-provider-3w71Eu4a.js} +44 -12
  13. package/dist/iam-role-provider-3w71Eu4a.js.map +1 -0
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +4 -4
  17. package/dist/{neptune-provider-CuZbMn9R.js → neptune-provider-D8tkFP12.js} +4 -4
  18. package/dist/{neptune-provider-CuZbMn9R.js.map → neptune-provider-D8tkFP12.js.map} +1 -1
  19. package/dist/{program-DSq5150i.js → program-CKm1Nk6t.js} +6 -6
  20. package/dist/{program-DSq5150i.js.map → program-CKm1Nk6t.js.map} +1 -1
  21. package/dist/{provider-classes-ushrO6ri.js → provider-classes-CbiecOol.js} +658 -61
  22. package/dist/provider-classes-CbiecOol.js.map +1 -0
  23. package/dist/{rds-provider-VigGKsxO.js → rds-provider-bEeid6uI.js} +60 -7
  24. package/dist/rds-provider-bEeid6uI.js.map +1 -0
  25. package/dist/{version-9_dvIw-h.js → version-CFF8UOVj.js} +2 -2
  26. package/dist/{version-9_dvIw-h.js.map → version-CFF8UOVj.js.map} +1 -1
  27. package/package.json +1 -1
  28. package/dist/aws-clients-CGZAQ1gS.js.map +0 -1
  29. package/dist/deploy-engine-NYjdxQWe.js.map +0 -1
  30. package/dist/iam-role-provider-Ddo7WwEs.js.map +0 -1
  31. package/dist/provider-classes-ushrO6ri.js.map +0 -1
  32. package/dist/rds-provider-VigGKsxO.js.map +0 -1
@@ -1,20 +1,20 @@
1
- import { r as getAwsClients, s as withApiGatewayPacing } from "./aws-clients-CGZAQ1gS.js";
1
+ import { r as getAwsClients, s as withApiGatewayPacing } from "./aws-clients-DWpHZk2l.js";
2
2
  import { $ as safeMsg, A as isBeforeStateRead, E as generatedNameFor, J as displaySafe, N as recordedGeneratedNameKept, O as getCurrentStackInstanceId, Q as plainIdentOr, T as generateResourceNameWithFallback, V as SECRET_REF_MAX_CODE_POINTS, 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, w as generateResourceName } from "./aws-failure-text-DiHodi76.js";
3
- import { $ as logGroupProtectionSite, $n as plainOrDescribed, A as withoutServerErrorRetries, Ar as markNonRetryable, At as createMaskedLogSinks, B as quotedRemedyLogicalId, C as RecentIdSet, Ct as compositeIdSeparatorRefusal, D as replayFollowedAmbiguousAttempt, Dr as THROTTLING_ERROR_NAMES, E as isInsideWindow, Et as packCompositeId, F as VALUE_NOT_SHOWN, Ft as withDerivedNameMasks, G as ProtectionFlipRegistry, Gt as markCreatedBeforeFailure, H as remedyLogicalId, Ht as isAuxiliaryFailure, I as isPlainImportJson, J as deleteWithProtectionCompensation, Jn as commandHole, Kt as markSupersedesEarlierCreate, L as isPlainImportValue, Mn as ProvisioningError, Mr as wrapMaskedAwsError, Mt as isSecretDerivedValue, N as markNotGone, Nt as maskDeep, O as replayedSendWindow, Or as isMarkedNonRetryable, Ot as segmentAfterAnchor, P as assertRegionMatch, Pn as ResourceUpdateNotSupportedError, Pt as maskerOrIdentity, Q as isTerminalDeleteFailure, R as isQuotableImportValue, Rt as clearCreatedBeforeFailure, S as AmbiguousCreateLatch, Sr as isExplicitDenyError, St as compositeIdFormatMessage, T as createAttemptKey, Tr as isTransientServerError, Tt as logicalIdShown, U as resolveExplicitPhysicalId, V as refusalTypeShown, Wt as markAuxiliaryFailure, X as isProceedDbStatus, Xn as isInertUnquoted, Yn as hasClauseBreak, Z as isTerminalDbWaitStatus, Zn as pasteableCommand, _n as CdkdError, a as retractCreatedResource, an as injectiveKey, at as userPoolProtectionSite, bt as startInterruptWatch, c as SECRET_DERIVED_READ_LIVE, ct as WITHHELD_AWS_COMMAND, d as readPrincipalLists, dn as ambientClientDefaults, dt as protectedReplacementAdvice, et as observeThenDisableProtection, fn as ambientCredentialConfig, fr as markNameCollision, ft as renderDisableCommand, h as clearOnUpdateRemoval, hn as AccountIdUnavailableError, i as reportCreatedResource, j as RESOURCE_NOT_FOUND, jr as markRedactedCause, jt as createMaskedRetryLogger, k as setBounded, kr as isThrottlingError, kt as stateOrphanRecordRemedy, l as holdsSecretDerivedEntry, lt as isAwsCliLiteral, mn as credentialFingerprint, mr as relayedNameCollision, mt as ElapsedBudgetRegistry, nr as shellQuote, nt as rdsFamilyProtectionSite, on as injectiveKeyPrefix, p as recordedPrincipalsRepair, pn as clientDefaultsFor, pr as markReplayMayCollide, pt as ElapsedBudget, q as deleteAfterProtectionFlipWithFinalSnapshot, rr as withheldTargetClause, st as UNNAMEABLE_ID_CLAUSE, tt as protectionFlipKey, u as onlySecretDerived, un as withPasteableAwsProfile, ut as pasteableAwsCommand, v as removedTemplateKeys, vr as explicitDenyPolicyKind, w as ambiguousAttemptLead, wr as isRetryableTransientError, wt as compositeIdSkipResult, x as AMBIGUOUS_LATCH_TTL_MS, xr as isAmbiguousOutcomeError, xt as canonicalizeRoute53QueryName, y as withRemovalDefaults, yt as isInterruptedWaitError, z as normalizeAwsTagsToCfn } from "./created-resource-sink-B9OCHRr_.js";
3
+ import { $ as isTerminalDeleteFailure, A as setBounded, Ar as isThrottlingError, At as stateOrphanRecordRemedy, B as normalizeAwsTagsToCfn, C as AmbiguousCreateLatch, Cr as isExplicitDenyError, Ct as compositeIdFormatMessage, D as isInsideWindow, Dt as packCompositeId, E as createAttemptKey, Er as isTransientServerError, Et as logicalIdShown, F as assertRegionMatch, Fn as ResourceUpdateNotSupportedError, Ft as maskerOrIdentity, Gt as markAuxiliaryFailure, H as refusalTypeShown, I as VALUE_NOT_SHOWN, It as withDerivedNameMasks, J as deleteAfterProtectionFlipWithFinalSnapshot, K as ProtectionFlipRegistry, Kt as markCreatedBeforeFailure, L as isPlainImportJson, M as RESOURCE_NOT_FOUND, Mr as markRedactedCause, Mt as createMaskedRetryLogger, Nn as ProvisioningError, Nr as wrapMaskedAwsError, Nt as isSecretDerivedValue, O as replayFollowedAmbiguousAttempt, Or as THROTTLING_ERROR_NAMES, P as markNotGone, Pt as maskDeep, Q as isTerminalDbWaitStatus, Qn as pasteableCommand, R as isPlainImportValue, S as AMBIGUOUS_LATCH_TTL_MS, Sr as isAmbiguousOutcomeError, St as canonicalizeRoute53QueryName, T as ambiguousAttemptLead, Tr as isRetryableTransientError, Tt as compositeIdSkipResult, U as remedyLogicalId, Ut as isAuxiliaryFailure, V as quotedRemedyLogicalId, W as resolveExplicitPhysicalId, Xn as hasClauseBreak, Y as deleteWithProtectionCompensation, Yn as commandHole, Z as isProceedDbStatus, Zn as isInertUnquoted, b as withRemovalDefaults, bt as isInterruptedWaitError, ct as UNNAMEABLE_ID_CLAUSE, d as onlySecretDerived, dn as withPasteableAwsProfile, dt as pasteableAwsCommand, er as plainOrDescribed, et as logGroupProtectionSite, f as readPrincipalLists, fn as ambientClientDefaults, ft as protectedReplacementAdvice, g as clearOnUpdateRemoval, gn as AccountIdUnavailableError, hn as credentialFingerprint, hr as relayedNameCollision, ht as ElapsedBudgetRegistry, i as reportCreatedResource, ir as withheldTargetClause, j as withoutServerErrorRetries, jr as markNonRetryable, jt as createMaskedLogSinks, k as replayedSendWindow, kr as isMarkedNonRetryable, kt as segmentAfterAnchor, l as SECRET_DERIVED_READ_LIVE, lt as WITHHELD_AWS_COMMAND, m as recordedPrincipalsRepair, mn as clientDefaultsFor, mr as markReplayMayCollide, mt as ElapsedBudget, nt as protectionFlipKey, o as retractCreatedResource, on as injectiveKey, ot as userPoolProtectionSite, pn as ambientCredentialConfig, pr as markNameCollision, pt as renderDisableCommand, qt as markSupersedesEarlierCreate, rr as shellQuote, rt as rdsFamilyProtectionSite, sn as injectiveKeyPrefix, tt as observeThenDisableProtection, u as holdsSecretDerivedEntry, ut as isAwsCliLiteral, vn as CdkdError, w as RecentIdSet, wt as compositeIdSeparatorRefusal, xt as startInterruptWatch, y as removedTemplateKeys, yr as explicitDenyPolicyKind, z as isQuotableImportValue, zt as clearCreatedBeforeFailure } from "./created-resource-sink-BpB3iPvn.js";
4
4
  import { c as ambientRegion } from "./aws-client-defaults-BLXFsfMa.js";
5
- import { $ as sendTtlWaitingOutRateLimit, A as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, Aa as isUsableAttemptedName, As as refuseMalformedResourcesForDestroy, B as deleteTableWithIndexBusyRetry, Ba as s3BucketDomainName, Bi as markDeleteStarted, Br as getStackRecords, C as planContributorInsightsOp, Ca as ec2InstanceProtectionSite, Cc as ecsServiceLaunchTypeSetOrChanged, Ct as enclosingDeadlineExpired, D as reverseMapTableContributorInsights, Da as reEnableInstanceApiTermination, Dc as sameLambdaFunctionAddress, E as reverseMapIndexContributorInsights, Ea as reDisableInstanceApiTermination, Ec as lambdaFunctionNameForMask, F as resolveDynamoDbDeleteBudgetClock, Fd as renderAssemblyPathEscape, Fi as acquireIdempotencyToken, Fo as accountArgs, G as readbackVectorIndexes, Gc as markSameGenerationBag, Gi as refuseMalformedDesiredTags, Gn as isRedactedRecordedValue, Gs as findSilentDropProperties, H as relayedIndexBusyDelete, Ha as s3BucketRegionalDomainName, Hi as DBPROXY_TAG_OPTIONS, Hn as getCurrentProducerRegions, Hr as replacedDeleteFailureVerdict, Hs as withheldAccountClause, I as resolveDynamoDbDeleteBudgetMs, Id as resolveAssemblyPath, J as vectorIndexesShapeDetail, Ja as outputReferenceProvenanceOf, Jc as snapshotPassProvenance, Ji as definedAttributes, Jt as getCurrentNestedStackContext, K as vectorIndexesForCreate, Kc as redactForState, Ki as tagMapAsList, Kn as redactedDeleteAddressFields, L as DELETE_INDEX_WAIT_PROCEED_NOTE, M as beginDeleteWait, N as compensateRemovedDeletionProtection, Nd as describeFileReadFailure, Ni as reserveStackCreateToken, O as stripIndexContributorInsights, Oo as passedParameterClassesOf, P as deleteBudgetKey, Pd as displayAssemblyPath, Q as readTtlSpec, R as INDEX_SETTLE_POLL_INTERVAL_MS, Ra as isSettledInstanceState, Rr as awaitInFlightSibling, S as indexDeclaresContributorInsights, Sl as recordAttributeIdCopy, T as readContributorInsightsSpec, Ta as observeThenDisableInstanceApiTermination, Tc as canonicalLambdaFunctionName, Tl as carriesSecretMask, To as parseWebACLArn, U as waitForIndexesSettled, Ua as s3BucketWebsiteUrl, Ui as planTagDiff, V as maskedLogger, Va as s3BucketDualStackDomainName, Vi as DBPROXY_TAGS_WHAT, Vt as getNestedRevertRun, W as planVectorIndexUpdates, Wi as readTagList, Wn as REDACTED_DELETE_ADDRESS_SKIP_REASON, Wt as revertNestedChildFromJournal, X as isTtlRateLimited, Y as isTtlAlreadyDisabled, Yi as stringifyIfAssigned, Yt as withNestedStackContext, Z as planTimeToLive, Zc as hasMaskableValues, _ as streamMemberRefusals, _t as renderNestedTemplateTreeDefect, _u as rewriteTemplateAssetReferences, aa as getCurrentResourceSecrets, ac as toCfnInteger, an as chunks, at as markRefusedBeforeApplying, b as CONTRIBUTOR_INSIGHTS_KEY, ba as isWaitAbandonedError, bc as withRetry, bd as derivePartitionAndUrlSuffix, bl as recoverMaskedOutput, c as DynamoDBGlobalTableProvider, cc as coerceCfnInteger, cn as withApiLimit, d as declaredStreamPolicyMember, da as slowCcOperationTimeoutMs, dc as configStringRefusal, dl as withoutPhysicalNameCopies, et as ECR_AUTO_DELETE_IMAGES_TAG, f as declaredStreamTagsMember, fa as onlySecretReferencesDiffer, fc as readConfigString, fu as stringifyValue, g as streamDeclaresTags, gc as requireConfigString, gd as decodeListingKey, gt as listNestedTemplateRows, h as streamDeclaresPolicy, hc as requireConfigObject, ht as isAbsoluteAssetPath, ic as isWarmThroughputDecrease, it as getPriorAttempts, j as DYNAMODB_DELETE_POLL_COST_MS, ji as earliestDefined, k as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, l as STREAM_POLICY_KEY, lc as configBooleanRefusal, lu as timePhase, m as reverseMapStreamPolicy, mc as requireConfigArray, mo as getAccountInfo, mt as findNestedTemplateTreeDefect, nc as WARM_THROUGHPUT_MEMBERS, nt as hasCdkAutoDeleteTag, oc as toFiniteNumber, on as isAccessDeniedError, p as planStreamMemberOps, pa as unchangedBehindSecretReference, pc as replayWarn, pl as dynamicReferenceTokens, q as vectorIndexesSettled, qc as recordReferenceProvenanceEntry, qi as tagPlanWarning, qn as redactedDeleteAddressSkip, qs as withoutSilentDropProperties, rc as coerceWarmThroughput$1, rt as isTruthyCfnBoolean, sc as coerceCfnBoolean, sn as lookupEachName, t as DeployEngine, ta as waitForLambdaFunctionActive, tt as S3_AUTO_DELETE_OBJECTS_TAG, u as STREAM_TAGS_KEY, uc as configIntegerRefusal, us as refuseMalformedNestedChildOutputs, v as streamPolicyMatchesDeclared, va as deleteSkipReason, vi as secretNamedAttributeNamesOf, w as planIndexContributorInsightsOps, wa as isTerminationProtectionPropagationError, wc as emrClusterInstancesReplaced, wt as enclosingDeadlineRemainingMs, x as contributorInsightsRefusals, xa as markWaitAbandoned, xc as blockDeviceMappingsDifferOnlyInDeleteOnTermination, xl as physicalNameCopiesOf, y as streamTagsMatchDeclared, ya as withIndeterminateGuard, yd as canonicalizeRegion, z as TABLE_INDEX_NOUN, za as s3BucketArn, zc as passedNoEchoParametersOf, zi as isRefusedByName } from "./deploy-engine-NYjdxQWe.js";
6
- import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-Ddo7WwEs.js";
7
- import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, s as resolvedResourceTimeoutMs, t as canonicalizeIpv4Cidr } from "./program-DSq5150i.js";
8
- import { n as modifyDbInstanceWhenAvailable } from "./db-instance-modify-retry-DQTozL4b.js";
9
- import { RDSProvider } from "./rds-provider-VigGKsxO.js";
10
- import { NeptuneProvider } from "./neptune-provider-CuZbMn9R.js";
11
- import { ASGProvider } from "./asg-provider-DOLuhiky.js";
5
+ import { $ as sendTtlWaitingOutRateLimit, A as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, Aa as isUsableAttemptedName, As as refuseMalformedResourcesForDestroy, B as deleteTableWithIndexBusyRetry, Ba as s3BucketDomainName, Bi as markDeleteStarted, Br as getStackRecords, C as planContributorInsightsOp, Ca as ec2InstanceProtectionSite, Cc as ecsServiceLaunchTypeSetOrChanged, Ct as enclosingDeadlineExpired, D as reverseMapTableContributorInsights, Da as reEnableInstanceApiTermination, Dc as sameLambdaFunctionAddress, E as reverseMapIndexContributorInsights, Ea as reDisableInstanceApiTermination, Ec as lambdaFunctionNameForMask, F as resolveDynamoDbDeleteBudgetClock, Fd as renderAssemblyPathEscape, Fi as acquireIdempotencyToken, Fo as accountArgs, G as readbackVectorIndexes, Gc as markSameGenerationBag, Gi as refuseMalformedDesiredTags, Gn as isRedactedRecordedValue, Gs as findSilentDropProperties, H as relayedIndexBusyDelete, Ha as s3BucketRegionalDomainName, Hi as DBPROXY_TAG_OPTIONS, Hn as getCurrentProducerRegions, Hr as replacedDeleteFailureVerdict, Hs as withheldAccountClause, I as resolveDynamoDbDeleteBudgetMs, Id as resolveAssemblyPath, J as vectorIndexesShapeDetail, Ja as outputReferenceProvenanceOf, Jc as snapshotPassProvenance, Ji as definedAttributes, Jt as getCurrentNestedStackContext, K as vectorIndexesForCreate, Kc as redactForState, Ki as tagMapAsList, Kn as redactedDeleteAddressFields, L as DELETE_INDEX_WAIT_PROCEED_NOTE, M as beginDeleteWait, N as compensateRemovedDeletionProtection, Nd as describeFileReadFailure, Ni as reserveStackCreateToken, O as stripIndexContributorInsights, Oo as passedParameterClassesOf, P as deleteBudgetKey, Pd as displayAssemblyPath, Q as readTtlSpec, R as INDEX_SETTLE_POLL_INTERVAL_MS, Ra as isSettledInstanceState, Rr as awaitInFlightSibling, S as indexDeclaresContributorInsights, Sl as recordAttributeIdCopy, T as readContributorInsightsSpec, Ta as observeThenDisableInstanceApiTermination, Tc as canonicalLambdaFunctionName, Tl as carriesSecretMask, To as parseWebACLArn, U as waitForIndexesSettled, Ua as s3BucketWebsiteUrl, Ui as planTagDiff, V as maskedLogger, Va as s3BucketDualStackDomainName, Vi as DBPROXY_TAGS_WHAT, Vt as getNestedRevertRun, W as planVectorIndexUpdates, Wi as readTagList, Wn as REDACTED_DELETE_ADDRESS_SKIP_REASON, Wt as revertNestedChildFromJournal, X as isTtlRateLimited, Y as isTtlAlreadyDisabled, Yi as stringifyIfAssigned, Yt as withNestedStackContext, Z as planTimeToLive, Zc as hasMaskableValues, _ as streamMemberRefusals, _t as renderNestedTemplateTreeDefect, _u as rewriteTemplateAssetReferences, aa as getCurrentResourceSecrets, ac as toCfnInteger, an as chunks, at as markRefusedBeforeApplying, b as CONTRIBUTOR_INSIGHTS_KEY, ba as isWaitAbandonedError, bc as withRetry, bd as derivePartitionAndUrlSuffix, bl as recoverMaskedOutput, c as DynamoDBGlobalTableProvider, cc as coerceCfnInteger, cn as withApiLimit, d as declaredStreamPolicyMember, da as slowCcOperationTimeoutMs, dc as configStringRefusal, dl as withoutPhysicalNameCopies, et as ECR_AUTO_DELETE_IMAGES_TAG, f as declaredStreamTagsMember, fa as onlySecretReferencesDiffer, fc as readConfigString, fu as stringifyValue, g as streamDeclaresTags, gc as requireConfigString, gd as decodeListingKey, gt as listNestedTemplateRows, h as streamDeclaresPolicy, hc as requireConfigObject, ht as isAbsoluteAssetPath, ic as isWarmThroughputDecrease, it as getPriorAttempts, j as DYNAMODB_DELETE_POLL_COST_MS, ji as earliestDefined, k as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, l as STREAM_POLICY_KEY, lc as configBooleanRefusal, lu as timePhase, m as reverseMapStreamPolicy, mc as requireConfigArray, mo as getAccountInfo, mt as findNestedTemplateTreeDefect, nc as WARM_THROUGHPUT_MEMBERS, nt as hasCdkAutoDeleteTag, oc as toFiniteNumber, on as isAccessDeniedError, p as planStreamMemberOps, pa as unchangedBehindSecretReference, pc as replayWarn, pl as dynamicReferenceTokens, q as vectorIndexesSettled, qc as recordReferenceProvenanceEntry, qi as tagPlanWarning, qn as redactedDeleteAddressSkip, qs as withoutSilentDropProperties, rc as coerceWarmThroughput$1, rt as isTruthyCfnBoolean, sc as coerceCfnBoolean, sn as lookupEachName, t as DeployEngine, ta as waitForLambdaFunctionActive, tt as S3_AUTO_DELETE_OBJECTS_TAG, u as STREAM_TAGS_KEY, uc as configIntegerRefusal, us as refuseMalformedNestedChildOutputs, v as streamPolicyMatchesDeclared, va as deleteSkipReason, vi as secretNamedAttributeNamesOf, w as planIndexContributorInsightsOps, wa as isTerminationProtectionPropagationError, wc as emrClusterInstancesReplaced, wt as enclosingDeadlineRemainingMs, x as contributorInsightsRefusals, xa as markWaitAbandoned, xc as blockDeviceMappingsDifferOnlyInDeleteOnTermination, xl as physicalNameCopiesOf, y as streamTagsMatchDeclared, ya as withIndeterminateGuard, yd as canonicalizeRegion, z as TABLE_INDEX_NOUN, za as s3BucketArn, zc as passedNoEchoParametersOf, zi as isRefusedByName } from "./deploy-engine-BnEvzfon.js";
6
+ import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-3w71Eu4a.js";
7
+ import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, s as resolvedResourceTimeoutMs, t as canonicalizeIpv4Cidr } from "./program-CKm1Nk6t.js";
8
+ import { n as modifyDbInstanceWhenAvailable } from "./db-instance-modify-retry-CspmK57I.js";
9
+ import { RDSProvider } from "./rds-provider-bEeid6uI.js";
10
+ import { NeptuneProvider } from "./neptune-provider-D8tkFP12.js";
11
+ import { ASGProvider } from "./asg-provider-kV8DYFjT.js";
12
12
  import { createHash, randomUUID } from "node:crypto";
13
13
  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";
14
14
  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";
15
15
  import { CreateQueueCommand, DeleteQueueCommand, GetQueueAttributesCommand, GetQueueUrlCommand, ListQueueTagsCommand, QueueDoesNotExist, SQSClient, SetQueueAttributesCommand, TagQueueCommand, UntagQueueCommand } from "@aws-sdk/client-sqs";
16
16
  import { CreateTopicCommand, DeleteTopicCommand, GetSubscriptionAttributesCommand, GetTopicAttributesCommand, InvalidParameterException, ListSubscriptionsByTopicCommand, ListTagsForResourceCommand, ListTopicsCommand, NotFoundException, SNSClient, SetSubscriptionAttributesCommand, SetTopicAttributesCommand, SubscribeCommand, TagResourceCommand, UnsubscribeCommand, UntagResourceCommand } from "@aws-sdk/client-sns";
17
- import { AddPermissionCommand, CreateEventSourceMappingCommand, CreateFunctionCommand, CreateFunctionUrlConfigCommand, DeleteEventSourceMappingCommand, DeleteFunctionCodeSigningConfigCommand, DeleteFunctionCommand, DeleteFunctionConcurrencyCommand, DeleteFunctionEventInvokeConfigCommand, DeleteFunctionUrlConfigCommand, DeleteLayerVersionCommand, GetEventSourceMappingCommand, GetFunctionCodeSigningConfigCommand, GetFunctionCommand, GetFunctionConcurrencyCommand, GetFunctionEventInvokeConfigCommand, GetFunctionRecursionConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionByArnCommand, GetPolicyCommand as GetPolicyCommand$1, GetRuntimeManagementConfigCommand, LambdaClient, ListEventSourceMappingsCommand, ListLayerVersionsCommand, ListTagsCommand, PublishLayerVersionCommand, PutFunctionCodeSigningConfigCommand, PutFunctionConcurrencyCommand, PutFunctionEventInvokeConfigCommand, PutFunctionRecursionConfigCommand, PutRuntimeManagementConfigCommand, RemovePermissionCommand, ResourceNotFoundException, TagResourceCommand as TagResourceCommand$1, UntagResourceCommand as UntagResourceCommand$1, UpdateEventSourceMappingCommand, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, UpdateFunctionUrlConfigCommand, waitUntilFunctionActiveV2, waitUntilFunctionUpdatedV2 } from "@aws-sdk/client-lambda";
17
+ 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";
18
18
  import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
19
19
  import { AllocateAddressCommand, AssociateAddressCommand, AssociateIamInstanceProfileCommand, AssociateNatGatewayAddressCommand, AssociateRouteTableCommand, AttachInternetGatewayCommand, 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, DetachVpnGatewayCommand, DisassociateAddressCommand, DisassociateIamInstanceProfileCommand, DisassociateNatGatewayAddressCommand, DisassociateRouteTableCommand, EC2Client, ModifyInstanceAttributeCommand, ModifyInstanceCreditSpecificationCommand, ModifyInstanceMetadataOptionsCommand, ModifySubnetAttributeCommand, ModifyVpcAttributeCommand, ModifyVpcTenancyCommand, MonitorInstancesCommand, ReleaseAddressCommand, ReplaceIamInstanceProfileAssociationCommand, ReplaceNetworkAclAssociationCommand, ReplaceNetworkAclEntryCommand, ReplaceRouteCommand, RevokeSecurityGroupEgressCommand, RevokeSecurityGroupIngressCommand, RunInstancesCommand, StartInstancesCommand, StopInstancesCommand, TerminateInstancesCommand, UnmonitorInstancesCommand, waitUntilInstanceRunning, waitUntilInstanceTerminated, waitUntilNatGatewayAvailable, waitUntilNatGatewayDeleted } from "@aws-sdk/client-ec2";
20
20
  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";
@@ -44,7 +44,7 @@ import * as zlib from "node:zlib";
44
44
  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";
45
45
  import { CreateStateMachineCommand, DeleteStateMachineCommand, DescribeStateMachineCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$12, SFNClient, StateMachineDoesNotExist, TagResourceCommand as TagResourceCommand$15, UntagResourceCommand as UntagResourceCommand$15, UpdateStateMachineCommand } from "@aws-sdk/client-sfn";
46
46
  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";
47
- 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, DescribeDBClustersCommand as DescribeDBClustersCommand$1, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DescribeDBSubnetGroupsCommand as DescribeDBSubnetGroupsCommand$1, DocDBClient, ListTagsForResourceCommand as ListTagsForResourceCommand$13, ModifyDBClusterCommand as ModifyDBClusterCommand$1, ModifyDBInstanceCommand as ModifyDBInstanceCommand$1, ModifyDBSubnetGroupCommand as ModifyDBSubnetGroupCommand$1, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$3 } from "@aws-sdk/client-docdb";
47
+ 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, 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 } from "@aws-sdk/client-docdb";
48
48
  import { CreateWebACLCommand, DeleteWebACLCommand, GetWebACLCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$14, TagResourceCommand as TagResourceCommand$17, UntagResourceCommand as UntagResourceCommand$17, UpdateWebACLCommand, WAFNonexistentItemException, WAFV2Client } from "@aws-sdk/client-wafv2";
49
49
  import { AddCustomAttributesCommand, CognitoIdentityProviderClient, CreateUserPoolCommand, DeleteUserPoolCommand, DescribeUserPoolCommand, GetUserPoolMfaConfigCommand, ListUserPoolsCommand, ResourceNotFoundException as ResourceNotFoundException$11, SetUserPoolMfaConfigCommand, UntagResourceCommand as UntagResourceCommand$18, UpdateUserPoolCommand } from "@aws-sdk/client-cognito-identity-provider";
50
50
  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$18, UntagResourceCommand as UntagResourceCommand$19, UpdateHttpNamespaceCommand, UpdatePrivateDnsNamespaceCommand, UpdatePublicDnsNamespaceCommand, UpdateServiceAttributesCommand, UpdateServiceCommand as UpdateServiceCommand$1 } from "@aws-sdk/client-servicediscovery";
@@ -59,7 +59,7 @@ import { AssociateFileSystemAliasesCommand, CreateFileSystemCommand as CreateFil
59
59
  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";
60
60
  import { CreateDeliveryStreamCommand, DeleteDeliveryStreamCommand, DescribeDeliveryStreamCommand, FirehoseClient, ListTagsForDeliveryStreamCommand, ResourceNotFoundException as ResourceNotFoundException$14, StartDeliveryStreamEncryptionCommand, StopDeliveryStreamEncryptionCommand, TagDeliveryStreamCommand, UntagDeliveryStreamCommand, UpdateDestinationCommand } from "@aws-sdk/client-firehose";
61
61
  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";
62
- import { BatchGetProjectsCommand, CodeBuildClient, CreateProjectCommand, DeleteProjectCommand, ResourceNotFoundException as ResourceNotFoundException$15, UpdateProjectCommand, UpdateProjectVisibilityCommand } from "@aws-sdk/client-codebuild";
62
+ import { BatchGetProjectsCommand, CodeBuildClient, CreateProjectCommand, CreateWebhookCommand, DeleteProjectCommand, DeleteWebhookCommand, ResourceNotFoundException as ResourceNotFoundException$15, UpdateProjectCommand, UpdateProjectVisibilityCommand, UpdateWebhookCommand } from "@aws-sdk/client-codebuild";
63
63
  import { CodeCommitClient, CreateCommitCommand, CreateRepositoryCommand as CreateRepositoryCommand$1, DeleteRepositoryCommand as DeleteRepositoryCommand$1, GetRepositoryCommand, GetRepositoryTriggersCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$18, PutRepositoryTriggersCommand, RepositoryDoesNotExistException, TagResourceCommand as TagResourceCommand$26, UntagResourceCommand as UntagResourceCommand$27, UpdateRepositoryDescriptionCommand, UpdateRepositoryEncryptionKeyCommand, UpdateRepositoryNameCommand } from "@aws-sdk/client-codecommit";
64
64
  import { CreateLifecyclePolicyCommand, DLMClient, DeleteLifecyclePolicyCommand as DeleteLifecyclePolicyCommand$1, GetLifecyclePoliciesCommand, GetLifecyclePolicyCommand as GetLifecyclePolicyCommand$1, ResourceNotFoundException as ResourceNotFoundException$16, TagResourceCommand as TagResourceCommand$27, UntagResourceCommand as UntagResourceCommand$28, UpdateLifecyclePolicyCommand } from "@aws-sdk/client-dlm";
65
65
  import { CreateVectorBucketCommand, DeleteIndexCommand, DeleteVectorBucketCommand, GetVectorBucketCommand, ListIndexesCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$19, S3VectorsClient, TagResourceCommand as TagResourceCommand$28, UntagResourceCommand as UntagResourceCommand$29 } from "@aws-sdk/client-s3vectors";
@@ -8334,6 +8334,26 @@ function withholdWaiterPayload(error, mask) {
8334
8334
  };
8335
8335
  }
8336
8336
  const LAMBDA_CLEANUP_DELETE_MAX_ATTEMPTS = 3;
8337
+ const LATEST_PUBLISHED = "$LATEST.PUBLISHED";
8338
+ function capacityProviderConfigForUpdate(config) {
8339
+ const managed = config?.LambdaManagedInstancesCapacityProviderConfig;
8340
+ if (managed === void 0) return config;
8341
+ return { LambdaManagedInstancesCapacityProviderConfig: {
8342
+ ...managed,
8343
+ ExecutionEnvironmentMemoryGiBPerVCpu: managed.ExecutionEnvironmentMemoryGiBPerVCpu ?? 2
8344
+ } };
8345
+ }
8346
+ function refuseManagedInstancesPropertiesWithoutCapacityProvider(logicalId, resourceType, properties, context, warn) {
8347
+ if (properties["CapacityProviderConfig"] !== void 0) return;
8348
+ const declared = [properties["PublishToLatestPublished"] !== void 0 ? "PublishToLatestPublished" : void 0, properties["FunctionScalingConfig"] !== void 0 ? "FunctionScalingConfig" : void 0].filter((key) => key !== void 0);
8349
+ if (declared.length === 0) return;
8350
+ const named = declared.join(" and ");
8351
+ if (context.replayingState === true) {
8352
+ warn(`Lambda function ${logicalId} records ${named} without CapacityProviderConfig; ignoring ${declared.length === 1 ? "it" : "them"} for this replay.`);
8353
+ return;
8354
+ }
8355
+ throw markNonRetryable(new ProvisioningError(`Lambda function ${logicalId} declares ${named} without CapacityProviderConfig: AWS applies ${declared.length === 1 ? "it" : "them"} to Lambda Managed Instances functions only. Add a capacity provider, or remove ${named}.`, resourceType, logicalId, context.physicalId));
8356
+ }
8337
8357
  function refuseImageFunctionUnsupported(logicalId, resourceType, properties, physicalId) {
8338
8358
  if (properties["PackageType"] !== "Image") return;
8339
8359
  const declared = [properties["CodeSigningConfigArn"] !== void 0 ? "CodeSigningConfigArn" : void 0, properties["RuntimeManagementConfig"] !== void 0 ? "RuntimeManagementConfig" : void 0].filter((key) => key !== void 0);
@@ -8349,7 +8369,8 @@ const SEPARATELY_APPLIED_KEYS = /* @__PURE__ */ new Set([
8349
8369
  "ReservedConcurrentExecutions",
8350
8370
  "RecursiveLoop",
8351
8371
  "CodeSigningConfigArn",
8352
- "RuntimeManagementConfig"
8372
+ "RuntimeManagementConfig",
8373
+ "FunctionScalingConfig"
8353
8374
  ]);
8354
8375
  var LambdaFunctionProvider = class {
8355
8376
  lambdaClient;
@@ -8384,7 +8405,10 @@ var LambdaFunctionProvider = class {
8384
8405
  "CodeSigningConfigArn",
8385
8406
  "RuntimeManagementConfig",
8386
8407
  "DurableConfig",
8387
- "TenancyConfig"
8408
+ "TenancyConfig",
8409
+ "CapacityProviderConfig",
8410
+ "FunctionScalingConfig",
8411
+ "PublishToLatestPublished"
8388
8412
  ])]]);
8389
8413
  removalDefaults = /* @__PURE__ */ new Map([["AWS::Lambda::Function", /* @__PURE__ */ new Map([
8390
8414
  ["Timeout", 3],
@@ -8415,14 +8439,18 @@ var LambdaFunctionProvider = class {
8415
8439
  "VpcConfig",
8416
8440
  "ReservedConcurrentExecutions",
8417
8441
  "CodeSigningConfigArn",
8418
- "RuntimeManagementConfig"
8442
+ "RuntimeManagementConfig",
8443
+ "CapacityProviderConfig",
8444
+ "FunctionScalingConfig",
8445
+ "PublishToLatestPublished"
8419
8446
  ])]]);
8420
- unhandledByDesign = /* @__PURE__ */ new Map([["AWS::Lambda::Function", /* @__PURE__ */ new Map([["PublishToLatestPublished", "CloudFormation-only version-publishing directive with no AWS SDK equivalent"]])]]);
8421
8447
  cleanupDeleteRetryDelayMs = 2e3;
8422
8448
  eniWaitTimeoutMs = 6e5;
8423
8449
  eniWaitInitialDelayMs = 1e4;
8424
8450
  eniWaitMaxDelayMs = 1e4;
8425
8451
  functionUpdateMaxWaitSeconds = 600;
8452
+ latestPublishedPollMs = 3e3;
8453
+ latestPublishedDeadlineMarginMs = 15e3;
8426
8454
  eniInitialSleepMs = 1e4;
8427
8455
  eniDeleteRetryBudgetMs = 18e5;
8428
8456
  eniDeleteRetryIntervalMs = 15e3;
@@ -8442,12 +8470,14 @@ var LambdaFunctionProvider = class {
8442
8470
  if (!code) throw new ProvisioningError(`Code is required for Lambda function ${logicalId}`, resourceType, logicalId);
8443
8471
  if (!role) throw new ProvisioningError(`Role is required for Lambda function ${logicalId}`, resourceType, logicalId);
8444
8472
  refuseImageFunctionUnsupported(logicalId, resourceType, properties);
8473
+ refuseManagedInstancesPropertiesWithoutCapacityProvider(logicalId, resourceType, properties, { replayingState: context?.replayingState }, log.warn);
8445
8474
  let functionCreated = false;
8446
8475
  let createdFunctionName;
8447
8476
  let createdFunctionIdentity;
8448
8477
  const postCreateCleanup = { deleted: false };
8449
8478
  try {
8450
8479
  const tags = properties["Tags"] ? Object.fromEntries(desiredTags.map((tag) => [tag.Key, tag.Value])) : void 0;
8480
+ const capacityProviderConfig = properties["CapacityProviderConfig"];
8451
8481
  const createParams = {
8452
8482
  FunctionName: functionName,
8453
8483
  Role: role,
@@ -8473,13 +8503,48 @@ var LambdaFunctionProvider = class {
8473
8503
  DurableConfig: properties["DurableConfig"],
8474
8504
  TenancyConfig: properties["TenancyConfig"],
8475
8505
  CodeSigningConfigArn: properties["CodeSigningConfigArn"],
8476
- Tags: tags
8506
+ Tags: tags,
8507
+ ...capacityProviderConfig !== void 0 && {
8508
+ CapacityProviderConfig: capacityProviderConfig,
8509
+ Publish: true,
8510
+ PublishTo: "LATEST_PUBLISHED"
8511
+ }
8477
8512
  };
8478
8513
  const response = await (await this.createClient.get()).send(new CreateFunctionCommand(createParams));
8479
8514
  functionCreated = true;
8480
8515
  createdFunctionName = response.FunctionName || functionName;
8481
8516
  createdFunctionIdentity = functionIdentityToken(response.FunctionArn, response.LastModified);
8482
8517
  reportCreatedResource(logicalId, resourceType, createdFunctionName, createdFunctionIdentity);
8518
+ if (capacityProviderConfig !== void 0) {
8519
+ createdFunctionIdentity = void 0;
8520
+ reportCreatedResource(logicalId, resourceType, createdFunctionName);
8521
+ const target = {
8522
+ logicalId,
8523
+ resourceType,
8524
+ functionName
8525
+ };
8526
+ await this.applyPostCreateConfig(() => this.waitForLatestPublishedSettled(target, log, "after"), {
8527
+ apiName: "GetFunctionConfiguration",
8528
+ propertyName: "CapacityProviderConfig",
8529
+ logicalId,
8530
+ resourceType,
8531
+ functionName,
8532
+ log,
8533
+ cleanup: postCreateCleanup,
8534
+ awaitGone: capacityProviderConfig !== void 0
8535
+ });
8536
+ const functionScalingConfig = properties["FunctionScalingConfig"];
8537
+ if (functionScalingConfig !== void 0) await this.applyPostCreateConfig(() => this.putFunctionScalingConfig(target, log, functionScalingConfig), {
8538
+ apiName: "PutFunctionScalingConfig",
8539
+ propertyName: "FunctionScalingConfig",
8540
+ logicalId,
8541
+ resourceType,
8542
+ functionName,
8543
+ log,
8544
+ cleanup: postCreateCleanup,
8545
+ awaitGone: capacityProviderConfig !== void 0
8546
+ });
8547
+ }
8483
8548
  const recursiveLoop = properties["RecursiveLoop"];
8484
8549
  if (recursiveLoop !== void 0) await this.applyPostCreateConfig(() => this.lambdaClient.send(new PutFunctionRecursionConfigCommand({
8485
8550
  FunctionName: functionName,
@@ -8491,7 +8556,8 @@ var LambdaFunctionProvider = class {
8491
8556
  resourceType,
8492
8557
  functionName,
8493
8558
  log,
8494
- cleanup: postCreateCleanup
8559
+ cleanup: postCreateCleanup,
8560
+ awaitGone: capacityProviderConfig !== void 0
8495
8561
  });
8496
8562
  const reservedConcurrentExecutions = properties["ReservedConcurrentExecutions"];
8497
8563
  if (reservedConcurrentExecutions !== void 0) await this.applyPostCreateConfig(() => this.lambdaClient.send(new PutFunctionConcurrencyCommand({
@@ -8504,11 +8570,12 @@ var LambdaFunctionProvider = class {
8504
8570
  resourceType,
8505
8571
  functionName,
8506
8572
  log,
8507
- cleanup: postCreateCleanup
8573
+ cleanup: postCreateCleanup,
8574
+ awaitGone: capacityProviderConfig !== void 0
8508
8575
  });
8509
8576
  const runtimeManagementConfig = properties["RuntimeManagementConfig"];
8510
8577
  if (runtimeManagementConfig !== void 0) await this.applyPostCreateConfig(async () => {
8511
- await waitUntilFunctionActiveV2({
8578
+ if (capacityProviderConfig === void 0) await waitUntilFunctionActiveV2({
8512
8579
  client: this.lambdaClient,
8513
8580
  maxWaitTime: this.functionUpdateMaxWaitSeconds,
8514
8581
  minDelay: 1,
@@ -8524,7 +8591,8 @@ var LambdaFunctionProvider = class {
8524
8591
  resourceType,
8525
8592
  functionName,
8526
8593
  log,
8527
- cleanup: postCreateCleanup
8594
+ cleanup: postCreateCleanup,
8595
+ awaitGone: capacityProviderConfig !== void 0
8528
8596
  });
8529
8597
  log.debug(`Successfully created Lambda function ${logicalId}: ${log.value(functionName)}`);
8530
8598
  return {
@@ -8579,7 +8647,12 @@ var LambdaFunctionProvider = class {
8579
8647
  if (!/currently in the following state|ResourceConflict/i.test(deleteMessage)) break;
8580
8648
  if (attempt < 2) await new Promise((resolve) => setTimeout(resolve, this.cleanupDeleteRetryDelayMs * (attempt + 1)));
8581
8649
  }
8582
- if (cleanupFailure === void 0) ctx.cleanup.deleted = true;
8650
+ if (cleanupFailure === void 0) {
8651
+ ctx.cleanup.deleted = true;
8652
+ if (ctx.awaitGone) await this.waitForFunctionGone(ctx, log).catch((goneError) => {
8653
+ log.warn(describeAwsFailure(goneError).summary);
8654
+ });
8655
+ }
8583
8656
  if (cleanupFailure !== void 0) {
8584
8657
  const cleanupHead = `Cleanup DeleteFunction failed for ${ctx.logicalId} after ${ctx.apiName} failure — function may be orphaned: `;
8585
8658
  if (cleanupFailure.redacted) this.logger.debug(log.mask(`${cleanupHead}${cleanupFailure.detail}`));
@@ -8597,6 +8670,42 @@ var LambdaFunctionProvider = class {
8597
8670
  RuntimeVersionArn: config["RuntimeVersionArn"]
8598
8671
  }));
8599
8672
  }
8673
+ async waitForLatestPublishedSettled(target, log, phase) {
8674
+ const { logicalId, resourceType, functionName } = target;
8675
+ const budgetMs = Math.min(this.functionUpdateMaxWaitSeconds * 1e3, enclosingDeadlineRemainingMs() - this.latestPublishedDeadlineMarginMs);
8676
+ const deadline = Date.now() + budgetMs;
8677
+ for (;;) {
8678
+ const cfg = await this.lambdaClient.send(new GetFunctionConfigurationCommand({
8679
+ FunctionName: functionName,
8680
+ Qualifier: LATEST_PUBLISHED
8681
+ }));
8682
+ if (phase === "after" && (cfg.State === "Failed" || cfg.LastUpdateStatus === "Failed")) throw this.wrapStatusReasonError(target, log, cfg);
8683
+ if (!(cfg.State === "Pending" || cfg.State === "Deactivating" || cfg.LastUpdateStatus === "InProgress")) return;
8684
+ if (Date.now() >= deadline) throw new ProvisioningError(`Lambda function ${logicalId}: ${LATEST_PUBLISHED} did not settle within ${Math.max(0, Math.round(budgetMs / 1e3))}s (State ${cfg.State}, LastUpdateStatus ${cfg.LastUpdateStatus})`, resourceType, logicalId, functionName);
8685
+ await new Promise((resolve) => setTimeout(resolve, this.latestPublishedPollMs));
8686
+ }
8687
+ }
8688
+ wrapStatusReasonError(target, log, cfg) {
8689
+ const { logicalId, resourceType, functionName } = target;
8690
+ const head = `Lambda function ${logicalId}: ${LATEST_PUBLISHED} failed: `;
8691
+ const text = describeAwsStatusReason({
8692
+ code: cfg.StateReasonCode ?? cfg.LastUpdateStatusReasonCode,
8693
+ message: cfg.StateReason ?? cfg.LastUpdateStatusReason
8694
+ }, "no reason given");
8695
+ const build = (detail, cause) => new ProvisioningError(`${head}${log.mask(detail)}`, resourceType, logicalId, functionName, cause);
8696
+ if (!text.redacted) return build(text.summary);
8697
+ log.debug(log.mask(`${head}${text.detail}`));
8698
+ return markRedactedCause(build(text.summary, new Error(text.detail)));
8699
+ }
8700
+ async putFunctionScalingConfig(target, log, config) {
8701
+ await this.waitForLatestPublishedSettled(target, log, "before");
8702
+ await this.lambdaClient.send(new PutFunctionScalingConfigCommand({
8703
+ FunctionName: target.functionName,
8704
+ Qualifier: LATEST_PUBLISHED,
8705
+ FunctionScalingConfig: config ?? {}
8706
+ }));
8707
+ await this.waitForLatestPublishedSettled(target, log, "after");
8708
+ }
8600
8709
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
8601
8710
  const markUnsettled = (key) => context?.markUnsettled?.(key);
8602
8711
  properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
@@ -8605,7 +8714,17 @@ var LambdaFunctionProvider = class {
8605
8714
  log.debug(`Updating Lambda function ${logicalId}: ${log.value(physicalId)}`);
8606
8715
  refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
8607
8716
  refuseImageFunctionUnsupported(logicalId, resourceType, properties, physicalId);
8608
- try {
8717
+ refuseManagedInstancesPropertiesWithoutCapacityProvider(logicalId, resourceType, properties, {
8718
+ replayingState: context?.replayingState,
8719
+ physicalId
8720
+ }, log.warn);
8721
+ try {
8722
+ const desiredCapacity = properties["CapacityProviderConfig"];
8723
+ const recordedCapacity = previousProperties["CapacityProviderConfig"];
8724
+ const liveManaged = desiredCapacity !== void 0 || recordedCapacity !== void 0 ? (await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: physicalId }))).Configuration?.CapacityProviderConfig !== void 0 : false;
8725
+ if (liveManaged && desiredCapacity === void 0) throw markNonRetryable(new ProvisioningError(`Lambda function ${logicalId} cannot lose its CapacityProviderConfig: AWS does not support removing it from a function. Keep the property, or replace the function under a new logical id.`, resourceType, logicalId, physicalId));
8726
+ const capacityNeverApplied = !liveManaged && desiredCapacity !== void 0 && recordedCapacity !== void 0;
8727
+ if (capacityNeverApplied) log.warn(`Lambda function ${logicalId} is not a Managed Instances function on AWS, so its CapacityProviderConfig and FunctionScalingConfig are not applied. Replace the function to apply them.`);
8609
8728
  const configFields = [
8610
8729
  "Role",
8611
8730
  "Handler",
@@ -8624,10 +8743,14 @@ var LambdaFunctionProvider = class {
8624
8743
  "ImageConfig",
8625
8744
  "SnapStart",
8626
8745
  "LoggingConfig",
8627
- "DurableConfig"
8746
+ "DurableConfig",
8747
+ "CapacityProviderConfig"
8628
8748
  ];
8629
8749
  const changedConfigFields = [];
8630
- for (const field of configFields) if (JSON.stringify(properties[field]) !== JSON.stringify(previousProperties[field])) changedConfigFields.push(field);
8750
+ for (const field of configFields) {
8751
+ if (field === "CapacityProviderConfig" && capacityNeverApplied) continue;
8752
+ if (JSON.stringify(properties[field]) !== JSON.stringify(previousProperties[field])) changedConfigFields.push(field);
8753
+ }
8631
8754
  if (changedConfigFields.length > 0) {
8632
8755
  const configParams = {
8633
8756
  FunctionName: physicalId,
@@ -8648,7 +8771,8 @@ var LambdaFunctionProvider = class {
8648
8771
  ImageConfig: properties["ImageConfig"],
8649
8772
  SnapStart: properties["SnapStart"],
8650
8773
  LoggingConfig: properties["LoggingConfig"],
8651
- DurableConfig: properties["DurableConfig"]
8774
+ DurableConfig: properties["DurableConfig"],
8775
+ CapacityProviderConfig: capacityProviderConfigForUpdate(capacityNeverApplied ? void 0 : desiredCapacity)
8652
8776
  };
8653
8777
  for (const field of changedConfigFields) markUnsettled(field);
8654
8778
  await this.lambdaClient.send(new UpdateFunctionConfigurationCommand(configParams));
@@ -8724,6 +8848,31 @@ var LambdaFunctionProvider = class {
8724
8848
  await this.putRuntimeManagementConfig(physicalId, newRuntimeManagementConfig ?? { UpdateRuntimeOn: "Auto" });
8725
8849
  log.debug(`Updated RuntimeManagementConfig for Lambda function ${log.value(physicalId)} to ${JSON.stringify(maskDeep(newRuntimeManagementConfig ?? { UpdateRuntimeOn: "Auto" }, operationMask))}`);
8726
8850
  }
8851
+ if (liveManaged && desiredCapacity !== void 0) {
8852
+ const target = {
8853
+ logicalId,
8854
+ resourceType,
8855
+ functionName: physicalId
8856
+ };
8857
+ const newScaling = properties["FunctionScalingConfig"];
8858
+ const prevScaling = previousProperties["FunctionScalingConfig"];
8859
+ const applyScaling = newScaling?.MinExecutionEnvironments !== prevScaling?.MinExecutionEnvironments || newScaling?.MaxExecutionEnvironments !== prevScaling?.MaxExecutionEnvironments || context?.unsettledProperties?.has("FunctionScalingConfig") === true;
8860
+ if (properties["PublishToLatestPublished"] !== false) {
8861
+ await this.waitForLatestPublishedSettled(target, log, "before");
8862
+ await this.lambdaClient.send(new PublishVersionCommand({
8863
+ FunctionName: physicalId,
8864
+ Description: properties["Description"],
8865
+ PublishTo: "LATEST_PUBLISHED"
8866
+ }));
8867
+ await this.waitForLatestPublishedSettled(target, log, "after");
8868
+ log.debug(`Published ${LATEST_PUBLISHED} of ${log.value(physicalId)}`);
8869
+ }
8870
+ if (applyScaling) {
8871
+ markUnsettled("FunctionScalingConfig");
8872
+ await this.putFunctionScalingConfig(target, log, newScaling);
8873
+ log.debug(`Updated FunctionScalingConfig of ${log.value(physicalId)}`);
8874
+ }
8875
+ }
8727
8876
  const getResponse = await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: physicalId }));
8728
8877
  const functionArn = getResponse.Configuration?.FunctionArn;
8729
8878
  await this.applyTagDiff(functionArn, physicalId, resourceType, logicalId, previousProperties["Tags"], properties["Tags"], log, {
@@ -8787,6 +8936,32 @@ var LambdaFunctionProvider = class {
8787
8936
  throw stripped ? markDeleteStarted(failure) : failure;
8788
8937
  }
8789
8938
  if (hasVpcConfig) await this.cleanupLambdaEnis(physicalId, Date.now() + enclosingDeadlineRemainingMs() - this.eniDeadlineMarginMs);
8939
+ if (properties?.["CapacityProviderConfig"] !== void 0) await this.waitForFunctionGone({
8940
+ logicalId,
8941
+ resourceType,
8942
+ functionName: physicalId
8943
+ }, createMaskedLogSinks(this.logger, context?.maskSecrets));
8944
+ }
8945
+ async waitForFunctionGone(target, log) {
8946
+ const { logicalId, resourceType, functionName } = target;
8947
+ const deadline = Date.now() + Math.min(this.functionUpdateMaxWaitSeconds * 1e3, enclosingDeadlineRemainingMs() - this.latestPublishedDeadlineMarginMs);
8948
+ for (;;) {
8949
+ try {
8950
+ await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: functionName }));
8951
+ } catch (error) {
8952
+ if (error instanceof ResourceNotFoundException) return;
8953
+ const failure = describeAwsFailure(error);
8954
+ log.debug(log.mask(`Waiting for Lambda function ${logicalId} to go: ${failure.detail}`));
8955
+ log.warn(`Waiting for Lambda function ${logicalId} to go failed: ${failure.summary}`);
8956
+ return;
8957
+ }
8958
+ if (Date.now() >= deadline) {
8959
+ const stillDeleting = new ProvisioningError(`Lambda function ${logicalId} is still being deleted`, resourceType, logicalId, functionName);
8960
+ markDeleteStarted(stillDeleting);
8961
+ throw stillDeleting;
8962
+ }
8963
+ await new Promise((resolve) => setTimeout(resolve, this.latestPublishedPollMs));
8964
+ }
8790
8965
  }
8791
8966
  buildVpcConfig(raw) {
8792
8967
  if (raw === void 0 || raw === null) return;
@@ -9092,6 +9267,13 @@ var LambdaFunctionProvider = class {
9092
9267
  });
9093
9268
  }
9094
9269
  if (names.has("CodeSigningConfigArn")) set("CodeSigningConfigArn", (await strict(() => this.lambdaClient.send(new GetFunctionCodeSigningConfigCommand({ FunctionName: physicalId }))))?.CodeSigningConfigArn);
9270
+ if (names.has("FunctionScalingConfig")) {
9271
+ const r = await strict(() => this.lambdaClient.send(new GetFunctionScalingConfigCommand({
9272
+ FunctionName: physicalId,
9273
+ Qualifier: LATEST_PUBLISHED
9274
+ })));
9275
+ set("FunctionScalingConfig", r?.RequestedFunctionScalingConfig ?? r?.AppliedFunctionScalingConfig);
9276
+ }
9095
9277
  return out;
9096
9278
  }
9097
9279
  async unsettledInTransition(physicalId, _logicalId, _resourceType, names) {
@@ -9157,6 +9339,19 @@ var LambdaFunctionProvider = class {
9157
9339
  if (Object.keys(dc).length > 0) result["DurableConfig"] = dc;
9158
9340
  }
9159
9341
  if (cfg.TenancyConfig?.TenantIsolationMode !== void 0) result["TenancyConfig"] = { TenantIsolationMode: cfg.TenancyConfig.TenantIsolationMode };
9342
+ if (cfg.CapacityProviderConfig !== void 0) {
9343
+ result["CapacityProviderConfig"] = cfg.CapacityProviderConfig;
9344
+ try {
9345
+ const scaling = await this.lambdaClient.send(new GetFunctionScalingConfigCommand({
9346
+ FunctionName: physicalId,
9347
+ Qualifier: LATEST_PUBLISHED
9348
+ }));
9349
+ const live = scaling.RequestedFunctionScalingConfig ?? scaling.AppliedFunctionScalingConfig;
9350
+ if (live !== void 0) result["FunctionScalingConfig"] = live;
9351
+ } catch (scalingErr) {
9352
+ 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}`);
9353
+ }
9354
+ }
9160
9355
  result["Tags"] = normalizeAwsTagsToCfn(resp.Tags);
9161
9356
  try {
9162
9357
  const rlResp = await this.lambdaClient.send(new GetFunctionRecursionConfigCommand({ FunctionName: physicalId }));
@@ -9201,7 +9396,8 @@ var LambdaFunctionProvider = class {
9201
9396
  "Code.S3ObjectVersion",
9202
9397
  "Code.S3ObjectStorageMode",
9203
9398
  "Code.ZipFile",
9204
- "Code.SourceKMSKeyArn"
9399
+ "Code.SourceKMSKeyArn",
9400
+ "PublishToLatestPublished"
9205
9401
  ];
9206
9402
  }
9207
9403
  async import(input) {
@@ -11096,15 +11292,15 @@ function buildCommonImageInput(properties) {
11096
11292
  return input;
11097
11293
  }
11098
11294
  function mapCodeArtifact(value) {
11099
- if (!isRecord$2(value)) return void 0;
11295
+ if (!isRecord$3(value)) return void 0;
11100
11296
  const uri = value["Uri"];
11101
11297
  return typeof uri === "string" ? { uri } : void 0;
11102
11298
  }
11103
11299
  function mapLogging(value) {
11104
- if (!isRecord$2(value)) return void 0;
11300
+ if (!isRecord$3(value)) return void 0;
11105
11301
  if (value["Disabled"] === true) return { disabled: {} };
11106
11302
  const cloudWatch = value["CloudWatch"];
11107
- if (isRecord$2(cloudWatch)) {
11303
+ if (isRecord$3(cloudWatch)) {
11108
11304
  const cw = {};
11109
11305
  if (typeof cloudWatch["LogGroup"] === "string") cw.logGroup = cloudWatch["LogGroup"];
11110
11306
  if (typeof cloudWatch["LogStream"] === "string") cw.logStream = cloudWatch["LogStream"];
@@ -11113,32 +11309,32 @@ function mapLogging(value) {
11113
11309
  }
11114
11310
  function mapCpuConfigurations(value) {
11115
11311
  if (!Array.isArray(value)) return void 0;
11116
- return value.filter(isRecord$2).map((c) => ({ architecture: c["Architecture"] }));
11312
+ return value.filter(isRecord$3).map((c) => ({ architecture: c["Architecture"] }));
11117
11313
  }
11118
11314
  function mapResources(value) {
11119
11315
  if (!Array.isArray(value)) return void 0;
11120
- return value.filter(isRecord$2).map((r) => Number(r["MinimumMemoryInMiB"])).filter((n) => Number.isFinite(n)).map((minimumMemoryInMiB) => ({ minimumMemoryInMiB }));
11316
+ return value.filter(isRecord$3).map((r) => Number(r["MinimumMemoryInMiB"])).filter((n) => Number.isFinite(n)).map((minimumMemoryInMiB) => ({ minimumMemoryInMiB }));
11121
11317
  }
11122
11318
  function mapHooks(value) {
11123
- if (!isRecord$2(value)) return void 0;
11319
+ if (!isRecord$3(value)) return void 0;
11124
11320
  return lowerFirstKeysDeep(value);
11125
11321
  }
11126
11322
  function mapKeyValueListToRecord(value) {
11127
11323
  if (!Array.isArray(value)) return void 0;
11128
11324
  const out = {};
11129
- for (const entry of value) if (isRecord$2(entry) && typeof entry["Key"] === "string") out[entry["Key"]] = typeof entry["Value"] === "string" ? entry["Value"] : "";
11325
+ for (const entry of value) if (isRecord$3(entry) && typeof entry["Key"] === "string") out[entry["Key"]] = typeof entry["Value"] === "string" ? entry["Value"] : "";
11130
11326
  return Object.keys(out).length > 0 ? out : void 0;
11131
11327
  }
11132
11328
  function lowerFirstKeysDeep(value) {
11133
11329
  if (Array.isArray(value)) return value.map(lowerFirstKeysDeep);
11134
- if (isRecord$2(value)) {
11330
+ if (isRecord$3(value)) {
11135
11331
  const out = {};
11136
11332
  for (const [k, v] of Object.entries(value)) out[k.charAt(0).toLowerCase() + k.slice(1)] = lowerFirstKeysDeep(v);
11137
11333
  return out;
11138
11334
  }
11139
11335
  return value;
11140
11336
  }
11141
- function isRecord$2(value) {
11337
+ function isRecord$3(value) {
11142
11338
  return typeof value === "object" && value !== null && !Array.isArray(value);
11143
11339
  }
11144
11340
 
@@ -31330,6 +31526,45 @@ const PORT_CHANGE_MEMBER_STATUSES = /* @__PURE__ */ new Set(["modifying", "reboo
31330
31526
  function numberOrUndefined(value) {
31331
31527
  return value == null ? void 0 : Number(value);
31332
31528
  }
31529
+ function docdbGlobalClusterId(value) {
31530
+ return typeof value === "string" && value.trim() !== "" ? value : void 0;
31531
+ }
31532
+ function withRecordedGlobalCluster(bag, previousProperties) {
31533
+ const { GlobalClusterIdentifier: _dropped, ...rest } = bag;
31534
+ const previous = previousProperties["GlobalClusterIdentifier"];
31535
+ return previous === void 0 ? rest : {
31536
+ ...rest,
31537
+ GlobalClusterIdentifier: previous
31538
+ };
31539
+ }
31540
+ function readableGlobalClusterId(value) {
31541
+ return value == null || typeof value === "string";
31542
+ }
31543
+ const DETACH_MAX_WAIT_MS = 18e5;
31544
+ const GLOBAL_CLUSTER_BUSY_MAX_WAIT_MS = 6e5;
31545
+ const TRANSIENT_DETACH_FAULTS = /* @__PURE__ */ new Set([
31546
+ "InvalidDBClusterStateFault",
31547
+ "InvalidGlobalClusterStateFault",
31548
+ "ThrottlingException",
31549
+ "Throttling",
31550
+ "RequestLimitExceeded"
31551
+ ]);
31552
+ function awsErrorName(error) {
31553
+ return error?.name ?? "";
31554
+ }
31555
+ var GlobalClusterDetachError = class extends Error {
31556
+ constructor(message) {
31557
+ super(message);
31558
+ this.name = "GlobalClusterDetachError";
31559
+ }
31560
+ };
31561
+ function docdbEngineVersionToSend(properties, previousProperties, context) {
31562
+ if (context?.replayingState === true) return void 0;
31563
+ const desired = properties["EngineVersion"];
31564
+ if (desired == null) return void 0;
31565
+ const previous = previousProperties["EngineVersion"];
31566
+ return previous != null && String(previous) === String(desired) ? void 0 : desired;
31567
+ }
31333
31568
  function clusterPortToSend(properties, previousProperties) {
31334
31569
  if (properties["Port"] != null) return Number(properties["Port"]);
31335
31570
  if (previousProperties["Port"] == null) return void 0;
@@ -31377,6 +31612,7 @@ var DocDBProvider = class {
31377
31612
  "Tags",
31378
31613
  "MasterUserPassword",
31379
31614
  "RotateMasterUserPassword",
31615
+ "GlobalClusterIdentifier",
31380
31616
  ...DOCDB_CLUSTER_KEPT_ON_REMOVAL,
31381
31617
  ...DOCDB_CLUSTER_UNMEASURED_ON_REMOVAL
31382
31618
  ])], ["AWS::DocDB::DBInstance", /* @__PURE__ */ new Set([
@@ -31408,6 +31644,7 @@ var DocDBProvider = class {
31408
31644
  "AvailabilityZones",
31409
31645
  "CopyTagsToSnapshot",
31410
31646
  "EnableCloudwatchLogsExports",
31647
+ "GlobalClusterIdentifier",
31411
31648
  "ManageMasterUserPassword",
31412
31649
  "MasterUserSecretKmsKeyId",
31413
31650
  "NetworkType",
@@ -31458,9 +31695,9 @@ var DocDBProvider = class {
31458
31695
  default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
31459
31696
  }
31460
31697
  }
31461
- async delete(logicalId, physicalId, resourceType, _properties, context) {
31698
+ async delete(logicalId, physicalId, resourceType, properties, context) {
31462
31699
  switch (resourceType) {
31463
- case "AWS::DocDB::DBCluster": return this.deleteDBCluster(logicalId, physicalId, resourceType, context);
31700
+ case "AWS::DocDB::DBCluster": return this.deleteDBCluster(logicalId, physicalId, resourceType, properties, context);
31464
31701
  case "AWS::DocDB::DBInstance": return this.deleteDBInstance(logicalId, physicalId, resourceType, context);
31465
31702
  default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
31466
31703
  }
@@ -31479,6 +31716,11 @@ var DocDBProvider = class {
31479
31716
  const { logTypes, scaling } = this.readClusterBlocks(properties, resourceType, logicalId, origin, true);
31480
31717
  const managedPassword = this.readBooleanProperty("ManageMasterUserPassword", properties, resourceType, logicalId, origin);
31481
31718
  const password = this.passwordBesideManaged(managedPassword, false, properties["MasterUserPassword"], resourceType, logicalId, origin);
31719
+ if (!readableGlobalClusterId(properties["GlobalClusterIdentifier"])) {
31720
+ if (!replayingState) this.refuseBlock(logicalId, resourceType, void 0, "GlobalClusterIdentifier is not a string");
31721
+ this.logger.warn(safeMsg`${logicalId} (${resourceType}): the recorded GlobalClusterIdentifier is unusable, so it is not sent.`);
31722
+ }
31723
+ const globalClusterId = docdbGlobalClusterId(properties["GlobalClusterIdentifier"]);
31482
31724
  const dbClusterIdentifier = properties["DBClusterIdentifier"] || generatedNameFor("AWS::DocDB::DBCluster", logicalId);
31483
31725
  let clusterCreated = false;
31484
31726
  let createdResourceId;
@@ -31505,6 +31747,7 @@ var DocDBProvider = class {
31505
31747
  MasterUserSecretKmsKeyId: properties["MasterUserSecretKmsKeyId"],
31506
31748
  NetworkType: properties["NetworkType"],
31507
31749
  StorageType: properties["StorageType"],
31750
+ ...globalClusterId !== void 0 && { GlobalClusterIdentifier: globalClusterId },
31508
31751
  ...logTypes !== void 0 && logTypes.length > 0 && { EnableCloudwatchLogsExports: logTypes },
31509
31752
  ...scaling != null && { ServerlessV2ScalingConfiguration: scaling },
31510
31753
  ...tags.length > 0 && { Tags: tags }
@@ -31533,7 +31776,9 @@ var DocDBProvider = class {
31533
31776
  physicalId
31534
31777
  };
31535
31778
  const { logTypes, scaling } = this.readClusterBlocks(properties, resourceType, logicalId, origin, false);
31779
+ const globalClusterPlan = await this.planGlobalClusterUpdate(physicalId, properties, previousProperties, resourceType, logicalId, origin, context?.desiredFromAwsReadback === true);
31536
31780
  const logExportConfig = logTypes === void 0 ? void 0 : docdbLogExportChange(logTypes, docdbStringList(previousProperties["EnableCloudwatchLogsExports"]) ?? []);
31781
+ let detachedFrom;
31537
31782
  try {
31538
31783
  const credentials = await this.planMasterCredentials(physicalId, properties, previousProperties, resourceType, logicalId, context, origin);
31539
31784
  const vpcSgIds = properties["VpcSecurityGroupIds"];
@@ -31547,10 +31792,16 @@ var DocDBProvider = class {
31547
31792
  const storageChange = declaredChange(storageType, previousProperties["StorageType"], live?.StorageType ?? DOCDB_DEFAULT_STORAGE_TYPE);
31548
31793
  const previousScaling = docdbServerlessScaling(previousProperties["ServerlessV2ScalingConfiguration"]);
31549
31794
  const scalingChange = scaling != null && (scaling.MinCapacity !== previousScaling?.MinCapacity || scaling.MaxCapacity !== previousScaling?.MaxCapacity);
31795
+ if (globalClusterPlan.kind === "detach") {
31796
+ if (await this.detachFromGlobalCluster(logicalId, physicalId, globalClusterPlan.globalClusterId, {
31797
+ beforeDelete: false,
31798
+ removeProtection: false
31799
+ }, { stripped: false }, maskerOrIdentity(context?.maskSecrets))) detachedFrom = globalClusterPlan.globalClusterId;
31800
+ }
31550
31801
  this.markChangedUnsettled(CLUSTER_MODIFY_UNSETTLED_KEYS, properties, previousProperties, context);
31551
31802
  await this.getClient().send(new ModifyDBClusterCommand$1({
31552
31803
  DBClusterIdentifier: physicalId,
31553
- EngineVersion: properties["EngineVersion"],
31804
+ EngineVersion: docdbEngineVersionToSend(properties, previousProperties, context),
31554
31805
  DeletionProtection: properties["DeletionProtection"],
31555
31806
  BackupRetentionPeriod: properties["BackupRetentionPeriod"] != null ? Number(properties["BackupRetentionPeriod"]) : void 0,
31556
31807
  PreferredBackupWindow: properties["PreferredBackupWindow"],
@@ -31611,19 +31862,21 @@ var DocDBProvider = class {
31611
31862
  ...described,
31612
31863
  Port: portToSend
31613
31864
  } : described),
31614
- ...credentials.effectiveProperties !== void 0 && { effectiveProperties: credentials.effectiveProperties }
31865
+ ...(credentials.effectiveProperties !== void 0 || globalClusterPlan.kind === "keep") && { effectiveProperties: globalClusterPlan.kind === "keep" ? withRecordedGlobalCluster(credentials.effectiveProperties ?? properties, previousProperties) : credentials.effectiveProperties }
31615
31866
  };
31616
31867
  } catch (error) {
31617
31868
  if (error instanceof ProvisioningError) throw error;
31869
+ if (error instanceof GlobalClusterDetachError) throw markNonRetryable(new ProvisioningError(`Failed to update DocDB DBCluster ${logicalId}: ${error.message}`, resourceType, logicalId, physicalId, error));
31618
31870
  const cause = error instanceof Error ? error : void 0;
31619
- throw this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to update DocDB DBCluster ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
31871
+ const detachedNote = detachedFrom !== void 0 ? " (it was already detached from its global cluster, and stays a standalone cluster)" : "";
31872
+ throw this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to update DocDB DBCluster ${logicalId}: ${text}${detachedNote}`, resourceType, logicalId, physicalId, cause));
31620
31873
  }
31621
31874
  }
31622
- async deleteDBCluster(logicalId, physicalId, resourceType, context) {
31875
+ async deleteDBCluster(logicalId, physicalId, resourceType, properties, context) {
31623
31876
  await deleteWithProtectionCompensation({
31624
31877
  registry: this.protectionFlips,
31625
31878
  key: protectionFlipKey(resourceType, physicalId, context?.expectedRegion),
31626
- run: (flip) => this.deleteDBClusterOnce(logicalId, physicalId, resourceType, context, flip),
31879
+ run: (flip) => this.deleteDBClusterOnce(logicalId, physicalId, resourceType, properties, context, flip),
31627
31880
  compensation: {
31628
31881
  logicalId,
31629
31882
  physicalId,
@@ -31647,8 +31900,10 @@ var DocDBProvider = class {
31647
31900
  }
31648
31901
  });
31649
31902
  }
31650
- async deleteDBClusterOnce(logicalId, physicalId, resourceType, context, flip) {
31903
+ async deleteDBClusterOnce(logicalId, physicalId, resourceType, properties, context, flip) {
31651
31904
  this.logger.debug(`Deleting DocDB DBCluster ${logicalId}`);
31905
+ let detachedFrom;
31906
+ const progress = { stripped: false };
31652
31907
  try {
31653
31908
  if (context?.removeProtection === true) try {
31654
31909
  await observeThenDisableProtection({
@@ -31670,6 +31925,11 @@ var DocDBProvider = class {
31670
31925
  } catch (disableError) {
31671
31926
  if (!isDocDBNotFoundError(disableError, "DBClusterNotFoundFault")) this.logger.debug(maskerOrIdentity(context?.maskSecrets)(`Could not disable deletion protection for DocDB DBCluster ${logicalId}: ${describeAwsFailure(disableError).detail}`));
31672
31927
  }
31928
+ const globalClusterId = docdbGlobalClusterId(properties?.["GlobalClusterIdentifier"]);
31929
+ if (globalClusterId !== void 0) detachedFrom = await this.detachFromGlobalCluster(logicalId, physicalId, globalClusterId, {
31930
+ beforeDelete: true,
31931
+ removeProtection: context?.removeProtection === true
31932
+ }, progress, maskerOrIdentity(context?.maskSecrets)) ? globalClusterId : void 0;
31673
31933
  const finalSnapshotId = context?.finalSnapshotIdentifier;
31674
31934
  const sendDelete = () => this.getClient().send(new DeleteDBClusterCommand$1({
31675
31935
  DBClusterIdentifier: physicalId,
@@ -31685,6 +31945,10 @@ var DocDBProvider = class {
31685
31945
  this.logger.debug(`Successfully initiated deletion of DocDB DBCluster ${logicalId}`);
31686
31946
  await this.waitForClusterDeleted(logicalId, physicalId);
31687
31947
  } catch (error) {
31948
+ if (error instanceof GlobalClusterDetachError) {
31949
+ const detachFailure = markNotGone(markNonRetryable(new ProvisioningError(`Failed to delete DocDB DBCluster ${logicalId}: ${error.message}`, resourceType, logicalId, physicalId, error)));
31950
+ throw progress.stripped ? markDeleteStarted(detachFailure) : detachFailure;
31951
+ }
31688
31952
  if (isDocDBNotFoundError(error, "DBClusterNotFoundFault")) {
31689
31953
  const clientRegion = await this.getClient().config.region();
31690
31954
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
@@ -31693,7 +31957,95 @@ var DocDBProvider = class {
31693
31957
  return;
31694
31958
  }
31695
31959
  const cause = error instanceof Error ? error : void 0;
31696
- throw this.wrapDeleteError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete DocDB DBCluster ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
31960
+ const detachedNote = detachedFrom !== void 0 ? " (it was already detached from its global cluster, and stays a standalone cluster)" : "";
31961
+ const failure = this.wrapDeleteError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete DocDB DBCluster ${logicalId}: ${text}${detachedNote}`, resourceType, logicalId, physicalId, cause));
31962
+ throw progress.stripped ? markDeleteStarted(failure) : failure;
31963
+ }
31964
+ }
31965
+ wrapGlobalClusterDetachError(error, mask, build) {
31966
+ const failure = describeAwsFailure(error);
31967
+ if (failure.redacted) this.logger.debug(mask(build(mask(failure.detail))));
31968
+ return new GlobalClusterDetachError(build(mask(failure.summary)));
31969
+ }
31970
+ async detachFromGlobalCluster(logicalId, physicalId, globalClusterId, { beforeDelete, removeProtection }, progress, mask) {
31971
+ let cluster = await this.describeDBCluster(physicalId);
31972
+ for (let i = 0; removeProtection && cluster?.DeletionProtection === true && i < 6; i++) {
31973
+ await this.sleep(5e3);
31974
+ cluster = await this.describeDBCluster(physicalId);
31975
+ }
31976
+ if (cluster === void 0) return false;
31977
+ if (beforeDelete && cluster.DeletionProtection === true) throw new GlobalClusterDetachError(safeMsg`${physicalId} has deletion protection on, so cdkd did not detach it from global cluster ${globalClusterId}; turn it off (cdkd destroy --remove-protection does) and re-run`);
31978
+ const clusterArn = cluster.DBClusterArn;
31979
+ if (typeof clusterArn !== "string" || clusterArn === "") throw new GlobalClusterDetachError(safeMsg`could not read the ARN of ${physicalId} to detach it from global cluster ${globalClusterId}`);
31980
+ const startTime = Date.now();
31981
+ let delay = 5e3;
31982
+ const backOff = async () => {
31983
+ if (Date.now() - startTime >= DETACH_MAX_WAIT_MS) throw new GlobalClusterDetachError(safeMsg`timed out waiting for ${physicalId} to leave global cluster ${globalClusterId}`);
31984
+ await this.sleep(delay);
31985
+ delay = Math.min(delay * 2, 1e4);
31986
+ };
31987
+ const readMembers = async (build) => {
31988
+ try {
31989
+ return (await this.getClient().send(new DescribeGlobalClustersCommand$1({ GlobalClusterIdentifier: globalClusterId }))).GlobalClusters?.[0]?.GlobalClusterMembers ?? [];
31990
+ } catch (error) {
31991
+ const name = awsErrorName(error);
31992
+ if (name === "GlobalClusterNotFoundFault") return [];
31993
+ if (TRANSIENT_DETACH_FAULTS.has(name)) return void 0;
31994
+ throw this.wrapGlobalClusterDetachError(error, mask, build);
31995
+ }
31996
+ };
31997
+ const isMember = async (build) => {
31998
+ return (await readMembers(build))?.some((member) => member.DBClusterArn === clusterArn);
31999
+ };
32000
+ for (;;) {
32001
+ const members = await readMembers((text) => safeMsg`could not read whether ${physicalId} is a member of global cluster ${globalClusterId} (${text})`);
32002
+ if (members !== void 0) {
32003
+ const own = members.find((member) => member.DBClusterArn === clusterArn);
32004
+ if (own === void 0) return false;
32005
+ const others = members.filter((member) => member.DBClusterArn !== clusterArn).map((member) => /^arn:[^:]*:rds:[^:]*:[^:]*:cluster:(.+)$/.exec(member.DBClusterArn ?? "")?.[1] ?? "(unnamed)");
32006
+ if (own.IsWriter === true && others.length > 0) throw new GlobalClusterDetachError(safeMsg`${physicalId} is the primary of global cluster ${globalClusterId}, which still has other members (${others.join(", ")}); detach or delete them first, then re-run`);
32007
+ break;
32008
+ }
32009
+ await backOff();
32010
+ }
32011
+ let globalBusySince;
32012
+ for (;;) try {
32013
+ await this.getClient().send(new RemoveFromGlobalClusterCommand$1({
32014
+ GlobalClusterIdentifier: globalClusterId,
32015
+ DbClusterIdentifier: clusterArn
32016
+ }));
32017
+ progress.stripped = true;
32018
+ this.logger.info(beforeDelete ? safeMsg`Detaching DocDB DBCluster ${logicalId} from global cluster ${globalClusterId} before the delete` : safeMsg`Detaching DocDB DBCluster ${logicalId} from global cluster ${globalClusterId}: GlobalClusterIdentifier was removed`);
32019
+ break;
32020
+ } catch (error) {
32021
+ const name = awsErrorName(error);
32022
+ if (name === "GlobalClusterNotFoundFault") return false;
32023
+ if (name === "DBClusterNotFoundFault") {
32024
+ progress.stripped = true;
32025
+ break;
32026
+ }
32027
+ if (name === "InvalidGlobalClusterStateFault") {
32028
+ globalBusySince ??= Date.now();
32029
+ if (Date.now() - globalBusySince >= GLOBAL_CLUSTER_BUSY_MAX_WAIT_MS) throw this.wrapGlobalClusterDetachError(error, mask, (text) => safeMsg`detaching ${physicalId} from global cluster ${globalClusterId} failed (${text})`);
32030
+ }
32031
+ if (!TRANSIENT_DETACH_FAULTS.has(name)) throw this.wrapGlobalClusterDetachError(error, mask, (text) => safeMsg`detaching ${physicalId} from global cluster ${globalClusterId} failed (${text})`);
32032
+ await backOff();
32033
+ }
32034
+ for (;;) {
32035
+ if (await isMember((text) => safeMsg`could not confirm ${physicalId} left global cluster ${globalClusterId} (${text})`) === false) {
32036
+ let after;
32037
+ try {
32038
+ after = await this.describeDBCluster(physicalId);
32039
+ } catch (error) {
32040
+ if (!TRANSIENT_DETACH_FAULTS.has(awsErrorName(error))) throw error;
32041
+ await backOff();
32042
+ continue;
32043
+ }
32044
+ if (after === void 0) return true;
32045
+ this.logger.debug(safeMsg`DocDB DBCluster ${physicalId} status after the detach: ${after.Status}`);
32046
+ if (after.Status === "available") return true;
32047
+ }
32048
+ await backOff();
31697
32049
  }
31698
32050
  }
31699
32051
  async createDBInstance(logicalId, resourceType, properties, mask, replayingState) {
@@ -31809,6 +32161,53 @@ var DocDBProvider = class {
31809
32161
  refuseBlock(logicalId, resourceType, physicalId, text) {
31810
32162
  throw markNonRetryable(new ProvisioningError(safeMsg`${resourceType === "AWS::DocDB::DBInstance" ? "DocDB DBInstance" : "DocDB DBCluster"} ${logicalId}: ${text}; nothing was changed.`, resourceType, logicalId, physicalId));
31811
32163
  }
32164
+ async planGlobalClusterUpdate(physicalId, properties, previousProperties, resourceType, logicalId, origin, fromReadback) {
32165
+ const desired = properties["GlobalClusterIdentifier"];
32166
+ if (fromReadback && desired === void 0) return previousProperties["GlobalClusterIdentifier"] !== void 0 ? { kind: "keep" } : { kind: "none" };
32167
+ const readable = readableGlobalClusterId(desired);
32168
+ const desiredId = docdbGlobalClusterId(desired);
32169
+ const previousId = docdbGlobalClusterId(previousProperties["GlobalClusterIdentifier"]);
32170
+ if (readable && desiredId === previousId) return { kind: "none" };
32171
+ if (readable && desiredId === void 0 && previousId !== void 0) {
32172
+ if (origin.stateBorne) {
32173
+ const member = await this.liveGlobalClusterMatches(physicalId, previousId);
32174
+ if (member === void 0) this.logger.warn(safeMsg`${logicalId} (${resourceType}): the cluster's membership of global cluster ${previousId} could not be read, so the record treats it as absent; if it is still a member, a later destroy may need aws docdb remove-from-global-cluster first.`);
32175
+ if (member !== true) return { kind: "none" };
32176
+ this.logger.warn(safeMsg`${logicalId} (${resourceType}): the restored state has no GlobalClusterIdentifier, but cdkd did not add the cluster to global cluster ${previousId} (it was already a member), so it leaves it there.`);
32177
+ return { kind: "keep" };
32178
+ }
32179
+ return {
32180
+ kind: "detach",
32181
+ globalClusterId: previousId
32182
+ };
32183
+ }
32184
+ if (readable && await this.liveGlobalClusterMatches(physicalId, desiredId) === true) return { kind: "none" };
32185
+ const text = readable ? "Changing GlobalClusterIdentifier to a different global cluster is not supported unless the cluster is already part of the target global cluster (CloudFormation refuses it too). To join a different global cluster, replace the cluster, for example with a new DBClusterIdentifier" : "GlobalClusterIdentifier is not a string";
32186
+ if (!origin.stateBorne) this.refuseBlock(logicalId, resourceType, physicalId, text);
32187
+ this.logger.warn(safeMsg`${logicalId} (${resourceType}): ${text}; the cluster keeps its current global cluster membership.`);
32188
+ return { kind: "keep" };
32189
+ }
32190
+ async liveGlobalClusterMatches(physicalId, desiredId) {
32191
+ try {
32192
+ const arn = (await this.describeDBCluster(physicalId))?.DBClusterArn;
32193
+ if (typeof arn !== "string" || arn === "") return void 0;
32194
+ let liveId;
32195
+ let marker;
32196
+ do {
32197
+ const page = await this.getClient().send(new DescribeGlobalClustersCommand$1({ ...marker !== void 0 && { Marker: marker } }));
32198
+ const holder = (page.GlobalClusters ?? []).find((global) => (global.GlobalClusterMembers ?? []).some((member) => member.DBClusterArn === arn));
32199
+ if (holder !== void 0) {
32200
+ liveId = holder.GlobalClusterIdentifier;
32201
+ break;
32202
+ }
32203
+ marker = page.Marker;
32204
+ } while (marker);
32205
+ return liveId === desiredId;
32206
+ } catch (error) {
32207
+ this.logger.debug(safeMsg`Could not read a DocDB cluster's global cluster membership: ${describeAwsFailure(error).summary}`);
32208
+ return;
32209
+ }
32210
+ }
31812
32211
  readClusterBlocks(properties, resourceType, logicalId, origin, creating) {
31813
32212
  const leaveOut = (key) => {
31814
32213
  this.logger.warn(safeMsg`${logicalId} (${resourceType}): the recorded ${key} is unusable, so it is not sent.`);
@@ -32094,6 +32493,7 @@ var DocDBProvider = class {
32094
32493
  getDriftUnknownPaths(resourceType) {
32095
32494
  if (resourceType === "AWS::DocDB::DBCluster") return [
32096
32495
  "AvailabilityZones",
32496
+ "GlobalClusterIdentifier",
32097
32497
  "MasterUserSecretKmsKeyId",
32098
32498
  "RotateMasterUserPassword"
32099
32499
  ];
@@ -35161,6 +35561,7 @@ var CognitoUserPoolProvider = class {
35161
35561
  const CACHE_DELETE_WAIT_MS = Math.max(6e5, slowCcOperationTimeoutMs("AWS::ElastiCache::CacheCluster", "DELETE"));
35162
35562
  const NODE_TYPE_MODIFY_WAIT_MS = Math.max(36e5, slowCcOperationTimeoutMs("AWS::ElastiCache::CacheCluster", "UPDATE"));
35163
35563
  const MODIFY_DROPPED_AFTER_MS = 12e4;
35564
+ const TERMINAL_CLUSTER_STATUSES = /* @__PURE__ */ new Set(["restore-failed", "incompatible-network"]);
35164
35565
  function availabilityZonesNotCovered(a, b) {
35165
35566
  const remaining = [...b];
35166
35567
  const out = [];
@@ -35265,6 +35666,7 @@ var ElastiCacheProvider = class {
35265
35666
  "Tags",
35266
35667
  "NotificationTopicArn",
35267
35668
  "SnapshotName",
35669
+ "SnapshotArns",
35268
35670
  "LogDeliveryConfigurations",
35269
35671
  "NetworkType",
35270
35672
  "IpDiscovery",
@@ -35416,6 +35818,7 @@ var ElastiCacheProvider = class {
35416
35818
  AutoMinorVersionUpgrade: properties["AutoMinorVersionUpgrade"],
35417
35819
  NotificationTopicArn: properties["NotificationTopicArn"],
35418
35820
  SnapshotName: properties["SnapshotName"],
35821
+ SnapshotArns: properties["SnapshotArns"],
35419
35822
  LogDeliveryConfigurations: properties["LogDeliveryConfigurations"],
35420
35823
  NetworkType: properties["NetworkType"],
35421
35824
  IpDiscovery: properties["IpDiscovery"],
@@ -35665,6 +36068,7 @@ var ElastiCacheProvider = class {
35665
36068
  const cluster = await this.describeCacheCluster(cacheClusterId);
35666
36069
  const status = cluster?.CacheClusterStatus;
35667
36070
  this.logger.debug(`CacheCluster ${cacheClusterId} status: ${status}`);
36071
+ if (status !== void 0 && TERMINAL_CLUSTER_STATUSES.has(status)) throw new Error(safeMsg`CacheCluster ${cacheClusterId} is ${status} and will not become available. Check the cluster's events (aws elasticache describe-events --source-type cache-cluster --source-identifier ${cacheClusterId}) for the reason.`);
35668
36072
  const liveNodeType = cluster?.CacheNodeType;
35669
36073
  const removalDone = removedNodeIds.length === 0 || cluster?.CacheNodes !== void 0 && !cluster.CacheNodes.some((n) => n.CacheNodeId !== void 0 && removedNodeIds.includes(n.CacheNodeId));
35670
36074
  if (status === "available" && removalDone && (expectedNodeType === void 0 || liveNodeType === expectedNodeType)) return;
@@ -35696,6 +36100,9 @@ var ElastiCacheProvider = class {
35696
36100
  sleep(ms) {
35697
36101
  return new Promise((resolve) => setTimeout(resolve, ms));
35698
36102
  }
36103
+ getDriftUnknownPaths(resourceType) {
36104
+ return resourceType === "AWS::ElastiCache::CacheCluster" ? ["SnapshotArns", "SnapshotName"] : [];
36105
+ }
35699
36106
  async readCurrentState(physicalId, _logicalId, resourceType) {
35700
36107
  switch (resourceType) {
35701
36108
  case "AWS::ElastiCache::CacheCluster": return this.readCacheCluster(physicalId);
@@ -46166,11 +46573,11 @@ var FSxFileSystemProvider = class {
46166
46573
  };
46167
46574
 
46168
46575
  // src/provisioning/emr-configuration.ts
46169
- function isRecord$1(value) {
46576
+ function isRecord$2(value) {
46170
46577
  return typeof value === "object" && value !== null && !Array.isArray(value);
46171
46578
  }
46172
46579
  function toSdkConfiguration(raw) {
46173
- if (!isRecord$1(raw)) return raw;
46580
+ if (!isRecord$2(raw)) return raw;
46174
46581
  const { ConfigurationProperties, Configurations, ...rest } = raw;
46175
46582
  return {
46176
46583
  ...rest,
@@ -46187,9 +46594,9 @@ function toSdkStepConfigs(value) {
46187
46594
  if (value === void 0) return void 0;
46188
46595
  if (!Array.isArray(value)) return value;
46189
46596
  return value.map((step) => {
46190
- if (!isRecord$1(step)) return step;
46597
+ if (!isRecord$2(step)) return step;
46191
46598
  const hadoopJarStep = step["HadoopJarStep"];
46192
- if (!isRecord$1(hadoopJarStep) || hadoopJarStep["StepProperties"] === void 0) return step;
46599
+ if (!isRecord$2(hadoopJarStep) || hadoopJarStep["StepProperties"] === void 0) return step;
46193
46600
  const { StepProperties, ...restHadoopJarStep } = hadoopJarStep;
46194
46601
  return {
46195
46602
  ...step,
@@ -46204,7 +46611,7 @@ function toSdkInstanceTypeConfigs(value) {
46204
46611
  if (value === void 0) return void 0;
46205
46612
  if (!Array.isArray(value)) return value;
46206
46613
  return value.map((instanceTypeConfig) => {
46207
- if (!isRecord$1(instanceTypeConfig) || instanceTypeConfig["Configurations"] === void 0) return instanceTypeConfig;
46614
+ if (!isRecord$2(instanceTypeConfig) || instanceTypeConfig["Configurations"] === void 0) return instanceTypeConfig;
46208
46615
  return {
46209
46616
  ...instanceTypeConfig,
46210
46617
  Configurations: toSdkConfigurations(instanceTypeConfig["Configurations"])
@@ -48029,7 +48436,8 @@ var FirehoseProvider = class {
48029
48436
  "AmazonopensearchserviceDestinationConfiguration",
48030
48437
  "SplunkDestinationConfiguration",
48031
48438
  "AmazonOpenSearchServerlessDestinationConfiguration",
48032
- "DeliveryStreamEncryptionConfigurationInput"
48439
+ "DeliveryStreamEncryptionConfigurationInput",
48440
+ "IcebergDestinationConfiguration"
48033
48441
  ])]]);
48034
48442
  getClient() {
48035
48443
  if (!this.client) {
@@ -48181,6 +48589,7 @@ var FirehoseProvider = class {
48181
48589
  VpcConfiguration: aossConfig["VpcConfiguration"]
48182
48590
  };
48183
48591
  }
48592
+ if (properties["IcebergDestinationConfiguration"]) input.IcebergDestinationConfiguration = this.mapIcebergDestinationConfiguration(properties["IcebergDestinationConfiguration"]);
48184
48593
  if (properties["DeliveryStreamEncryptionConfigurationInput"]) {
48185
48594
  const encConfig = properties["DeliveryStreamEncryptionConfigurationInput"];
48186
48595
  input.DeliveryStreamEncryptionConfigurationInput = {
@@ -48760,6 +49169,15 @@ var FirehoseProvider = class {
48760
49169
  IcebergDestinationUpdate: this.mapIcebergConfigToUpdate(nextConfig)
48761
49170
  }));
48762
49171
  }
49172
+ mapIcebergDestinationConfiguration(config) {
49173
+ const result = this.mapIcebergConfigToUpdate(config);
49174
+ const catalog = config["CatalogConfiguration"];
49175
+ if (catalog !== void 0) result.CatalogConfiguration = {
49176
+ ...catalog["CatalogArn"] !== void 0 && { CatalogARN: catalog["CatalogArn"] },
49177
+ ...catalog["WarehouseLocation"] !== void 0 && { WarehouseLocation: catalog["WarehouseLocation"] }
49178
+ };
49179
+ return result;
49180
+ }
48763
49181
  mapIcebergConfigToUpdate(config) {
48764
49182
  const result = {};
48765
49183
  if (config["DestinationTableConfigurationList"] !== void 0) result.DestinationTableConfigurationList = config["DestinationTableConfigurationList"];
@@ -48768,12 +49186,11 @@ var FirehoseProvider = class {
48768
49186
  if (config["BufferingHints"] !== void 0) result.BufferingHints = config["BufferingHints"];
48769
49187
  if (config["CloudWatchLoggingOptions"] !== void 0) result.CloudWatchLoggingOptions = config["CloudWatchLoggingOptions"];
48770
49188
  if (config["ProcessingConfiguration"] !== void 0) result.ProcessingConfiguration = config["ProcessingConfiguration"];
48771
- if (config["S3BackupMode"] !== void 0) result.S3BackupMode = config["S3BackupMode"];
49189
+ if (config["s3BackupMode"] !== void 0) result.S3BackupMode = config["s3BackupMode"];
48772
49190
  if (config["RetryOptions"] !== void 0) result.RetryOptions = config["RetryOptions"];
48773
49191
  const roleArn = config["RoleARN"] ?? config["RoleArn"];
48774
49192
  if (roleArn !== void 0) result.RoleARN = roleArn;
48775
49193
  if (config["AppendOnly"] !== void 0) result.AppendOnly = config["AppendOnly"];
48776
- if (config["CatalogConfiguration"] !== void 0) result.CatalogConfiguration = config["CatalogConfiguration"];
48777
49194
  if (config["S3Configuration"] !== void 0) result.S3Configuration = this.mapS3DestinationConfiguration(config["S3Configuration"]);
48778
49195
  return result;
48779
49196
  }
@@ -48865,6 +49282,7 @@ var FirehoseProvider = class {
48865
49282
  if (directPut?.ThroughputHintInMBs !== void 0) result["DirectPutSourceConfiguration"] = { ThroughputHintInMBs: directPut.ThroughputHintInMBs };
48866
49283
  const dest = desc.Destinations?.[0];
48867
49284
  if (dest?.ExtendedS3DestinationDescription) result["ExtendedS3DestinationConfiguration"] = mapExtendedS3DescriptionToCfn(dest.ExtendedS3DestinationDescription);
49285
+ else if (dest?.IcebergDestinationDescription) result["IcebergDestinationConfiguration"] = mapIcebergDescriptionToCfn(dest.IcebergDestinationDescription);
48868
49286
  else if (dest?.S3DestinationDescription) result["S3DestinationConfiguration"] = mapS3DescriptionToCfn(dest.S3DestinationDescription);
48869
49287
  else if (dest?.RedshiftDestinationDescription) result["RedshiftDestinationConfiguration"] = mapRedshiftDescriptionToCfn(dest.RedshiftDestinationDescription);
48870
49288
  else if (dest?.ElasticsearchDestinationDescription) result["ElasticsearchDestinationConfiguration"] = mapNonS3DestinationToCfn(dest.ElasticsearchDestinationDescription);
@@ -49027,6 +49445,31 @@ function mapRedshiftDescriptionToCfn(desc) {
49027
49445
  if (desc["S3BackupDescription"]) out["S3BackupConfiguration"] = mapS3DescriptionToCfn(desc["S3BackupDescription"]);
49028
49446
  return out;
49029
49447
  }
49448
+ function mapIcebergDescriptionToCfn(desc) {
49449
+ const out = {};
49450
+ for (const k of [
49451
+ "DestinationTableConfigurationList",
49452
+ "SchemaEvolutionConfiguration",
49453
+ "TableCreationConfiguration",
49454
+ "BufferingHints",
49455
+ "CloudWatchLoggingOptions",
49456
+ "ProcessingConfiguration",
49457
+ "RetryOptions",
49458
+ "RoleARN",
49459
+ "AppendOnly"
49460
+ ]) {
49461
+ const v = pickDefinedDeep(desc[k]);
49462
+ if (v !== void 0) out[k] = v;
49463
+ }
49464
+ if (desc["S3BackupMode"] !== void 0) out["s3BackupMode"] = desc["S3BackupMode"];
49465
+ const catalog = desc["CatalogConfiguration"];
49466
+ if (catalog) out["CatalogConfiguration"] = {
49467
+ ...catalog["CatalogARN"] !== void 0 && { CatalogArn: catalog["CatalogARN"] },
49468
+ ...catalog["WarehouseLocation"] !== void 0 && { WarehouseLocation: catalog["WarehouseLocation"] }
49469
+ };
49470
+ if (desc["S3DestinationDescription"]) out["S3Configuration"] = mapS3DescriptionToCfn(desc["S3DestinationDescription"]);
49471
+ return out;
49472
+ }
49030
49473
  function mapHttpEndpointDescriptionToCfn(desc) {
49031
49474
  const out = {};
49032
49475
  for (const k of [
@@ -49621,6 +50064,89 @@ function readVisibility(properties, mask) {
49621
50064
  ...typeof role === "string" && role !== "" && { resourceAccessRole: role }
49622
50065
  };
49623
50066
  }
50067
+ const DEFAULT_WEBHOOK_BUILD_TYPE = "BUILD";
50068
+ const NEW_PROJECT_WEBHOOK_ATTEMPTS = 4;
50069
+ const NEW_PROJECT_WEBHOOK_RETRY_BASE_MS = 2e3;
50070
+ const DEFAULT_WEBHOOK_SOURCE_LOCATION = "CODEBUILD_DEFAULT_WEBHOOK_SOURCE_LOCATION";
50071
+ const DEFAULT_WEBHOOK_SCOPE = "GITHUB_ORGANIZATION";
50072
+ function relayedConnectionRace(error, detail) {
50073
+ if (!(error instanceof Error) || error.name !== "OAuthProviderException") return "";
50074
+ if (detail.includes("security token included in the request is invalid")) return " (The security token included in the request is invalid. (Service: CodeBuild))";
50075
+ if (detail.includes("not authorized to access connection")) return " (The service role is not authorized to perform access to the connection Source.Auth names)";
50076
+ return "";
50077
+ }
50078
+ function isRecord$1(value) {
50079
+ return typeof value === "object" && value !== null && !Array.isArray(value);
50080
+ }
50081
+ function readTriggers(properties, mask) {
50082
+ const triggers = properties["Triggers"];
50083
+ if (triggers == null) return { kind: "unmanaged" };
50084
+ const refuse = (key, expected, value) => ({
50085
+ kind: "unusable",
50086
+ reason: `AWS::CodeBuild::Project ${key} must be ${expected}, got ${JSON.stringify(maskDeep(value, mask))}`
50087
+ });
50088
+ if (!isRecord$1(triggers)) return refuse("Triggers", "an object", triggers);
50089
+ const declared = triggers["Webhook"];
50090
+ const webhook = declared == null ? void 0 : coerceCfnBoolean(declared);
50091
+ if (declared != null && webhook === void 0) return refuse("Triggers.Webhook", "a boolean", declared);
50092
+ const groups = triggers["FilterGroups"];
50093
+ const buildType = triggers["BuildType"];
50094
+ if (webhook !== true) {
50095
+ for (const [key, value, noun] of [[
50096
+ "FilterGroups",
50097
+ groups,
50098
+ "filter groups"
50099
+ ], [
50100
+ "BuildType",
50101
+ buildType,
50102
+ "build type"
50103
+ ]]) if (value != null) return {
50104
+ kind: "unusable",
50105
+ reason: `AWS::CodeBuild::Project Triggers.${key}: cannot specify ${noun} when webhook is disabled`
50106
+ };
50107
+ return { kind: webhook === false ? "disabled" : "unmanaged" };
50108
+ }
50109
+ if (buildType != null && typeof buildType !== "string") return refuse("Triggers.BuildType", "a string", buildType);
50110
+ let filterGroups;
50111
+ if (groups != null) {
50112
+ if (!Array.isArray(groups) || !groups.every(Array.isArray)) return refuse("Triggers.FilterGroups", "a list of filter lists", groups);
50113
+ const rows = groups;
50114
+ if (!rows.every((group) => group.every(isRecord$1))) return refuse("Triggers.FilterGroups", "a list of filter lists", groups);
50115
+ filterGroups = rows.map((group) => group.map((filter) => {
50116
+ const excluded = filter["ExcludeMatchedPattern"];
50117
+ return {
50118
+ type: filter["Type"],
50119
+ pattern: filter["Pattern"],
50120
+ ...excluded != null && { excludeMatchedPattern: coerceCfnBoolean(excluded) ?? excluded }
50121
+ };
50122
+ }));
50123
+ }
50124
+ const policy = triggers["PullRequestBuildPolicy"];
50125
+ if (policy != null && !isRecord$1(policy)) return refuse("Triggers.PullRequestBuildPolicy", "an object", policy);
50126
+ const scope = triggers["ScopeConfiguration"];
50127
+ if (scope != null && !isRecord$1(scope)) return refuse("Triggers.ScopeConfiguration", "an object", scope);
50128
+ if (scope != null) {
50129
+ const source = properties["Source"];
50130
+ if (!isRecord$1(source) || source["Location"] !== DEFAULT_WEBHOOK_SOURCE_LOCATION) return {
50131
+ kind: "unusable",
50132
+ reason: `AWS::CodeBuild::Project Triggers.ScopeConfiguration: cannot specify a scope when the project source location is not ${DEFAULT_WEBHOOK_SOURCE_LOCATION}`
50133
+ };
50134
+ }
50135
+ return {
50136
+ kind: "enabled",
50137
+ ...filterGroups !== void 0 && { filterGroups },
50138
+ ...buildType != null && { buildType },
50139
+ ...scope != null && { scopeConfiguration: {
50140
+ name: scope["Name"],
50141
+ scope: scope["Scope"] ?? DEFAULT_WEBHOOK_SCOPE,
50142
+ ...scope["Domain"] != null && { domain: scope["Domain"] }
50143
+ } },
50144
+ ...policy != null && { pullRequestBuildPolicy: {
50145
+ requiresCommentApproval: policy["RequiresCommentApproval"],
50146
+ ...policy["ApproverRoles"] != null && { approverRoles: policy["ApproverRoles"] }
50147
+ } }
50148
+ };
50149
+ }
49624
50150
  var CodeBuildProvider = class {
49625
50151
  client;
49626
50152
  createClient;
@@ -49651,7 +50177,8 @@ var CodeBuildProvider = class {
49651
50177
  "SourceVersion",
49652
50178
  "AutoRetryLimit",
49653
50179
  "Visibility",
49654
- "ResourceAccessRole"
50180
+ "ResourceAccessRole",
50181
+ "Triggers"
49655
50182
  ])]]);
49656
50183
  getClient() {
49657
50184
  if (!this.client) {
@@ -49849,6 +50376,11 @@ var CodeBuildProvider = class {
49849
50376
  if (context?.replayingState !== true) throw new ProvisioningError(visibilityRead.reason, resourceType, logicalId);
49850
50377
  this.logger.warn(mask(`${visibilityRead.reason}. Replaying a state record, so CodeBuild Project ${logicalId} is left ${DEFAULT_PROJECT_VISIBILITY} with no resource access role rather than refusing the restore`));
49851
50378
  }
50379
+ const triggersRead = readTriggers(properties, mask);
50380
+ if (triggersRead.kind === "unusable") {
50381
+ if (context?.replayingState !== true) throw new ProvisioningError(triggersRead.reason, resourceType, logicalId);
50382
+ this.logger.warn(mask(`${triggersRead.reason}. Replaying a state record, so CodeBuild Project ${logicalId} gets no webhook rather than refusing the restore`));
50383
+ }
49852
50384
  let createdName;
49853
50385
  try {
49854
50386
  const input = this.mapProperties(() => generatedNameFor("AWS::CodeBuild::Project", logicalId), properties);
@@ -49857,6 +50389,7 @@ var CodeBuildProvider = class {
49857
50389
  const projectArn = result.project.arn;
49858
50390
  createdName = projectName;
49859
50391
  reportCreatedResource(logicalId, resourceType, createdName);
50392
+ if (triggersRead.kind === "enabled") await this.createWebhookOnNewProject(projectName, triggersRead);
49860
50393
  if (visibilityRead.kind === "usable" && (visibilityRead.visibility !== DEFAULT_PROJECT_VISIBILITY || visibilityRead.resourceAccessRole !== void 0)) await this.applyVisibility(projectArn, visibilityRead);
49861
50394
  this.logger.debug(`Successfully created CodeBuild Project ${logicalId}: ${projectName}`);
49862
50395
  return {
@@ -49866,11 +50399,67 @@ var CodeBuildProvider = class {
49866
50399
  } catch (error) {
49867
50400
  if (createdName !== void 0) markAuxiliaryFailure(error, logicalId);
49868
50401
  const cause = error instanceof Error ? error : void 0;
49869
- const thrown = this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to create CodeBuild Project ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause));
50402
+ const thrown = this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to create CodeBuild Project ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause), createdName === void 0);
49870
50403
  if (createdName !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdName);
49871
50404
  throw thrown;
49872
50405
  }
49873
50406
  }
50407
+ async createWebhook(projectName, read) {
50408
+ await this.getCreateClient().send(new CreateWebhookCommand({
50409
+ projectName,
50410
+ ...read.filterGroups !== void 0 && { filterGroups: read.filterGroups },
50411
+ ...read.buildType !== void 0 && { buildType: read.buildType },
50412
+ ...read.scopeConfiguration !== void 0 && { scopeConfiguration: read.scopeConfiguration },
50413
+ ...read.pullRequestBuildPolicy !== void 0 && { pullRequestBuildPolicy: read.pullRequestBuildPolicy }
50414
+ }));
50415
+ }
50416
+ async createWebhookOnNewProject(projectName, read) {
50417
+ const watch = startInterruptWatch(`The webhook of CodeBuild Project ${projectName}`);
50418
+ let mayHaveLanded = false;
50419
+ try {
50420
+ for (let attempt = 1;; attempt++) try {
50421
+ await this.createWebhook(projectName, read);
50422
+ return;
50423
+ } catch (error) {
50424
+ if (!(error instanceof Error)) throw error;
50425
+ if (mayHaveLanded && error.name === "ResourceAlreadyExistsException") return;
50426
+ const ambiguous = isAmbiguousOutcomeError(error);
50427
+ mayHaveLanded ||= ambiguous;
50428
+ if (!(ambiguous || isRetryableTransientError(error, error.message)) || attempt === NEW_PROJECT_WEBHOOK_ATTEMPTS) throw markNonRetryable(error);
50429
+ let remaining = NEW_PROJECT_WEBHOOK_RETRY_BASE_MS * 2 ** (attempt - 1);
50430
+ while (remaining > 0) {
50431
+ if (watch.isInterrupted()) throw watch.onInterrupted();
50432
+ const chunk = Math.min(1e3, remaining);
50433
+ await this.sleep(chunk);
50434
+ remaining -= chunk;
50435
+ }
50436
+ if (watch.isInterrupted()) throw watch.onInterrupted();
50437
+ }
50438
+ } finally {
50439
+ watch.dispose();
50440
+ }
50441
+ }
50442
+ sleep(ms) {
50443
+ return new Promise((resolve) => setTimeout(resolve, ms));
50444
+ }
50445
+ async reconcileWebhook(projectName, read, liveWebhook) {
50446
+ if (read.kind === "disabled" && liveWebhook) {
50447
+ await this.getClient().send(new DeleteWebhookCommand({ projectName }));
50448
+ return;
50449
+ }
50450
+ if (read.kind !== "enabled") return;
50451
+ if (!liveWebhook) {
50452
+ await this.createWebhook(projectName, read);
50453
+ return;
50454
+ }
50455
+ await this.getClient().send(new UpdateWebhookCommand({
50456
+ projectName,
50457
+ filterGroups: read.filterGroups ?? [],
50458
+ buildType: read.buildType ?? DEFAULT_WEBHOOK_BUILD_TYPE,
50459
+ rotateSecret: false,
50460
+ ...read.pullRequestBuildPolicy !== void 0 && { pullRequestBuildPolicy: read.pullRequestBuildPolicy }
50461
+ }));
50462
+ }
49874
50463
  async applyVisibility(projectArn, read) {
49875
50464
  await this.getClient().send(new UpdateProjectVisibilityCommand({
49876
50465
  projectArn,
@@ -49882,6 +50471,11 @@ var CodeBuildProvider = class {
49882
50471
  this.logger.debug(`Updating CodeBuild Project ${logicalId}: ${physicalId}`);
49883
50472
  const mask = maskerOrIdentity(context?.maskSecrets);
49884
50473
  assertRegionMatch(context?.expectedRegion ? await this.getClient().config.region() : void 0, context?.expectedRegion, resourceType, logicalId, physicalId, "pre-update");
50474
+ const triggersRead = readTriggers(properties, mask);
50475
+ if (triggersRead.kind === "unusable") {
50476
+ if (context?.replayingState !== true) throw new ProvisioningError(triggersRead.reason, resourceType, logicalId, physicalId);
50477
+ this.logger.warn(mask(`${triggersRead.reason}. Replaying a state record, so the webhook of CodeBuild Project ${physicalId} is left unchanged`));
50478
+ }
49885
50479
  try {
49886
50480
  const input = this.mapProperties(() => physicalId, properties);
49887
50481
  input.name = physicalId;
@@ -49890,6 +50484,9 @@ var CodeBuildProvider = class {
49890
50484
  if (!declaredKey(properties["EncryptionKey"]) && declaredKey(previousProperties["EncryptionKey"])) input.encryptionKey = DEFAULT_ENCRYPTION_KEY;
49891
50485
  if (properties["Tags"] == null && previousProperties["Tags"] != null) input.tags = [];
49892
50486
  const updated = await this.getClient().send(new UpdateProjectCommand(input));
50487
+ const liveWebhook = updated.project?.webhook;
50488
+ await this.reconcileWebhook(physicalId, triggersRead, liveWebhook != null);
50489
+ if (triggersRead.kind === "enabled" && triggersRead.scopeConfiguration !== void 0 && liveWebhook != null && Object.entries(triggersRead.scopeConfiguration).some(([key, value]) => liveWebhook.scopeConfiguration?.[key] !== value)) this.logger.warn(mask(`The Triggers.ScopeConfiguration of CodeBuild Project ${physicalId} differs from its live webhook, which cannot change scope: the webhook keeps its scope. Delete it with Webhook: false, then deploy Webhook: true to apply the new one`));
49893
50490
  const desiredVisibility = readVisibility(properties, mask);
49894
50491
  const recorded = readVisibility(previousProperties, mask);
49895
50492
  if (desiredVisibility.kind === "unusable") {
@@ -49907,14 +50504,14 @@ var CodeBuildProvider = class {
49907
50504
  };
49908
50505
  } catch (error) {
49909
50506
  const cause = error instanceof Error ? error : void 0;
49910
- throw this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to update CodeBuild Project ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
50507
+ throw this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to update CodeBuild Project ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause), true);
49911
50508
  }
49912
50509
  }
49913
- wrapCaughtError(mask, error, build) {
50510
+ wrapCaughtError(mask, error, build, retryConnectionRace) {
49914
50511
  const failure = describeAwsFailure(error);
49915
50512
  if (!failure.redacted) return wrapMaskedAwsError(mask, error, build);
49916
50513
  this.logger.debug(mask(build(mask(failure.detail)).message));
49917
- const wrapped = build(`${mask(failure.summary)}${relayedNameCollision(failure.detail)}`);
50514
+ const wrapped = build(`${mask(failure.summary)}${relayedNameCollision(failure.detail)}` + (retryConnectionRace ? relayedConnectionRace(error, failure.detail) : ""));
49918
50515
  return error instanceof Error ? markRedactedCause(wrapped) : wrapped;
49919
50516
  }
49920
50517
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -49930,7 +50527,7 @@ var CodeBuildProvider = class {
49930
50527
  return;
49931
50528
  }
49932
50529
  const cause = error instanceof Error ? error : void 0;
49933
- const thrown = this.wrapCaughtError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to delete CodeBuild Project ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
50530
+ const thrown = this.wrapCaughtError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to delete CodeBuild Project ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause), false);
49934
50531
  throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
49935
50532
  }
49936
50533
  }
@@ -50110,7 +50707,7 @@ var CodeBuildProvider = class {
50110
50707
  return result;
50111
50708
  }
50112
50709
  getDriftUnknownPaths() {
50113
- return ["Source.Auth"];
50710
+ return ["Source.Auth", "Triggers"];
50114
50711
  }
50115
50712
  async import(input) {
50116
50713
  const explicit = resolveExplicitPhysicalId(input, "Name");
@@ -54317,4 +54914,4 @@ var ACMCertificateProvider = class {
54317
54914
  };
54318
54915
 
54319
54916
  export { ACMCertificateProvider, ASGProvider, AgentCoreBrowserProvider, AgentCoreCodeInterpreterProvider, AgentCoreEvaluatorProvider, AgentCoreRuntimeProvider, ApiGatewayProvider, ApiGatewayV2Provider, 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 };
54320
- //# sourceMappingURL=provider-classes-ushrO6ri.js.map
54917
+ //# sourceMappingURL=provider-classes-CbiecOol.js.map