@cdkd/cli 0.373.4 → 0.373.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/{ambient-client-defaults-DtG0A5aG.js → ambient-client-defaults-BqOg0I6e.js} +3 -3
  2. package/dist/{ambient-client-defaults-DtG0A5aG.js.map → ambient-client-defaults-BqOg0I6e.js.map} +1 -1
  3. package/dist/{asg-provider-BmCui3zx.js → asg-provider-DkhAcikX.js} +31 -14
  4. package/dist/{asg-provider-BmCui3zx.js.map → asg-provider-DkhAcikX.js.map} +1 -1
  5. package/dist/cli.js +3 -3
  6. package/dist/{custom-resource-runtime-pm6t9jBv.js → custom-resource-runtime-CLjuWVBC.js} +6 -6
  7. package/dist/{custom-resource-runtime-pm6t9jBv.js.map → custom-resource-runtime-CLjuWVBC.js.map} +1 -1
  8. package/dist/{db-associated-roles-C607MnbC.js → db-associated-roles-CCgL0Loo.js} +2 -2
  9. package/dist/{db-associated-roles-C607MnbC.js.map → db-associated-roles-CCgL0Loo.js.map} +1 -1
  10. package/dist/{delete-started-C_hilY_A.js → delete-started-C9z4Yf_c.js} +4 -4
  11. package/dist/{delete-started-C_hilY_A.js.map → delete-started-C9z4Yf_c.js.map} +1 -1
  12. package/dist/{deploy-engine-BEzzfllj.js → deploy-engine-DNEAZMj7.js} +828 -320
  13. package/dist/deploy-engine-DNEAZMj7.js.map +1 -0
  14. package/dist/{ec2-termination-protection-BeYoGs66.js → ec2-termination-protection-zaan5pi0.js} +3 -3
  15. package/dist/{ec2-termination-protection-BeYoGs66.js.map → ec2-termination-protection-zaan5pi0.js.map} +1 -1
  16. package/dist/{ecr-uri-DcNB-WSe.js → ecr-uri-CrQgKKRC.js} +2 -2
  17. package/dist/{ecr-uri-DcNB-WSe.js.map → ecr-uri-CrQgKKRC.js.map} +1 -1
  18. package/dist/{emr-cluster-provider-TaiGpHEX.js → emr-cluster-provider-Dkg4vDao.js} +80 -16
  19. package/dist/emr-cluster-provider-Dkg4vDao.js.map +1 -0
  20. package/dist/{expected-bucket-owner-DASdeJRs.js → expected-bucket-owner-DIMD36_h.js} +2 -2
  21. package/dist/{expected-bucket-owner-DASdeJRs.js.map → expected-bucket-owner-DIMD36_h.js.map} +1 -1
  22. package/dist/{iam-role-provider-ob3lrDNI.js → iam-role-provider-CkIQ7vmu.js} +12 -12
  23. package/dist/{iam-role-provider-ob3lrDNI.js.map → iam-role-provider-CkIQ7vmu.js.map} +1 -1
  24. package/dist/{identity-read-denied-CGR1hIyA.js → identity-read-denied-DU0YqxNk.js} +4 -4
  25. package/dist/{identity-read-denied-CGR1hIyA.js.map → identity-read-denied-DU0YqxNk.js.map} +1 -1
  26. package/dist/{image-plan-BWFMyIRS.js → image-plan-B1CAuiek.js} +10 -10
  27. package/dist/{image-plan-BWFMyIRS.js.map → image-plan-B1CAuiek.js.map} +1 -1
  28. package/dist/index.d.ts +19 -3
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +5 -5
  31. package/dist/{logger-8a4raAC-.js → logger-IjQ12QWZ.js} +2 -2
  32. package/dist/{logger-8a4raAC-.js.map → logger-IjQ12QWZ.js.map} +1 -1
  33. package/dist/{neptune-provider-C8fiHA_U.js → neptune-provider-2O6bzLTH.js} +9 -9
  34. package/dist/{neptune-provider-C8fiHA_U.js.map → neptune-provider-2O6bzLTH.js.map} +1 -1
  35. package/dist/{program-BCit4cJS.js → program-DnMYJ4--.js} +613 -143
  36. package/dist/program-DnMYJ4--.js.map +1 -0
  37. package/dist/{provider-classes-BydpQUFi.js → provider-classes-BuCH49t_.js} +647 -139
  38. package/dist/provider-classes-BuCH49t_.js.map +1 -0
  39. package/dist/{rds-provider-Dv0lcb0m.js → rds-provider-BSeLwUR8.js} +13 -13
  40. package/dist/{rds-provider-Dv0lcb0m.js.map → rds-provider-BSeLwUR8.js.map} +1 -1
  41. package/dist/{read-replica-BQ87f_Oe.js → read-replica-FMRYAHg6.js} +3 -3
  42. package/dist/{read-replica-BQ87f_Oe.js.map → read-replica-FMRYAHg6.js.map} +1 -1
  43. package/dist/{redacted-delete-address-BrPnoyD9.js → redacted-delete-address-DGHv9GNm.js} +4 -4
  44. package/dist/{redacted-delete-address-BrPnoyD9.js.map → redacted-delete-address-DGHv9GNm.js.map} +1 -1
  45. package/dist/{replacement-rules-HtPsWZIV.js → replacement-rules-BAJWgr5f.js} +144 -53
  46. package/dist/replacement-rules-BAJWgr5f.js.map +1 -0
  47. package/dist/{created-resource-sink-DVzNDZ-N.js → resource-deadline-DB1HaWnD.js} +115 -5
  48. package/dist/resource-deadline-DB1HaWnD.js.map +1 -0
  49. package/dist/{restore-source-guard-BIaZBr57.js → restore-source-guard-BL2O_O6r.js} +4 -4
  50. package/dist/{restore-source-guard-BIaZBr57.js.map → restore-source-guard-BL2O_O6r.js.map} +1 -1
  51. package/dist/{run-cli-OPPhPXxz.js → run-cli-CtrPRsbm.js} +2 -2
  52. package/dist/{run-cli-OPPhPXxz.js.map → run-cli-CtrPRsbm.js.map} +1 -1
  53. package/dist/{secret-reference-immutable-OIvSuvpM.js → secret-reference-immutable-XFEdCfNg.js} +6 -6
  54. package/dist/{secret-reference-immutable-OIvSuvpM.js.map → secret-reference-immutable-XFEdCfNg.js.map} +1 -1
  55. package/dist/{settle-own-write-members-fY5JNYhA.js → settle-own-write-members-DzUentwR.js} +10 -10
  56. package/dist/{settle-own-write-members-fY5JNYhA.js.map → settle-own-write-members-DzUentwR.js.map} +1 -1
  57. package/dist/{tag-list-CmpwQ18R.js → tag-list-Bye2zxAF.js} +4 -4
  58. package/dist/{tag-list-CmpwQ18R.js.map → tag-list-Bye2zxAF.js.map} +1 -1
  59. package/dist/update-removal-BpxPxmQR.js +82 -0
  60. package/dist/update-removal-BpxPxmQR.js.map +1 -0
  61. package/dist/{version-DwQIlsjN.js → version-nXXjUmZl.js} +2 -2
  62. package/dist/{version-DwQIlsjN.js.map → version-nXXjUmZl.js.map} +1 -1
  63. package/package.json +1 -1
  64. package/dist/created-resource-sink-DVzNDZ-N.js.map +0 -1
  65. package/dist/deploy-engine-BEzzfllj.js.map +0 -1
  66. package/dist/emr-cluster-provider-TaiGpHEX.js.map +0 -1
  67. package/dist/program-BCit4cJS.js.map +0 -1
  68. package/dist/provider-classes-BydpQUFi.js.map +0 -1
  69. package/dist/replacement-rules-HtPsWZIV.js.map +0 -1
  70. package/dist/resource-deadline-nSheE7zd.js +0 -186
  71. package/dist/resource-deadline-nSheE7zd.js.map +0 -1
@@ -1,27 +1,27 @@
1
- import { _ as verifyOwnIdentityBeforeUpdate, a as stackOwnHolders, b as isEntityAlreadyExists, c as clearOwnWriteRemovals, d as takeOwnWriteRemovals, f as InlinePolicyPrincipalMismatchError, g as verifyInlinePolicyPrincipals, h as compareMembershipWrites, i as isStackOwnHolder, l as recordOwnWriteRemoval, m as assertInlinePolicyAttachTargets, n as collectInlinePolicyNamesManagedBySiblings, o as planInlinePolicyNames, p as MANAGED_POLICY_OWNER, r as heldText, s as sameInlinePolicyName, t as IAMRoleProvider, u as restoreOwnWriteRemovals, v as deferIamPropagationSettle, x as IamCreateClientCache, y as iamEntityLeftByThisCreate } from "./iam-role-provider-ob3lrDNI.js";
2
- import { A as configStringRefusal, B as generateResourceName, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, J as getCurrentStackName, M as replayWarn, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, U as recordedGeneratedNameKept, V as generateResourceNameWithFallback, Y as isBeforeStateRead, c as VERBOSE_POINTER, d as describeAwsStatusReason, f as isAwsAuthoredFailure, g as verbosePointerTail, h as verbosePointerSentence, j as readConfigString, k as configIntegerRefusal, m as verboseAwareText, n as getLogger, p as safeStringify, q as getCurrentStackInstanceId, u as describeAwsFailure, w as generatedNameFor } from "./logger-8a4raAC-.js";
1
+ import { _ as verifyOwnIdentityBeforeUpdate, a as stackOwnHolders, b as isEntityAlreadyExists, c as clearOwnWriteRemovals, d as takeOwnWriteRemovals, f as InlinePolicyPrincipalMismatchError, g as verifyInlinePolicyPrincipals, h as compareMembershipWrites, i as isStackOwnHolder, l as recordOwnWriteRemoval, m as assertInlinePolicyAttachTargets, n as collectInlinePolicyNamesManagedBySiblings, o as planInlinePolicyNames, p as MANAGED_POLICY_OWNER, r as heldText, s as sameInlinePolicyName, t as IAMRoleProvider, u as restoreOwnWriteRemovals, v as deferIamPropagationSettle, x as IamCreateClientCache, y as iamEntityLeftByThisCreate } from "./iam-role-provider-CkIQ7vmu.js";
2
+ import { A as configStringRefusal, B as generateResourceName, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, J as getCurrentStackName, M as replayWarn, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, U as recordedGeneratedNameKept, V as generateResourceNameWithFallback, Y as isBeforeStateRead, c as VERBOSE_POINTER, d as describeAwsStatusReason, f as isAwsAuthoredFailure, g as verbosePointerTail, h as verbosePointerSentence, j as readConfigString, k as configIntegerRefusal, m as verboseAwareText, n as getLogger, p as safeStringify, q as getCurrentStackInstanceId, u as describeAwsFailure, w as generatedNameFor } from "./logger-IjQ12QWZ.js";
3
3
  import { d as withApiGatewayPacing, l as s3ClientDefaults, r as getAwsClients } from "./aws-clients-DOkPjjAW.js";
