@go-to-k/cdkd 0.317.0 → 0.319.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 (26) hide show
  1. package/dist/{asg-provider-WornuySB.js → asg-provider-T9K-NVi8.js} +2 -2
  2. package/dist/{asg-provider-WornuySB.js.map → asg-provider-T9K-NVi8.js.map} +1 -1
  3. package/dist/cli.js +2 -2
  4. package/dist/{deploy-engine-b0rYBotL.js → deploy-engine-CVYhHEgq.js} +72 -40
  5. package/dist/deploy-engine-CVYhHEgq.js.map +1 -0
  6. package/dist/{iam-role-provider-gTpDZhfz.js → iam-role-provider-qTIqSmlf.js} +40 -24
  7. package/dist/iam-role-provider-qTIqSmlf.js.map +1 -0
  8. package/dist/index.d.ts +0 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +2 -2
  11. package/dist/{neptune-provider-BfzktOKC.js → neptune-provider-BsA7jGiV.js} +208 -26
  12. package/dist/neptune-provider-BsA7jGiV.js.map +1 -0
  13. package/dist/{program-BZ-VVfXu.js → program-DyYTFxF-.js} +11 -11
  14. package/dist/{program-BZ-VVfXu.js.map → program-DyYTFxF-.js.map} +1 -1
  15. package/dist/{provider-classes-DGFOKPO9.js → provider-classes-DOr3JVGp.js} +394 -67
  16. package/dist/provider-classes-DOr3JVGp.js.map +1 -0
  17. package/dist/{rds-provider-BUNLNluC.js → rds-provider-CIjO2Do5.js} +74 -5
  18. package/dist/rds-provider-CIjO2Do5.js.map +1 -0
  19. package/dist/{version-BkSInxUL.js → version-C3yhae4b.js} +2 -2
  20. package/dist/{version-BkSInxUL.js.map → version-C3yhae4b.js.map} +1 -1
  21. package/package.json +1 -1
  22. package/dist/deploy-engine-b0rYBotL.js.map +0 -1
  23. package/dist/iam-role-provider-gTpDZhfz.js.map +0 -1
  24. package/dist/neptune-provider-BfzktOKC.js.map +0 -1
  25. package/dist/provider-classes-DGFOKPO9.js.map +0 -1
  26. package/dist/rds-provider-BUNLNluC.js.map +0 -1
@@ -2,19 +2,19 @@ import { r as getAwsClients, s as withApiGatewayPacing } from "./aws-clients-DWp
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
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-b0rYBotL.js";
6
- import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-gTpDZhfz.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-BZ-VVfXu.js";
5
+ import { $ as sendTtlWaitingOutRateLimit, A as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, B as deleteTableWithIndexBusyRetry, Ba as s3BucketArn, Bc as passedNoEchoParametersOf, Bi as isRefusedByName, C as planContributorInsightsOp, Cl as recordAttributeIdCopy, Ct as enclosingDeadlineExpired, D as reverseMapTableContributorInsights, Da as reDisableInstanceApiTermination, Dc as lambdaFunctionNameForMask, E as reverseMapIndexContributorInsights, Ea as observeThenDisableInstanceApiTermination, Ec as canonicalLambdaFunctionName, El as carriesSecretMask, Eo as parseWebACLArn, F as resolveDynamoDbDeleteBudgetClock, Fd as displayAssemblyPath, G as readbackVectorIndexes, Gi as readTagList, Gn as isRedactedRecordedValue, H as relayedIndexBusyDelete, Ha as s3BucketDualStackDomainName, Hi as DBPROXY_TAGS_WHAT, Hn as getCurrentProducerRegions, I as resolveDynamoDbDeleteBudgetMs, Id as renderAssemblyPathEscape, Ii as acquireIdempotencyToken, Io as accountArgs, J as vectorIndexesShapeDetail, Jc as recordReferenceProvenanceEntry, Ji as tagPlanWarning, Js as withoutSilentDropProperties, Jt as getCurrentNestedStackContext, K as vectorIndexesForCreate, Kc as markSameGenerationBag, Ki as refuseMalformedDesiredTags, Kn as redactedDeleteAddressFields, Ks as findSilentDropProperties, L as DELETE_INDEX_WAIT_PROCEED_NOTE, Ld as resolveAssemblyPath, M as beginDeleteWait, Mi as earliestDefined, N as compensateRemovedDeletionProtection, O as stripIndexContributorInsights, Oa as reEnableInstanceApiTermination, Oc as sameLambdaFunctionAddress, P as deleteBudgetKey, Pd as describeFileReadFailure, Pi as reserveStackCreateToken, Q as readTtlSpec, Qc as hasMaskableValues, R as INDEX_SETTLE_POLL_INTERVAL_MS, S as indexDeclaresContributorInsights, Sa as markWaitAbandoned, Sc as blockDeviceMappingsDifferOnlyInDeleteOnTermination, Sl as physicalNameCopiesOf, T as readContributorInsightsSpec, Ta as isTerminationProtectionPropagationError, Tc as emrClusterInstancesReplaced, U as waitForIndexesSettled, Ua as s3BucketRegionalDomainName, Ui as DBPROXY_TAG_OPTIONS, Ur as replacedDeleteFailureVerdict, Us as withheldAccountClause, V as maskedLogger, Va as s3BucketDomainName, Vi as markDeleteStarted, Vr as getStackRecords, Vt as getNestedRevertRun, W as planVectorIndexUpdates, Wa as s3BucketWebsiteUrl, Wi as planTagDiff, Wn as REDACTED_DELETE_ADDRESS_SKIP_REASON, Wt as revertNestedChildFromJournal, X as isTtlRateLimited, Xi as stringifyIfAssigned, Y as isTtlAlreadyDisabled, Ya as outputReferenceProvenanceOf, Yc as snapshotPassProvenance, Yi as definedAttributes, Yt as withNestedStackContext, Z as planTimeToLive, _ as streamMemberRefusals, _c as requireConfigString, _d as decodeListingKey, _t as renderNestedTemplateTreeDefect, ac as isWarmThroughputDecrease, an as chunks, at as markRefusedBeforeApplying, b as CONTRIBUTOR_INSIGHTS_KEY, ba as withIndeterminateGuard, bd as canonicalizeRegion, c as DynamoDBGlobalTableProvider, cc as coerceCfnBoolean, cn as withApiLimit, d as declaredStreamPolicyMember, dc as configIntegerRefusal, ds as refuseMalformedNestedChildOutputs, et as ECR_AUTO_DELETE_IMAGES_TAG, f as declaredStreamTagsMember, fa as slowCcOperationTimeoutMs, fc as configStringRefusal, fl as withoutPhysicalNameCopies, g as streamDeclaresTags, gc as requireConfigObject, gt as listNestedTemplateRows, h as streamDeclaresPolicy, hc as requireConfigArray, ho as getAccountInfo, ht as isAbsoluteAssetPath, ic as coerceWarmThroughput$1, it as getPriorAttempts, j as DYNAMODB_DELETE_POLL_COST_MS, ja as isUsableAttemptedName, js as refuseMalformedResourcesForDestroy, k as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, ko as passedParameterClassesOf, l as STREAM_POLICY_KEY, lc as coerceCfnInteger, m as reverseMapStreamPolicy, ma as unchangedBehindSecretReference, mc as replayWarn, ml as dynamicReferenceTokens, mt as findNestedTemplateTreeDefect, na as waitForLambdaFunctionActive, nt as hasCdkAutoDeleteTag, oa as getCurrentResourceSecrets, oc as toCfnInteger, on as isAccessDeniedError, p as planStreamMemberOps, pa as onlySecretReferencesDiffer, pc as readConfigString, pu as stringifyValue, q as vectorIndexesSettled, qc as redactForState, qi as tagMapAsList, qn as redactedDeleteAddressSkip, rc as WARM_THROUGHPUT_MEMBERS, rt as isTruthyCfnBoolean, sc as toFiniteNumber, sn as lookupEachName, t as DeployEngine, tt as S3_AUTO_DELETE_OBJECTS_TAG, u as STREAM_TAGS_KEY, uc as configBooleanRefusal, uu as timePhase, v as streamPolicyMatchesDeclared, vu as rewriteTemplateAssetReferences, w as planIndexContributorInsightsOps, wa as ec2InstanceProtectionSite, wc as ecsServiceLaunchTypeSetOrChanged, wt as enclosingDeadlineRemainingMs, x as contributorInsightsRefusals, xa as isWaitAbandonedError, xc as withRetry, xd as derivePartitionAndUrlSuffix, xl as recoverMaskedOutput, y as streamTagsMatchDeclared, ya as deleteSkipReason, yi as secretNamedAttributeNamesOf, z as TABLE_INDEX_NOUN, za as isSettledInstanceState, zr as awaitInFlightSibling } from "./deploy-engine-CVYhHEgq.js";
6
+ import { a as IamCreateClientCache, i as isEntityAlreadyExists, n as collectInlinePolicyNamesManagedBySiblings, r as iamEntityLeftByThisCreate, t as IAMRoleProvider } from "./iam-role-provider-qTIqSmlf.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-DyYTFxF-.js";
8
8
  import { n as modifyDbInstanceWhenAvailable } from "./db-instance-modify-retry-CspmK57I.js";
