@cdkd/cli 0.373.3 → 0.373.5
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.
- package/dist/{ambient-client-defaults-ChOenyD2.js → ambient-client-defaults-D2ziUucm.js} +3 -3
- package/dist/{ambient-client-defaults-ChOenyD2.js.map → ambient-client-defaults-D2ziUucm.js.map} +1 -1
- package/dist/{asg-provider-Bfinx42n.js → asg-provider-DXerSmY8.js} +8 -8
- package/dist/{asg-provider-Bfinx42n.js.map → asg-provider-DXerSmY8.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{custom-resource-runtime-9fjsDVrs.js → custom-resource-runtime-Z0UesGu4.js} +6 -6
- package/dist/{custom-resource-runtime-9fjsDVrs.js.map → custom-resource-runtime-Z0UesGu4.js.map} +1 -1
- package/dist/{db-associated-roles-Bn8HCQ2r.js → db-associated-roles-BVE6a5hy.js} +2 -2
- package/dist/{db-associated-roles-Bn8HCQ2r.js.map → db-associated-roles-BVE6a5hy.js.map} +1 -1
- package/dist/{delete-started-CiTP5c3_.js → delete-started-C-Fplb9I.js} +4 -4
- package/dist/{delete-started-CiTP5c3_.js.map → delete-started-C-Fplb9I.js.map} +1 -1
- package/dist/{deploy-engine-D7Iv9v8e.js → deploy-engine-7gPM_z0r.js} +282 -66
- package/dist/deploy-engine-7gPM_z0r.js.map +1 -0
- package/dist/{ec2-termination-protection-BXy91mrW.js → ec2-termination-protection-C3bNJVAK.js} +3 -3
- package/dist/{ec2-termination-protection-BXy91mrW.js.map → ec2-termination-protection-C3bNJVAK.js.map} +1 -1
- package/dist/{ecr-uri-DUDwEekn.js → ecr-uri-Dy7a2hEI.js} +2 -2
- package/dist/{ecr-uri-DUDwEekn.js.map → ecr-uri-Dy7a2hEI.js.map} +1 -1
- package/dist/{emr-cluster-provider-MokUAEGh.js → emr-cluster-provider-DpzQ2tXe.js} +80 -16
- package/dist/emr-cluster-provider-DpzQ2tXe.js.map +1 -0
- package/dist/{expected-bucket-owner-BrzB1C4p.js → expected-bucket-owner-NU2Veqhr.js} +2 -2
- package/dist/{expected-bucket-owner-BrzB1C4p.js.map → expected-bucket-owner-NU2Veqhr.js.map} +1 -1
- package/dist/{iam-role-provider-CB--BYVm.js → iam-role-provider-BK7LqipH.js} +12 -12
- package/dist/{iam-role-provider-CB--BYVm.js.map → iam-role-provider-BK7LqipH.js.map} +1 -1
- package/dist/{identity-read-denied-CoeMBkCz.js → identity-read-denied-BnZ-p9kt.js} +4 -4
- package/dist/{identity-read-denied-CoeMBkCz.js.map → identity-read-denied-BnZ-p9kt.js.map} +1 -1
- package/dist/{image-plan-RNp8hqc4.js → image-plan-7isjcxk3.js} +10 -10
- package/dist/{image-plan-RNp8hqc4.js.map → image-plan-7isjcxk3.js.map} +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{logger-Bfz63gW5.js → logger-CC9C99az.js} +2 -2
- package/dist/{logger-Bfz63gW5.js.map → logger-CC9C99az.js.map} +1 -1
- package/dist/{neptune-provider-BFwovty1.js → neptune-provider-CjjpqzLj.js} +9 -9
- package/dist/{neptune-provider-BFwovty1.js.map → neptune-provider-CjjpqzLj.js.map} +1 -1
- package/dist/{program-DR3X8-7x.js → program-Ce2id6tt.js} +678 -194
- package/dist/program-Ce2id6tt.js.map +1 -0
- package/dist/{provider-classes-BNZGFwNO.js → provider-classes-BesMsi8i.js} +748 -139
- package/dist/provider-classes-BesMsi8i.js.map +1 -0
- package/dist/{rds-provider-evebINWq.js → rds-provider-j7YCssyt.js} +13 -13
- package/dist/{rds-provider-evebINWq.js.map → rds-provider-j7YCssyt.js.map} +1 -1
- package/dist/{read-replica-BGoRAh10.js → read-replica-B3tUZd7q.js} +3 -3
- package/dist/{read-replica-BGoRAh10.js.map → read-replica-B3tUZd7q.js.map} +1 -1
- package/dist/{redacted-delete-address-rTL8ikg4.js → redacted-delete-address-DAZayV8w.js} +4 -4
- package/dist/{redacted-delete-address-rTL8ikg4.js.map → redacted-delete-address-DAZayV8w.js.map} +1 -1
- package/dist/{replacement-rules-roVU6gYR.js → replacement-rules-bf4K_Yka.js} +172 -69
- package/dist/replacement-rules-bf4K_Yka.js.map +1 -0
- package/dist/{created-resource-sink-D7iM5jwM.js → resource-deadline-D6p4x_pl.js} +108 -5
- package/dist/resource-deadline-D6p4x_pl.js.map +1 -0
- package/dist/{restore-source-guard-Dz_vQPiM.js → restore-source-guard-DRxM4nEI.js} +4 -4
- package/dist/{restore-source-guard-Dz_vQPiM.js.map → restore-source-guard-DRxM4nEI.js.map} +1 -1
- package/dist/{run-cli-vKsR6JeT.js → run-cli-B1pXbQh9.js} +2 -2
- package/dist/{run-cli-vKsR6JeT.js.map → run-cli-B1pXbQh9.js.map} +1 -1
- package/dist/{secret-reference-immutable-BF02Wobz.js → secret-reference-immutable-CGZO-iyw.js} +6 -6
- package/dist/{secret-reference-immutable-BF02Wobz.js.map → secret-reference-immutable-CGZO-iyw.js.map} +1 -1
- package/dist/{settle-own-write-members-CF-RPYMD.js → settle-own-write-members-WuNz0klP.js} +10 -10
- package/dist/{settle-own-write-members-CF-RPYMD.js.map → settle-own-write-members-WuNz0klP.js.map} +1 -1
- package/dist/{tag-list-DbmXev9Z.js → tag-list-DiQb3Tm9.js} +4 -4
- package/dist/{tag-list-DbmXev9Z.js.map → tag-list-DiQb3Tm9.js.map} +1 -1
- package/dist/update-removal-CBAhk3SI.js +82 -0
- package/dist/update-removal-CBAhk3SI.js.map +1 -0
- package/dist/{version-CP9RYTCy.js → version-CdLI5JxZ.js} +2 -2
- package/dist/{version-CP9RYTCy.js.map → version-CdLI5JxZ.js.map} +1 -1
- package/package.json +1 -1
- package/dist/created-resource-sink-D7iM5jwM.js.map +0 -1
- package/dist/deploy-engine-D7Iv9v8e.js.map +0 -1
- package/dist/emr-cluster-provider-MokUAEGh.js.map +0 -1
- package/dist/program-DR3X8-7x.js.map +0 -1
- package/dist/provider-classes-BNZGFwNO.js.map +0 -1
- package/dist/replacement-rules-roVU6gYR.js.map +0 -1
- package/dist/resource-deadline-B4Rp-3f7.js +0 -186
- package/dist/resource-deadline-B4Rp-3f7.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-
|
|
2
|
-
import { A as configStringRefusal, B as generateResourceName, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, J as getCurrentStackName, M as replayWarn, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, U as recordedGeneratedNameKept, V as generateResourceNameWithFallback, Y as isBeforeStateRead, c as VERBOSE_POINTER, d as describeAwsStatusReason, f as isAwsAuthoredFailure, g as verbosePointerTail, h as verbosePointerSentence, j as readConfigString, k as configIntegerRefusal, n as getLogger, p as safeStringify, q as getCurrentStackInstanceId, u as describeAwsFailure, w as generatedNameFor } from "./logger-
|
|
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-BK7LqipH.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-CC9C99az.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-
|
|
5
|
-
import { $ as
|
|
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-
|
|
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-
|
|
8
|
-
import { gt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted } from "./delete-started-
|
|
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-
|
|
10
|
-
import { i as redactedDeleteAddressSkip, n as isRedactedRecordedValue, r as redactedDeleteAddressFields, t as REDACTED_DELETE_ADDRESS_SKIP_REASON } from "./redacted-delete-address-
|
|
11
|
-
import { $ as streamTagsMatchDeclared, $
|
|
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-
|
|
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-
|
|
14
|
-
import { T as timePhase, n as unchangedBehindSecretReference, t as onlySecretReferencesDiffer, v as withRetry } from "./secret-reference-immutable-
|
|
15
|
-
import { a as principalOwnWriteMembers, c as stringListMember, n as declaredStringList, o as settleOwnWriteMembers } from "./settle-own-write-members-
|
|
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-D2ziUucm.js";
|
|
5
|
+
import { $t as markCreatedBeforeFailure, A as isPlainImportJson, At as compositeIdFormatMessage, B as markNotGone, Bt as isSecretDerivedValue, C as DriftReadRefusedError, D as holderRefusalRun, Dt as isInterruptedWaitError, E as holderRefusalMask, F as readNameProperty, G as rdsFamilyProtectionSite, H as deleteWithProtectionCompensation, Ht as maskerOrIdentity, I as refusalTypeShown, In as recordReferenceProvenanceEntry, It as segmentAfterAnchor, J as PROTECTION_FLIP_RETRY_WAIT_MS, Kt as clearCreatedBeforeFailure, L as remedyLogicalId, Lt as stateOrphanRecordRemedy, M as isQuotableImportValue, Mt as compositeIdSkipResult, N as normalizeAwsTagsToCfn, Nt as logicalIdShown, O as VALUE_NOT_SHOWN, Ot as startInterruptWatch, P as quotedRemedyLogicalId, Pt as packCompositeId, Q as isTerminalDbWaitStatus, Qi as injectiveKeyPrefix, Qt as markAuxiliaryFailure, R as resolveExplicitPhysicalId, Rn as snapshotPassProvenance, Rt as createMaskedLogSinks, S as withoutServerErrorRetries, St as recordedPrincipalsRepair, T as assertRegionMatch, U as logGroupProtectionSite, Un as hasMaskableValues, Ut as withDerivedNameMasks, Vr as recoverMaskedOutput, Vt as maskDeep, W as observeThenDisableProtection, Xi as withPasteableAwsProfile, Xr as recordAttributeIdCopy, Xt as isAuxiliaryFailure, Y as deleteAfterProtectionFlipWithFinalSnapshot, Yr as physicalNameCopiesOf, Z as isProceedDbStatus, Zi as injectiveKey, _ as createAttemptKey, _t as diffPrincipalNames, an as holdsMaskLeaf, at as ElapsedBudgetRegistry, b as replayedSendWindow, bn as markSameGenerationBag, bt as readPrincipalLists, cn as mentionsDynamicReference, ct as UNNAMEABLE_ID_CLAUSE, d as retractCreatedResource, dt as pasteableAwsCommand, en as markSupersedesEarlierCreate, et as ProtectionFlipRegistry, f as AMBIGUOUS_LATCH_TTL_MS, ft as protectedReplacementAdvice, g as ambiguousAttemptLead, gr as withoutPhysicalNameCopies, gt as SECRET_DERIVED_READ_LIVE, h as RecentIdSet, it as ElapsedBudget, j as isPlainImportValue, jt as compositeIdSeparatorRefusal, k as importRemedyCommand, kn as redactForState, kt as canonicalizeRoute53QueryName, l as reportCreatedResource, li as carriesSecretMask, lt as WITHHELD_AWS_COMMAND, m as CREATION_DATE_SKEW_MARGIN_MS, n as enclosingDeadlineRemainingMs, nt as protectionFlipKey, p as AmbiguousCreateLatch, pn as recordedSecrecyOf, pt as renderDisableCommand, q as userPoolProtectionSite, t as enclosingDeadlineExpired, ti as dynamicReferenceTokens, tt as isTerminalDeleteFailure, ut as isAwsCliLiteral, v as isInsideWindow, vt as holdsSecretDerivedEntry, w as RESOURCE_NOT_FOUND, x as setBounded, y as replayFollowedAmbiguousAttempt, yt as onlySecretDerived, zt as createMaskedRetryLogger } from "./resource-deadline-D6p4x_pl.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-CdLI5JxZ.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-BnZ-p9kt.js";
|
|
8
|
+
import { gt as slowCcOperationTimeoutMs, n as isRefusedByName, r as markDeleteStarted } from "./delete-started-C-Fplb9I.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-Ce2id6tt.js";
|
|
10
|
+
import { i as redactedDeleteAddressSkip, n as isRedactedRecordedValue, r as redactedDeleteAddressFields, t as REDACTED_DELETE_ADDRESS_SKIP_REASON } from "./redacted-delete-address-DAZayV8w.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-7gPM_z0r.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-DiQb3Tm9.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-DRxM4nEI.js";
|
|
14
|
+
import { T as timePhase, n as unchangedBehindSecretReference, t as onlySecretReferencesDiffer, v as withRetry } from "./secret-reference-immutable-CGZO-iyw.js";
|
|
15
|
+
import { a as principalOwnWriteMembers, c as stringListMember, n as declaredStringList, o as settleOwnWriteMembers } from "./settle-own-write-members-WuNz0klP.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-
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
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-
|
|
22
|
-
import { RDSProvider } from "./rds-provider-
|
|
23
|
-
import { NeptuneProvider } from "./neptune-provider-
|
|
24
|
-
import { ASGProvider } from "./asg-provider-
|
|
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-C3bNJVAK.js";
|
|
19
|
+
import { a as withRemovalDefaults, i as removedTemplateKeys, t as clearOnUpdateRemoval } from "./update-removal-CBAhk3SI.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-bf4K_Yka.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-DpzQ2tXe.js";
|
|
22
|
+
import { RDSProvider } from "./rds-provider-j7YCssyt.js";
|
|
23
|
+
import { NeptuneProvider } from "./neptune-provider-CjjpqzLj.js";
|
|
24
|
+
import { ASGProvider } from "./asg-provider-DXerSmY8.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";
|
|
@@ -11900,6 +11900,67 @@ const DEFAULT_BATCH_SIZE_BY_KIND = /* @__PURE__ */ new Map([
|
|
|
11900
11900
|
["documentdb", 100]
|
|
11901
11901
|
]);
|
|
11902
11902
|
|
|
11903
|
+
// src/provisioning/providers/lambda-eventsource/settle-wait.ts
|
|
11904
|
+
const SETTLING_STATES = /* @__PURE__ */ new Set([
|
|
11905
|
+
"Creating",
|
|
11906
|
+
"Updating",
|
|
11907
|
+
"Enabling",
|
|
11908
|
+
"Disabling"
|
|
11909
|
+
]);
|
|
11910
|
+
const MAPPING_SETTLE_POLL_MS = 1e3;
|
|
11911
|
+
const MAPPING_SETTLE_POLLS = 1800;
|
|
11912
|
+
const MAPPING_STALE_READ_GRACE_POLLS = 5;
|
|
11913
|
+
async function waitForMappingSettled(client, logicalId, uuid, expectedEnabled, log, opts = {}) {
|
|
11914
|
+
const pollMs = opts.pollMs ?? 1e3;
|
|
11915
|
+
const maxPolls = opts.maxPolls ?? 1800;
|
|
11916
|
+
const gracePolls = opts.staleReadGracePolls ?? 5;
|
|
11917
|
+
const notFoundGracePolls = opts.notFoundGracePolls ?? 0;
|
|
11918
|
+
let seenSettling = opts.answeredState === void 0 || !SETTLING_STATES.has(opts.answeredState);
|
|
11919
|
+
const expected = expectedEnabled === void 0 ? void 0 : expectedEnabled ? "Enabled" : "Disabled";
|
|
11920
|
+
const what = `event source mapping ${logicalId} to settle`;
|
|
11921
|
+
if (process.env["CDKD_NO_WAIT"] === "true") {
|
|
11922
|
+
log.debug(`Skipping the wait for ${what} (CDKD_NO_WAIT=true)`);
|
|
11923
|
+
return;
|
|
11924
|
+
}
|
|
11925
|
+
const watch = startInterruptWatch(log.mask(what));
|
|
11926
|
+
let last;
|
|
11927
|
+
try {
|
|
11928
|
+
for (let poll = 1; poll <= maxPolls; poll++) {
|
|
11929
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
11930
|
+
if (enclosingDeadlineRemainingMs() <= 0) throw markNonRetryable(new Error(log.mask(`The resource timeout expired while waiting for ${what} (last state: ${last ?? "none read"}); the change is not confirmed`)));
|
|
11931
|
+
let mapping;
|
|
11932
|
+
try {
|
|
11933
|
+
mapping = await client.send(new GetEventSourceMappingCommand({ UUID: uuid }));
|
|
11934
|
+
} catch (error) {
|
|
11935
|
+
const notYetVisible = error instanceof ResourceNotFoundException && poll <= notFoundGracePolls;
|
|
11936
|
+
if (!(notYetVisible || isThrottlingError(error) || isTransientServerError(error))) throw error;
|
|
11937
|
+
log.debug(`A read while waiting for ${what} failed (${notYetVisible ? "not yet visible" : "throttled or server-side"}); reading again`);
|
|
11938
|
+
}
|
|
11939
|
+
const settled = (state) => state === "Enabled" || state === "Disabled";
|
|
11940
|
+
if (mapping === void 0) {} else if (SETTLING_STATES.has(last = mapping.State ?? "unknown")) seenSettling = true;
|
|
11941
|
+
else if (settled(last) && !seenSettling && poll <= gracePolls) {} else if (settled(last) && (expected === void 0 || last === expected)) return;
|
|
11942
|
+
else if (settled(last)) {
|
|
11943
|
+
if (poll <= gracePolls) {} else {
|
|
11944
|
+
const reason = describeAwsStatusReason({ message: mapping.StateTransitionReason }, "");
|
|
11945
|
+
if (reason.redacted) log.debug(`Event source mapping ${logicalId} settled ${last}: ${reason.detail}`);
|
|
11946
|
+
log.warn(`Event source mapping ${logicalId} settled ${last}, but the template asks for ${expected}; ` + verboseAwareText("re-run with --verbose for Lambda's reason", "Lambda's reason is in the debug output above"));
|
|
11947
|
+
return;
|
|
11948
|
+
}
|
|
11949
|
+
} else {
|
|
11950
|
+
const head = `Event source mapping ${logicalId} settled as ${last}` + (expected !== void 0 ? `, expected ${expected}` : "");
|
|
11951
|
+
const reason = describeAwsStatusReason({ message: mapping.StateTransitionReason }, "");
|
|
11952
|
+
if (reason.redacted) log.debug(`${head}: ${reason.detail}`);
|
|
11953
|
+
throw markNonRetryable(new Error(log.mask(reason.redacted ? `${head}. ${reason.summary}` : head)));
|
|
11954
|
+
}
|
|
11955
|
+
if (poll === maxPolls) break;
|
|
11956
|
+
await new Promise((resolve) => setTimeout(resolve, Math.max(0, Math.min(pollMs, enclosingDeadlineRemainingMs()))));
|
|
11957
|
+
}
|
|
11958
|
+
} finally {
|
|
11959
|
+
watch.dispose();
|
|
11960
|
+
}
|
|
11961
|
+
throw markNonRetryable(new Error(log.mask(`Timed out waiting for ${what}: still ${last ?? "none read"} after ${maxPolls * pollMs / 1e3} seconds; the change is not confirmed`)));
|
|
11962
|
+
}
|
|
11963
|
+
|
|
11903
11964
|
// src/provisioning/providers/lambda-eventsource/create.ts
|
|
11904
11965
|
async function create$33(logicalId, resourceType, properties, context) {
|
|
11905
11966
|
const log = this.operationSinks(context?.maskSecrets, properties);
|
|
@@ -11907,6 +11968,7 @@ async function create$33(logicalId, resourceType, properties, context) {
|
|
|
11907
11968
|
const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, void 0, "Tags", DBPROXY_TAGS_WHAT, DBPROXY_TAG_OPTIONS);
|
|
11908
11969
|
const functionName = properties["FunctionName"];
|
|
11909
11970
|
if (!functionName) throw new ProvisioningError(`FunctionName is required for event source mapping ${logicalId}`, resourceType, logicalId);
|
|
11971
|
+
let createdUuid;
|
|
11910
11972
|
try {
|
|
11911
11973
|
const params = { FunctionName: functionName };
|
|
11912
11974
|
if (properties["EventSourceArn"]) params.EventSourceArn = properties["EventSourceArn"];
|
|
@@ -11960,6 +12022,12 @@ async function create$33(logicalId, resourceType, properties, context) {
|
|
|
11960
12022
|
mappingsCreatedByThisProcess.add(uuid);
|
|
11961
12023
|
const replayWindow = replayedSendWindow(response, attemptStartMs);
|
|
11962
12024
|
if (replayWindow !== void 0) await this.reportPossibleMappingOrphans(logicalId, replayWindow, log, functionName, params.EventSourceArn);
|
|
12025
|
+
createdUuid = uuid;
|
|
12026
|
+
reportCreatedResource(logicalId, resourceType, uuid);
|
|
12027
|
+
await waitForMappingSettled(this.lambdaClient, logicalId, uuid, coerceCfnBoolean(properties["Enabled"]) ?? true, log, {
|
|
12028
|
+
staleReadGracePolls: 0,
|
|
12029
|
+
notFoundGracePolls: 5
|
|
12030
|
+
});
|
|
11963
12031
|
log.debug(`Successfully created event source mapping ${logicalId}: ${uuid}`);
|
|
11964
12032
|
return {
|
|
11965
12033
|
physicalId: uuid,
|
|
@@ -11974,7 +12042,9 @@ async function create$33(logicalId, resourceType, properties, context) {
|
|
|
11974
12042
|
};
|
|
11975
12043
|
} catch (error) {
|
|
11976
12044
|
const cause = error instanceof Error ? error : void 0;
|
|
11977
|
-
|
|
12045
|
+
const thrown = this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to create event source mapping ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause));
|
|
12046
|
+
if (createdUuid === void 0) throw thrown;
|
|
12047
|
+
throw markNonRetryable(markCreatedBeforeFailure(thrown, logicalId, resourceType, createdUuid));
|
|
11978
12048
|
}
|
|
11979
12049
|
}
|
|
11980
12050
|
async function reportPossibleMappingOrphans(logicalId, window, log, functionName, sourceArn) {
|
|
@@ -12135,6 +12205,7 @@ async function applyUpdate$5(logicalId, physicalId, resourceType, properties, pr
|
|
|
12135
12205
|
}
|
|
12136
12206
|
if (wasSet("DocumentDBEventSourceConfig")) log.warn(safeMsg`${logicalId} (${resourceType}): DocumentDBEventSourceConfig ${removed()}; the mapping keeps its current DocumentDB settings, as CloudFormation keeps them. Declare the block with the values you want instead.`);
|
|
12137
12207
|
const updateResp = await this.lambdaClient.send(new UpdateEventSourceMappingCommand(updateParams));
|
|
12208
|
+
await waitForMappingSettled(this.lambdaClient, logicalId, physicalId, coerceCfnBoolean(updateParams.Enabled), log, { ...updateResp.State !== void 0 && { answeredState: updateResp.State } });
|
|
12138
12209
|
const eventSourceMappingArn = updateResp.EventSourceMappingArn;
|
|
12139
12210
|
if (eventSourceMappingArn) await this.applyTagDiff(eventSourceMappingArn, resourceType, logicalId, previousProperties["Tags"], properties["Tags"], log);
|
|
12140
12211
|
log.debug(`Successfully updated event source mapping ${logicalId}`);
|
|
@@ -15426,6 +15497,10 @@ async function applyKinesisStreamingDestination(tableName, spec, previousSpec, m
|
|
|
15426
15497
|
...precision ? { EnableKinesisStreamingConfiguration: { ApproximateCreationDateTimePrecision: precision } } : {}
|
|
15427
15498
|
})), `enable Kinesis streaming on ${tableName}`, void 0, { maskSecrets });
|
|
15428
15499
|
this.logger.debug(maskSecrets(`Enabled Kinesis streaming destination ${newArn} on DynamoDB table ${tableName}`));
|
|
15500
|
+
await waitForKinesisEnableActive(this.dynamoDBClient, tableName, newArn, `DynamoDB table ${tableName}`, {
|
|
15501
|
+
maskSecrets,
|
|
15502
|
+
debug: (message) => this.logger.debug(message)
|
|
15503
|
+
});
|
|
15429
15504
|
}
|
|
15430
15505
|
}
|
|
15431
15506
|
async function waitForKinesisDisableSettled(tableName, streamArn, maskSecrets) {
|
|
@@ -15858,13 +15933,18 @@ async function applyIndexContributorInsights(tableName, desiredIndexes, previous
|
|
|
15858
15933
|
async function sendContributorInsightsOp(tableName, op, maskSecrets) {
|
|
15859
15934
|
const debug = (message) => this.logger.debug(maskSecrets(message));
|
|
15860
15935
|
const target = op.indexName === void 0 ? `DynamoDB table ${tableName}` : this.indexScopeAt(op.indexName, tableName, maskSecrets);
|
|
15861
|
-
await this.retryOnTransientControlPlane(() => this.dynamoDBClient.send(new UpdateContributorInsightsCommand({
|
|
15936
|
+
const answered = await this.retryOnTransientControlPlane(() => this.dynamoDBClient.send(new UpdateContributorInsightsCommand({
|
|
15862
15937
|
TableName: tableName,
|
|
15863
15938
|
...op.indexName !== void 0 ? { IndexName: op.indexName } : {},
|
|
15864
15939
|
ContributorInsightsAction: op.action,
|
|
15865
15940
|
...op.mode !== void 0 ? { ContributorInsightsMode: op.mode } : {}
|
|
15866
15941
|
})), `set ContributorInsights on ${target}`);
|
|
15867
15942
|
debug(`Set ContributorInsightsAction=${op.action}${op.mode !== void 0 ? ` Mode=${op.mode}` : ""} on ${target}`);
|
|
15943
|
+
await waitForContributorInsightsSettled(this.dynamoDBClient, tableName, op.indexName, op.action, target, {
|
|
15944
|
+
maskSecrets,
|
|
15945
|
+
debug,
|
|
15946
|
+
...answered?.ContributorInsightsStatus !== void 0 && { answeredStatus: answered.ContributorInsightsStatus }
|
|
15947
|
+
});
|
|
15868
15948
|
}
|
|
15869
15949
|
|
|
15870
15950
|
// src/provisioning/providers/dynamodb-table/table-settings.ts
|
|
@@ -25168,45 +25248,56 @@ async function ensureIamInstanceProfileAssociated(instanceId, arn, name, logical
|
|
|
25168
25248
|
return;
|
|
25169
25249
|
}
|
|
25170
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())));
|
|
25171
25258
|
const maxAttempts = 10;
|
|
25172
|
-
|
|
25173
|
-
|
|
25174
|
-
|
|
25175
|
-
|
|
25176
|
-
|
|
25177
|
-
|
|
25178
|
-
|
|
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;
|
|
25179
25284
|
}
|
|
25180
|
-
}));
|
|
25181
|
-
this.logger.debug(`AssociateIamInstanceProfile issued for instance ${instanceId} (${logicalId}) on attempt ${attempt}`);
|
|
25182
|
-
associated = true;
|
|
25183
|
-
break;
|
|
25184
|
-
} catch (error) {
|
|
25185
|
-
const msg = describeAwsFailure(error).detail;
|
|
25186
|
-
if (msg.includes("IncorrectState") || msg.includes("already associated")) {
|
|
25187
|
-
this.logger.debug(`IAM instance profile already associated with instance ${instanceId} (${logicalId})`);
|
|
25188
|
-
associated = true;
|
|
25189
|
-
break;
|
|
25190
|
-
}
|
|
25191
|
-
if (this.isInstanceProfilePropagationError(msg) && attempt < maxAttempts) {
|
|
25192
|
-
this.logger.debug(`IAM instance profile not yet propagated for instance ${instanceId} (associate attempt ${attempt}/${maxAttempts}: ${msg}), retrying in ${attempt}s...`);
|
|
25193
|
-
await this.sleep(attempt * 1e3);
|
|
25194
|
-
continue;
|
|
25195
|
-
}
|
|
25196
|
-
throw error;
|
|
25197
|
-
}
|
|
25198
|
-
if (!associated) return;
|
|
25199
|
-
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
25200
|
-
if (await this.isInstanceProfileAssociated(instanceId)) {
|
|
25201
|
-
this.logger.debug(`IAM instance profile is now associated with instance ${instanceId} (${logicalId})`);
|
|
25202
|
-
return;
|
|
25203
25285
|
}
|
|
25204
|
-
|
|
25205
|
-
|
|
25206
|
-
await this.
|
|
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
|
+
}
|
|
25207
25296
|
}
|
|
25297
|
+
} finally {
|
|
25298
|
+
watch.dispose();
|
|
25208
25299
|
}
|
|
25209
|
-
|
|
25300
|
+
throw markNonRetryable(notConfirmed(`did not read associated within the propagation window (${maxAttempts} reads)`));
|
|
25210
25301
|
}
|
|
25211
25302
|
async function isInstanceProfileAssociated(instanceId) {
|
|
25212
25303
|
try {
|
|
@@ -25230,18 +25321,96 @@ const instanceCreateMethods = {
|
|
|
25230
25321
|
isInstanceProfilePropagationError
|
|
25231
25322
|
};
|
|
25232
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
|
+
|
|
25233
25398
|
// src/provisioning/providers/ec2/instance-update.ts
|
|
25234
25399
|
async function updateInstance(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
25235
25400
|
this.logger.debug(`Updating EC2 Instance ${logicalId}: ${physicalId}`);
|
|
25236
25401
|
refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
|
|
25237
25402
|
this.guardTerminationProtectionRemoval(logicalId, physicalId, resourceType, properties, previousProperties, context);
|
|
25238
25403
|
const memberPlan = this.planInstanceMemberUpdates(logicalId, physicalId, resourceType, properties, previousProperties, context);
|
|
25404
|
+
const mask = maskerOrIdentity(context?.maskSecrets);
|
|
25239
25405
|
try {
|
|
25240
25406
|
await this.prepareInstanceMemberUpdates(logicalId, physicalId, resourceType, memberPlan);
|
|
25241
|
-
await this.applyTagDiff(physicalId, resourceType, logicalId, previousProperties["Tags"], properties["Tags"],
|
|
25242
|
-
await this.updateInstanceSecurityProps(physicalId, properties, previousProperties
|
|
25243
|
-
|
|
25244
|
-
|
|
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);
|
|
25245
25414
|
const instance = (await this.ec2Client.send(new DescribeInstancesCommand({ InstanceIds: [physicalId] }))).Reservations?.[0]?.Instances?.[0];
|
|
25246
25415
|
return {
|
|
25247
25416
|
physicalId,
|
|
@@ -25251,7 +25420,7 @@ async function updateInstance(logicalId, physicalId, resourceType, properties, p
|
|
|
25251
25420
|
} catch (error) {
|
|
25252
25421
|
if (error instanceof CdkdError || isInterruptedWaitError(error)) throw error;
|
|
25253
25422
|
const cause = error instanceof Error ? error : void 0;
|
|
25254
|
-
throw this.wrapCaughtError(
|
|
25423
|
+
throw this.wrapCaughtError(mask, error, (text) => new ProvisioningError(`Failed to update EC2 Instance ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
25255
25424
|
}
|
|
25256
25425
|
}
|
|
25257
25426
|
function guardTerminationProtectionRemoval(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
@@ -25262,7 +25431,13 @@ function guardTerminationProtectionRemoval(logicalId, physicalId, resourceType,
|
|
|
25262
25431
|
}
|
|
25263
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));
|
|
25264
25433
|
}
|
|
25265
|
-
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
|
+
};
|
|
25266
25441
|
const newDisableApiTermination = this.coerceBool(properties["DisableApiTermination"]);
|
|
25267
25442
|
const oldDisableApiTermination = this.coerceBool(previousProperties["DisableApiTermination"]);
|
|
25268
25443
|
if (newDisableApiTermination !== void 0 && newDisableApiTermination !== oldDisableApiTermination) await this.ec2Client.send(new ModifyInstanceAttributeCommand({
|
|
@@ -25274,13 +25449,17 @@ async function updateInstanceSecurityProps(physicalId, properties, previousPrope
|
|
|
25274
25449
|
if (newMonitoring !== void 0 && newMonitoring !== oldMonitoring) {
|
|
25275
25450
|
if (newMonitoring) await this.ec2Client.send(new MonitorInstancesCommand({ InstanceIds: [physicalId] }));
|
|
25276
25451
|
else await this.ec2Client.send(new UnmonitorInstancesCommand({ InstanceIds: [physicalId] }));
|
|
25452
|
+
await waitForInstanceMonitoringSettled(site, newMonitoring);
|
|
25277
25453
|
}
|
|
25278
25454
|
const newMetadata = this.buildMetadataOptions(properties);
|
|
25279
25455
|
const oldMetadata = this.buildMetadataOptions(previousProperties);
|
|
25280
|
-
if (newMetadata !== void 0 && !this.shallowEqual(newMetadata, oldMetadata))
|
|
25281
|
-
|
|
25282
|
-
|
|
25283
|
-
|
|
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
|
+
}
|
|
25284
25463
|
const newCpuCredits = this.readCpuCredits(properties["CreditSpecification"]);
|
|
25285
25464
|
const oldCpuCredits = this.readCpuCredits(previousProperties["CreditSpecification"]);
|
|
25286
25465
|
if (newCpuCredits !== void 0 && newCpuCredits !== oldCpuCredits) await this.ec2Client.send(new ModifyInstanceCreditSpecificationCommand({ InstanceCreditSpecifications: [{
|
|
@@ -25564,7 +25743,7 @@ async function prepareInstanceMemberUpdates(logicalId, physicalId, resourceType,
|
|
|
25564
25743
|
ids: [await this.vpcDefaultSecurityGroupId(logicalId, physicalId, resourceType, instance?.VpcId)]
|
|
25565
25744
|
};
|
|
25566
25745
|
}
|
|
25567
|
-
async function applyInstanceMemberUpdates(logicalId, physicalId, resourceType, plan) {
|
|
25746
|
+
async function applyInstanceMemberUpdates(logicalId, physicalId, resourceType, plan, maskSecrets) {
|
|
25568
25747
|
const applied = [];
|
|
25569
25748
|
if (plan.securityGroups?.kind === "set") {
|
|
25570
25749
|
await this.ec2Client.send(new ModifyInstanceAttributeCommand({
|
|
@@ -25574,7 +25753,7 @@ async function applyInstanceMemberUpdates(logicalId, physicalId, resourceType, p
|
|
|
25574
25753
|
applied.push("the new SecurityGroupIds");
|
|
25575
25754
|
}
|
|
25576
25755
|
if (plan.profile !== void 0) {
|
|
25577
|
-
await this.applyInstanceProfileChange(logicalId, physicalId, plan.profile);
|
|
25756
|
+
await this.applyInstanceProfileChange(logicalId, physicalId, plan.profile, maskSecrets);
|
|
25578
25757
|
applied.push(plan.profile.kind === "remove" ? "the IamInstanceProfile removed" : "the new IamInstanceProfile");
|
|
25579
25758
|
}
|
|
25580
25759
|
if (plan.deleteOnTermination !== void 0) {
|
|
@@ -25884,7 +26063,7 @@ async function vpcDefaultSecurityGroupId(logicalId, physicalId, resourceType, vp
|
|
|
25884
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));
|
|
25885
26064
|
return id;
|
|
25886
26065
|
}
|
|
25887
|
-
async function applyInstanceProfileChange(logicalId, physicalId, change) {
|
|
26066
|
+
async function applyInstanceProfileChange(logicalId, physicalId, change, maskSecrets) {
|
|
25888
26067
|
let assoc = await this.ec2Client.send(new DescribeIamInstanceProfileAssociationsCommand({ Filters: [{
|
|
25889
26068
|
Name: "instance-id",
|
|
25890
26069
|
Values: [physicalId]
|
|
@@ -25897,31 +26076,51 @@ async function applyInstanceProfileChange(logicalId, physicalId, change) {
|
|
|
25897
26076
|
}] }));
|
|
25898
26077
|
}
|
|
25899
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
|
+
};
|
|
25900
26087
|
if (change.kind === "remove") {
|
|
25901
26088
|
if (current?.AssociationId === void 0) return;
|
|
25902
26089
|
await this.ec2Client.send(new DisassociateIamInstanceProfileCommand({ AssociationId: current.AssociationId }));
|
|
26090
|
+
await waitForInstanceProfileAssociationSettled(site, {
|
|
26091
|
+
kind: "disassociated",
|
|
26092
|
+
associationId: current.AssociationId
|
|
26093
|
+
});
|
|
25903
26094
|
return;
|
|
25904
26095
|
}
|
|
25905
26096
|
const spec = change.arn !== void 0 ? { Arn: change.arn } : { Name: change.name };
|
|
25906
26097
|
const maxAttempts = 10;
|
|
25907
|
-
for (let attempt = 1;; attempt++)
|
|
25908
|
-
|
|
25909
|
-
|
|
25910
|
-
|
|
25911
|
-
|
|
25912
|
-
|
|
25913
|
-
|
|
25914
|
-
|
|
25915
|
-
|
|
25916
|
-
|
|
25917
|
-
|
|
25918
|
-
|
|
25919
|
-
|
|
25920
|
-
|
|
25921
|
-
|
|
25922
|
-
|
|
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;
|
|
25923
26116
|
}
|
|
25924
|
-
|
|
26117
|
+
await waitForInstanceProfileAssociationSettled(site, {
|
|
26118
|
+
kind: "associated",
|
|
26119
|
+
associationId: sent?.IamInstanceProfileAssociation?.AssociationId,
|
|
26120
|
+
arn: change.arn,
|
|
26121
|
+
name: change.name
|
|
26122
|
+
});
|
|
26123
|
+
return;
|
|
25925
26124
|
}
|
|
25926
26125
|
}
|
|
25927
26126
|
function shallowEqual(a, b) {
|
|
@@ -34008,6 +34207,26 @@ async function waitForRuntimeSettledBeforeDelete(deps, agentRuntimeId, logicalId
|
|
|
34008
34207
|
watch.dispose();
|
|
34009
34208
|
}
|
|
34010
34209
|
}
|
|
34210
|
+
const RUNTIME_DELETE_MAX_WAIT_MS = 6e5;
|
|
34211
|
+
async function waitForRuntimeGoneAfterDelete(deps, agentRuntimeId, logicalId, resourceType) {
|
|
34212
|
+
await waitForGoneAfterDelete({
|
|
34213
|
+
what: `BedrockAgentCore Runtime ${agentRuntimeId}`,
|
|
34214
|
+
resourceType,
|
|
34215
|
+
describe: async () => {
|
|
34216
|
+
try {
|
|
34217
|
+
return (await deps.client.send(new GetAgentRuntimeCommand({ agentRuntimeId }))).status ?? "DELETING";
|
|
34218
|
+
} catch (error) {
|
|
34219
|
+
if (error instanceof ResourceNotFoundException$6) return void 0;
|
|
34220
|
+
throw error;
|
|
34221
|
+
}
|
|
34222
|
+
},
|
|
34223
|
+
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,
|
|
34224
|
+
logger: deps.logger,
|
|
34225
|
+
pollIntervalMs: RUNTIME_WAIT_POLL_MS,
|
|
34226
|
+
maxWaitMs: RUNTIME_DELETE_MAX_WAIT_MS,
|
|
34227
|
+
sleep: deps.sleep
|
|
34228
|
+
});
|
|
34229
|
+
}
|
|
34011
34230
|
async function retireFailedRuntimeCreate(deps, agentRuntimeId, region, mask) {
|
|
34012
34231
|
try {
|
|
34013
34232
|
await deps.client.send(new DeleteAgentRuntimeCommand({ agentRuntimeId }));
|
|
@@ -34279,7 +34498,6 @@ var AgentCoreRuntimeProvider = class {
|
|
|
34279
34498
|
await waitForRuntimeSettledBeforeDelete(this.waitDeps(), physicalId, logicalId);
|
|
34280
34499
|
try {
|
|
34281
34500
|
await this.client.send(new DeleteAgentRuntimeCommand({ agentRuntimeId: physicalId }));
|
|
34282
|
-
this.logger.debug(`Successfully deleted BedrockAgentCore Runtime ${logicalId}`);
|
|
34283
34501
|
} catch (error) {
|
|
34284
34502
|
if (error instanceof ResourceNotFoundException$6) {
|
|
34285
34503
|
const clientRegion = await this.client.config.region();
|
|
@@ -34291,6 +34509,11 @@ var AgentCoreRuntimeProvider = class {
|
|
|
34291
34509
|
const thrown = this.wrapCaughtError(maskerOrIdentity(context?.maskSecrets), error, (text) => new ProvisioningError(`Failed to delete BedrockAgentCore Runtime ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
34292
34510
|
throw error instanceof Error && error.name.includes("NotFound") ? markNotGone(thrown) : thrown;
|
|
34293
34511
|
}
|
|
34512
|
+
await waitForRuntimeGoneAfterDelete({
|
|
34513
|
+
...this.waitDeps(),
|
|
34514
|
+
logger: this.logger
|
|
34515
|
+
}, physicalId, logicalId, resourceType);
|
|
34516
|
+
this.logger.debug(`Successfully deleted BedrockAgentCore Runtime ${logicalId}`);
|
|
34294
34517
|
}
|
|
34295
34518
|
buildAttributes(response, agentRuntimeName) {
|
|
34296
34519
|
const attributes = definedAttributes({
|
|
@@ -35528,6 +35751,69 @@ async function waitForOwnCapacityProviderPut(client, logicalId, cluster, log, pu
|
|
|
35528
35751
|
const reason = failed.length > 0 ? `: ${log.mask(failed.join("; "))}` : "";
|
|
35529
35752
|
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));
|
|
35530
35753
|
}
|
|
35754
|
+
const CLUSTER_SETTLE_POLL_MS = 1e3;
|
|
35755
|
+
const CLUSTER_SETTLE_POLLS = 600;
|
|
35756
|
+
const CLUSTER_STALE_READ_GRACE_POLLS = 3;
|
|
35757
|
+
const CLUSTER_NOT_VISIBLE_GRACE_POLLS = 5;
|
|
35758
|
+
function settling(cluster) {
|
|
35759
|
+
return cluster?.status === "PROVISIONING" || cluster?.attachmentsStatus === IN_PROGRESS;
|
|
35760
|
+
}
|
|
35761
|
+
function clusterWriteNeedsSettle(sentServiceConnect, answered) {
|
|
35762
|
+
return sentServiceConnect || settling(answered);
|
|
35763
|
+
}
|
|
35764
|
+
async function waitForClusterSettled(client, logicalId, cluster, log, answered, opts = {}) {
|
|
35765
|
+
const pollMs = opts.pollMs ?? 1e3;
|
|
35766
|
+
const maxPolls = opts.maxPolls ?? 600;
|
|
35767
|
+
const gracePolls = opts.staleReadGracePolls ?? 3;
|
|
35768
|
+
const what = `ECS cluster ${logicalId} to settle`;
|
|
35769
|
+
if (process.env["CDKD_NO_WAIT"] === "true") {
|
|
35770
|
+
log.debug(`Skipping the wait for ${what} (CDKD_NO_WAIT=true)`);
|
|
35771
|
+
return;
|
|
35772
|
+
}
|
|
35773
|
+
const clusterSettleFailure = (head, failed) => {
|
|
35774
|
+
const attachments = (failed?.attachments ?? []).filter((a) => FAILED_ATTACHMENT.test(a.status ?? "")).map((a) => {
|
|
35775
|
+
const details = (a.details ?? []).map((d) => `${d.name ?? "?"}=${d.value ?? ""}`).join(", ");
|
|
35776
|
+
return `${a.type ?? "attachment"} ${a.id ?? ""} ${a.status ?? ""}${details ? ` (${details})` : ""}`.trim();
|
|
35777
|
+
});
|
|
35778
|
+
const reason = describeAwsStatusReason({ message: attachments.join("; ") }, "");
|
|
35779
|
+
if (reason.redacted) log.debug(`${head}: ${reason.detail}`);
|
|
35780
|
+
return markNonRetryable(new ProvisioningError(log.mask(reason.redacted ? `${head}. ${reason.summary}` : head), CLUSTER_TYPE, logicalId, cluster));
|
|
35781
|
+
};
|
|
35782
|
+
const describeLast = (c) => c === void 0 ? "none read" : `${c.status ?? "unknown"} / attachments ${c.attachmentsStatus ?? "none"}`;
|
|
35783
|
+
let seenSettling = gracePolls === 0 || settling(answered);
|
|
35784
|
+
const watch = startInterruptWatch(log.mask(what));
|
|
35785
|
+
let last;
|
|
35786
|
+
try {
|
|
35787
|
+
for (let poll = 1; poll <= maxPolls; poll++) {
|
|
35788
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
35789
|
+
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`)));
|
|
35790
|
+
let read = false;
|
|
35791
|
+
try {
|
|
35792
|
+
last = await describeAttachments(client, cluster);
|
|
35793
|
+
read = true;
|
|
35794
|
+
} catch (error) {
|
|
35795
|
+
if (!(isThrottlingError(error) || isTransientServerError(error))) throw error;
|
|
35796
|
+
log.debug(`A read while waiting for ${what} was throttled or failed server-side; reading again`);
|
|
35797
|
+
}
|
|
35798
|
+
if (read) {
|
|
35799
|
+
if (last === void 0) {
|
|
35800
|
+
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);
|
|
35801
|
+
} else if (last.status === "FAILED") throw clusterSettleFailure(`ECS cluster ${logicalIdShown(logicalId)} (${log.value(cluster)}) settled as ${describeLast(last)}, expected ACTIVE / attachments UPDATE_COMPLETE`, last);
|
|
35802
|
+
else if (settling(last)) seenSettling = true;
|
|
35803
|
+
else if (!seenSettling && poll <= gracePolls) {} else if (last.status === "ACTIVE" && (last.attachmentsStatus === void 0 || last.attachmentsStatus === "UPDATE_COMPLETE")) return;
|
|
35804
|
+
else if (last.status === "ACTIVE" && last.attachmentsStatus === "UPDATE_FAILED" && !seenSettling) {
|
|
35805
|
+
log.warn(`ECS cluster ${log.value(cluster)} still reports UPDATE_FAILED attachments from before this update, which never showed UPDATE_IN_PROGRESS; continuing`);
|
|
35806
|
+
return;
|
|
35807
|
+
} else throw clusterSettleFailure(`ECS cluster ${logicalIdShown(logicalId)} (${log.value(cluster)}) settled as ${describeLast(last)}, expected ACTIVE / attachments UPDATE_COMPLETE`, last);
|
|
35808
|
+
}
|
|
35809
|
+
if (poll === maxPolls) break;
|
|
35810
|
+
await clusterAttachmentsWait.sleep(Math.max(0, Math.min(pollMs, enclosingDeadlineRemainingMs())));
|
|
35811
|
+
}
|
|
35812
|
+
} finally {
|
|
35813
|
+
watch.dispose();
|
|
35814
|
+
}
|
|
35815
|
+
throw markNonRetryable(new Error(log.mask(`Timed out waiting for ${what}: still ${describeLast(last)} after ${maxPolls * pollMs / 1e3} seconds; the change is not confirmed`)));
|
|
35816
|
+
}
|
|
35531
35817
|
|
|
35532
35818
|
// src/provisioning/providers/ecs/cluster-task-definition.ts
|
|
35533
35819
|
async function createCluster(logicalId, resourceType, properties, log) {
|
|
@@ -35535,6 +35821,7 @@ async function createCluster(logicalId, resourceType, properties, log) {
|
|
|
35535
35821
|
const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
|
|
35536
35822
|
const client = this.getClient();
|
|
35537
35823
|
const clusterName = properties["ClusterName"] || this.generatedCreateName(resourceType, logicalId, properties);
|
|
35824
|
+
let createdName;
|
|
35538
35825
|
try {
|
|
35539
35826
|
const cluster = (await client.send(new CreateClusterCommand({
|
|
35540
35827
|
clusterName,
|
|
@@ -35549,14 +35836,22 @@ async function createCluster(logicalId, resourceType, properties, log) {
|
|
|
35549
35836
|
tags: convertTags(desiredTags)
|
|
35550
35837
|
}))).cluster;
|
|
35551
35838
|
if (!cluster || !cluster.clusterArn) throw new Error("CreateCluster did not return cluster ARN");
|
|
35839
|
+
const physicalId = cluster.clusterName ?? clusterName;
|
|
35840
|
+
if (clusterWriteNeedsSettle(Boolean(properties["ServiceConnectDefaults"]), cluster)) {
|
|
35841
|
+
createdName = physicalId;
|
|
35842
|
+
reportCreatedResource(logicalId, resourceType, physicalId);
|
|
35843
|
+
await waitForClusterSettled(client, logicalId, physicalId, log, cluster, { staleReadGracePolls: 0 });
|
|
35844
|
+
}
|
|
35552
35845
|
log.debug(`Successfully created ECS cluster ${logicalId}: ${cluster.clusterArn}`);
|
|
35553
35846
|
return {
|
|
35554
|
-
physicalId
|
|
35847
|
+
physicalId,
|
|
35555
35848
|
attributes: { Arn: cluster.clusterArn }
|
|
35556
35849
|
};
|
|
35557
35850
|
} catch (error) {
|
|
35558
35851
|
const cause = error instanceof Error ? error : void 0;
|
|
35559
|
-
|
|
35852
|
+
const thrown = this.wrapCaughtError(log.mask, error, (text) => new ProvisioningError(`Failed to create ECS cluster ${logicalId}: ${text}`, resourceType, logicalId, clusterName, cause));
|
|
35853
|
+
if (createdName !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdName);
|
|
35854
|
+
throw thrown;
|
|
35560
35855
|
}
|
|
35561
35856
|
}
|
|
35562
35857
|
async function updateCluster(logicalId, physicalId, resourceType, properties, previousProperties, log) {
|
|
@@ -35583,13 +35878,14 @@ async function updateCluster(logicalId, physicalId, resourceType, properties, pr
|
|
|
35583
35878
|
value: (s["Value"] || s["value"]) ?? void 0
|
|
35584
35879
|
})) : void 0;
|
|
35585
35880
|
const svcConnectInput = svcConnectChanged ? properties["ServiceConnectDefaults"] ? { namespace: properties["ServiceConnectDefaults"]["Namespace"] } : { namespace: "" } : void 0;
|
|
35586
|
-
await sendWhenAttachmentsSettle(client, logicalId, physicalId, log, () => client.send(new UpdateClusterCommand({
|
|
35881
|
+
const updateResponse = await sendWhenAttachmentsSettle(client, logicalId, physicalId, log, () => client.send(new UpdateClusterCommand({
|
|
35587
35882
|
cluster: physicalId,
|
|
35588
35883
|
...settingsChanged && { settings: settingsInput },
|
|
35589
35884
|
...configChanged && { configuration: this.convertClusterConfiguration(properties["Configuration"]) },
|
|
35590
35885
|
...svcConnectChanged && { serviceConnectDefaults: svcConnectInput }
|
|
35591
35886
|
})));
|
|
35592
35887
|
log.debug(`Updated ECS cluster ${shownCluster} (settings=${settingsChanged}, config=${configChanged}, svcConnect=${svcConnectChanged})`);
|
|
35888
|
+
if (clusterWriteNeedsSettle(svcConnectChanged, updateResponse?.cluster)) await waitForClusterSettled(client, logicalId, physicalId, log, updateResponse?.cluster);
|
|
35593
35889
|
}
|
|
35594
35890
|
const cluster = (await client.send(new DescribeClustersCommand({ clusters: [physicalId] }))).clusters?.[0];
|
|
35595
35891
|
if (cluster?.clusterArn) await this.applyTagDiff(cluster.clusterArn, resourceType, logicalId, previousProperties["Tags"], properties["Tags"], log);
|
|
@@ -37426,7 +37722,7 @@ function isWellFormedTarget(entry, side, ignoreSecrets = false) {
|
|
|
37426
37722
|
if (quic != null && (typeof quic !== "string" || quic.length === 0)) return false;
|
|
37427
37723
|
return az == null || typeof az === "string" && az.length > 0;
|
|
37428
37724
|
}
|
|
37429
|
-
function readTargets(value, side) {
|
|
37725
|
+
function readTargets$1(value, side) {
|
|
37430
37726
|
if (value === void 0 || value === null) return {
|
|
37431
37727
|
kind: "list",
|
|
37432
37728
|
items: []
|
|
@@ -38008,7 +38304,7 @@ async function updateLoadBalancer(logicalId, physicalId, resourceType, propertie
|
|
|
38008
38304
|
async function createTargetGroup(logicalId, resourceType, properties, maskSecrets) {
|
|
38009
38305
|
this.logger.debug(`Creating TargetGroup ${logicalId}`);
|
|
38010
38306
|
const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
|
|
38011
|
-
const desiredTargets = readTargets(properties["Targets"], "desired");
|
|
38307
|
+
const desiredTargets = readTargets$1(properties["Targets"], "desired");
|
|
38012
38308
|
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));
|
|
38013
38309
|
let leftBehindArn;
|
|
38014
38310
|
try {
|
|
@@ -38423,10 +38719,10 @@ function diffAttributeBag(bag, logicalId, desired, previous, removalValue, fromR
|
|
|
38423
38719
|
return submitted;
|
|
38424
38720
|
}
|
|
38425
38721
|
async function readUpdateTargets(logicalId, physicalId, resourceType, desiredRaw, recordedRaw, groupPort) {
|
|
38426
|
-
const desired = readTargets(desiredRaw, "desired");
|
|
38722
|
+
const desired = readTargets$1(desiredRaw, "desired");
|
|
38427
38723
|
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));
|
|
38428
38724
|
const newTargets = toTargetDescriptions(desired.items, groupPort);
|
|
38429
|
-
const recorded = readTargets(recordedRaw, "recorded");
|
|
38725
|
+
const recorded = readTargets$1(recordedRaw, "recorded");
|
|
38430
38726
|
if (recorded.kind === "list") return {
|
|
38431
38727
|
newTargets,
|
|
38432
38728
|
oldTargets: toTargetDescriptions(removableRecordedTargets(recorded.items), groupPort)
|
|
@@ -39967,6 +40263,105 @@ function withoutKey(bag, key) {
|
|
|
39967
40263
|
return rest;
|
|
39968
40264
|
}
|
|
39969
40265
|
|
|
40266
|
+
// src/provisioning/providers/rds-dbproxy-targetgroup/settle-wait.ts
|
|
40267
|
+
const PROXY_TARGETS_POLL_MS = 3e3;
|
|
40268
|
+
const PROXY_TARGETS_POLLS = 300;
|
|
40269
|
+
const PROXY_TARGET_FAILURE_GRACE_POLLS = 3;
|
|
40270
|
+
const FAILURE_REASONS = /* @__PURE__ */ new Set([
|
|
40271
|
+
"CONNECTION_FAILED",
|
|
40272
|
+
"AUTH_FAILURE",
|
|
40273
|
+
"INVALID_REPLICATION_STATE"
|
|
40274
|
+
]);
|
|
40275
|
+
function rowsFor(targets, kind, id) {
|
|
40276
|
+
return targets.filter((t) => kind === "cluster" ? t.Type !== "TRACKED_CLUSTER" && t.TrackedClusterId === id : t.Type !== "TRACKED_CLUSTER" && !t.TrackedClusterId && t.RdsResourceId === id);
|
|
40277
|
+
}
|
|
40278
|
+
const healthOf = (t) => [t.TargetHealth?.State ?? "no state", t.TargetHealth?.Reason].filter(Boolean).join("/");
|
|
40279
|
+
async function waitForProxyTargetsAvailable(client, logicalId, dbProxyName, targetGroupName, registered, log, wrapReadError, opts = {}) {
|
|
40280
|
+
const what = `the targets of DB proxy target group ${logicalId} to read AVAILABLE`;
|
|
40281
|
+
if (registered.clusters.length === 0 && registered.instances.length === 0) return;
|
|
40282
|
+
if (process.env["CDKD_NO_WAIT"] === "true") {
|
|
40283
|
+
log.debug(`Skipping the wait for ${what} (CDKD_NO_WAIT=true)`);
|
|
40284
|
+
return;
|
|
40285
|
+
}
|
|
40286
|
+
const pollMs = opts.pollMs ?? 3e3;
|
|
40287
|
+
const maxPolls = opts.maxPolls ?? 300;
|
|
40288
|
+
const watched = [...registered.clusters.map((id) => ({
|
|
40289
|
+
kind: "cluster",
|
|
40290
|
+
id
|
|
40291
|
+
})), ...registered.instances.map((id) => ({
|
|
40292
|
+
kind: "instance",
|
|
40293
|
+
id
|
|
40294
|
+
}))];
|
|
40295
|
+
let last = "none read";
|
|
40296
|
+
let failingPolls = 0;
|
|
40297
|
+
const watch = startInterruptWatch(log.mask(what));
|
|
40298
|
+
try {
|
|
40299
|
+
for (let poll = 1; poll <= maxPolls; poll++) {
|
|
40300
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
40301
|
+
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`)));
|
|
40302
|
+
let targets;
|
|
40303
|
+
try {
|
|
40304
|
+
targets = await readTargets(client, dbProxyName, targetGroupName);
|
|
40305
|
+
} catch (error) {
|
|
40306
|
+
if (!(isThrottlingError(error) || isTransientServerError(error))) throw wrapReadError(error);
|
|
40307
|
+
log.debug(`A read while waiting for ${what} was throttled or failed server-side; reading again`);
|
|
40308
|
+
}
|
|
40309
|
+
if (targets !== void 0) {
|
|
40310
|
+
const pending = [];
|
|
40311
|
+
let failure;
|
|
40312
|
+
for (const { kind, id } of watched) {
|
|
40313
|
+
const rows = rowsFor(targets, kind, id);
|
|
40314
|
+
if (rows.length === 0) {
|
|
40315
|
+
pending.push(`${log.value(id)} not listed`);
|
|
40316
|
+
continue;
|
|
40317
|
+
}
|
|
40318
|
+
for (const row of rows) {
|
|
40319
|
+
const state = row.TargetHealth?.State;
|
|
40320
|
+
if (state === "AVAILABLE" || state === "UNUSED") continue;
|
|
40321
|
+
pending.push(`${log.value(row.RdsResourceId ?? id)} ${healthOf(row)}`);
|
|
40322
|
+
if (failure === void 0 && row.TargetHealth?.State === "UNAVAILABLE" && FAILURE_REASONS.has(row.TargetHealth.Reason ?? "")) failure = {
|
|
40323
|
+
id: row.RdsResourceId ?? id,
|
|
40324
|
+
row
|
|
40325
|
+
};
|
|
40326
|
+
}
|
|
40327
|
+
}
|
|
40328
|
+
if (pending.length === 0) return;
|
|
40329
|
+
last = pending.join(", ");
|
|
40330
|
+
failingPolls = failure === void 0 ? 0 : failingPolls + 1;
|
|
40331
|
+
if (failure !== void 0 && failingPolls >= 3) {
|
|
40332
|
+
const reason = failure.row.TargetHealth?.Reason ?? "";
|
|
40333
|
+
const head = `DB proxy target group ${logicalId}: target ${log.value(failure.id)} of proxy ${log.value(dbProxyName)} reads UNAVAILABLE (${reason}), expected AVAILABLE`;
|
|
40334
|
+
const text = describeAwsStatusReason({
|
|
40335
|
+
code: reason,
|
|
40336
|
+
message: failure.row.TargetHealth?.Description
|
|
40337
|
+
}, "");
|
|
40338
|
+
if (text.redacted) log.debug(`${head}: ${text.detail}`);
|
|
40339
|
+
throw markNonRetryable(new Error(log.mask(text.redacted ? `${head}. ${text.summary}` : head)));
|
|
40340
|
+
}
|
|
40341
|
+
}
|
|
40342
|
+
if (poll === maxPolls) break;
|
|
40343
|
+
await new Promise((resolve) => setTimeout(resolve, Math.max(0, Math.min(pollMs, enclosingDeadlineRemainingMs()))));
|
|
40344
|
+
}
|
|
40345
|
+
} finally {
|
|
40346
|
+
watch.dispose();
|
|
40347
|
+
}
|
|
40348
|
+
throw markNonRetryable(new Error(log.mask(`Timed out waiting for ${what}: still ${last} after ${maxPolls * pollMs / 1e3} seconds; the registration is not confirmed`)));
|
|
40349
|
+
}
|
|
40350
|
+
async function readTargets(client, dbProxyName, targetGroupName) {
|
|
40351
|
+
const out = [];
|
|
40352
|
+
let marker;
|
|
40353
|
+
do {
|
|
40354
|
+
const page = await client.send(new DescribeDBProxyTargetsCommand({
|
|
40355
|
+
DBProxyName: dbProxyName,
|
|
40356
|
+
TargetGroupName: targetGroupName,
|
|
40357
|
+
...marker ? { Marker: marker } : {}
|
|
40358
|
+
}));
|
|
40359
|
+
out.push(...page.Targets ?? []);
|
|
40360
|
+
marker = page.Marker;
|
|
40361
|
+
} while (marker);
|
|
40362
|
+
return out;
|
|
40363
|
+
}
|
|
40364
|
+
|
|
39970
40365
|
// src/provisioning/providers/rds-dbproxy-targetgroup/create.ts
|
|
39971
40366
|
async function create$21(logicalId, resourceType, properties, context) {
|
|
39972
40367
|
const dbProxyName = readProxyName(properties["DBProxyName"]);
|
|
@@ -40024,7 +40419,23 @@ async function create$21(logicalId, resourceType, properties, context) {
|
|
|
40024
40419
|
throw await this.retireRegistrationAfterFailedCreate(this.wrapError(error, "CREATE (describe)", resourceType, logicalId, void 0, mask), dbProxyName, targetGroupName, dbClusterIdentifiers, dbInstanceIdentifiers, context?.maskSecrets);
|
|
40025
40420
|
}
|
|
40026
40421
|
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);
|
|
40027
|
-
if (dbClusterIdentifiers.length > 0 || dbInstanceIdentifiers.length > 0)
|
|
40422
|
+
if (dbClusterIdentifiers.length > 0 || dbInstanceIdentifiers.length > 0) {
|
|
40423
|
+
reportCreatedResource(logicalId, resourceType, targetGroupArn);
|
|
40424
|
+
try {
|
|
40425
|
+
await waitForProxyTargetsAvailable(client, logicalId, dbProxyName, targetGroupName, {
|
|
40426
|
+
clusters: dbClusterIdentifiers,
|
|
40427
|
+
instances: dbInstanceIdentifiers
|
|
40428
|
+
}, createMaskedLogSinks(this.logger, context?.maskSecrets), (error) => this.wrapError(error, "CREATE (wait for targets)", resourceType, logicalId, void 0, mask));
|
|
40429
|
+
} catch (error) {
|
|
40430
|
+
if (isInterruptedWaitError(error)) throw error;
|
|
40431
|
+
const original = error instanceof ProvisioningError ? error : new ProvisioningError(error.message, resourceType, logicalId, void 0, error);
|
|
40432
|
+
throw await this.retireRegistrationAfterFailedCreate(original, dbProxyName, targetGroupName, dbClusterIdentifiers, dbInstanceIdentifiers, context?.maskSecrets, {
|
|
40433
|
+
logicalId,
|
|
40434
|
+
resourceType,
|
|
40435
|
+
physicalId: targetGroupArn
|
|
40436
|
+
});
|
|
40437
|
+
}
|
|
40438
|
+
}
|
|
40028
40439
|
if (tags.length > 0) try {
|
|
40029
40440
|
await client.send(new AddTagsToResourceCommand$2({
|
|
40030
40441
|
ResourceName: targetGroupArn,
|
|
@@ -40180,6 +40591,10 @@ async function update$21(logicalId, physicalId, resourceType, properties, previo
|
|
|
40180
40591
|
} catch (error) {
|
|
40181
40592
|
throw this.wrapError(error, "UPDATE (register)", resourceType, logicalId, physicalId, mask);
|
|
40182
40593
|
}
|
|
40594
|
+
await waitForProxyTargetsAvailable(client, logicalId, dbProxyName, targetGroupName, {
|
|
40595
|
+
clusters: clustersToAdd,
|
|
40596
|
+
instances: instancesToAdd
|
|
40597
|
+
}, createMaskedLogSinks(this.logger, context?.maskSecrets), (error) => this.wrapError(error, "UPDATE (wait for targets)", resourceType, logicalId, physicalId, mask));
|
|
40183
40598
|
}
|
|
40184
40599
|
const tagsToRemove = tagPlan.remove;
|
|
40185
40600
|
const tagsToAdd = [...tagPlan.set].map(([Key, Value]) => ({
|
|
@@ -42691,6 +43106,50 @@ function isMatchableSetIdentifier(value) {
|
|
|
42691
43106
|
return typeof value === "string" && !value.includes("{{resolve:");
|
|
42692
43107
|
}
|
|
42693
43108
|
|
|
43109
|
+
// src/provisioning/providers/route53/change-wait.ts
|
|
43110
|
+
const CHANGE_INSYNC_POLL_MS = 2e3;
|
|
43111
|
+
const CHANGE_INSYNC_POLLS = 450;
|
|
43112
|
+
function changeIdOf(output) {
|
|
43113
|
+
return output?.ChangeInfo?.Id;
|
|
43114
|
+
}
|
|
43115
|
+
async function waitForRoute53ChangeInsync(client, changeId, what, log, opts = {}) {
|
|
43116
|
+
if (process.env["CDKD_FULL_WAIT"] !== "true") return;
|
|
43117
|
+
if (!changeId) {
|
|
43118
|
+
log.debug(`No Route 53 change id to wait on for ${what}`);
|
|
43119
|
+
return;
|
|
43120
|
+
}
|
|
43121
|
+
const pollMs = opts.pollMs ?? 2e3;
|
|
43122
|
+
const maxPolls = opts.maxPolls ?? 450;
|
|
43123
|
+
const id = changeId.replace(/^\/change\//, "");
|
|
43124
|
+
const manual = `To wait manually: ${pasteableAwsCommand(log.mask)`aws route53 wait resource-record-sets-changed --id ${id}`.render()}.`;
|
|
43125
|
+
const giveUp = (why) => log.warn(`The Route 53 change for ${what} ${why}; continuing (propagation finishes in the background). ${manual}`);
|
|
43126
|
+
const watch = startInterruptWatch(log.mask(`the Route 53 change for ${what} to reach INSYNC`));
|
|
43127
|
+
try {
|
|
43128
|
+
for (let poll = 1; poll <= maxPolls; poll++) {
|
|
43129
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
43130
|
+
if (enclosingDeadlineRemainingMs() <= 0) {
|
|
43131
|
+
giveUp("did not reach INSYNC before the resource timeout");
|
|
43132
|
+
return;
|
|
43133
|
+
}
|
|
43134
|
+
try {
|
|
43135
|
+
if ((await client.send(new GetChangeCommand({ Id: id }))).ChangeInfo?.Status === "INSYNC") return;
|
|
43136
|
+
} catch (error) {
|
|
43137
|
+
if (!(isThrottlingError(error) || isTransientServerError(error))) {
|
|
43138
|
+
log.debug(`GetChange for ${what} failed: ${describeAwsFailure(error).detail}`);
|
|
43139
|
+
giveUp(`could not be read (${verboseAwareText("re-run with --verbose for the reason", "the reason is in the debug output above")})`);
|
|
43140
|
+
return;
|
|
43141
|
+
}
|
|
43142
|
+
log.debug(`A read while waiting for the Route 53 change for ${what} was throttled or failed server-side; reading again`);
|
|
43143
|
+
}
|
|
43144
|
+
if (poll === maxPolls) break;
|
|
43145
|
+
await new Promise((resolve) => setTimeout(resolve, Math.max(0, Math.min(pollMs, enclosingDeadlineRemainingMs()))));
|
|
43146
|
+
}
|
|
43147
|
+
} finally {
|
|
43148
|
+
watch.dispose();
|
|
43149
|
+
}
|
|
43150
|
+
giveUp(`did not reach INSYNC within ${maxPolls * pollMs / 1e3} seconds`);
|
|
43151
|
+
}
|
|
43152
|
+
|
|
42694
43153
|
// src/provisioning/providers/route53/hosted-zone.ts
|
|
42695
43154
|
async function createHostedZone(logicalId, resourceType, properties, mask, context) {
|
|
42696
43155
|
this.logger.debug(`Creating Route 53 hosted zone ${logicalId}`);
|
|
@@ -42734,16 +43193,18 @@ async function createHostedZone(logicalId, resourceType, properties, mask, conte
|
|
|
42734
43193
|
const zoneId = hostedZone.Id.replace("/hostedzone/", "");
|
|
42735
43194
|
createdZoneId = zoneId;
|
|
42736
43195
|
reportCreatedResource(logicalId, resourceType, zoneId);
|
|
43196
|
+
const changeIds = [changeIdOf(response)];
|
|
42737
43197
|
if (vpcs && vpcs.length > 1) for (let i = 1; i < vpcs.length; i++) {
|
|
42738
43198
|
const additionalVpc = vpcs[i];
|
|
42739
43199
|
this.logger.debug(`Associating additional VPC ${String(additionalVpc["VPCId"])} with hosted zone ${zoneId}`);
|
|
42740
|
-
await this.getClient().send(new AssociateVPCWithHostedZoneCommand({
|
|
43200
|
+
const associated = await this.getClient().send(new AssociateVPCWithHostedZoneCommand({
|
|
42741
43201
|
HostedZoneId: zoneId,
|
|
42742
43202
|
VPC: {
|
|
42743
43203
|
VPCId: additionalVpc["VPCId"],
|
|
42744
43204
|
VPCRegion: additionalVpc["VPCRegion"]
|
|
42745
43205
|
}
|
|
42746
43206
|
}));
|
|
43207
|
+
changeIds.push(changeIdOf(associated));
|
|
42747
43208
|
}
|
|
42748
43209
|
await this.applyHostedZoneTags(zoneId, properties, logicalId, void 0, mask);
|
|
42749
43210
|
await this.applyQueryLoggingConfig(zoneId, properties, logicalId, void 0, mask);
|
|
@@ -42772,6 +43233,10 @@ async function createHostedZone(logicalId, resourceType, properties, mask, conte
|
|
|
42772
43233
|
}
|
|
42773
43234
|
await this.waitForAcceleratedRecoveryFeatureSettled(zoneId, logicalId, resourceType, true, true);
|
|
42774
43235
|
}
|
|
43236
|
+
if (process.env["CDKD_FULL_WAIT"] === "true") {
|
|
43237
|
+
const log = createMaskedLogSinks(this.logger, mask);
|
|
43238
|
+
for (const changeId of changeIds) await waitForRoute53ChangeInsync(this.getClient(), changeId, `hosted zone ${logicalId}`, log);
|
|
43239
|
+
}
|
|
42775
43240
|
const nameServers = response.DelegationSet?.NameServers ?? [];
|
|
42776
43241
|
this.logger.debug(`Successfully created hosted zone ${logicalId}: ${zoneId}`);
|
|
42777
43242
|
callerReferenceToken.release();
|
|
@@ -42879,10 +43344,11 @@ async function updateHostedZone(logicalId, physicalId, resourceType, properties,
|
|
|
42879
43344
|
async function deleteHostedZone(logicalId, physicalId, resourceType, context) {
|
|
42880
43345
|
this.logger.debug(`Deleting Route 53 hosted zone ${logicalId}: ${physicalId}`);
|
|
42881
43346
|
const progress = { stripped: false };
|
|
43347
|
+
let changeId;
|
|
42882
43348
|
try {
|
|
42883
43349
|
await this.deleteQueryLoggingConfigForZone(physicalId, logicalId, progress);
|
|
42884
43350
|
await this.ensureAcceleratedRecoveryDisabledForDelete(physicalId, logicalId, progress);
|
|
42885
|
-
await this.getClient().send(new DeleteHostedZoneCommand({ Id: physicalId }));
|
|
43351
|
+
changeId = changeIdOf(await this.getClient().send(new DeleteHostedZoneCommand({ Id: physicalId })));
|
|
42886
43352
|
this.logger.debug(`Successfully deleted hosted zone ${logicalId}`);
|
|
42887
43353
|
} catch (error) {
|
|
42888
43354
|
if (error instanceof Error && error.name === "NoSuchHostedZone") {
|
|
@@ -42895,6 +43361,7 @@ async function deleteHostedZone(logicalId, physicalId, resourceType, context) {
|
|
|
42895
43361
|
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));
|
|
42896
43362
|
throw progress.stripped ? markDeleteStarted(failure) : failure;
|
|
42897
43363
|
}
|
|
43364
|
+
await waitForRoute53ChangeInsync(this.getClient(), changeId, `hosted zone ${logicalId} deletion`, createMaskedLogSinks(this.logger, context?.maskSecrets));
|
|
42898
43365
|
}
|
|
42899
43366
|
async function ensureAcceleratedRecoveryDisabledForDelete(physicalId, logicalId, progress) {
|
|
42900
43367
|
const client = this.getClient();
|
|
@@ -43127,6 +43594,10 @@ function isRecordValuesMismatchRefusal(error) {
|
|
|
43127
43594
|
function isRecordNotFoundRefusal(error) {
|
|
43128
43595
|
return error instanceof Error && error.name === "InvalidChangeBatch" && /but it was not found/i.test(error.message);
|
|
43129
43596
|
}
|
|
43597
|
+
const groupSubject = {
|
|
43598
|
+
noun: "record set group",
|
|
43599
|
+
remedy: "set HostedZoneId explicitly"
|
|
43600
|
+
};
|
|
43130
43601
|
|
|
43131
43602
|
// src/provisioning/providers/route53/record-set.ts
|
|
43132
43603
|
async function createRecordSet(logicalId, resourceType, properties, mask, replayingState = false) {
|
|
@@ -43136,10 +43607,11 @@ async function createRecordSet(logicalId, resourceType, properties, mask, replay
|
|
|
43136
43607
|
const recordName = properties["Name"];
|
|
43137
43608
|
const recordType = properties["Type"];
|
|
43138
43609
|
const compositeId = recordSetCompositeId(hostedZoneId, recordName, recordType);
|
|
43610
|
+
let changeId;
|
|
43139
43611
|
try {
|
|
43140
43612
|
const resourceRecordSet = replayingState ? this.buildResourceRecordSet(properties) : withTemplateAliasConflicts(this.buildResourceRecordSet(properties), properties);
|
|
43141
43613
|
const comment = properties["Comment"];
|
|
43142
|
-
await this.getClient().send(new ChangeResourceRecordSetsCommand({
|
|
43614
|
+
const created = await this.getClient().send(new ChangeResourceRecordSetsCommand({
|
|
43143
43615
|
HostedZoneId: hostedZoneId,
|
|
43144
43616
|
ChangeBatch: {
|
|
43145
43617
|
...comment ? { Comment: comment } : {},
|
|
@@ -43149,11 +43621,8 @@ async function createRecordSet(logicalId, resourceType, properties, mask, replay
|
|
|
43149
43621
|
}]
|
|
43150
43622
|
}
|
|
43151
43623
|
}));
|
|
43624
|
+
changeId = changeIdOf(created);
|
|
43152
43625
|
this.logger.debug(`Successfully created record set ${logicalId}: ${compositeId}`);
|
|
43153
|
-
return {
|
|
43154
|
-
physicalId: compositeId,
|
|
43155
|
-
attributes: {}
|
|
43156
|
-
};
|
|
43157
43626
|
} catch (error) {
|
|
43158
43627
|
if (error instanceof ProvisioningError) throw error;
|
|
43159
43628
|
const cause = error instanceof Error ? error : void 0;
|
|
@@ -43161,6 +43630,15 @@ async function createRecordSet(logicalId, resourceType, properties, mask, replay
|
|
|
43161
43630
|
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));
|
|
43162
43631
|
throw cnameConflict ? markNameCollision(wrapped) : wrapped;
|
|
43163
43632
|
}
|
|
43633
|
+
try {
|
|
43634
|
+
await waitForRoute53ChangeInsync(this.getClient(), changeId, `record set ${logicalId}`, createMaskedLogSinks(this.logger, mask));
|
|
43635
|
+
} catch (error) {
|
|
43636
|
+
throw markCreatedBeforeFailure(error, logicalId, resourceType, compositeId);
|
|
43637
|
+
}
|
|
43638
|
+
return {
|
|
43639
|
+
physicalId: compositeId,
|
|
43640
|
+
attributes: {}
|
|
43641
|
+
};
|
|
43164
43642
|
}
|
|
43165
43643
|
async function updateRecordSet(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
43166
43644
|
this.logger.debug(`Updating Route 53 record set ${logicalId}: ${physicalId}`);
|
|
@@ -43192,13 +43670,14 @@ async function updateRecordSet(logicalId, physicalId, resourceType, properties,
|
|
|
43192
43670
|
Action: "UPSERT",
|
|
43193
43671
|
ResourceRecordSet: resourceRecordSet
|
|
43194
43672
|
}];
|
|
43195
|
-
await this.getClient().send(new ChangeResourceRecordSetsCommand({
|
|
43673
|
+
const updated = await this.getClient().send(new ChangeResourceRecordSetsCommand({
|
|
43196
43674
|
HostedZoneId: hostedZoneId,
|
|
43197
43675
|
ChangeBatch: {
|
|
43198
43676
|
...comment ? { Comment: comment } : {},
|
|
43199
43677
|
Changes: changes
|
|
43200
43678
|
}
|
|
43201
43679
|
}));
|
|
43680
|
+
await waitForRoute53ChangeInsync(this.getClient(), changeIdOf(updated), `record set ${logicalId}`, createMaskedLogSinks(this.logger, context?.maskSecrets));
|
|
43202
43681
|
this.logger.debug(`Successfully updated record set ${logicalId}`);
|
|
43203
43682
|
return {
|
|
43204
43683
|
physicalId: context?.desiredFromAwsReadback === true ? physicalId : compositeId,
|
|
@@ -43267,6 +43746,7 @@ async function deleteRecordSet(logicalId, physicalId, resourceType, properties,
|
|
|
43267
43746
|
throw error;
|
|
43268
43747
|
}
|
|
43269
43748
|
}
|
|
43749
|
+
let changeId;
|
|
43270
43750
|
try {
|
|
43271
43751
|
const resourceRecordSet = this.buildResourceRecordSet(properties);
|
|
43272
43752
|
const sendDelete = (recordSet) => this.getClient().send(new ChangeResourceRecordSetsCommand({
|
|
@@ -43278,12 +43758,12 @@ async function deleteRecordSet(logicalId, physicalId, resourceType, properties,
|
|
|
43278
43758
|
}));
|
|
43279
43759
|
const deleteRecord = async (recordSet) => {
|
|
43280
43760
|
try {
|
|
43281
|
-
await sendDelete(recordSet);
|
|
43761
|
+
changeId = changeIdOf(await sendDelete(recordSet));
|
|
43282
43762
|
} catch (error) {
|
|
43283
43763
|
if (!isZoneDisabledForMutationError(error)) throw error;
|
|
43284
43764
|
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}`);
|
|
43285
43765
|
await this.waitForAcceleratedRecoveryMutable(hostedZoneId, logicalId, resourceType);
|
|
43286
|
-
await sendDelete(recordSet);
|
|
43766
|
+
changeId = changeIdOf(await sendDelete(recordSet));
|
|
43287
43767
|
}
|
|
43288
43768
|
};
|
|
43289
43769
|
try {
|
|
@@ -43311,6 +43791,7 @@ async function deleteRecordSet(logicalId, physicalId, resourceType, properties,
|
|
|
43311
43791
|
const cause = error instanceof Error ? error : void 0;
|
|
43312
43792
|
throw this.wrapDeleteError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete record set ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
43313
43793
|
}
|
|
43794
|
+
await waitForRoute53ChangeInsync(this.getClient(), changeId, `record set ${logicalId} deletion`, createMaskedLogSinks(this.logger, context?.maskSecrets));
|
|
43314
43795
|
}
|
|
43315
43796
|
function buildResourceRecordSet(properties) {
|
|
43316
43797
|
const name = properties["Name"];
|
|
@@ -43411,10 +43892,6 @@ function desiredGroup(properties, logicalId, physicalId) {
|
|
|
43411
43892
|
zone: zone.zone
|
|
43412
43893
|
};
|
|
43413
43894
|
}
|
|
43414
|
-
const groupSubject = {
|
|
43415
|
-
noun: "record set group",
|
|
43416
|
-
remedy: "set HostedZoneId explicitly"
|
|
43417
|
-
};
|
|
43418
43895
|
async function createRecordSetGroup(logicalId, resourceType, properties, mask, replayingState = false) {
|
|
43419
43896
|
this.logger.debug(safeMsg`Creating Route 53 record set group ${logicalId}`);
|
|
43420
43897
|
refuseCfnGroupZoneShape(this, properties, listedRecords(properties), logicalId, resourceType, void 0, replayingState);
|
|
@@ -43431,9 +43908,10 @@ async function createRecordSetGroup(logicalId, resourceType, properties, mask, r
|
|
|
43431
43908
|
attributes: {}
|
|
43432
43909
|
};
|
|
43433
43910
|
}
|
|
43911
|
+
let changeId;
|
|
43434
43912
|
try {
|
|
43435
43913
|
const comment = properties["Comment"];
|
|
43436
|
-
await this.getClient().send(new ChangeResourceRecordSetsCommand({
|
|
43914
|
+
const created = await this.getClient().send(new ChangeResourceRecordSetsCommand({
|
|
43437
43915
|
HostedZoneId: hostedZoneId,
|
|
43438
43916
|
ChangeBatch: {
|
|
43439
43917
|
...typeof comment === "string" && comment ? { Comment: comment } : {},
|
|
@@ -43443,11 +43921,8 @@ async function createRecordSetGroup(logicalId, resourceType, properties, mask, r
|
|
|
43443
43921
|
}))
|
|
43444
43922
|
}
|
|
43445
43923
|
}));
|
|
43924
|
+
changeId = changeIdOf(created);
|
|
43446
43925
|
this.logger.debug(safeMsg`Successfully created record set group ${logicalId}: ${compositeId}`);
|
|
43447
|
-
return {
|
|
43448
|
-
physicalId: compositeId,
|
|
43449
|
-
attributes: {}
|
|
43450
|
-
};
|
|
43451
43926
|
} catch (error) {
|
|
43452
43927
|
if (error instanceof ProvisioningError) throw error;
|
|
43453
43928
|
const cause = error instanceof Error ? error : void 0;
|
|
@@ -43455,6 +43930,15 @@ async function createRecordSetGroup(logicalId, resourceType, properties, mask, r
|
|
|
43455
43930
|
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));
|
|
43456
43931
|
throw cnameConflict ? markNameCollision(wrapped) : wrapped;
|
|
43457
43932
|
}
|
|
43933
|
+
try {
|
|
43934
|
+
await waitForRoute53ChangeInsync(this.getClient(), changeId, `record set group ${logicalId}`, createMaskedLogSinks(this.logger, mask));
|
|
43935
|
+
} catch (error) {
|
|
43936
|
+
throw markCreatedBeforeFailure(error, logicalId, resourceType, compositeId);
|
|
43937
|
+
}
|
|
43938
|
+
return {
|
|
43939
|
+
physicalId: compositeId,
|
|
43940
|
+
attributes: {}
|
|
43941
|
+
};
|
|
43458
43942
|
}
|
|
43459
43943
|
async function existingGroupZone(physicalId, zone, logicalId, resourceType) {
|
|
43460
43944
|
const parsed = parseRecordSetGroupCompositeId(physicalId, logicalId);
|
|
@@ -43501,6 +43985,7 @@ async function applyRecordSetGroupUpdate(logicalId, physicalId, resourceType, pr
|
|
|
43501
43985
|
let recordedZone = hostedZoneId;
|
|
43502
43986
|
if (!parseRecordSetGroupCompositeId(physicalId, logicalId) && !("refusal" in previousZone) && zoneReferenceChanged(previousZone.zone, zone)) recordedZone = await recordedZoneForSwitch(this, previousZone.zone, logicalId, resourceType, physicalId, "Record set group");
|
|
43503
43987
|
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);
|
|
43988
|
+
let changeId;
|
|
43504
43989
|
try {
|
|
43505
43990
|
const desiredKeys = /* @__PURE__ */ new Set();
|
|
43506
43991
|
const changes = [];
|
|
@@ -43540,20 +44025,16 @@ async function applyRecordSetGroupUpdate(logicalId, physicalId, resourceType, pr
|
|
|
43540
44025
|
if (changes.length > 0) {
|
|
43541
44026
|
const comment = properties["Comment"];
|
|
43542
44027
|
progress.sent = true;
|
|
43543
|
-
await updateBatchClient(this).send(new ChangeResourceRecordSetsCommand({
|
|
44028
|
+
const updated = await updateBatchClient(this).send(new ChangeResourceRecordSetsCommand({
|
|
43544
44029
|
HostedZoneId: hostedZoneId,
|
|
43545
44030
|
ChangeBatch: {
|
|
43546
44031
|
...typeof comment === "string" && comment ? { Comment: comment } : {},
|
|
43547
44032
|
Changes: [...changes.filter((c) => c.Action === "DELETE"), ...changes.filter((c) => c.Action !== "DELETE")]
|
|
43548
44033
|
}
|
|
43549
44034
|
}));
|
|
44035
|
+
changeId = changeIdOf(updated);
|
|
43550
44036
|
}
|
|
43551
44037
|
this.logger.debug(safeMsg`Successfully updated record set group ${logicalId}`);
|
|
43552
|
-
return {
|
|
43553
|
-
physicalId: compositeId,
|
|
43554
|
-
wasReplaced: false,
|
|
43555
|
-
attributes: {}
|
|
43556
|
-
};
|
|
43557
44038
|
} catch (error) {
|
|
43558
44039
|
if (error instanceof ProvisioningError) throw error;
|
|
43559
44040
|
if (progress.sent) {
|
|
@@ -43563,6 +44044,12 @@ async function applyRecordSetGroupUpdate(logicalId, physicalId, resourceType, pr
|
|
|
43563
44044
|
const cause = error instanceof Error ? error : void 0;
|
|
43564
44045
|
throw this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to update record set group ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
43565
44046
|
}
|
|
44047
|
+
await waitForRoute53ChangeInsync(this.getClient(), changeId, `record set group ${logicalId}`, createMaskedLogSinks(this.logger, context?.maskSecrets));
|
|
44048
|
+
return {
|
|
44049
|
+
physicalId: compositeId,
|
|
44050
|
+
wasReplaced: false,
|
|
44051
|
+
attributes: {}
|
|
44052
|
+
};
|
|
43566
44053
|
}
|
|
43567
44054
|
async function ownEarlierWriteMayHold(logicalId, key, desired, provider) {
|
|
43568
44055
|
const lookup = getPriorAttempts(logicalId);
|
|
@@ -43619,6 +44106,7 @@ async function deleteRecordSetGroup(logicalId, physicalId, resourceType, propert
|
|
|
43619
44106
|
}
|
|
43620
44107
|
}
|
|
43621
44108
|
if (records.length === 0) return;
|
|
44109
|
+
const changeIds = [];
|
|
43622
44110
|
try {
|
|
43623
44111
|
const deletes = [];
|
|
43624
44112
|
for (const record of records) {
|
|
@@ -43642,12 +44130,12 @@ async function deleteRecordSetGroup(logicalId, physicalId, resourceType, propert
|
|
|
43642
44130
|
}));
|
|
43643
44131
|
const sendSettled = async (sets) => {
|
|
43644
44132
|
try {
|
|
43645
|
-
await send(sets);
|
|
44133
|
+
changeIds.push(changeIdOf(await send(sets)));
|
|
43646
44134
|
} catch (error) {
|
|
43647
44135
|
if (!isZoneDisabledForMutationError(error)) throw error;
|
|
43648
44136
|
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}`);
|
|
43649
44137
|
await this.waitForAcceleratedRecoveryMutable(hostedZoneId, logicalId, resourceType);
|
|
43650
|
-
await send(sets);
|
|
44138
|
+
changeIds.push(changeIdOf(await send(sets)));
|
|
43651
44139
|
}
|
|
43652
44140
|
};
|
|
43653
44141
|
try {
|
|
@@ -43673,6 +44161,8 @@ async function deleteRecordSetGroup(logicalId, physicalId, resourceType, propert
|
|
|
43673
44161
|
const cause = error instanceof Error ? error : void 0;
|
|
43674
44162
|
throw this.wrapDeleteError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to delete record set group ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
43675
44163
|
}
|
|
44164
|
+
const log = createMaskedLogSinks(this.logger, context?.maskSecrets);
|
|
44165
|
+
for (const changeId of changeIds) await waitForRoute53ChangeInsync(this.getClient(), changeId, `record set group ${logicalId} deletion`, log);
|
|
43676
44166
|
}
|
|
43677
44167
|
const HOSTED_ZONE_LOOKUP_FAILED$1 = Symbol.for("cdkd.route53.hostedZoneLookupFailed");
|
|
43678
44168
|
function isHostedZoneLookupFailure$1(err) {
|
|
@@ -43717,6 +44207,8 @@ async function readRecordSetGroup(physicalId, logicalId, properties) {
|
|
|
43717
44207
|
RecordSets: observed
|
|
43718
44208
|
};
|
|
43719
44209
|
}
|
|
44210
|
+
|
|
44211
|
+
// src/provisioning/providers/route53/record-set-group-import.ts
|
|
43720
44212
|
async function importRecordSetGroupFromTemplate(input) {
|
|
43721
44213
|
const parsed = groupRecordSets(input.properties);
|
|
43722
44214
|
if ("refusal" in parsed || parsed.records.length === 0) return null;
|
|
@@ -43907,12 +44399,13 @@ async function syncVPCAssociations(zoneId, properties, logicalId, previousProper
|
|
|
43907
44399
|
const currentVpcs = (await this.getClient().send(new GetHostedZoneCommand({ Id: zoneId }))).VPCs ?? [];
|
|
43908
44400
|
const currentVpcIds = new Set(currentVpcs.map((v) => v.VPCId));
|
|
43909
44401
|
const desiredVpcIds = new Set(desiredVpcs.map((v) => v["VPCId"]));
|
|
44402
|
+
const changeIds = [];
|
|
43910
44403
|
for (const vpc of desiredVpcs) {
|
|
43911
44404
|
const vpcId = vpc["VPCId"];
|
|
43912
44405
|
if (!currentVpcIds.has(vpcId)) {
|
|
43913
44406
|
this.logger.debug(`Associating VPC ${vpcId} with hosted zone ${zoneId}`);
|
|
43914
44407
|
marks?.markUnsettled?.("VPCs");
|
|
43915
|
-
await this.getClient().send(new AssociateVPCWithHostedZoneCommand({
|
|
44408
|
+
const associated = await this.getClient().send(new AssociateVPCWithHostedZoneCommand({
|
|
43916
44409
|
HostedZoneId: zoneId,
|
|
43917
44410
|
VPC: {
|
|
43918
44411
|
VPCId: vpcId,
|
|
@@ -43921,19 +44414,25 @@ async function syncVPCAssociations(zoneId, properties, logicalId, previousProper
|
|
|
43921
44414
|
}));
|
|
43922
44415
|
marks?.markAttempted?.("VPCs", [vpcId]);
|
|
43923
44416
|
currentVpcIds.add(vpcId);
|
|
44417
|
+
changeIds.push(changeIdOf(associated));
|
|
43924
44418
|
}
|
|
43925
44419
|
}
|
|
43926
44420
|
const previousVpcIds = new Set(declaredVpcIds(previousProperties["VPCs"]));
|
|
43927
44421
|
for (const vpc of currentVpcs) if (vpc.VPCId && previousVpcIds.has(vpc.VPCId) && !desiredVpcIds.has(vpc.VPCId)) {
|
|
43928
44422
|
this.logger.debug(`Disassociating VPC ${vpc.VPCId} from hosted zone ${zoneId}`);
|
|
43929
44423
|
marks?.markUnsettled?.("VPCs");
|
|
43930
|
-
await this.getClient().send(new DisassociateVPCFromHostedZoneCommand({
|
|
44424
|
+
const disassociated = await this.getClient().send(new DisassociateVPCFromHostedZoneCommand({
|
|
43931
44425
|
HostedZoneId: zoneId,
|
|
43932
44426
|
VPC: {
|
|
43933
44427
|
VPCId: vpc.VPCId,
|
|
43934
44428
|
VPCRegion: vpc.VPCRegion
|
|
43935
44429
|
}
|
|
43936
44430
|
}));
|
|
44431
|
+
changeIds.push(changeIdOf(disassociated));
|
|
44432
|
+
}
|
|
44433
|
+
if (process.env["CDKD_FULL_WAIT"] === "true") {
|
|
44434
|
+
const log = createMaskedLogSinks(this.logger, mask);
|
|
44435
|
+
for (const changeId of changeIds) await waitForRoute53ChangeInsync(this.getClient(), changeId, `hosted zone ${logicalId} VPC association`, log);
|
|
43937
44436
|
}
|
|
43938
44437
|
} catch (error) {
|
|
43939
44438
|
const cause = error instanceof Error ? error : void 0;
|
|
@@ -45121,6 +45620,28 @@ function readEnabledMfas(properties) {
|
|
|
45121
45620
|
function hasMfaConfigProps(properties) {
|
|
45122
45621
|
return readEnabledMfas(properties).declaresFactor || !!properties["EmailAuthenticationMessage"] || !!properties["EmailAuthenticationSubject"] || !!properties["WebAuthnRelyingPartyID"] || !!properties["WebAuthnUserVerification"] || !!properties["WebAuthnFactorConfiguration"];
|
|
45123
45622
|
}
|
|
45623
|
+
const EMAIL_OTP_MESSAGE_KEYS = ["EmailAuthenticationMessage", "EmailAuthenticationSubject"];
|
|
45624
|
+
function withoutOffFactorEchoes(properties, { keepEmailOtp = false } = {}) {
|
|
45625
|
+
if (properties["MfaConfiguration"] !== "OFF") return properties;
|
|
45626
|
+
const enabled = properties["EnabledMfas"];
|
|
45627
|
+
const isEcho = (factor) => factor === "SMS_MFA" || !keepEmailOtp && factor === "EMAIL_OTP";
|
|
45628
|
+
const dropsFactor = Array.isArray(enabled) && enabled.some(isEcho);
|
|
45629
|
+
const dropsMessage = !keepEmailOtp && EMAIL_OTP_MESSAGE_KEYS.some((key) => !!properties[key]);
|
|
45630
|
+
if (!dropsFactor && !dropsMessage) return properties;
|
|
45631
|
+
const kept = Object.fromEntries(Object.entries(properties).filter(([key]) => keepEmailOtp || !EMAIL_OTP_MESSAGE_KEYS.includes(key)));
|
|
45632
|
+
if (dropsFactor) kept["EnabledMfas"] = enabled.filter((f) => !isEcho(f));
|
|
45633
|
+
return kept;
|
|
45634
|
+
}
|
|
45635
|
+
function withOffEmailOtpCleared(properties) {
|
|
45636
|
+
if (properties["MfaConfiguration"] !== "OFF") return properties;
|
|
45637
|
+
const enabled = properties["EnabledMfas"];
|
|
45638
|
+
const listsEmail = Array.isArray(enabled) && enabled.includes("EMAIL_OTP");
|
|
45639
|
+
if (!listsEmail && !EMAIL_OTP_MESSAGE_KEYS.some((key) => !!properties[key])) return properties;
|
|
45640
|
+
const cleared = { ...properties };
|
|
45641
|
+
if (listsEmail) cleared["EnabledMfas"] = enabled.filter((f) => f !== MFA_FACTOR_EMAIL_OTP);
|
|
45642
|
+
for (const key of EMAIL_OTP_MESSAGE_KEYS) if (key in cleared) cleared[key] = "";
|
|
45643
|
+
return cleared;
|
|
45644
|
+
}
|
|
45124
45645
|
function clearsRemovedMfaConfig(properties, previousProperties, declaredMfaConfiguration) {
|
|
45125
45646
|
const resolvesOff = declaredMfaConfiguration === "OFF" || classifyDeclaredMfaConfiguration(properties["MfaConfiguration"]) === "absent";
|
|
45126
45647
|
const previousDeclaresFactor = readEnabledMfas(previousProperties).declaresFactor || !!previousProperties["EmailAuthenticationMessage"] || !!previousProperties["EmailAuthenticationSubject"];
|
|
@@ -45349,7 +45870,7 @@ async function resetMfaConfigOff(logicalId, physicalId, onReadFailure) {
|
|
|
45349
45870
|
if (onReadFailure === "bare") this.logger.warn(safeMsg`Cognito User Pool ${logicalId} (${physicalId}): cdkd could not read the pool's ` + safeMsg`MFA configuration, so turning MFA OFF could not carry a WebAuthn (passkey) ` + safeMsg`configuration the pool may hold; check it with ${aws`aws cognito-idp get-user-pool-mfa-config --user-pool-id ${physicalId}${region}`.render()}.`);
|
|
45350
45871
|
else {
|
|
45351
45872
|
this.logger.warn(safeMsg`Cognito User Pool ${logicalId} (${physicalId}): cdkd could not read the pool's ` + safeMsg`MFA configuration, so it did not reset the removed MFA factors (the reset would ` + safeMsg`also drop a WebAuthn configuration it could not see). A removed factor such as ` + safeMsg`the software token may still be enabled; check it with ${aws`aws cognito-idp get-user-pool-mfa-config --user-pool-id ${physicalId}${region}`.render()}.`);
|
|
45352
|
-
return;
|
|
45873
|
+
return false;
|
|
45353
45874
|
}
|
|
45354
45875
|
}
|
|
45355
45876
|
const carriedFields = webAuthn === void 0 ? {} : {
|
|
@@ -45362,6 +45883,7 @@ async function resetMfaConfigOff(logicalId, physicalId, onReadFailure) {
|
|
|
45362
45883
|
MfaConfiguration: "OFF",
|
|
45363
45884
|
...Object.keys(carriedFields).length > 0 && { WebAuthnConfiguration: carriedFields }
|
|
45364
45885
|
})), `SetUserPoolMfaConfig(${physicalId})`);
|
|
45886
|
+
return true;
|
|
45365
45887
|
}
|
|
45366
45888
|
|
|
45367
45889
|
// src/provisioning/providers/cognito/read-state.ts
|
|
@@ -45377,15 +45899,22 @@ function canonicalizeDriftPair$3(resourceType, baseline, aws, properties = {}) {
|
|
|
45377
45899
|
if (resourceType !== "AWS::Cognito::UserPool") return unchanged;
|
|
45378
45900
|
const declared = properties["MfaConfiguration"];
|
|
45379
45901
|
if (declared !== void 0 && declared !== "OFF") return unchanged;
|
|
45380
|
-
if (
|
|
45902
|
+
if (readEnabledMfas(properties).declaresFactor || !!properties["EmailAuthenticationMessage"] || !!properties["EmailAuthenticationSubject"]) return unchanged;
|
|
45381
45903
|
if (baseline["MfaConfiguration"] !== "OFF") return unchanged;
|
|
45382
45904
|
const recorded = baseline["EnabledMfas"];
|
|
45383
|
-
if (!Array.isArray(recorded)
|
|
45905
|
+
if (!Array.isArray(recorded)) return unchanged;
|
|
45906
|
+
const remaining = recorded.filter((factor) => factor !== "SOFTWARE_TOKEN_MFA" && factor !== "EMAIL_OTP");
|
|
45907
|
+
if (remaining.length === recorded.length) return unchanged;
|
|
45908
|
+
if (remaining.some((factor) => factor !== "SMS_MFA")) return unchanged;
|
|
45909
|
+
const next = {
|
|
45910
|
+
...baseline,
|
|
45911
|
+
EnabledMfas: remaining
|
|
45912
|
+
};
|
|
45913
|
+
if (recorded.includes("EMAIL_OTP")) {
|
|
45914
|
+
for (const key of ["EmailAuthenticationMessage", "EmailAuthenticationSubject"]) if (key in baseline) next[key] = "";
|
|
45915
|
+
}
|
|
45384
45916
|
return Promise.resolve({
|
|
45385
|
-
baseline:
|
|
45386
|
-
...baseline,
|
|
45387
|
-
EnabledMfas: []
|
|
45388
|
-
},
|
|
45917
|
+
baseline: next,
|
|
45389
45918
|
aws
|
|
45390
45919
|
});
|
|
45391
45920
|
}
|
|
@@ -45863,6 +46392,13 @@ function dcrConfigurationUpdate(properties, previousProperties) {
|
|
|
45863
46392
|
}
|
|
45864
46393
|
async function update$17(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
45865
46394
|
this.logger.debug(`Updating Cognito User Pool ${logicalId}: ${physicalId}`);
|
|
46395
|
+
const receivedProperties = properties;
|
|
46396
|
+
let recordedProperties = properties;
|
|
46397
|
+
if (context?.desiredFromAwsReadback === true) {
|
|
46398
|
+
recordedProperties = withOffEmailOtpCleared(properties);
|
|
46399
|
+
properties = withoutOffFactorEchoes(properties);
|
|
46400
|
+
previousProperties = withoutOffFactorEchoes(previousProperties, { keepEmailOtp: true });
|
|
46401
|
+
}
|
|
45866
46402
|
const stateBorneDesired = context?.replayingState === true || context?.desiredFromAwsReadback === true;
|
|
45867
46403
|
let mfaConfiguration;
|
|
45868
46404
|
try {
|
|
@@ -45944,13 +46480,15 @@ async function update$17(logicalId, physicalId, resourceType, properties, previo
|
|
|
45944
46480
|
const userPool = (await this.getClient().send(new DescribeUserPoolCommand({ UserPoolId: physicalId }))).UserPool;
|
|
45945
46481
|
await this.untagRemovedUserPoolTags(logicalId, physicalId, resourceType, userPool?.Arn, properties["UserPoolTags"], previousProperties["UserPoolTags"]);
|
|
45946
46482
|
if (removedMfa !== "") await this.turnOffRemovedMfa(logicalId, physicalId, removedMfa);
|
|
45947
|
-
else if (clearRemovedMfa)
|
|
46483
|
+
else if (clearRemovedMfa) {
|
|
46484
|
+
if (!await this.resetMfaConfigOff(logicalId, physicalId, "skip")) recordedProperties = receivedProperties;
|
|
46485
|
+
}
|
|
45948
46486
|
this.logger.debug(`Successfully updated Cognito User Pool ${logicalId}`);
|
|
45949
46487
|
const region = await this.getClient().config.region();
|
|
45950
46488
|
const { urlSuffix } = derivePartitionAndUrlSuffix(region);
|
|
45951
46489
|
const providerName = `cognito-idp.${region}.${urlSuffix}/${physicalId}`;
|
|
45952
46490
|
const providerUrl = `https://cognito-idp.${region}.${urlSuffix}/${physicalId}`;
|
|
45953
|
-
const narrowed = withPreviousCreateTimeOnly(narrowMfaConfiguration(
|
|
46491
|
+
const narrowed = withPreviousCreateTimeOnly(narrowMfaConfiguration(recordedProperties), previousProperties, keptCreateTimeOnly);
|
|
45954
46492
|
const effectiveProperties = keptSchema === void 0 ? narrowed : {
|
|
45955
46493
|
...narrowed,
|
|
45956
46494
|
Schema: keptSchema
|
|
@@ -45964,7 +46502,7 @@ async function update$17(logicalId, physicalId, resourceType, properties, previo
|
|
|
45964
46502
|
ProviderURL: providerUrl,
|
|
45965
46503
|
UserPoolId: physicalId
|
|
45966
46504
|
},
|
|
45967
|
-
...effectiveProperties !==
|
|
46505
|
+
...effectiveProperties !== receivedProperties ? { effectiveProperties } : {}
|
|
45968
46506
|
};
|
|
45969
46507
|
} catch (error) {
|
|
45970
46508
|
if (error instanceof ResourceUpdateNotSupportedError || error instanceof ProvisioningError) throw error;
|
|
@@ -56887,6 +57425,70 @@ async function importImpl$8(input) {
|
|
|
56887
57425
|
}
|
|
56888
57426
|
}
|
|
56889
57427
|
|
|
57428
|
+
// src/provisioning/providers/efs/settle-waits.ts
|
|
57429
|
+
const EFS_SETTLE_POLL_MS = 1e3;
|
|
57430
|
+
const EFS_SETTLE_POLLS = 300;
|
|
57431
|
+
const EFS_STALE_READ_GRACE_POLLS = 5;
|
|
57432
|
+
async function pollUntilSettled(what, log, opts, read, judge, describeLast) {
|
|
57433
|
+
const pollMs = opts.pollMs ?? 1e3;
|
|
57434
|
+
const maxPolls = opts.maxPolls ?? 300;
|
|
57435
|
+
if (process.env["CDKD_NO_WAIT"] === "true") {
|
|
57436
|
+
log.debug(`Skipping the wait for ${what} (CDKD_NO_WAIT=true)`);
|
|
57437
|
+
return;
|
|
57438
|
+
}
|
|
57439
|
+
const watch = startInterruptWatch(log.mask(what));
|
|
57440
|
+
let last;
|
|
57441
|
+
try {
|
|
57442
|
+
for (let poll = 1; poll <= maxPolls; poll++) {
|
|
57443
|
+
if (watch.isInterrupted()) throw watch.onInterrupted();
|
|
57444
|
+
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`)));
|
|
57445
|
+
let verdict = "pending";
|
|
57446
|
+
try {
|
|
57447
|
+
last = await read(poll);
|
|
57448
|
+
verdict = judge(last, poll);
|
|
57449
|
+
} catch (error) {
|
|
57450
|
+
if (!(isThrottlingError(error) || isTransientServerError(error))) throw error;
|
|
57451
|
+
log.debug(`A read while waiting for ${what} was throttled or failed server-side; reading again`);
|
|
57452
|
+
}
|
|
57453
|
+
if (verdict === "settled") return;
|
|
57454
|
+
if (verdict instanceof Error) throw markNonRetryable(verdict);
|
|
57455
|
+
if (poll === maxPolls) break;
|
|
57456
|
+
await new Promise((resolve) => setTimeout(resolve, Math.max(0, Math.min(pollMs, enclosingDeadlineRemainingMs()))));
|
|
57457
|
+
}
|
|
57458
|
+
} finally {
|
|
57459
|
+
watch.dispose();
|
|
57460
|
+
}
|
|
57461
|
+
throw markNonRetryable(new Error(log.mask(`Timed out waiting for ${what}: still ${describeLast(last)} after ${maxPolls * pollMs / 1e3} seconds; the change is not confirmed`)));
|
|
57462
|
+
}
|
|
57463
|
+
async function waitForAccessPointAvailable(client, logicalId, accessPointId, log, opts = {}) {
|
|
57464
|
+
await pollUntilSettled(`EFS AccessPoint ${logicalId} to read available`, log, opts, async (poll) => {
|
|
57465
|
+
try {
|
|
57466
|
+
return (await client.send(new DescribeAccessPointsCommand({ AccessPointId: accessPointId }))).AccessPoints?.[0]?.LifeCycleState ?? "absent";
|
|
57467
|
+
} catch (error) {
|
|
57468
|
+
if ((error instanceof AccessPointNotFound || error?.name === "AccessPointNotFound") && poll <= 5) return "not yet visible";
|
|
57469
|
+
throw error;
|
|
57470
|
+
}
|
|
57471
|
+
}, (state, poll) => {
|
|
57472
|
+
if (state === "available") return "settled";
|
|
57473
|
+
if (state === "creating" || state === "updating" || state === "not yet visible") return "pending";
|
|
57474
|
+
if (state === "absent" && poll <= 5) return "pending";
|
|
57475
|
+
return new Error(log.mask(`EFS AccessPoint ${logicalId} (${accessPointId}) settled as ${state}, expected available`));
|
|
57476
|
+
}, (state) => state ?? "none read");
|
|
57477
|
+
}
|
|
57478
|
+
async function waitForBackupPolicySettled(client, fileSystemId, requested, answeredStatus, log, opts = {}) {
|
|
57479
|
+
const transitional = (s) => s === "ENABLING" || s === "DISABLING";
|
|
57480
|
+
let seenSettling = !transitional(answeredStatus);
|
|
57481
|
+
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) => {
|
|
57482
|
+
if (transitional(status)) {
|
|
57483
|
+
seenSettling = true;
|
|
57484
|
+
return "pending";
|
|
57485
|
+
}
|
|
57486
|
+
if (status === requested && (seenSettling || poll > 5)) return "settled";
|
|
57487
|
+
if (poll <= 5) return "pending";
|
|
57488
|
+
return new Error(log.mask(`The BackupPolicy on EFS FileSystem ${fileSystemId} settled as ${status ?? "absent"}, expected ${requested}`));
|
|
57489
|
+
}, (status) => status ?? "none read");
|
|
57490
|
+
}
|
|
57491
|
+
|
|
56890
57492
|
// src/provisioning/providers/efs/file-system.ts
|
|
56891
57493
|
async function updateFileSystem(logicalId, physicalId, resourceType, properties, previousProperties, log, stateBorneDesired) {
|
|
56892
57494
|
for (const key of [
|
|
@@ -56969,10 +57571,11 @@ async function applyBackupPolicy(fileSystemId, spec, log) {
|
|
|
56969
57571
|
if (spec === void 0 || spec === null) return;
|
|
56970
57572
|
const status = spec.Status;
|
|
56971
57573
|
if (status === void 0) return;
|
|
56972
|
-
await this.retryOnTransientControlPlane(() => this.getClient().send(new PutBackupPolicyCommand({
|
|
57574
|
+
const answered = await this.retryOnTransientControlPlane(() => this.getClient().send(new PutBackupPolicyCommand({
|
|
56973
57575
|
FileSystemId: fileSystemId,
|
|
56974
57576
|
BackupPolicy: { Status: status }
|
|
56975
57577
|
})), `set BackupPolicy on ${fileSystemId}`, log);
|
|
57578
|
+
await waitForBackupPolicySettled(this.getClient(), fileSystemId, status, answered?.BackupPolicy?.Status, log);
|
|
56976
57579
|
log.debug(`Set BackupPolicy Status=${log.value(status)} on EFS FileSystem ${fileSystemId}`);
|
|
56977
57580
|
}
|
|
56978
57581
|
async function applyFileSystemPolicy(fileSystemId, policy, bypass, log) {
|
|
@@ -57435,6 +58038,7 @@ async function createAccessPoint(logicalId, resourceType, properties, log) {
|
|
|
57435
58038
|
logicalId,
|
|
57436
58039
|
maxLength: 64
|
|
57437
58040
|
});
|
|
58041
|
+
let createdAccessPointId;
|
|
57438
58042
|
try {
|
|
57439
58043
|
const response = await this.createOrAdoptAccessPoint(logicalId, resourceType, log, {
|
|
57440
58044
|
ClientToken: clientToken.value,
|
|
@@ -57459,6 +58063,9 @@ async function createAccessPoint(logicalId, resourceType, properties, log) {
|
|
|
57459
58063
|
});
|
|
57460
58064
|
const accessPointId = response.AccessPointId;
|
|
57461
58065
|
const arn = response.AccessPointArn;
|
|
58066
|
+
createdAccessPointId = accessPointId;
|
|
58067
|
+
reportCreatedResource(logicalId, resourceType, accessPointId);
|
|
58068
|
+
await waitForAccessPointAvailable(this.getClient(), logicalId, accessPointId, log);
|
|
57462
58069
|
log.debug(`Successfully created EFS AccessPoint ${logicalId}: ${accessPointId}`);
|
|
57463
58070
|
clientToken.release();
|
|
57464
58071
|
return {
|
|
@@ -57471,7 +58078,9 @@ async function createAccessPoint(logicalId, resourceType, properties, log) {
|
|
|
57471
58078
|
} catch (error) {
|
|
57472
58079
|
if (error instanceof ProvisioningError) throw error;
|
|
57473
58080
|
const cause = error instanceof Error ? error : void 0;
|
|
57474
|
-
|
|
58081
|
+
const thrown = this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to create EFS AccessPoint ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause));
|
|
58082
|
+
if (createdAccessPointId !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdAccessPointId);
|
|
58083
|
+
throw thrown;
|
|
57475
58084
|
}
|
|
57476
58085
|
}
|
|
57477
58086
|
async function createOrAdoptAccessPoint(logicalId, resourceType, log, input) {
|
|
@@ -67340,4 +67949,4 @@ var ACMCertificateProvider = class {
|
|
|
67340
67949
|
};
|
|
67341
67950
|
|
|
67342
67951
|
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 };
|
|
67343
|
-
//# sourceMappingURL=provider-classes-
|
|
67952
|
+
//# sourceMappingURL=provider-classes-BesMsi8i.js.map
|