4
- import { $ as AccountIdUnavailableError, B as isTransientServerError, D as markReplayMayCollide, E as markNameCollision, F as isAmbiguousOutcomeError, G as markNonRetryable, K as markRedactedCause, L as isExplicitDenyError, M as explicitDenyPolicyKind, O as relayedNameCollision, W as isThrottlingError, _ as ResourceUpdateNotSupportedError, i as credentialFingerprint, n as ambientCredentialConfig, ot as ProvisioningError, q as wrapMaskedAwsError, r as clientDefaultsFor, t as ambientClientDefaults, tt as CdkdError, x as hasReplayMayCollide, z as isRetryableTransientError } from "./ambient-client-defaults-DtG0A5aG.js";
5
- import { $ as ElapsedBudget, A as readNameProperty, B as rdsFamilyProtectionSite, C as VALUE_NOT_SHOWN, Ct as startInterruptWatch, D as isQuotableImportValue, Dt as compositeIdSkipResult, E as isPlainImportValue, Et as compositeIdSeparatorRefusal, F as markNotGone, Ft as isSecretDerivedValue, Gi as withPasteableAwsProfile, Gr as recordAttributeIdCopy, Gt as isAuxiliaryFailure, H as userPoolProtectionSite, Ir as recoverMaskedOutput, It as maskDeep, Jt as markCreatedBeforeFailure, K as isProceedDbStatus, Ki as injectiveKey, L as deleteWithProtectionCompensation, Lt as maskerOrIdentity, M as remedyLogicalId, Mt as stateOrphanRecordRemedy, N as resolveExplicitPhysicalId, Nn as snapshotPassProvenance, Nt as createMaskedLogSinks, O as normalizeAwsTagsToCfn, Ot as logicalIdShown, Pt as createMaskedRetryLogger, R as logGroupProtectionSite, Rn as hasMaskableValues, Rt as withDerivedNameMasks, S as holderRefusalRun, St as isInterruptedWaitError, T as isPlainImportJson, Tt as compositeIdFormatMessage, U as PROTECTION_FLIP_RETRY_WAIT_MS, Vt as clearCreatedBeforeFailure, W as deleteAfterProtectionFlipWithFinalSnapshot, Wr as physicalNameCopiesOf, X as isTerminalDeleteFailure, Xr as dynamicReferenceTokens, Y as ProtectionFlipRegistry, Yt as markSupersedesEarlierCreate, Z as protectionFlipKey, _ as withoutServerErrorRetries, _t as recordedPrincipalsRepair, at as isAwsCliLiteral, b as assertRegionMatch, c as AmbiguousCreateLatch, cn as recordedSecrecyOf, ct as renderDisableCommand, d as ambiguousAttemptLead, dr as withoutPhysicalNameCopies, dt as SECRET_DERIVED_READ_LIVE, en as holdsMaskLeaf, et as ElapsedBudgetRegistry, f as createAttemptKey, ft as diffPrincipalNames, g as setBounded, h as replayedSendWindow, hn as markSameGenerationBag, ht as readPrincipalLists, i as reportCreatedResource, ii as carriesSecretMask, it as WITHHELD_AWS_COMMAND, j as refusalTypeShown, jn as recordReferenceProvenanceEntry, jt as segmentAfterAnchor, k as quotedRemedyLogicalId, kt as packCompositeId, l as CREATION_DATE_SKEW_MARGIN_MS, m as replayFollowedAmbiguousAttempt, mt as onlySecretDerived, o as retractCreatedResource, ot as pasteableAwsCommand, p as isInsideWindow, pt as holdsSecretDerivedEntry, q as isTerminalDbWaitStatus, qi as injectiveKeyPrefix, qt as markAuxiliaryFailure, rn as mentionsDynamicReference, rt as UNNAMEABLE_ID_CLAUSE, s as AMBIGUOUS_LATCH_TTL_MS, st as protectedReplacementAdvice, u as RecentIdSet, v as DriftReadRefusedError, w as importRemedyCommand, wn as redactForState, wt as canonicalizeRoute53QueryName, x as holderRefusalMask, y as RESOURCE_NOT_FOUND, z as observeThenDisableProtection } from "./created-resource-sink-DVzNDZ-N.js";
6
- import { A as displayStackName, L as truncateCodePoints, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, _ as shellQuote, c as deployReplaceCommand, d as pasteableCommand, j as isPasteableIdent, k as displaySafe, l as hasClauseBreak, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, u as isInertUnquoted, v as withheldTargetClause } from "./version-DwQIlsjN.js";
7
- import { S as isoTimestampAttribute, a as lookupEachName, c as RecordedIdentityMismatchError, g as identityTimestamp, i as isAccessDeniedError, l as assertRecordedIdentity, n as isPermissionDenial, o as withApiLimit, p as recordedIdentityId, r as chunks, s as RecordedIdentityError, t as deniedIdentityReadRefusal } from "./identity-read-denied-CGR1hIyA.js";
8
- import { gt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted } from "./delete-started-C_hilY_A.js";
9
- import { $ as effectiveInventoryItem, A as withRecordedCidrSpelling, B as LIFECYCLE_DEFAULT_STATUS, C as securityGroupReadbackDelays, D as stackIngressRuleHolder, E as singleSecurityGroupRuleId, F as clearLifecycleWritesOf, G as canonicalizeItemList, H as LIFECYCLE_RULE_PATH, I as lifecycleSettleTarget, J as lifecycleUsesFilterForm, K as effectiveLifecycleConfiguration, L as recordLifecycleWrite, M as sgRemovalRuleKey, N as sgRuleListMember, O as survivingRecordOfRuleId, P as LIFECYCLE_BASELINE_REREAD_DELAYS_MS, Q as effectiveIntelligentTieringItem, R as settleLifecycleRead, S as reconcileSgRules, T as sgRuleKey, U as LIFECYCLE_TAG_FILTERS_PATH, V as LIFECYCLE_FILTER_PATH, W as canonicalizeBlock, X as EVENTBRIDGE_CONFIG_PATH, Y as parseCfnTimestamp, Z as effectiveAnalyticsItem, _ as ingressRuleIdentity, a as refuseRevertRevokingSiblingRules, at as declaresBucketObjectLock, b as isResendableSocketFailure, c as siblingIdOwnedSgRules, ct as isPlainObject$4, d as authorizeDefinitelyNotApplied, dt as shownLifecycleRuleId, et as effectiveNotificationConfiguration, f as canonicalizeSgInlineRuleProtocols, g as flattenIpPermissions, h as descriptionKey, i as resolveSecretDerivedPrincipals, it as configItemId, j as markCopiesAgreed, k as tagListsMatch, l as SG_READBACK_RETRY_DELAY_MS, lt as manualBucketDeletionClause, m as comparableIngressIdentity, n as holdsUnprovenSecretPrincipalToken, nt as caughtErrorName, o as sgRuleDiffKey, ot as declaresNestedObjectLock, p as canonicalizeSgRuleProtocol, q as lifecycleRuleScope, r as isResolvableSecretPrincipalList, rt as coerceCfnNumber, s as readSgIngressById, st as describeValue$1, t as runDestroyForStack, tt as eventBridgeEnabledOf, u as SG_RULE_PAGE_SIZE, ut as mergeLegacySingular, v as isConnectTimeout, w as securityGroupRuleMatchesCfnIngress, x as narrowIngressIpProtocol, y as isDefaultEgressRule, z as takeLifecycleWrite } from "./program-BCit4cJS.js";
10
- import { i as redactedDeleteAddressSkip, n as isRedactedRecordedValue, r as redactedDeleteAddressFields, t as REDACTED_DELETE_ADDRESS_SKIP_REASON } from "./redacted-delete-address-BrPnoyD9.js";
11
- import { $ as streamTagsMatchDeclared, $i as getCurrentProducerRegions, $o as WaitConditionSignalStore, $t as contributorInsightsRefusals, Al as maskedSecretSegment, At as tableNameReleaseWait, Bo as memberReadFailure, Bt as waitForKinesisEnableActive, Ci as earliestDefined, Cn as hasCdkAutoDeleteTag, Co as isStoredExpression, Ct as mapSSESpecification, Di as acquireIdempotencyToken, Dl as toFiniteNumber, Dt as sseSpecificationRefusal, El as toCfnInteger, Eo as awaitInFlightSibling, Es as withIndeterminateGuard, Et as readCapacityNumber, Fd as isAbsoluteAssetPath, Ff as displayAssemblyPath, Fo as SNS_DEFAULT_POLICY_ID, Ft as recordTagWrite, Fu as refuseMalformedNestedChildOutputs, G as declaredStreamTagsMember, Go as verbatimEchoDriftKeys, Gt as sendTtlWaitingOutRateLimit, Gu as refuseMalformedResourcesForDestroy, H as STREAM_POLICY_KEY, Ha as canonicalizeIpv6Cidr, Hn as childStackTags, Ho as reReadUntilSettled, Ht as isTtlRateLimited, Id as listNestedTemplateRows, Io as declaredMemberDocument, Is as isSettledInstanceState, It as settleWrittenTags, J as reverseMapStreamPolicy, Jd as decodeListingKey, Jt as vectorIndexesForCreate, K as planStreamMemberOps, Kn as licensedNameHolder, Ko as attemptedPolicyDocument, Kt as planVectorIndexUpdates, La as SG_RULE_ID_PATTERN, Ld as renderNestedTemplateTreeDefect, Lf as renderAssemblyPathEscape, Lo as declaredPolicyDocument, Ls as connectInstanceIdOf, Ma as replacedDeleteFailureVerdict, Md as stringifyValue, Mo as KMS_DEFAULT_KEY_POLICY_ID, Mt as clearTagWrites, Ol as APPSYNC_APIKEY_ARN_RESOURCE_PATH, Oo as getStackRecords, Ot as sseSpecificationToSend, Pd as findNestedTemplateTreeDefect, Pf as describeFileReadFailure, Po as OWN_WRITE_REREAD_DELAYS_MS, Pt as isDynamoDBTableArnIn, Q as streamPolicyMatchesDeclared, Qt as completeTableContributorInsightsBaseline, Ra as cfnIngressPortValue, Rf as resolveAssemblyPath, Ro as efsPolicyMatchesDeclared, Rt as takeTagWrite, Sn as S3_AUTO_DELETE_OBJECTS_TAG, So as collectPrincipalsAttachingPolicy, St as isTableName, Ti as reserveStackCreateToken, Tl as isWarmThroughputDecrease, To as withoutSiblingOwned, Ts as deleteSkipReason, Tt as pointInTimeRecoveryRefusal, U as STREAM_TAGS_KEY, Ua as canonicalizeIpv4Cidr, Uo as settleDeclaredMember, Ut as planTimeToLive, V as DynamoDBGlobalTableProvider, Va as sgProtocolKey, Vl as passedParameterClassesOf, Vn as childRowTags, Vo as policyDocumentMatchesDeclared, Vt as isTtlAlreadyDisabled, W as declaredStreamPolicyMember, Wo as warnUnsettledMember, Wt as readTtlSpec, X as streamDeclaresTags, Xt as vectorIndexesShapeDetail, Xu as accountArgs, Y as streamDeclaresPolicy, Yt as vectorIndexesSettled, Z as streamMemberRefusals, Zt as CONTRIBUTOR_INSIGHTS_KEY, Zu as withheldAccountClause, _l as isLegacyHandleId, _n as deleteTableWithIndexBusyRetry, _t as KINESIS_DESTINATION_SETTLE_POLL_MS, ac as s3BucketArn, ad as findSdkUnwiredProperties, an as reverseMapTableContributorInsights, at as localSecondaryIndexesKey, bn as waitForIndexesSettled, bo as collectGroupsAddedBySiblings, bs as waitForGoneAfterDelete, bt as hasUsableDeclaredCapacity, cc as s3BucketRegionalDomainName, cn as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, ct as sameJsonValue, dn as deleteBudgetKey, dr as withNestedStackContext, dt as desiredBagIsInformative, el as getCurrentResourceSecrets, en as indexDeclaresContributorInsights, es as classifyHandleUrl, et as canonicalizeStaleIndexDescription, fd as normalizeRecordName, fn as resolveDynamoDbDeleteBudgetClock, ft as isRefusedWarmThroughput, gl as LEGACY_HANDLE_ID_PREFIX, gn as TABLE_INDEX_NOUN, gt as warmThroughputAlreadyMatches, hi as calculateResourceDrift, hn as INDEX_SETTLE_POLL_INTERVAL_MS, ht as trimUnsentWarmMembers, ic as dnsEntryStrings, ii as withoutSiblingOwnedSgRules, in as reverseMapIndexContributorInsights, io as secretNamedAttributeNamesOf, it as gsiUnsendableChangeRefusal, jt as TAGS_BASELINE_REREAD_DELAYS_MS, ks as markWaitAbandoned, kt as tableDeleteGoneWait, lc as s3BucketWebsiteUrl, ln as beginDeleteWait, lt as coerceWarmThroughput, md as wireAttributeValue, mn as DELETE_INDEX_WAIT_PROCEED_NOTE, mt as sentWarmThroughputMembers, ni as siblingOwnedSgRuleIdentities, nn as planIndexContributorInsightsOps, nt as deletionProtectionRefusal, oc as s3BucketDomainName, of as rewriteTemplateAssetReferences, on as stripIndexContributorInsights, or as revertNestedChildFromJournal, ot as projectIndexesOnto, pd as planSubscriptionAttributes, pn as resolveDynamoDbDeleteBudgetMs, pt as readbackWarmThroughput, qo as policyContentKey, qt as readbackVectorIndexes, rl as outputReferenceProvenanceOf, rn as readContributorInsightsSpec, rr as getNestedRevertRun, rt as desiredIndexEntriesByName, sc as s3BucketDualStackDomainName, sd as withoutSdkUnwiredProperties, sl as getAccountInfo, sn as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, st as reverseMapSecondaryIndex, t as DeployEngine, tn as planContributorInsightsOp, ts as evaluateSignals, tt as declaresIndexList, un as compensateRemovedDeletionProtection, ur as getCurrentNestedStackContext, ut as declaresWarmThroughput, vn as maskedLogger, vs as waitForLambdaFunctionActive, vt as KINESIS_DISABLE_PENDING_STATUSES, wn as isTruthyCfnBoolean, wo as withoutSiblingAttachedArns, wt as maskLeafValue, xn as ECR_AUTO_DELETE_IMAGES_TAG, xo as collectManagedPolicyArnsAttachedBySiblings, xt as isPlainCapacityBlock, yc as parseWebACLArn, yn as relayedIndexBusyDelete, yt as deleteTableRetryDelays, za as recordedSgRuleId, zo as lambdaPermissionMatchesDeclared, zt as waitForContributorInsightsSettled } from "./deploy-engine-BEzzfllj.js";
12
- import { a as refuseMalformedDesiredTags, i as readTagList, n as DBPROXY_TAG_OPTIONS, o as tagMapAsList, r as planTagDiff, s as tagPlanWarning, t as DBPROXY_TAGS_WHAT } from "./tag-list-CmpwQ18R.js";
13
- import { _ as isUsableAttemptedName, c as definedAttributes, d as awaitDeferredResource, h as throwIfReadinessAborted, i as refuseRestoreFromItself, l as stringifyIfAssigned, m as deferReadiness, o as isModifyNotAvailableRefusal, s as modifyDbInstanceWhenAvailable, u as abortableSleep } from "./restore-source-guard-BIaZBr57.js";
14
- import { T as timePhase, n as unchangedBehindSecretReference, t as onlySecretReferencesDiffer, v as withRetry } from "./secret-reference-immutable-OIvSuvpM.js";
15
- import { a as principalOwnWriteMembers, c as stringListMember, n as declaredStringList, o as settleOwnWriteMembers } from "./settle-own-write-members-fY5JNYhA.js";
4
+ import { $ as AccountIdUnavailableError, B as isTransientServerError, D as markReplayMayCollide, E as markNameCollision, F as isAmbiguousOutcomeError, G as markNonRetryable, K as markRedactedCause, L as isExplicitDenyError, M as explicitDenyPolicyKind, O as relayedNameCollision, W as isThrottlingError, _ as ResourceUpdateNotSupportedError, i as credentialFingerprint, n as ambientCredentialConfig, ot as ProvisioningError, q as wrapMaskedAwsError, r as clientDefaultsFor, t as ambientClientDefaults, tt as CdkdError, x as hasReplayMayCollide, z as isRetryableTransientError } from "./ambient-client-defaults-BqOg0I6e.js";
5
+ import { $ as isTerminalDbWaitStatus, $i as injectiveKeyPrefix, $t as markAuxiliaryFailure, A as importRemedyCommand, An as redactForState, At as canonicalizeRoute53QueryName, Bt as createMaskedRetryLogger, C as withoutServerErrorRetries, Ct as recordedPrincipalsRepair, D as holderRefusalMask, E as assertRegionMatch, F as quotedRemedyLogicalId, Ft as packCompositeId, G as observeThenDisableProtection, Hr as recoverMaskedOutput, Ht as maskDeep, I as readNameProperty, J as userPoolProtectionSite, K as rdsFamilyProtectionSite, L as refusalTypeShown, Ln as recordReferenceProvenanceEntry, Lt as segmentAfterAnchor, M as isPlainImportValue, Mt as compositeIdSeparatorRefusal, N as isQuotableImportValue, Nt as compositeIdSkipResult, O as holderRefusalRun, Ot as isInterruptedWaitError, P as normalizeAwsTagsToCfn, Pt as logicalIdShown, Q as isProceedDbStatus, Qi as injectiveKey, R as remedyLogicalId, Rt as stateOrphanRecordRemedy, S as setBounded, T as RESOURCE_NOT_FOUND, U as deleteWithProtectionCompensation, Ut as maskerOrIdentity, V as markNotGone, Vt as isSecretDerivedValue, W as logGroupProtectionSite, Wn as hasMaskableValues, Wt as withDerivedNameMasks, X as deleteAfterProtectionFlipWithFinalSnapshot, Xr as physicalNameCopiesOf, Y as PROTECTION_FLIP_RETRY_WAIT_MS, Zi as withPasteableAwsProfile, Zr as recordAttributeIdCopy, Zt as isAuxiliaryFailure, _ as ambiguousAttemptLead, _r as withoutPhysicalNameCopies, _t as SECRET_DERIVED_READ_LIVE, at as ElapsedBudget, b as replayFollowedAmbiguousAttempt, bt as onlySecretDerived, dt as isAwsCliLiteral, en as markCreatedBeforeFailure, f as retractCreatedResource, ft as pasteableAwsCommand, g as RecentIdSet, h as CREATION_DATE_SKEW_MARGIN_MS, j as isPlainImportJson, jt as compositeIdFormatMessage, k as VALUE_NOT_SHOWN, kt as startInterruptWatch, ln as mentionsDynamicReference, lt as UNNAMEABLE_ID_CLAUSE, m as AmbiguousCreateLatch, mn as recordedSecrecyOf, mt as renderDisableCommand, n as enclosingDeadlineRemainingMs, ni as dynamicReferenceTokens, nt as isTerminalDeleteFailure, on as holdsMaskLeaf, ot as ElapsedBudgetRegistry, p as AMBIGUOUS_LATCH_TTL_MS, pt as protectedReplacementAdvice, qt as clearCreatedBeforeFailure, rt as protectionFlipKey, t as enclosingDeadlineExpired, tn as markSupersedesEarlierCreate, tt as ProtectionFlipRegistry, u as reportCreatedResource, ui as carriesSecretMask, ut as WITHHELD_AWS_COMMAND, v as createAttemptKey, vt as diffPrincipalNames, w as DriftReadRefusedError, x as replayedSendWindow, xn as markSameGenerationBag, xt as readPrincipalLists, y as isInsideWindow, yt as holdsSecretDerivedEntry, z as resolveExplicitPhysicalId, zn as snapshotPassProvenance, zt as createMaskedLogSinks } from "./resource-deadline-DB1HaWnD.js";
6
+ import { A as displayStackName, L as truncateCodePoints, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, _ as shellQuote, c as deployReplaceCommand, d as pasteableCommand, j as isPasteableIdent, k as displaySafe, l as hasClauseBreak, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, u as isInertUnquoted, v as withheldTargetClause } from "./version-nXXjUmZl.js";
7
+ import { S as isoTimestampAttribute, a as lookupEachName, c as RecordedIdentityMismatchError, g as identityTimestamp, i as isAccessDeniedError, l as assertRecordedIdentity, n as isPermissionDenial, o as withApiLimit, p as recordedIdentityId, r as chunks, s as RecordedIdentityError, t as deniedIdentityReadRefusal } from "./identity-read-denied-DU0YqxNk.js";
8
+ import { gt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted } from "./delete-started-C9z4Yf_c.js";
9
+ import { $ as effectiveIntelligentTieringItem, A as tagListsMatch, B as takeLifecycleWrite, C as securityGroupReadbackDelays, D as singleSecurityGroupRuleId, E as sharedIngressRuleDescriptions, F as LIFECYCLE_BASELINE_REREAD_DELAYS_MS, G as canonicalizeBlock, H as LIFECYCLE_FILTER_PATH, I as clearLifecycleWritesOf, J as lifecycleRuleScope, K as canonicalizeItemList, L as lifecycleSettleTarget, M as markCopiesAgreed, N as sgRemovalRuleKey, O as stackIngressRuleHolder, P as sgRuleListMember, Q as effectiveAnalyticsItem, R as recordLifecycleWrite, S as reconcileSgRules, T as sgRuleKey, U as LIFECYCLE_RULE_PATH, V as LIFECYCLE_DEFAULT_STATUS, W as LIFECYCLE_TAG_FILTERS_PATH, X as parseCfnTimestamp, Y as lifecycleUsesFilterForm, Z as EVENTBRIDGE_CONFIG_PATH, _ as ingressRuleIdentity, a as refuseRevertRevokingSiblingRules, at as configItemId, b as isResendableSocketFailure, c as siblingIdOwnedSgRules, ct as describeValue$1, d as authorizeDefinitelyNotApplied, dt as mergeLegacySingular, et as effectiveInventoryItem, f as canonicalizeSgInlineRuleProtocols, ft as shownLifecycleRuleId, g as flattenIpPermissions, h as descriptionKey, i as resolveSecretDerivedPrincipals, it as coerceCfnNumber, j as withRecordedCidrSpelling, k as survivingRecordOfRuleId, l as SG_READBACK_RETRY_DELAY_MS, lt as isPlainObject$4, m as comparableIngressIdentity, n as holdsUnprovenSecretPrincipalToken, nt as eventBridgeEnabledOf, o as sgRuleDiffKey, ot as declaresBucketObjectLock, p as canonicalizeSgRuleProtocol, q as effectiveLifecycleConfiguration, r as isResolvableSecretPrincipalList, rt as caughtErrorName, s as readSgIngressById, st as declaresNestedObjectLock, t as runDestroyForStack, tt as effectiveNotificationConfiguration, u as SG_RULE_PAGE_SIZE, ut as manualBucketDeletionClause, v as isConnectTimeout, w as securityGroupRuleMatchesCfnIngress, x as narrowIngressIpProtocol, y as isDefaultEgressRule, z as settleLifecycleRead } from "./program-DnMYJ4--.js";
10
+ import { i as redactedDeleteAddressSkip, n as isRedactedRecordedValue, r as redactedDeleteAddressFields, t as REDACTED_DELETE_ADDRESS_SKIP_REASON } from "./redacted-delete-address-DGHv9GNm.js";
11
+ import { $ as streamTagsMatchDeclared, $o as WaitConditionSignalStore, $t as contributorInsightsRefusals, Al as maskedSecretSegment, At as tableNameReleaseWait, Bo as memberReadFailure, Bt as waitForKinesisEnableActive, Ci as earliestDefined, Cn as hasCdkAutoDeleteTag, Co as isStoredExpression, Ct as mapSSESpecification, Di as acquireIdempotencyToken, Dl as toFiniteNumber, Dt as sseSpecificationRefusal, El as toCfnInteger, Eo as awaitInFlightSibling, Es as withIndeterminateGuard, Et as readCapacityNumber, Fd as isAbsoluteAssetPath, Ff as displayAssemblyPath, Fo as SNS_DEFAULT_POLICY_ID, Ft as recordTagWrite, Fu as refuseMalformedNestedChildOutputs, G as declaredStreamTagsMember, Go as verbatimEchoDriftKeys, Gt as sendTtlWaitingOutRateLimit, Gu as refuseMalformedResourcesForDestroy, H as STREAM_POLICY_KEY, Ha as canonicalizeIpv6Cidr, Hn as childStackTags, Ho as reReadUntilSettled, Ht as isTtlRateLimited, Id as listNestedTemplateRows, Io as declaredMemberDocument, Is as isSettledInstanceState, It as settleWrittenTags, J as reverseMapStreamPolicy, Jd as decodeListingKey, Jt as vectorIndexesForCreate, K as planStreamMemberOps, Kn as licensedNameHolder, Ko as attemptedPolicyDocument, Kt as planVectorIndexUpdates, La as SG_RULE_ID_PATTERN, Ld as renderNestedTemplateTreeDefect, Lf as renderAssemblyPathEscape, Lo as declaredPolicyDocument, Ls as connectInstanceIdOf, Ma as replacedDeleteFailureVerdict, Md as stringifyValue, Mo as KMS_DEFAULT_KEY_POLICY_ID, Mt as clearTagWrites, Ol as APPSYNC_APIKEY_ARN_RESOURCE_PATH, Oo as getStackRecords, Ot as sseSpecificationToSend, Pd as findNestedTemplateTreeDefect, Pf as describeFileReadFailure, Po as OWN_WRITE_REREAD_DELAYS_MS, Pt as isDynamoDBTableArnIn, Q as streamPolicyMatchesDeclared, Qt as completeTableContributorInsightsBaseline, Ra as cfnIngressPortValue, Rf as resolveAssemblyPath, Ro as efsPolicyMatchesDeclared, Rt as takeTagWrite, Sn as S3_AUTO_DELETE_OBJECTS_TAG, So as collectPrincipalsAttachingPolicy, St as isTableName, Ti as reserveStackCreateToken, Tl as isWarmThroughputDecrease, To as withoutSiblingOwned, Ts as deleteSkipReason, Tt as pointInTimeRecoveryRefusal, U as STREAM_TAGS_KEY, Ua as canonicalizeIpv4Cidr, Uo as settleDeclaredMember, Ut as planTimeToLive, V as DynamoDBGlobalTableProvider, Va as sgProtocolKey, Vl as passedParameterClassesOf, Vn as childRowTags, Vo as policyDocumentMatchesDeclared, Vt as isTtlAlreadyDisabled, W as declaredStreamPolicyMember, Wo as warnUnsettledMember, Wt as readTtlSpec, X as streamDeclaresTags, Xi as getCurrentProducerRegions, Xt as vectorIndexesShapeDetail, Xu as accountArgs, Y as streamDeclaresPolicy, Yt as vectorIndexesSettled, Z as streamMemberRefusals, Zt as CONTRIBUTOR_INSIGHTS_KEY, Zu as withheldAccountClause, _l as isLegacyHandleId, _n as deleteTableWithIndexBusyRetry, _t as KINESIS_DESTINATION_SETTLE_POLL_MS, ac as s3BucketArn, ad as findSdkUnwiredProperties, an as reverseMapTableContributorInsights, at as localSecondaryIndexesKey, bn as waitForIndexesSettled, bo as collectGroupsAddedBySiblings, bs as waitForGoneAfterDelete, bt as hasUsableDeclaredCapacity, cc as s3BucketRegionalDomainName, cn as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, ct as sameJsonValue, dn as deleteBudgetKey, dr as withNestedStackContext, dt as desiredBagIsInformative, el as getCurrentResourceSecrets, en as indexDeclaresContributorInsights, es as classifyHandleUrl, et as canonicalizeStaleIndexDescription, fd as normalizeRecordName, fn as resolveDynamoDbDeleteBudgetClock, ft as isRefusedWarmThroughput, gl as LEGACY_HANDLE_ID_PREFIX, gn as TABLE_INDEX_NOUN, gt as warmThroughputAlreadyMatches, hi as calculateResourceDrift, hn as INDEX_SETTLE_POLL_INTERVAL_MS, ht as trimUnsentWarmMembers, ic as dnsEntryStrings, ii as withoutSiblingOwnedSgRules, in as reverseMapIndexContributorInsights, io as secretNamedAttributeNamesOf, it as gsiUnsendableChangeRefusal, jt as TAGS_BASELINE_REREAD_DELAYS_MS, ks as markWaitAbandoned, kt as tableDeleteGoneWait, lc as s3BucketWebsiteUrl, ln as beginDeleteWait, lt as coerceWarmThroughput, md as wireAttributeValue, mn as DELETE_INDEX_WAIT_PROCEED_NOTE, mt as sentWarmThroughputMembers, ni as siblingOwnedSgRuleIdentities, nn as planIndexContributorInsightsOps, nt as deletionProtectionRefusal, oc as s3BucketDomainName, of as rewriteTemplateAssetReferences, on as stripIndexContributorInsights, or as revertNestedChildFromJournal, ot as projectIndexesOnto, pd as planSubscriptionAttributes, pn as resolveDynamoDbDeleteBudgetMs, pt as readbackWarmThroughput, qo as policyContentKey, qt as readbackVectorIndexes, rl as outputReferenceProvenanceOf, rn as readContributorInsightsSpec, rr as getNestedRevertRun, rt as desiredIndexEntriesByName, sc as s3BucketDualStackDomainName, sd as withoutSdkUnwiredProperties, sl as getAccountInfo, sn as DYNAMODB_DELETE_DEADLINE_MARGIN_MS, st as reverseMapSecondaryIndex, t as DeployEngine, tn as planContributorInsightsOp, ts as evaluateSignals, tt as declaresIndexList, un as compensateRemovedDeletionProtection, ur as getCurrentNestedStackContext, ut as declaresWarmThroughput, vn as maskedLogger, vs as waitForLambdaFunctionActive, vt as KINESIS_DISABLE_PENDING_STATUSES, wn as isTruthyCfnBoolean, wo as withoutSiblingAttachedArns, wt as maskLeafValue, xn as ECR_AUTO_DELETE_IMAGES_TAG, xo as collectManagedPolicyArnsAttachedBySiblings, xt as isPlainCapacityBlock, yc as parseWebACLArn, yn as relayedIndexBusyDelete, yt as deleteTableRetryDelays, za as recordedSgRuleId, zo as lambdaPermissionMatchesDeclared, zt as waitForContributorInsightsSettled } from "./deploy-engine-DNEAZMj7.js";
12
+ import { a as refuseMalformedDesiredTags, i as readTagList, n as DBPROXY_TAG_OPTIONS, o as tagMapAsList, r as planTagDiff, s as tagPlanWarning, t as DBPROXY_TAGS_WHAT } from "./tag-list-Bye2zxAF.js";
13
+ import { _ as isUsableAttemptedName, c as definedAttributes, d as awaitDeferredResource, h as throwIfReadinessAborted, i as refuseRestoreFromItself, l as stringifyIfAssigned, m as deferReadiness, o as isModifyNotAvailableRefusal, s as modifyDbInstanceWhenAvailable, u as abortableSleep } from "./restore-source-guard-BL2O_O6r.js";
14
+ import { T as timePhase, n as unchangedBehindSecretReference, t as onlySecretReferencesDiffer, v as withRetry } from "./secret-reference-immutable-XFEdCfNg.js";
15
+ import { a as principalOwnWriteMembers, c as stringListMember, n as declaredStringList, o as settleOwnWriteMembers } from "./settle-own-write-members-DzUentwR.js";
16
16
  import { n as canonicalizeRegion, r as derivePartitionAndUrlSuffix } from "./aws-partition-DA0r2sr-.js";