9
- import { RDSProvider } from "./rds-provider-BUNLNluC.js";
10
- import { NeptuneProvider } from "./neptune-provider-BfzktOKC.js";
11
- import { ASGProvider } from "./asg-provider-WornuySB.js";
9
+ import { RDSProvider } from "./rds-provider-CIjO2Do5.js";
10
+ import { NeptuneProvider } from "./neptune-provider-BsA7jGiV.js";
11
+ import { ASGProvider } from "./asg-provider-T9K-NVi8.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";
@@ -650,17 +650,39 @@ var IAMManagedPolicyProvider = class {
650
650
  if (properties["Description"]) createParams.Description = properties["Description"];
651
651
  if (properties["Path"]) createParams.Path = properties["Path"];
652
652
  if (tags.length > 0) createParams.Tags = tags;
653
- const response = await (await this.createClient.get()).send(new CreatePolicyCommand(createParams));
654
- const policyArn = response.Policy?.Arn;
655
- if (!policyArn) throw new ProvisioningError(`CreatePolicy succeeded but no Arn returned for ${logicalId}`, resourceType, logicalId, policyName);
653
+ const createClient = await this.createClient.get();
654
+ let policy;
655
+ let adopted = false;
656
+ try {
657
+ policy = (await createClient.send(new CreatePolicyCommand(createParams))).Policy;
658
+ } catch (createError) {
659
+ const expectedArnTail = `:policy${createParams.Path ?? "/"}${policyName}`;
660
+ policy = await iamEntityLeftByThisCreate({
661
+ logicalId,
662
+ resourceType,
663
+ noun: "managed policy",
664
+ displayName: policyName,
665
+ createError,
666
+ namesThisEntity: (reported) => reported.endsWith(expectedArnTail),
667
+ read: async (reportedArn) => (await this.iamClient.send(new GetPolicyCommand({ PolicyArn: reportedArn }))).Policy,
668
+ identityOf: (live) => policyIdentityToken(live?.PolicyId),
669
+ log
670
+ });
671
+ if (policy === void 0) throw createError;
672
+ adopted = true;
673
+ }
674
+ const policyArn = policy?.Arn;
675
+ if (!policyArn) throw new ProvisioningError(`${adopted ? "GetPolicy" : "CreatePolicy"} succeeded but no Arn returned for ${logicalId}`, resourceType, logicalId, policyName);
656
676
  leftBehindArn = policyArn;
657
- createdPolicyIdentity = policyIdentityToken(response.Policy?.PolicyId);
658
- reportCreatedResource(logicalId, resourceType, policyArn, createdPolicyIdentity);
659
- log.debug(`Created IAM managed policy: ${v(policyArn)}`);
677
+ createdPolicyIdentity = policyIdentityToken(policy?.PolicyId);
678
+ if (!adopted) {
679
+ reportCreatedResource(logicalId, resourceType, policyArn, createdPolicyIdentity);
680
+ log.debug(`Created IAM managed policy: ${v(policyArn)}`);
681
+ }
660
682
  try {
661
683
  await this.attachToPrincipals(policyArn, principals.lists.Groups, principals.lists.Roles, principals.lists.Users, log);
662
684
  } catch (innerError) {
663
- try {
685
+ if (!adopted) try {
664
686
  await this.detachAllPrincipals(policyArn);
665
687
  await this.deleteAllNonDefaultVersions(policyArn);
666
688
  await this.iamClient.send(new DeletePolicyCommand({ PolicyArn: policyArn }));
@@ -1257,17 +1279,40 @@ var IAMInstanceProfileProvider = class {
1257
1279
  let leftBehind = false;
1258
1280
  let createdProfileIdentity;
1259
1281
  try {
1260
- const response = await (await this.createClient.get()).send(new CreateInstanceProfileCommand({
1261
- InstanceProfileName: instanceProfileName,
1262
- Path: path
1263
- }));
1282
+ const createClient = await this.createClient.get();
1283
+ let profile;
1284
+ let adopted = false;
1285
+ try {
1286
+ profile = (await createClient.send(new CreateInstanceProfileCommand({
1287
+ InstanceProfileName: instanceProfileName,
1288
+ Path: path
1289
+ }))).InstanceProfile;
1290
+ } catch (createError) {
1291
+ profile = await iamEntityLeftByThisCreate({
1292
+ logicalId,
1293
+ resourceType,
1294
+ noun: "instance profile",
1295
+ displayName: instanceProfileName,
1296
+ createError,
1297
+ namesThisEntity: (reported) => reported === instanceProfileName,
1298
+ read: async () => (await this.iamClient.send(new GetInstanceProfileCommand({ InstanceProfileName: instanceProfileName }))).InstanceProfile,
1299
+ identityOf: (live) => instanceProfileIdentityToken(live?.InstanceProfileId),
1300
+ log
1301
+ });
1302
+ if (profile === void 0) throw createError;
1303
+ adopted = true;
1304
+ }
1264
1305
  leftBehind = true;
1265
- createdProfileIdentity = instanceProfileIdentityToken(response.InstanceProfile?.InstanceProfileId);
1266
- reportCreatedResource(logicalId, resourceType, instanceProfileName, createdProfileIdentity);
1267
- log.debug(`Created IAM instance profile: ${v(instanceProfileName)}`);
1306
+ createdProfileIdentity = instanceProfileIdentityToken(profile?.InstanceProfileId);
1307
+ if (!adopted) {
1308
+ reportCreatedResource(logicalId, resourceType, instanceProfileName, createdProfileIdentity);
1309
+ log.debug(`Created IAM instance profile: ${v(instanceProfileName)}`);
1310
+ }
1268
1311
  const attachedRoles = [];
1312
+ const heldRoles = new Set(profile?.Roles?.map((role) => role.RoleName?.toLowerCase()));
1269
1313
  try {
1270
1314
  if (roles && Array.isArray(roles)) for (const roleName of roles) {
1315
+ if (heldRoles.has(roleName.toLowerCase())) continue;
1271
1316
  await this.iamClient.send(new AddRoleToInstanceProfileCommand({
1272
1317
  InstanceProfileName: instanceProfileName,
1273
1318
  RoleName: roleName
@@ -1276,7 +1321,7 @@ var IAMInstanceProfileProvider = class {
1276
1321
  log.debug(`Added role ${v(roleName)} to instance profile ${v(instanceProfileName)}`);
1277
1322
  }
1278
1323
  } catch (innerError) {
1279
- try {
1324
+ if (!adopted) try {
1280
1325
  for (const roleName of attachedRoles) try {
1281
1326
  await this.iamClient.send(new RemoveRoleFromInstanceProfileCommand({
1282
1327
  InstanceProfileName: instanceProfileName,
@@ -1301,7 +1346,7 @@ var IAMInstanceProfileProvider = class {
1301
1346
  log.debug(`Successfully created IAM instance profile ${logicalId}: ${v(instanceProfileName)}`);
1302
1347
  return {
1303
1348
  physicalId: instanceProfileName,
1304
- attributes: { Arn: response.InstanceProfile?.Arn }
1349
+ attributes: { Arn: profile?.Arn }
1305
1350
  };
1306
1351
  } catch (error) {
1307
1352
  const cause = error instanceof Error ? error : void 0;
@@ -1803,6 +1848,8 @@ function isUserOrGroupType(resourceType) {
1803
1848
  function userOrGroupIdentityToken(id) {
1804
1849
  return typeof id === "string" && id !== "" ? id : void 0;
1805
1850
  }
1851
+ const PROFILE_SETTLING_ERROR = "EntityTemporarilyUnmodifiableException";
1852
+ const LOGIN_PROFILE_SETTLING_MESSAGE = "IAM cannot modify the login profile yet: a concurrent update operation has not settled";
1806
1853
  const MEMBERSHIP_NO_PROPERTIES_SKIP_REASON = "no properties in state — group membership not removed";
1807
1854
  const MEMBERSHIP_MISSING_FIELDS_SKIP_REASON = "GroupName/Users missing from state — membership not removed";
1808
1855
  const MEMBERSHIP_MALFORMED_USERS_SKIP_REASON = "malformed Users in state — membership not removed";
@@ -1938,10 +1985,29 @@ var IAMUserGroupProvider = class {
1938
1985
  const createParams = { UserName: userName };
1939
1986
  if (properties["Path"]) createParams.Path = properties["Path"];
1940
1987
  if (properties["Tags"] !== void 0 && properties["Tags"] !== null) createParams.Tags = desiredTags;
1941
- const response = await (await this.createClient.get()).send(new CreateUserCommand(createParams));
1988
+ const createClient = await this.createClient.get();
1989
+ let user;
1990
+ let adopted = false;
1991
+ try {
1992
+ user = (await createClient.send(new CreateUserCommand(createParams))).User;
1993
+ } catch (createError) {
1994
+ user = await iamEntityLeftByThisCreate({
1995
+ logicalId,
1996
+ resourceType,
1997
+ noun: "user",
1998
+ displayName: userName,
1999
+ createError,
2000
+ namesThisEntity: (reported) => reported === userName,
2001
+ read: async () => (await this.iamClient.send(new GetUserCommand({ UserName: userName }))).User,
2002
+ identityOf: (live) => userOrGroupIdentityToken(live?.UserId),
2003
+ log
2004
+ });
2005
+ if (user === void 0) throw createError;
2006
+ adopted = true;
2007
+ }
1942
2008
  leftBehind = true;
1943
- createdUserIdentity = userOrGroupIdentityToken(response.User?.UserId);
1944
- reportCreatedResource(logicalId, resourceType, userName, createdUserIdentity);
2009
+ createdUserIdentity = userOrGroupIdentityToken(user?.UserId);
2010
+ if (!adopted) reportCreatedResource(logicalId, resourceType, userName, createdUserIdentity);
1945
2011
  try {
1946
2012
  const permissionsBoundary = properties["PermissionsBoundary"];
1947
2013
  if (permissionsBoundary) {
@@ -1953,12 +2019,24 @@ var IAMUserGroupProvider = class {
1953
2019
  }
1954
2020
  const loginProfile = properties["LoginProfile"];
1955
2021
  if (loginProfile) {
1956
- await this.iamClient.send(new CreateLoginProfileCommand({
2022
+ const profile = {
1957
2023
  UserName: userName,
1958
2024
  Password: loginProfile.Password,
1959
2025
  PasswordResetRequired: loginProfile.PasswordResetRequired ?? false
1960
- }));
1961
- log.debug(`Created login profile for user ${v(userName)}`);
2026
+ };
2027
+ try {
2028
+ await this.iamClient.send(new CreateLoginProfileCommand(profile));
2029
+ log.debug(`Created login profile for user ${v(userName)}`);
2030
+ } catch (profileError) {
2031
+ if (!adopted || !isEntityAlreadyExists(profileError)) throw profileError;
2032
+ try {
2033
+ await this.iamClient.send(new UpdateLoginProfileCommand(profile));
2034
+ } catch (updateError) {
2035
+ if (updateError?.name !== PROFILE_SETTLING_ERROR) throw updateError;
2036
+ throw new Error(LOGIN_PROFILE_SETTLING_MESSAGE, { cause: updateError });
2037
+ }
2038
+ log.debug(`Updated login profile for user ${v(userName)}`);
2039
+ }
1962
2040
  }
1963
2041
  const managedPolicyArns = properties["ManagedPolicyArns"];
1964
2042
  if (managedPolicyArns && Array.isArray(managedPolicyArns)) for (const policyArn of managedPolicyArns) {
@@ -1987,7 +2065,7 @@ var IAMUserGroupProvider = class {
1987
2065
  log.debug(`Added inline policy ${v(policy.PolicyName)} to user ${v(userName)}`);
1988
2066
  }
1989
2067
  } catch (innerError) {
1990
- try {
2068
+ if (!adopted) try {
1991
2069
  await this.removeUserFromAllGroups(userName, log);
1992
2070
  await this.detachAllUserPolicies(userName, log);
1993
2071
  await this.deleteAllUserInlinePolicies(userName, log);
@@ -2015,7 +2093,7 @@ var IAMUserGroupProvider = class {
2015
2093
  log.debug(`Successfully created IAM user ${logicalId}: ${v(userName)}`);
2016
2094
  return {
2017
2095
  physicalId: userName,
2018
- attributes: { Arn: response.User?.Arn }
2096
+ attributes: { Arn: user?.Arn }
2019
2097
  };
2020
2098
  } catch (error) {
2021
2099
  const cause = error instanceof Error ? error : void 0;
@@ -2342,10 +2420,32 @@ var IAMUserGroupProvider = class {
2342
2420
  try {
2343
2421
  const createParams = { GroupName: groupName };
2344
2422
  if (properties["Path"]) createParams.Path = properties["Path"];
2345
- const response = await (await this.createClient.get()).send(new CreateGroupCommand(createParams));
2423
+ const createClient = await this.createClient.get();
2424
+ let group;
2425
+ let adopted = false;
2426
+ try {
2427
+ group = (await createClient.send(new CreateGroupCommand(createParams))).Group;
2428
+ } catch (createError) {
2429
+ group = await iamEntityLeftByThisCreate({
2430
+ logicalId,
2431
+ resourceType,
2432
+ noun: "group",
2433
+ displayName: groupName,
2434
+ createError,
2435
+ namesThisEntity: (reported) => reported === groupName,
2436
+ read: async () => (await this.iamClient.send(new GetGroupCommand({
2437
+ GroupName: groupName,
2438
+ MaxItems: 1
2439
+ }))).Group,
2440
+ identityOf: (live) => userOrGroupIdentityToken(live?.GroupId),
2441
+ log
2442
+ });
2443
+ if (group === void 0) throw createError;
2444
+ adopted = true;
2445
+ }
2346
2446
  leftBehind = true;
2347
- createdGroupIdentity = userOrGroupIdentityToken(response.Group?.GroupId);
2348
- reportCreatedResource(logicalId, resourceType, groupName, createdGroupIdentity);
2447
+ createdGroupIdentity = userOrGroupIdentityToken(group?.GroupId);
2448
+ if (!adopted) reportCreatedResource(logicalId, resourceType, groupName, createdGroupIdentity);
2349
2449
  try {
2350
2450
  const managedPolicyArns = properties["ManagedPolicyArns"];
2351
2451
  if (managedPolicyArns && Array.isArray(managedPolicyArns)) for (const policyArn of managedPolicyArns) {
@@ -2366,7 +2466,7 @@ var IAMUserGroupProvider = class {
2366
2466
  log.debug(`Added inline policy ${v(policy.PolicyName)} to group ${v(groupName)}`);
2367
2467
  }
2368
2468
  } catch (innerError) {
2369
- try {
2469
+ if (!adopted) try {
2370
2470
  await this.detachAllGroupPolicies(groupName, log);
2371
2471
  await this.deleteAllGroupInlinePolicies(groupName, log);
2372
2472
  await this.iamClient.send(new DeleteGroupCommand({ GroupName: groupName }));
@@ -2383,7 +2483,7 @@ var IAMUserGroupProvider = class {
2383
2483
  log.debug(`Successfully created IAM group ${logicalId}: ${v(groupName)}`);
2384
2484
  return {
2385
2485
  physicalId: groupName,
2386
- attributes: { Arn: response.Group?.Arn }
2486
+ attributes: { Arn: group?.Arn }
2387
2487
  };
2388
2488
  } catch (error) {
2389
2489
  const cause = error instanceof Error ? error : void 0;
@@ -8334,6 +8434,26 @@ function withholdWaiterPayload(error, mask) {
8334
8434
  };
8335
8435
  }
8336
8436
  const LAMBDA_CLEANUP_DELETE_MAX_ATTEMPTS = 3;
8437
+ const LATEST_PUBLISHED = "$LATEST.PUBLISHED";
8438
+ function capacityProviderConfigForUpdate(config) {
8439
+ const managed = config?.LambdaManagedInstancesCapacityProviderConfig;
8440
+ if (managed === void 0) return config;
8441
+ return { LambdaManagedInstancesCapacityProviderConfig: {
8442
+ ...managed,
8443
+ ExecutionEnvironmentMemoryGiBPerVCpu: managed.ExecutionEnvironmentMemoryGiBPerVCpu ?? 2
8444
+ } };
8445
+ }
8446
+ function refuseManagedInstancesPropertiesWithoutCapacityProvider(logicalId, resourceType, properties, context, warn) {
8447
+ if (properties["CapacityProviderConfig"] !== void 0) return;
8448
+ const declared = [properties["PublishToLatestPublished"] !== void 0 ? "PublishToLatestPublished" : void 0, properties["FunctionScalingConfig"] !== void 0 ? "FunctionScalingConfig" : void 0].filter((key) => key !== void 0);
8449
+ if (declared.length === 0) return;
8450
+ const named = declared.join(" and ");
8451
+ if (context.replayingState === true) {
8452
+ warn(`Lambda function ${logicalId} records ${named} without CapacityProviderConfig; ignoring ${declared.length === 1 ? "it" : "them"} for this replay.`);
8453
+ return;
8454
+ }
8455
+ 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));
8456
+ }
8337
8457
  function refuseImageFunctionUnsupported(logicalId, resourceType, properties, physicalId) {
8338
8458
  if (properties["PackageType"] !== "Image") return;
8339
8459
  const declared = [properties["CodeSigningConfigArn"] !== void 0 ? "CodeSigningConfigArn" : void 0, properties["RuntimeManagementConfig"] !== void 0 ? "RuntimeManagementConfig" : void 0].filter((key) => key !== void 0);
@@ -8349,7 +8469,8 @@ const SEPARATELY_APPLIED_KEYS = /* @__PURE__ */ new Set([
8349
8469
  "ReservedConcurrentExecutions",
8350
8470
  "RecursiveLoop",
8351
8471
  "CodeSigningConfigArn",
8352
- "RuntimeManagementConfig"
8472
+ "RuntimeManagementConfig",
8473
+ "FunctionScalingConfig"
8353
8474
  ]);
8354
8475
  var LambdaFunctionProvider = class {
8355
8476
  lambdaClient;
@@ -8384,7 +8505,10 @@ var LambdaFunctionProvider = class {
8384
8505
  "CodeSigningConfigArn",
8385
8506
  "RuntimeManagementConfig",
8386
8507
  "DurableConfig",
8387
- "TenancyConfig"
8508
+ "TenancyConfig",
8509
+ "CapacityProviderConfig",
8510
+ "FunctionScalingConfig",
8511
+ "PublishToLatestPublished"
8388
8512
  ])]]);
8389
8513
  removalDefaults = /* @__PURE__ */ new Map([["AWS::Lambda::Function", /* @__PURE__ */ new Map([
8390
8514
  ["Timeout", 3],
@@ -8415,14 +8539,18 @@ var LambdaFunctionProvider = class {
8415
8539
  "VpcConfig",
8416
8540
  "ReservedConcurrentExecutions",
8417
8541
  "CodeSigningConfigArn",
8418
- "RuntimeManagementConfig"
8542
+ "RuntimeManagementConfig",
8543
+ "CapacityProviderConfig",
8544
+ "FunctionScalingConfig",
8545
+ "PublishToLatestPublished"
8419
8546
  ])]]);
8420
- unhandledByDesign = /* @__PURE__ */ new Map([["AWS::Lambda::Function", /* @__PURE__ */ new Map([["PublishToLatestPublished", "CloudFormation-only version-publishing directive with no AWS SDK equivalent"]])]]);
8421
8547
  cleanupDeleteRetryDelayMs = 2e3;
8422
8548
  eniWaitTimeoutMs = 6e5;
8423
8549
  eniWaitInitialDelayMs = 1e4;
8424
8550
  eniWaitMaxDelayMs = 1e4;
8425
8551
  functionUpdateMaxWaitSeconds = 600;
8552
+ latestPublishedPollMs = 3e3;
8553
+ latestPublishedDeadlineMarginMs = 15e3;
8426
8554
  eniInitialSleepMs = 1e4;
8427
8555
  eniDeleteRetryBudgetMs = 18e5;
8428
8556
  eniDeleteRetryIntervalMs = 15e3;
@@ -8442,12 +8570,14 @@ var LambdaFunctionProvider = class {
8442
8570
  if (!code) throw new ProvisioningError(`Code is required for Lambda function ${logicalId}`, resourceType, logicalId);
8443
8571
  if (!role) throw new ProvisioningError(`Role is required for Lambda function ${logicalId}`, resourceType, logicalId);
8444
8572
  refuseImageFunctionUnsupported(logicalId, resourceType, properties);
8573
+ refuseManagedInstancesPropertiesWithoutCapacityProvider(logicalId, resourceType, properties, { replayingState: context?.replayingState }, log.warn);
8445
8574
  let functionCreated = false;
8446
8575
  let createdFunctionName;
8447
8576
  let createdFunctionIdentity;
8448
8577
  const postCreateCleanup = { deleted: false };
8449
8578
  try {
8450
8579
  const tags = properties["Tags"] ? Object.fromEntries(desiredTags.map((tag) => [tag.Key, tag.Value])) : void 0;
8580
+ const capacityProviderConfig = properties["CapacityProviderConfig"];
8451
8581
  const createParams = {
8452
8582
  FunctionName: functionName,
8453
8583
  Role: role,
@@ -8473,13 +8603,48 @@ var LambdaFunctionProvider = class {
8473
8603
  DurableConfig: properties["DurableConfig"],
8474
8604
  TenancyConfig: properties["TenancyConfig"],
8475
8605
  CodeSigningConfigArn: properties["CodeSigningConfigArn"],
8476
- Tags: tags
8606
+ Tags: tags,
8607
+ ...capacityProviderConfig !== void 0 && {
8608
+ CapacityProviderConfig: capacityProviderConfig,
8609
+ Publish: true,
8610
+ PublishTo: "LATEST_PUBLISHED"
8611
+ }
8477
8612
  };
8478
8613
  const response = await (await this.createClient.get()).send(new CreateFunctionCommand(createParams));
8479
8614
  functionCreated = true;
8480
8615
  createdFunctionName = response.FunctionName || functionName;
8481
8616
  createdFunctionIdentity = functionIdentityToken(response.FunctionArn, response.LastModified);
8482
8617
  reportCreatedResource(logicalId, resourceType, createdFunctionName, createdFunctionIdentity);
8618
+ if (capacityProviderConfig !== void 0) {
8619
+ createdFunctionIdentity = void 0;
8620
+ reportCreatedResource(logicalId, resourceType, createdFunctionName);
8621
+ const target = {
8622
+ logicalId,
8623
+ resourceType,
8624
+ functionName
8625
+ };
8626
+ await this.applyPostCreateConfig(() => this.waitForLatestPublishedSettled(target, log, "after"), {
8627
+ apiName: "GetFunctionConfiguration",
8628
+ propertyName: "CapacityProviderConfig",
8629
+ logicalId,
8630
+ resourceType,
8631
+ functionName,
8632
+ log,
8633
+ cleanup: postCreateCleanup,
8634
+ awaitGone: capacityProviderConfig !== void 0
8635
+ });
8636
+ const functionScalingConfig = properties["FunctionScalingConfig"];
8637
+ if (functionScalingConfig !== void 0) await this.applyPostCreateConfig(() => this.putFunctionScalingConfig(target, log, functionScalingConfig), {
8638
+ apiName: "PutFunctionScalingConfig",
8639
+ propertyName: "FunctionScalingConfig",
8640
+ logicalId,
8641
+ resourceType,
8642
+ functionName,
8643
+ log,
8644
+ cleanup: postCreateCleanup,
8645
+ awaitGone: capacityProviderConfig !== void 0
8646
+ });
8647
+ }
8483
8648
  const recursiveLoop = properties["RecursiveLoop"];
8484
8649
  if (recursiveLoop !== void 0) await this.applyPostCreateConfig(() => this.lambdaClient.send(new PutFunctionRecursionConfigCommand({
8485
8650
  FunctionName: functionName,
@@ -8491,7 +8656,8 @@ var LambdaFunctionProvider = class {
8491
8656
  resourceType,
8492
8657
  functionName,
8493
8658
  log,
8494
- cleanup: postCreateCleanup
8659
+ cleanup: postCreateCleanup,
8660
+ awaitGone: capacityProviderConfig !== void 0
8495
8661
  });
8496
8662
  const reservedConcurrentExecutions = properties["ReservedConcurrentExecutions"];
8497
8663
  if (reservedConcurrentExecutions !== void 0) await this.applyPostCreateConfig(() => this.lambdaClient.send(new PutFunctionConcurrencyCommand({
@@ -8504,11 +8670,12 @@ var LambdaFunctionProvider = class {
8504
8670
  resourceType,
8505
8671
  functionName,
8506
8672
  log,
8507
- cleanup: postCreateCleanup
8673
+ cleanup: postCreateCleanup,
8674
+ awaitGone: capacityProviderConfig !== void 0
8508
8675
  });
8509
8676
  const runtimeManagementConfig = properties["RuntimeManagementConfig"];
8510
8677
  if (runtimeManagementConfig !== void 0) await this.applyPostCreateConfig(async () => {
8511
- await waitUntilFunctionActiveV2({
8678
+ if (capacityProviderConfig === void 0) await waitUntilFunctionActiveV2({
8512
8679
  client: this.lambdaClient,
8513
8680
  maxWaitTime: this.functionUpdateMaxWaitSeconds,
8514
8681
  minDelay: 1,
@@ -8524,7 +8691,8 @@ var LambdaFunctionProvider = class {
8524
8691
  resourceType,
8525
8692
  functionName,
8526
8693
  log,
8527
- cleanup: postCreateCleanup
8694
+ cleanup: postCreateCleanup,
8695
+ awaitGone: capacityProviderConfig !== void 0
8528
8696
  });
8529
8697
  log.debug(`Successfully created Lambda function ${logicalId}: ${log.value(functionName)}`);
8530
8698
  return {
@@ -8579,7 +8747,12 @@ var LambdaFunctionProvider = class {
8579
8747
  if (!/currently in the following state|ResourceConflict/i.test(deleteMessage)) break;
8580
8748
  if (attempt < 2) await new Promise((resolve) => setTimeout(resolve, this.cleanupDeleteRetryDelayMs * (attempt + 1)));
8581
8749
  }
8582
- if (cleanupFailure === void 0) ctx.cleanup.deleted = true;
8750
+ if (cleanupFailure === void 0) {
8751
+ ctx.cleanup.deleted = true;
8752
+ if (ctx.awaitGone) await this.waitForFunctionGone(ctx, log).catch((goneError) => {
8753
+ log.warn(describeAwsFailure(goneError).summary);
8754
+ });
8755
+ }
8583
8756
  if (cleanupFailure !== void 0) {
8584
8757
  const cleanupHead = `Cleanup DeleteFunction failed for ${ctx.logicalId} after ${ctx.apiName} failure — function may be orphaned: `;
8585
8758
  if (cleanupFailure.redacted) this.logger.debug(log.mask(`${cleanupHead}${cleanupFailure.detail}`));
@@ -8597,6 +8770,42 @@ var LambdaFunctionProvider = class {
8597
8770
  RuntimeVersionArn: config["RuntimeVersionArn"]
8598
8771
  }));
8599
8772
  }
8773
+ async waitForLatestPublishedSettled(target, log, phase) {
8774
+ const { logicalId, resourceType, functionName } = target;
8775
+ const budgetMs = Math.min(this.functionUpdateMaxWaitSeconds * 1e3, enclosingDeadlineRemainingMs() - this.latestPublishedDeadlineMarginMs);
8776
+ const deadline = Date.now() + budgetMs;
8777
+ for (;;) {
8778
+ const cfg = await this.lambdaClient.send(new GetFunctionConfigurationCommand({
8779
+ FunctionName: functionName,
8780
+ Qualifier: LATEST_PUBLISHED
8781
+ }));
8782
+ if (phase === "after" && (cfg.State === "Failed" || cfg.LastUpdateStatus === "Failed")) throw this.wrapStatusReasonError(target, log, cfg);
8783
+ if (!(cfg.State === "Pending" || cfg.State === "Deactivating" || cfg.LastUpdateStatus === "InProgress")) return;
8784
+ 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);
8785
+ await new Promise((resolve) => setTimeout(resolve, this.latestPublishedPollMs));
8786
+ }
8787
+ }
8788
+ wrapStatusReasonError(target, log, cfg) {
8789
+ const { logicalId, resourceType, functionName } = target;
8790
+ const head = `Lambda function ${logicalId}: ${LATEST_PUBLISHED} failed: `;
8791
+ const text = describeAwsStatusReason({
8792
+ code: cfg.StateReasonCode ?? cfg.LastUpdateStatusReasonCode,
8793
+ message: cfg.StateReason ?? cfg.LastUpdateStatusReason
8794
+ }, "no reason given");
8795
+ const build = (detail, cause) => new ProvisioningError(`${head}${log.mask(detail)}`, resourceType, logicalId, functionName, cause);
8796
+ if (!text.redacted) return build(text.summary);
8797
+ log.debug(log.mask(`${head}${text.detail}`));
8798
+ return markRedactedCause(build(text.summary, new Error(text.detail)));
8799
+ }
8800
+ async putFunctionScalingConfig(target, log, config) {
8801
+ await this.waitForLatestPublishedSettled(target, log, "before");
8802
+ await this.lambdaClient.send(new PutFunctionScalingConfigCommand({
8803
+ FunctionName: target.functionName,
8804
+ Qualifier: LATEST_PUBLISHED,
8805
+ FunctionScalingConfig: config ?? {}
8806
+ }));
8807
+ await this.waitForLatestPublishedSettled(target, log, "after");
8808
+ }
8600
8809
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
8601
8810
  const markUnsettled = (key) => context?.markUnsettled?.(key);
8602
8811
  properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
@@ -8605,7 +8814,17 @@ var LambdaFunctionProvider = class {
8605
8814
  log.debug(`Updating Lambda function ${logicalId}: ${log.value(physicalId)}`);
8606
8815
  refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
8607
8816
  refuseImageFunctionUnsupported(logicalId, resourceType, properties, physicalId);
8608
- try {
8817
+ refuseManagedInstancesPropertiesWithoutCapacityProvider(logicalId, resourceType, properties, {
8818
+ replayingState: context?.replayingState,
8819
+ physicalId
8820
+ }, log.warn);
8821
+ try {
8822
+ const desiredCapacity = properties["CapacityProviderConfig"];
8823
+ const recordedCapacity = previousProperties["CapacityProviderConfig"];
8824
+ const liveManaged = desiredCapacity !== void 0 || recordedCapacity !== void 0 ? (await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: physicalId }))).Configuration?.CapacityProviderConfig !== void 0 : false;
8825
+ 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));
8826
+ const capacityNeverApplied = !liveManaged && desiredCapacity !== void 0 && recordedCapacity !== void 0;
8827
+ 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
8828
  const configFields = [
8610
8829
  "Role",
8611
8830
  "Handler",
@@ -8624,10 +8843,14 @@ var LambdaFunctionProvider = class {
8624
8843
  "ImageConfig",
8625
8844
  "SnapStart",
8626
8845
  "LoggingConfig",
8627
- "DurableConfig"
8846
+ "DurableConfig",
8847
+ "CapacityProviderConfig"
8628
8848
  ];
8629
8849
  const changedConfigFields = [];
8630
- for (const field of configFields) if (JSON.stringify(properties[field]) !== JSON.stringify(previousProperties[field])) changedConfigFields.push(field);
8850
+ for (const field of configFields) {
8851
+ if (field === "CapacityProviderConfig" && capacityNeverApplied) continue;
8852
+ if (JSON.stringify(properties[field]) !== JSON.stringify(previousProperties[field])) changedConfigFields.push(field);
8853
+ }
8631
8854
  if (changedConfigFields.length > 0) {
8632
8855
  const configParams = {
8633
8856
  FunctionName: physicalId,
@@ -8648,7 +8871,8 @@ var LambdaFunctionProvider = class {
8648
8871
  ImageConfig: properties["ImageConfig"],
8649
8872
  SnapStart: properties["SnapStart"],
8650
8873
  LoggingConfig: properties["LoggingConfig"],
8651
- DurableConfig: properties["DurableConfig"]
8874
+ DurableConfig: properties["DurableConfig"],
8875
+ CapacityProviderConfig: capacityProviderConfigForUpdate(capacityNeverApplied ? void 0 : desiredCapacity)
8652
8876
  };
8653
8877
  for (const field of changedConfigFields) markUnsettled(field);
8654
8878
  await this.lambdaClient.send(new UpdateFunctionConfigurationCommand(configParams));
@@ -8724,6 +8948,31 @@ var LambdaFunctionProvider = class {
8724
8948
  await this.putRuntimeManagementConfig(physicalId, newRuntimeManagementConfig ?? { UpdateRuntimeOn: "Auto" });
8725
8949
  log.debug(`Updated RuntimeManagementConfig for Lambda function ${log.value(physicalId)} to ${JSON.stringify(maskDeep(newRuntimeManagementConfig ?? { UpdateRuntimeOn: "Auto" }, operationMask))}`);
8726
8950
  }
8951
+ if (liveManaged && desiredCapacity !== void 0) {
8952
+ const target = {
8953
+ logicalId,
8954
+ resourceType,
8955
+ functionName: physicalId
8956
+ };
8957
+ const newScaling = properties["FunctionScalingConfig"];
8958
+ const prevScaling = previousProperties["FunctionScalingConfig"];
8959
+ const applyScaling = newScaling?.MinExecutionEnvironments !== prevScaling?.MinExecutionEnvironments || newScaling?.MaxExecutionEnvironments !== prevScaling?.MaxExecutionEnvironments || context?.unsettledProperties?.has("FunctionScalingConfig") === true;
8960
+ if (properties["PublishToLatestPublished"] !== false) {
8961
+ await this.waitForLatestPublishedSettled(target, log, "before");
8962
+ await this.lambdaClient.send(new PublishVersionCommand({
8963
+ FunctionName: physicalId,
8964
+ Description: properties["Description"],
8965
+ PublishTo: "LATEST_PUBLISHED"
8966
+ }));
8967
+ await this.waitForLatestPublishedSettled(target, log, "after");
8968
+ log.debug(`Published ${LATEST_PUBLISHED} of ${log.value(physicalId)}`);
8969
+ }
8970
+ if (applyScaling) {
8971
+ markUnsettled("FunctionScalingConfig");
8972
+ await this.putFunctionScalingConfig(target, log, newScaling);
8973
+ log.debug(`Updated FunctionScalingConfig of ${log.value(physicalId)}`);
8974
+ }
8975
+ }
8727
8976
  const getResponse = await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: physicalId }));
8728
8977
  const functionArn = getResponse.Configuration?.FunctionArn;
8729
8978
  await this.applyTagDiff(functionArn, physicalId, resourceType, logicalId, previousProperties["Tags"], properties["Tags"], log, {
@@ -8787,6 +9036,32 @@ var LambdaFunctionProvider = class {
8787
9036
  throw stripped ? markDeleteStarted(failure) : failure;
8788
9037
  }
8789
9038
  if (hasVpcConfig) await this.cleanupLambdaEnis(physicalId, Date.now() + enclosingDeadlineRemainingMs() - this.eniDeadlineMarginMs);
9039
+ if (properties?.["CapacityProviderConfig"] !== void 0) await this.waitForFunctionGone({
9040
+ logicalId,
9041
+ resourceType,
9042
+ functionName: physicalId
9043
+ }, createMaskedLogSinks(this.logger, context?.maskSecrets));
9044
+ }
9045
+ async waitForFunctionGone(target, log) {
9046
+ const { logicalId, resourceType, functionName } = target;
9047
+ const deadline = Date.now() + Math.min(this.functionUpdateMaxWaitSeconds * 1e3, enclosingDeadlineRemainingMs() - this.latestPublishedDeadlineMarginMs);
9048
+ for (;;) {
9049
+ try {
9050
+ await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: functionName }));
9051
+ } catch (error) {
9052
+ if (error instanceof ResourceNotFoundException) return;
9053
+ const failure = describeAwsFailure(error);
9054
+ log.debug(log.mask(`Waiting for Lambda function ${logicalId} to go: ${failure.detail}`));
9055
+ log.warn(`Waiting for Lambda function ${logicalId} to go failed: ${failure.summary}`);
9056
+ return;
9057
+ }
9058
+ if (Date.now() >= deadline) {
9059
+ const stillDeleting = new ProvisioningError(`Lambda function ${logicalId} is still being deleted`, resourceType, logicalId, functionName);
9060
+ markDeleteStarted(stillDeleting);
9061
+ throw stillDeleting;
9062
+ }
9063
+ await new Promise((resolve) => setTimeout(resolve, this.latestPublishedPollMs));
9064
+ }
8790
9065
  }
8791
9066
  buildVpcConfig(raw) {
8792
9067
  if (raw === void 0 || raw === null) return;
@@ -9092,6 +9367,13 @@ var LambdaFunctionProvider = class {
9092
9367
  });
9093
9368
  }
9094
9369
  if (names.has("CodeSigningConfigArn")) set("CodeSigningConfigArn", (await strict(() => this.lambdaClient.send(new GetFunctionCodeSigningConfigCommand({ FunctionName: physicalId }))))?.CodeSigningConfigArn);
9370
+ if (names.has("FunctionScalingConfig")) {
9371
+ const r = await strict(() => this.lambdaClient.send(new GetFunctionScalingConfigCommand({
9372
+ FunctionName: physicalId,
9373
+ Qualifier: LATEST_PUBLISHED
9374
+ })));
9375
+ set("FunctionScalingConfig", r?.RequestedFunctionScalingConfig ?? r?.AppliedFunctionScalingConfig);
9376
+ }
9095
9377
  return out;
9096
9378
  }
9097
9379
  async unsettledInTransition(physicalId, _logicalId, _resourceType, names) {
@@ -9157,6 +9439,19 @@ var LambdaFunctionProvider = class {
9157
9439
  if (Object.keys(dc).length > 0) result["DurableConfig"] = dc;
9158
9440
  }
9159
9441
  if (cfg.TenancyConfig?.TenantIsolationMode !== void 0) result["TenancyConfig"] = { TenantIsolationMode: cfg.TenancyConfig.TenantIsolationMode };
9442
+ if (cfg.CapacityProviderConfig !== void 0) {
9443
+ result["CapacityProviderConfig"] = cfg.CapacityProviderConfig;
9444
+ try {
9445
+ const scaling = await this.lambdaClient.send(new GetFunctionScalingConfigCommand({
9446
+ FunctionName: physicalId,
9447
+ Qualifier: LATEST_PUBLISHED
9448
+ }));
9449
+ const live = scaling.RequestedFunctionScalingConfig ?? scaling.AppliedFunctionScalingConfig;
9450
+ if (live !== void 0) result["FunctionScalingConfig"] = live;
9451
+ } catch (scalingErr) {
9452
+ 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}`);
9453
+ }
9454
+ }
9160
9455
  result["Tags"] = normalizeAwsTagsToCfn(resp.Tags);
9161
9456
  try {
9162
9457
  const rlResp = await this.lambdaClient.send(new GetFunctionRecursionConfigCommand({ FunctionName: physicalId }));
@@ -9201,7 +9496,8 @@ var LambdaFunctionProvider = class {
9201
9496
  "Code.S3ObjectVersion",
9202
9497
  "Code.S3ObjectStorageMode",
9203
9498
  "Code.ZipFile",
9204
- "Code.SourceKMSKeyArn"
9499
+ "Code.SourceKMSKeyArn",
9500
+ "PublishToLatestPublished"
9205
9501
  ];
9206
9502
  }
9207
9503
  async import(input) {
@@ -32658,6 +32954,10 @@ const VPCS_KEPT_ON_REMOVAL_NOTE = "A private hosted zone stays private and keeps
32658
32954
  function declaresNoVpcs(vpcs) {
32659
32955
  return vpcs == null || Array.isArray(vpcs) && vpcs.length === 0;
32660
32956
  }
32957
+ function declaredVpcIds(vpcs) {
32958
+ if (!Array.isArray(vpcs)) return [];
32959
+ return vpcs.map((vpc) => vpc?.["VPCId"]);
32960
+ }
32661
32961
  function sentence$1(text) {
32662
32962
  return text.endsWith(".") ? text : `${text}.`;
32663
32963
  }
@@ -32824,7 +33124,7 @@ var Route53Provider = class {
32824
33124
  }));
32825
33125
  }
32826
33126
  await this.applyHostedZoneTags(zoneId, properties, logicalId, void 0, mask);
32827
- await this.applyQueryLoggingConfig(zoneId, properties, logicalId);
33127
+ await this.applyQueryLoggingConfig(zoneId, properties, logicalId, void 0, mask);
32828
33128
  if (declaresAcceleratedRecovery(properties)) {
32829
33129
  try {
32830
33130
  await this.getClient().send(new UpdateHostedZoneFeaturesCommand({
@@ -32924,8 +33224,8 @@ var Route53Provider = class {
32924
33224
  Comment: comment
32925
33225
  }));
32926
33226
  await this.applyHostedZoneTags(physicalId, properties, logicalId, previousProperties, mask);
32927
- await this.applyQueryLoggingConfig(physicalId, properties, logicalId, previousProperties);
32928
- await this.syncVPCAssociations(physicalId, properties, logicalId);
33227
+ await this.applyQueryLoggingConfig(physicalId, properties, logicalId, previousProperties, mask, context?.markUnsettled);
33228
+ await this.syncVPCAssociations(physicalId, properties, logicalId, previousProperties, mask, context);
32929
33229
  const prevEnabled = declaresAcceleratedRecovery(previousProperties, true);
32930
33230
  const nextEnabled = declaresAcceleratedRecovery(properties, context?.desiredFromAwsReadback === true);
32931
33231
  if (prevEnabled !== nextEnabled) {
@@ -32937,7 +33237,7 @@ var Route53Provider = class {
32937
33237
  }
32938
33238
  const nameServers = (await this.getClient().send(new GetHostedZoneCommand({ Id: physicalId }))).DelegationSet?.NameServers ?? [];
32939
33239
  this.logger.debug(`Successfully updated hosted zone ${logicalId}`);
32940
- if (context?.desiredFromAwsReadback !== true && declaresNoVpcs(properties["VPCs"]) && Array.isArray(previousProperties["VPCs"]) && previousProperties["VPCs"].length > 0) this.logger.warn(context?.replayingState ? safeMsg`${logicalId} (AWS::Route53::HostedZone): VPCs is absent from the state being restored, so the rollback leaves the zone's VPC associations in place. ${VPCS_KEPT_ON_REMOVAL_NOTE}` : safeMsg`${logicalId} (AWS::Route53::HostedZone): VPCs was removed from the template, and the zone keeps its current VPC associations, as CloudFormation leaves them. ${VPCS_KEPT_ON_REMOVAL_NOTE}`);
33240
+ if (context?.desiredFromAwsReadback !== true && declaresNoVpcs(properties["VPCs"]) && (Array.isArray(previousProperties["VPCs"]) && previousProperties["VPCs"].length > 0 || context?.unsettledProperties?.has("VPCs") === true)) this.logger.warn(context?.replayingState ? safeMsg`${logicalId} (AWS::Route53::HostedZone): VPCs is absent from the state being restored, so the rollback leaves the zone's VPC associations in place. ${VPCS_KEPT_ON_REMOVAL_NOTE}` : safeMsg`${logicalId} (AWS::Route53::HostedZone): VPCs was removed from the template, and the zone keeps its current VPC associations, as CloudFormation leaves them. ${VPCS_KEPT_ON_REMOVAL_NOTE}`);
32941
33241
  return {
32942
33242
  physicalId,
32943
33243
  wasReplaced: false,
@@ -33343,7 +33643,7 @@ var Route53Provider = class {
33343
33643
  return typeof entry.Key === "string" && typeof entry.Value === "string";
33344
33644
  });
33345
33645
  }
33346
- async applyQueryLoggingConfig(zoneId, properties, logicalId, previousProperties) {
33646
+ async applyQueryLoggingConfig(zoneId, properties, logicalId, previousProperties, mask, markUnsettled) {
33347
33647
  const cloudWatchLogsLogGroupArn = this.readQueryLogGroupArn(properties);
33348
33648
  const desiredBlock = properties["QueryLoggingConfig"];
33349
33649
  const desiredBlockIsObject = typeof desiredBlock === "object" && desiredBlock !== null && !Array.isArray(desiredBlock);
@@ -33355,13 +33655,16 @@ var Route53Provider = class {
33355
33655
  if (cloudWatchLogsLogGroupArn === void 0) {
33356
33656
  if (previousProperties !== void 0 && this.readQueryLogGroupArn(previousProperties)) {
33357
33657
  this.logger.debug(`QueryLoggingConfig removed from template for hosted zone ${logicalId}; deleting the live config`);
33658
+ markUnsettled?.("QueryLoggingConfig");
33358
33659
  await this.deleteQueryLoggingConfigForZone(zoneId, logicalId);
33359
33660
  const remaining = await this.listQueryLoggingConfigIds(zoneId);
33360
33661
  if (remaining.length > 0) throw new ProvisioningError(`QueryLoggingConfig was removed from the template for hosted zone ${logicalId} but the live config (${remaining.join(", ")}) is still present. The removal will NOT be retried on the next deploy (state no longer records the property), so it is reported instead of ignored.`, "AWS::Route53::HostedZone", logicalId, zoneId);
33361
33662
  }
33362
33663
  return;
33363
33664
  }
33665
+ if (previousProperties !== void 0 && this.readQueryLogGroupArn(previousProperties) === cloudWatchLogsLogGroupArn) return;
33364
33666
  try {
33667
+ markUnsettled?.("QueryLoggingConfig");
33365
33668
  await this.deleteQueryLoggingConfigForZone(zoneId, logicalId);
33366
33669
  await this.getClient().send(new CreateQueryLoggingConfigCommand({
33367
33670
  HostedZoneId: zoneId,
@@ -33369,11 +33672,12 @@ var Route53Provider = class {
33369
33672
  }));
33370
33673
  this.logger.debug(`Applied query logging config to hosted zone ${logicalId}`);
33371
33674
  } catch (error) {
33372
- if (error instanceof Error && error.name === "QueryLoggingConfigAlreadyExists") {
33675
+ if (previousProperties === void 0 && error instanceof Error && error.name === "QueryLoggingConfigAlreadyExists") {
33373
33676
  this.logger.debug(`Query logging config already exists for hosted zone ${logicalId}`);
33374
33677
  return;
33375
33678
  }
33376
- this.logger.warn(`Failed to apply query logging config to hosted zone ${logicalId}: ${describeAwsFailure(error).detail}`);
33679
+ const cause = error instanceof Error ? error : void 0;
33680
+ throw this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to apply query logging config to hosted zone ${logicalId}: ${text}`, "AWS::Route53::HostedZone", logicalId, zoneId, cause));
33377
33681
  }
33378
33682
  }
33379
33683
  readQueryLogGroupArn(properties) {
@@ -33409,7 +33713,7 @@ var Route53Provider = class {
33409
33713
  this.logger.warn(`Failed to delete query logging config for hosted zone ${logicalId}: ${describeAwsFailure(error).detail}`);
33410
33714
  }
33411
33715
  }
33412
- async syncVPCAssociations(zoneId, properties, logicalId) {
33716
+ async syncVPCAssociations(zoneId, properties, logicalId, previousProperties, mask, marks) {
33413
33717
  const desiredVpcs = properties["VPCs"];
33414
33718
  if (!desiredVpcs || desiredVpcs.length === 0) return;
33415
33719
  try {
@@ -33420,6 +33724,7 @@ var Route53Provider = class {
33420
33724
  const vpcId = vpc["VPCId"];
33421
33725
  if (!currentVpcIds.has(vpcId)) {
33422
33726
  this.logger.debug(`Associating VPC ${vpcId} with hosted zone ${zoneId}`);
33727
+ marks?.markUnsettled?.("VPCs");
33423
33728
  await this.getClient().send(new AssociateVPCWithHostedZoneCommand({
33424
33729
  HostedZoneId: zoneId,
33425
33730
  VPC: {
@@ -33427,14 +33732,14 @@ var Route53Provider = class {
33427
33732
  VPCRegion: vpc["VPCRegion"]
33428
33733
  }
33429
33734
  }));
33735
+ marks?.markAttempted?.("VPCs", [vpcId]);
33736
+ currentVpcIds.add(vpcId);
33430
33737
  }
33431
33738
  }
33432
- for (const vpc of currentVpcs) if (vpc.VPCId && !desiredVpcIds.has(vpc.VPCId)) {
33433
- if (currentVpcs.length <= 1) {
33434
- this.logger.warn(`Cannot disassociate last VPC ${vpc.VPCId} from hosted zone ${logicalId}`);
33435
- continue;
33436
- }
33739
+ const previousVpcIds = new Set(declaredVpcIds(previousProperties["VPCs"]));
33740
+ for (const vpc of currentVpcs) if (vpc.VPCId && previousVpcIds.has(vpc.VPCId) && !desiredVpcIds.has(vpc.VPCId)) {
33437
33741
  this.logger.debug(`Disassociating VPC ${vpc.VPCId} from hosted zone ${zoneId}`);
33742
+ marks?.markUnsettled?.("VPCs");
33438
33743
  await this.getClient().send(new DisassociateVPCFromHostedZoneCommand({
33439
33744
  HostedZoneId: zoneId,
33440
33745
  VPC: {
@@ -33444,7 +33749,8 @@ var Route53Provider = class {
33444
33749
  }));
33445
33750
  }
33446
33751
  } catch (error) {
33447
- this.logger.warn(`Failed to sync VPC associations for hosted zone ${logicalId}: ${describeAwsFailure(error).detail}`);
33752
+ const cause = error instanceof Error ? error : void 0;
33753
+ throw this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to sync VPC associations for hosted zone ${logicalId}: ${text}`, "AWS::Route53::HostedZone", logicalId, zoneId, cause));
33448
33754
  }
33449
33755
  }
33450
33756
  async resolveHostedZoneId(properties, logicalId, resourceType, physicalId, options) {
@@ -33522,7 +33828,27 @@ var Route53Provider = class {
33522
33828
  default: return;
33523
33829
  }
33524
33830
  }
33525
- async readHostedZone(physicalId, properties) {
33831
+ async readUnsettled(physicalId, logicalId, resourceType, names, recordedProperties, desiredProperties, attemptedItems) {
33832
+ if (resourceType !== "AWS::Route53::HostedZone") return this.readCurrentState(physicalId, logicalId, resourceType, recordedProperties);
33833
+ const live = await this.readHostedZone(physicalId, recordedProperties, names.has("QueryLoggingConfig"));
33834
+ if (live === void 0 || live === RESOURCE_NOT_FOUND) return live;
33835
+ if (!names.has("VPCs") || !Array.isArray(live["VPCs"])) return live;
33836
+ const { VPCs: liveVpcs, ...rest } = live;
33837
+ if (declaresNoVpcs(desiredProperties?.["VPCs"])) return rest;
33838
+ const named = /* @__PURE__ */ new Set([
33839
+ ...declaredVpcIds(recordedProperties?.["VPCs"]),
33840
+ ...declaredVpcIds(desiredProperties?.["VPCs"]),
33841
+ ...[...attemptedItems?.get("VPCs") ?? []].filter(isUsableAttemptedName)
33842
+ ]);
33843
+ return {
33844
+ ...rest,
33845
+ VPCs: liveVpcs.filter((vpc) => named.has(vpc["VPCId"]))
33846
+ };
33847
+ }
33848
+ getDriftUnorderedPaths(resourceType) {
33849
+ return resourceType === "AWS::Route53::HostedZone" ? ["VPCs"] : [];
33850
+ }
33851
+ async readHostedZone(physicalId, properties, throwOnFailedQueryLoggingRead = false) {
33526
33852
  let resp;
33527
33853
  try {
33528
33854
  resp = await this.getClient().send(new GetHostedZoneCommand({ Id: physicalId }));
@@ -33566,6 +33892,7 @@ var Route53Provider = class {
33566
33892
  else result["QueryLoggingConfig"] = {};
33567
33893
  } catch (err) {
33568
33894
  this.logger.debug(`Route53 ListQueryLoggingConfigs(${idTail}) failed: ${describeAwsFailure(err).detail}`);
33895
+ if (throwOnFailedQueryLoggingRead) throw err;
33569
33896
  result["QueryLoggingConfig"] = {};
33570
33897
  }
33571
33898
  return result;
@@ -54718,4 +55045,4 @@ var ACMCertificateProvider = class {
54718
55045
  };
54719
55046
 
54720
55047
  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 };
54721
- //# sourceMappingURL=provider-classes-DGFOKPO9.js.map
55048
+ //# sourceMappingURL=provider-classes-DOr3JVGp.js.map