17
17
  import { f as ambientRegion, r as awsEndpointOverrideActive } from "./aws-client-defaults-DAebi99J.js";
18
- import { a as reDisableInstanceApiTermination, c as resolvedResourceTimeoutMs, f as markRefusedBeforeApplying, i as observeThenDisableInstanceApiTermination, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, r as isTerminationProtectionPropagationError, s as resolvedPerTypeResourceTimeoutMs, u as getPriorAttempts } from "./ec2-termination-protection-BeYoGs66.js";
19
- import { l as removedTemplateKeys, n as enclosingDeadlineRemainingMs, o as clearOnUpdateRemoval, t as enclosingDeadlineExpired, u as withRemovalDefaults } from "./resource-deadline-nSheE7zd.js";
20
- import { R as passedNoEchoParametersOf, c as blockDeviceMappingsDifferOnlyInDeleteOnTermination, f as canonicalLambdaFunctionName, h as sameLambdaFunctionAddress, m as parseLambdaFunctionAddress, p as lambdaFunctionNameForMask, u as ecsServiceLaunchTypeSetOrChanged } from "./replacement-rules-HtPsWZIV.js";
21
- import { EMRClusterProvider, a as undeclaredDriftKeys, c as reportPossibleOrphans, i as projectDeclaredDriftPair, n as EMRInstanceGroupConfigProvider, o as collectOrphanIds, r as filledDefaultsFrom, s as orphanCommandRegionArg$2, t as EMRInstanceFleetConfigProvider } from "./emr-cluster-provider-TaiGpHEX.js";
22
- import { RDSProvider } from "./rds-provider-Dv0lcb0m.js";
23
- import { NeptuneProvider } from "./neptune-provider-C8fiHA_U.js";
24
- import { ASGProvider } from "./asg-provider-BmCui3zx.js";
18
+ import { a as reDisableInstanceApiTermination, c as resolvedResourceTimeoutMs, f as markRefusedBeforeApplying, i as observeThenDisableInstanceApiTermination, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, r as isTerminationProtectionPropagationError, s as resolvedPerTypeResourceTimeoutMs, u as getPriorAttempts } from "./ec2-termination-protection-zaan5pi0.js";
19
+ import { a as withRemovalDefaults, i as removedTemplateKeys, t as clearOnUpdateRemoval } from "./update-removal-BpxPxmQR.js";
20
+ import { B as passedNoEchoParametersOf, c as blockDeviceMappingsDifferOnlyInDeleteOnTermination, f as canonicalLambdaFunctionName, h as sameLambdaFunctionAddress, m as parseLambdaFunctionAddress, p as lambdaFunctionNameForMask, u as ecsServiceLaunchTypeSetOrChanged } from "./replacement-rules-BAJWgr5f.js";
21
+ import { EMRClusterProvider, a as undeclaredDriftKeys, c as reportPossibleOrphans, i as projectDeclaredDriftPair, n as EMRInstanceGroupConfigProvider, o as collectOrphanIds, r as filledDefaultsFrom, s as orphanCommandRegionArg$2, t as EMRInstanceFleetConfigProvider } from "./emr-cluster-provider-Dkg4vDao.js";
22
+ import { RDSProvider } from "./rds-provider-BSeLwUR8.js";
23
+ import { NeptuneProvider } from "./neptune-provider-2O6bzLTH.js";
24
+ import { ASGProvider } from "./asg-provider-DkhAcikX.js";
25
25
  import { createHash, randomUUID } from "node:crypto";
26
26
  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";
27
27
  import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteConflictException, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetLoginProfileCommand, GetPolicyCommand, GetPolicyVersionCommand, GetRolePolicyCommand, GetUserCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListAttachedGroupPoliciesCommand, ListAttachedUserPoliciesCommand, ListEntitiesForPolicyCommand, ListGroupPoliciesCommand, ListGroupsForUserCommand, ListPoliciesCommand, ListPolicyTagsCommand, ListPolicyVersionsCommand, ListUserPoliciesCommand, NoSuchEntityException, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPermissionsBoundaryCommand, PutUserPolicyCommand, RemoveRoleFromInstanceProfileCommand, RemoveUserFromGroupCommand, TagPolicyCommand, TagUserCommand, UntagPolicyCommand, UntagUserCommand, UpdateAccessKeyCommand, UpdateGroupCommand, UpdateLoginProfileCommand, UpdateUserCommand } from "@aws-sdk/client-iam";
@@ -41,7 +41,7 @@ import { AssociateKmsKeyCommand, CloudWatchLogsClient, CreateDeliveryCommand, Cr
41
41
  import { BedrockAgentCoreControlClient, CreateAgentRuntimeCommand, CreateEvaluatorCommand, DeleteAgentRuntimeCommand, DeleteEvaluatorCommand, GetAgentRuntimeCommand, GetBrowserCommand, GetCodeInterpreterCommand, GetEvaluatorCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$6, ResourceNotFoundException as ResourceNotFoundException$6, TagResourceCommand as TagResourceCommand$9, UntagResourceCommand as UntagResourceCommand$9, UpdateAgentRuntimeCommand, UpdateEvaluatorCommand } from "@aws-sdk/client-bedrock-agentcore-control";
42
42
  import { AddTagsToResourceCommand as AddTagsToResourceCommand$1, CreateCacheClusterCommand, CreateCacheSubnetGroupCommand, DeleteCacheClusterCommand, DeleteCacheSubnetGroupCommand, DescribeCacheClustersCommand, DescribeCacheSubnetGroupsCommand, ElastiCacheClient, ListTagsForResourceCommand as ListTagsForResourceCommand$7, ModifyCacheClusterCommand, ModifyCacheSubnetGroupCommand, RemoveTagsFromResourceCommand as RemoveTagsFromResourceCommand$1 } from "@aws-sdk/client-elasticache";
43
43
  import { ACMClient, AddTagsToCertificateCommand, DeleteCertificateCommand, DescribeCertificateCommand, ListTagsForCertificateCommand, RemoveTagsFromCertificateCommand, RequestCertificateCommand, ResourceNotFoundException as ResourceNotFoundException$7, UpdateCertificateOptionsCommand } from "@aws-sdk/client-acm";
44
- import { AssociateVPCWithHostedZoneCommand, ChangeResourceRecordSetsCommand, ChangeTagsForResourceCommand, CreateHostedZoneCommand, CreateQueryLoggingConfigCommand, DeleteHostedZoneCommand, DeleteQueryLoggingConfigCommand, DisassociateVPCFromHostedZoneCommand, GetHostedZoneCommand, HostedZoneAlreadyExists, ListHostedZonesByNameCommand, ListQueryLoggingConfigsCommand, ListResourceRecordSetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$8, Route53Client, UpdateHostedZoneCommentCommand, UpdateHostedZoneFeaturesCommand } from "@aws-sdk/client-route-53";
44
+ import { AssociateVPCWithHostedZoneCommand, ChangeResourceRecordSetsCommand, ChangeTagsForResourceCommand, CreateHostedZoneCommand, CreateQueryLoggingConfigCommand, DeleteHostedZoneCommand, DeleteQueryLoggingConfigCommand, DisassociateVPCFromHostedZoneCommand, GetChangeCommand, GetHostedZoneCommand, HostedZoneAlreadyExists, ListHostedZonesByNameCommand, ListQueryLoggingConfigsCommand, ListResourceRecordSetsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$8, Route53Client, UpdateHostedZoneCommentCommand, UpdateHostedZoneFeaturesCommand } from "@aws-sdk/client-route-53";
45
45
  import { CreateMicrovmImageCommand, DeleteMicrovmImageCommand, GetMicrovmImageCommand, LambdaMicrovmsClient, ListTagsCommand as ListTagsCommand$1, ResourceNotFoundException as ResourceNotFoundException$8, TagResourceCommand as TagResourceCommand$10, UntagResourceCommand as UntagResourceCommand$10, UpdateMicrovmImageCommand } from "@aws-sdk/client-lambda-microvms";
46
46
  import { CreateWebFunctionEndpointCommand, CreateWebFunctionRevisionCommand, DeleteWebFunctionEndpointCommand, DeleteWebFunctionRevisionCommand, GetWebFunctionEndpointCommand, GetWebFunctionRevisionCommand, LambdaWebClient, ListWebFunctionRevisionsCommand, ResourceNotFoundException as ResourceNotFoundException$9, UpdateWebFunctionEndpointCommand } from "@aws-sdk/client-lambda-web";
47
47
  import { CreateNetworkConnectorCommand, DeleteNetworkConnectorCommand, GetNetworkConnectorCommand, LambdaCoreClient, ResourceNotFoundException as ResourceNotFoundException$10, UpdateNetworkConnectorCommand } from "@aws-sdk/client-lambda-core";
@@ -25248,45 +25248,56 @@ async function ensureIamInstanceProfileAssociated(instanceId, arn, name, logical
25248
25248
  return;
25249
25249
  }
25250
25250
  this.logger.debug(`IAM instance profile not bound at launch for instance ${instanceId} (${logicalId}); associating ${arn ?? name} explicitly`);
25251
+ const notConfirmed = (why) => new ProvisioningError(`The IAM instance profile association of EC2 Instance ${logicalId} (${instanceId}) ${why}; the association is not confirmed`, "AWS::EC2::Instance", logicalId, instanceId);
25252
+ const watch = startInterruptWatch(`EC2 Instance ${logicalId} IAM instance profile association`);
25253
+ const checkpoint = () => {
25254
+ if (watch.isInterrupted()) throw watch.onInterrupted();
25255
+ if (enclosingDeadlineRemainingMs() <= 0) throw markNonRetryable(notConfirmed("did not read associated before the resource timeout"));
25256
+ };
25257
+ const pause = (ms) => this.sleep(Math.max(0, Math.min(ms, enclosingDeadlineRemainingMs())));
25251
25258
  const maxAttempts = 10;
25252
- let associated = false;
25253
- for (let attempt = 1; attempt <= maxAttempts; attempt++) try {
25254
- await this.ec2Client.send(new AssociateIamInstanceProfileCommand({
25255
- InstanceId: instanceId,
25256
- IamInstanceProfile: {
25257
- Arn: arn,
25258
- Name: name
25259
+ try {
25260
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
25261
+ checkpoint();
25262
+ try {
25263
+ await this.ec2Client.send(new AssociateIamInstanceProfileCommand({
25264
+ InstanceId: instanceId,
25265
+ IamInstanceProfile: {
25266
+ Arn: arn,
25267
+ Name: name
25268
+ }
25269
+ }));
25270
+ this.logger.debug(`AssociateIamInstanceProfile issued for instance ${instanceId} (${logicalId}) on attempt ${attempt}`);
25271
+ break;
25272
+ } catch (error) {
25273
+ const msg = describeAwsFailure(error).detail;
25274
+ if (msg.includes("IncorrectState") || msg.includes("already associated")) {
25275
+ this.logger.debug(`IAM instance profile already associated with instance ${instanceId} (${logicalId})`);
25276
+ break;
25277
+ }
25278
+ if (this.isInstanceProfilePropagationError(msg) && attempt < maxAttempts) {
25279
+ this.logger.debug(`IAM instance profile not yet propagated for instance ${instanceId} (associate attempt ${attempt}/${maxAttempts}: ${msg}), retrying in ${attempt}s...`);
25280
+ await pause(attempt * 1e3);
25281
+ continue;
25282
+ }
25283
+ throw error;
25259
25284
  }
25260
- }));
25261
- this.logger.debug(`AssociateIamInstanceProfile issued for instance ${instanceId} (${logicalId}) on attempt ${attempt}`);
25262
- associated = true;
25263
- break;
25264
- } catch (error) {
25265
- const msg = describeAwsFailure(error).detail;
25266
- if (msg.includes("IncorrectState") || msg.includes("already associated")) {
25267
- this.logger.debug(`IAM instance profile already associated with instance ${instanceId} (${logicalId})`);
25268
- associated = true;
25269
- break;
25270
- }
25271
- if (this.isInstanceProfilePropagationError(msg) && attempt < maxAttempts) {
25272
- this.logger.debug(`IAM instance profile not yet propagated for instance ${instanceId} (associate attempt ${attempt}/${maxAttempts}: ${msg}), retrying in ${attempt}s...`);
25273
- await this.sleep(attempt * 1e3);
25274
- continue;
25275
- }
25276
- throw error;
25277
- }
25278
- if (!associated) return;
25279
- for (let attempt = 1; attempt <= maxAttempts; attempt++) {
25280
- if (await this.isInstanceProfileAssociated(instanceId)) {
25281
- this.logger.debug(`IAM instance profile is now associated with instance ${instanceId} (${logicalId})`);
25282
- return;
25283
25285
  }
25284
- if (attempt < maxAttempts) {
25285
- this.logger.debug(`Waiting for IAM instance profile association to reach 'associated' for instance ${instanceId} (${logicalId}) (poll ${attempt}/${maxAttempts})...`);
25286
- await this.sleep(attempt * 1e3);
25286
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
25287
+ checkpoint();
25288
+ if (await this.isInstanceProfileAssociated(instanceId)) {
25289
+ this.logger.debug(`IAM instance profile is now associated with instance ${instanceId} (${logicalId})`);
25290
+ return;
25291
+ }
25292
+ if (attempt < maxAttempts) {
25293
+ this.logger.debug(`Waiting for IAM instance profile association to reach 'associated' for instance ${instanceId} (${logicalId}) (poll ${attempt}/${maxAttempts})...`);
25294
+ await pause(attempt * 1e3);
25295
+ }
25287
25296
  }
25297
+ } finally {
25298
+ watch.dispose();
25288
25299
  }
25289
- this.logger.warn(`IAM instance profile association for instance ${instanceId} (${logicalId}) did not reach 'associated' within the propagation window; the instance may still be missing its profile`);
25300
+ throw markNonRetryable(notConfirmed(`did not read associated within the propagation window (${maxAttempts} reads)`));
25290
25301
  }
25291
25302
  async function isInstanceProfileAssociated(instanceId) {
25292
25303
  try {
@@ -25310,18 +25321,96 @@ const instanceCreateMethods = {
25310
25321
  isInstanceProfilePropagationError
25311
25322
  };
25312
25323
 
25324
+ // src/provisioning/providers/ec2/instance-settle-wait.ts
25325
+ const INSTANCE_SETTLE_POLL_MS = 1e3;
25326
+ const INSTANCE_SETTLE_POLLS = 120;
25327
+ const METADATA_STALE_READ_GRACE_POLLS = 5;
25328
+ async function pollUntilSettled$1(what, opts, read, judge, describeLast) {
25329
+ const { maskSecrets } = opts;
25330
+ const pollMs = opts.pollMs ?? 1e3;
25331
+ const maxPolls = opts.maxPolls ?? 120;
25332
+ if (process.env["CDKD_NO_WAIT"] === "true") {
25333
+ opts.debug(maskSecrets(`Skipping the wait for ${what} (CDKD_NO_WAIT=true)`));
25334
+ return;
25335
+ }
25336
+ const watch = startInterruptWatch(maskSecrets(what));
25337
+ let last;
25338
+ try {
25339
+ for (let poll = 1; poll <= maxPolls; poll++) {
25340
+ if (watch.isInterrupted()) throw watch.onInterrupted();
25341
+ if (enclosingDeadlineRemainingMs() <= 0) throw markNonRetryable(new Error(maskSecrets(`The resource timeout expired while waiting for ${what} (last state: ${describeLast(last)}); the change is not confirmed`)));
25342
+ let verdict = "pending";
25343
+ try {
25344
+ last = await read();
25345
+ verdict = judge(last, poll);
25346
+ } catch (error) {
25347
+ if (!(isThrottlingError(error) || isTransientServerError(error))) throw error;
25348
+ opts.debug(maskSecrets(`A read while waiting for ${what} was throttled or failed server-side; reading again`));
25349
+ }
25350
+ if (verdict === "settled") return;
25351
+ if (verdict instanceof Error) throw markNonRetryable(verdict);
25352
+ if (poll === maxPolls) break;
25353
+ await new Promise((resolve) => setTimeout(resolve, Math.max(0, Math.min(pollMs, enclosingDeadlineRemainingMs()))));
25354
+ }
25355
+ } finally {
25356
+ watch.dispose();
25357
+ }
25358
+ throw markNonRetryable(new Error(maskSecrets(`Timed out waiting for ${what}: still ${describeLast(last)} after ${maxPolls * pollMs / 1e3} seconds; the change is not confirmed`)));
25359
+ }
25360
+ async function describeInstance(client, instanceId) {
25361
+ return (await client.send(new DescribeInstancesCommand({ InstanceIds: [instanceId] }))).Reservations?.[0]?.Instances?.[0];
25362
+ }
25363
+ async function waitForInstanceMonitoringSettled(opts, enabled) {
25364
+ const { client, logicalId, instanceId } = opts;
25365
+ const expected = enabled ? "enabled" : "disabled";
25366
+ await pollUntilSettled$1(`detailed monitoring on EC2 Instance ${logicalId} (${instanceId}) to read ${expected}`, opts, () => describeInstance(client, instanceId), (instance) => instance?.Monitoring?.State === expected ? "settled" : "pending", (instance) => instance?.Monitoring?.State ?? "none read");
25367
+ }
25368
+ async function waitForInstanceMetadataOptionsSettled(opts, requested) {
25369
+ const { client, logicalId, instanceId } = opts;
25370
+ const sent = requested;
25371
+ await pollUntilSettled$1(`the metadata options of EC2 Instance ${logicalId} (${instanceId}) to read applied`, opts, () => describeInstance(client, instanceId), (instance, poll) => {
25372
+ const md = instance?.MetadataOptions;
25373
+ if (md?.["State"] !== "applied") return "pending";
25374
+ return Object.keys(sent).every((k) => sent[k] === void 0 || String(md[k]) === String(sent[k])) || poll > 5 ? "settled" : "pending";
25375
+ }, (instance) => instance?.MetadataOptions?.State ?? "none read");
25376
+ }
25377
+ function profileMatches(a, arn, name) {
25378
+ const live = a.IamInstanceProfile?.Arn;
25379
+ if (live === void 0) return false;
25380
+ if (arn !== void 0) return live === arn;
25381
+ return name !== void 0 && live.endsWith(`/${name}`);
25382
+ }
25383
+ async function waitForInstanceProfileAssociationSettled(opts, target) {
25384
+ const { client, logicalId, instanceId } = opts;
25385
+ const find = (list) => target.associationId !== void 0 ? list.find((a) => a.AssociationId === target.associationId) : target.kind === "associated" ? list.find((a) => profileMatches(a, target.arn, target.name) && a.State !== "disassociated") ?? list.find((a) => profileMatches(a, target.arn, target.name)) : void 0;
25386
+ await pollUntilSettled$1(`the IAM instance profile association of EC2 Instance ${logicalId} (${instanceId}) to read ${target.kind}`, opts, async () => find((await client.send(new DescribeIamInstanceProfileAssociationsCommand({ Filters: [{
25387
+ Name: "instance-id",
25388
+ Values: [instanceId]
25389
+ }] }))).IamInstanceProfileAssociations ?? []), (assoc) => {
25390
+ const state = assoc?.State;
25391
+ if (target.kind === "disassociated") return state === void 0 || state === "disassociated" ? "settled" : "pending";
25392
+ if (state === "associated") return "settled";
25393
+ if (state === "disassociated") return new Error(opts.maskSecrets(`The IAM instance profile association of EC2 Instance ${logicalId} (${instanceId}) settled as disassociated, expected associated; the profile is not bound`));
25394
+ return "pending";
25395
+ }, (assoc) => assoc?.State ?? "absent");
25396
+ }
25397
+
25313
25398
  // src/provisioning/providers/ec2/instance-update.ts
25314
25399
  async function updateInstance(logicalId, physicalId, resourceType, properties, previousProperties, context) {
25315
25400
  this.logger.debug(`Updating EC2 Instance ${logicalId}: ${physicalId}`);
25316
25401
  refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
25317
25402
  this.guardTerminationProtectionRemoval(logicalId, physicalId, resourceType, properties, previousProperties, context);
25318
25403
  const memberPlan = this.planInstanceMemberUpdates(logicalId, physicalId, resourceType, properties, previousProperties, context);
25404
+ const mask = maskerOrIdentity(context?.maskSecrets);
25319
25405
  try {
25320
25406
  await this.prepareInstanceMemberUpdates(logicalId, physicalId, resourceType, memberPlan);
25321
- await this.applyTagDiff(physicalId, resourceType, logicalId, previousProperties["Tags"], properties["Tags"], maskerOrIdentity(context?.maskSecrets));
25322
- await this.updateInstanceSecurityProps(physicalId, properties, previousProperties);
25323
- await this.applyInstanceMemberUpdates(logicalId, physicalId, resourceType, memberPlan);
25324
- if (memberPlan.ssmAssociation !== void 0) await this.applyInstanceSsmAssociationChange(logicalId, physicalId, resourceType, memberPlan.ssmAssociation, maskerOrIdentity(context?.maskSecrets), context?.expectedRegion);
25407
+ await this.applyTagDiff(physicalId, resourceType, logicalId, previousProperties["Tags"], properties["Tags"], mask);
25408
+ await this.updateInstanceSecurityProps(physicalId, properties, previousProperties, {
25409
+ logicalId,
25410
+ maskSecrets: mask
25411
+ });
25412
+ await this.applyInstanceMemberUpdates(logicalId, physicalId, resourceType, memberPlan, mask);
25413
+ if (memberPlan.ssmAssociation !== void 0) await this.applyInstanceSsmAssociationChange(logicalId, physicalId, resourceType, memberPlan.ssmAssociation, mask, context?.expectedRegion);
25325
25414
  const instance = (await this.ec2Client.send(new DescribeInstancesCommand({ InstanceIds: [physicalId] }))).Reservations?.[0]?.Instances?.[0];
25326
25415
  return {
25327
25416
  physicalId,
@@ -25331,7 +25420,7 @@ async function updateInstance(logicalId, physicalId, resourceType, properties, p
25331
25420
  } catch (error) {
25332
25421
  if (error instanceof CdkdError || isInterruptedWaitError(error)) throw error;
25333
25422
  const cause = error instanceof Error ? error : void 0;
25334
- throw this.wrapCaughtError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to update EC2 Instance ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
25423
+ throw this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to update EC2 Instance ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
25335
25424
  }
25336
25425
  }
25337
25426
  function guardTerminationProtectionRemoval(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -25342,7 +25431,13 @@ function guardTerminationProtectionRemoval(logicalId, physicalId, resourceType,
25342
25431
  }
25343
25432
  throw markNonRetryable(new ProvisioningError(safeMsg`${logicalId} (${resourceType}): DisableApiTermination was removed from the template, and CloudFormation fails that update for an existing instance. Keep it declared, and set it to false to turn termination protection off. The instance was not updated.`, resourceType, logicalId, physicalId));
25344
25433
  }
25345
- async function updateInstanceSecurityProps(physicalId, properties, previousProperties) {
25434
+ async function updateInstanceSecurityProps(physicalId, properties, previousProperties, at) {
25435
+ const site = {
25436
+ ...at,
25437
+ client: this.ec2Client,
25438
+ instanceId: physicalId,
25439
+ debug: (m) => this.logger.debug(m)
25440
+ };
25346
25441
  const newDisableApiTermination = this.coerceBool(properties["DisableApiTermination"]);
25347
25442
  const oldDisableApiTermination = this.coerceBool(previousProperties["DisableApiTermination"]);
25348
25443
  if (newDisableApiTermination !== void 0 && newDisableApiTermination !== oldDisableApiTermination) await this.ec2Client.send(new ModifyInstanceAttributeCommand({
@@ -25354,13 +25449,17 @@ async function updateInstanceSecurityProps(physicalId, properties, previousPrope
25354
25449
  if (newMonitoring !== void 0 && newMonitoring !== oldMonitoring) {
25355
25450
  if (newMonitoring) await this.ec2Client.send(new MonitorInstancesCommand({ InstanceIds: [physicalId] }));
25356
25451
  else await this.ec2Client.send(new UnmonitorInstancesCommand({ InstanceIds: [physicalId] }));
25452
+ await waitForInstanceMonitoringSettled(site, newMonitoring);
25357
25453
  }
25358
25454
  const newMetadata = this.buildMetadataOptions(properties);
25359
25455
  const oldMetadata = this.buildMetadataOptions(previousProperties);
25360
- if (newMetadata !== void 0 && !this.shallowEqual(newMetadata, oldMetadata)) await this.ec2Client.send(new ModifyInstanceMetadataOptionsCommand({
25361
- InstanceId: physicalId,
25362
- ...newMetadata
25363
- }));
25456
+ if (newMetadata !== void 0 && !this.shallowEqual(newMetadata, oldMetadata)) {
25457
+ await this.ec2Client.send(new ModifyInstanceMetadataOptionsCommand({
25458
+ InstanceId: physicalId,
25459
+ ...newMetadata
25460
+ }));
25461
+ await waitForInstanceMetadataOptionsSettled(site, newMetadata);
25462
+ }
25364
25463
  const newCpuCredits = this.readCpuCredits(properties["CreditSpecification"]);
25365
25464
  const oldCpuCredits = this.readCpuCredits(previousProperties["CreditSpecification"]);
25366
25465
  if (newCpuCredits !== void 0 && newCpuCredits !== oldCpuCredits) await this.ec2Client.send(new ModifyInstanceCreditSpecificationCommand({ InstanceCreditSpecifications: [{
@@ -25644,7 +25743,7 @@ async function prepareInstanceMemberUpdates(logicalId, physicalId, resourceType,
25644
25743
  ids: [await this.vpcDefaultSecurityGroupId(logicalId, physicalId, resourceType, instance?.VpcId)]
25645
25744
  };
25646
25745
  }
25647
- async function applyInstanceMemberUpdates(logicalId, physicalId, resourceType, plan) {
25746
+ async function applyInstanceMemberUpdates(logicalId, physicalId, resourceType, plan, maskSecrets) {
25648
25747
  const applied = [];
25649
25748
  if (plan.securityGroups?.kind === "set") {
25650
25749
  await this.ec2Client.send(new ModifyInstanceAttributeCommand({
@@ -25654,7 +25753,7 @@ async function applyInstanceMemberUpdates(logicalId, physicalId, resourceType, p
25654
25753
  applied.push("the new SecurityGroupIds");
25655
25754
  }
25656
25755
  if (plan.profile !== void 0) {
25657
- await this.applyInstanceProfileChange(logicalId, physicalId, plan.profile);
25756
+ await this.applyInstanceProfileChange(logicalId, physicalId, plan.profile, maskSecrets);
25658
25757
  applied.push(plan.profile.kind === "remove" ? "the IamInstanceProfile removed" : "the new IamInstanceProfile");
25659
25758
  }
25660
25759
  if (plan.deleteOnTermination !== void 0) {
@@ -25964,7 +26063,7 @@ async function vpcDefaultSecurityGroupId(logicalId, physicalId, resourceType, vp
25964
26063
  if (id === void 0) throw refusedBeforeApplying(new ProvisioningError(`${logicalId} (${resourceType}): SecurityGroupIds was removed, and the default security group of instance ${physicalId}'s VPC (${vpcId ?? "unknown"}) could not be found to put in its place. The instance was not updated.`, resourceType, logicalId, physicalId));
25965
26064
  return id;
25966
26065
  }
25967
- async function applyInstanceProfileChange(logicalId, physicalId, change) {
26066
+ async function applyInstanceProfileChange(logicalId, physicalId, change, maskSecrets) {
25968
26067
  let assoc = await this.ec2Client.send(new DescribeIamInstanceProfileAssociationsCommand({ Filters: [{
25969
26068
  Name: "instance-id",
25970
26069
  Values: [physicalId]
@@ -25977,31 +26076,51 @@ async function applyInstanceProfileChange(logicalId, physicalId, change) {
25977
26076
  }] }));
25978
26077
  }
25979
26078
  const current = assoc.IamInstanceProfileAssociations?.find((a) => a.State === "associated" || a.State === "associating");
26079
+ const log = createMaskedLogSinks(this.logger, maskSecrets);
26080
+ const site = {
26081
+ client: this.ec2Client,
26082
+ logicalId,
26083
+ instanceId: physicalId,
26084
+ maskSecrets: log.mask,
26085
+ debug: log.debug
26086
+ };
25980
26087
  if (change.kind === "remove") {
25981
26088
  if (current?.AssociationId === void 0) return;
25982
26089
  await this.ec2Client.send(new DisassociateIamInstanceProfileCommand({ AssociationId: current.AssociationId }));
26090
+ await waitForInstanceProfileAssociationSettled(site, {
26091
+ kind: "disassociated",
26092
+ associationId: current.AssociationId
26093
+ });
25983
26094
  return;
25984
26095
  }
25985
26096
  const spec = change.arn !== void 0 ? { Arn: change.arn } : { Name: change.name };
25986
26097
  const maxAttempts = 10;
25987
- for (let attempt = 1;; attempt++) try {
25988
- if (current?.AssociationId !== void 0) await this.ec2Client.send(new ReplaceIamInstanceProfileAssociationCommand({
25989
- AssociationId: current.AssociationId,
25990
- IamInstanceProfile: spec
25991
- }));
25992
- else await this.ec2Client.send(new AssociateIamInstanceProfileCommand({
25993
- InstanceId: physicalId,
25994
- IamInstanceProfile: spec
25995
- }));
25996
- return;
25997
- } catch (error) {
25998
- const msg = describeAwsFailure(error).detail;
25999
- if (this.isInstanceProfilePropagationError(msg) && attempt < maxAttempts) {
26000
- this.logger.debug(safeMsg`IAM instance profile not yet propagated for ${logicalId} (${physicalId}) (attempt ${attempt}/${maxAttempts}: ${msg}), retrying in ${attempt}s...`);
26001
- await this.sleep(attempt * 1e3);
26002
- continue;
26098
+ for (let attempt = 1;; attempt++) {
26099
+ let sent;
26100
+ try {
26101
+ sent = current?.AssociationId !== void 0 ? await this.ec2Client.send(new ReplaceIamInstanceProfileAssociationCommand({
26102
+ AssociationId: current.AssociationId,
26103
+ IamInstanceProfile: spec
26104
+ })) : await this.ec2Client.send(new AssociateIamInstanceProfileCommand({
26105
+ InstanceId: physicalId,
26106
+ IamInstanceProfile: spec
26107
+ }));
26108
+ } catch (error) {
26109
+ const msg = describeAwsFailure(error).detail;
26110
+ if (this.isInstanceProfilePropagationError(msg) && attempt < maxAttempts) {
26111
+ this.logger.debug(safeMsg`IAM instance profile not yet propagated for ${logicalId} (${physicalId}) (attempt ${attempt}/${maxAttempts}: ${msg}), retrying in ${attempt}s...`);
26112
+ await this.sleep(attempt * 1e3);
26113
+ continue;
26114
+ }
26115
+ throw error;
26003
26116
  }
26004
- throw error;
26117
+ await waitForInstanceProfileAssociationSettled(site, {
26118
+ kind: "associated",
26119
+ associationId: sent?.IamInstanceProfileAssociation?.AssociationId,
26120
+ arn: change.arn,
26121
+ name: change.name
26122
+ });
26123
+ return;
26005
26124
  }
26006
26125
  }
26007
26126
  function shallowEqual(a, b) {
@@ -27594,8 +27713,8 @@ async function readSgIngressByIdentity(groupId, flat, properties, context) {
27594
27713
  const matches = flat.filter((r) => identity(r) === wanted);
27595
27714
  if (matches.length !== 1) return void 0;
27596
27715
  const match = matches[0];
27597
- const siblings = Object.entries(context?.siblings ?? {});
27598
- if (stackIngressRuleHolder(siblings, "", groupId, properties) !== void 0 || siblings.some(([, sibling]) => sibling.resourceType === "AWS::EC2::SecurityGroupIngress" && recordedSgRuleId(sibling.attributes) === recordedId)) return;
27716
+ const sharers = sharedIngressRuleDescriptions(Object.entries(context?.siblings ?? {}), groupId, properties, recordedId);
27717
+ if (sharers === void 0) return void 0;
27599
27718
  let owned;
27600
27719
  try {
27601
27720
  owned = (await this.ec2Client.send(new DescribeSecurityGroupRulesCommand({ SecurityGroupRuleIds: [recordedId] }))).SecurityGroupRules?.find((r) => r.SecurityGroupRuleId === recordedId);
@@ -27605,11 +27724,17 @@ async function readSgIngressByIdentity(groupId, flat, properties, context) {
27605
27724
  return;
27606
27725
  }
27607
27726
  if (owned === void 0 || owned.IsEgress === true || owned.GroupId !== groupId || !securityGroupRuleMatchesCfnIngress(owned, properties) || descriptionKey(owned.Description) !== descriptionKey(match["Description"])) return;
27608
- return {
27727
+ const out = {
27609
27728
  ...withRecordedCidrSpelling(match, properties),
27610
27729
  ...properties["FromPort"] != null && { FromPort: properties["FromPort"] },
27611
27730
  ...properties["ToPort"] != null && { ToPort: properties["ToPort"] }
27612
27731
  };
27732
+ const live = descriptionKey(match["Description"]);
27733
+ if (sharers.some((d) => descriptionKey(d) === live)) {
27734
+ delete out["Description"];
27735
+ if (properties["Description"] != null) out["Description"] = properties["Description"];
27736
+ }
27737
+ return out;
27613
27738
  }
27614
27739
  async function readNetworkAclEntryCurrentState(physicalId) {
27615
27740
  const parts = physicalId.split("|");
@@ -33163,22 +33288,34 @@ function orphanSearchHint(properties, maskSecrets) {
33163
33288
  if (comment !== "") parts.push(`comment ${JSON.stringify(comment)}`);
33164
33289
  return parts.length > 0 ? parts.join(" and ") : "its creation time (the orphan is the newest distribution in this account)";
33165
33290
  }
33291
+ const UPDATE_PRECONDITION_ATTEMPTS = 3;
33292
+ function isPreconditionFailed(error) {
33293
+ return error instanceof Error && error.name === "PreconditionFailed";
33294
+ }
33166
33295
  async function update$26(logicalId, physicalId, resourceType, properties, previousProperties, context) {
33167
33296
  this.logger.debug(`Updating CloudFront Distribution ${logicalId}: ${physicalId}`);
33168
33297
  assertRegionMatch(context?.expectedRegion ? await this.cloudFrontClient.config.region() : void 0, context?.expectedRegion, resourceType, logicalId, physicalId, "pre-update", "global");
33169
33298
  refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
33170
33299
  try {
33171
- const getConfigResponse = await this.cloudFrontClient.send(new GetDistributionConfigCommand({ Id: physicalId }));
33172
- const etag = getConfigResponse.ETag;
33173
- const currentConfig = getConfigResponse.DistributionConfig;
33174
33300
  const newDistributionConfig = properties["DistributionConfig"] ?? {};
33175
33301
  const previousDistributionConfig = previousProperties["DistributionConfig"] ?? {};
33176
- const sdkConfig = this.mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistributionConfig, logicalId, context?.replayingState === true, context?.restoredObservedProperties);
33177
- await this.cloudFrontClient.send(new UpdateDistributionCommand({
33178
- Id: physicalId,
33179
- IfMatch: etag,
33180
- DistributionConfig: sdkConfig
33181
- }));
33302
+ for (let attempt = 1;; attempt++) {
33303
+ const getConfigResponse = await this.cloudFrontClient.send(new GetDistributionConfigCommand({ Id: physicalId }));
33304
+ const etag = getConfigResponse.ETag;
33305
+ const currentConfig = getConfigResponse.DistributionConfig;
33306
+ const sdkConfig = this.mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistributionConfig, logicalId, context?.replayingState === true, context?.restoredObservedProperties);
33307
+ try {
33308
+ await this.cloudFrontClient.send(new UpdateDistributionCommand({
33309
+ Id: physicalId,
33310
+ IfMatch: etag,
33311
+ DistributionConfig: sdkConfig
33312
+ }));
33313
+ break;
33314
+ } catch (error) {
33315
+ if (!isPreconditionFailed(error) || attempt >= UPDATE_PRECONDITION_ATTEMPTS) throw error;
33316
+ this.logger.debug(safeMsg`CloudFront Distribution ${logicalId}: UpdateDistribution was refused with PreconditionFailed (the ETag changed after it was read); re-reading the config and retrying (attempt ${attempt + 1}/${UPDATE_PRECONDITION_ATTEMPTS})`);
33317
+ }
33318
+ }
33182
33319
  const getResponse = await this.cloudFrontClient.send(new GetDistributionCommand({ Id: physicalId }));
33183
33320
  const domainName = getResponse.Distribution?.DomainName;
33184
33321
  const arn = getResponse.Distribution?.ARN;
@@ -34088,6 +34225,26 @@ async function waitForRuntimeSettledBeforeDelete(deps, agentRuntimeId, logicalId
34088
34225
  watch.dispose();
34089
34226
  }
34090
34227
  }
34228
+ const RUNTIME_DELETE_MAX_WAIT_MS = 6e5;
34229
+ async function waitForRuntimeGoneAfterDelete(deps, agentRuntimeId, logicalId, resourceType) {
34230
+ await waitForGoneAfterDelete({
34231
+ what: `BedrockAgentCore Runtime ${agentRuntimeId}`,
34232
+ resourceType,
34233
+ describe: async () => {
34234
+ try {
34235
+ return (await deps.client.send(new GetAgentRuntimeCommand({ agentRuntimeId }))).status ?? "DELETING";
34236
+ } catch (error) {
34237
+ if (error instanceof ResourceNotFoundException$6) return void 0;
34238
+ throw error;
34239
+ }
34240
+ },
34241
+ failedStatus: (status) => status === "DELETE_FAILED" ? new ProvisioningError(`BedrockAgentCore Runtime ${logicalId} (${agentRuntimeId}) reached DELETE_FAILED after its delete was accepted; AWS will not finish the delete on its own, so cdkd keeps its record`, resourceType, logicalId, agentRuntimeId) : void 0,
34242
+ logger: deps.logger,
34243
+ pollIntervalMs: RUNTIME_WAIT_POLL_MS,
34244
+ maxWaitMs: RUNTIME_DELETE_MAX_WAIT_MS,
34245
+ sleep: deps.sleep
34246
+ });
34247
+ }
34091
34248
  async function retireFailedRuntimeCreate(deps, agentRuntimeId, region, mask) {
34092
34249
  try {
34093
34250
  await deps.client.send(new DeleteAgentRuntimeCommand({ agentRuntimeId }));
@@ -34359,7 +34516,6 @@ var AgentCoreRuntimeProvider = class {
34359
34516
  await waitForRuntimeSettledBeforeDelete(this.waitDeps(), physicalId, logicalId);
34360
34517
  try {
34361
34518
  await this.client.send(new DeleteAgentRuntimeCommand({ agentRuntimeId: physicalId }));
34362
- this.logger.debug(`Successfully deleted BedrockAgentCore Runtime ${logicalId}`);
34363
34519
  } catch (error) {
34364
34520
  if (error instanceof ResourceNotFoundException$6) {
34365
34521
  const clientRegion = await this.client.config.region();
@@ -34371,6 +34527,11 @@ var AgentCoreRuntimeProvider = class {
34371
34527
  const thrown = this.wrapCaughtError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to delete BedrockAgentCore Runtime ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
34372
34528
  throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
34373
34529
  }
34530
+ await waitForRuntimeGoneAfterDelete({
34531
+ ...this.waitDeps(),
34532
+ logger: this.logger
34533
+ }, physicalId, logicalId, resourceType);
34534
+ this.logger.debug(`Successfully deleted BedrockAgentCore Runtime ${logicalId}`);
34374
34535
  }
34375
34536
  buildAttributes(response, agentRuntimeName) {
34376
34537
  const attributes = definedAttributes({
@@ -35608,6 +35769,69 @@ async function waitForOwnCapacityProviderPut(client, logicalId, cluster, log, pu
35608
35769
  const reason = failed.length > 0 ? `: ${log.mask(failed.join("; "))}` : "";
35609
35770
  throw markNonRetryable(new ProvisioningError(`ECS cluster ${logicalIdShown(logicalId)} (${log.value(cluster)}): PutClusterCapacityProviders ended with the capacity provider attachments UPDATE_FAILED${reason}. Check the capacity providers the template names (an Auto Scaling group provider needs its group and the ECS service-linked role), fix them, then re-run.`, CLUSTER_TYPE, logicalId, cluster));
35610
35771
  }
35772
+ const CLUSTER_SETTLE_POLL_MS = 1e3;
35773
+ const CLUSTER_SETTLE_POLLS = 600;
35774
+ const CLUSTER_STALE_READ_GRACE_POLLS = 3;
35775
+ const CLUSTER_NOT_VISIBLE_GRACE_POLLS = 5;
35776
+ function settling(cluster) {
35777
+ return cluster?.status === "PROVISIONING" || cluster?.attachmentsStatus === IN_PROGRESS;
35778
+ }
35779
+ function clusterWriteNeedsSettle(sentServiceConnect, answered) {
35780
+ return sentServiceConnect || settling(answered);
35781
+ }
35782
+ async function waitForClusterSettled(client, logicalId, cluster, log, answered, opts = {}) {
35783
+ const pollMs = opts.pollMs ?? 1e3;
35784
+ const maxPolls = opts.maxPolls ?? 600;
35785
+ const gracePolls = opts.staleReadGracePolls ?? 3;
35786
+ const what = `ECS cluster ${logicalId} to settle`;
35787
+ if (process.env["CDKD_NO_WAIT"] === "true") {
35788
+ log.debug(`Skipping the wait for ${what} (CDKD_NO_WAIT=true)`);
35789
+ return;
35790
+ }
35791
+ const clusterSettleFailure = (head, failed) => {
35792
+ const attachments = (failed?.attachments ?? []).filter((a) => FAILED_ATTACHMENT.test(a.status ?? "")).map((a) => {
35793
+ const details = (a.details ?? []).map((d) => `${d.name ?? "?"}=${d.value ?? ""}`).join(", ");
35794
+ return `${a.type ?? "attachment"} ${a.id ?? ""} ${a.status ?? ""}${details ? ` (${details})` : ""}`.trim();
35795
+ });
35796
+ const reason = describeAwsStatusReason({ message: attachments.join("; ") }, "");
35797
+ if (reason.redacted) log.debug(`${head}: ${reason.detail}`);
35798
+ return markNonRetryable(new ProvisioningError(log.mask(reason.redacted ? `${head}. ${reason.summary}` : head), CLUSTER_TYPE, logicalId, cluster));
35799
+ };
35800
+ const describeLast = (c) => c === void 0 ? "none read" : `${c.status ?? "unknown"} / attachments ${c.attachmentsStatus ?? "none"}`;
35801
+ let seenSettling = gracePolls === 0 || settling(answered);
35802
+ const watch = startInterruptWatch(log.mask(what));
35803
+ let last;
35804
+ try {
35805
+ for (let poll = 1; poll <= maxPolls; poll++) {
35806
+ if (watch.isInterrupted()) throw watch.onInterrupted();
35807
+ if (enclosingDeadlineRemainingMs() <= 0) throw markNonRetryable(new Error(log.mask(`The resource timeout expired while waiting for ${what} (last status: ${describeLast(last)}); the change is not confirmed`)));
35808
+ let read = false;
35809
+ try {
35810
+ last = await describeAttachments(client, cluster);
35811
+ read = true;
35812
+ } catch (error) {
35813
+ if (!(isThrottlingError(error) || isTransientServerError(error))) throw error;
35814
+ log.debug(`A read while waiting for ${what} was throttled or failed server-side; reading again`);
35815
+ }
35816
+ if (read) {
35817
+ if (last === void 0) {
35818
+ if (poll > CLUSTER_NOT_VISIBLE_GRACE_POLLS) throw clusterSettleFailure(`ECS cluster ${logicalIdShown(logicalId)} (${log.value(cluster)}) could not be read back while settling`, void 0);
35819
+ } else if (last.status === "FAILED") throw clusterSettleFailure(`ECS cluster ${logicalIdShown(logicalId)} (${log.value(cluster)}) settled as ${describeLast(last)}, expected ACTIVE / attachments UPDATE_COMPLETE`, last);
35820
+ else if (settling(last)) seenSettling = true;
35821
+ else if (!seenSettling && poll <= gracePolls) {} else if (last.status === "ACTIVE" && (last.attachmentsStatus === void 0 || last.attachmentsStatus === "UPDATE_COMPLETE")) return;
35822
+ else if (last.status === "ACTIVE" && last.attachmentsStatus === "UPDATE_FAILED" && !seenSettling) {
35823
+ log.warn(`ECS cluster ${log.value(cluster)} still reports UPDATE_FAILED attachments from before this update, which never showed UPDATE_IN_PROGRESS; continuing`);
35824
+ return;
35825
+ } else throw clusterSettleFailure(`ECS cluster ${logicalIdShown(logicalId)} (${log.value(cluster)}) settled as ${describeLast(last)}, expected ACTIVE / attachments UPDATE_COMPLETE`, last);
35826
+ }
35827
+ if (poll === maxPolls) break;
35828
+ await clusterAttachmentsWait.sleep(Math.max(0, Math.min(pollMs, enclosingDeadlineRemainingMs())));
35829
+ }
35830
+ } finally {
35831
+ watch.dispose();
35832
+ }
35833
+ throw markNonRetryable(new Error(log.mask(`Timed out waiting for ${what}: still ${describeLast(last)} after ${maxPolls * pollMs / 1e3} seconds; the change is not confirmed`)));
35834
+ }
35611
35835
 
35612
35836
  // src/provisioning/providers/ecs/cluster-task-definition.ts
35613
35837
  async function createCluster(logicalId, resourceType, properties, log) {
@@ -35615,6 +35839,7 @@ async function createCluster(logicalId, resourceType, properties, log) {
35615
35839
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
35616
35840
  const client = this.getClient();
35617
35841
  const clusterName = properties["ClusterName"] || this.generatedCreateName(resourceType, logicalId, properties);
35842
+ let createdName;
35618
35843
  try {
35619
35844
  const cluster = (await client.send(new CreateClusterCommand({
35620
35845
  clusterName,
@@ -35629,14 +35854,22 @@ async function createCluster(logicalId, resourceType, properties, log) {
35629
35854
  tags: convertTags(desiredTags)
35630
35855
  }))).cluster;
35631
35856
  if (!cluster || !cluster.clusterArn) throw new Error("CreateCluster did not return cluster ARN");
35857
+ const physicalId = cluster.clusterName ?? clusterName;
35858
+ if (clusterWriteNeedsSettle(Boolean(properties["ServiceConnectDefaults"]), cluster)) {
35859
+ createdName = physicalId;
35860
+ reportCreatedResource(logicalId, resourceType, physicalId);
35861
+ await waitForClusterSettled(client, logicalId, physicalId, log, cluster, { staleReadGracePolls: 0 });
35862
+ }
35632
35863
  log.debug(`Successfully created ECS cluster ${logicalId}: ${cluster.clusterArn}`);
35633
35864
  return {
35634
- physicalId: cluster.clusterName ?? clusterName,
35865
+ physicalId,
35635
35866
  attributes: { Arn: cluster.clusterArn }
35636
35867
  };
35637
35868
  } catch (error) {
35638
35869
  const cause = error instanceof Error ? error : void 0;
35639
- throw this.wrapCaughtError(log.mask, error, (text) => new ProvisioningError(`Failed to create ECS cluster ${logicalId}: ${text}`, resourceType, logicalId, clusterName, cause));
35870
+ const thrown = this.wrapCaughtError(log.mask, error, (text) => new ProvisioningError(`Failed to create ECS cluster ${logicalId}: ${text}`, resourceType, logicalId, clusterName, cause));
35871
+ if (createdName !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdName);
35872
+ throw thrown;
35640
35873
  }
35641
35874
  }
35642
35875
  async function updateCluster(logicalId, physicalId, resourceType, properties, previousProperties, log) {
@@ -35663,13 +35896,14 @@ async function updateCluster(logicalId, physicalId, resourceType, properties, pr
35663
35896
  value: (s["Value"] || s["value"]) ?? void 0
35664
35897
  })) : void 0;
35665
35898
  const svcConnectInput = svcConnectChanged ? properties["ServiceConnectDefaults"] ? { namespace: properties["ServiceConnectDefaults"]["Namespace"] } : { namespace: "" } : void 0;
35666
- await sendWhenAttachmentsSettle(client, logicalId, physicalId, log, () => client.send(new UpdateClusterCommand({
35899
+ const updateResponse = await sendWhenAttachmentsSettle(client, logicalId, physicalId, log, () => client.send(new UpdateClusterCommand({
35667
35900
  cluster: physicalId,
35668
35901
  ...settingsChanged && { settings: settingsInput },
35669
35902
  ...configChanged && { configuration: this.convertClusterConfiguration(properties["Configuration"]) },
35670
35903
  ...svcConnectChanged && { serviceConnectDefaults: svcConnectInput }
35671
35904
  })));
35672
35905
  log.debug(`Updated ECS cluster ${shownCluster} (settings=${settingsChanged}, config=${configChanged}, svcConnect=${svcConnectChanged})`);
35906
+ if (clusterWriteNeedsSettle(svcConnectChanged, updateResponse?.cluster)) await waitForClusterSettled(client, logicalId, physicalId, log, updateResponse?.cluster);
35673
35907
  }
35674
35908
  const cluster = (await client.send(new DescribeClustersCommand({ clusters: [physicalId] }))).clusters?.[0];
35675
35909
  if (cluster?.clusterArn) await this.applyTagDiff(cluster.clusterArn, resourceType, logicalId, previousProperties["Tags"], properties["Tags"], log);
@@ -37506,7 +37740,7 @@ function isWellFormedTarget(entry, side, ignoreSecrets = false) {
37506
37740
  if (quic != null && (typeof quic !== "string" || quic.length === 0)) return false;
37507
37741
  return az == null || typeof az === "string" && az.length > 0;
37508
37742
  }
37509
- function readTargets(value, side) {
37743
+ function readTargets$1(value, side) {
37510
37744
  if (value === void 0 || value === null) return {
37511
37745
  kind: "list",
37512
37746
  items: []
@@ -38088,7 +38322,7 @@ async function updateLoadBalancer(logicalId, physicalId, resourceType, propertie
38088
38322
  async function createTargetGroup(logicalId, resourceType, properties, maskSecrets) {
38089
38323
  this.logger.debug(`Creating TargetGroup ${logicalId}`);
38090
38324
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
38091
- const desiredTargets = readTargets(properties["Targets"], "desired");
38325
+ const desiredTargets = readTargets$1(properties["Targets"], "desired");
38092
38326
  if (desiredTargets.kind === "malformed") throw markNonRetryable(new ProvisioningError(`Targets of TargetGroup ${logicalId} is not a list of ${TARGETS_WHAT}${targetsSecretCause(desiredTargets)} — the target group was not created`, resourceType, logicalId));
38093
38327
  let leftBehindArn;
38094
38328
  try {
@@ -38503,10 +38737,10 @@ function diffAttributeBag(bag, logicalId, desired, previous, removalValue, fromR
38503
38737
  return submitted;
38504
38738
  }
38505
38739
  async function readUpdateTargets(logicalId, physicalId, resourceType, desiredRaw, recordedRaw, groupPort) {
38506
- const desired = readTargets(desiredRaw, "desired");
38740
+ const desired = readTargets$1(desiredRaw, "desired");
38507
38741
  if (desired.kind === "malformed") throw markNonRetryable(new ProvisioningError(`desired Targets of TargetGroup ${logicalId} is not a list of ${TARGETS_WHAT}${targetsSecretCause(desired)} — the target group was not updated`, resourceType, logicalId, physicalId));
38508
38742
  const newTargets = toTargetDescriptions(desired.items, groupPort);
38509
- const recorded = readTargets(recordedRaw, "recorded");
38743
+ const recorded = readTargets$1(recordedRaw, "recorded");
38510
38744
  if (recorded.kind === "list") return {
38511
38745
  newTargets,
38512
38746
  oldTargets: toTargetDescriptions(removableRecordedTargets(recorded.items), groupPort)
@@ -40047,6 +40281,105 @@ function withoutKey(bag, key) {
40047
40281
  return rest;
40048
40282
  }
40049
40283
 
40284
+ // src/provisioning/providers/rds-dbproxy-targetgroup/settle-wait.ts
40285
+ const PROXY_TARGETS_POLL_MS = 3e3;
40286
+ const PROXY_TARGETS_POLLS = 300;
40287
+ const PROXY_TARGET_FAILURE_GRACE_POLLS = 3;
40288
+ const FAILURE_REASONS = /* @__PURE__ */ new Set([
40289
+ "CONNECTION_FAILED",
40290
+ "AUTH_FAILURE",
40291
+ "INVALID_REPLICATION_STATE"
40292
+ ]);
40293
+ function rowsFor(targets, kind, id) {
40294
+ return targets.filter((t) => kind === "cluster" ? t.Type !== "TRACKED_CLUSTER" && t.TrackedClusterId === id : t.Type !== "TRACKED_CLUSTER" && !t.TrackedClusterId && t.RdsResourceId === id);
40295
+ }
40296
+ const healthOf = (t) => [t.TargetHealth?.State ?? "no state", t.TargetHealth?.Reason].filter(Boolean).join("/");
40297
+ async function waitForProxyTargetsAvailable(client, logicalId, dbProxyName, targetGroupName, registered, log, wrapReadError, opts = {}) {
40298
+ const what = `the targets of DB proxy target group ${logicalId} to read AVAILABLE`;
40299
+ if (registered.clusters.length === 0 && registered.instances.length === 0) return;
40300
+ if (process.env["CDKD_NO_WAIT"] === "true") {
40301
+ log.debug(`Skipping the wait for ${what} (CDKD_NO_WAIT=true)`);
40302
+ return;
40303
+ }
40304
+ const pollMs = opts.pollMs ?? 3e3;
40305
+ const maxPolls = opts.maxPolls ?? 300;
40306
+ const watched = [...registered.clusters.map((id) => ({
40307
+ kind: "cluster",
40308
+ id
40309
+ })), ...registered.instances.map((id) => ({
40310
+ kind: "instance",
40311
+ id
40312
+ }))];
40313
+ let last = "none read";
40314
+ let failingPolls = 0;
40315
+ const watch = startInterruptWatch(log.mask(what));
40316
+ try {
40317
+ for (let poll = 1; poll <= maxPolls; poll++) {
40318
+ if (watch.isInterrupted()) throw watch.onInterrupted();
40319
+ if (enclosingDeadlineRemainingMs() <= 0) throw markNonRetryable(new Error(log.mask(`The resource timeout expired while waiting for ${what} (last read: ${last}); the registration is not confirmed`)));
40320
+ let targets;
40321
+ try {
40322
+ targets = await readTargets(client, dbProxyName, targetGroupName);
40323
+ } catch (error) {
40324
+ if (!(isThrottlingError(error) || isTransientServerError(error))) throw wrapReadError(error);
40325
+ log.debug(`A read while waiting for ${what} was throttled or failed server-side; reading again`);
40326
+ }
40327
+ if (targets !== void 0) {
40328
+ const pending = [];
40329
+ let failure;
40330
+ for (const { kind, id } of watched) {
40331
+ const rows = rowsFor(targets, kind, id);
40332
+ if (rows.length === 0) {
40333
+ pending.push(`${log.value(id)} not listed`);
40334
+ continue;
40335
+ }
40336
+ for (const row of rows) {
40337
+ const state = row.TargetHealth?.State;
40338
+ if (state === "AVAILABLE" || state === "UNUSED") continue;
40339
+ pending.push(`${log.value(row.RdsResourceId ?? id)} ${healthOf(row)}`);
40340
+ if (failure === void 0 && row.TargetHealth?.State === "UNAVAILABLE" && FAILURE_REASONS.has(row.TargetHealth.Reason ?? "")) failure = {
40341
+ id: row.RdsResourceId ?? id,
40342
+ row
40343
+ };
40344
+ }
40345
+ }
40346
+ if (pending.length === 0) return;
40347
+ last = pending.join(", ");
40348
+ failingPolls = failure === void 0 ? 0 : failingPolls + 1;
40349
+ if (failure !== void 0 && failingPolls >= 3) {
40350
+ const reason = failure.row.TargetHealth?.Reason ?? "";
40351
+ const head = `DB proxy target group ${logicalId}: target ${log.value(failure.id)} of proxy ${log.value(dbProxyName)} reads UNAVAILABLE (${reason}), expected AVAILABLE`;
40352
+ const text = describeAwsStatusReason({
40353
+ code: reason,
40354
+ message: failure.row.TargetHealth?.Description
40355
+ }, "");
40356
+ if (text.redacted) log.debug(`${head}: ${text.detail}`);
40357
+ throw markNonRetryable(new Error(log.mask(text.redacted ? `${head}. ${text.summary}` : head)));
40358
+ }
40359
+ }
40360
+ if (poll === maxPolls) break;
40361
+ await new Promise((resolve) => setTimeout(resolve, Math.max(0, Math.min(pollMs, enclosingDeadlineRemainingMs()))));
40362
+ }
40363
+ } finally {
40364
+ watch.dispose();
40365
+ }
40366
+ throw markNonRetryable(new Error(log.mask(`Timed out waiting for ${what}: still ${last} after ${maxPolls * pollMs / 1e3} seconds; the registration is not confirmed`)));
40367
+ }
40368
+ async function readTargets(client, dbProxyName, targetGroupName) {
40369
+ const out = [];
40370
+ let marker;
40371
+ do {
40372
+ const page = await client.send(new DescribeDBProxyTargetsCommand({
40373
+ DBProxyName: dbProxyName,
40374
+ TargetGroupName: targetGroupName,
40375
+ ...marker ? { Marker: marker } : {}
40376
+ }));
40377
+ out.push(...page.Targets ?? []);
40378
+ marker = page.Marker;
40379
+ } while (marker);
40380
+ return out;
40381
+ }
40382
+
40050
40383
  // src/provisioning/providers/rds-dbproxy-targetgroup/create.ts
40051
40384
  async function create$21(logicalId, resourceType, properties, context) {
40052
40385
  const dbProxyName = readProxyName(properties["DBProxyName"]);
@@ -40104,7 +40437,23 @@ async function create$21(logicalId, resourceType, properties, context) {
40104
40437
  throw await this.retireRegistrationAfterFailedCreate(this.wrapError(error, "CREATE (describe)", resourceType, logicalId, void 0, mask), dbProxyName, targetGroupName, dbClusterIdentifiers, dbInstanceIdentifiers, context?.maskSecrets);
40105
40438
  }
40106
40439
  if (!targetGroupArn) throw await this.retireRegistrationAfterFailedCreate(new ProvisioningError(`Failed to recover TargetGroupArn for ${dbProxyName}/${targetGroupName} after create`, resourceType, logicalId), dbProxyName, targetGroupName, dbClusterIdentifiers, dbInstanceIdentifiers, context?.maskSecrets);
40107
- if (dbClusterIdentifiers.length > 0 || dbInstanceIdentifiers.length > 0) reportCreatedResource(logicalId, resourceType, targetGroupArn);
40440
+ if (dbClusterIdentifiers.length > 0 || dbInstanceIdentifiers.length > 0) {
40441
+ reportCreatedResource(logicalId, resourceType, targetGroupArn);
40442
+ try {
40443
+ await waitForProxyTargetsAvailable(client, logicalId, dbProxyName, targetGroupName, {
40444
+ clusters: dbClusterIdentifiers,
40445
+ instances: dbInstanceIdentifiers
40446
+ }, createMaskedLogSinks(this.logger, context?.maskSecrets), (error) => this.wrapError(error, "CREATE (wait for targets)", resourceType, logicalId, void 0, mask));
40447
+ } catch (error) {
40448
+ if (isInterruptedWaitError(error)) throw error;
40449
+ const original = error instanceof ProvisioningError ? error : new ProvisioningError(error.message, resourceType, logicalId, void 0, error);
40450
+ throw await this.retireRegistrationAfterFailedCreate(original, dbProxyName, targetGroupName, dbClusterIdentifiers, dbInstanceIdentifiers, context?.maskSecrets, {
40451
+ logicalId,
40452
+ resourceType,
40453
+ physicalId: targetGroupArn
40454
+ });
40455
+ }
40456
+ }
40108
40457
  if (tags.length > 0) try {
40109
40458
  await client.send(new AddTagsToResourceCommand$2({
40110
40459
  ResourceName: targetGroupArn,
@@ -40260,6 +40609,10 @@ async function update$21(logicalId, physicalId, resourceType, properties, previo
40260
40609
  } catch (error) {
40261
40610
  throw this.wrapError(error, "UPDATE (register)", resourceType, logicalId, physicalId, mask);
40262
40611
  }
40612
+ await waitForProxyTargetsAvailable(client, logicalId, dbProxyName, targetGroupName, {
40613
+ clusters: clustersToAdd,
40614
+ instances: instancesToAdd
40615
+ }, createMaskedLogSinks(this.logger, context?.maskSecrets), (error) => this.wrapError(error, "UPDATE (wait for targets)", resourceType, logicalId, physicalId, mask));
40263
40616
  }
40264
40617
  const tagsToRemove = tagPlan.remove;
40265
40618
  const tagsToAdd = [...tagPlan.set].map(([Key, Value]) => ({
@@ -42771,6 +43124,50 @@ function isMatchableSetIdentifier(value) {
42771
43124
  return typeof value === "string" && !value.includes("{{resolve:");
42772
43125
  }
42773
43126
 
43127
+ // src/provisioning/providers/route53/change-wait.ts
43128
+ const CHANGE_INSYNC_POLL_MS = 2e3;
43129
+ const CHANGE_INSYNC_POLLS = 450;
43130
+ function changeIdOf(output) {
43131
+ return output?.ChangeInfo?.Id;
43132
+ }
43133
+ async function waitForRoute53ChangeInsync(client, changeId, what, log, opts = {}) {
43134
+ if (process.env["CDKD_FULL_WAIT"] !== "true") return;
43135
+ if (!changeId) {
43136
+ log.debug(`No Route 53 change id to wait on for ${what}`);
43137
+ return;
43138
+ }
43139
+ const pollMs = opts.pollMs ?? 2e3;
43140
+ const maxPolls = opts.maxPolls ?? 450;
43141
+ const id = changeId.replace(/^\/change\//, "");
43142
+ const manual = `To wait manually: ${pasteableAwsCommand(log.mask)`aws route53 wait resource-record-sets-changed --id ${id}`.render()}.`;
43143
+ const giveUp = (why) => log.warn(`The Route 53 change for ${what} ${why}; continuing (propagation finishes in the background). ${manual}`);
43144
+ const watch = startInterruptWatch(log.mask(`the Route 53 change for ${what} to reach INSYNC`));
43145
+ try {
43146
+ for (let poll = 1; poll <= maxPolls; poll++) {
43147
+ if (watch.isInterrupted()) throw watch.onInterrupted();
43148
+ if (enclosingDeadlineRemainingMs() <= 0) {
43149
+ giveUp("did not reach INSYNC before the resource timeout");
43150
+ return;
43151
+ }
43152
+ try {
43153
+ if ((await client.send(new GetChangeCommand({ Id: id }))).ChangeInfo?.Status === "INSYNC") return;
43154
+ } catch (error) {
43155
+ if (!(isThrottlingError(error) || isTransientServerError(error))) {
43156
+ log.debug(`GetChange for ${what} failed: ${describeAwsFailure(error).detail}`);
43157
+ giveUp(`could not be read (${verboseAwareText("re-run with --verbose for the reason", "the reason is in the debug output above")})`);
43158
+ return;
43159
+ }
43160
+ log.debug(`A read while waiting for the Route 53 change for ${what} was throttled or failed server-side; reading again`);
43161
+ }
43162
+ if (poll === maxPolls) break;
43163
+ await new Promise((resolve) => setTimeout(resolve, Math.max(0, Math.min(pollMs, enclosingDeadlineRemainingMs()))));
43164
+ }
43165
+ } finally {
43166
+ watch.dispose();
43167
+ }
43168
+ giveUp(`did not reach INSYNC within ${maxPolls * pollMs / 1e3} seconds`);
43169
+ }
43170
+
42774
43171
  // src/provisioning/providers/route53/hosted-zone.ts
42775
43172
  async function createHostedZone(logicalId, resourceType, properties, mask, context) {
42776
43173
  this.logger.debug(`Creating Route 53 hosted zone ${logicalId}`);
@@ -42814,16 +43211,18 @@ async function createHostedZone(logicalId, resourceType, properties, mask, conte
42814
43211
  const zoneId = hostedZone.Id.replace("/hostedzone/", "");
42815
43212
  createdZoneId = zoneId;
42816
43213
  reportCreatedResource(logicalId, resourceType, zoneId);
43214
+ const changeIds = [changeIdOf(response)];
42817
43215
  if (vpcs && vpcs.length > 1) for (let i = 1; i < vpcs.length; i++) {
42818
43216
  const additionalVpc = vpcs[i];
42819
43217
  this.logger.debug(`Associating additional VPC ${String(additionalVpc["VPCId"])} with hosted zone ${zoneId}`);
42820
- await this.getClient().send(new AssociateVPCWithHostedZoneCommand({
43218
+ const associated = await this.getClient().send(new AssociateVPCWithHostedZoneCommand({
42821
43219
  HostedZoneId: zoneId,
42822
43220
  VPC: {
42823
43221
  VPCId: additionalVpc["VPCId"],
42824
43222
  VPCRegion: additionalVpc["VPCRegion"]
42825
43223
  }
42826
43224
  }));
43225
+ changeIds.push(changeIdOf(associated));
42827
43226
  }
42828
43227
  await this.applyHostedZoneTags(zoneId, properties, logicalId, void 0, mask);
42829
43228
  await this.applyQueryLoggingConfig(zoneId, properties, logicalId, void 0, mask);
@@ -42852,6 +43251,10 @@ async function createHostedZone(logicalId, resourceType, properties, mask, conte
42852
43251
  }
42853
43252
  await this.waitForAcceleratedRecoveryFeatureSettled(zoneId, logicalId, resourceType, true, true);
42854
43253
  }
43254
+ if (process.env["CDKD_FULL_WAIT"] === "true") {
43255
+ const log = createMaskedLogSinks(this.logger, mask);
43256
+ for (const changeId of changeIds) await waitForRoute53ChangeInsync(this.getClient(), changeId, `hosted zone ${logicalId}`, log);
43257
+ }
42855
43258
  const nameServers = response.DelegationSet?.NameServers ?? [];
42856
43259
  this.logger.debug(`Successfully created hosted zone ${logicalId}: ${zoneId}`);
42857
43260
  callerReferenceToken.release();
@@ -42959,10 +43362,11 @@ async function updateHostedZone(logicalId, physicalId, resourceType, properties,
42959
43362
  async function deleteHostedZone(logicalId, physicalId, resourceType, context) {
42960
43363
  this.logger.debug(`Deleting Route 53 hosted zone ${logicalId}: ${physicalId}`);
42961
43364
  const progress = { stripped: false };
43365
+ let changeId;
42962
43366
  try {
42963
43367
  await this.deleteQueryLoggingConfigForZone(physicalId, logicalId, progress);
42964
43368
  await this.ensureAcceleratedRecoveryDisabledForDelete(physicalId, logicalId, progress);
42965
- await this.getClient().send(new DeleteHostedZoneCommand({ Id: physicalId }));
43369
+ changeId = changeIdOf(await this.getClient().send(new DeleteHostedZoneCommand({ Id: physicalId })));
42966
43370
  this.logger.debug(`Successfully deleted hosted zone ${logicalId}`);
42967
43371
  } catch (error) {
42968
43372
  if (error instanceof Error && error.name === "NoSuchHostedZone") {
@@ -42975,6 +43379,7 @@ async function deleteHostedZone(logicalId, physicalId, resourceType, context) {
42975
43379
  const failure = error instanceof ProvisioningError ? error : this.wrapDeleteError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete hosted zone ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
42976
43380
  throw progress.stripped ? markDeleteStarted(failure) : failure;
42977
43381
  }
43382
+ await waitForRoute53ChangeInsync(this.getClient(), changeId, `hosted zone ${logicalId} deletion`, createMaskedLogSinks(this.logger, context?.maskSecrets));
42978
43383
  }
42979
43384
  async function ensureAcceleratedRecoveryDisabledForDelete(physicalId, logicalId, progress) {
42980
43385
  const client = this.getClient();
@@ -43207,6 +43612,10 @@ function isRecordValuesMismatchRefusal(error) {
43207
43612
  function isRecordNotFoundRefusal(error) {
43208
43613
  return error instanceof Error && error.name === "InvalidChangeBatch" && /but it was not found/i.test(error.message);
43209
43614
  }
43615
+ const groupSubject = {
43616
+ noun: "record set group",
43617
+ remedy: "set HostedZoneId explicitly"
43618
+ };
43210
43619
 
43211
43620
  // src/provisioning/providers/route53/record-set.ts
43212
43621
  async function createRecordSet(logicalId, resourceType, properties, mask, replayingState = false) {
@@ -43216,10 +43625,11 @@ async function createRecordSet(logicalId, resourceType, properties, mask, replay
43216
43625
  const recordName = properties["Name"];
43217
43626
  const recordType = properties["Type"];
43218
43627
  const compositeId = recordSetCompositeId(hostedZoneId, recordName, recordType);
43628
+ let changeId;
43219
43629
  try {
43220
43630
  const resourceRecordSet = replayingState ? this.buildResourceRecordSet(properties) : withTemplateAliasConflicts(this.buildResourceRecordSet(properties), properties);
43221
43631
  const comment = properties["Comment"];
43222
- await this.getClient().send(new ChangeResourceRecordSetsCommand({
43632
+ const created = await this.getClient().send(new ChangeResourceRecordSetsCommand({
43223
43633
  HostedZoneId: hostedZoneId,
43224
43634
  ChangeBatch: {
43225
43635
  ...comment ? { Comment: comment } : {},
@@ -43229,11 +43639,8 @@ async function createRecordSet(logicalId, resourceType, properties, mask, replay
43229
43639
  }]
43230
43640
  }
43231
43641
  }));
43642
+ changeId = changeIdOf(created);
43232
43643
  this.logger.debug(`Successfully created record set ${logicalId}: ${compositeId}`);
43233
- return {
43234
- physicalId: compositeId,
43235
- attributes: {}
43236
- };
43237
43644
  } catch (error) {
43238
43645
  if (error instanceof ProvisioningError) throw error;
43239
43646
  const cause = error instanceof Error ? error : void 0;
@@ -43241,6 +43648,15 @@ async function createRecordSet(logicalId, resourceType, properties, mask, replay
43241
43648
  const wrapped = this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to create record set ${logicalId}${cnameConflict ? CNAME_CONFLICT_COLLISION_NOTE : ""}: ${text}`, resourceType, logicalId, void 0, cause));
43242
43649
  throw cnameConflict ? markNameCollision(wrapped) : wrapped;
43243
43650
  }
43651
+ try {
43652
+ await waitForRoute53ChangeInsync(this.getClient(), changeId, `record set ${logicalId}`, createMaskedLogSinks(this.logger, mask));
43653
+ } catch (error) {
43654
+ throw markCreatedBeforeFailure(error, logicalId, resourceType, compositeId);
43655
+ }
43656
+ return {
43657
+ physicalId: compositeId,
43658
+ attributes: {}
43659
+ };
43244
43660
  }
43245
43661
  async function updateRecordSet(logicalId, physicalId, resourceType, properties, previousProperties, context) {
43246
43662
  this.logger.debug(`Updating Route 53 record set ${logicalId}: ${physicalId}`);
@@ -43272,13 +43688,14 @@ async function updateRecordSet(logicalId, physicalId, resourceType, properties,
43272
43688
  Action: "UPSERT",
43273
43689
  ResourceRecordSet: resourceRecordSet
43274
43690
  }];
43275
- await this.getClient().send(new ChangeResourceRecordSetsCommand({
43691
+ const updated = await this.getClient().send(new ChangeResourceRecordSetsCommand({
43276
43692
  HostedZoneId: hostedZoneId,
43277
43693
  ChangeBatch: {
43278
43694
  ...comment ? { Comment: comment } : {},
43279
43695
  Changes: changes
43280
43696
  }
43281
43697
  }));
43698
+ await waitForRoute53ChangeInsync(this.getClient(), changeIdOf(updated), `record set ${logicalId}`, createMaskedLogSinks(this.logger, context?.maskSecrets));
43282
43699
  this.logger.debug(`Successfully updated record set ${logicalId}`);
43283
43700
  return {
43284
43701
  physicalId: context?.desiredFromAwsReadback === true ? physicalId : compositeId,
@@ -43347,6 +43764,7 @@ async function deleteRecordSet(logicalId, physicalId, resourceType, properties,
43347
43764
  throw error;
43348
43765
  }
43349
43766
  }
43767
+ let changeId;
43350
43768
  try {
43351
43769
  const resourceRecordSet = this.buildResourceRecordSet(properties);
43352
43770
  const sendDelete = (recordSet) => this.getClient().send(new ChangeResourceRecordSetsCommand({
@@ -43358,12 +43776,12 @@ async function deleteRecordSet(logicalId, physicalId, resourceType, properties,
43358
43776
  }));
43359
43777
  const deleteRecord = async (recordSet) => {
43360
43778
  try {
43361
- await sendDelete(recordSet);
43779
+ changeId = changeIdOf(await sendDelete(recordSet));
43362
43780
  } catch (error) {
43363
43781
  if (!isZoneDisabledForMutationError(error)) throw error;
43364
43782
  this.logger.info(`Hosted zone ${hostedZoneId} is mid AcceleratedRecovery transition (marked disabled for mutation); waiting for it to settle before retrying delete of record set ${logicalId}`);
43365
43783
  await this.waitForAcceleratedRecoveryMutable(hostedZoneId, logicalId, resourceType);
43366
- await sendDelete(recordSet);
43784
+ changeId = changeIdOf(await sendDelete(recordSet));
43367
43785
  }
43368
43786
  };
43369
43787
  try {
@@ -43391,6 +43809,7 @@ async function deleteRecordSet(logicalId, physicalId, resourceType, properties,
43391
43809
  const cause = error instanceof Error ? error : void 0;
43392
43810
  throw this.wrapDeleteError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete record set ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
43393
43811
  }
43812
+ await waitForRoute53ChangeInsync(this.getClient(), changeId, `record set ${logicalId} deletion`, createMaskedLogSinks(this.logger, context?.maskSecrets));
43394
43813
  }
43395
43814
  function buildResourceRecordSet(properties) {
43396
43815
  const name = properties["Name"];
@@ -43491,10 +43910,6 @@ function desiredGroup(properties, logicalId, physicalId) {
43491
43910
  zone: zone.zone
43492
43911
  };
43493
43912
  }
43494
- const groupSubject = {
43495
- noun: "record set group",
43496
- remedy: "set HostedZoneId explicitly"
43497
- };
43498
43913
  async function createRecordSetGroup(logicalId, resourceType, properties, mask, replayingState = false) {
43499
43914
  this.logger.debug(safeMsg`Creating Route 53 record set group ${logicalId}`);
43500
43915
  refuseCfnGroupZoneShape(this, properties, listedRecords(properties), logicalId, resourceType, void 0, replayingState);
@@ -43511,9 +43926,10 @@ async function createRecordSetGroup(logicalId, resourceType, properties, mask, r
43511
43926
  attributes: {}
43512
43927
  };
43513
43928
  }
43929
+ let changeId;
43514
43930
  try {
43515
43931
  const comment = properties["Comment"];
43516
- await this.getClient().send(new ChangeResourceRecordSetsCommand({
43932
+ const created = await this.getClient().send(new ChangeResourceRecordSetsCommand({
43517
43933
  HostedZoneId: hostedZoneId,
43518
43934
  ChangeBatch: {
43519
43935
  ...typeof comment === "string" && comment ? { Comment: comment } : {},
@@ -43523,11 +43939,8 @@ async function createRecordSetGroup(logicalId, resourceType, properties, mask, r
43523
43939
  }))
43524
43940
  }
43525
43941
  }));
43942
+ changeId = changeIdOf(created);
43526
43943
  this.logger.debug(safeMsg`Successfully created record set group ${logicalId}: ${compositeId}`);
43527
- return {
43528
- physicalId: compositeId,
43529
- attributes: {}
43530
- };
43531
43944
  } catch (error) {
43532
43945
  if (error instanceof ProvisioningError) throw error;
43533
43946
  const cause = error instanceof Error ? error : void 0;
@@ -43535,6 +43948,15 @@ async function createRecordSetGroup(logicalId, resourceType, properties, mask, r
43535
43948
  const wrapped = this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to create record set group ${logicalId}${cnameConflict ? CNAME_CONFLICT_COLLISION_NOTE : ""}: ${text}`, resourceType, logicalId, void 0, cause));
43536
43949
  throw cnameConflict ? markNameCollision(wrapped) : wrapped;
43537
43950
  }
43951
+ try {
43952
+ await waitForRoute53ChangeInsync(this.getClient(), changeId, `record set group ${logicalId}`, createMaskedLogSinks(this.logger, mask));
43953
+ } catch (error) {
43954
+ throw markCreatedBeforeFailure(error, logicalId, resourceType, compositeId);
43955
+ }
43956
+ return {
43957
+ physicalId: compositeId,
43958
+ attributes: {}
43959
+ };
43538
43960
  }
43539
43961
  async function existingGroupZone(physicalId, zone, logicalId, resourceType) {
43540
43962
  const parsed = parseRecordSetGroupCompositeId(physicalId, logicalId);
@@ -43581,6 +44003,7 @@ async function applyRecordSetGroupUpdate(logicalId, physicalId, resourceType, pr
43581
44003
  let recordedZone = hostedZoneId;
43582
44004
  if (!parseRecordSetGroupCompositeId(physicalId, logicalId) && !("refusal" in previousZone) && zoneReferenceChanged(previousZone.zone, zone)) recordedZone = await recordedZoneForSwitch(this, previousZone.zone, logicalId, resourceType, physicalId, "Record set group");
43583
44005
  if (desiredZone !== void 0 && bareHostedZoneId(desiredZone) !== bareHostedZoneId(recordedZone)) throw groupRefusalError(`Record set group ${logicalId}: the template's hosted zone differs from the one its records are in (${recordedZone}). Moving a group to another zone replaces it: name the new zone with the key the group already uses (HostedZoneId or HostedZoneName) so cdkd plans the replacement`, logicalId, physicalId);
44006
+ let changeId;
43584
44007
  try {
43585
44008
  const desiredKeys = /* @__PURE__ */ new Set();
43586
44009
  const changes = [];
@@ -43620,20 +44043,16 @@ async function applyRecordSetGroupUpdate(logicalId, physicalId, resourceType, pr
43620
44043
  if (changes.length > 0) {
43621
44044
  const comment = properties["Comment"];
43622
44045
  progress.sent = true;
43623
- await updateBatchClient(this).send(new ChangeResourceRecordSetsCommand({
44046
+ const updated = await updateBatchClient(this).send(new ChangeResourceRecordSetsCommand({
43624
44047
  HostedZoneId: hostedZoneId,
43625
44048
  ChangeBatch: {
43626
44049
  ...typeof comment === "string" && comment ? { Comment: comment } : {},
43627
44050
  Changes: [...changes.filter((c) => c.Action === "DELETE"), ...changes.filter((c) => c.Action !== "DELETE")]
43628
44051
  }
43629
44052
  }));
44053
+ changeId = changeIdOf(updated);
43630
44054
  }
43631
44055
  this.logger.debug(safeMsg`Successfully updated record set group ${logicalId}`);
43632
- return {
43633
- physicalId: compositeId,
43634
- wasReplaced: false,
43635
- attributes: {}
43636
- };
43637
44056
  } catch (error) {
43638
44057
  if (error instanceof ProvisioningError) throw error;
43639
44058
  if (progress.sent) {
@@ -43643,6 +44062,12 @@ async function applyRecordSetGroupUpdate(logicalId, physicalId, resourceType, pr
43643
44062
  const cause = error instanceof Error ? error : void 0;
43644
44063
  throw this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to update record set group ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
43645
44064
  }
44065
+ await waitForRoute53ChangeInsync(this.getClient(), changeId, `record set group ${logicalId}`, createMaskedLogSinks(this.logger, context?.maskSecrets));
44066
+ return {
44067
+ physicalId: compositeId,
44068
+ wasReplaced: false,
44069
+ attributes: {}
44070
+ };
43646
44071
  }
43647
44072
  async function ownEarlierWriteMayHold(logicalId, key, desired, provider) {
43648
44073
  const lookup = getPriorAttempts(logicalId);
@@ -43699,6 +44124,7 @@ async function deleteRecordSetGroup(logicalId, physicalId, resourceType, propert
43699
44124
  }
43700
44125
  }
43701
44126
  if (records.length === 0) return;
44127
+ const changeIds = [];
43702
44128
  try {
43703
44129
  const deletes = [];
43704
44130
  for (const record of records) {
@@ -43722,12 +44148,12 @@ async function deleteRecordSetGroup(logicalId, physicalId, resourceType, propert
43722
44148
  }));
43723
44149
  const sendSettled = async (sets) => {
43724
44150
  try {
43725
- await send(sets);
44151
+ changeIds.push(changeIdOf(await send(sets)));
43726
44152
  } catch (error) {
43727
44153
  if (!isZoneDisabledForMutationError(error)) throw error;
43728
44154
  this.logger.info(safeMsg`Hosted zone ${hostedZoneId} is mid AcceleratedRecovery transition (marked disabled for mutation); waiting for it to settle before retrying delete of record set group ${logicalId}`);
43729
44155
  await this.waitForAcceleratedRecoveryMutable(hostedZoneId, logicalId, resourceType);
43730
- await send(sets);
44156
+ changeIds.push(changeIdOf(await send(sets)));
43731
44157
  }
43732
44158
  };
43733
44159
  try {
@@ -43753,6 +44179,8 @@ async function deleteRecordSetGroup(logicalId, physicalId, resourceType, propert
43753
44179
  const cause = error instanceof Error ? error : void 0;
43754
44180
  throw this.wrapDeleteError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete record set group ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
43755
44181
  }
44182
+ const log = createMaskedLogSinks(this.logger, context?.maskSecrets);
44183
+ for (const changeId of changeIds) await waitForRoute53ChangeInsync(this.getClient(), changeId, `record set group ${logicalId} deletion`, log);
43756
44184
  }
43757
44185
  const HOSTED_ZONE_LOOKUP_FAILED$1 = Symbol.for("cdkd.route53.hostedZoneLookupFailed");
43758
44186
  function isHostedZoneLookupFailure$1(err) {
@@ -43797,6 +44225,8 @@ async function readRecordSetGroup(physicalId, logicalId, properties) {
43797
44225
  RecordSets: observed
43798
44226
  };
43799
44227
  }
44228
+
44229
+ // src/provisioning/providers/route53/record-set-group-import.ts
43800
44230
  async function importRecordSetGroupFromTemplate(input) {
43801
44231
  const parsed = groupRecordSets(input.properties);
43802
44232
  if ("refusal" in parsed || parsed.records.length === 0) return null;
@@ -43987,12 +44417,13 @@ async function syncVPCAssociations(zoneId, properties, logicalId, previousProper
43987
44417
  const currentVpcs = (await this.getClient().send(new GetHostedZoneCommand({ Id: zoneId }))).VPCs ?? [];
43988
44418
  const currentVpcIds = new Set(currentVpcs.map((v) => v.VPCId));
43989
44419
  const desiredVpcIds = new Set(desiredVpcs.map((v) => v["VPCId"]));
44420
+ const changeIds = [];
43990
44421
  for (const vpc of desiredVpcs) {
43991
44422
  const vpcId = vpc["VPCId"];
43992
44423
  if (!currentVpcIds.has(vpcId)) {
43993
44424
  this.logger.debug(`Associating VPC ${vpcId} with hosted zone ${zoneId}`);
43994
44425
  marks?.markUnsettled?.("VPCs");
43995
- await this.getClient().send(new AssociateVPCWithHostedZoneCommand({
44426
+ const associated = await this.getClient().send(new AssociateVPCWithHostedZoneCommand({
43996
44427
  HostedZoneId: zoneId,
43997
44428
  VPC: {
43998
44429
  VPCId: vpcId,
@@ -44001,19 +44432,25 @@ async function syncVPCAssociations(zoneId, properties, logicalId, previousProper
44001
44432
  }));
44002
44433
  marks?.markAttempted?.("VPCs", [vpcId]);
44003
44434
  currentVpcIds.add(vpcId);
44435
+ changeIds.push(changeIdOf(associated));
44004
44436
  }
44005
44437
  }
44006
44438
  const previousVpcIds = new Set(declaredVpcIds(previousProperties["VPCs"]));
44007
44439
  for (const vpc of currentVpcs) if (vpc.VPCId && previousVpcIds.has(vpc.VPCId) && !desiredVpcIds.has(vpc.VPCId)) {
44008
44440
  this.logger.debug(`Disassociating VPC ${vpc.VPCId} from hosted zone ${zoneId}`);
44009
44441
  marks?.markUnsettled?.("VPCs");
44010
- await this.getClient().send(new DisassociateVPCFromHostedZoneCommand({
44442
+ const disassociated = await this.getClient().send(new DisassociateVPCFromHostedZoneCommand({
44011
44443
  HostedZoneId: zoneId,
44012
44444
  VPC: {
44013
44445
  VPCId: vpc.VPCId,
44014
44446
  VPCRegion: vpc.VPCRegion
44015
44447
  }
44016
44448
  }));
44449
+ changeIds.push(changeIdOf(disassociated));
44450
+ }
44451
+ if (process.env["CDKD_FULL_WAIT"] === "true") {
44452
+ const log = createMaskedLogSinks(this.logger, mask);
44453
+ for (const changeId of changeIds) await waitForRoute53ChangeInsync(this.getClient(), changeId, `hosted zone ${logicalId} VPC association`, log);
44017
44454
  }
44018
44455
  } catch (error) {
44019
44456
  const cause = error instanceof Error ? error : void 0;
@@ -57006,6 +57443,70 @@ async function importImpl$8(input) {
57006
57443
  }
57007
57444
  }
57008
57445
 
57446
+ // src/provisioning/providers/efs/settle-waits.ts
57447
+ const EFS_SETTLE_POLL_MS = 1e3;
57448
+ const EFS_SETTLE_POLLS = 300;
57449
+ const EFS_STALE_READ_GRACE_POLLS = 5;
57450
+ async function pollUntilSettled(what, log, opts, read, judge, describeLast) {
57451
+ const pollMs = opts.pollMs ?? 1e3;
57452
+ const maxPolls = opts.maxPolls ?? 300;
57453
+ if (process.env["CDKD_NO_WAIT"] === "true") {
57454
+ log.debug(`Skipping the wait for ${what} (CDKD_NO_WAIT=true)`);
57455
+ return;
57456
+ }
57457
+ const watch = startInterruptWatch(log.mask(what));
57458
+ let last;
57459
+ try {
57460
+ for (let poll = 1; poll <= maxPolls; poll++) {
57461
+ if (watch.isInterrupted()) throw watch.onInterrupted();
57462
+ if (enclosingDeadlineRemainingMs() <= 0) throw markNonRetryable(new Error(log.mask(`The resource timeout expired while waiting for ${what} (last status: ${describeLast(last)}); the change is not confirmed`)));
57463
+ let verdict = "pending";
57464
+ try {
57465
+ last = await read(poll);
57466
+ verdict = judge(last, poll);
57467
+ } catch (error) {
57468
+ if (!(isThrottlingError(error) || isTransientServerError(error))) throw error;
57469
+ log.debug(`A read while waiting for ${what} was throttled or failed server-side; reading again`);
57470
+ }
57471
+ if (verdict === "settled") return;
57472
+ if (verdict instanceof Error) throw markNonRetryable(verdict);
57473
+ if (poll === maxPolls) break;
57474
+ await new Promise((resolve) => setTimeout(resolve, Math.max(0, Math.min(pollMs, enclosingDeadlineRemainingMs()))));
57475
+ }
57476
+ } finally {
57477
+ watch.dispose();
57478
+ }
57479
+ throw markNonRetryable(new Error(log.mask(`Timed out waiting for ${what}: still ${describeLast(last)} after ${maxPolls * pollMs / 1e3} seconds; the change is not confirmed`)));
57480
+ }
57481
+ async function waitForAccessPointAvailable(client, logicalId, accessPointId, log, opts = {}) {
57482
+ await pollUntilSettled(`EFS AccessPoint ${logicalId} to read available`, log, opts, async (poll) => {
57483
+ try {
57484
+ return (await client.send(new DescribeAccessPointsCommand({ AccessPointId: accessPointId }))).AccessPoints?.[0]?.LifeCycleState ?? "absent";
57485
+ } catch (error) {
57486
+ if ((error instanceof AccessPointNotFound || error?.name === "AccessPointNotFound") && poll <= 5) return "not yet visible";
57487
+ throw error;
57488
+ }
57489
+ }, (state, poll) => {
57490
+ if (state === "available") return "settled";
57491
+ if (state === "creating" || state === "updating" || state === "not yet visible") return "pending";
57492
+ if (state === "absent" && poll <= 5) return "pending";
57493
+ return new Error(log.mask(`EFS AccessPoint ${logicalId} (${accessPointId}) settled as ${state}, expected available`));
57494
+ }, (state) => state ?? "none read");
57495
+ }
57496
+ async function waitForBackupPolicySettled(client, fileSystemId, requested, answeredStatus, log, opts = {}) {
57497
+ const transitional = (s) => s === "ENABLING" || s === "DISABLING";
57498
+ let seenSettling = !transitional(answeredStatus);
57499
+ await pollUntilSettled(`the BackupPolicy on EFS FileSystem ${fileSystemId} to read ${requested}`, log, opts, async () => (await client.send(new DescribeBackupPolicyCommand({ FileSystemId: fileSystemId }))).BackupPolicy?.Status, (status, poll) => {
57500
+ if (transitional(status)) {
57501
+ seenSettling = true;
57502
+ return "pending";
57503
+ }
57504
+ if (status === requested && (seenSettling || poll > 5)) return "settled";
57505
+ if (poll <= 5) return "pending";
57506
+ return new Error(log.mask(`The BackupPolicy on EFS FileSystem ${fileSystemId} settled as ${status ?? "absent"}, expected ${requested}`));
57507
+ }, (status) => status ?? "none read");
57508
+ }
57509
+
57009
57510
  // src/provisioning/providers/efs/file-system.ts
57010
57511
  async function updateFileSystem(logicalId, physicalId, resourceType, properties, previousProperties, log, stateBorneDesired) {
57011
57512
  for (const key of [
@@ -57088,10 +57589,11 @@ async function applyBackupPolicy(fileSystemId, spec, log) {
57088
57589
  if (spec === void 0 || spec === null) return;
57089
57590
  const status = spec.Status;
57090
57591
  if (status === void 0) return;
57091
- await this.retryOnTransientControlPlane(() => this.getClient().send(new PutBackupPolicyCommand({
57592
+ const answered = await this.retryOnTransientControlPlane(() => this.getClient().send(new PutBackupPolicyCommand({
57092
57593
  FileSystemId: fileSystemId,
57093
57594
  BackupPolicy: { Status: status }
57094
57595
  })), `set BackupPolicy on ${fileSystemId}`, log);
57596
+ await waitForBackupPolicySettled(this.getClient(), fileSystemId, status, answered?.BackupPolicy?.Status, log);
57095
57597
  log.debug(`Set BackupPolicy Status=${log.value(status)} on EFS FileSystem ${fileSystemId}`);
57096
57598
  }
57097
57599
  async function applyFileSystemPolicy(fileSystemId, policy, bypass, log) {
@@ -57554,6 +58056,7 @@ async function createAccessPoint(logicalId, resourceType, properties, log) {
57554
58056
  logicalId,
57555
58057
  maxLength: 64
57556
58058
  });
58059
+ let createdAccessPointId;
57557
58060
  try {
57558
58061
  const response = await this.createOrAdoptAccessPoint(logicalId, resourceType, log, {
57559
58062
  ClientToken: clientToken.value,
@@ -57578,6 +58081,9 @@ async function createAccessPoint(logicalId, resourceType, properties, log) {
57578
58081
  });
57579
58082
  const accessPointId = response.AccessPointId;
57580
58083
  const arn = response.AccessPointArn;
58084
+ createdAccessPointId = accessPointId;
58085
+ reportCreatedResource(logicalId, resourceType, accessPointId);
58086
+ await waitForAccessPointAvailable(this.getClient(), logicalId, accessPointId, log);
57581
58087
  log.debug(`Successfully created EFS AccessPoint ${logicalId}: ${accessPointId}`);
57582
58088
  clientToken.release();
57583
58089
  return {
@@ -57590,7 +58096,9 @@ async function createAccessPoint(logicalId, resourceType, properties, log) {
57590
58096
  } catch (error) {
57591
58097
  if (error instanceof ProvisioningError) throw error;
57592
58098
  const cause = error instanceof Error ? error : void 0;
57593
- throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to create EFS AccessPoint ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause));
58099
+ const thrown = this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to create EFS AccessPoint ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause));
58100
+ if (createdAccessPointId !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdAccessPointId);
58101
+ throw thrown;
57594
58102
  }
57595
58103
  }
57596
58104
  async function createOrAdoptAccessPoint(logicalId, resourceType, log, input) {
@@ -67459,4 +67967,4 @@ var ACMCertificateProvider = class {
67459
67967
  };
67460
67968
 
67461
67969
  export { ACMCertificateProvider, ASGProvider, AgentCoreBrowserProvider, AgentCoreCodeInterpreterProvider, AgentCoreEvaluatorProvider, AgentCoreRuntimeProvider, ApiGatewayProvider, ApiGatewayV2Provider, AppConfigEnvironmentProvider, AppSyncProvider, BudgetsBudgetProvider, CloudFrontDistributionProvider, CloudFrontOACProvider, CloudFrontOAIProvider, CloudTrailProvider, CloudWatchAlarmProvider, CloudWatchAnomalyDetectorProvider, CodeBuildProvider, CodeCommitRepositoryProvider, CognitoUserPoolProvider, ConnectInstanceProvider, DLMLifecyclePolicyProvider, DocDBProvider, DocDBSubnetGroupProvider, DynamoDBGlobalTableProvider, DynamoDBTableProvider, EC2Provider, EC2VPCEndpointProvider, ECRProvider, ECSProvider, EFSProvider, ELBv2Provider, EMRClusterProvider, EMRInstanceFleetConfigProvider, EMRInstanceGroupConfigProvider, ElastiCacheProvider, EventBridgeArchiveProvider, EventBridgeBusProvider, EventBridgeRuleProvider, FSxFileSystemProvider, FirehoseProvider, GlueConnectionProvider, GlueCrawlerProvider, GlueJobProvider, GlueProvider, GlueSecurityConfigurationProvider, GlueTriggerProvider, GlueWorkflowProvider, IAMAccessKeyProvider, IAMInstanceProfileProvider, IAMManagedPolicyProvider, IAMPolicyProvider, IAMRoleProvider, IAMUserGroupProvider, KMSProvider, KinesisStreamConsumerProvider, KinesisStreamProvider, LambdaEventInvokeConfigProvider, LambdaEventSourceMappingProvider, LambdaFunctionProvider, LambdaLayerVersionProvider, LambdaMicrovmImageProvider, LambdaNetworkConnectorProvider, LambdaPermissionProvider, LambdaUrlProvider, LambdaWebFunctionEndpointProvider, LambdaWebFunctionRevisionProvider, LightsailAlarmProvider, LogsDeliveryDestinationProvider, LogsDeliveryProvider, LogsDeliverySourceProvider, LogsLogGroupProvider, NeptuneProvider, NestedStackProvider, PipesPipeProvider, RDSDBProxyEndpointProvider, RDSDBProxyProvider, RDSDBProxyTargetGroupProvider, RDSProvider, Route53Provider, S3BucketPolicyProvider, S3BucketProvider, S3DirectoryBucketProvider, S3TablesProvider, S3VectorsProvider, SNSSubscriptionProvider, SNSTopicPolicyProvider, SNSTopicProvider, SQSQueuePolicyProvider, SQSQueueProvider, SSMParameterProvider, SchedulerScheduleProvider, SecretsManagerSecretProvider, ServiceDiscoveryProvider, StepFunctionsProvider, WAFv2WebACLProvider, WaitConditionHandleProvider, WaitConditionProvider };
67462
- //# sourceMappingURL=provider-classes-BydpQUFi.js.map
67970
+ //# sourceMappingURL=provider-classes-BuCH49t_.js.map