@cdkd/cli 0.358.7 → 0.359.1
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-DvXDYfs8.js → ambient-client-defaults-D1Gua-yw.js} +3 -3
- package/dist/{ambient-client-defaults-DvXDYfs8.js.map → ambient-client-defaults-D1Gua-yw.js.map} +1 -1
- package/dist/{asg-provider-BReZap7O.js → asg-provider-HLdSUkYV.js} +6 -6
- package/dist/{asg-provider-BReZap7O.js.map → asg-provider-HLdSUkYV.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{custom-resource-runtime-CpziCILQ.js → custom-resource-runtime-D4P2W0VI.js} +6 -6
- package/dist/{custom-resource-runtime-CpziCILQ.js.map → custom-resource-runtime-D4P2W0VI.js.map} +1 -1
- package/dist/{db-associated-roles-DTMCw2Ka.js → db-associated-roles-CA_XrqV2.js} +2 -2
- package/dist/{db-associated-roles-DTMCw2Ka.js.map → db-associated-roles-CA_XrqV2.js.map} +1 -1
- package/dist/{delete-started-DNc0CPAc.js → delete-started-B0adv_Q0.js} +4 -4
- package/dist/{delete-started-DNc0CPAc.js.map → delete-started-B0adv_Q0.js.map} +1 -1
- package/dist/{deploy-engine-Db00WvIx.js → deploy-engine-P7CPgaVx.js} +2116 -873
- package/dist/deploy-engine-P7CPgaVx.js.map +1 -0
- package/dist/{ec2-termination-protection-Gf-1-VVU.js → ec2-termination-protection-CdyXzh7W.js} +11 -7
- package/dist/ec2-termination-protection-CdyXzh7W.js.map +1 -0
- package/dist/{ecr-uri-zC_A2VLB.js → ecr-uri-DrUOsysa.js} +2 -2
- package/dist/{ecr-uri-zC_A2VLB.js.map → ecr-uri-DrUOsysa.js.map} +1 -1
- package/dist/{expected-bucket-owner-Am4J3ano.js → expected-bucket-owner-DjxT-AqD.js} +2 -2
- package/dist/{expected-bucket-owner-Am4J3ano.js.map → expected-bucket-owner-DjxT-AqD.js.map} +1 -1
- package/dist/{iam-role-provider-BisBYgT3.js → iam-role-provider-B6Rlc_GY.js} +27 -13
- package/dist/iam-role-provider-B6Rlc_GY.js.map +1 -0
- package/dist/{image-plan-CNMyGwzi.js → image-plan-D_EGu-8M.js} +8 -8
- package/dist/{image-plan-CNMyGwzi.js.map → image-plan-D_EGu-8M.js.map} +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{logger-BZmINj0f.js → logger-BkzZeRzu.js} +2 -2
- package/dist/{logger-BZmINj0f.js.map → logger-BkzZeRzu.js.map} +1 -1
- package/dist/{neptune-provider-DM4GhUTb.js → neptune-provider-pvZ07quz.js} +7 -7
- package/dist/{neptune-provider-DM4GhUTb.js.map → neptune-provider-pvZ07quz.js.map} +1 -1
- package/dist/{program-CCtcOCaP.js → program-Cda-eDUT.js} +626 -40
- package/dist/program-Cda-eDUT.js.map +1 -0
- package/dist/{provider-classes-CgZzBNg8.js → provider-classes--2kJfv8x.js} +527 -402
- package/dist/provider-classes--2kJfv8x.js.map +1 -0
- package/dist/{rds-provider-Cef0DBFH.js → rds-provider-C47dGZz_.js} +10 -10
- package/dist/{rds-provider-Cef0DBFH.js.map → rds-provider-C47dGZz_.js.map} +1 -1
- package/dist/{read-replica-DCjUkLOl.js → read-replica-CfVkW9fC.js} +3 -3
- package/dist/{read-replica-DCjUkLOl.js.map → read-replica-CfVkW9fC.js.map} +1 -1
- package/dist/{replacement-rules-iQkausbv.js → replacement-rules-DfitfaSq.js} +3 -3
- package/dist/{replacement-rules-iQkausbv.js.map → replacement-rules-DfitfaSq.js.map} +1 -1
- package/dist/{resource-deadline-6tnCx6Yj.js → resource-deadline-CCBYcUI-.js} +123 -122
- package/dist/resource-deadline-CCBYcUI-.js.map +1 -0
- package/dist/{restore-source-guard-Dj_CS7r6.js → restore-source-guard-gqR_ya6m.js} +4 -4
- package/dist/{restore-source-guard-Dj_CS7r6.js.map → restore-source-guard-gqR_ya6m.js.map} +1 -1
- package/dist/{run-cli-Db8hPv4V.js → run-cli-fuzwJdwl.js} +2 -2
- package/dist/{run-cli-Db8hPv4V.js.map → run-cli-fuzwJdwl.js.map} +1 -1
- package/dist/{settle-own-write-members-CXG2uUvJ.js → settle-own-write-members-B3XEent-.js} +49 -304
- package/dist/settle-own-write-members-B3XEent-.js.map +1 -0
- package/dist/{version-DSeV-Tyv.js → version-C2QpskKl.js} +2 -2
- package/dist/{version-DSeV-Tyv.js.map → version-C2QpskKl.js.map} +1 -1
- package/package.json +2 -2
- package/dist/deploy-engine-Db00WvIx.js.map +0 -1
- package/dist/ec2-termination-protection-Gf-1-VVU.js.map +0 -1
- package/dist/iam-role-provider-BisBYgT3.js.map +0 -1
- package/dist/program-CCtcOCaP.js.map +0 -1
- package/dist/provider-classes-CgZzBNg8.js.map +0 -1
- package/dist/resource-deadline-6tnCx6Yj.js.map +0 -1
- package/dist/settle-own-write-members-CXG2uUvJ.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { A as displayStackName, C as STACK_REF_MAX_CODE_POINTS, D as displayAwsMessage, I as terminalSafe, L as truncateCodePoints, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, T as asIsMessage, _ as shellQuote, a as UNSHOWABLE_VALUE, c as deployReplaceCommand, d as pasteableCommand, f as physicalIdShownBesideCommand, g as shellBoundedDisplay, h as quotedOrDescribed, i as SHELL_ACTIVE_WHY, j as isPasteableIdent, k as displaySafe, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, t as getCdkdVersion, u as isInertUnquoted, v as withheldTargetClause, w as UNRENDERABLE } from "./version-
|
|
2
|
-
import { $ as withStackScope, A as configStringRefusal, C as fallbackNamePropertyFor, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, G as currentNameGeneration, H as looksLikeCdkdGeneratedName, J as getCurrentStackName, K as getCurrentSkipPrefix, M as replayWarn, O as configBooleanRefusal, P as requireConfigObject, Q as withSkipPrefix, S as explicitNamePropertyFor, T as withoutGeneratedFallbackName, V as generateResourceNameWithFallback, W as stackInstanceNameSuffix, X as isNameGeneration, Z as withNameGeneration, _ as currentLogLineMasker, b as alternateNamePropertiesFor, c as VERBOSE_POINTER, et as withStackScopeBeforeStateRead, 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, v as installLogLineMaskerSource, w as generatedNameFor, x as applyDefaultNameForFallback, y as getLiveRenderer } from "./logger-
|
|
3
|
-
import { A as stripControlChars, C as isNameCooldownError, F as isAmbiguousOutcomeError, G as markRedactedCause, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, K as wrapMaskedAwsError, L as isIamPropagationError, O as relayedNameCollision, P as isAmbiguousCcHandlerErrorCode, Q as AccountIdUnavailableError, R as isRetryableTransientError, S as isNameCollisionErrorFrom, T as isReplayedNameCollisionFrom, U as isThrottlingError, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, Z as SelectOutOfBoundsRefusalError, _ as ResourceUpdateNotSupportedError, a as normalizeAwsError, at as ProvisioningError, b as isUpdateUnsupportedError, et as CdkdError, i as credentialFingerprint, k as escapeRegExp$1, m as ExportInUseError, n as ambientCredentialConfig, nt as DeploymentNotApprovedError, ot as ResourceTimeoutError, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, st as StateError, t as ambientClientDefaults, w as isRecreateRetryableError, z as isTransientServerError } from "./ambient-client-defaults-
|
|
1
|
+
import { A as displayStackName, C as STACK_REF_MAX_CODE_POINTS, D as displayAwsMessage, I as terminalSafe, L as truncateCodePoints, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, T as asIsMessage, _ as shellQuote, a as UNSHOWABLE_VALUE, c as deployReplaceCommand, d as pasteableCommand, f as physicalIdShownBesideCommand, g as shellBoundedDisplay, h as quotedOrDescribed, i as SHELL_ACTIVE_WHY, j as isPasteableIdent, k as displaySafe, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, t as getCdkdVersion, u as isInertUnquoted, v as withheldTargetClause, w as UNRENDERABLE } from "./version-C2QpskKl.js";
|
|
2
|
+
import { $ as withStackScope, A as configStringRefusal, C as fallbackNamePropertyFor, D as coerceCfnInteger, E as coerceCfnBoolean, F as requireConfigString, G as currentNameGeneration, H as looksLikeCdkdGeneratedName, J as getCurrentStackName, K as getCurrentSkipPrefix, M as replayWarn, O as configBooleanRefusal, P as requireConfigObject, Q as withSkipPrefix, S as explicitNamePropertyFor, T as withoutGeneratedFallbackName, V as generateResourceNameWithFallback, W as stackInstanceNameSuffix, X as isNameGeneration, Z as withNameGeneration, _ as currentLogLineMasker, b as alternateNamePropertiesFor, c as VERBOSE_POINTER, et as withStackScopeBeforeStateRead, 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, v as installLogLineMaskerSource, w as generatedNameFor, x as applyDefaultNameForFallback, y as getLiveRenderer } from "./logger-BkzZeRzu.js";
|
|
3
|
+
import { A as stripControlChars, C as isNameCooldownError, F as isAmbiguousOutcomeError, G as markRedactedCause, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, K as wrapMaskedAwsError, L as isIamPropagationError, O as relayedNameCollision, P as isAmbiguousCcHandlerErrorCode, Q as AccountIdUnavailableError, R as isRetryableTransientError, S as isNameCollisionErrorFrom, T as isReplayedNameCollisionFrom, U as isThrottlingError, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, Z as SelectOutOfBoundsRefusalError, _ as ResourceUpdateNotSupportedError, a as normalizeAwsError, at as ProvisioningError, b as isUpdateUnsupportedError, et as CdkdError, i as credentialFingerprint, k as escapeRegExp$1, m as ExportInUseError, n as ambientCredentialConfig, nt as DeploymentNotApprovedError, ot as ResourceTimeoutError, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, st as StateError, t as ambientClientDefaults, w as isRecreateRetryableError, z as isTransientServerError } from "./ambient-client-defaults-D1Gua-yw.js";
|
|
4
4
|
import { a as getAssumedRoleCredentials, c as setAssumedRoleCredentials, d as quietS3Logger, f as ambientRegion, i as awsEndpointOverrideUrl, n as awsClientDefaults, o as getPreAssumeEnvCredentials, r as awsEndpointOverrideActive, t as SECOND_ROLE_PUBLISH_REFUSAL, u as setPreAssumeEnvCredentials } from "./aws-client-defaults-DAebi99J.js";
|
|
5
5
|
import { l as s3ClientDefaults, r as getAwsClients } from "./aws-clients-DOkPjjAW.js";
|
|
6
|
-
import { A as
|
|
6
|
+
import { A as IAM_PROPAGATION_MAX_DELAY_MS, B as phaseScopeForStack, C as prefetchCreateOnlyPropertyPaths, D as hasNoRegistrySchema, E as describeTypeWithThrottleRetry, G as timePhaseSync, H as recordPhase, I as ignoresUnmodifiedGroupSize, J as parseFailureDebugDetail, K as describeJsonParseFailure, L as rollingUpdatePolicy, M as CREATE_ONLY_PATHS_SNAPSHOT, N as INSTANCE_REFRESH_TRIGGER_PROPERTIES, O as isAwsEmulatorRegistryMiss, P as REPLACEMENT_TRIGGER_PROPERTIES, R as willReplaceGroup, S as isIntrinsicShaped, T as parseCreateOnlyPropertyPointers, V as phaseTimingsEnabled, W as timePhase, X as utf8ByteLength, Y as parseJsonNamingNoBody, a as reDisableInstanceApiTermination, c as resolvedResourceTimeoutMs, d as isRefusedBeforeApplying, f as markRefusedBeforeApplying, g as withPriorAttempts, h as provenOrphanIdsInJournal, i as observeThenDisableInstanceApiTermination, j as withRetry, k as reportAwsEmulatorRegistryMiss, m as priorAttemptsInJournal, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, p as priorAttemptLookup, q as jsonParseFailureStandIn, r as isTerminationProtectionPropagationError, v as unchangedBehindSecretReference, w as templateResourceTypes, x as getCreateOnlyPropertyPaths, y as cachedCreateOnlyPropertyPaths, z as PhaseClock } from "./ec2-termination-protection-CdyXzh7W.js";
|
|
7
7
|
import { i as sameRegion, n as canonicalizeRegion, r as derivePartitionAndUrlSuffix } from "./aws-partition-DA0r2sr-.js";
|
|
8
|
-
import { $ as
|
|
9
|
-
import { t as expectedOwnerParam } from "./expected-bucket-owner-
|
|
10
|
-
import { Ct as isReadableBag, Dt as skippedOutputsCarriedFrom, Et as shouldRetainResource, Ot as stackInstanceIdCarriedFrom, St as importableOutputs, Tt as orphansCarriedFrom, _t as acceptedCreateOnlyDropsOf, gt as slowCcOperationTimeoutMs, ht as dbInstanceAttributes, i as dbClusterAttributes, n as isRefusedByName, r as markDeleteStarted, t as isDeleteStarted, vt as describeRegionValueKind, wt as orphansAfterRollback, xt as importableOutputKeys, yt as exportNamesCarriedFrom } from "./delete-started-
|
|
11
|
-
import { $t as recordInheritedParameterValue, A as witnessNormalize, An as recordNoEchoAttributeValues, At as withoutPhysicalNameCopies, B as redactionClaimOf, Cn as noEchoParameterPlaintextsOf, Ct as withLegacyOverlapScan, D as recordedNoEchoValuesOf, Dn as recordFreshNoEchoValuesIn, Dt as replaceEmbeddedPhysicalNameRewrites, E as recordPassedNoEchoParameters, En as recordDerivedMaskOnlyValue, Et as repairPhysicalNameCopyLeaves, F as markLeafCertifiedBag, G as foldRecording, Gt as recordTakenIfBranch, H as mixedLiteralAnswered, Ht as splitOutsideDynamicReferences, I as markSameGenerationBag, In as isDynamicReferenceString, It as secretRerenderPairs, J as hasPassProvenance, Jt as templateRereadsAccountId, K as openRecordingScope, Kt as inheritedPseudoValue, L as mergeResolvedPairs, Ln as isSingleDynamicReferenceToken, M as carryRedactionMarks, Mn as recordProvenPublicExpression, Mt as DYNAMIC_REFERENCE_TOKEN_SCAN, N as intrinsicLeafResolutionOf, Nn as wholeStringLeavesOf, Nt as dynamicReferenceTokens, O as replaceAtCoordinates, Ot as scrubResourceRecord, P as isSameGenerationBag, Pn as withoutNoEchoParameterEntries, Q as recordReferenceResolution, Qt as recordInheritedParameterRead, R as recordIntrinsicLeafResolution, Rn as maskMatchSpans, S as noEchoParametersReadBy, Sn as markNoEchoParameterClass, St as replaceWholeLeaves, Tt as repairEmbeddedPhysicalNamesTowards, U as withLegacyMixedScan, Ut as standsForInheritedSecret, V as resolvedPlaintextOf, Vt as rereadParameterExpression, W as redactForState, Wt as recordDroppedArrayElements, X as passReadVersionsFor, Xt as inheritedParameterExpression, Y as passProvenanceFor, Yt as inheritNestedStackParameterAssociations, Z as recordReferenceProvenanceEntry, Zt as inheritedRenderedToken, _ as noEchoComparison, _n as freshNoEchoValuesOf, _t as maskSecretsInText, an as recordRecoverableMaskedOutput, at as literalSplitDelimitersOf, bn as isScopedSecretVerdict, bt as legacyReferenceLeavesOnly, c as parseLambdaFunctionAddress, ct as recordLogOnlyParameterValue, d as canonicalJson$
|
|
12
|
-
import { C as withUnsettledItems, S as unsettledPropertiesOf, T as withoutUnsettledProperties, _ as isUsableAttemptedName, b as unsettledItemsOf, c as planTagDiff, f as tagPlanWarning, h as definedAttributes, i as refuseRestoreFromItself, l as readTagList, u as refuseMalformedDesiredTags, v as unsettledContextOf, w as withUnsettledProperties, x as unsettledItemsTopKey, y as unsettledItemsField } from "./restore-source-guard-
|
|
8
|
+
import { $t as markAuxiliaryFailure, At as canonicalizeRoute53QueryName, B as assertRegionMatch, Bt as createMaskedRetryLogger, D as withoutServerErrorRetries, F as refusalTypeShown, Gt as RETRY_AUXILIARY_OWNER, H as markNotGone, Ht as maskDeep, It as resourceTypeShown, Jt as createdBeforeFailure, K as observeThenDisableProtection, L as resolveExplicitPhysicalId, Lt as segmentAfterAnchor, M as isQuotableImportValue, Mt as compositeIdSeparatorRefusal, N as normalizeAwsTagsToCfn, P as quotedRemedyLogicalId, Pt as logicalIdShown, Qt as isAuxiliaryMarkOf, Rt as stateOrphanRecordRemedy, U as compensateProtectionFlip, Ut as maskerOrIdentity, V as isMarkedNotGone, Vt as isSecretDerivedValue, W as deleteWithProtectionCompensation, Wt as withDerivedNameMasks, Yt as createdResourceIdentityBeforeFailure, Zt as isAuxiliaryFailure, _n as withPasteableAwsProfile, at as runDeleteAttempt, bt as startInterruptWatch, ct as monotonicNowMs, d as CreatedResourceSink, dn as sanitizeRecoveryValue, en as markCreatedBeforeFailure, f as clearCreatedReport, fn as CUSTOM_RESOURCE_RESPONSE_PREFIX, g as retractCreatedResource, i as withResourceDeadline, it as protectionFlipKey, kt as withUnchangedSecretPrincipalLists, lt as DELETION_PROTECTION_DOC_POINTER, m as reportCreatedResource, mn as WAIT_CONDITION_SIGNAL_PREFIX, mt as protectedReplacementAdvice, n as enclosingDeadlineRemainingMs, nt as ProtectionFlipRegistry, o as prepareRemovalForUpdate, ot as ElapsedBudget, p as collectCreatedResources, pn as DEFAULT_STATE_PREFIX, pt as pasteableAwsCommand, r as whileEnclosingDeadlinesPaused, rt as isTerminalDeleteFailure, s as removalWarning, st as ElapsedBudgetRegistry, t as enclosingDeadlineExpired, u as withoutInjectedRemovals, un as recoveryCommandFlags, vn as injectiveKey, wt as holdsSecretDerivedEntry, xn as producerRecordKey, yt as isInterruptedWaitError, z as RESOURCE_NOT_FOUND, zt as createMaskedLogSinks } from "./resource-deadline-CCBYcUI-.js";
|
|
9
|
+
import { t as expectedOwnerParam } from "./expected-bucket-owner-DjxT-AqD.js";
|
|
10
|
+
import { Ct as isReadableBag, Dt as skippedOutputsCarriedFrom, Et as shouldRetainResource, Ot as stackInstanceIdCarriedFrom, St as importableOutputs, Tt as orphansCarriedFrom, _t as acceptedCreateOnlyDropsOf, gt as slowCcOperationTimeoutMs, ht as dbInstanceAttributes, i as dbClusterAttributes, n as isRefusedByName, r as markDeleteStarted, t as isDeleteStarted, vt as describeRegionValueKind, wt as orphansAfterRollback, xt as importableOutputKeys, yt as exportNamesCarriedFrom } from "./delete-started-B0adv_Q0.js";
|
|
11
|
+
import { $t as recordInheritedParameterValue, A as witnessNormalize, An as recordNoEchoAttributeValues, At as withoutPhysicalNameCopies, B as redactionClaimOf, Cn as noEchoParameterPlaintextsOf, Ct as withLegacyOverlapScan, D as recordedNoEchoValuesOf, Dn as recordFreshNoEchoValuesIn, Dt as replaceEmbeddedPhysicalNameRewrites, E as recordPassedNoEchoParameters, En as recordDerivedMaskOnlyValue, Et as repairPhysicalNameCopyLeaves, F as markLeafCertifiedBag, G as foldRecording, Gt as recordTakenIfBranch, H as mixedLiteralAnswered, Ht as splitOutsideDynamicReferences, I as markSameGenerationBag, In as isDynamicReferenceString, It as secretRerenderPairs, J as hasPassProvenance, Jt as templateRereadsAccountId, K as openRecordingScope, Kt as inheritedPseudoValue, L as mergeResolvedPairs, Ln as isSingleDynamicReferenceToken, M as carryRedactionMarks, Mn as recordProvenPublicExpression, Mt as DYNAMIC_REFERENCE_TOKEN_SCAN, N as intrinsicLeafResolutionOf, Nn as wholeStringLeavesOf, Nt as dynamicReferenceTokens, O as replaceAtCoordinates, Ot as scrubResourceRecord, P as isSameGenerationBag, Pn as withoutNoEchoParameterEntries, Q as recordReferenceResolution, Qt as recordInheritedParameterRead, R as recordIntrinsicLeafResolution, Rn as maskMatchSpans, S as noEchoParametersReadBy, Sn as markNoEchoParameterClass, St as replaceWholeLeaves, Tt as repairEmbeddedPhysicalNamesTowards, U as withLegacyMixedScan, Ut as standsForInheritedSecret, V as resolvedPlaintextOf, Vt as rereadParameterExpression, W as redactForState, Wt as recordDroppedArrayElements, X as passReadVersionsFor, Xt as inheritedParameterExpression, Y as passProvenanceFor, Yt as inheritNestedStackParameterAssociations, Z as recordReferenceProvenanceEntry, Zt as inheritedRenderedToken, _ as noEchoComparison, _n as freshNoEchoValuesOf, _t as maskSecretsInText, an as recordRecoverableMaskedOutput, at as literalSplitDelimitersOf, bn as isScopedSecretVerdict, bt as legacyReferenceLeavesOnly, c as parseLambdaFunctionAddress, ct as recordLogOnlyParameterValue, d as canonicalJson$7, dn as crossStackSourceKey, dt as shareLogOnlyValues, en as redactInheritedParameterValue, et as carryLogOnlyValues, f as isMarkedCoordinate, fn as recordCrossStackExpression, ft as unionOfSecretBags, g as maskedLeafCoordinatesOf, gn as contradictProvenPublicExpression, gt as maskSecretsInError, h as maskWholeValue, hn as carryFreshNoEchoMark, ht as maskRecordedSecretsInText, in as freshNoEchoLeafPositions, it as hasMaskableValues, jn as recordNoEchoParameterFreshValue, jt as spanNamesResolvableService, k as valueAtCoordinate, kt as withPhysicalNameCopies, ln as recordPhysicalNameCopy, lt as recordLogOnlySplitFragments, m as maskReadbackAtCoordinates, mn as carriesSecretMask, mt as errorCauseChain, nn as carriesFreshNoEchoValue, nt as createUnionSecretMasker, on as recoverMaskedOutput, ot as logOnlyValueCount, p as maskAtCoordinates, pn as splitGetAttStringForm, pt as createSecretMasker, q as recordSecretResolution, qt as recordInheritedPseudoParameters, rn as embedsFreshNoEchoValue, rt as hasLogOnlyValues, sn as physicalNameCopiesOf, st as printingCorpusOf, t as ReplacementRulesRegistry, tn as withdrawRenderedParameterSpelling, tt as carryLogOnlyValuesCarriedBy, u as canonicalCoordinates, un as recordNestedStackParameterExpressions, ut as recordLogOnlyValue, v as noEchoCoordinatesOf, vn as isMaskOnlyPlaintext, vt as differingStringLeaves, w as readbackPathFor, wn as pinScopedSecretVerdict, wt as embeddedPhysicalNameRewrites, x as noEchoParameterNodesAt, xn as isSecretExpressionByVerdictOrSpelling, xt as overlapRuleAnswered, y as noEchoLeavesOf, yn as isNoEchoParameterPlaintext, yt as legacyLeavesWithoutMask, z as recordIntrinsicLeafResolutionAs, zt as arrayPairsWhateverDrops } from "./replacement-rules-DfitfaSq.js";
|
|
12
|
+
import { C as withUnsettledItems, S as unsettledPropertiesOf, T as withoutUnsettledProperties, _ as isUsableAttemptedName, b as unsettledItemsOf, c as planTagDiff, f as tagPlanWarning, h as definedAttributes, i as refuseRestoreFromItself, l as readTagList, u as refuseMalformedDesiredTags, v as unsettledContextOf, w as withUnsettledProperties, x as unsettledItemsTopKey, y as unsettledItemsField } from "./restore-source-guard-gqR_ya6m.js";
|
|
13
13
|
import { createHash, randomUUID, timingSafeEqual } from "node:crypto";
|
|
14
14
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
15
15
|
import { CreateBucketCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketLifecycleConfigurationCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client } from "@aws-sdk/client-s3";
|
|
@@ -82,7 +82,7 @@ async function resolveBucketRegion(bucketName, opts = {}) {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
try {
|
|
85
|
-
const { expectedOwnerParam } = await import("./expected-bucket-owner-
|
|
85
|
+
const { expectedOwnerParam } = await import("./expected-bucket-owner-DjxT-AqD.js").then((n) => n.n);
|
|
86
86
|
return (await client.send(new GetBucketLocationCommand({
|
|
87
87
|
Bucket: bucketName,
|
|
88
88
|
...await expectedOwnerParam(client)
|
|
@@ -1803,7 +1803,7 @@ var CrossPrefixReadError = class extends Error {
|
|
|
1803
1803
|
key;
|
|
1804
1804
|
cause;
|
|
1805
1805
|
constructor(key, cause) {
|
|
1806
|
-
super(`reading ${displayIdent(key, { maxCodePoints: 1024 })} failed (${errorName$
|
|
1806
|
+
super(`reading ${displayIdent(key, { maxCodePoints: 1024 })} failed (${errorName$2(cause, "an unknown error")})`);
|
|
1807
1807
|
this.name = "CrossPrefixReadError";
|
|
1808
1808
|
this.key = key;
|
|
1809
1809
|
this.cause = cause;
|
|
@@ -2081,7 +2081,7 @@ function destructiveDeployUnderOtherPrefixMessage(s, prefixes, action = "deploy-
|
|
|
2081
2081
|
function staleRecordNotice(s, prefixes) {
|
|
2082
2082
|
return `Note: bucket ${displayIdent(s.bucket)} also holds a record of stack ${subjectText(s)} under another state prefix (${prefixesText(prefixes)}) that owns no resource -- the leftover of a failed first deploy. It does not block this command; remove it with \`${stateCommand("orphan", s, prefixes[0])}\`${prefixes.length > 1 ? ", and the same with each other prefix" : ""}.`;
|
|
2083
2083
|
}
|
|
2084
|
-
function errorName$
|
|
2084
|
+
function errorName$2(error, fallback) {
|
|
2085
2085
|
const subject = error instanceof CrossPrefixReadError ? error.cause : error;
|
|
2086
2086
|
return subject !== null && typeof subject === "object" && typeof subject.name === "string" ? displaySafe(subject.name, { asciiOnly: true }) : fallback;
|
|
2087
2087
|
}
|
|
@@ -2089,10 +2089,10 @@ function failedKeyText(error) {
|
|
|
2089
2089
|
return error instanceof CrossPrefixReadError ? ` reading s3 object ${displayIdent(error.key, { maxCodePoints: 1024 })}` : "";
|
|
2090
2090
|
}
|
|
2091
2091
|
function crossPrefixDeniedWarning(s, error, stage = "probe") {
|
|
2092
|
-
if (stage === "registry" && isNotImplemented(unwrapCause(error))) return `Could not use the stack registry for stack ${subjectText(s)}: the state bucket's endpoint does not implement a conditional write${failedKeyText(error)} (${errorName$
|
|
2093
|
-
if (stage === "registry") return `Could not use the stack registry for stack ${subjectText(s)}: S3 refused${failedKeyText(error)} (${errorName$
|
|
2092
|
+
if (stage === "registry" && isNotImplemented(unwrapCause(error))) return `Could not use the stack registry for stack ${subjectText(s)}: the state bucket's endpoint does not implement a conditional write${failedKeyText(error)} (${errorName$2(error, "NotImplemented")}), so the bucket's other state prefixes were scanned instead, which is slower. Continuing.`;
|
|
2093
|
+
if (stage === "registry") return `Could not use the stack registry for stack ${subjectText(s)}: S3 refused${failedKeyText(error)} (${errorName$2(error, "AccessDenied")}), so the bucket's other state prefixes were scanned instead, which is slower. Grant s3:GetObject, s3:PutObject and s3:DeleteObject on ${displayIdent(s.bucket)}/_cdkd-registry/* to use it. Continuing.`;
|
|
2094
2094
|
const what = stage === "list" ? `S3 refused to list bucket ${displayIdent(s.bucket)}` : `S3 refused a read under another state prefix of bucket ${displayIdent(s.bucket)}`;
|
|
2095
|
-
return `Could not check the other state prefixes for stack ${subjectText(s)}: ${what} (${errorName$
|
|
2095
|
+
return `Could not check the other state prefixes for stack ${subjectText(s)}: ${what} (${errorName$2(error, "AccessDenied")}). Continuing. Deploying one stack name under two state prefixes in one account and region is unsupported.`;
|
|
2096
2096
|
}
|
|
2097
2097
|
function inProgressUnderOtherPrefixMessage(s, action, prefix) {
|
|
2098
2098
|
const account = recoveryCommandFlags({
|
|
@@ -2118,7 +2118,7 @@ function inProgressUnderOtherPrefixMessage(s, action, prefix) {
|
|
|
2118
2118
|
return `Refusing to ${VERB[action]} stack ${subjectText(s)}: bucket ${displayIdent(s.bucket)} assigns it to state prefix ${displayIdent(prefix)}, which records nothing for it yet but holds its lock, so a deploy there may be in progress. ${UNSUPPORTED_SENTENCE} ${NOTHING[action]} Re-run once that deploy has finished; if none is running, remove its lock with \`${unlock}\` and re-run.`;
|
|
2119
2119
|
}
|
|
2120
2120
|
function crossPrefixFailedMessage(s, action, error) {
|
|
2121
|
-
return `Refusing to ${VERB[action]} stack ${subjectText(s)}: cdkd could not check whether the bucket ${displayIdent(s.bucket)} records it under another state prefix (${errorName$
|
|
2121
|
+
return `Refusing to ${VERB[action]} stack ${subjectText(s)}: cdkd could not check whether the bucket ${displayIdent(s.bucket)} records it under another state prefix (${errorName$2(error, "an unknown error")}${failedKeyText(error)}). ${UNSUPPORTED_SENTENCE} ${NOTHING[action]} Re-run once the check can succeed.`;
|
|
2122
2122
|
}
|
|
2123
2123
|
function applyCrossPrefixScan(result, s, action, warn, info) {
|
|
2124
2124
|
if (result.kind !== "in-progress" && result.stale !== void 0 && result.stale.length > 0) info?.(staleRecordNotice(s, result.stale));
|
|
@@ -4396,6 +4396,7 @@ const PROPERTY_COVERAGE_BY_TYPE = /* @__PURE__ */ new Map([
|
|
|
4396
4396
|
"AuthType",
|
|
4397
4397
|
"IdentitySource",
|
|
4398
4398
|
"IdentityValidationExpression",
|
|
4399
|
+
"JwtConfiguration",
|
|
4399
4400
|
"Name",
|
|
4400
4401
|
"ProviderARNs",
|
|
4401
4402
|
"RestApiId",
|
|
@@ -4946,6 +4947,18 @@ const PROPERTY_COVERAGE_BY_TYPE = /* @__PURE__ */ new Map([
|
|
|
4946
4947
|
primaryIdentifier: /* @__PURE__ */ new Set(["StackId"]),
|
|
4947
4948
|
ccRouteUnavailable: true
|
|
4948
4949
|
}],
|
|
4950
|
+
["AWS::CloudFormation::WaitCondition", {
|
|
4951
|
+
handled: /* @__PURE__ */ new Set([
|
|
4952
|
+
"Count",
|
|
4953
|
+
"Handle",
|
|
4954
|
+
"Timeout"
|
|
4955
|
+
]),
|
|
4956
|
+
sdkUnwired: /* @__PURE__ */ new Map(),
|
|
4957
|
+
createOnlyDrops: /* @__PURE__ */ new Set(),
|
|
4958
|
+
readOnly: /* @__PURE__ */ new Set(["Data", "Id"]),
|
|
4959
|
+
primaryIdentifier: /* @__PURE__ */ new Set(["Id"]),
|
|
4960
|
+
ccRouteUnavailable: true
|
|
4961
|
+
}],
|
|
4949
4962
|
["AWS::CloudFormation::WaitConditionHandle", {
|
|
4950
4963
|
handled: /* @__PURE__ */ new Set(),
|
|
4951
4964
|
sdkUnwired: /* @__PURE__ */ new Map(),
|
|
@@ -7105,7 +7118,7 @@ const PROPERTY_COVERAGE_BY_TYPE = /* @__PURE__ */ new Map([
|
|
|
7105
7118
|
"Type",
|
|
7106
7119
|
"Weight"
|
|
7107
7120
|
]),
|
|
7108
|
-
sdkUnwired: /* @__PURE__ */ new Map(),
|
|
7121
|
+
sdkUnwired: /* @__PURE__ */ new Map([["AZAffinity", "not yet implemented by cdkd"]]),
|
|
7109
7122
|
createOnlyDrops: /* @__PURE__ */ new Set(),
|
|
7110
7123
|
readOnly: /* @__PURE__ */ new Set(),
|
|
7111
7124
|
primaryIdentifier: /* @__PURE__ */ new Set([
|
|
@@ -7571,7 +7584,6 @@ const NON_PROVISIONABLE_TYPES = /* @__PURE__ */ new Set([
|
|
|
7571
7584
|
"AWS::CleanRoomsML::TrainedModelInferenceJob",
|
|
7572
7585
|
"AWS::CloudFormation::Macro",
|
|
7573
7586
|
"AWS::CloudFormation::ResourceScan",
|
|
7574
|
-
"AWS::CloudFormation::WaitCondition",
|
|
7575
7587
|
"AWS::CloudFront::StreamingDistribution",
|
|
7576
7588
|
"AWS::CloudHSMV2::Backup",
|
|
7577
7589
|
"AWS::CodeArtifact::Package",
|
|
@@ -7853,6 +7865,7 @@ const SDK_PROVIDER_NON_PROVISIONABLE_TYPES = /* @__PURE__ */ new Set([
|
|
|
7853
7865
|
"AWS::BedrockAgentCore::Browser",
|
|
7854
7866
|
"AWS::BedrockAgentCore::CodeInterpreter",
|
|
7855
7867
|
"AWS::Budgets::Budget",
|
|
7868
|
+
"AWS::CloudFormation::WaitCondition",
|
|
7856
7869
|
"AWS::CloudFormation::WaitConditionHandle",
|
|
7857
7870
|
"AWS::CloudWatch::AnomalyDetector",
|
|
7858
7871
|
"AWS::CodeBuild::Project",
|
|
@@ -7878,6 +7891,43 @@ function unsupportedTypeIssueUrl(resourceType) {
|
|
|
7878
7891
|
return `https://github.com/go-to-k/cdkd/issues/new?title=${encodeURIComponent(`Support resource type ${resourceType}`)}&labels=resource-support`;
|
|
7879
7892
|
}
|
|
7880
7893
|
|
|
7894
|
+
// src/provisioning/sdk-unmodelled-nested-paths.ts
|
|
7895
|
+
const SDK_UNMODELLED_NESTED_PATHS = {
|
|
7896
|
+
"AWS::CloudFront::Distribution": ["DistributionConfig.Origins.CustomOriginConfig.OriginHttpVersion", "DistributionConfig.Origins.VpcOriginConfig.OriginHttpVersion"],
|
|
7897
|
+
"AWS::Route53::HostedZone": [
|
|
7898
|
+
"HostedZoneConfig.HostedZoneTier",
|
|
7899
|
+
"HostedZoneFeatures.ChangeGuardrails",
|
|
7900
|
+
"HostedZoneFeatures.ChangeGuardrails.Name",
|
|
7901
|
+
"HostedZoneFeatures.ChangeGuardrails.Status",
|
|
7902
|
+
"HostedZoneFeatures.EnablePublicDNSFallback"
|
|
7903
|
+
]
|
|
7904
|
+
};
|
|
7905
|
+
function sdkUnmodelledNestedRationale(path) {
|
|
7906
|
+
return `${path} is not modelled by the AWS SDK client cdkd ships, so the SDK provider would drop it`;
|
|
7907
|
+
}
|
|
7908
|
+
function findSdkUnmodelledNestedProperties(resourceType, templateProperties) {
|
|
7909
|
+
const declared = SDK_UNMODELLED_NESTED_PATHS[resourceType];
|
|
7910
|
+
if (declared === void 0 || templateProperties === void 0) return [];
|
|
7911
|
+
const routed = /* @__PURE__ */ new Map();
|
|
7912
|
+
for (const path of declared) {
|
|
7913
|
+
const [top, ...rest] = path.split(".");
|
|
7914
|
+
if (routed.has(top)) continue;
|
|
7915
|
+
if (holdsPath(templateProperties[top], rest)) routed.set(top, sdkUnmodelledNestedRationale(path));
|
|
7916
|
+
}
|
|
7917
|
+
return [...routed].map(([property, rationale]) => ({
|
|
7918
|
+
property,
|
|
7919
|
+
rationale
|
|
7920
|
+
}));
|
|
7921
|
+
}
|
|
7922
|
+
function holdsPath(value, segments) {
|
|
7923
|
+
if (value === void 0 || value === null) return false;
|
|
7924
|
+
if (Array.isArray(value)) return value.some((item) => holdsPath(item, segments));
|
|
7925
|
+
if (segments.length === 0) return true;
|
|
7926
|
+
if (typeof value !== "object") return false;
|
|
7927
|
+
const [head, ...rest] = segments;
|
|
7928
|
+
return holdsPath(value[head], rest);
|
|
7929
|
+
}
|
|
7930
|
+
|
|
7881
7931
|
// src/provisioning/property-coverage.ts
|
|
7882
7932
|
function getPropertyCoverage(resourceType) {
|
|
7883
7933
|
return PROPERTY_COVERAGE_BY_TYPE.get(resourceType);
|
|
@@ -7911,12 +7961,13 @@ function findActionableSdkUnwired(resourceType, templateProperties, allowedKeys,
|
|
|
7911
7961
|
}
|
|
7912
7962
|
const AWS_CN_CROSS_REGION_REPLICA_RATIONALE = "an aws-cn cross-region read replica: RDS in China honours its PreSignedUrl, which the AWS SDK for JavaScript signs for the commercial amazonaws.com host rather than the amazonaws.com.cn one CloudFormation's handler signs for";
|
|
7913
7963
|
function findValueRoutedProperties(resourceType, templateProperties) {
|
|
7964
|
+
const nested = findSdkUnmodelledNestedProperties(resourceType, templateProperties);
|
|
7914
7965
|
const property = CROSS_REGION_REPLICA_SOURCE_KEYS[resourceType];
|
|
7915
|
-
if (property === void 0) return
|
|
7966
|
+
if (property === void 0) return nested;
|
|
7916
7967
|
const source = templateProperties?.[property];
|
|
7917
|
-
if (typeof source !== "string" || !source.startsWith("arn:aws-cn:")) return
|
|
7918
|
-
if (sameRegion(ambientRegion(), source.split(":")[3])) return
|
|
7919
|
-
return [{
|
|
7968
|
+
if (typeof source !== "string" || !source.startsWith("arn:aws-cn:")) return nested;
|
|
7969
|
+
if (sameRegion(ambientRegion(), source.split(":")[3])) return nested;
|
|
7970
|
+
return [...nested, {
|
|
7920
7971
|
property,
|
|
7921
7972
|
rationale: AWS_CN_CROSS_REGION_REPLICA_RATIONALE
|
|
7922
7973
|
}];
|
|
@@ -7947,7 +7998,7 @@ function toJsonValue(value) {
|
|
|
7947
7998
|
return value === void 0 ? void 0 : JSON.parse(JSON.stringify(value));
|
|
7948
7999
|
}
|
|
7949
8000
|
function findAcceptedSdkUnwired(resourceType, templateProperties, allowedKeys, recordedProperties) {
|
|
7950
|
-
if (findRoutableUnrecognizedProperties(resourceType, templateProperties, allowedKeys, recordedProperties).length > 0) return [];
|
|
8001
|
+
if (findRoutableUnrecognizedProperties(resourceType, templateProperties, allowedKeys, recordedProperties).length > 0 || findValueRoutedProperties(resourceType, templateProperties).some(({ property }) => !allowedKeys.has(`${resourceType}:${property}`))) return [];
|
|
7951
8002
|
const drops = findSdkUnwiredProperties(resourceType, templateProperties);
|
|
7952
8003
|
const accepted = [];
|
|
7953
8004
|
for (const { property } of drops) {
|
|
@@ -8877,12 +8928,12 @@ function malformedOrphansForOrphanRefusalMessage(rawStackName, rawRegion, logica
|
|
|
8877
8928
|
|
|
8878
8929
|
// src/deployment/masked-property-fingerprints/core.ts
|
|
8879
8930
|
const FINGERPRINT_LAYOUT$1 = 1;
|
|
8880
|
-
function canonicalJson$
|
|
8931
|
+
function canonicalJson$6(value) {
|
|
8881
8932
|
if (value === void 0) return "null";
|
|
8882
|
-
if (Array.isArray(value)) return `[${value.map(canonicalJson$
|
|
8933
|
+
if (Array.isArray(value)) return `[${value.map(canonicalJson$6).join(",")}]`;
|
|
8883
8934
|
if (value !== null && typeof value === "object") {
|
|
8884
8935
|
const record = value;
|
|
8885
|
-
return `{${Object.keys(record).filter((key) => record[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson$
|
|
8936
|
+
return `{${Object.keys(record).filter((key) => record[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson$6(record[key])}`).join(",")}}`;
|
|
8886
8937
|
}
|
|
8887
8938
|
return JSON.stringify(value) ?? "null";
|
|
8888
8939
|
}
|
|
@@ -8903,7 +8954,7 @@ function splitInputFingerprint(entry) {
|
|
|
8903
8954
|
};
|
|
8904
8955
|
}
|
|
8905
8956
|
function templateCarriesNeedle(templateValue, secrets) {
|
|
8906
|
-
const text = canonicalJson$
|
|
8957
|
+
const text = canonicalJson$6(templateValue);
|
|
8907
8958
|
for (const needle of printingCorpusOf(secrets).keys()) {
|
|
8908
8959
|
if (needle.length < 4) continue;
|
|
8909
8960
|
if (text.includes(needle) || text.includes(JSON.stringify(needle).slice(1, -1))) return true;
|
|
@@ -8911,7 +8962,7 @@ function templateCarriesNeedle(templateValue, secrets) {
|
|
|
8911
8962
|
return false;
|
|
8912
8963
|
}
|
|
8913
8964
|
function maskedPropertyFingerprint(templateValue) {
|
|
8914
|
-
const digest = createHash("sha256").update(canonicalJson$
|
|
8965
|
+
const digest = createHash("sha256").update(canonicalJson$6({
|
|
8915
8966
|
layout: FINGERPRINT_LAYOUT$1,
|
|
8916
8967
|
value: templateValue
|
|
8917
8968
|
})).digest("hex");
|
|
@@ -9169,7 +9220,7 @@ async function maskedInputWalk(templateValue, sources, covered) {
|
|
|
9169
9220
|
};
|
|
9170
9221
|
}
|
|
9171
9222
|
function inputFingerprintOf(form, templateValue) {
|
|
9172
|
-
const digest = createHash("sha256").update(canonicalJson$
|
|
9223
|
+
const digest = createHash("sha256").update(canonicalJson$6({
|
|
9173
9224
|
layout: 2,
|
|
9174
9225
|
value: form
|
|
9175
9226
|
})).digest("hex");
|
|
@@ -9220,7 +9271,7 @@ const NESTED_STACK_TYPE$4 = "AWS::CloudFormation::Stack";
|
|
|
9220
9271
|
const NESTED_OUTPUT_PREFIX = "Outputs.";
|
|
9221
9272
|
function carriesSecretValue(value, corpora) {
|
|
9222
9273
|
if (carriesSecretMask(value)) return true;
|
|
9223
|
-
const text = canonicalJson$
|
|
9274
|
+
const text = canonicalJson$6(value);
|
|
9224
9275
|
if (text.includes("{{resolve:")) return true;
|
|
9225
9276
|
for (const corpus of corpora) {
|
|
9226
9277
|
if (corpus === void 0) continue;
|
|
@@ -9269,7 +9320,7 @@ function parameterInputsFor(args) {
|
|
|
9269
9320
|
};
|
|
9270
9321
|
}
|
|
9271
9322
|
function carriesReference(operand) {
|
|
9272
|
-
return canonicalJson$
|
|
9323
|
+
return canonicalJson$6(operand).includes(DYNAMIC_REFERENCE_OPEN);
|
|
9273
9324
|
}
|
|
9274
9325
|
function proof(walk, proven) {
|
|
9275
9326
|
return walk.covered === void 0 ? {} : { proven: proven() };
|
|
@@ -9691,7 +9742,7 @@ function possiblyMaskedKeys(resolvedProps, corpora) {
|
|
|
9691
9742
|
return Object.keys(resolvedProps).filter((key) => {
|
|
9692
9743
|
const value = resolvedProps[key];
|
|
9693
9744
|
if (carriesSecretMask(value) || wholeShortLeaf(value)) return true;
|
|
9694
|
-
const text = canonicalJson$
|
|
9745
|
+
const text = canonicalJson$6(value);
|
|
9695
9746
|
return long.some((needle) => text.includes(needle) || text.includes(JSON.stringify(needle).slice(1, -1)));
|
|
9696
9747
|
});
|
|
9697
9748
|
}
|
|
@@ -10182,7 +10233,7 @@ function replacementNameKeyMoves(input) {
|
|
|
10182
10233
|
if (key === void 0) return void 0;
|
|
10183
10234
|
const fold = replacementOrderIsCaseSensitive(input.resourceType) ? (v) => v : (v) => v.toLowerCase();
|
|
10184
10235
|
for (const path of key.name) {
|
|
10185
|
-
const desiredName = valueAt$
|
|
10236
|
+
const desiredName = valueAt$2(input.desiredProperties, path);
|
|
10186
10237
|
if (desiredName === void 0) continue;
|
|
10187
10238
|
const held = heldAt(input.recorded, input.observed, path);
|
|
10188
10239
|
if (held.unreadable || held.value === void 0) return void 0;
|
|
@@ -10210,7 +10261,7 @@ function renameMakesRecreateCreateFirst(input) {
|
|
|
10210
10261
|
}
|
|
10211
10262
|
return false;
|
|
10212
10263
|
}
|
|
10213
|
-
function valueAt$
|
|
10264
|
+
function valueAt$2(bag, path) {
|
|
10214
10265
|
let node = bag;
|
|
10215
10266
|
for (const segment of path.slice(0, -1)) {
|
|
10216
10267
|
if (node === null || typeof node !== "object" || Array.isArray(node)) return void 0;
|
|
@@ -10227,14 +10278,14 @@ function unreadableAt(bag, path) {
|
|
|
10227
10278
|
if (node === null || typeof node !== "object" || Array.isArray(node)) return false;
|
|
10228
10279
|
node = node[segment];
|
|
10229
10280
|
}
|
|
10230
|
-
return node !== void 0 && node !== null && valueAt$
|
|
10281
|
+
return node !== void 0 && node !== null && valueAt$2(bag, path) === void 0;
|
|
10231
10282
|
}
|
|
10232
10283
|
function heldAt(recorded, observed, path) {
|
|
10233
10284
|
if (unreadableAt(recorded, path)) return {
|
|
10234
10285
|
value: void 0,
|
|
10235
10286
|
unreadable: true
|
|
10236
10287
|
};
|
|
10237
|
-
const value = valueAt$
|
|
10288
|
+
const value = valueAt$2(recorded, path) ?? valueAt$2(observed, path);
|
|
10238
10289
|
return {
|
|
10239
10290
|
value,
|
|
10240
10291
|
unreadable: value === void 0 && unreadableAt(observed, path)
|
|
@@ -10292,9 +10343,9 @@ const DEPLOY_VOICE = {
|
|
|
10292
10343
|
};
|
|
10293
10344
|
function sentIdentifierIs(requested, recorded, observed, physicalId) {
|
|
10294
10345
|
const isNameKey = (key) => /(Name|Identifier)$/.test(key);
|
|
10295
|
-
if (!Object.keys(requested).some((key) => isNameKey(key) && valueAt$
|
|
10346
|
+
if (!Object.keys(requested).some((key) => isNameKey(key) && valueAt$2(requested, [key]) === physicalId)) return false;
|
|
10296
10347
|
return [...new Set([...Object.keys(requested), ...Object.keys(recorded ?? {})].filter(isNameKey))].every((key) => {
|
|
10297
|
-
const sent = valueAt$
|
|
10348
|
+
const sent = valueAt$2(requested, [key]);
|
|
10298
10349
|
return sent !== void 0 && heldAt(recorded, observed, [key]).value === sent;
|
|
10299
10350
|
});
|
|
10300
10351
|
}
|
|
@@ -10323,7 +10374,7 @@ function replayPrefixChoice(input) {
|
|
|
10323
10374
|
if (raw === void 0 || raw === "") return { kind: "not-applicable" };
|
|
10324
10375
|
const recorded = getCurrentSkipPrefix();
|
|
10325
10376
|
const property = rewrite.property;
|
|
10326
|
-
const declared = valueAt$
|
|
10377
|
+
const declared = valueAt$2(input.properties, [property]);
|
|
10327
10378
|
if (declared === void 0 || typeof input.logicalId !== "string" || typeof input.physicalId !== "string" || input.physicalId === "") return {
|
|
10328
10379
|
kind: "unreproduced",
|
|
10329
10380
|
skipPrefix: recorded,
|
|
@@ -10471,22 +10522,22 @@ function reverseReplacementTrustsGeneratedName(resourceType) {
|
|
|
10471
10522
|
// src/deployment/replacement-name-holder/holder.ts
|
|
10472
10523
|
function recordSetHolds(requested, recorded, observed, newPhysicalId, r, v) {
|
|
10473
10524
|
const newRecord = `${v.holderRecord} (${r.shown(newPhysicalId)})`;
|
|
10474
|
-
const wantName = valueAt$
|
|
10475
|
-
const wantType = valueAt$
|
|
10525
|
+
const wantName = valueAt$2(requested, ["Name"]);
|
|
10526
|
+
const wantType = valueAt$2(requested, ["Type"]);
|
|
10476
10527
|
const haveName = heldAt(recorded, observed, ["Name"]).value;
|
|
10477
10528
|
const haveType = heldAt(recorded, observed, ["Type"]).value;
|
|
10478
10529
|
if (wantName === void 0 || wantType === void 0) return unproven(`cdkd cannot read the Name and Type ${v.createdRecord} asked for`);
|
|
10479
10530
|
const wanted = `${v.create} asked for Name ${r.quoted(wantName)}`;
|
|
10480
10531
|
if (haveName === void 0 || haveType === void 0) return unproven(`${wanted}, and cdkd cannot read the name ${newRecord} holds`);
|
|
10481
10532
|
if (dnsFold(wantName) !== dnsFold(haveName)) return /\\[0-9]{3}/.test(wantName + haveName) ? unproven(`${wanted}, and cdkd cannot compare it with the escaped name ${newRecord} holds`) : elsewhere(`${wanted}, while ${newRecord} holds Name ${r.quoted(haveName)}`);
|
|
10482
|
-
const wantZoneId = valueAt$
|
|
10533
|
+
const wantZoneId = valueAt$2(requested, ["HostedZoneId"]);
|
|
10483
10534
|
const haveZoneId = heldAt(recorded, observed, ["HostedZoneId"]).value;
|
|
10484
|
-
const wantZoneName = valueAt$
|
|
10535
|
+
const wantZoneName = valueAt$2(requested, ["HostedZoneName"]);
|
|
10485
10536
|
const haveZoneName = heldAt(recorded, observed, ["HostedZoneName"]).value;
|
|
10486
10537
|
const sameZone = wantZoneId !== void 0 && haveZoneId !== void 0 ? zoneIdFold(wantZoneId) === zoneIdFold(haveZoneId) : wantZoneName !== void 0 && haveZoneName !== void 0 ? dnsFold(wantZoneName) === dnsFold(haveZoneName) : void 0;
|
|
10487
10538
|
if (sameZone === false) return elsewhere(`${wanted}, while ${newRecord} is in another hosted zone`);
|
|
10488
10539
|
if (sameZone === void 0) return unproven(`${wanted}, and cdkd cannot tell whether ${newRecord} is in the same hosted zone`);
|
|
10489
|
-
const wantSet = valueAt$
|
|
10540
|
+
const wantSet = valueAt$2(requested, ["SetIdentifier"]);
|
|
10490
10541
|
const haveSet = heldAt(recorded, observed, ["SetIdentifier"]).value;
|
|
10491
10542
|
if (wantType.toUpperCase() === "CNAME" !== (haveType.toUpperCase() === "CNAME")) return HOLDS;
|
|
10492
10543
|
if (wantType.toUpperCase() !== haveType.toUpperCase()) return elsewhere(`${wanted} of Type ${r.quoted(wantType)}, while ${newRecord} is a ${r.quoted(haveType)} record of that name`);
|
|
@@ -10502,7 +10553,7 @@ function pathValue(bag, path) {
|
|
|
10502
10553
|
return node;
|
|
10503
10554
|
}
|
|
10504
10555
|
function rewrittenNameHolds(input, rewrite, viaCloudControl, labels, newResource, r, v) {
|
|
10505
|
-
const declared = valueAt$
|
|
10556
|
+
const declared = valueAt$2(input.requested, [rewrite.property]);
|
|
10506
10557
|
const logicalId = typeof input.logicalId === "string" && input.logicalId !== "" ? input.logicalId : void 0;
|
|
10507
10558
|
if (declared === void 0 && (viaCloudControl || logicalId === void 0)) return unproven(`${v.create} named no ${labels}, and cdkd cannot derive the name its provider generates, so it cannot show that ${newResource} holds it`);
|
|
10508
10559
|
const sent = viaCloudControl ? declared : generateResourceNameWithFallback(declared, logicalId ?? "", { maxLength: rewrite.maxLength });
|
|
@@ -10536,11 +10587,11 @@ function holderVerdict$1(input, v) {
|
|
|
10536
10587
|
const rewrite = ownEntry$1(SENT_NAME_REWRITTEN, oldResourceType);
|
|
10537
10588
|
if (rewrite !== void 0) return rewrittenNameHolds(input, rewrite, input.createdVia === "cc-api", labels, newResource, r, v);
|
|
10538
10589
|
let generatedName = false;
|
|
10539
|
-
let namePath = oldKey.name.find((path) => valueAt$
|
|
10540
|
-
let wantName = namePath === void 0 ? void 0 : valueAt$
|
|
10590
|
+
let namePath = oldKey.name.find((path) => valueAt$2(requested, path) !== void 0);
|
|
10591
|
+
let wantName = namePath === void 0 ? void 0 : valueAt$2(requested, namePath);
|
|
10541
10592
|
if (namePath === void 0 && input.generated !== void 0 && reverseReplacementTrustsGeneratedName(oldResourceType)) {
|
|
10542
|
-
namePath = oldKey.name.find((path) => valueAt$
|
|
10543
|
-
wantName = namePath === void 0 ? void 0 : valueAt$
|
|
10593
|
+
namePath = oldKey.name.find((path) => valueAt$2(input.generated, path) !== void 0);
|
|
10594
|
+
wantName = namePath === void 0 ? void 0 : valueAt$2(input.generated, namePath);
|
|
10544
10595
|
generatedName = wantName !== void 0;
|
|
10545
10596
|
}
|
|
10546
10597
|
const derived = ownEntry$1(DERIVED_GENERATED_NAMES, oldResourceType);
|
|
@@ -10559,14 +10610,14 @@ function holderVerdict$1(input, v) {
|
|
|
10559
10610
|
const h = heldAt(recorded, observed, path);
|
|
10560
10611
|
return h.value !== void 0 || h.unreadable;
|
|
10561
10612
|
});
|
|
10562
|
-
const recordedName = namePathHeld && valueAt$
|
|
10563
|
-
const observedName = namePathHeld && valueAt$
|
|
10613
|
+
const recordedName = namePathHeld && valueAt$2(recorded, namePathHeld);
|
|
10614
|
+
const observedName = namePathHeld && valueAt$2(observed, namePathHeld);
|
|
10564
10615
|
if (namePathHeld !== void 0 && recordedName !== void 0 && observedName !== void 0 && !same(recordedName, observedName)) return unproven(`${wanted}, and the records of ${newResource} disagree on its ${r.shown(namePathHeld.join("."))} (recorded ${r.quoted(recordedName)}, read back ${r.quoted(observedName)}), so cdkd cannot show which name it holds`);
|
|
10565
10616
|
const haveName = namePathHeld === void 0 ? void 0 : heldAt(recorded, observed, namePathHeld).value;
|
|
10566
10617
|
if (!(haveName !== void 0 && same(haveName, wantName) || physicalId !== "" && !NO_PHYSICAL_ID_NAME_PROOF.has(newResourceType) && holderIdNames(inCase(physicalId), inCase(wantName)))) return haveName !== void 0 && !generatedName ? elsewhere(`${wanted}, while ${newResource} holds ${r.quoted(haveName)}`) : unproven(`${wanted}, and cdkd cannot show that ${newResource} holds that name`);
|
|
10567
10618
|
for (const [i, path] of (oldKey.scope ?? []).entries()) {
|
|
10568
10619
|
const label = r.shown(path.join("."));
|
|
10569
|
-
const wantRaw = valueAt$
|
|
10620
|
+
const wantRaw = valueAt$2(requested, path);
|
|
10570
10621
|
const have = heldAt(recorded, observed, path);
|
|
10571
10622
|
if (wantRaw === void 0 && unreadableAt(requested, path) || have.unreadable) return unproven(`${wanted}, and cdkd cannot read the ${label} that places it`);
|
|
10572
10623
|
const fallback = oldKey.scopeDefaults?.[i];
|
|
@@ -12916,6 +12967,224 @@ function s3BucketWebsiteUrl(bucketName, region) {
|
|
|
12916
12967
|
return `http://${bucketName}.s3-website${S3_WEBSITE_ENDPOINT_LEGACY_DASH_REGIONS.has(folded) ? "-" : "."}${folded}.${urlSuffix}`;
|
|
12917
12968
|
}
|
|
12918
12969
|
|
|
12970
|
+
// src/provisioning/getatt-attributes.generated.ts
|
|
12971
|
+
const WRITABLE_GETATT_ATTRIBUTES = {
|
|
12972
|
+
"AWS::Amplify::Branch": ["BranchName"],
|
|
12973
|
+
"AWS::Amplify::Domain": [
|
|
12974
|
+
"AutoSubDomainCreationPatterns",
|
|
12975
|
+
"AutoSubDomainIAMRole",
|
|
12976
|
+
"DomainName",
|
|
12977
|
+
"EnableAutoSubDomain"
|
|
12978
|
+
],
|
|
12979
|
+
"AWS::AppMesh::GatewayRoute": [
|
|
12980
|
+
"GatewayRouteName",
|
|
12981
|
+
"MeshName",
|
|
12982
|
+
"MeshOwner",
|
|
12983
|
+
"VirtualGatewayName"
|
|
12984
|
+
],
|
|
12985
|
+
"AWS::AppMesh::Mesh": ["MeshName"],
|
|
12986
|
+
"AWS::AppMesh::Route": [
|
|
12987
|
+
"MeshName",
|
|
12988
|
+
"MeshOwner",
|
|
12989
|
+
"RouteName",
|
|
12990
|
+
"VirtualRouterName"
|
|
12991
|
+
],
|
|
12992
|
+
"AWS::AppMesh::VirtualGateway": [
|
|
12993
|
+
"MeshName",
|
|
12994
|
+
"MeshOwner",
|
|
12995
|
+
"VirtualGatewayName"
|
|
12996
|
+
],
|
|
12997
|
+
"AWS::AppMesh::VirtualNode": [
|
|
12998
|
+
"MeshName",
|
|
12999
|
+
"MeshOwner",
|
|
13000
|
+
"VirtualNodeName"
|
|
13001
|
+
],
|
|
13002
|
+
"AWS::AppMesh::VirtualRouter": [
|
|
13003
|
+
"MeshName",
|
|
13004
|
+
"MeshOwner",
|
|
13005
|
+
"VirtualRouterName"
|
|
13006
|
+
],
|
|
13007
|
+
"AWS::AppMesh::VirtualService": [
|
|
13008
|
+
"MeshName",
|
|
13009
|
+
"MeshOwner",
|
|
13010
|
+
"VirtualServiceName"
|
|
13011
|
+
],
|
|
13012
|
+
"AWS::AppSync::DataSource": ["Name"],
|
|
13013
|
+
"AWS::AppSync::DomainName": ["DomainName"],
|
|
13014
|
+
"AWS::AppSync::FunctionConfiguration": ["DataSourceName", "Name"],
|
|
13015
|
+
"AWS::AppSync::Resolver": ["FieldName", "TypeName"],
|
|
13016
|
+
"AWS::Backup::BackupSelection": ["BackupPlanId"],
|
|
13017
|
+
"AWS::Backup::BackupVault": ["BackupVaultName"],
|
|
13018
|
+
"AWS::CleanRooms::AnalysisTemplate": ["Schema"],
|
|
13019
|
+
"AWS::Cloud9::EnvironmentEC2": ["Name"],
|
|
13020
|
+
"AWS::CloudWatch::InsightRule": ["RuleName"],
|
|
13021
|
+
"AWS::CodeArtifact::Domain": ["EncryptionKey"],
|
|
13022
|
+
"AWS::CodeArtifact::Repository": ["DomainName", "DomainOwner"],
|
|
13023
|
+
"AWS::EC2::CapacityReservation": [
|
|
13024
|
+
"AvailabilityZone",
|
|
13025
|
+
"InstanceType",
|
|
13026
|
+
"Tenancy"
|
|
13027
|
+
],
|
|
13028
|
+
"AWS::EC2::Instance": ["AvailabilityZone"],
|
|
13029
|
+
"AWS::EC2::SecurityGroup": ["VpcId"],
|
|
13030
|
+
"AWS::EC2::Subnet": [
|
|
13031
|
+
"AvailabilityZone",
|
|
13032
|
+
"AvailabilityZoneId",
|
|
13033
|
+
"CidrBlock",
|
|
13034
|
+
"OutpostArn",
|
|
13035
|
+
"VpcId"
|
|
13036
|
+
],
|
|
13037
|
+
"AWS::EC2::VPC": ["CidrBlock"],
|
|
13038
|
+
"AWS::EFS::MountTarget": ["IpAddress"],
|
|
13039
|
+
"AWS::EKS::Nodegroup": ["ClusterName", "NodegroupName"],
|
|
13040
|
+
"AWS::ElasticLoadBalancingV2::LoadBalancer": ["SecurityGroups"],
|
|
13041
|
+
"AWS::EventSchemas::Discoverer": ["CrossAccount"],
|
|
13042
|
+
"AWS::EventSchemas::Registry": ["RegistryName"],
|
|
13043
|
+
"AWS::EventSchemas::Schema": ["SchemaName"],
|
|
13044
|
+
"AWS::Events::EventBus": ["Name"],
|
|
13045
|
+
"AWS::GameLift::GameSessionQueue": ["Name"],
|
|
13046
|
+
"AWS::GameLift::MatchmakingConfiguration": ["Name"],
|
|
13047
|
+
"AWS::GameLift::MatchmakingRuleSet": ["Name"],
|
|
13048
|
+
"AWS::Grafana::Workspace": ["GrafanaVersion"],
|
|
13049
|
+
"AWS::Greengrass::ConnectorDefinition": ["Name"],
|
|
13050
|
+
"AWS::Greengrass::CoreDefinition": ["Name"],
|
|
13051
|
+
"AWS::Greengrass::DeviceDefinition": ["Name"],
|
|
13052
|
+
"AWS::Greengrass::FunctionDefinition": ["Name"],
|
|
13053
|
+
"AWS::Greengrass::Group": ["Name", "RoleArn"],
|
|
13054
|
+
"AWS::Greengrass::LoggerDefinition": ["Name"],
|
|
13055
|
+
"AWS::Greengrass::ResourceDefinition": ["Name"],
|
|
13056
|
+
"AWS::Greengrass::SubscriptionDefinition": ["Name"],
|
|
13057
|
+
"AWS::ImageBuilder::Component": ["Name"],
|
|
13058
|
+
"AWS::ImageBuilder::ContainerRecipe": ["Name"],
|
|
13059
|
+
"AWS::ImageBuilder::DistributionConfiguration": ["Name"],
|
|
13060
|
+
"AWS::ImageBuilder::ImagePipeline": ["Name"],
|
|
13061
|
+
"AWS::ImageBuilder::ImageRecipe": ["Name"],
|
|
13062
|
+
"AWS::ImageBuilder::InfrastructureConfiguration": ["Name"],
|
|
13063
|
+
"AWS::Kinesis::StreamConsumer": ["ConsumerName", "StreamARN"],
|
|
13064
|
+
"AWS::MSK::Cluster": ["CurrentVersion"],
|
|
13065
|
+
"AWS::ManagedBlockchain::Member": ["NetworkId"],
|
|
13066
|
+
"AWS::ManagedBlockchain::Node": ["MemberId", "NetworkId"],
|
|
13067
|
+
"AWS::MediaConvert::JobTemplate": ["Name"],
|
|
13068
|
+
"AWS::MediaConvert::Preset": ["Name"],
|
|
13069
|
+
"AWS::MediaConvert::Queue": ["Name"],
|
|
13070
|
+
"AWS::NetworkManager::ConnectAttachment": ["ProposedSegmentChange"],
|
|
13071
|
+
"AWS::NetworkManager::SiteToSiteVpnAttachment": ["ProposedSegmentChange"],
|
|
13072
|
+
"AWS::NetworkManager::TransitGatewayRouteTableAttachment": ["ProposedSegmentChange"],
|
|
13073
|
+
"AWS::NetworkManager::VpcAttachment": ["ProposedSegmentChange"],
|
|
13074
|
+
"AWS::OpsWorks::Instance": ["AvailabilityZone"],
|
|
13075
|
+
"AWS::OpsWorks::UserProfile": ["SshUsername"],
|
|
13076
|
+
"AWS::QuickSight::Analysis": ["Errors", "Sheets"],
|
|
13077
|
+
"AWS::RDS::DBInstance": ["DBSystemId"],
|
|
13078
|
+
"AWS::RDS::DBParameterGroup": ["DBParameterGroupName"],
|
|
13079
|
+
"AWS::RedshiftServerless::Workgroup": ["Workgroup"],
|
|
13080
|
+
"AWS::RoboMaker::RobotApplication": ["CurrentRevisionId"],
|
|
13081
|
+
"AWS::RoboMaker::SimulationApplication": ["CurrentRevisionId"],
|
|
13082
|
+
"AWS::Route53Resolver::ResolverEndpoint": [
|
|
13083
|
+
"Direction",
|
|
13084
|
+
"Name",
|
|
13085
|
+
"OutpostArn",
|
|
13086
|
+
"PreferredInstanceType",
|
|
13087
|
+
"ResolverEndpointType"
|
|
13088
|
+
],
|
|
13089
|
+
"AWS::Route53Resolver::ResolverRule": [
|
|
13090
|
+
"DomainName",
|
|
13091
|
+
"Name",
|
|
13092
|
+
"ResolverEndpointId",
|
|
13093
|
+
"TargetIps"
|
|
13094
|
+
],
|
|
13095
|
+
"AWS::Route53Resolver::ResolverRuleAssociation": [
|
|
13096
|
+
"Name",
|
|
13097
|
+
"ResolverRuleId",
|
|
13098
|
+
"VPCId"
|
|
13099
|
+
],
|
|
13100
|
+
"AWS::S3::AccessPoint": ["Name"],
|
|
13101
|
+
"AWS::SNS::Topic": ["TopicName"],
|
|
13102
|
+
"AWS::SQS::Queue": ["QueueName"],
|
|
13103
|
+
"AWS::SSM::Parameter": ["Type"],
|
|
13104
|
+
"AWS::SSM::ResourceDataSync": ["SyncName"],
|
|
13105
|
+
"AWS::SageMaker::CodeRepository": ["CodeRepositoryName"],
|
|
13106
|
+
"AWS::SageMaker::Endpoint": ["EndpointName"],
|
|
13107
|
+
"AWS::SageMaker::EndpointConfig": ["EndpointConfigName"],
|
|
13108
|
+
"AWS::SageMaker::Model": ["ModelName"],
|
|
13109
|
+
"AWS::SageMaker::ModelPackage": ["LastModifiedTime"],
|
|
13110
|
+
"AWS::SageMaker::NotebookInstance": ["NotebookInstanceName"],
|
|
13111
|
+
"AWS::SageMaker::NotebookInstanceLifecycleConfig": ["NotebookInstanceLifecycleConfigName"],
|
|
13112
|
+
"AWS::SageMaker::Workteam": ["WorkteamName"],
|
|
13113
|
+
"AWS::ServiceDiscovery::Service": ["Name"],
|
|
13114
|
+
"AWS::Signer::SigningProfile": ["ProfileName"],
|
|
13115
|
+
"AWS::StepFunctions::Activity": ["Name"],
|
|
13116
|
+
"AWS::Transfer::User": ["ServerId", "UserName"]
|
|
13117
|
+
};
|
|
13118
|
+
const SHAPE_MISMATCHED_GETATT_ATTRIBUTES = {
|
|
13119
|
+
"AWS::DocDB::DBCluster": ["Port"],
|
|
13120
|
+
"AWS::Events::EventBus": ["Policy"],
|
|
13121
|
+
"AWS::MediaLive::Input": ["Destinations", "Sources"]
|
|
13122
|
+
};
|
|
13123
|
+
|
|
13124
|
+
// src/deployment/recorded-identity-attributes.ts
|
|
13125
|
+
const SURVIVOR_IDENTITY_ATTRIBUTES = {
|
|
13126
|
+
"AWS::IAM::Role": "RoleId",
|
|
13127
|
+
"AWS::IAM::ManagedPolicy": "PolicyId",
|
|
13128
|
+
"AWS::DynamoDB::Table": "TableId",
|
|
13129
|
+
"AWS::RDS::DBInstance": "DbiResourceId",
|
|
13130
|
+
"AWS::RDS::DBCluster": "DBClusterResourceId",
|
|
13131
|
+
"AWS::IAM::User": "UserId",
|
|
13132
|
+
"AWS::IAM::Group": "GroupId",
|
|
13133
|
+
"AWS::IAM::InstanceProfile": "InstanceProfileId"
|
|
13134
|
+
};
|
|
13135
|
+
function isRecordedIdentityAttribute(resourceType, key) {
|
|
13136
|
+
return Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, resourceType) && SURVIVOR_IDENTITY_ATTRIBUTES[resourceType] === key;
|
|
13137
|
+
}
|
|
13138
|
+
function keepRecordedIdentity(resourceType, previous, next, onDiffering) {
|
|
13139
|
+
if (!Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, resourceType)) return next;
|
|
13140
|
+
const key = SURVIVOR_IDENTITY_ATTRIBUTES[resourceType];
|
|
13141
|
+
const held = previous !== void 0 && Object.hasOwn(previous, key) ? previous[key] : void 0;
|
|
13142
|
+
const recorded = isUsableIdentityValue(held) ? held : void 0;
|
|
13143
|
+
if (recorded === void 0 || next[key] === recorded) return next;
|
|
13144
|
+
if (Object.hasOwn(next, key) && next[key] !== void 0) onDiffering?.(key);
|
|
13145
|
+
return {
|
|
13146
|
+
...next,
|
|
13147
|
+
[key]: recorded
|
|
13148
|
+
};
|
|
13149
|
+
}
|
|
13150
|
+
function attributesAfterUpdate(resourceType, previous, result, onDiffering) {
|
|
13151
|
+
if (result.wasReplaced) return result.attributes;
|
|
13152
|
+
const next = result.attributes ?? previous;
|
|
13153
|
+
return next === void 0 ? void 0 : keepRecordedIdentity(resourceType, previous, next, onDiffering);
|
|
13154
|
+
}
|
|
13155
|
+
function withoutDeadIdentity(resourceType, attributes) {
|
|
13156
|
+
if (attributes === void 0 || !Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, resourceType)) return attributes;
|
|
13157
|
+
const key = SURVIVOR_IDENTITY_ATTRIBUTES[resourceType];
|
|
13158
|
+
if (!Object.hasOwn(attributes, key)) return attributes;
|
|
13159
|
+
const { [key]: _dead, ...rest } = attributes;
|
|
13160
|
+
return rest;
|
|
13161
|
+
}
|
|
13162
|
+
function newCopyDeleteAttributes(resourceType, current, oldDeletedBeforeCreate, previous) {
|
|
13163
|
+
if (oldDeletedBeforeCreate !== true || !Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, resourceType)) return current;
|
|
13164
|
+
const key = SURVIVOR_IDENTITY_ATTRIBUTES[resourceType];
|
|
13165
|
+
return current?.[key] !== void 0 && current[key] === previous?.[key] ? withoutDeadIdentity(resourceType, current) : current;
|
|
13166
|
+
}
|
|
13167
|
+
function isUsableIdentityValue(value) {
|
|
13168
|
+
return typeof value === "string" && value !== "" && !value.includes("***") && !holdsSecretDerivedEntry(value);
|
|
13169
|
+
}
|
|
13170
|
+
function replaceDeadIdentity(resourceType, attributes, previous, madeIdentity) {
|
|
13171
|
+
const dropped = newCopyDeleteAttributes(resourceType, attributes, true, previous);
|
|
13172
|
+
if (dropped === attributes || madeIdentity === void 0 || madeIdentity === "") return dropped;
|
|
13173
|
+
return {
|
|
13174
|
+
...dropped,
|
|
13175
|
+
[SURVIVOR_IDENTITY_ATTRIBUTES[resourceType]]: madeIdentity
|
|
13176
|
+
};
|
|
13177
|
+
}
|
|
13178
|
+
|
|
13179
|
+
// src/deployment/unexposed-identity-attribute.ts
|
|
13180
|
+
function isUnexposedRecordedIdentity(resourceType, attributeName) {
|
|
13181
|
+
if (!isRecordedIdentityAttribute(resourceType, attributeName)) return false;
|
|
13182
|
+
const coverage = getPropertyCoverage(resourceType);
|
|
13183
|
+
if (coverage === void 0) return false;
|
|
13184
|
+
if (coverage.readOnly.has(attributeName)) return false;
|
|
13185
|
+
return !(Object.hasOwn(WRITABLE_GETATT_ATTRIBUTES, resourceType) && WRITABLE_GETATT_ATTRIBUTES[resourceType].includes(attributeName));
|
|
13186
|
+
}
|
|
13187
|
+
|
|
12919
13188
|
// src/deployment/intrinsic-resolver/getatt/flat-object-attributes.ts
|
|
12920
13189
|
const FLAT_OBJECT_MEMBERS = {
|
|
12921
13190
|
"AWS::RDS::DBInstance": {
|
|
@@ -13189,6 +13458,10 @@ function refuseEndpointTheEngineLacks(resolver, resource, logicalId, attributeNa
|
|
|
13189
13458
|
const other = lacking === "RedisEndpoint" ? "ConfigurationEndpoint" : "RedisEndpoint";
|
|
13190
13459
|
throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}]: the cache cluster's engine is ${displayMasked(resolver, engine, context)}, which has no ${lacking}. CloudFormation answers an empty Address and Port for it; cdkd refuses instead of passing an empty endpoint on. Reference ${other} instead.`));
|
|
13191
13460
|
}
|
|
13461
|
+
function refuseUnexposedRecordedIdentity(resolver, resourceType, logicalId, attributeName, context) {
|
|
13462
|
+
if (!isUnexposedRecordedIdentity(resourceType, attributeName)) return;
|
|
13463
|
+
throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, ${displayMasked(resolver, attributeName, context)}] for ${displayMasked(resolver, resourceType, context)}: CloudFormation does not expose ${displayMasked(resolver, attributeName, context)} as an attribute of this type and rejects the template. cdkd records it for its own identity checks only. Read an attribute the type exposes, or use Ref.`));
|
|
13464
|
+
}
|
|
13192
13465
|
|
|
13193
13466
|
// src/deployment/intrinsic-resolver/getatt-construct-core.ts
|
|
13194
13467
|
const NOT_CONSTRUCTED = Symbol("NOT_CONSTRUCTED");
|
|
@@ -14877,8 +15150,12 @@ function maskedSecretSegment(segment) {
|
|
|
14877
15150
|
return `****${segment.slice(-4)}`;
|
|
14878
15151
|
}
|
|
14879
15152
|
function secretPhysicalIdSegment(resourceType, physicalId) {
|
|
14880
|
-
if (resourceType !== "AWS::AppSync::ApiKey") return void 0;
|
|
14881
15153
|
if (typeof physicalId !== "string" || physicalId === "") return void 0;
|
|
15154
|
+
if (resourceType === "AWS::CloudFormation::WaitConditionHandle") {
|
|
15155
|
+
const query = physicalId.indexOf("?");
|
|
15156
|
+
return query >= 0 && query < physicalId.length - 1 ? physicalId.slice(query + 1) : void 0;
|
|
15157
|
+
}
|
|
15158
|
+
if (resourceType !== "AWS::AppSync::ApiKey") return void 0;
|
|
14882
15159
|
const parts = physicalId.split("|");
|
|
14883
15160
|
if (parts.length === 2 && parts[0] !== "" && parts[1] !== "") return parts[1];
|
|
14884
15161
|
const arn = APPSYNC_ARN.exec(physicalId);
|
|
@@ -16506,6 +16783,7 @@ async function resolveGetAtt(resolver, getAtt, context) {
|
|
|
16506
16783
|
if (!resource) throw markNonRetryable(/* @__PURE__ */ new Error(`Resource ${displayMasked(resolver, logicalId, context)} not found for Fn::GetAtt`));
|
|
16507
16784
|
recordSecretNamedRead(logicalId, void 0, context);
|
|
16508
16785
|
refuseEndpointTheEngineLacks(resolver, resource, logicalId, attributeName, context);
|
|
16786
|
+
refuseUnexposedRecordedIdentity(resolver, resource.resourceType, logicalId, attributeName, context);
|
|
16509
16787
|
if (!isAlwaysLiveAttribute(resource.resourceType, attributeName) && resource.attributes !== void 0) {
|
|
16510
16788
|
const storedValue = Object.hasOwn(resource.attributes, attributeName) ? resource.attributes[attributeName] : assembleFlatObjectAttribute(resource.resourceType, attributeName, resource.attributes);
|
|
16511
16789
|
const flatValue = isImpossibleEmptyStoredAttribute(resource.resourceType, attributeName, storedValue) ? void 0 : storedValue;
|
|
@@ -17645,160 +17923,6 @@ function maskLeavesDeep(value) {
|
|
|
17645
17923
|
return "***";
|
|
17646
17924
|
}
|
|
17647
17925
|
|
|
17648
|
-
// src/provisioning/getatt-attributes.generated.ts
|
|
17649
|
-
const WRITABLE_GETATT_ATTRIBUTES = {
|
|
17650
|
-
"AWS::Amplify::Branch": ["BranchName"],
|
|
17651
|
-
"AWS::Amplify::Domain": [
|
|
17652
|
-
"AutoSubDomainCreationPatterns",
|
|
17653
|
-
"AutoSubDomainIAMRole",
|
|
17654
|
-
"DomainName",
|
|
17655
|
-
"EnableAutoSubDomain"
|
|
17656
|
-
],
|
|
17657
|
-
"AWS::AppMesh::GatewayRoute": [
|
|
17658
|
-
"GatewayRouteName",
|
|
17659
|
-
"MeshName",
|
|
17660
|
-
"MeshOwner",
|
|
17661
|
-
"VirtualGatewayName"
|
|
17662
|
-
],
|
|
17663
|
-
"AWS::AppMesh::Mesh": ["MeshName"],
|
|
17664
|
-
"AWS::AppMesh::Route": [
|
|
17665
|
-
"MeshName",
|
|
17666
|
-
"MeshOwner",
|
|
17667
|
-
"RouteName",
|
|
17668
|
-
"VirtualRouterName"
|
|
17669
|
-
],
|
|
17670
|
-
"AWS::AppMesh::VirtualGateway": [
|
|
17671
|
-
"MeshName",
|
|
17672
|
-
"MeshOwner",
|
|
17673
|
-
"VirtualGatewayName"
|
|
17674
|
-
],
|
|
17675
|
-
"AWS::AppMesh::VirtualNode": [
|
|
17676
|
-
"MeshName",
|
|
17677
|
-
"MeshOwner",
|
|
17678
|
-
"VirtualNodeName"
|
|
17679
|
-
],
|
|
17680
|
-
"AWS::AppMesh::VirtualRouter": [
|
|
17681
|
-
"MeshName",
|
|
17682
|
-
"MeshOwner",
|
|
17683
|
-
"VirtualRouterName"
|
|
17684
|
-
],
|
|
17685
|
-
"AWS::AppMesh::VirtualService": [
|
|
17686
|
-
"MeshName",
|
|
17687
|
-
"MeshOwner",
|
|
17688
|
-
"VirtualServiceName"
|
|
17689
|
-
],
|
|
17690
|
-
"AWS::AppSync::DataSource": ["Name"],
|
|
17691
|
-
"AWS::AppSync::DomainName": ["DomainName"],
|
|
17692
|
-
"AWS::AppSync::FunctionConfiguration": ["DataSourceName", "Name"],
|
|
17693
|
-
"AWS::AppSync::Resolver": ["FieldName", "TypeName"],
|
|
17694
|
-
"AWS::Backup::BackupSelection": ["BackupPlanId"],
|
|
17695
|
-
"AWS::Backup::BackupVault": ["BackupVaultName"],
|
|
17696
|
-
"AWS::CleanRooms::AnalysisTemplate": ["Schema"],
|
|
17697
|
-
"AWS::Cloud9::EnvironmentEC2": ["Name"],
|
|
17698
|
-
"AWS::CloudWatch::InsightRule": ["RuleName"],
|
|
17699
|
-
"AWS::CodeArtifact::Domain": ["EncryptionKey"],
|
|
17700
|
-
"AWS::CodeArtifact::Repository": ["DomainName", "DomainOwner"],
|
|
17701
|
-
"AWS::EC2::CapacityReservation": [
|
|
17702
|
-
"AvailabilityZone",
|
|
17703
|
-
"InstanceType",
|
|
17704
|
-
"Tenancy"
|
|
17705
|
-
],
|
|
17706
|
-
"AWS::EC2::Instance": ["AvailabilityZone"],
|
|
17707
|
-
"AWS::EC2::SecurityGroup": ["VpcId"],
|
|
17708
|
-
"AWS::EC2::Subnet": [
|
|
17709
|
-
"AvailabilityZone",
|
|
17710
|
-
"AvailabilityZoneId",
|
|
17711
|
-
"CidrBlock",
|
|
17712
|
-
"OutpostArn",
|
|
17713
|
-
"VpcId"
|
|
17714
|
-
],
|
|
17715
|
-
"AWS::EC2::VPC": ["CidrBlock"],
|
|
17716
|
-
"AWS::EFS::MountTarget": ["IpAddress"],
|
|
17717
|
-
"AWS::EKS::Nodegroup": ["ClusterName", "NodegroupName"],
|
|
17718
|
-
"AWS::ElasticLoadBalancingV2::LoadBalancer": ["SecurityGroups"],
|
|
17719
|
-
"AWS::EventSchemas::Discoverer": ["CrossAccount"],
|
|
17720
|
-
"AWS::EventSchemas::Registry": ["RegistryName"],
|
|
17721
|
-
"AWS::EventSchemas::Schema": ["SchemaName"],
|
|
17722
|
-
"AWS::Events::EventBus": ["Name"],
|
|
17723
|
-
"AWS::GameLift::GameSessionQueue": ["Name"],
|
|
17724
|
-
"AWS::GameLift::MatchmakingConfiguration": ["Name"],
|
|
17725
|
-
"AWS::GameLift::MatchmakingRuleSet": ["Name"],
|
|
17726
|
-
"AWS::Grafana::Workspace": ["GrafanaVersion"],
|
|
17727
|
-
"AWS::Greengrass::ConnectorDefinition": ["Name"],
|
|
17728
|
-
"AWS::Greengrass::CoreDefinition": ["Name"],
|
|
17729
|
-
"AWS::Greengrass::DeviceDefinition": ["Name"],
|
|
17730
|
-
"AWS::Greengrass::FunctionDefinition": ["Name"],
|
|
17731
|
-
"AWS::Greengrass::Group": ["Name", "RoleArn"],
|
|
17732
|
-
"AWS::Greengrass::LoggerDefinition": ["Name"],
|
|
17733
|
-
"AWS::Greengrass::ResourceDefinition": ["Name"],
|
|
17734
|
-
"AWS::Greengrass::SubscriptionDefinition": ["Name"],
|
|
17735
|
-
"AWS::ImageBuilder::Component": ["Name"],
|
|
17736
|
-
"AWS::ImageBuilder::ContainerRecipe": ["Name"],
|
|
17737
|
-
"AWS::ImageBuilder::DistributionConfiguration": ["Name"],
|
|
17738
|
-
"AWS::ImageBuilder::ImagePipeline": ["Name"],
|
|
17739
|
-
"AWS::ImageBuilder::ImageRecipe": ["Name"],
|
|
17740
|
-
"AWS::ImageBuilder::InfrastructureConfiguration": ["Name"],
|
|
17741
|
-
"AWS::Kinesis::StreamConsumer": ["ConsumerName", "StreamARN"],
|
|
17742
|
-
"AWS::MSK::Cluster": ["CurrentVersion"],
|
|
17743
|
-
"AWS::ManagedBlockchain::Member": ["NetworkId"],
|
|
17744
|
-
"AWS::ManagedBlockchain::Node": ["MemberId", "NetworkId"],
|
|
17745
|
-
"AWS::MediaConvert::JobTemplate": ["Name"],
|
|
17746
|
-
"AWS::MediaConvert::Preset": ["Name"],
|
|
17747
|
-
"AWS::MediaConvert::Queue": ["Name"],
|
|
17748
|
-
"AWS::NetworkManager::ConnectAttachment": ["ProposedSegmentChange"],
|
|
17749
|
-
"AWS::NetworkManager::SiteToSiteVpnAttachment": ["ProposedSegmentChange"],
|
|
17750
|
-
"AWS::NetworkManager::TransitGatewayRouteTableAttachment": ["ProposedSegmentChange"],
|
|
17751
|
-
"AWS::NetworkManager::VpcAttachment": ["ProposedSegmentChange"],
|
|
17752
|
-
"AWS::OpsWorks::Instance": ["AvailabilityZone"],
|
|
17753
|
-
"AWS::OpsWorks::UserProfile": ["SshUsername"],
|
|
17754
|
-
"AWS::QuickSight::Analysis": ["Errors", "Sheets"],
|
|
17755
|
-
"AWS::RDS::DBInstance": ["DBSystemId"],
|
|
17756
|
-
"AWS::RDS::DBParameterGroup": ["DBParameterGroupName"],
|
|
17757
|
-
"AWS::RedshiftServerless::Workgroup": ["Workgroup"],
|
|
17758
|
-
"AWS::RoboMaker::RobotApplication": ["CurrentRevisionId"],
|
|
17759
|
-
"AWS::RoboMaker::SimulationApplication": ["CurrentRevisionId"],
|
|
17760
|
-
"AWS::Route53Resolver::ResolverEndpoint": [
|
|
17761
|
-
"Direction",
|
|
17762
|
-
"Name",
|
|
17763
|
-
"OutpostArn",
|
|
17764
|
-
"PreferredInstanceType",
|
|
17765
|
-
"ResolverEndpointType"
|
|
17766
|
-
],
|
|
17767
|
-
"AWS::Route53Resolver::ResolverRule": [
|
|
17768
|
-
"DomainName",
|
|
17769
|
-
"Name",
|
|
17770
|
-
"ResolverEndpointId",
|
|
17771
|
-
"TargetIps"
|
|
17772
|
-
],
|
|
17773
|
-
"AWS::Route53Resolver::ResolverRuleAssociation": [
|
|
17774
|
-
"Name",
|
|
17775
|
-
"ResolverRuleId",
|
|
17776
|
-
"VPCId"
|
|
17777
|
-
],
|
|
17778
|
-
"AWS::S3::AccessPoint": ["Name"],
|
|
17779
|
-
"AWS::SNS::Topic": ["TopicName"],
|
|
17780
|
-
"AWS::SQS::Queue": ["QueueName"],
|
|
17781
|
-
"AWS::SSM::Parameter": ["Type"],
|
|
17782
|
-
"AWS::SSM::ResourceDataSync": ["SyncName"],
|
|
17783
|
-
"AWS::SageMaker::CodeRepository": ["CodeRepositoryName"],
|
|
17784
|
-
"AWS::SageMaker::Endpoint": ["EndpointName"],
|
|
17785
|
-
"AWS::SageMaker::EndpointConfig": ["EndpointConfigName"],
|
|
17786
|
-
"AWS::SageMaker::Model": ["ModelName"],
|
|
17787
|
-
"AWS::SageMaker::ModelPackage": ["LastModifiedTime"],
|
|
17788
|
-
"AWS::SageMaker::NotebookInstance": ["NotebookInstanceName"],
|
|
17789
|
-
"AWS::SageMaker::NotebookInstanceLifecycleConfig": ["NotebookInstanceLifecycleConfigName"],
|
|
17790
|
-
"AWS::SageMaker::Workteam": ["WorkteamName"],
|
|
17791
|
-
"AWS::ServiceDiscovery::Service": ["Name"],
|
|
17792
|
-
"AWS::Signer::SigningProfile": ["ProfileName"],
|
|
17793
|
-
"AWS::StepFunctions::Activity": ["Name"],
|
|
17794
|
-
"AWS::Transfer::User": ["ServerId", "UserName"]
|
|
17795
|
-
};
|
|
17796
|
-
const SHAPE_MISMATCHED_GETATT_ATTRIBUTES = {
|
|
17797
|
-
"AWS::DocDB::DBCluster": ["Port"],
|
|
17798
|
-
"AWS::Events::EventBus": ["Policy"],
|
|
17799
|
-
"AWS::MediaLive::Input": ["Destinations", "Sources"]
|
|
17800
|
-
};
|
|
17801
|
-
|
|
17802
17926
|
// src/provisioning/read-only-properties.ts
|
|
17803
17927
|
function isDefinitiveRefusal(error) {
|
|
17804
17928
|
if (isThrottlingError(error)) return false;
|
|
@@ -18131,12 +18255,61 @@ function withListenerRuleConditionOps(resourceType, patch, desired) {
|
|
|
18131
18255
|
}];
|
|
18132
18256
|
}
|
|
18133
18257
|
|
|
18258
|
+
// src/provisioning/cc-read-back-default-paths.ts
|
|
18259
|
+
const CC_READ_BACK_DEFAULT_PATHS = { "AWS::OpenSearchService::Domain": [{
|
|
18260
|
+
path: ["AdvancedOptions", "override_main_response_version"],
|
|
18261
|
+
value: "false"
|
|
18262
|
+
}, {
|
|
18263
|
+
path: ["AIMLOptions"],
|
|
18264
|
+
value: {
|
|
18265
|
+
S3VectorsEngine: { Enabled: false },
|
|
18266
|
+
ServerlessVectorAcceleration: { Enabled: false }
|
|
18267
|
+
}
|
|
18268
|
+
}] };
|
|
18269
|
+
function hasCcReadBackDefaultPaths(resourceType) {
|
|
18270
|
+
return Object.prototype.hasOwnProperty.call(CC_READ_BACK_DEFAULT_PATHS, resourceType);
|
|
18271
|
+
}
|
|
18272
|
+
const ABSENT$1 = Symbol("absent");
|
|
18273
|
+
function valueAt$1(bag, path) {
|
|
18274
|
+
let cur = bag;
|
|
18275
|
+
for (const segment of path) {
|
|
18276
|
+
if (cur === null || typeof cur !== "object" || Array.isArray(cur)) return ABSENT$1;
|
|
18277
|
+
if (!Object.prototype.hasOwnProperty.call(cur, segment)) return ABSENT$1;
|
|
18278
|
+
cur = cur[segment];
|
|
18279
|
+
}
|
|
18280
|
+
return cur;
|
|
18281
|
+
}
|
|
18282
|
+
function withCcReadBackDefaultRemovals(resourceType, patch, desired, liveModel) {
|
|
18283
|
+
const defaults = hasCcReadBackDefaultPaths(resourceType) ? CC_READ_BACK_DEFAULT_PATHS[resourceType] : [];
|
|
18284
|
+
if (defaults.length === 0 || patch.length === 0 || liveModel === void 0) return patch;
|
|
18285
|
+
const extra = [];
|
|
18286
|
+
for (const { path, value } of defaults) {
|
|
18287
|
+
const pointer = `/${path.map(escapeJsonPointer$1).join("/")}`;
|
|
18288
|
+
if (patch.some((op) => op.path === pointer || op.path.startsWith(`${pointer}/`) || pointer.startsWith(`${op.path}/`))) continue;
|
|
18289
|
+
if (!isDeepStrictEqual(valueAt$1(liveModel, path), value)) continue;
|
|
18290
|
+
const declared = valueAt$1(desired, path);
|
|
18291
|
+
if (declared !== ABSENT$1 && !isDeepStrictEqual(declared, value)) continue;
|
|
18292
|
+
extra.push({
|
|
18293
|
+
op: "remove",
|
|
18294
|
+
path: pointer
|
|
18295
|
+
});
|
|
18296
|
+
}
|
|
18297
|
+
return extra.length === 0 ? patch : [...patch, ...extra];
|
|
18298
|
+
}
|
|
18299
|
+
function escapeJsonPointer$1(key) {
|
|
18300
|
+
return key.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
18301
|
+
}
|
|
18302
|
+
|
|
18134
18303
|
// src/provisioning/cc-read-back-empty-keys.ts
|
|
18135
|
-
const CC_READ_BACK_EMPTY_KEYS = {
|
|
18304
|
+
const CC_READ_BACK_EMPTY_KEYS = {
|
|
18305
|
+
"AWS::DataSync::Task": ["Name", "Schedule"],
|
|
18306
|
+
"AWS::ImageBuilder::InfrastructureConfiguration": ["ResourceTags"]
|
|
18307
|
+
};
|
|
18136
18308
|
function hasCcReadBackEmptyKeys(resourceType) {
|
|
18137
18309
|
return Object.prototype.hasOwnProperty.call(CC_READ_BACK_EMPTY_KEYS, resourceType);
|
|
18138
18310
|
}
|
|
18139
|
-
function
|
|
18311
|
+
function isEmptyValue(value) {
|
|
18312
|
+
if (value === "") return true;
|
|
18140
18313
|
if (Array.isArray(value)) return value.length === 0;
|
|
18141
18314
|
return value !== null && typeof value === "object" && Object.keys(value).length === 0;
|
|
18142
18315
|
}
|
|
@@ -18150,14 +18323,16 @@ function withCcReadBackEmptyKeyRemovals(resourceType, patch, desired, liveModel)
|
|
|
18150
18323
|
const existing = out.findIndex((op) => op.path === path);
|
|
18151
18324
|
if (existing !== -1) {
|
|
18152
18325
|
const op = out[existing];
|
|
18153
|
-
|
|
18326
|
+
const live = liveModel[key];
|
|
18327
|
+
const keepsLiveString = op.value === "" && typeof live === "string" && live !== "";
|
|
18328
|
+
if ((op.op === "add" || op.op === "replace") && isEmptyValue(op.value) && !keepsLiveString) out = Object.prototype.hasOwnProperty.call(liveModel, key) ? out.map((o, i) => i === existing ? {
|
|
18154
18329
|
op: "remove",
|
|
18155
18330
|
path
|
|
18156
18331
|
} : o) : out.filter((_, i) => i !== existing);
|
|
18157
18332
|
continue;
|
|
18158
18333
|
}
|
|
18159
|
-
if (!
|
|
18160
|
-
if (Object.prototype.hasOwnProperty.call(desired, key) && !
|
|
18334
|
+
if (!isEmptyValue(liveModel[key])) continue;
|
|
18335
|
+
if (Object.prototype.hasOwnProperty.call(desired, key) && !isEmptyValue(desired[key])) continue;
|
|
18161
18336
|
extra.push({
|
|
18162
18337
|
op: "remove",
|
|
18163
18338
|
path
|
|
@@ -18304,6 +18479,16 @@ function withRemovedBlockDefaults(patch, previous, resourceType) {
|
|
|
18304
18479
|
};
|
|
18305
18480
|
});
|
|
18306
18481
|
}
|
|
18482
|
+
const REMOVED_TOP_LEVEL_AS_EMPTY = { "AWS::Route53::HostedZone": ["HostedZoneFeatures"] };
|
|
18483
|
+
function withMeasuredRemovalsAsEmpty(patch, resourceType) {
|
|
18484
|
+
const keys = Object.hasOwn(REMOVED_TOP_LEVEL_AS_EMPTY, resourceType) ? REMOVED_TOP_LEVEL_AS_EMPTY[resourceType] : [];
|
|
18485
|
+
if (keys.length === 0) return [...patch];
|
|
18486
|
+
return patch.map((op) => op.op === "remove" && keys.some((key) => op.path === `/${key}`) ? {
|
|
18487
|
+
op: "replace",
|
|
18488
|
+
path: op.path,
|
|
18489
|
+
value: {}
|
|
18490
|
+
} : op);
|
|
18491
|
+
}
|
|
18307
18492
|
function nestedReadOnlyGaps(patch, readOnlyPaths, previous, resourceType) {
|
|
18308
18493
|
const measured = new Set(Object.keys(removedBlockEntries(resourceType)));
|
|
18309
18494
|
const gaps = [];
|
|
@@ -18890,6 +19075,8 @@ async function updateInIdLogScope(logicalId, physicalId, resourceType, propertie
|
|
|
18890
19075
|
...sentNothing
|
|
18891
19076
|
};
|
|
18892
19077
|
}
|
|
19078
|
+
if (hasCcReadBackDefaultPaths(resourceType)) patch = withCcReadBackDefaultRemovals(resourceType, patch, cleanProperties, await readLiveModel());
|
|
19079
|
+
patch = withMeasuredRemovalsAsEmpty(patch, resourceType);
|
|
18893
19080
|
if (writesTopLevelObject(patch)) {
|
|
18894
19081
|
const [createOnlyPaths, readOnlyPaths] = await Promise.all([getCreateOnlyPropertyPaths(resourceType), getReadOnlyPropertyPaths(resourceType)]);
|
|
18895
19082
|
const gaps = [...nestedCreateOnlyGaps(patch, createOnlyPaths), ...nestedReadOnlyGaps(patch, (readOnlyPaths ?? []).map((path) => path.split(".")), cleanPreviousProperties, resourceType)];
|
|
@@ -19038,7 +19225,7 @@ async function deleteEc2VolumeDirect(client, volumeId, logicalId, opts) {
|
|
|
19038
19225
|
await client.send(new DeleteVolumeCommand({ VolumeId: volumeId }));
|
|
19039
19226
|
opts.logger.debug(`DeleteVolume accepted for ${logicalId} (${volumeId})`);
|
|
19040
19227
|
} catch (error) {
|
|
19041
|
-
if (errorName(error) !== "IncorrectState") throw error;
|
|
19228
|
+
if (errorName$1(error) !== "IncorrectState") throw error;
|
|
19042
19229
|
let state;
|
|
19043
19230
|
try {
|
|
19044
19231
|
state = await readVolumeState(client, volumeId);
|
|
@@ -19087,11 +19274,11 @@ async function readVolumeState(client, volumeId) {
|
|
|
19087
19274
|
const volume = (await client.send(new DescribeVolumesCommand({ VolumeIds: [volumeId] }))).Volumes?.[0];
|
|
19088
19275
|
return volume === void 0 ? void 0 : volume.State ?? "unknown";
|
|
19089
19276
|
} catch (error) {
|
|
19090
|
-
if (errorName(error) === "InvalidVolume.NotFound") return void 0;
|
|
19277
|
+
if (errorName$1(error) === "InvalidVolume.NotFound") return void 0;
|
|
19091
19278
|
throw error;
|
|
19092
19279
|
}
|
|
19093
19280
|
}
|
|
19094
|
-
function errorName(error) {
|
|
19281
|
+
function errorName$1(error) {
|
|
19095
19282
|
if (typeof error !== "object" || error === null) return "";
|
|
19096
19283
|
const name = error.name;
|
|
19097
19284
|
return typeof name === "string" ? name : "";
|
|
@@ -19739,6 +19926,62 @@ function ccProtectionSite(resourceType, physicalId, entry, region) {
|
|
|
19739
19926
|
};
|
|
19740
19927
|
}
|
|
19741
19928
|
|
|
19929
|
+
// src/provisioning/recorded-identity.ts
|
|
19930
|
+
function recordedIdentityId(resourceType, context) {
|
|
19931
|
+
if (!Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, resourceType)) return void 0;
|
|
19932
|
+
const key = SURVIVOR_IDENTITY_ATTRIBUTES[resourceType];
|
|
19933
|
+
const value = context?.recordedAttributes?.[key];
|
|
19934
|
+
return isUsableIdentityValue(value) ? {
|
|
19935
|
+
key,
|
|
19936
|
+
value
|
|
19937
|
+
} : void 0;
|
|
19938
|
+
}
|
|
19939
|
+
var RecordedIdentityError = class extends ProvisioningError {
|
|
19940
|
+
constructor(message, resourceType, logicalId, physicalId, cause) {
|
|
19941
|
+
super(message, resourceType, logicalId, physicalId, cause);
|
|
19942
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
19943
|
+
this.name = "RecordedIdentityError";
|
|
19944
|
+
}
|
|
19945
|
+
};
|
|
19946
|
+
var RecordedIdentityMismatchError = class RecordedIdentityMismatchError extends RecordedIdentityError {
|
|
19947
|
+
attribute;
|
|
19948
|
+
constructor(params) {
|
|
19949
|
+
const { label, resourceType, logicalId, physicalId, attribute, context } = params;
|
|
19950
|
+
super(`Cannot delete ${label} ${logicalId}: the ${label} holding the name cdkd recorded is not the one cdkd created (its ${attribute} differs from the recorded one), so cdkd sent no delete and kept the record. Leave that ${label} alone; if the one cdkd created is gone, drop the record with ${stateOrphanRecordRemedy(context, logicalId)}.`, resourceType, logicalId, physicalId);
|
|
19951
|
+
Object.setPrototypeOf(this, RecordedIdentityMismatchError.prototype);
|
|
19952
|
+
this.attribute = attribute;
|
|
19953
|
+
this.name = "RecordedIdentityMismatchError";
|
|
19954
|
+
markNonRetryable(this);
|
|
19955
|
+
}
|
|
19956
|
+
};
|
|
19957
|
+
const RECORDED_IDENTITY_REREAD_DELAY_MS = 5e3;
|
|
19958
|
+
async function assertRecordedIdentity(params) {
|
|
19959
|
+
const recorded = recordedIdentityId(params.resourceType, params.context);
|
|
19960
|
+
if (recorded === void 0) return;
|
|
19961
|
+
const { label, resourceType, logicalId, physicalId, context } = params;
|
|
19962
|
+
let liveId = params.liveId;
|
|
19963
|
+
if (typeof liveId === "string" && liveId !== "" && liveId !== recorded.value) {
|
|
19964
|
+
await new Promise((resolve) => setTimeout(resolve, RECORDED_IDENTITY_REREAD_DELAY_MS));
|
|
19965
|
+
liveId = await params.reread();
|
|
19966
|
+
}
|
|
19967
|
+
if (typeof liveId !== "string" || liveId === "") throw markNotGone(new RecordedIdentityError(`Cannot delete ${label} ${logicalId}: AWS answered without its ${recorded.key}, so cdkd cannot confirm it is the one cdkd created; nothing was sent and the record is kept. Re-run the operation.`, resourceType, logicalId, physicalId));
|
|
19968
|
+
if (liveId === recorded.value) return;
|
|
19969
|
+
throw new RecordedIdentityMismatchError({
|
|
19970
|
+
label,
|
|
19971
|
+
resourceType,
|
|
19972
|
+
logicalId,
|
|
19973
|
+
physicalId,
|
|
19974
|
+
attribute: recorded.key,
|
|
19975
|
+
context
|
|
19976
|
+
});
|
|
19977
|
+
}
|
|
19978
|
+
function differingIdentityWarning(logicalId, resourceType, attribute) {
|
|
19979
|
+
return safeMsg`${logicalId} (${resourceType}): the update answered with another ${attribute} than the recorded one, so it may have reached another resource under the same name; cdkd keeps the recorded ${attribute}. Check the resource before deleting anything by hand.`;
|
|
19980
|
+
}
|
|
19981
|
+
function identityWarner(logger, mask, op) {
|
|
19982
|
+
return (attribute) => logger.warn(mask(differingIdentityWarning(op.logicalId, op.resourceType, attribute)));
|
|
19983
|
+
}
|
|
19984
|
+
|
|
19742
19985
|
// src/provisioning/cloud-control/delete-guards.ts
|
|
19743
19986
|
const CC_DELETE_IDENTITY_CHECKED_TYPES = /* @__PURE__ */ new Set(["AWS::S3::Bucket"]);
|
|
19744
19987
|
function requiresCcDeleteIdentityCheck(resourceType) {
|
|
@@ -19754,6 +19997,17 @@ function bucketLocationToRegion(constraint) {
|
|
|
19754
19997
|
function isNoSuchBucketError(error) {
|
|
19755
19998
|
return error?.name === "NoSuchBucket";
|
|
19756
19999
|
}
|
|
20000
|
+
const CC_MODEL_OMITS_IDENTITY = /* @__PURE__ */ new Set([
|
|
20001
|
+
"AWS::DynamoDB::Table",
|
|
20002
|
+
"AWS::IAM::User",
|
|
20003
|
+
"AWS::IAM::Group",
|
|
20004
|
+
"AWS::IAM::InstanceProfile"
|
|
20005
|
+
]);
|
|
20006
|
+
const CC_DELETE_RECORDED_IDENTITY_ATTRIBUTES = new Map(Object.entries(SURVIVOR_IDENTITY_ATTRIBUTES).filter(([resourceType]) => !CC_MODEL_OMITS_IDENTITY.has(resourceType)));
|
|
20007
|
+
function recordedCcDeleteIdentity(resourceType, context) {
|
|
20008
|
+
if (!CC_DELETE_RECORDED_IDENTITY_ATTRIBUTES.has(resourceType)) return void 0;
|
|
20009
|
+
return recordedIdentityId(resourceType, context);
|
|
20010
|
+
}
|
|
19757
20011
|
const SDK_DELETE_FAMILIES = /* @__PURE__ */ new Map([
|
|
19758
20012
|
["AWS::RDS::DBCluster", "rds"],
|
|
19759
20013
|
["AWS::RDS::DBInstance", "rds"],
|
|
@@ -19780,6 +20034,113 @@ function isCcConflict(error) {
|
|
|
19780
20034
|
return typeof error === "object" && error !== null && error.name === "ResourceConflictException";
|
|
19781
20035
|
}
|
|
19782
20036
|
|
|
20037
|
+
// src/provisioning/cloud-control/delete-identity.ts
|
|
20038
|
+
async function assertRecordedRegionAgainstClient(phase, expectedRegion, resourceType, logicalId, physicalId) {
|
|
20039
|
+
const recordedRegion = canonicalizeRegion(expectedRegion?.trim());
|
|
20040
|
+
if (recordedRegion === void 0 || recordedRegion === "") return;
|
|
20041
|
+
let clientRegion;
|
|
20042
|
+
try {
|
|
20043
|
+
clientRegion = canonicalizeRegion((await this.cloudControlClient.config.region())?.trim());
|
|
20044
|
+
} catch (error) {
|
|
20045
|
+
this.logger.debug(`Could not resolve the Cloud Control client region before the ${phase} region check for ${logicalId} (${resourceType}): ${displaySafe(describeAwsFailure(error).detail)}`);
|
|
20046
|
+
clientRegion = void 0;
|
|
20047
|
+
}
|
|
20048
|
+
try {
|
|
20049
|
+
assertRegionMatch(clientRegion, recordedRegion, resourceType, logicalId, physicalId, phase);
|
|
20050
|
+
} catch (error) {
|
|
20051
|
+
throw markNonRetryable(error);
|
|
20052
|
+
}
|
|
20053
|
+
}
|
|
20054
|
+
async function assertRecordedIdentityBeforeCcDelete(logicalId, resourceType, physicalId, context) {
|
|
20055
|
+
if (recordedCcDeleteIdentity(resourceType, context) === void 0) return;
|
|
20056
|
+
const read = async () => {
|
|
20057
|
+
let raw;
|
|
20058
|
+
try {
|
|
20059
|
+
raw = (await this.cloudControlClient.send(new GetResourceCommand({
|
|
20060
|
+
TypeName: resourceType,
|
|
20061
|
+
Identifier: physicalId
|
|
20062
|
+
}))).ResourceDescription?.Properties;
|
|
20063
|
+
} catch (error) {
|
|
20064
|
+
if (error?.name === "ResourceNotFoundException") return ABSENT;
|
|
20065
|
+
try {
|
|
20066
|
+
this.handleError(error, "READ", resourceType, logicalId, physicalId);
|
|
20067
|
+
} catch (wrapped) {
|
|
20068
|
+
throw markNotGoneOnNeedle(wrapped);
|
|
20069
|
+
}
|
|
20070
|
+
}
|
|
20071
|
+
const key = CC_DELETE_RECORDED_IDENTITY_ATTRIBUTES.get(resourceType);
|
|
20072
|
+
try {
|
|
20073
|
+
const model = typeof raw === "string" ? JSON.parse(raw) : void 0;
|
|
20074
|
+
const live = model !== null && typeof model === "object" && !Array.isArray(model) ? model[key] : void 0;
|
|
20075
|
+
return typeof live === "string" ? live : void 0;
|
|
20076
|
+
} catch {
|
|
20077
|
+
return;
|
|
20078
|
+
}
|
|
20079
|
+
};
|
|
20080
|
+
const first = await read();
|
|
20081
|
+
if (first === ABSENT) return;
|
|
20082
|
+
await assertRecordedIdentity({
|
|
20083
|
+
label: resourceType,
|
|
20084
|
+
resourceType,
|
|
20085
|
+
logicalId,
|
|
20086
|
+
physicalId,
|
|
20087
|
+
liveId: first,
|
|
20088
|
+
reread: async () => {
|
|
20089
|
+
const again = await read();
|
|
20090
|
+
return again === ABSENT ? void 0 : again;
|
|
20091
|
+
},
|
|
20092
|
+
context
|
|
20093
|
+
});
|
|
20094
|
+
}
|
|
20095
|
+
const ABSENT = Symbol("absent");
|
|
20096
|
+
async function confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context) {
|
|
20097
|
+
if (!requiresCcDeleteIdentityCheck(resourceType)) return void 0;
|
|
20098
|
+
const recordedRegion = context?.expectedRegion?.trim();
|
|
20099
|
+
let expectedRegion = recordedRegion === void 0 || recordedRegion === "" ? void 0 : recordedRegion;
|
|
20100
|
+
let clientRegionError;
|
|
20101
|
+
if (expectedRegion === void 0) try {
|
|
20102
|
+
const clientRegion = (await this.cloudControlClient.config.region())?.trim();
|
|
20103
|
+
expectedRegion = clientRegion === void 0 || clientRegion === "" ? void 0 : clientRegion;
|
|
20104
|
+
} catch (error) {
|
|
20105
|
+
const clientRegionFailure = describeAwsFailure(error);
|
|
20106
|
+
clientRegionError = clientRegionFailure.summary;
|
|
20107
|
+
this.logger.debug(`Could not resolve the Cloud Control client region while confirming ${physicalId}: ${clientRegionFailure.detail}`);
|
|
20108
|
+
expectedRegion = void 0;
|
|
20109
|
+
}
|
|
20110
|
+
if (expectedRegion === void 0) {
|
|
20111
|
+
const reason = clientRegionError === void 0 ? `neither the stack state nor the AWS client reports a region` : `the stack state records no region and the AWS client's region could not be resolved: ${clientRegionError}`;
|
|
20112
|
+
this.logger.warn(`Could not confirm that ${resourceType} ${physicalId} (${logicalId}) is the resource this destroy targets: ${reason.replace(/[.\s]+$/, "")}. Proceeding with the delete.`);
|
|
20113
|
+
return {
|
|
20114
|
+
guard: CC_DELETE_REGION_IDENTITY_GUARD,
|
|
20115
|
+
reason
|
|
20116
|
+
};
|
|
20117
|
+
}
|
|
20118
|
+
const wantRegion = canonicalizeRegion(expectedRegion);
|
|
20119
|
+
let actualRegion;
|
|
20120
|
+
try {
|
|
20121
|
+
const location = await getAwsClients().s3.send(new GetBucketLocationCommand({ Bucket: physicalId }));
|
|
20122
|
+
actualRegion = bucketLocationToRegion(location.LocationConstraint);
|
|
20123
|
+
} catch (error) {
|
|
20124
|
+
if (isNoSuchBucketError(error)) {
|
|
20125
|
+
this.logger.debug(`Bucket ${physicalId} (${logicalId}) is already absent; leaving the delete to the Cloud Control idempotency path`);
|
|
20126
|
+
return;
|
|
20127
|
+
}
|
|
20128
|
+
const failure = describeAwsFailure(error);
|
|
20129
|
+
this.logger.debug(`s3:GetBucketLocation on ${physicalId} (${logicalId}) failed: ${failure.detail}`);
|
|
20130
|
+
const summarySentence = failure.summary.replace(/[.\s]+$/, "");
|
|
20131
|
+
this.logger.warn(`Could not confirm which region S3 bucket ${physicalId} (${logicalId}) lives in before deleting it: ${summarySentence}. S3 bucket names are globally unique, so cdkd cannot rule out that this name denotes a bucket in another region. Grant s3:GetBucketLocation on the bucket to enable the check. Proceeding with the delete.`);
|
|
20132
|
+
return {
|
|
20133
|
+
guard: CC_DELETE_REGION_IDENTITY_GUARD,
|
|
20134
|
+
reason: `s3:GetBucketLocation on ${physicalId} could not be answered: ${failure.summary}`
|
|
20135
|
+
};
|
|
20136
|
+
}
|
|
20137
|
+
if (actualRegion === wantRegion) {
|
|
20138
|
+
this.logger.debug(`Confirmed S3 bucket ${physicalId} (${logicalId}) lives in ${wantRegion} before deleting it`);
|
|
20139
|
+
return;
|
|
20140
|
+
}
|
|
20141
|
+
throw markNonRetryable(new ProvisioningError(`Refusing to delete S3 bucket ${physicalId} for ${logicalId} (${resourceType}): the bucket carrying that name lives in ${actualRegion}, while this destroy targets ${wantRegion}. S3 bucket names are globally unique, so a physical id recorded in cdkd state can denote a bucket in a different region. S3 follows the region redirect for a body-bearing operation, so issuing this delete risks destroying the live bucket in ${actualRegion} instead, unrecoverably, rather than reporting the bucket absent. Confirm the physical id recorded in cdkd state (cdkd state show) and correct the record: --region does not change this comparison, which reads the region stored in the state file, so re-running the destroy with a different flag value will not resolve it.`, resourceType, logicalId, physicalId));
|
|
20142
|
+
}
|
|
20143
|
+
|
|
19783
20144
|
// src/provisioning/delete-gone-wait.ts
|
|
19784
20145
|
async function waitForGoneAfterDelete(opts) {
|
|
19785
20146
|
const sleep = opts.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
@@ -19982,7 +20343,7 @@ async function deleteInIdLogScope(logicalId, physicalId, resourceType, propertie
|
|
|
19982
20343
|
const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
|
|
19983
20344
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
19984
20345
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
19985
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
20346
|
+
const { ASGProvider } = await import("./asg-provider-HLdSUkYV.js");
|
|
19986
20347
|
const delegateRegion = ambientRegion();
|
|
19987
20348
|
let asgProvider = this.asgDeleteDelegates.get(delegateRegion);
|
|
19988
20349
|
if (asgProvider === void 0) {
|
|
@@ -19991,6 +20352,7 @@ async function deleteInIdLogScope(logicalId, physicalId, resourceType, propertie
|
|
|
19991
20352
|
}
|
|
19992
20353
|
return withIndeterminateGuard(await asgProvider.delete(logicalId, physicalId, resourceType, properties, context), indeterminateGuard);
|
|
19993
20354
|
}
|
|
20355
|
+
await assertRecordedIdentityBeforeCcDelete.call(this, logicalId, resourceType, physicalId, context);
|
|
19994
20356
|
if ((context?.deletionPolicy === "Delete" || context?.skipFinalSnapshot === true) && SDK_DELETE_FAMILIES.has(resourceType)) {
|
|
19995
20357
|
if (deletesThroughSdkProvider(resourceType, properties)) {
|
|
19996
20358
|
const delegate = await this.sdkDeleteDelegateInCcRegion(resourceType, logicalId, physicalId);
|
|
@@ -20136,7 +20498,7 @@ async function sdkDeleteDelegateInCcRegion(resourceType, logicalId, physicalId)
|
|
|
20136
20498
|
const family = SDK_DELETE_FAMILIES.get(resourceType);
|
|
20137
20499
|
const cached = this.sdkDeleteDelegates.get(family);
|
|
20138
20500
|
if (cached !== void 0 && cached.region === ccRegion) return cached.provider;
|
|
20139
|
-
const provider = family === "rds" ? new (await (import("./rds-provider-
|
|
20501
|
+
const provider = family === "rds" ? new (await (import("./rds-provider-C47dGZz_.js"))).RDSProvider({ region: ccRegion }) : new (await (import("./neptune-provider-pvZ07quz.js"))).NeptuneProvider({ region: ccRegion });
|
|
20140
20502
|
this.sdkDeleteDelegates.set(family, {
|
|
20141
20503
|
region: ccRegion,
|
|
20142
20504
|
provider
|
|
@@ -20158,71 +20520,6 @@ async function ec2ClientInCcRegion(resourceType, logicalId, physicalId) {
|
|
|
20158
20520
|
return ec2;
|
|
20159
20521
|
}
|
|
20160
20522
|
|
|
20161
|
-
// src/provisioning/cloud-control/delete-identity.ts
|
|
20162
|
-
async function assertRecordedRegionAgainstClient(phase, expectedRegion, resourceType, logicalId, physicalId) {
|
|
20163
|
-
const recordedRegion = canonicalizeRegion(expectedRegion?.trim());
|
|
20164
|
-
if (recordedRegion === void 0 || recordedRegion === "") return;
|
|
20165
|
-
let clientRegion;
|
|
20166
|
-
try {
|
|
20167
|
-
clientRegion = canonicalizeRegion((await this.cloudControlClient.config.region())?.trim());
|
|
20168
|
-
} catch (error) {
|
|
20169
|
-
this.logger.debug(`Could not resolve the Cloud Control client region before the ${phase} region check for ${logicalId} (${resourceType}): ${displaySafe(describeAwsFailure(error).detail)}`);
|
|
20170
|
-
clientRegion = void 0;
|
|
20171
|
-
}
|
|
20172
|
-
try {
|
|
20173
|
-
assertRegionMatch(clientRegion, recordedRegion, resourceType, logicalId, physicalId, phase);
|
|
20174
|
-
} catch (error) {
|
|
20175
|
-
throw markNonRetryable(error);
|
|
20176
|
-
}
|
|
20177
|
-
}
|
|
20178
|
-
async function confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context) {
|
|
20179
|
-
if (!requiresCcDeleteIdentityCheck(resourceType)) return void 0;
|
|
20180
|
-
const recordedRegion = context?.expectedRegion?.trim();
|
|
20181
|
-
let expectedRegion = recordedRegion === void 0 || recordedRegion === "" ? void 0 : recordedRegion;
|
|
20182
|
-
let clientRegionError;
|
|
20183
|
-
if (expectedRegion === void 0) try {
|
|
20184
|
-
const clientRegion = (await this.cloudControlClient.config.region())?.trim();
|
|
20185
|
-
expectedRegion = clientRegion === void 0 || clientRegion === "" ? void 0 : clientRegion;
|
|
20186
|
-
} catch (error) {
|
|
20187
|
-
const clientRegionFailure = describeAwsFailure(error);
|
|
20188
|
-
clientRegionError = clientRegionFailure.summary;
|
|
20189
|
-
this.logger.debug(`Could not resolve the Cloud Control client region while confirming ${physicalId}: ${clientRegionFailure.detail}`);
|
|
20190
|
-
expectedRegion = void 0;
|
|
20191
|
-
}
|
|
20192
|
-
if (expectedRegion === void 0) {
|
|
20193
|
-
const reason = clientRegionError === void 0 ? `neither the stack state nor the AWS client reports a region` : `the stack state records no region and the AWS client's region could not be resolved: ${clientRegionError}`;
|
|
20194
|
-
this.logger.warn(`Could not confirm that ${resourceType} ${physicalId} (${logicalId}) is the resource this destroy targets: ${reason.replace(/[.\s]+$/, "")}. Proceeding with the delete.`);
|
|
20195
|
-
return {
|
|
20196
|
-
guard: CC_DELETE_REGION_IDENTITY_GUARD,
|
|
20197
|
-
reason
|
|
20198
|
-
};
|
|
20199
|
-
}
|
|
20200
|
-
const wantRegion = canonicalizeRegion(expectedRegion);
|
|
20201
|
-
let actualRegion;
|
|
20202
|
-
try {
|
|
20203
|
-
const location = await getAwsClients().s3.send(new GetBucketLocationCommand({ Bucket: physicalId }));
|
|
20204
|
-
actualRegion = bucketLocationToRegion(location.LocationConstraint);
|
|
20205
|
-
} catch (error) {
|
|
20206
|
-
if (isNoSuchBucketError(error)) {
|
|
20207
|
-
this.logger.debug(`Bucket ${physicalId} (${logicalId}) is already absent; leaving the delete to the Cloud Control idempotency path`);
|
|
20208
|
-
return;
|
|
20209
|
-
}
|
|
20210
|
-
const failure = describeAwsFailure(error);
|
|
20211
|
-
this.logger.debug(`s3:GetBucketLocation on ${physicalId} (${logicalId}) failed: ${failure.detail}`);
|
|
20212
|
-
const summarySentence = failure.summary.replace(/[.\s]+$/, "");
|
|
20213
|
-
this.logger.warn(`Could not confirm which region S3 bucket ${physicalId} (${logicalId}) lives in before deleting it: ${summarySentence}. S3 bucket names are globally unique, so cdkd cannot rule out that this name denotes a bucket in another region. Grant s3:GetBucketLocation on the bucket to enable the check. Proceeding with the delete.`);
|
|
20214
|
-
return {
|
|
20215
|
-
guard: CC_DELETE_REGION_IDENTITY_GUARD,
|
|
20216
|
-
reason: `s3:GetBucketLocation on ${physicalId} could not be answered: ${failure.summary}`
|
|
20217
|
-
};
|
|
20218
|
-
}
|
|
20219
|
-
if (actualRegion === wantRegion) {
|
|
20220
|
-
this.logger.debug(`Confirmed S3 bucket ${physicalId} (${logicalId}) lives in ${wantRegion} before deleting it`);
|
|
20221
|
-
return;
|
|
20222
|
-
}
|
|
20223
|
-
throw markNonRetryable(new ProvisioningError(`Refusing to delete S3 bucket ${physicalId} for ${logicalId} (${resourceType}): the bucket carrying that name lives in ${actualRegion}, while this destroy targets ${wantRegion}. S3 bucket names are globally unique, so a physical id recorded in cdkd state can denote a bucket in a different region. S3 follows the region redirect for a body-bearing operation, so issuing this delete risks destroying the live bucket in ${actualRegion} instead, unrecoverably, rather than reporting the bucket absent. Confirm the physical id recorded in cdkd state (cdkd state show) and correct the record: --region does not change this comparison, which reads the region stored in the state file, so re-running the destroy with a different flag value will not resolve it.`, resourceType, logicalId, physicalId));
|
|
20224
|
-
}
|
|
20225
|
-
|
|
20226
20523
|
// src/provisioning/cloud-control/protection.ts
|
|
20227
20524
|
async function disableCcProtection(logicalId, physicalId, resourceType, entry) {
|
|
20228
20525
|
const protectionProperty = entry.property;
|
|
@@ -21841,11 +22138,11 @@ function applyNoEchoDeleteValues(properties, recordedLeaves, values) {
|
|
|
21841
22138
|
payload: properties,
|
|
21842
22139
|
unresolved: []
|
|
21843
22140
|
};
|
|
21844
|
-
const byKey = new Map((values?.leaves ?? []).map((leaf) => [canonicalJson$
|
|
22141
|
+
const byKey = new Map((values?.leaves ?? []).map((leaf) => [canonicalJson$7(leaf.coordinate), leaf]));
|
|
21845
22142
|
const entries = [];
|
|
21846
22143
|
const unresolved = [];
|
|
21847
22144
|
for (const coordinate of masked) {
|
|
21848
|
-
const leaf = byKey.get(canonicalJson$
|
|
22145
|
+
const leaf = byKey.get(canonicalJson$7(coordinate));
|
|
21849
22146
|
if (leaf === void 0) unresolved.push(coordinate);
|
|
21850
22147
|
else entries.push({
|
|
21851
22148
|
coordinate,
|
|
@@ -21896,7 +22193,7 @@ async function noEchoDeleteValuesFromResolved(options) {
|
|
|
21896
22193
|
const fingerprinter = options.inputSources === void 0 ? void 0 : inputFingerprinter(templateProps, options.inputSources);
|
|
21897
22194
|
const leaves = [];
|
|
21898
22195
|
for (const coordinate of masked) {
|
|
21899
|
-
if (!nodes.has(canonicalJson$
|
|
22196
|
+
if (!nodes.has(canonicalJson$7(coordinate))) continue;
|
|
21900
22197
|
if (!await fingerprintsUnchanged(record, templateProps, coordinate, fingerprinter)) continue;
|
|
21901
22198
|
const value = valueAtCoordinate(resolvedProperties, coordinate);
|
|
21902
22199
|
if (value === void 0 || carriesSecretMask(value)) continue;
|
|
@@ -22075,7 +22372,7 @@ var TemplateNoEchoReresolver = class TemplateNoEchoReresolver {
|
|
|
22075
22372
|
const bag = await this.noEchoNeedles();
|
|
22076
22373
|
const leaves = [];
|
|
22077
22374
|
for (const coordinate of masked) {
|
|
22078
|
-
const key = canonicalJson$
|
|
22375
|
+
const key = canonicalJson$7(coordinate);
|
|
22079
22376
|
if (!nodes.has(key)) continue;
|
|
22080
22377
|
const node = nodes.get(key)?.node;
|
|
22081
22378
|
if (!readsParametersOnly(node, declared, refused)) continue;
|
|
@@ -22777,7 +23074,7 @@ async function publishToSns(topicArn, request) {
|
|
|
22777
23074
|
}
|
|
22778
23075
|
async function invokeLambda(serviceToken, request) {
|
|
22779
23076
|
if (localCustomResourceRuntimeActive()) {
|
|
22780
|
-
const { invokeCustomResourceFunctionLocally } = await import("./custom-resource-runtime-
|
|
23077
|
+
const { invokeCustomResourceFunctionLocally } = await import("./custom-resource-runtime-D4P2W0VI.js");
|
|
22781
23078
|
const local = await invokeCustomResourceFunctionLocally({
|
|
22782
23079
|
lambda: this.lambdaClient,
|
|
22783
23080
|
s3: this.s3Client
|
|
@@ -23258,6 +23555,217 @@ var CustomResourceProvider = class CustomResourceProvider {
|
|
|
23258
23555
|
}
|
|
23259
23556
|
};
|
|
23260
23557
|
|
|
23558
|
+
// src/provisioning/wait-condition-signal-versions.ts
|
|
23559
|
+
async function listSignalVersions(client, bucket, key, owner) {
|
|
23560
|
+
const versions = [];
|
|
23561
|
+
let keyMarker;
|
|
23562
|
+
let versionIdMarker;
|
|
23563
|
+
do {
|
|
23564
|
+
const page = await client.send(new ListObjectVersionsCommand({
|
|
23565
|
+
Bucket: bucket,
|
|
23566
|
+
Prefix: key,
|
|
23567
|
+
...owner,
|
|
23568
|
+
EncodingType: "url",
|
|
23569
|
+
...keyMarker !== void 0 && { KeyMarker: keyMarker },
|
|
23570
|
+
...versionIdMarker !== void 0 && { VersionIdMarker: versionIdMarker }
|
|
23571
|
+
}));
|
|
23572
|
+
for (const v of page.Versions ?? []) {
|
|
23573
|
+
if (typeof v.VersionId !== "string") continue;
|
|
23574
|
+
let listed;
|
|
23575
|
+
try {
|
|
23576
|
+
listed = decodeListingKey(v.Key);
|
|
23577
|
+
} catch {
|
|
23578
|
+
continue;
|
|
23579
|
+
}
|
|
23580
|
+
if (listed === key) versions.push({
|
|
23581
|
+
versionId: v.VersionId,
|
|
23582
|
+
size: v.Size ?? 0
|
|
23583
|
+
});
|
|
23584
|
+
}
|
|
23585
|
+
keyMarker = page.IsTruncated ? decodeListingKey(page.NextKeyMarker) : void 0;
|
|
23586
|
+
versionIdMarker = page.IsTruncated ? page.NextVersionIdMarker : void 0;
|
|
23587
|
+
} while (keyMarker !== void 0);
|
|
23588
|
+
return versions.reverse();
|
|
23589
|
+
}
|
|
23590
|
+
|
|
23591
|
+
// src/provisioning/wait-condition-signal-store.ts
|
|
23592
|
+
const SIGNAL_URL_EXPIRES_IN_SECONDS = 604800;
|
|
23593
|
+
const MAX_SIGNAL_BYTES = 65536;
|
|
23594
|
+
const LEGACY_HANDLE_ID_PREFIX = "cdkd-wait-condition-handle-";
|
|
23595
|
+
const SIGNAL_KEY = new RegExp(`^${WAIT_CONDITION_SIGNAL_PREFIX}/[A-Za-z0-9]{1,255}-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\.json$`);
|
|
23596
|
+
function signalKeyFor(logicalId) {
|
|
23597
|
+
return `${WAIT_CONDITION_SIGNAL_PREFIX}/${logicalId}-${randomUUID()}.json`;
|
|
23598
|
+
}
|
|
23599
|
+
function classifyHandleUrl(handle, bucket) {
|
|
23600
|
+
if (handle.startsWith("cdkd-wait-condition-handle-")) return { kind: "legacy" };
|
|
23601
|
+
let parsed;
|
|
23602
|
+
try {
|
|
23603
|
+
parsed = new URL(handle);
|
|
23604
|
+
} catch {
|
|
23605
|
+
return { kind: "foreign" };
|
|
23606
|
+
}
|
|
23607
|
+
const marker = `/${WAIT_CONDITION_SIGNAL_PREFIX}/`;
|
|
23608
|
+
const at = parsed.pathname.lastIndexOf(marker);
|
|
23609
|
+
if (at < 0) return { kind: "foreign" };
|
|
23610
|
+
let key;
|
|
23611
|
+
try {
|
|
23612
|
+
key = decodeURIComponent(parsed.pathname.slice(at + 1));
|
|
23613
|
+
} catch {
|
|
23614
|
+
return { kind: "foreign" };
|
|
23615
|
+
}
|
|
23616
|
+
if (!SIGNAL_KEY.test(key)) return { kind: "foreign" };
|
|
23617
|
+
const before = parsed.pathname.slice(0, at);
|
|
23618
|
+
return before === `/${bucket}` || before === "" && parsed.hostname.startsWith(`${bucket}.`) ? {
|
|
23619
|
+
kind: "ours",
|
|
23620
|
+
key
|
|
23621
|
+
} : { kind: "foreign" };
|
|
23622
|
+
}
|
|
23623
|
+
function parseSignalBody(body) {
|
|
23624
|
+
let doc;
|
|
23625
|
+
try {
|
|
23626
|
+
doc = JSON.parse(body);
|
|
23627
|
+
} catch {
|
|
23628
|
+
return;
|
|
23629
|
+
}
|
|
23630
|
+
if (doc === null || typeof doc !== "object" || Array.isArray(doc)) return void 0;
|
|
23631
|
+
const d = doc;
|
|
23632
|
+
const status = typeof d["Status"] === "string" ? d["Status"].toUpperCase() : void 0;
|
|
23633
|
+
if (status !== "SUCCESS" && status !== "FAILURE") return void 0;
|
|
23634
|
+
const text = (v) => v === void 0 || v === null ? "" : typeof v === "string" ? v : JSON.stringify(v);
|
|
23635
|
+
return {
|
|
23636
|
+
status,
|
|
23637
|
+
uniqueId: text(d["UniqueId"]),
|
|
23638
|
+
data: text(d["Data"]),
|
|
23639
|
+
reason: text(d["Reason"])
|
|
23640
|
+
};
|
|
23641
|
+
}
|
|
23642
|
+
function evaluateSignals(signals, count) {
|
|
23643
|
+
const data = /* @__PURE__ */ new Map();
|
|
23644
|
+
if (count <= 0) return {
|
|
23645
|
+
state: "succeeded",
|
|
23646
|
+
data: {}
|
|
23647
|
+
};
|
|
23648
|
+
for (const signal of signals) {
|
|
23649
|
+
if (signal.status === "FAILURE") return {
|
|
23650
|
+
state: "failed",
|
|
23651
|
+
signal
|
|
23652
|
+
};
|
|
23653
|
+
data.set(signal.uniqueId, signal.data);
|
|
23654
|
+
if (data.size >= count) return {
|
|
23655
|
+
state: "succeeded",
|
|
23656
|
+
data: Object.fromEntries(data)
|
|
23657
|
+
};
|
|
23658
|
+
}
|
|
23659
|
+
return {
|
|
23660
|
+
state: "pending",
|
|
23661
|
+
successes: data.size
|
|
23662
|
+
};
|
|
23663
|
+
}
|
|
23664
|
+
var WaitConditionSignalStore = class {
|
|
23665
|
+
bucket;
|
|
23666
|
+
clients = /* @__PURE__ */ new WeakMap();
|
|
23667
|
+
logger = getLogger().child("WaitConditionSignalStore");
|
|
23668
|
+
setBucket(bucket) {
|
|
23669
|
+
this.bucket = bucket;
|
|
23670
|
+
}
|
|
23671
|
+
requireBucket() {
|
|
23672
|
+
if (this.bucket === void 0 || this.bucket === "") throw new Error("No cdkd state bucket is configured, so no wait condition signal URL can be issued.");
|
|
23673
|
+
return this.bucket;
|
|
23674
|
+
}
|
|
23675
|
+
client() {
|
|
23676
|
+
const base = getAwsClients().s3;
|
|
23677
|
+
const bucket = this.requireBucket();
|
|
23678
|
+
let resolved = this.clients.get(base);
|
|
23679
|
+
if (resolved === void 0) {
|
|
23680
|
+
resolved = rebuildClientForBucketRegion(base, bucket, {
|
|
23681
|
+
reuseClientCredentials: true,
|
|
23682
|
+
tolerateNonStandardClient: true
|
|
23683
|
+
}).then((rebuilt) => rebuilt ?? base);
|
|
23684
|
+
this.clients.set(base, resolved);
|
|
23685
|
+
resolved.catch(() => {
|
|
23686
|
+
if (this.clients.get(base) === resolved) this.clients.delete(base);
|
|
23687
|
+
});
|
|
23688
|
+
}
|
|
23689
|
+
return resolved;
|
|
23690
|
+
}
|
|
23691
|
+
async issueSignalUrl(logicalId) {
|
|
23692
|
+
const bucket = this.requireBucket();
|
|
23693
|
+
const client = await this.client();
|
|
23694
|
+
const key = signalKeyFor(logicalId);
|
|
23695
|
+
const url = await getSignedUrl(client, new PutObjectCommand({
|
|
23696
|
+
Bucket: bucket,
|
|
23697
|
+
Key: key
|
|
23698
|
+
}), { expiresIn: SIGNAL_URL_EXPIRES_IN_SECONDS });
|
|
23699
|
+
let expiresAt = new Date(Date.now() + SIGNAL_URL_EXPIRES_IN_SECONDS * 1e3);
|
|
23700
|
+
try {
|
|
23701
|
+
const provider = client.config?.credentials;
|
|
23702
|
+
const creds = typeof provider === "function" ? await provider() : void 0;
|
|
23703
|
+
if (creds?.expiration instanceof Date && creds.expiration < expiresAt) expiresAt = creds.expiration;
|
|
23704
|
+
} catch {}
|
|
23705
|
+
return {
|
|
23706
|
+
url,
|
|
23707
|
+
key,
|
|
23708
|
+
expiresAt
|
|
23709
|
+
};
|
|
23710
|
+
}
|
|
23711
|
+
async readSignals(key, seen, maxVersions = Infinity) {
|
|
23712
|
+
const bucket = this.requireBucket();
|
|
23713
|
+
const client = await this.client();
|
|
23714
|
+
const owner = await expectedOwnerParam(client);
|
|
23715
|
+
const versions = await listSignalVersions(client, bucket, key, owner);
|
|
23716
|
+
if (versions.length > maxVersions) throw Object.assign(/* @__PURE__ */ new Error(`${versions.length} signal versions exceed the limit of ${maxVersions}`), { name: "WaitConditionSignalFlood" });
|
|
23717
|
+
const signals = [];
|
|
23718
|
+
for (const { versionId, size } of versions) {
|
|
23719
|
+
if (!seen.has(versionId)) seen.set(versionId, await this.readVersion(client, bucket, key, versionId, size, owner));
|
|
23720
|
+
const signal = seen.get(versionId);
|
|
23721
|
+
if (signal) signals.push(signal);
|
|
23722
|
+
}
|
|
23723
|
+
return signals;
|
|
23724
|
+
}
|
|
23725
|
+
async readVersion(client, bucket, key, versionId, size, owner) {
|
|
23726
|
+
if (size === 0) return null;
|
|
23727
|
+
if (size > 65536) {
|
|
23728
|
+
this.logger.warn(safeMsg`Ignoring a wait condition signal of ${size} bytes (over ${MAX_SIGNAL_BYTES}).`);
|
|
23729
|
+
return null;
|
|
23730
|
+
}
|
|
23731
|
+
const body = await (await client.send(new GetObjectCommand({
|
|
23732
|
+
Bucket: bucket,
|
|
23733
|
+
Key: key,
|
|
23734
|
+
VersionId: versionId,
|
|
23735
|
+
...owner
|
|
23736
|
+
}))).Body?.transformToString() ?? "";
|
|
23737
|
+
const signal = parseSignalBody(body);
|
|
23738
|
+
if (signal === void 0) {
|
|
23739
|
+
this.logger.warn(safeMsg`Ignoring a wait condition signal that is not a {"Status": "SUCCESS" | "FAILURE", ...} document (${body.length} bytes).`);
|
|
23740
|
+
return null;
|
|
23741
|
+
}
|
|
23742
|
+
return signal;
|
|
23743
|
+
}
|
|
23744
|
+
async deleteSignals(key) {
|
|
23745
|
+
try {
|
|
23746
|
+
const bucket = this.requireBucket();
|
|
23747
|
+
const client = await this.client();
|
|
23748
|
+
const owner = await expectedOwnerParam(client);
|
|
23749
|
+
const deleted = await client.send(new DeleteObjectCommand({
|
|
23750
|
+
Bucket: bucket,
|
|
23751
|
+
Key: key,
|
|
23752
|
+
...owner
|
|
23753
|
+
}));
|
|
23754
|
+
await purgeNoncurrentKeyVersions(client, bucket, [key], { requestFields: owner });
|
|
23755
|
+
if (deleted.DeleteMarker === true && typeof deleted.VersionId === "string") await client.send(new DeleteObjectCommand({
|
|
23756
|
+
Bucket: bucket,
|
|
23757
|
+
Key: key,
|
|
23758
|
+
VersionId: deleted.VersionId,
|
|
23759
|
+
...owner
|
|
23760
|
+
}));
|
|
23761
|
+
} catch (error) {
|
|
23762
|
+
const failure = describeAwsFailure(error);
|
|
23763
|
+
this.logger.warn(safeMsg`Could not remove the wait condition signal object ${key}: ${failure.summary}`);
|
|
23764
|
+
this.logger.debug(safeMsg`Signal object delete failure detail: ${failure.detail}`);
|
|
23765
|
+
}
|
|
23766
|
+
}
|
|
23767
|
+
};
|
|
23768
|
+
|
|
23261
23769
|
// src/provisioning/provider-registry/routing.ts
|
|
23262
23770
|
function getProviderFor(input) {
|
|
23263
23771
|
const debug = (message) => {
|
|
@@ -23385,6 +23893,11 @@ function buildMutuallyExclusiveMessage(logicalId, violation) {
|
|
|
23385
23893
|
|
|
23386
23894
|
// src/provisioning/nested-required.generated.ts
|
|
23387
23895
|
const NESTED_REQUIRED = /* @__PURE__ */ new Map([
|
|
23896
|
+
["AWS::ApiGateway::Authorizer", /* @__PURE__ */ new Map([
|
|
23897
|
+
["JwtConfiguration", ["DefaultAlgorithms", "Issuers"]],
|
|
23898
|
+
["JwtConfiguration.Issuers", ["Audiences", "Issuer"]],
|
|
23899
|
+
["JwtConfiguration.Issuers.AdditionalClaims", ["ClaimName", "Format"]]
|
|
23900
|
+
])],
|
|
23388
23901
|
["AWS::ApiGateway::Deployment", /* @__PURE__ */ new Map([["StageDescription.Tags", ["Key", "Value"]]])],
|
|
23389
23902
|
["AWS::ApiGateway::Method", /* @__PURE__ */ new Map([
|
|
23390
23903
|
["Integration", ["Type"]],
|
|
@@ -24332,11 +24845,16 @@ const NESTED_REQUIRED = /* @__PURE__ */ new Map([
|
|
|
24332
24845
|
["AWS::RDS::DBProxyTargetGroup", /* @__PURE__ */ new Map([["Tags", ["Key"]]])],
|
|
24333
24846
|
["AWS::RDS::DBSubnetGroup", /* @__PURE__ */ new Map([["Tags", ["Key"]]])],
|
|
24334
24847
|
["AWS::Route53::HostedZone", /* @__PURE__ */ new Map([
|
|
24848
|
+
["HostedZoneFeatures.ChangeGuardrails", ["Name", "Status"]],
|
|
24335
24849
|
["HostedZoneTags", ["Key", "Value"]],
|
|
24336
24850
|
["QueryLoggingConfig", ["CloudWatchLogsLogGroupArn"]],
|
|
24337
24851
|
["VPCs", ["VPCId", "VPCRegion"]]
|
|
24338
24852
|
])],
|
|
24339
|
-
["AWS::Route53::RecordSet", /* @__PURE__ */ new Map([
|
|
24853
|
+
["AWS::Route53::RecordSet", /* @__PURE__ */ new Map([
|
|
24854
|
+
["AZAffinity", ["LocationId", "LocationType"]],
|
|
24855
|
+
["AliasTarget", ["DNSName", "HostedZoneId"]],
|
|
24856
|
+
["CidrRoutingConfig", ["CollectionId", "LocationName"]]
|
|
24857
|
+
])],
|
|
24340
24858
|
["AWS::Route53::RecordSetGroup", /* @__PURE__ */ new Map([
|
|
24341
24859
|
["RecordSets", ["Name", "Type"]],
|
|
24342
24860
|
["RecordSets.AliasTarget", ["DNSName", "HostedZoneId"]],
|
|
@@ -24929,7 +25447,7 @@ function buildNestedRequiredMessage(logicalId, violation) {
|
|
|
24929
25447
|
|
|
24930
25448
|
// src/provisioning/property-shape.generated.ts
|
|
24931
25449
|
const PROPERTY_SHAPES = /* @__PURE__ */ new Map([
|
|
24932
|
-
["AWS::ApiGateway::Authorizer", "{\"ProviderARNs\":\"array\"}"],
|
|
25450
|
+
["AWS::ApiGateway::Authorizer", "{\"JwtConfiguration\":\"object\",\"JwtConfiguration.DefaultAlgorithms\":\"array\",\"JwtConfiguration.Issuers\":\"array\",\"JwtConfiguration.Issuers[]\":\"object\",\"JwtConfiguration.Issuers[].AdditionalClaims\":\"array\",\"JwtConfiguration.Issuers[].AdditionalClaims[]\":\"object\",\"JwtConfiguration.Issuers[].AdditionalClaims[].ExpectedValues\":\"array\",\"JwtConfiguration.Issuers[].Audiences\":\"array\",\"ProviderARNs\":\"array\"}"],
|
|
24933
25451
|
["AWS::ApiGateway::Deployment", "{\"DeploymentCanarySettings\":\"object\",\"DeploymentCanarySettings.StageVariableOverrides\":\"object\",\"StageDescription\":\"object\",\"StageDescription.AccessLogSetting\":\"object\",\"StageDescription.CanarySetting\":\"object\",\"StageDescription.CanarySetting.StageVariableOverrides\":\"object\",\"StageDescription.MethodSettings\":\"array\",\"StageDescription.MethodSettings[]\":\"object\",\"StageDescription.Tags\":\"array\",\"StageDescription.Tags[]\":\"object\",\"StageDescription.Variables\":\"object\"}"],
|
|
24934
25452
|
["AWS::ApiGateway::Method", "{\"AuthorizationScopes\":\"array\",\"Integration\":\"object\",\"Integration.CacheKeyParameters\":\"array\",\"Integration.IntegrationResponses\":\"array\",\"Integration.IntegrationResponses[]\":\"object\",\"Integration.IntegrationResponses[].ResponseParameters\":\"object\",\"Integration.IntegrationResponses[].ResponseTemplates\":\"object\",\"Integration.RequestParameters\":\"object\",\"Integration.RequestTemplates\":\"object\",\"MethodResponses\":\"array\",\"MethodResponses[]\":\"object\",\"MethodResponses[].ResponseModels\":\"object\",\"MethodResponses[].ResponseParameters\":\"object\",\"RequestModels\":\"object\",\"RequestParameters\":\"object\"}"],
|
|
24935
25453
|
["AWS::ApiGateway::RestApi", "{\"BinaryMediaTypes\":\"array\",\"BodyS3Location\":\"object\",\"EndpointConfiguration\":\"object\",\"EndpointConfiguration.Types\":\"array\",\"EndpointConfiguration.VpcEndpointIds\":\"array\",\"Tags\":\"array\",\"Tags[]\":\"object\"}"],
|
|
@@ -25031,8 +25549,8 @@ const PROPERTY_SHAPES = /* @__PURE__ */ new Map([
|
|
|
25031
25549
|
["AWS::RDS::DBProxyEndpoint", "{\"Tags\":\"array\",\"Tags[]\":\"object\",\"VpcSecurityGroupIds\":\"array\",\"VpcSubnetIds\":\"array\"}"],
|
|
25032
25550
|
["AWS::RDS::DBProxyTargetGroup", "{\"ConnectionPoolConfigurationInfo\":\"object\",\"ConnectionPoolConfigurationInfo.SessionPinningFilters\":\"array\",\"DBClusterIdentifiers\":\"array\",\"DBInstanceIdentifiers\":\"array\",\"Tags\":\"array\",\"Tags[]\":\"object\"}"],
|
|
25033
25551
|
["AWS::RDS::DBSubnetGroup", "{\"SubnetIds\":\"array\",\"Tags\":\"array\",\"Tags[]\":\"object\"}"],
|
|
25034
|
-
["AWS::Route53::HostedZone", "{\"HostedZoneConfig\":\"object\",\"HostedZoneFeatures\":\"object\",\"HostedZoneTags\":\"array\",\"HostedZoneTags[]\":\"object\",\"NameServers\":\"array\",\"QueryLoggingConfig\":\"object\",\"VPCs\":\"array\",\"VPCs[]\":\"object\"}"],
|
|
25035
|
-
["AWS::Route53::RecordSet", "{\"AliasTarget\":\"object\",\"CidrRoutingConfig\":\"object\",\"GeoLocation\":\"object\",\"ResourceRecords\":\"array\"}"],
|
|
25552
|
+
["AWS::Route53::HostedZone", "{\"HostedZoneConfig\":\"object\",\"HostedZoneFeatures\":\"object\",\"HostedZoneFeatures.ChangeGuardrails\":\"array\",\"HostedZoneFeatures.ChangeGuardrails[]\":\"object\",\"HostedZoneFeatures.ChangeHistory\":\"object\",\"HostedZoneTags\":\"array\",\"HostedZoneTags[]\":\"object\",\"NameServers\":\"array\",\"QueryLoggingConfig\":\"object\",\"VPCs\":\"array\",\"VPCs[]\":\"object\"}"],
|
|
25553
|
+
["AWS::Route53::RecordSet", "{\"AZAffinity\":\"object\",\"AliasTarget\":\"object\",\"CidrRoutingConfig\":\"object\",\"GeoLocation\":\"object\",\"ResourceRecords\":\"array\"}"],
|
|
25036
25554
|
["AWS::S3::Bucket", "{\"AccelerateConfiguration\":\"object\",\"AnalyticsConfigurations\":\"array\",\"AnalyticsConfigurations[]\":\"object\",\"AnalyticsConfigurations[].StorageClassAnalysis\":\"object\",\"AnalyticsConfigurations[].StorageClassAnalysis.DataExport\":\"object\",\"AnalyticsConfigurations[].StorageClassAnalysis.DataExport.Destination\":\"object\",\"AnalyticsConfigurations[].TagFilters\":\"array\",\"AnalyticsConfigurations[].TagFilters[]\":\"object\",\"BucketEncryption\":\"object\",\"BucketEncryption.ServerSideEncryptionConfiguration\":\"array\",\"BucketEncryption.ServerSideEncryptionConfiguration[]\":\"object\",\"BucketEncryption.ServerSideEncryptionConfiguration[].BlockedEncryptionTypes\":\"object\",\"BucketEncryption.ServerSideEncryptionConfiguration[].BlockedEncryptionTypes.EncryptionType\":\"array\",\"BucketEncryption.ServerSideEncryptionConfiguration[].ServerSideEncryptionByDefault\":\"object\",\"CorsConfiguration\":\"object\",\"CorsConfiguration.CorsRules\":\"array\",\"CorsConfiguration.CorsRules[]\":\"object\",\"CorsConfiguration.CorsRules[].AllowedHeaders\":\"array\",\"CorsConfiguration.CorsRules[].AllowedMethods\":\"array\",\"CorsConfiguration.CorsRules[].AllowedOrigins\":\"array\",\"CorsConfiguration.CorsRules[].ExposedHeaders\":\"array\",\"IntelligentTieringConfigurations\":\"array\",\"IntelligentTieringConfigurations[]\":\"object\",\"IntelligentTieringConfigurations[].TagFilters\":\"array\",\"IntelligentTieringConfigurations[].TagFilters[]\":\"object\",\"IntelligentTieringConfigurations[].Tierings\":\"array\",\"IntelligentTieringConfigurations[].Tierings[]\":\"object\",\"InventoryConfigurations\":\"array\",\"InventoryConfigurations[]\":\"object\",\"InventoryConfigurations[].Destination\":\"object\",\"InventoryConfigurations[].OptionalFields\":\"array\",\"LifecycleConfiguration\":\"object\",\"LifecycleConfiguration.Rules\":\"array\",\"LifecycleConfiguration.Rules[]\":\"object\",\"LifecycleConfiguration.Rules[].AbortIncompleteMultipartUpload\":\"object\",\"LifecycleConfiguration.Rules[].NoncurrentVersionExpiration\":\"object\",\"LifecycleConfiguration.Rules[].NoncurrentVersionTransition\":\"object\",\"LifecycleConfiguration.Rules[].NoncurrentVersionTransitions\":\"array\",\"LifecycleConfiguration.Rules[].NoncurrentVersionTransitions[]\":\"object\",\"LifecycleConfiguration.Rules[].TagFilters\":\"array\",\"LifecycleConfiguration.Rules[].TagFilters[]\":\"object\",\"LifecycleConfiguration.Rules[].Transition\":\"object\",\"LifecycleConfiguration.Rules[].Transitions\":\"array\",\"LifecycleConfiguration.Rules[].Transitions[]\":\"object\",\"LoggingConfiguration\":\"object\",\"LoggingConfiguration.TargetObjectKeyFormat\":\"object\",\"LoggingConfiguration.TargetObjectKeyFormat.PartitionedPrefix\":\"object\",\"LoggingConfiguration.TargetObjectKeyFormat.SimplePrefix\":\"object\",\"MetadataConfiguration\":\"object\",\"MetadataConfiguration.AnnotationTableConfiguration\":\"object\",\"MetadataConfiguration.AnnotationTableConfiguration.EncryptionConfiguration\":\"object\",\"MetadataConfiguration.Destination\":\"object\",\"MetadataConfiguration.InventoryTableConfiguration\":\"object\",\"MetadataConfiguration.InventoryTableConfiguration.EncryptionConfiguration\":\"object\",\"MetadataConfiguration.JournalTableConfiguration\":\"object\",\"MetadataConfiguration.JournalTableConfiguration.EncryptionConfiguration\":\"object\",\"MetadataConfiguration.JournalTableConfiguration.RecordExpiration\":\"object\",\"MetadataTableConfiguration\":\"object\",\"MetadataTableConfiguration.S3TablesDestination\":\"object\",\"MetricsConfigurations\":\"array\",\"MetricsConfigurations[]\":\"object\",\"MetricsConfigurations[].TagFilters\":\"array\",\"MetricsConfigurations[].TagFilters[]\":\"object\",\"NotificationConfiguration\":\"object\",\"NotificationConfiguration.EventBridgeConfiguration\":\"object\",\"NotificationConfiguration.LambdaConfigurations\":\"array\",\"NotificationConfiguration.LambdaConfigurations[]\":\"object\",\"NotificationConfiguration.LambdaConfigurations[].Filter\":\"object\",\"NotificationConfiguration.LambdaConfigurations[].Filter.S3Key\":\"object\",\"NotificationConfiguration.LambdaConfigurations[].Filter.S3Key.Rules\":\"array\",\"NotificationConfiguration.LambdaConfigurations[].Filter.S3Key.Rules[]\":\"object\",\"NotificationConfiguration.QueueConfigurations\":\"array\",\"NotificationConfiguration.QueueConfigurations[]\":\"object\",\"NotificationConfiguration.QueueConfigurations[].Filter\":\"object\",\"NotificationConfiguration.QueueConfigurations[].Filter.S3Key\":\"object\",\"NotificationConfiguration.QueueConfigurations[].Filter.S3Key.Rules\":\"array\",\"NotificationConfiguration.QueueConfigurations[].Filter.S3Key.Rules[]\":\"object\",\"NotificationConfiguration.TopicConfigurations\":\"array\",\"NotificationConfiguration.TopicConfigurations[]\":\"object\",\"NotificationConfiguration.TopicConfigurations[].Filter\":\"object\",\"NotificationConfiguration.TopicConfigurations[].Filter.S3Key\":\"object\",\"NotificationConfiguration.TopicConfigurations[].Filter.S3Key.Rules\":\"array\",\"NotificationConfiguration.TopicConfigurations[].Filter.S3Key.Rules[]\":\"object\",\"ObjectLockConfiguration\":\"object\",\"ObjectLockConfiguration.Rule\":\"object\",\"ObjectLockConfiguration.Rule.DefaultRetention\":\"object\",\"ObjectLockConfiguration.Rule.DefaultRetention.DefaultEventHold\":\"object\",\"OwnershipControls\":\"object\",\"OwnershipControls.Rules\":\"array\",\"OwnershipControls.Rules[]\":\"object\",\"PublicAccessBlockConfiguration\":\"object\",\"ReplicationConfiguration\":\"object\",\"ReplicationConfiguration.Rules\":\"array\",\"ReplicationConfiguration.Rules[]\":\"object\",\"ReplicationConfiguration.Rules[].DeleteMarkerReplication\":\"object\",\"ReplicationConfiguration.Rules[].Destination\":\"object\",\"ReplicationConfiguration.Rules[].Destination.AccessControlTranslation\":\"object\",\"ReplicationConfiguration.Rules[].Destination.EncryptionConfiguration\":\"object\",\"ReplicationConfiguration.Rules[].Destination.Metrics\":\"object\",\"ReplicationConfiguration.Rules[].Destination.Metrics.EventThreshold\":\"object\",\"ReplicationConfiguration.Rules[].Destination.ReplicationTime\":\"object\",\"ReplicationConfiguration.Rules[].Destination.ReplicationTime.Time\":\"object\",\"ReplicationConfiguration.Rules[].Filter\":\"object\",\"ReplicationConfiguration.Rules[].Filter.And\":\"object\",\"ReplicationConfiguration.Rules[].Filter.And.TagFilters\":\"array\",\"ReplicationConfiguration.Rules[].Filter.And.TagFilters[]\":\"object\",\"ReplicationConfiguration.Rules[].Filter.TagFilter\":\"object\",\"ReplicationConfiguration.Rules[].SourceSelectionCriteria\":\"object\",\"ReplicationConfiguration.Rules[].SourceSelectionCriteria.ReplicaModifications\":\"object\",\"ReplicationConfiguration.Rules[].SourceSelectionCriteria.SseKmsEncryptedObjects\":\"object\",\"Tags\":\"array\",\"Tags[]\":\"object\",\"VersioningConfiguration\":\"object\",\"WebsiteConfiguration\":\"object\",\"WebsiteConfiguration.RedirectAllRequestsTo\":\"object\",\"WebsiteConfiguration.RoutingRules\":\"array\",\"WebsiteConfiguration.RoutingRules[]\":\"object\",\"WebsiteConfiguration.RoutingRules[].RedirectRule\":\"object\",\"WebsiteConfiguration.RoutingRules[].RoutingRuleCondition\":\"object\"}"],
|
|
25037
25555
|
["AWS::S3Express::DirectoryBucket", "{\"BucketEncryption\":\"object\",\"BucketEncryption.ServerSideEncryptionConfiguration\":\"array\",\"BucketEncryption.ServerSideEncryptionConfiguration[]\":\"object\",\"BucketEncryption.ServerSideEncryptionConfiguration[].ServerSideEncryptionByDefault\":\"object\",\"InventoryConfigurations\":\"array\",\"InventoryConfigurations[]\":\"object\",\"InventoryConfigurations[].Destination\":\"object\",\"InventoryConfigurations[].OptionalFields\":\"array\",\"LifecycleConfiguration\":\"object\",\"LifecycleConfiguration.Rules\":\"array\",\"LifecycleConfiguration.Rules[]\":\"object\",\"LifecycleConfiguration.Rules[].AbortIncompleteMultipartUpload\":\"object\",\"MetricsConfigurations\":\"array\",\"MetricsConfigurations[]\":\"object\",\"Tags\":\"array\",\"Tags[]\":\"object\"}"],
|
|
25038
25556
|
["AWS::S3Tables::Table", "{\"Compaction\":\"object\",\"IcebergMetadata\":\"object\",\"IcebergMetadata.IcebergPartitionSpec\":\"object\",\"IcebergMetadata.IcebergPartitionSpec.Fields\":\"array\",\"IcebergMetadata.IcebergPartitionSpec.Fields[]\":\"object\",\"IcebergMetadata.IcebergSchema\":\"object\",\"IcebergMetadata.IcebergSchema.SchemaFieldList\":\"array\",\"IcebergMetadata.IcebergSchema.SchemaFieldList[]\":\"object\",\"IcebergMetadata.IcebergSchemaV2\":\"object\",\"IcebergMetadata.IcebergSchemaV2.IdentifierFieldIds\":\"array\",\"IcebergMetadata.IcebergSchemaV2.SchemaV2FieldList\":\"array\",\"IcebergMetadata.IcebergSchemaV2.SchemaV2FieldList[]\":\"object\",\"IcebergMetadata.IcebergSortOrder\":\"object\",\"IcebergMetadata.IcebergSortOrder.Fields\":\"array\",\"IcebergMetadata.IcebergSortOrder.Fields[]\":\"object\",\"IcebergMetadata.TableProperties\":\"object\",\"SnapshotManagement\":\"object\",\"StorageClassConfiguration\":\"object\",\"Tags\":\"array\",\"Tags[]\":\"object\"}"],
|
|
@@ -25196,16 +25714,33 @@ function reportSdkUnwiredDecisions(resources) {
|
|
|
25196
25714
|
const unrecognizedRoute = findRoutableUnrecognizedProperties(resourceType, properties, this.allowedUnsupportedProperties, previousProperties);
|
|
25197
25715
|
const stickyCc = provisionedBy === "cc-api" && !STICKY_CC_MIGRATION_EXEMPT.has(resourceType);
|
|
25198
25716
|
const overridden = stickyCc ? [] : findAcceptedSdkUnwired(resourceType, properties, this.allowedUnsupportedProperties, previousProperties);
|
|
25199
|
-
const
|
|
25717
|
+
const autoRoutedDrops = drops.map(({ property }) => property).filter((property) => !this.allowedUnsupportedProperties.has(`${resourceType}:${property}`));
|
|
25718
|
+
const valueRoutes = findValueRoutedProperties(resourceType, properties).map((v) => ({
|
|
25719
|
+
...v,
|
|
25720
|
+
allowed: this.allowedUnsupportedProperties.has(`${resourceType}:${v.property}`)
|
|
25721
|
+
}));
|
|
25722
|
+
const valueRouted = valueRoutes.filter((v) => !v.allowed);
|
|
25723
|
+
const autoRouted = [.../* @__PURE__ */ new Set([
|
|
25724
|
+
...autoRoutedDrops,
|
|
25725
|
+
...unrecognizedRoute,
|
|
25726
|
+
...valueRouted.map((v) => v.property)
|
|
25727
|
+
])].sort((a, b) => a.localeCompare(b));
|
|
25200
25728
|
if (autoRouted.length > 0) {
|
|
25201
25729
|
const unroutable = this.ccRouteUnavailableReason(resourceType);
|
|
25202
|
-
if (unroutable !== void 0) throw new Error(safeMsg`${logicalId}: ` + this.buildUnroutableSdkUnwiredMessage(resourceType, drops.filter((d) => autoRouted.includes(d.property)), unroutable));
|
|
25203
|
-
const
|
|
25730
|
+
if (unroutable !== void 0) throw new Error(safeMsg`${logicalId}: ` + this.buildUnroutableSdkUnwiredMessage(resourceType, [...drops, ...valueRouted].filter((d) => autoRouted.includes(d.property)), unroutable));
|
|
25731
|
+
const unwiredList = [...autoRoutedDrops, ...unrecognizedRoute].sort((a, b) => a.localeCompare(b)).join(", ");
|
|
25732
|
+
const reasons = [...unwiredList === "" ? [] : [safeMsg`cdkd's SDK Provider does not yet wire ${unwiredList}`], ...valueRouted.map((v) => safeMsg`${v.property}: ${v.rationale}`)].join("; ");
|
|
25204
25733
|
const overrideHint = autoRouted.map((p) => `${resourceType}:${p}`).join(",");
|
|
25205
|
-
const message = `${logicalId} (${resourceType}): routing via Cloud Control API (
|
|
25734
|
+
const message = `${logicalId} (${resourceType}): routing via Cloud Control API (${reasons} — CC API will forward the full property map.${unrecognizedRoute.length === 0 ? "" : ` ${unrecognizedRoute.join(", ")} ${unrecognizedRoute.length === 1 ? "is" : "are"} not in cdkd's CFn schema snapshot: Cloud Control applies a property AWS published since, and rejects a misspelled one as CloudFormation does.`} Override via --prefer-sdk-route ${overrideHint}.)`;
|
|
25206
25735
|
if (provisionedBy === "cc-api") this.logger.debug(message);
|
|
25207
25736
|
else this.logger.info(message);
|
|
25208
25737
|
}
|
|
25738
|
+
const keptOnSdk = stickyCc || autoRouted.length > 0 ? [] : valueRoutes.filter((v) => v.allowed);
|
|
25739
|
+
if (keptOnSdk.length > 0) {
|
|
25740
|
+
const reasonList = keptOnSdk.map((v) => safeMsg`${v.property}: ${v.rationale}`).join("; ");
|
|
25741
|
+
const keys = keptOnSdk.map((v) => safeMsg`${resourceType}:${v.property}`).join(",");
|
|
25742
|
+
this.logger.warn(safeMsg`${logicalId} (${resourceType}): --prefer-sdk-route keeps this resource on its SDK ` + `provider, which cannot send part of it as declared. ` + safeMsg`${reasonList}. Drop ${keys} from --prefer-sdk-route to route it via Cloud Control ` + `API, which sends it.`);
|
|
25743
|
+
}
|
|
25209
25744
|
const named = drops.map(({ property }) => property).filter((property) => this.allowedUnsupportedProperties.has(`${resourceType}:${property}`));
|
|
25210
25745
|
if (named.length > 0 && (stickyCc || autoRouted.length > 0)) {
|
|
25211
25746
|
const list = named.join(", ");
|
|
@@ -25836,6 +26371,7 @@ var ProviderRegistry = class {
|
|
|
25836
26371
|
providers = /* @__PURE__ */ new Map();
|
|
25837
26372
|
cloudControlProvider;
|
|
25838
26373
|
customResourceProvider;
|
|
26374
|
+
waitConditionSignals = new WaitConditionSignalStore();
|
|
25839
26375
|
skipResourceTypes = /* @__PURE__ */ new Set();
|
|
25840
26376
|
allowedUnsupportedTypes = /* @__PURE__ */ new Set();
|
|
25841
26377
|
allowedUnsupportedProperties = /* @__PURE__ */ new Set();
|
|
@@ -25860,6 +26396,7 @@ var ProviderRegistry = class {
|
|
|
25860
26396
|
}
|
|
25861
26397
|
setCustomResourceResponseBucket(bucket) {
|
|
25862
26398
|
this.customResourceProvider.setResponseBucket(bucket);
|
|
26399
|
+
this.waitConditionSignals.setBucket(bucket);
|
|
25863
26400
|
this.logger.debug(`Custom resource response bucket set to: ${bucket}`);
|
|
25864
26401
|
}
|
|
25865
26402
|
skipResourceType(resourceType) {
|
|
@@ -25936,6 +26473,292 @@ function isCustomResource(resourceType) {
|
|
|
25936
26473
|
return resourceType.startsWith("Custom::") || resourceType === "AWS::CloudFormation::CustomResource";
|
|
25937
26474
|
}
|
|
25938
26475
|
|
|
26476
|
+
// src/provisioning/policy-document-content.ts
|
|
26477
|
+
const MASK = "***";
|
|
26478
|
+
const PERMANENT_CDKD_CODES = /* @__PURE__ */ new Set(["ROLLBACK_SECRET_TOKEN_SCAN_MISMATCH"]);
|
|
26479
|
+
const MARKED_PERMANENT_CODE_PREFIXES = ["INTRINSIC_RESOLUTION_REFUSAL", "ROLLBACK_SECRET_REGION_AMBIGUOUS"];
|
|
26480
|
+
const NOT_FOUND_ERROR_NAMES = /* @__PURE__ */ new Set([
|
|
26481
|
+
"ResourceNotFoundException",
|
|
26482
|
+
"ParameterNotFound",
|
|
26483
|
+
"ParameterVersionNotFound"
|
|
26484
|
+
]);
|
|
26485
|
+
function holdsUnresolvedValue(document) {
|
|
26486
|
+
let root = document;
|
|
26487
|
+
if (typeof document === "string") try {
|
|
26488
|
+
root = JSON.parse(document);
|
|
26489
|
+
} catch {
|
|
26490
|
+
root = document;
|
|
26491
|
+
}
|
|
26492
|
+
const walk = (v) => {
|
|
26493
|
+
if (typeof v === "string") return v === MASK || v.includes("{{resolve:");
|
|
26494
|
+
if (Array.isArray(v)) return v.some(walk);
|
|
26495
|
+
if (v !== null && typeof v === "object") return Object.values(v).some(walk);
|
|
26496
|
+
return false;
|
|
26497
|
+
};
|
|
26498
|
+
return walk(root);
|
|
26499
|
+
}
|
|
26500
|
+
function isPermanentResolutionError(error) {
|
|
26501
|
+
let current = error;
|
|
26502
|
+
for (let depth = 0; depth < 5 && current != null; depth++) {
|
|
26503
|
+
const e = current;
|
|
26504
|
+
if (typeof e.name === "string" && NOT_FOUND_ERROR_NAMES.has(e.name)) return true;
|
|
26505
|
+
if (typeof e.code === "string") {
|
|
26506
|
+
if (PERMANENT_CDKD_CODES.has(e.code)) return true;
|
|
26507
|
+
const code = e.code;
|
|
26508
|
+
if (MARKED_PERMANENT_CODE_PREFIXES.some((p) => code.startsWith(p)) && isMarkedNonRetryable(current)) return true;
|
|
26509
|
+
}
|
|
26510
|
+
if (typeof e.message === "string" && e.message.startsWith("Dynamic reference: ")) return true;
|
|
26511
|
+
current = e.cause;
|
|
26512
|
+
}
|
|
26513
|
+
return false;
|
|
26514
|
+
}
|
|
26515
|
+
function errorName(error) {
|
|
26516
|
+
const name = error?.name;
|
|
26517
|
+
return typeof name === "string" && /^[\w.-]{1,128}$/.test(name) ? name : "error";
|
|
26518
|
+
}
|
|
26519
|
+
async function attemptedPolicyDocument(recorded, resolve) {
|
|
26520
|
+
let document = recorded;
|
|
26521
|
+
if (resolve) try {
|
|
26522
|
+
document = await resolve();
|
|
26523
|
+
} catch (error) {
|
|
26524
|
+
return isPermanentResolutionError(error) ? {
|
|
26525
|
+
kind: "unusable",
|
|
26526
|
+
why: "a secret it references does not exist or cannot be used"
|
|
26527
|
+
} : {
|
|
26528
|
+
kind: "retry",
|
|
26529
|
+
errorName: errorName(error)
|
|
26530
|
+
};
|
|
26531
|
+
}
|
|
26532
|
+
if (!(typeof document === "string" && document.length > 0 || document !== null && typeof document === "object")) return {
|
|
26533
|
+
kind: "unusable",
|
|
26534
|
+
why: "no policy document it attempted is recorded"
|
|
26535
|
+
};
|
|
26536
|
+
if (holdsUnresolvedValue(document)) return {
|
|
26537
|
+
kind: "unusable",
|
|
26538
|
+
why: "its policy document still holds a secret reference or masked value"
|
|
26539
|
+
};
|
|
26540
|
+
return {
|
|
26541
|
+
kind: "document",
|
|
26542
|
+
document
|
|
26543
|
+
};
|
|
26544
|
+
}
|
|
26545
|
+
const ACCOUNT_ID = /^\d{12}$/;
|
|
26546
|
+
const ACCOUNT_ROOT_ARN = /^arn:[a-z-]+:iam::(\d{12}):root$/;
|
|
26547
|
+
const LIST_KEYS = [
|
|
26548
|
+
"Action",
|
|
26549
|
+
"NotAction",
|
|
26550
|
+
"Resource",
|
|
26551
|
+
"NotResource"
|
|
26552
|
+
];
|
|
26553
|
+
const PRINCIPAL_KEYS = ["Principal", "NotPrincipal"];
|
|
26554
|
+
function unwrapSingle(value) {
|
|
26555
|
+
return Array.isArray(value) && value.length === 1 ? value[0] : value;
|
|
26556
|
+
}
|
|
26557
|
+
function accountKey(value) {
|
|
26558
|
+
if (typeof value !== "string") return value;
|
|
26559
|
+
if (ACCOUNT_ID.test(value)) return `account:${value}`;
|
|
26560
|
+
const m = ACCOUNT_ROOT_ARN.exec(value);
|
|
26561
|
+
return m ? `account:${m[1]}` : value;
|
|
26562
|
+
}
|
|
26563
|
+
const ANYONE = "anyone:*";
|
|
26564
|
+
function normalizePrincipal(principal) {
|
|
26565
|
+
if (principal === "*") return ANYONE;
|
|
26566
|
+
if (principal === null || typeof principal !== "object" || Array.isArray(principal)) return principal;
|
|
26567
|
+
const keys = Object.keys(principal);
|
|
26568
|
+
if (keys.length === 1 && keys[0] === "AWS" && unwrapSingle(principal["AWS"]) === "*") return ANYONE;
|
|
26569
|
+
const out = {};
|
|
26570
|
+
for (const [key, raw] of Object.entries(principal)) out[key] = unwrapSingle(key === "AWS" ? Array.isArray(raw) ? raw.map(accountKey) : accountKey(raw) : raw);
|
|
26571
|
+
return out;
|
|
26572
|
+
}
|
|
26573
|
+
function normalizeStatement(statement) {
|
|
26574
|
+
if (statement === null || typeof statement !== "object" || Array.isArray(statement)) return statement;
|
|
26575
|
+
const out = { ...statement };
|
|
26576
|
+
for (const key of LIST_KEYS) if (Object.prototype.hasOwnProperty.call(out, key)) out[key] = unwrapSingle(out[key]);
|
|
26577
|
+
for (const key of PRINCIPAL_KEYS) if (Object.prototype.hasOwnProperty.call(out, key)) out[key] = normalizePrincipal(out[key]);
|
|
26578
|
+
return out;
|
|
26579
|
+
}
|
|
26580
|
+
function canonicalJson$5(value) {
|
|
26581
|
+
const sortKeys = (v) => {
|
|
26582
|
+
if (Array.isArray(v)) return v.map(sortKeys);
|
|
26583
|
+
if (v !== null && typeof v === "object") {
|
|
26584
|
+
const out = Object.create(null);
|
|
26585
|
+
for (const key of Object.keys(v).sort()) out[key] = sortKeys(v[key]);
|
|
26586
|
+
return out;
|
|
26587
|
+
}
|
|
26588
|
+
return v;
|
|
26589
|
+
};
|
|
26590
|
+
return JSON.stringify(sortKeys(value));
|
|
26591
|
+
}
|
|
26592
|
+
function policyContentKey(document) {
|
|
26593
|
+
let value = document;
|
|
26594
|
+
if (typeof document === "string") try {
|
|
26595
|
+
value = JSON.parse(document);
|
|
26596
|
+
} catch {
|
|
26597
|
+
return `raw:${document}`;
|
|
26598
|
+
}
|
|
26599
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
26600
|
+
const doc = { ...value };
|
|
26601
|
+
if (Object.prototype.hasOwnProperty.call(doc, "Statement")) doc["Statement"] = (Array.isArray(doc["Statement"]) ? doc["Statement"] : [doc["Statement"]]).map(normalizeStatement);
|
|
26602
|
+
value = doc;
|
|
26603
|
+
}
|
|
26604
|
+
return canonicalJson$5(value);
|
|
26605
|
+
}
|
|
26606
|
+
|
|
26607
|
+
// src/provisioning/settle-after-own-write.ts
|
|
26608
|
+
const OWN_WRITE_REREAD_DELAYS_MS = [
|
|
26609
|
+
500,
|
|
26610
|
+
1e3,
|
|
26611
|
+
2e3
|
|
26612
|
+
];
|
|
26613
|
+
async function reReadUntilSettled(read, settled, delaysMs) {
|
|
26614
|
+
let answer = await read();
|
|
26615
|
+
for (const delayMs of delaysMs) {
|
|
26616
|
+
if (settled(answer)) return {
|
|
26617
|
+
answer,
|
|
26618
|
+
settled: true
|
|
26619
|
+
};
|
|
26620
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
26621
|
+
answer = await read();
|
|
26622
|
+
}
|
|
26623
|
+
return {
|
|
26624
|
+
answer,
|
|
26625
|
+
settled: settled(answer)
|
|
26626
|
+
};
|
|
26627
|
+
}
|
|
26628
|
+
function memberReadFailure(err) {
|
|
26629
|
+
return isThrottlingError(err) || isTransientServerError(err) || isAmbiguousOutcomeError(err) ? "failed" : "refused";
|
|
26630
|
+
}
|
|
26631
|
+
async function settleDeclaredMember(first, read, matches, declared, delaysMs, unsettled) {
|
|
26632
|
+
const settled = (answer) => typeof answer === "object" && matches(answer.value);
|
|
26633
|
+
if (first === "refused" || settled(first)) return first;
|
|
26634
|
+
let newest = first;
|
|
26635
|
+
for (const delayMs of delaysMs) {
|
|
26636
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
26637
|
+
let answer;
|
|
26638
|
+
try {
|
|
26639
|
+
answer = await read();
|
|
26640
|
+
} catch (err) {
|
|
26641
|
+
answer = memberReadFailure(err);
|
|
26642
|
+
}
|
|
26643
|
+
if (answer === "refused") break;
|
|
26644
|
+
if (answer !== "failed") newest = answer;
|
|
26645
|
+
if (settled(newest)) return newest;
|
|
26646
|
+
}
|
|
26647
|
+
if (newest !== "failed") unsettled();
|
|
26648
|
+
return newest === "absent" ? { value: declared } : newest;
|
|
26649
|
+
}
|
|
26650
|
+
function warnUnsettledMember(logger, logicalId, resourceType, memberKey) {
|
|
26651
|
+
logger.warn(safeMsg`${resourceType} ${logicalId}: the read right after the write never showed the declared ${memberKey}, so its drift baseline may not match the live resource; run ${proseQuoted(cdkdRemedy("cdkd state refresh-observed"))} on the stack to re-capture it`);
|
|
26652
|
+
}
|
|
26653
|
+
function declaredMemberDocument(value) {
|
|
26654
|
+
if (typeof value === "string") {
|
|
26655
|
+
if (value === "") return void 0;
|
|
26656
|
+
try {
|
|
26657
|
+
return JSON.parse(value);
|
|
26658
|
+
} catch {
|
|
26659
|
+
return value;
|
|
26660
|
+
}
|
|
26661
|
+
}
|
|
26662
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
26663
|
+
}
|
|
26664
|
+
const KMS_DEFAULT_KEY_POLICY_ID = "key-default-1";
|
|
26665
|
+
const EFS_FILE_SYSTEM_ARN = /^arn:[a-z-]+:elasticfilesystem:[a-z0-9-]+:\d{12}:file-system\/fs-[0-9a-f]+$/;
|
|
26666
|
+
function efsPolicyMatchesDeclared(answer, declared, fileSystemId) {
|
|
26667
|
+
return policyDocumentMatchesDeclared(withoutAddedResource(answer, declared, fileSystemId), declared);
|
|
26668
|
+
}
|
|
26669
|
+
function withoutAddedResource(answer, declared, fileSystemId) {
|
|
26670
|
+
const parse = (doc) => {
|
|
26671
|
+
if (typeof doc !== "string") return doc;
|
|
26672
|
+
try {
|
|
26673
|
+
return JSON.parse(doc);
|
|
26674
|
+
} catch {
|
|
26675
|
+
return doc;
|
|
26676
|
+
}
|
|
26677
|
+
};
|
|
26678
|
+
const read = parse(answer);
|
|
26679
|
+
const want = parse(declared);
|
|
26680
|
+
const statements = (doc) => {
|
|
26681
|
+
if (typeof doc !== "object" || doc === null || Array.isArray(doc)) return void 0;
|
|
26682
|
+
const s = doc["Statement"];
|
|
26683
|
+
return s === void 0 ? void 0 : Array.isArray(s) ? s : [s];
|
|
26684
|
+
};
|
|
26685
|
+
const readStatements = statements(read);
|
|
26686
|
+
const wantStatements = statements(want);
|
|
26687
|
+
if (readStatements === void 0 || wantStatements === void 0) return answer;
|
|
26688
|
+
return {
|
|
26689
|
+
...read,
|
|
26690
|
+
Statement: readStatements.map((entry, index) => {
|
|
26691
|
+
const wanted = wantStatements[index];
|
|
26692
|
+
if (typeof entry !== "object" || entry === null || typeof wanted !== "object" || wanted === null || Object.prototype.hasOwnProperty.call(wanted, "Resource")) return entry;
|
|
26693
|
+
const resource = entry["Resource"];
|
|
26694
|
+
if (typeof resource !== "string" || !EFS_FILE_SYSTEM_ARN.test(resource) || fileSystemId !== void 0 && !resource.endsWith(`:file-system/${fileSystemId}`)) return entry;
|
|
26695
|
+
const { Resource: _added, ...rest } = entry;
|
|
26696
|
+
return rest;
|
|
26697
|
+
})
|
|
26698
|
+
};
|
|
26699
|
+
}
|
|
26700
|
+
function declaredPolicyDocument(properties) {
|
|
26701
|
+
if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return;
|
|
26702
|
+
const doc = properties["PolicyDocument"];
|
|
26703
|
+
if (typeof doc === "string") return doc === "" ? void 0 : doc;
|
|
26704
|
+
return typeof doc === "object" && doc !== null && !Array.isArray(doc) ? doc : void 0;
|
|
26705
|
+
}
|
|
26706
|
+
function policyDocumentMatchesDeclared(answer, declared) {
|
|
26707
|
+
return answer !== void 0 && policyContentKey(foldConditionValues(answer)) === policyContentKey(foldConditionValues(declared));
|
|
26708
|
+
}
|
|
26709
|
+
function foldConditionValues(document) {
|
|
26710
|
+
let doc = document;
|
|
26711
|
+
if (typeof doc === "string") try {
|
|
26712
|
+
doc = JSON.parse(doc);
|
|
26713
|
+
} catch {
|
|
26714
|
+
return document;
|
|
26715
|
+
}
|
|
26716
|
+
if (typeof doc !== "object" || doc === null || Array.isArray(doc)) return doc;
|
|
26717
|
+
const statement = doc["Statement"];
|
|
26718
|
+
if (statement === void 0) return doc;
|
|
26719
|
+
const statements = Array.isArray(statement) ? statement : [statement];
|
|
26720
|
+
return {
|
|
26721
|
+
...doc,
|
|
26722
|
+
Statement: statements.map((entry) => {
|
|
26723
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return entry;
|
|
26724
|
+
const condition = entry["Condition"];
|
|
26725
|
+
if (typeof condition !== "object" || condition === null || Array.isArray(condition)) return entry;
|
|
26726
|
+
const folded = {};
|
|
26727
|
+
for (const [operator, block] of Object.entries(condition)) {
|
|
26728
|
+
if (typeof block !== "object" || block === null || Array.isArray(block)) {
|
|
26729
|
+
folded[operator] = block;
|
|
26730
|
+
continue;
|
|
26731
|
+
}
|
|
26732
|
+
const values = {};
|
|
26733
|
+
for (const [key, value] of Object.entries(block)) values[key] = Array.isArray(value) && value.length === 1 ? value[0] : value;
|
|
26734
|
+
folded[operator] = values;
|
|
26735
|
+
}
|
|
26736
|
+
return {
|
|
26737
|
+
...entry,
|
|
26738
|
+
Condition: folded
|
|
26739
|
+
};
|
|
26740
|
+
})
|
|
26741
|
+
};
|
|
26742
|
+
}
|
|
26743
|
+
const SNS_DEFAULT_POLICY_ID = "__default_policy_ID";
|
|
26744
|
+
const LAMBDA_PERMISSION_STATEMENT_KEYS = [
|
|
26745
|
+
"Action",
|
|
26746
|
+
"Principal",
|
|
26747
|
+
"SourceArn",
|
|
26748
|
+
"SourceAccount",
|
|
26749
|
+
"PrincipalOrgID",
|
|
26750
|
+
"InvokedViaFunctionUrl"
|
|
26751
|
+
];
|
|
26752
|
+
function lambdaPermissionMatchesDeclared(read, declared) {
|
|
26753
|
+
return LAMBDA_PERMISSION_STATEMENT_KEYS.every((key) => {
|
|
26754
|
+
if (key === "InvokedViaFunctionUrl") return read[key] === true === (coerceCfnBoolean(declared[key]) === true);
|
|
26755
|
+
const want = declared[key];
|
|
26756
|
+
const got = read[key];
|
|
26757
|
+
if (want === void 0 || want === null || want === "") return got === void 0;
|
|
26758
|
+
return key === "Principal" ? accountKey(got) === accountKey(want) : got === want;
|
|
26759
|
+
});
|
|
26760
|
+
}
|
|
26761
|
+
|
|
25939
26762
|
// src/provisioning/iam-sibling-managed-policies.ts
|
|
25940
26763
|
const ATTACHMENT_FIELD = {
|
|
25941
26764
|
"AWS::IAM::Role": "Roles",
|
|
@@ -26774,7 +27597,7 @@ async function ccRoutedInstanceTakesNoSnapshot(input) {
|
|
|
26774
27597
|
if (resourceType !== "AWS::RDS::DBInstance") return false;
|
|
26775
27598
|
if (region === void 0 || region === "") return false;
|
|
26776
27599
|
const mask = input.mask ?? ((text) => text);
|
|
26777
|
-
const { describeDBInstanceInRegion, isLiveReadReplica } = await import("./read-replica-
|
|
27600
|
+
const { describeDBInstanceInRegion, isLiveReadReplica } = await import("./read-replica-CfVkW9fC.js").then((n) => n.l);
|
|
26778
27601
|
let reason;
|
|
26779
27602
|
try {
|
|
26780
27603
|
const live = await describeDBInstanceInRegion(physicalId, region);
|
|
@@ -28325,12 +29148,12 @@ const gray = (s) => `${codes.gray}${s}${codes.reset}`;
|
|
|
28325
29148
|
const bold = (s) => `${codes.bright}${s}${codes.reset}`;
|
|
28326
29149
|
|
|
28327
29150
|
// src/deployment/delete-guard-scope.ts
|
|
28328
|
-
const storage$
|
|
29151
|
+
const storage$2 = new AsyncLocalStorage();
|
|
28329
29152
|
function collectDeleteGuards(sink, fn) {
|
|
28330
|
-
return storage$
|
|
29153
|
+
return storage$2.run(sink, fn);
|
|
28331
29154
|
}
|
|
28332
29155
|
function reportDeleteGuards(result, target) {
|
|
28333
|
-
const sink = storage$
|
|
29156
|
+
const sink = storage$2.getStore();
|
|
28334
29157
|
if (!sink) return;
|
|
28335
29158
|
for (const guard of deleteIndeterminateGuards(result)) sink.push({
|
|
28336
29159
|
guard: guard.guard,
|
|
@@ -28687,183 +29510,6 @@ function isReplacementNameRefusal(error, logicalId) {
|
|
|
28687
29510
|
return false;
|
|
28688
29511
|
}
|
|
28689
29512
|
|
|
28690
|
-
// src/deployment/superseded-resources.ts
|
|
28691
|
-
function supersededResourcesOf(state) {
|
|
28692
|
-
const rows = state?.supersededResources;
|
|
28693
|
-
if (!Array.isArray(rows)) return [];
|
|
28694
|
-
return rows.filter(isSupersededResourceRecord);
|
|
28695
|
-
}
|
|
28696
|
-
function isSupersededResourceRecord(row) {
|
|
28697
|
-
if (typeof row !== "object" || row === null) return false;
|
|
28698
|
-
const entry = row;
|
|
28699
|
-
const record = entry["state"];
|
|
28700
|
-
if (typeof entry["logicalId"] !== "string") return false;
|
|
28701
|
-
if (typeof record !== "object" || record === null) return false;
|
|
28702
|
-
const { physicalId, resourceType, properties } = record;
|
|
28703
|
-
return typeof physicalId === "string" && physicalId !== "" && typeof resourceType === "string" && resourceType !== "" && typeof properties === "object" && properties !== null && !Array.isArray(properties);
|
|
28704
|
-
}
|
|
28705
|
-
function isSupersededHeld(entry, resources) {
|
|
28706
|
-
return supersededHolderOf(entry, resources) !== void 0;
|
|
28707
|
-
}
|
|
28708
|
-
function supersededHolderOf(entry, resources) {
|
|
28709
|
-
const holders = Object.values(resources).filter((record) => typeof record === "object" && record !== null && record.physicalId === entry.state.physicalId);
|
|
28710
|
-
return holders.find((record) => record.resourceType === entry.state.resourceType) ?? holders[0];
|
|
28711
|
-
}
|
|
28712
|
-
function isSupersededHeldBySameType(entry, resources) {
|
|
28713
|
-
return Object.values(resources).some((record) => typeof record === "object" && record !== null && record.physicalId === entry.state.physicalId && record.resourceType === entry.state.resourceType);
|
|
28714
|
-
}
|
|
28715
|
-
function supersededHeldByOtherTypeWarning(entry, holderType) {
|
|
28716
|
-
return `the superseded ${entry.state.resourceType} of ${entry.logicalId} (${entry.state.physicalId}) was not deleted: a ${holderType} record of this stack has the same physical id, and cdkd never deletes an id a record names. If the ${entry.state.resourceType} still exists, delete it by hand; it is no longer tracked in state.`;
|
|
28717
|
-
}
|
|
28718
|
-
function addSuperseded(host, entry) {
|
|
28719
|
-
host.supersededResources = [...(Array.isArray(host.supersededResources) ? host.supersededResources : []).filter((row) => !isSupersededResourceRecord(row) || row.state.physicalId !== entry.state.physicalId || row.state.resourceType !== entry.state.resourceType), entry];
|
|
28720
|
-
}
|
|
28721
|
-
function canRecordSuperseded(record, deleteContext) {
|
|
28722
|
-
if (deleteNeedsThisRunsNoEchoValues(record, deleteContext.noEchoDeleteValues)) return false;
|
|
28723
|
-
if (deleteContext.persistedRecord !== true && Array.isArray(record.noEchoLeaves) && record.noEchoLeaves.length > 0) return false;
|
|
28724
|
-
if (deleteContext.inlinePolicyClaimed !== void 0) return false;
|
|
28725
|
-
return !INLINE_POLICY_TYPES.has(record.resourceType);
|
|
28726
|
-
}
|
|
28727
|
-
function deleteNeedsThisRunsNoEchoValues(record, noEchoDeleteValues) {
|
|
28728
|
-
if (noEchoDeleteValues !== void 0) return true;
|
|
28729
|
-
return readsNoEchoDeleteValues(record.resourceType) && Array.isArray(record.noEchoLeaves) && record.noEchoLeaves.length > 0;
|
|
28730
|
-
}
|
|
28731
|
-
function isInlinePolicyType(resourceType) {
|
|
28732
|
-
return INLINE_POLICY_TYPES.has(resourceType);
|
|
28733
|
-
}
|
|
28734
|
-
const INLINE_POLICY_TYPES = /* @__PURE__ */ new Set([
|
|
28735
|
-
"AWS::IAM::Policy",
|
|
28736
|
-
"AWS::IAM::RolePolicy",
|
|
28737
|
-
"AWS::IAM::UserPolicy",
|
|
28738
|
-
"AWS::IAM::GroupPolicy"
|
|
28739
|
-
]);
|
|
28740
|
-
function removeSuperseded(host, entry) {
|
|
28741
|
-
if (!Array.isArray(host.supersededResources)) return;
|
|
28742
|
-
const remaining = host.supersededResources.filter((row) => row !== entry);
|
|
28743
|
-
if (remaining.length === 0) delete host.supersededResources;
|
|
28744
|
-
else host.supersededResources = remaining;
|
|
28745
|
-
}
|
|
28746
|
-
function supersededAfterRollback(base, pending, resources) {
|
|
28747
|
-
const added = Array.isArray(pending.supersededResources) ? pending.supersededResources : [];
|
|
28748
|
-
const all = [...ownNotPending(base, added).filter((entry) => !isSupersededResourceRecord(entry) || !isSupersededHeldBySameType(entry, resources)), ...added];
|
|
28749
|
-
return all.length > 0 ? { supersededResources: all } : {};
|
|
28750
|
-
}
|
|
28751
|
-
function ownNotPending(base, added) {
|
|
28752
|
-
return (Array.isArray(base.supersededResources) ? base.supersededResources : []).filter((entry) => !added.some((a) => a.state.physicalId === entry.state.physicalId && a.state.resourceType === entry.state.resourceType));
|
|
28753
|
-
}
|
|
28754
|
-
const SUPERSEDED_KEPT_REMEDY = "cdkd keeps it in state: the next `cdkd deploy` of this stack retries the delete, and `cdkd destroy` deletes it";
|
|
28755
|
-
function withoutSuperseded(state) {
|
|
28756
|
-
const { supersededResources: _dropped, ...rest } = state;
|
|
28757
|
-
return rest;
|
|
28758
|
-
}
|
|
28759
|
-
async function deleteSupersededEntry(entry, input) {
|
|
28760
|
-
const record = entry.state;
|
|
28761
|
-
const owesSnapshot = entry.skipFinalSnapshot !== true && entry.finalSnapshotIdentifier !== void 0 && PRE_DELETE_SNAPSHOT_TYPES.has(record.resourceType);
|
|
28762
|
-
if (owesSnapshot) {
|
|
28763
|
-
if (input.preDeleteSnapshot === void 0) return {
|
|
28764
|
-
kind: "failed",
|
|
28765
|
-
error: new CdkdError(`The final snapshot of ${entry.logicalId}'s superseded ${record.resourceType} could not be taken here. The resource was NOT deleted.`, "FINAL_SNAPSHOT_FAILED")
|
|
28766
|
-
};
|
|
28767
|
-
if (input.stop()) return {
|
|
28768
|
-
kind: "failed",
|
|
28769
|
-
error: new CdkdError(`The run was interrupted before the final snapshot of ${entry.logicalId}'s superseded ${record.resourceType}. The resource was NOT deleted.`, "FINAL_SNAPSHOT_FAILED")
|
|
28770
|
-
};
|
|
28771
|
-
try {
|
|
28772
|
-
await createPreDeleteFinalSnapshot(record.resourceType, record.physicalId, entry.logicalId, input.preDeleteSnapshot.clients, input.preDeleteSnapshot.logger, {
|
|
28773
|
-
refuseUnsnapshottableState: true,
|
|
28774
|
-
reuseStartedAtOrAfter: Number.isFinite(entry.supersededAt) ? entry.supersededAt : Date.now(),
|
|
28775
|
-
stop: input.stop
|
|
28776
|
-
});
|
|
28777
|
-
} catch (error) {
|
|
28778
|
-
return {
|
|
28779
|
-
kind: "failed",
|
|
28780
|
-
error
|
|
28781
|
-
};
|
|
28782
|
-
}
|
|
28783
|
-
}
|
|
28784
|
-
const { finalSnapshotIdentifier: _taken, ...snapshotTaken } = entry;
|
|
28785
|
-
const failed = (error) => owesSnapshot ? {
|
|
28786
|
-
kind: "failed",
|
|
28787
|
-
error,
|
|
28788
|
-
replacement: snapshotTaken
|
|
28789
|
-
} : {
|
|
28790
|
-
kind: "failed",
|
|
28791
|
-
error
|
|
28792
|
-
};
|
|
28793
|
-
let result;
|
|
28794
|
-
try {
|
|
28795
|
-
const send = () => input.provider.delete(entry.logicalId, record.physicalId, record.resourceType, record.properties, {
|
|
28796
|
-
expectedRegion: input.region,
|
|
28797
|
-
...entry.forceDataDelete === true && { forceDataDelete: true },
|
|
28798
|
-
...entry.finalSnapshotIdentifier !== void 0 && !PRE_DELETE_SNAPSHOT_TYPES.has(record.resourceType) && { finalSnapshotIdentifier: entry.finalSnapshotIdentifier },
|
|
28799
|
-
deletionPolicy: replacementDeletePolicy(entry.updateReplacePolicy),
|
|
28800
|
-
...entry.skipFinalSnapshot === true && { skipFinalSnapshot: true },
|
|
28801
|
-
...input.removeProtection === true && { removeProtection: true },
|
|
28802
|
-
...input.stackDestroy === true && { stackDestroy: true },
|
|
28803
|
-
recordedAttributes: record.attributes,
|
|
28804
|
-
recordedCreateOnlyDrops: record.acceptedCreateOnlyDrops,
|
|
28805
|
-
recordedNoEchoLeaves: record.noEchoLeaves,
|
|
28806
|
-
recordedTypedPayloadLeaves: record.typedPayloadLeaves,
|
|
28807
|
-
maskSecrets: input.maskSecrets
|
|
28808
|
-
});
|
|
28809
|
-
result = input.once === true ? await send() : await retryWhileInUse(send, input.stop);
|
|
28810
|
-
} catch (error) {
|
|
28811
|
-
return failed(error);
|
|
28812
|
-
}
|
|
28813
|
-
reportDeleteGuards(result, {
|
|
28814
|
-
physicalId: record.physicalId,
|
|
28815
|
-
resourceType: record.resourceType,
|
|
28816
|
-
provisionedBy: record.provisionedBy
|
|
28817
|
-
});
|
|
28818
|
-
const reason = deleteSkipReason(result);
|
|
28819
|
-
return reason === void 0 ? { kind: "deleted" } : {
|
|
28820
|
-
kind: "notDeleted",
|
|
28821
|
-
reason
|
|
28822
|
-
};
|
|
28823
|
-
}
|
|
28824
|
-
const supersededInUseRetry = {
|
|
28825
|
-
attempts: 6,
|
|
28826
|
-
delayMs: 1e4
|
|
28827
|
-
};
|
|
28828
|
-
const IN_USE_ERROR_NAMES = /* @__PURE__ */ new Set([
|
|
28829
|
-
"ResourceInUseException",
|
|
28830
|
-
"ResourceInUse",
|
|
28831
|
-
"DependencyViolation"
|
|
28832
|
-
]);
|
|
28833
|
-
const IN_USE_CONFLICT = /\bare using it\b/;
|
|
28834
|
-
function isInUseRefusal(error) {
|
|
28835
|
-
for (let current = error, depth = 0; current !== void 0 && depth < 8; depth++) {
|
|
28836
|
-
if (typeof current !== "object" || current === null) return false;
|
|
28837
|
-
const { name, message } = current;
|
|
28838
|
-
if (typeof name === "string" && IN_USE_ERROR_NAMES.has(name)) return true;
|
|
28839
|
-
if (name === "ConflictException" && typeof message === "string" && IN_USE_CONFLICT.test(message)) return true;
|
|
28840
|
-
current = current.cause;
|
|
28841
|
-
}
|
|
28842
|
-
return false;
|
|
28843
|
-
}
|
|
28844
|
-
function isInUseOrConflictRefusal(error) {
|
|
28845
|
-
if (isInUseRefusal(error)) return true;
|
|
28846
|
-
for (let current = error, depth = 0; current !== void 0 && depth < 8; depth++) {
|
|
28847
|
-
if (typeof current !== "object" || current === null) return false;
|
|
28848
|
-
if (current.name === "ConflictException") return true;
|
|
28849
|
-
current = current.cause;
|
|
28850
|
-
}
|
|
28851
|
-
return false;
|
|
28852
|
-
}
|
|
28853
|
-
async function retryWhileInUse(send, stop) {
|
|
28854
|
-
for (let attempt = 1;; attempt++) try {
|
|
28855
|
-
return await send();
|
|
28856
|
-
} catch (error) {
|
|
28857
|
-
if (attempt >= supersededInUseRetry.attempts || stop() || !isInUseRefusal(error) || isMarkedNonRetryable(error)) throw error;
|
|
28858
|
-
await new Promise((resolve) => setTimeout(resolve, supersededInUseRetry.delayMs));
|
|
28859
|
-
if (stop()) throw error;
|
|
28860
|
-
}
|
|
28861
|
-
}
|
|
28862
|
-
function holdsSupersededResources(record) {
|
|
28863
|
-
const rows = record.supersededResources;
|
|
28864
|
-
return rows !== void 0 && (!Array.isArray(rows) || rows.length > 0);
|
|
28865
|
-
}
|
|
28866
|
-
|
|
28867
29513
|
// src/deployment/rollback-executor/replay-scope.ts
|
|
28868
29514
|
function withReplayDeletePrinting(scope, fn) {
|
|
28869
29515
|
const deployBag = scope.ctx.logOnlyNeedlesFor?.(scope.op.logicalId);
|
|
@@ -29147,7 +29793,6 @@ async function liveSurvivorRead(ctx, oldType, physicalId) {
|
|
|
29147
29793
|
clearTimeout(timer);
|
|
29148
29794
|
}
|
|
29149
29795
|
}
|
|
29150
|
-
const SURVIVOR_IDENTITY_ATTRIBUTES = { "AWS::IAM::Role": "RoleId" };
|
|
29151
29796
|
const INTERRUPT_POLL_MS = 250;
|
|
29152
29797
|
async function probeReplacedSurvivor(s, oldType, timeoutMs = REPLACED_SURVIVOR_PROBE_TIMEOUT_MS) {
|
|
29153
29798
|
if (s.isInterrupted?.() === true) return "interrupted";
|
|
@@ -29225,19 +29870,294 @@ function judgeHolder(s, oldType, existence, read, snapshot) {
|
|
|
29225
29870
|
return read.identity === void 0 ? "unknown" : "exists";
|
|
29226
29871
|
}
|
|
29227
29872
|
async function identityVerdict(s, physicalId, oldType) {
|
|
29228
|
-
const
|
|
29229
|
-
if (
|
|
29230
|
-
const recorded = s.op.previousState?.attributes?.
|
|
29231
|
-
if (
|
|
29873
|
+
const held = recordedIdentityValue(oldType, s.op.previousState?.attributes);
|
|
29874
|
+
if (held.kind === "no-attribute" || held.kind === "not-recorded") return "identity-unverified";
|
|
29875
|
+
const recorded = recordedIdentityId(oldType, { recordedAttributes: s.op.previousState?.attributes })?.value;
|
|
29876
|
+
if (recorded === void 0) return "identity-uncompared";
|
|
29232
29877
|
try {
|
|
29233
29878
|
const provider = s.ctx.providerRegistry.getProvider(oldType);
|
|
29234
|
-
if (typeof provider.resourceIdentity !== "function") return "
|
|
29879
|
+
if (typeof provider.resourceIdentity !== "function") return "identity-unverified";
|
|
29235
29880
|
const live = await withReplayDeletePrinting(s, () => provider.resourceIdentity(physicalId, oldType, { expectedRegion: s.ctx.region }));
|
|
29236
29881
|
if (live === RESOURCE_NOT_FOUND) return "gone";
|
|
29237
|
-
|
|
29882
|
+
if (typeof live !== "string" || live === "") return "identity-uncompared";
|
|
29883
|
+
return live === recorded ? "exists" : "foreign";
|
|
29238
29884
|
} catch {
|
|
29239
|
-
return "
|
|
29885
|
+
return "identity-unread";
|
|
29886
|
+
}
|
|
29887
|
+
}
|
|
29888
|
+
function recordedIdentityValue(oldType, attributes) {
|
|
29889
|
+
if (!Object.hasOwn(SURVIVOR_IDENTITY_ATTRIBUTES, oldType)) return { kind: "no-attribute" };
|
|
29890
|
+
const key = SURVIVOR_IDENTITY_ATTRIBUTES[oldType];
|
|
29891
|
+
const value = typeof attributes === "object" && attributes !== null && Object.hasOwn(attributes, key) ? attributes[key] : void 0;
|
|
29892
|
+
return value === void 0 || value === null || value === "" ? { kind: "not-recorded" } : {
|
|
29893
|
+
kind: "held",
|
|
29894
|
+
key
|
|
29895
|
+
};
|
|
29896
|
+
}
|
|
29897
|
+
function unverifiedIdentityCause(oldType, attributes, shownType) {
|
|
29898
|
+
const held = recordedIdentityValue(oldType, attributes);
|
|
29899
|
+
if (held.kind === "no-attribute") return `cdkd records no AWS-assigned id for ${shownType} to compare`;
|
|
29900
|
+
const key = SURVIVOR_IDENTITY_ATTRIBUTES[oldType];
|
|
29901
|
+
return held.kind === "not-recorded" ? `its state record holds no ${key}: it was written before cdkd recorded one` : `cdkd has no read of the ${key} for ${shownType}`;
|
|
29902
|
+
}
|
|
29903
|
+
|
|
29904
|
+
// src/deployment/journaled-holder.ts
|
|
29905
|
+
const journaledHolderRead = {
|
|
29906
|
+
attempts: 3,
|
|
29907
|
+
delayMs: 2e3
|
|
29908
|
+
};
|
|
29909
|
+
function isUnreadHolder(judged) {
|
|
29910
|
+
return judged === "unreadable" || judged === "interrupted";
|
|
29911
|
+
}
|
|
29912
|
+
async function judgeJournaledHolder(input) {
|
|
29913
|
+
if (input.journaled.split("|")[0] !== canonicalizeRegion(input.region)) return { incomparable: "the recorded generation names another region than the stack's" };
|
|
29914
|
+
try {
|
|
29915
|
+
if (typeof input.provider().replacedSurvivorIdentity !== "function") return { incomparable: "cdkd reads no holder for this resource type" };
|
|
29916
|
+
} catch {
|
|
29917
|
+
return { incomparable: "cdkd reads no holder for this resource type" };
|
|
29918
|
+
}
|
|
29919
|
+
let judged = "unreadable";
|
|
29920
|
+
for (let attempt = 0; attempt < journaledHolderRead.attempts; attempt++) {
|
|
29921
|
+
if (attempt > 0) {
|
|
29922
|
+
if (input.interrupted()) return "interrupted";
|
|
29923
|
+
await new Promise((resolve) => setTimeout(resolve, journaledHolderRead.delayMs));
|
|
29924
|
+
}
|
|
29925
|
+
judged = judge(await readHolder(input), input.journaled, input.resourceType);
|
|
29926
|
+
if (judged !== "unreadable") break;
|
|
29927
|
+
}
|
|
29928
|
+
return judged;
|
|
29929
|
+
}
|
|
29930
|
+
function unreadHolderCause(judged) {
|
|
29931
|
+
return judged === "interrupted" ? "the run was interrupted before cdkd could read what holds that name now to confirm it is the resource the deploy replaced" : "cdkd could not read what holds that name now to confirm it is the resource the deploy replaced";
|
|
29932
|
+
}
|
|
29933
|
+
function incomparableHolderNote(reason) {
|
|
29934
|
+
return `cdkd cannot compare what holds that name now with the generation it recorded (${reason}), so the delete is sent by name, as for an entry recorded without one`;
|
|
29935
|
+
}
|
|
29936
|
+
function notOursHolderCause(resourceType, attribute) {
|
|
29937
|
+
return `the ${resourceType} now under that name is not the one the deploy replaced (its ${attribute} differs from what cdkd read when it deferred the delete), so no delete was sent and that resource was left alone`;
|
|
29938
|
+
}
|
|
29939
|
+
async function readHolder(input) {
|
|
29940
|
+
let timer;
|
|
29941
|
+
try {
|
|
29942
|
+
const provider = input.provider();
|
|
29943
|
+
if (typeof provider.replacedSurvivorIdentity !== "function") return { kind: "unknown" };
|
|
29944
|
+
return await Promise.race([provider.replacedSurvivorIdentity(input.physicalId, input.resourceType, { expectedRegion: input.region }), new Promise((resolve) => {
|
|
29945
|
+
timer = setTimeout(() => resolve({ kind: "unknown" }), DEFERRAL_IDENTITY_TIMEOUT_MS);
|
|
29946
|
+
})]);
|
|
29947
|
+
} catch {
|
|
29948
|
+
return { kind: "unknown" };
|
|
29949
|
+
} finally {
|
|
29950
|
+
clearTimeout(timer);
|
|
29951
|
+
}
|
|
29952
|
+
}
|
|
29953
|
+
function judge(read, journaled, resourceType) {
|
|
29954
|
+
switch (read.kind) {
|
|
29955
|
+
case "gone": return "gone";
|
|
29956
|
+
case "foreign": return { notOurs: read.seen === "other-account" ? "owning account" : "region" };
|
|
29957
|
+
case "unknown": return "unreadable";
|
|
29958
|
+
case "owned":
|
|
29959
|
+
if (read.identity === void 0) return "unreadable";
|
|
29960
|
+
if (read.identity === journaled) return "ours";
|
|
29961
|
+
return journaled.split("|")[0] === SURVIVOR_LIVE_READ_TYPES[resourceType] ? { notOurs: "creation time" } : "ours";
|
|
29962
|
+
}
|
|
29963
|
+
}
|
|
29964
|
+
|
|
29965
|
+
// src/deployment/superseded-resources.ts
|
|
29966
|
+
function supersededResourcesOf(state) {
|
|
29967
|
+
const rows = state?.supersededResources;
|
|
29968
|
+
if (!Array.isArray(rows)) return [];
|
|
29969
|
+
return rows.filter(isSupersededResourceRecord);
|
|
29970
|
+
}
|
|
29971
|
+
function isSupersededResourceRecord(row) {
|
|
29972
|
+
if (typeof row !== "object" || row === null) return false;
|
|
29973
|
+
const entry = row;
|
|
29974
|
+
const record = entry["state"];
|
|
29975
|
+
if (typeof entry["logicalId"] !== "string") return false;
|
|
29976
|
+
if (typeof record !== "object" || record === null) return false;
|
|
29977
|
+
const { physicalId, resourceType, properties } = record;
|
|
29978
|
+
return typeof physicalId === "string" && physicalId !== "" && typeof resourceType === "string" && resourceType !== "" && typeof properties === "object" && properties !== null && !Array.isArray(properties);
|
|
29979
|
+
}
|
|
29980
|
+
function isSupersededHeld(entry, resources) {
|
|
29981
|
+
return supersededHolderOf(entry, resources) !== void 0;
|
|
29982
|
+
}
|
|
29983
|
+
function supersededHolderOf(entry, resources) {
|
|
29984
|
+
const holders = Object.values(resources).filter((record) => typeof record === "object" && record !== null && record.physicalId === entry.state.physicalId);
|
|
29985
|
+
return holders.find((record) => record.resourceType === entry.state.resourceType) ?? holders[0];
|
|
29986
|
+
}
|
|
29987
|
+
function isSupersededHeldBySameType(entry, resources) {
|
|
29988
|
+
return Object.values(resources).some((record) => typeof record === "object" && record !== null && record.physicalId === entry.state.physicalId && record.resourceType === entry.state.resourceType);
|
|
29989
|
+
}
|
|
29990
|
+
function supersededHeldByOtherTypeWarning(entry, holderType) {
|
|
29991
|
+
return `the superseded ${entry.state.resourceType} of ${entry.logicalId} (${entry.state.physicalId}) was not deleted: a ${holderType} record of this stack has the same physical id, and cdkd never deletes an id a record names. If the ${entry.state.resourceType} still exists, delete it by hand; it is no longer tracked in state.`;
|
|
29992
|
+
}
|
|
29993
|
+
function addSuperseded(host, entry) {
|
|
29994
|
+
host.supersededResources = [...(Array.isArray(host.supersededResources) ? host.supersededResources : []).filter((row) => !isSupersededResourceRecord(row) || row.state.physicalId !== entry.state.physicalId || row.state.resourceType !== entry.state.resourceType), entry];
|
|
29995
|
+
}
|
|
29996
|
+
function canRecordSuperseded(record, deleteContext) {
|
|
29997
|
+
if (deleteNeedsThisRunsNoEchoValues(record, deleteContext.noEchoDeleteValues)) return false;
|
|
29998
|
+
if (deleteContext.persistedRecord !== true && Array.isArray(record.noEchoLeaves) && record.noEchoLeaves.length > 0) return false;
|
|
29999
|
+
if (deleteContext.inlinePolicyClaimed !== void 0) return false;
|
|
30000
|
+
return !INLINE_POLICY_TYPES.has(record.resourceType);
|
|
30001
|
+
}
|
|
30002
|
+
function deleteNeedsThisRunsNoEchoValues(record, noEchoDeleteValues) {
|
|
30003
|
+
if (noEchoDeleteValues !== void 0) return true;
|
|
30004
|
+
return readsNoEchoDeleteValues(record.resourceType) && Array.isArray(record.noEchoLeaves) && record.noEchoLeaves.length > 0;
|
|
30005
|
+
}
|
|
30006
|
+
function isInlinePolicyType(resourceType) {
|
|
30007
|
+
return INLINE_POLICY_TYPES.has(resourceType);
|
|
30008
|
+
}
|
|
30009
|
+
const INLINE_POLICY_TYPES = /* @__PURE__ */ new Set([
|
|
30010
|
+
"AWS::IAM::Policy",
|
|
30011
|
+
"AWS::IAM::RolePolicy",
|
|
30012
|
+
"AWS::IAM::UserPolicy",
|
|
30013
|
+
"AWS::IAM::GroupPolicy"
|
|
30014
|
+
]);
|
|
30015
|
+
function removeSuperseded(host, entry) {
|
|
30016
|
+
if (!Array.isArray(host.supersededResources)) return;
|
|
30017
|
+
const remaining = host.supersededResources.filter((row) => row !== entry);
|
|
30018
|
+
if (remaining.length === 0) delete host.supersededResources;
|
|
30019
|
+
else host.supersededResources = remaining;
|
|
30020
|
+
}
|
|
30021
|
+
function supersededAfterRollback(base, pending, resources) {
|
|
30022
|
+
const added = Array.isArray(pending.supersededResources) ? pending.supersededResources : [];
|
|
30023
|
+
const all = [...ownNotPending(base, added).filter((entry) => !isSupersededResourceRecord(entry) || !isSupersededHeldBySameType(entry, resources)), ...added];
|
|
30024
|
+
return all.length > 0 ? { supersededResources: all } : {};
|
|
30025
|
+
}
|
|
30026
|
+
function ownNotPending(base, added) {
|
|
30027
|
+
return (Array.isArray(base.supersededResources) ? base.supersededResources : []).filter((entry) => !added.some((a) => a.state.physicalId === entry.state.physicalId && a.state.resourceType === entry.state.resourceType));
|
|
30028
|
+
}
|
|
30029
|
+
const SUPERSEDED_KEPT_REMEDY = "cdkd keeps it in state: the next `cdkd deploy` of this stack retries the delete, and `cdkd destroy` deletes it";
|
|
30030
|
+
function withoutSuperseded(state) {
|
|
30031
|
+
const { supersededResources: _dropped, ...rest } = state;
|
|
30032
|
+
return rest;
|
|
30033
|
+
}
|
|
30034
|
+
async function deleteSupersededEntry(entry, input) {
|
|
30035
|
+
const record = entry.state;
|
|
30036
|
+
if (Object.prototype.hasOwnProperty.call(entry, "identity")) {
|
|
30037
|
+
const journaled = entry.identity;
|
|
30038
|
+
const judged = typeof journaled !== "string" || journaled === "" ? { incomparable: "the recorded generation is malformed" } : input.holderProvider === void 0 ? { incomparable: "cdkd reads no holder for this resource type" } : await judgeJournaledHolder({
|
|
30039
|
+
provider: input.holderProvider,
|
|
30040
|
+
resourceType: record.resourceType,
|
|
30041
|
+
physicalId: record.physicalId,
|
|
30042
|
+
region: input.region,
|
|
30043
|
+
journaled,
|
|
30044
|
+
interrupted: input.stop
|
|
30045
|
+
});
|
|
30046
|
+
if (judged === "gone") return { kind: "gone" };
|
|
30047
|
+
if (isUnreadHolder(judged)) return {
|
|
30048
|
+
kind: "failed",
|
|
30049
|
+
error: new CdkdError(`No delete was sent: ${unreadHolderCause(judged)}`, "SUPERSEDED_HOLDER_UNREAD")
|
|
30050
|
+
};
|
|
30051
|
+
if (typeof judged === "object" && "incomparable" in judged) input.warn?.(incomparableHolderNote(judged.incomparable));
|
|
30052
|
+
else if (judged !== "ours") return {
|
|
30053
|
+
kind: "notOurs",
|
|
30054
|
+
cause: notOursHolderCause(record.resourceType, judged.notOurs)
|
|
30055
|
+
};
|
|
30056
|
+
}
|
|
30057
|
+
const owesSnapshot = entry.skipFinalSnapshot !== true && entry.finalSnapshotIdentifier !== void 0 && PRE_DELETE_SNAPSHOT_TYPES.has(record.resourceType);
|
|
30058
|
+
if (owesSnapshot) {
|
|
30059
|
+
if (input.preDeleteSnapshot === void 0) return {
|
|
30060
|
+
kind: "failed",
|
|
30061
|
+
error: new CdkdError(`The final snapshot of ${entry.logicalId}'s superseded ${record.resourceType} could not be taken here. The resource was NOT deleted.`, "FINAL_SNAPSHOT_FAILED")
|
|
30062
|
+
};
|
|
30063
|
+
if (input.stop()) return {
|
|
30064
|
+
kind: "failed",
|
|
30065
|
+
error: new CdkdError(`The run was interrupted before the final snapshot of ${entry.logicalId}'s superseded ${record.resourceType}. The resource was NOT deleted.`, "FINAL_SNAPSHOT_FAILED")
|
|
30066
|
+
};
|
|
30067
|
+
try {
|
|
30068
|
+
await createPreDeleteFinalSnapshot(record.resourceType, record.physicalId, entry.logicalId, input.preDeleteSnapshot.clients, input.preDeleteSnapshot.logger, {
|
|
30069
|
+
refuseUnsnapshottableState: true,
|
|
30070
|
+
reuseStartedAtOrAfter: Number.isFinite(entry.supersededAt) ? entry.supersededAt : Date.now(),
|
|
30071
|
+
stop: input.stop
|
|
30072
|
+
});
|
|
30073
|
+
} catch (error) {
|
|
30074
|
+
return {
|
|
30075
|
+
kind: "failed",
|
|
30076
|
+
error
|
|
30077
|
+
};
|
|
30078
|
+
}
|
|
30079
|
+
}
|
|
30080
|
+
const { finalSnapshotIdentifier: _taken, ...snapshotTaken } = entry;
|
|
30081
|
+
const failed = (error) => owesSnapshot ? {
|
|
30082
|
+
kind: "failed",
|
|
30083
|
+
error,
|
|
30084
|
+
replacement: snapshotTaken
|
|
30085
|
+
} : {
|
|
30086
|
+
kind: "failed",
|
|
30087
|
+
error
|
|
30088
|
+
};
|
|
30089
|
+
let result;
|
|
30090
|
+
try {
|
|
30091
|
+
const send = () => input.provider.delete(entry.logicalId, record.physicalId, record.resourceType, record.properties, {
|
|
30092
|
+
expectedRegion: input.region,
|
|
30093
|
+
...entry.forceDataDelete === true && { forceDataDelete: true },
|
|
30094
|
+
...entry.finalSnapshotIdentifier !== void 0 && !PRE_DELETE_SNAPSHOT_TYPES.has(record.resourceType) && { finalSnapshotIdentifier: entry.finalSnapshotIdentifier },
|
|
30095
|
+
deletionPolicy: replacementDeletePolicy(entry.updateReplacePolicy),
|
|
30096
|
+
...entry.skipFinalSnapshot === true && { skipFinalSnapshot: true },
|
|
30097
|
+
...input.removeProtection === true && { removeProtection: true },
|
|
30098
|
+
...input.stackDestroy === true && { stackDestroy: true },
|
|
30099
|
+
recordedAttributes: record.attributes,
|
|
30100
|
+
recordedCreateOnlyDrops: record.acceptedCreateOnlyDrops,
|
|
30101
|
+
recordedNoEchoLeaves: record.noEchoLeaves,
|
|
30102
|
+
recordedTypedPayloadLeaves: record.typedPayloadLeaves,
|
|
30103
|
+
maskSecrets: input.maskSecrets
|
|
30104
|
+
});
|
|
30105
|
+
result = input.once === true ? await send() : await retryWhileInUse(send, input.stop);
|
|
30106
|
+
} catch (error) {
|
|
30107
|
+
return failed(error);
|
|
29240
30108
|
}
|
|
30109
|
+
reportDeleteGuards(result, {
|
|
30110
|
+
physicalId: record.physicalId,
|
|
30111
|
+
resourceType: record.resourceType,
|
|
30112
|
+
provisionedBy: record.provisionedBy
|
|
30113
|
+
});
|
|
30114
|
+
const reason = deleteSkipReason(result);
|
|
30115
|
+
return reason === void 0 ? { kind: "deleted" } : {
|
|
30116
|
+
kind: "notDeleted",
|
|
30117
|
+
reason
|
|
30118
|
+
};
|
|
30119
|
+
}
|
|
30120
|
+
const supersededInUseRetry = {
|
|
30121
|
+
attempts: 6,
|
|
30122
|
+
delayMs: 1e4
|
|
30123
|
+
};
|
|
30124
|
+
const IN_USE_ERROR_NAMES = /* @__PURE__ */ new Set([
|
|
30125
|
+
"ResourceInUseException",
|
|
30126
|
+
"ResourceInUse",
|
|
30127
|
+
"DependencyViolation"
|
|
30128
|
+
]);
|
|
30129
|
+
const IN_USE_CONFLICT = /\bare using it\b/;
|
|
30130
|
+
function isInUseRefusal(error) {
|
|
30131
|
+
for (let current = error, depth = 0; current !== void 0 && depth < 8; depth++) {
|
|
30132
|
+
if (typeof current !== "object" || current === null) return false;
|
|
30133
|
+
const { name, message } = current;
|
|
30134
|
+
if (typeof name === "string" && IN_USE_ERROR_NAMES.has(name)) return true;
|
|
30135
|
+
if (name === "ConflictException" && typeof message === "string" && IN_USE_CONFLICT.test(message)) return true;
|
|
30136
|
+
current = current.cause;
|
|
30137
|
+
}
|
|
30138
|
+
return false;
|
|
30139
|
+
}
|
|
30140
|
+
function isInUseOrConflictRefusal(error) {
|
|
30141
|
+
if (isInUseRefusal(error)) return true;
|
|
30142
|
+
for (let current = error, depth = 0; current !== void 0 && depth < 8; depth++) {
|
|
30143
|
+
if (typeof current !== "object" || current === null) return false;
|
|
30144
|
+
if (current.name === "ConflictException") return true;
|
|
30145
|
+
current = current.cause;
|
|
30146
|
+
}
|
|
30147
|
+
return false;
|
|
30148
|
+
}
|
|
30149
|
+
async function retryWhileInUse(send, stop) {
|
|
30150
|
+
for (let attempt = 1;; attempt++) try {
|
|
30151
|
+
return await send();
|
|
30152
|
+
} catch (error) {
|
|
30153
|
+
if (attempt >= supersededInUseRetry.attempts || stop() || !isInUseRefusal(error) || isMarkedNonRetryable(error)) throw error;
|
|
30154
|
+
await new Promise((resolve) => setTimeout(resolve, supersededInUseRetry.delayMs));
|
|
30155
|
+
if (stop()) throw error;
|
|
30156
|
+
}
|
|
30157
|
+
}
|
|
30158
|
+
function holdsSupersededResources(record) {
|
|
30159
|
+
const rows = record.supersededResources;
|
|
30160
|
+
return rows !== void 0 && (!Array.isArray(rows) || rows.length > 0);
|
|
29241
30161
|
}
|
|
29242
30162
|
|
|
29243
30163
|
// src/deployment/deploy-engine/replacement/delete-replaced.ts
|
|
@@ -29250,6 +30170,15 @@ async function deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType,
|
|
|
29250
30170
|
const identity = await readDeferralIdentity(deps.providerRegistry(), oldResourceType, currentResource.physicalId, deps.stackRegion);
|
|
29251
30171
|
if (identity !== void 0) run.replacedOldIdentity.set(logicalId, identity);
|
|
29252
30172
|
else run.replacedOldIdentity.delete(logicalId);
|
|
30173
|
+
const recorded = run.supersededEntries.get(logicalId);
|
|
30174
|
+
if (identity !== void 0 && recorded !== void 0 && run.supersededHost !== void 0) {
|
|
30175
|
+
const withIdentity = {
|
|
30176
|
+
...recorded,
|
|
30177
|
+
identity
|
|
30178
|
+
};
|
|
30179
|
+
addSuperseded(run.supersededHost, withIdentity);
|
|
30180
|
+
run.supersededEntries.set(logicalId, withIdentity);
|
|
30181
|
+
}
|
|
29253
30182
|
run.deferredReplacedDeletes?.set(logicalId, {
|
|
29254
30183
|
physicalId: currentResource.physicalId,
|
|
29255
30184
|
resourceType: oldResourceType,
|
|
@@ -29263,6 +30192,7 @@ async function deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType,
|
|
|
29263
30192
|
return;
|
|
29264
30193
|
}
|
|
29265
30194
|
if (!isRetry) deps.logger.info(safeMsg` Deleting old ${logicalId} (${displayPhysicalId(currentResource.resourceType, currentResource.physicalId)})...`);
|
|
30195
|
+
else if (!await journaledHolderIsOurs(run, deps, logicalId, oldResourceType, currentResource)) return;
|
|
29266
30196
|
let sentSnapshotIdentifier = finalSnapshotIdentifier;
|
|
29267
30197
|
if (owesPreDeleteSnapshot(oldResourceType, finalSnapshotIdentifier)) {
|
|
29268
30198
|
if (!await takeOwedSnapshot(run, deps, logicalId, currentResource, secrets, isRetry)) return;
|
|
@@ -29332,6 +30262,45 @@ async function deleteReplacedAfterCreate(run, deps, logicalId, oldResourceType,
|
|
|
29332
30262
|
deps.logger.info(isRetry ? safeMsg` ${green("✓")} Old ${logicalId} (${currentResource.physicalId}) deleted` : safeMsg` ${green("✓")} Old resource deleted`);
|
|
29333
30263
|
}
|
|
29334
30264
|
}
|
|
30265
|
+
async function journaledHolderIsOurs(run, deps, logicalId, oldResourceType, oldResource) {
|
|
30266
|
+
const journaled = run.replacedOldIdentity.get(logicalId);
|
|
30267
|
+
if (journaled === void 0) return true;
|
|
30268
|
+
const judged = await judgeJournaledHolder({
|
|
30269
|
+
provider: () => deps.providerRegistry().getProvider(oldResourceType),
|
|
30270
|
+
resourceType: oldResourceType,
|
|
30271
|
+
physicalId: oldResource.physicalId,
|
|
30272
|
+
region: deps.stackRegion,
|
|
30273
|
+
journaled,
|
|
30274
|
+
interrupted: () => deps.interrupted()
|
|
30275
|
+
});
|
|
30276
|
+
if (judged === "ours") return true;
|
|
30277
|
+
const shown = displayPhysicalId(oldResource.resourceType, oldResource.physicalId);
|
|
30278
|
+
if (typeof judged === "object" && "incomparable" in judged) {
|
|
30279
|
+
deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${shown}): ${incomparableHolderNote(judged.incomparable)}`);
|
|
30280
|
+
return true;
|
|
30281
|
+
}
|
|
30282
|
+
const recorded = run.supersededEntries.get(logicalId);
|
|
30283
|
+
if (isUnreadHolder(judged)) {
|
|
30284
|
+
const why = unreadHolderCause(judged);
|
|
30285
|
+
if (recorded === void 0) {
|
|
30286
|
+
run.replacedOldMaySurvive.set(logicalId, "unconfirmed");
|
|
30287
|
+
run.replacedDeleteSkips.set(logicalId, `the replaced ${oldResourceType} (${oldResource.physicalId}) was not deleted (${why}) and is no longer tracked by cdkd`);
|
|
30288
|
+
}
|
|
30289
|
+
deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${shown}) was not deleted: ${why}, so no delete was sent. ` + (recorded !== void 0 ? safeMsg`${SUPERSEDED_KEPT_REMEDY}.` : "It is no longer tracked in state: delete it manually once you confirm it is the stack's."));
|
|
30290
|
+
return false;
|
|
30291
|
+
}
|
|
30292
|
+
if (recorded !== void 0 && run.supersededHost !== void 0) {
|
|
30293
|
+
removeSuperseded(run.supersededHost, recorded);
|
|
30294
|
+
run.supersededEntries.delete(logicalId);
|
|
30295
|
+
}
|
|
30296
|
+
run.replacedOldMaySurvive.delete(logicalId);
|
|
30297
|
+
if (judged === "gone") {
|
|
30298
|
+
deps.logger.info(safeMsg` ${green("✓")} Old ${logicalId} (${shown}) is already gone; no delete was sent`);
|
|
30299
|
+
return false;
|
|
30300
|
+
}
|
|
30301
|
+
deps.logger.warn(safeMsg` ⚠ Old ${logicalId} (${shown}) was not deleted: ${notOursHolderCause(oldResourceType, judged.notOurs)}. The replaced resource is gone, and cdkd no longer tracks it in state.`);
|
|
30302
|
+
return false;
|
|
30303
|
+
}
|
|
29335
30304
|
async function takeOwedSnapshot(run, deps, logicalId, oldResource, secrets, isRetry) {
|
|
29336
30305
|
const recorded = isRetry ? run.supersededEntries.get(logicalId) : void 0;
|
|
29337
30306
|
const tracking = () => recorded !== void 0 ? "kept" : oldIdHeldByAnotherRecord(deps, logicalId, oldResource) ? "held" : "untracked";
|
|
@@ -32503,7 +33472,7 @@ function maskRestoredNoEchoRecord(record, baseline, substituted = []) {
|
|
|
32503
33472
|
const marked = noEchoLeavesOf(baseline) ?? [];
|
|
32504
33473
|
const names = declaredNoEchoAttributeNames(baseline);
|
|
32505
33474
|
if (marked.length === 0 && names.length === 0 && substituted.length === 0) return record;
|
|
32506
|
-
const echoes = (name, value) => value !== record.physicalId && substituted.some((leaf) => leaf.coordinate[0] === name && canonicalJson$
|
|
33475
|
+
const echoes = (name, value) => value !== record.physicalId && substituted.some((leaf) => leaf.coordinate[0] === name && canonicalJson$7(leaf.value) === canonicalJson$7(value));
|
|
32507
33476
|
let attributes = record.attributes;
|
|
32508
33477
|
if (attributes !== void 0 && attributes !== null && typeof attributes === "object") for (const [name, value] of Object.entries(attributes)) {
|
|
32509
33478
|
if (!names.includes(name) && !echoes(name, value)) continue;
|
|
@@ -32514,7 +33483,7 @@ function maskRestoredNoEchoRecord(record, baseline, substituted = []) {
|
|
|
32514
33483
|
const list = coordinate.findIndex((segment) => typeof segment === "number");
|
|
32515
33484
|
if (list < 0) return false;
|
|
32516
33485
|
const path = coordinate.slice(0, list);
|
|
32517
|
-
return canonicalJson$
|
|
33486
|
+
return canonicalJson$7(valueAtCoordinate(byIndex, path)) !== canonicalJson$7(valueAtCoordinate(baseline.properties, path));
|
|
32518
33487
|
});
|
|
32519
33488
|
const properties = reshaped.length === 0 ? byIndex : maskReadbackAtCoordinates(byIndex, baseline.properties, reshaped);
|
|
32520
33489
|
const widened = reshaped.map((coordinate) => readbackPathFor(byIndex, baseline.properties, coordinate)).filter((path, i) => path !== void 0 && path.length < reshaped[i].length);
|
|
@@ -33150,15 +34119,15 @@ async function createWithRollbackRetry(provider, create, logicalId, logger, isIn
|
|
|
33150
34119
|
isRetryable: outer.isRetryable
|
|
33151
34120
|
});
|
|
33152
34121
|
}
|
|
33153
|
-
function recordAfterRollbackUpdate(restored, result) {
|
|
33154
|
-
return withoutNoEchoValueMacs(withoutUnsettledProperties(recordAfterRollbackUpdateUnsettled(restored, result)));
|
|
34122
|
+
function recordAfterRollbackUpdate(restored, result, onDiffering) {
|
|
34123
|
+
return withoutNoEchoValueMacs(withoutUnsettledProperties(recordAfterRollbackUpdateUnsettled(restored, result, onDiffering)));
|
|
33155
34124
|
}
|
|
33156
34125
|
function withoutNoEchoValueMacs(record) {
|
|
33157
34126
|
if (record.noEchoValueMacs === void 0) return record;
|
|
33158
34127
|
const { noEchoValueMacs: _dropped, ...rest } = record;
|
|
33159
34128
|
return rest;
|
|
33160
34129
|
}
|
|
33161
|
-
function recordAfterRollbackUpdateUnsettled(restored, result) {
|
|
34130
|
+
function recordAfterRollbackUpdateUnsettled(restored, result, onDiffering) {
|
|
33162
34131
|
if (result === void 0) return restored;
|
|
33163
34132
|
const returned = result.attributes;
|
|
33164
34133
|
const replacedId = result.wasReplaced && typeof result.physicalId === "string" && result.physicalId !== "" ? result.physicalId : void 0;
|
|
@@ -33169,10 +34138,10 @@ function recordAfterRollbackUpdateUnsettled(restored, result) {
|
|
|
33169
34138
|
...returned === void 0 && idChanged ? withoutAttributes : restored,
|
|
33170
34139
|
...replacedId !== void 0 && { physicalId: replacedId },
|
|
33171
34140
|
...result.effectiveProperties && { properties: copyClaimingProviderBag(result.effectiveProperties) },
|
|
33172
|
-
...returned !== void 0 && { attributes: result.wasReplaced ? { ...returned } : {
|
|
34141
|
+
...returned !== void 0 && { attributes: result.wasReplaced ? { ...returned } : keepRecordedIdentity(restored.resourceType, restored.attributes, {
|
|
33173
34142
|
...restored.attributes,
|
|
33174
34143
|
...returned
|
|
33175
|
-
} }
|
|
34144
|
+
}, onDiffering) }
|
|
33176
34145
|
};
|
|
33177
34146
|
}
|
|
33178
34147
|
function recordedPropertiesAfterReplayCreate(restored, result) {
|
|
@@ -33205,6 +34174,7 @@ function buildReadCurrentStateContext(state, excludedLogicalId) {
|
|
|
33205
34174
|
const ownObserved = ownRecord("observedProperties");
|
|
33206
34175
|
return {
|
|
33207
34176
|
siblings,
|
|
34177
|
+
...isReadableResourceEntry(own) && own.provisionedBy === "cc-api" && { ccApiRead: true },
|
|
33208
34178
|
...ownAttributes && { attributes: ownAttributes },
|
|
33209
34179
|
...ownObserved && { driftBaseline: ownObserved }
|
|
33210
34180
|
};
|
|
@@ -33408,7 +34378,8 @@ async function replayRevert(s) {
|
|
|
33408
34378
|
...previousState,
|
|
33409
34379
|
physicalId: current.physicalId
|
|
33410
34380
|
} : previousState;
|
|
33411
|
-
|
|
34381
|
+
const revertedRecord = recordAfterRollbackUpdate(restoreBase, revertResult, identityWarner(logger, mask, op));
|
|
34382
|
+
stateResources[op.logicalId] = maskRestoredNoEchoRecord(redactRollbackRecord(await withRefreshedObservedBaseline(revertedRecord, {
|
|
33412
34383
|
provider,
|
|
33413
34384
|
op,
|
|
33414
34385
|
desiredProps,
|
|
@@ -33512,7 +34483,7 @@ async function recreateOldResource(s, r) {
|
|
|
33512
34483
|
...newCopyClaimed && { inlinePolicyClaimed: newCopyClaimed },
|
|
33513
34484
|
...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
|
|
33514
34485
|
deletionPolicy: replacementDeletePolicy(current.updateReplacePolicy),
|
|
33515
|
-
recordedAttributes: current.attributes,
|
|
34486
|
+
recordedAttributes: newCopyDeleteAttributes(op.resourceType, current.attributes, op.oldDeletedBeforeCreate, op.previousState?.attributes),
|
|
33516
34487
|
recordedCreateOnlyDrops: current.acceptedCreateOnlyDrops,
|
|
33517
34488
|
recordedNoEchoLeaves: current.noEchoLeaves,
|
|
33518
34489
|
recordedTypedPayloadLeaves: current.typedPayloadLeaves,
|
|
@@ -33671,7 +34642,7 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
|
|
|
33671
34642
|
...newCopyClaimed && { inlinePolicyClaimed: newCopyClaimed },
|
|
33672
34643
|
...finalSnapshotIdentifier !== void 0 && { finalSnapshotIdentifier },
|
|
33673
34644
|
deletionPolicy: replacementDeletePolicy(current.updateReplacePolicy),
|
|
33674
|
-
recordedAttributes: current.attributes,
|
|
34645
|
+
recordedAttributes: newCopyDeleteAttributes(op.resourceType, current.attributes, op.oldDeletedBeforeCreate, op.previousState?.attributes),
|
|
33675
34646
|
recordedCreateOnlyDrops: current.acceptedCreateOnlyDrops,
|
|
33676
34647
|
recordedNoEchoLeaves: current.noEchoLeaves,
|
|
33677
34648
|
recordedTypedPayloadLeaves: current.typedPayloadLeaves,
|
|
@@ -33796,16 +34767,26 @@ async function replayReverseReplacement(s) {
|
|
|
33796
34767
|
result.warnings++;
|
|
33797
34768
|
survivor = "exists";
|
|
33798
34769
|
}
|
|
34770
|
+
let identityUnverified = false;
|
|
34771
|
+
if (survivor === "identity-unverified") {
|
|
34772
|
+
identityUnverified = true;
|
|
34773
|
+
survivor = "exists";
|
|
34774
|
+
}
|
|
33799
34775
|
if (survivor === "exists" && op.oldResourceMaySurvive === "unconfirmed") throw survivorUnprovenRefusal(s, oldType, "maybe-deleting");
|
|
33800
34776
|
if (op.oldResourceMaySurvive === "deferred" && survivor !== "gone" && survivor !== "interrupted" && (survivor === "exists" || deferredDeleteStillPending(ctx.supersededResources, prev, oldType))) {
|
|
33801
34777
|
logger.info(safeMsg` Rollback: the old resource of ${safe(op.logicalId)} (${mask(String(prev.physicalId))}) was not deleted yet — re-adopting it`);
|
|
33802
|
-
|
|
34778
|
+
await replayReadopt(s, {});
|
|
34779
|
+
if (identityUnverified) warnUnverifiedSurvivor(s, oldType);
|
|
34780
|
+
if (survivor === "identity-uncompared" || survivor === "identity-unread") warnUnverifiedSurvivor(s, oldType, survivor);
|
|
34781
|
+
return;
|
|
33803
34782
|
}
|
|
33804
34783
|
if (survivor === "exists") {
|
|
33805
34784
|
const oldShown = refusalPhysicalId(mask(String(prev.physicalId)));
|
|
33806
34785
|
logger.warn(safeMsg` ⚠ Rollback: the old resource of ${shownLogicalId(op.logicalId)} (${oldShown}) still ` + "exists — the deploy's delete of it was not confirmed — so it is re-adopted instead of re-created. Part of it may have been removed before that delete failed: check it " + safeMsg`with ${cdkdRemedy("cdkd drift")} after the rollback.${describedPhysicalIdPointer(oldShown)}`);
|
|
33807
34786
|
result.warnings++;
|
|
33808
|
-
|
|
34787
|
+
await replayReadopt(s, { reason: `the old resource survived a delete that was refused or never sent during the deploy and was re-adopted instead of re-created; the provider may have run part of that delete, so check it with ${cdkdRemedy("cdkd drift")}` });
|
|
34788
|
+
if (identityUnverified) warnUnverifiedSurvivor(s, oldType);
|
|
34789
|
+
return;
|
|
33809
34790
|
}
|
|
33810
34791
|
if (survivor !== "gone") throw survivorUnprovenRefusal(s, oldType, survivor);
|
|
33811
34792
|
logger.info(safeMsg` Rollback: the old resource of ${safe(op.logicalId)} (${mask(String(prev.physicalId))}) is gone — re-creating it`);
|
|
@@ -33895,14 +34876,24 @@ async function replayReverseReplacement(s) {
|
|
|
33895
34876
|
const { createResult, deletedNewFirst } = await recreateOldResource(s, scope);
|
|
33896
34877
|
await finishReverseReplacement(s, scope, createResult, deletedNewFirst);
|
|
33897
34878
|
}
|
|
34879
|
+
function warnUnverifiedSurvivor(s, oldType, uncompared) {
|
|
34880
|
+
const { op, logger, mask } = s;
|
|
34881
|
+
const cause = uncompared === void 0 ? unverifiedIdentityCause(oldType, op.previousState?.attributes, refusalResourceType(oldType)) : uncomparedIdentityCause(oldType, uncompared);
|
|
34882
|
+
logger.warn(mask(safeMsg` ⚠ Rollback: cdkd could not prove that the resource AWS reports under the old id of ` + safeMsg`${shownLogicalId(op.logicalId)} is the one cdkd created ` + safeMsg`(${cause}), so it was re-adopted because AWS reports it` + (uncompared === void 0 ? "" : ` and state still lists it as awaiting its delete`) + `. If it is not this stack's, leave it alone and drop ` + safeMsg`its record after the rollback with ${stateOrphanRecordRemedy(void 0, String(op.logicalId))}.`));
|
|
34883
|
+
}
|
|
34884
|
+
function uncomparedIdentityCause(oldType, verdict) {
|
|
34885
|
+
const key = SURVIVOR_IDENTITY_ATTRIBUTES[oldType] ?? "identity";
|
|
34886
|
+
return verdict === "identity-unread" ? `the read of its ${key} failed, so cdkd could not compare it with the recorded one` : `cdkd could not compare it with the recorded ${key}: the recorded value is redacted, or the read could not name the resource`;
|
|
34887
|
+
}
|
|
33898
34888
|
function survivorUnprovenRefusal(s, oldType, verdict) {
|
|
33899
34889
|
const { op, ctx, mask } = s;
|
|
33900
34890
|
const remedy = orphanRemedy(op.logicalId, ctx);
|
|
33901
34891
|
const oldId = op.previousState?.physicalId;
|
|
33902
34892
|
const oldShown = hasAddressablePhysicalId({ physicalId: oldId }) ? refusalPhysicalId(mask(String(oldId))) : "no recorded id";
|
|
33903
34893
|
const rerun = rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback"));
|
|
33904
|
-
const
|
|
33905
|
-
|
|
34894
|
+
const identity = verdict === "identity-uncompared" || verdict === "identity-unread";
|
|
34895
|
+
const why = verdict === "identity-uncompared" ? `AWS reports a resource under that id, but ${uncomparedIdentityCause(oldType, verdict)}, so cdkd cannot tell whether it is the one this stack created; a re-run meets the same answer. Re-adopting another owner's resource would delete the new one` : verdict === "identity-unread" ? `AWS reports a resource under that id, but ${uncomparedIdentityCause(oldType, verdict)}; re-running ${rerun} reads it again. Re-adopting another owner's resource would delete the new one` : verdict === "free-unreadable" ? `nothing held that name when this rollback started, and its current state could not be read; re-running ${rerun} reads it again` : verdict === "vacated" ? `the name went free while this rollback read it (AWS reported it, then a second read found no bucket under it), so re-adopting it would delete the new resource for nothing; re-running ${rerun} reads it again` : verdict === "owner-unverified" ? `cdkd could not read whether it does, nor whether it belongs to this account (this account's bucket list could not be read; it needs s3:ListAllMyBuckets). Re-adopting another owner's bucket would delete the new one; re-running ${rerun} reads both again` : verdict === "unreadable" ? "cdkd has no read for this resource type that can tell whether it does. Re-creating it could duplicate it or collide with it" : verdict === "interrupted" ? `the rollback was interrupted before cdkd could read whether it does; re-running ${rerun} reads it` : verdict === "unknown" ? `cdkd could not read whether it does (the read failed or did not answer in time); re-running ${rerun} reads it again. Re-creating it could duplicate it or collide with it` : `AWS still reports it, but its failed delete may have been accepted and still be running, or only partly ran. Re-adopting it could leave neither resource once a running delete finishes, or one that delete already stripped; once AWS reports it gone, re-running ${rerun} re-creates it. A refused delete is not running, so waiting does not help: if its delete was refused, delete it by hand, then re-run ${rerun}`;
|
|
34896
|
+
return ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(oldType)}): ` + (identity || verdict === "vacated" || verdict === "free-unreadable" ? `the old resource (${oldShown}) cannot be proven the stack's: ${why}.` : `the deploy did not confirm that it deleted the old resource (${oldShown}), so it may still exist, and ${why}.`) + ` Nothing was sent and the journal is kept.` + (remedy.offered ? ` To keep the new resource in its place instead, re-run with the command below, ` + (identity || verdict === "vacated" || verdict === "free-unreadable" ? `and leave anything under the old id alone unless it is this stack's.` : `then delete the old resource by hand if it still exists.`) : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown)}` + remedy.line, "REPLACED_SURVIVOR_UNPROVEN")));
|
|
33906
34897
|
}
|
|
33907
34898
|
function foreignSurvivorRefusal(s, oldType, verdict) {
|
|
33908
34899
|
const { op, ctx, mask } = s;
|
|
@@ -34257,6 +35248,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
|
|
|
34257
35248
|
const secrets = /* @__PURE__ */ new Map();
|
|
34258
35249
|
const opMasker = createOpMasker(logger, secrets, ctx.logOnlyNeedlesFor?.(op.logicalId));
|
|
34259
35250
|
const mask = opMasker.mask;
|
|
35251
|
+
const warnIdentity = identityWarner(logger, mask, op);
|
|
34260
35252
|
const skipScope = {
|
|
34261
35253
|
ctx,
|
|
34262
35254
|
stackName,
|
|
@@ -34523,7 +35515,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
|
|
|
34523
35515
|
}
|
|
34524
35516
|
], op.logicalId, logger, options.isInterrupted, secrets, mask));
|
|
34525
35517
|
if (revertFailedResult) recordNoEchoAttributeValues(revertFailedResult, secrets, desiredProps);
|
|
34526
|
-
stateResources[op.logicalId] = maskRestoredNoEchoRecord(redactRollbackRecord(withNameGenerationReached(await withRefreshedObservedBaseline(recordAfterRollbackUpdate(prev, revertFailedResult), {
|
|
35518
|
+
stateResources[op.logicalId] = maskRestoredNoEchoRecord(redactRollbackRecord(withNameGenerationReached(await withRefreshedObservedBaseline(recordAfterRollbackUpdate(prev, revertFailedResult, warnIdentity), {
|
|
34527
35519
|
provider,
|
|
34528
35520
|
op,
|
|
34529
35521
|
desiredProps,
|
|
@@ -34745,6 +35737,11 @@ function cfnIngressPortValue(value) {
|
|
|
34745
35737
|
}
|
|
34746
35738
|
return NaN;
|
|
34747
35739
|
}
|
|
35740
|
+
const SG_RULE_ID_PATTERN = /^sgr-[0-9a-f]+$/;
|
|
35741
|
+
function recordedSgRuleId(attributes) {
|
|
35742
|
+
const recorded = attributes?.["Id"];
|
|
35743
|
+
return typeof recorded === "string" && SG_RULE_ID_PATTERN.test(recorded) ? recorded : void 0;
|
|
35744
|
+
}
|
|
34748
35745
|
|
|
34749
35746
|
// src/provisioning/sg-sibling-rules.ts
|
|
34750
35747
|
const RULE_TYPE = {
|
|
@@ -34791,11 +35788,12 @@ function sgRuleOwnershipIdentity(rule, direction) {
|
|
|
34791
35788
|
...PEER_KEYS[direction].map((key) => rule[key] ?? null)
|
|
34792
35789
|
]);
|
|
34793
35790
|
}
|
|
34794
|
-
function siblingOwnedSgRuleIdentities(groupId, direction, properties, context) {
|
|
35791
|
+
function siblingOwnedSgRuleIdentities(groupId, direction, properties, context, skip) {
|
|
34795
35792
|
const owned = /* @__PURE__ */ new Set();
|
|
34796
35793
|
if (typeof groupId !== "string" || groupId === "") return owned;
|
|
34797
|
-
for (const sibling of Object.
|
|
35794
|
+
for (const [lid, sibling] of Object.entries(context?.siblings ?? {})) {
|
|
34798
35795
|
if (sibling.resourceType !== RULE_TYPE[direction]) continue;
|
|
35796
|
+
if (skip?.(lid, sibling) === true) continue;
|
|
34799
35797
|
const props = sibling.properties;
|
|
34800
35798
|
if (!isPlainRecord$3(props) || props["GroupId"] !== groupId) continue;
|
|
34801
35799
|
const identity = sgRuleOwnershipIdentity(props, direction);
|
|
@@ -34809,6 +35807,64 @@ function siblingOwnedSgRuleIdentities(groupId, direction, properties, context) {
|
|
|
34809
35807
|
}
|
|
34810
35808
|
return owned;
|
|
34811
35809
|
}
|
|
35810
|
+
const INGRESS_IDENTITY_KEYS = [
|
|
35811
|
+
"IpProtocol",
|
|
35812
|
+
"FromPort",
|
|
35813
|
+
"ToPort",
|
|
35814
|
+
"CidrIp",
|
|
35815
|
+
"CidrIpv6",
|
|
35816
|
+
"SourceSecurityGroupId",
|
|
35817
|
+
"SourceSecurityGroupName",
|
|
35818
|
+
"SourceSecurityGroupOwnerId",
|
|
35819
|
+
"SourcePrefixListId"
|
|
35820
|
+
];
|
|
35821
|
+
function sgSiblingDecidedById(selfLogicalId, self, records, groupProperties) {
|
|
35822
|
+
if (!isPlainRecord$3(self)) return false;
|
|
35823
|
+
const direction = self.resourceType === RULE_TYPE.ingress ? "ingress" : self.resourceType === RULE_TYPE.egress ? "egress" : void 0;
|
|
35824
|
+
const props = self.properties;
|
|
35825
|
+
const id = recordedRuleIdOf(self);
|
|
35826
|
+
if (direction === void 0 || !isPlainRecord$3(props) || id === void 0) return false;
|
|
35827
|
+
const groupId = props["GroupId"];
|
|
35828
|
+
if (typeof groupId !== "string" || groupId === "") return false;
|
|
35829
|
+
if (INGRESS_IDENTITY_KEYS.some((key) => isRedactedRecordedValue(props[key]))) return false;
|
|
35830
|
+
if (props["SourceSecurityGroupName"] != null && props["SourceSecurityGroupId"] == null) return false;
|
|
35831
|
+
const identity = sgRuleOwnershipIdentity(props, direction);
|
|
35832
|
+
if (identity === void 0) return false;
|
|
35833
|
+
for (const [lid, other] of records) {
|
|
35834
|
+
if (lid === selfLogicalId || !isPlainRecord$3(other)) continue;
|
|
35835
|
+
if (other.resourceType !== RULE_TYPE[direction]) continue;
|
|
35836
|
+
const otherProps = other.properties;
|
|
35837
|
+
if (!isPlainRecord$3(otherProps) || otherProps["GroupId"] !== groupId) continue;
|
|
35838
|
+
if (recordedRuleIdOf(other) === id) return false;
|
|
35839
|
+
if (sgRuleOwnershipIdentity(otherProps, direction) === identity) return false;
|
|
35840
|
+
}
|
|
35841
|
+
const inline = groupProperties?.[LIST_KEY[direction]];
|
|
35842
|
+
if (Array.isArray(inline) && inline.some((e) => sgRuleOwnershipIdentity(e, direction) === identity)) return false;
|
|
35843
|
+
return true;
|
|
35844
|
+
}
|
|
35845
|
+
function skipSiblingsDecidedById(properties, context) {
|
|
35846
|
+
if (context?.ccApiRead === true) return void 0;
|
|
35847
|
+
const records = Object.entries(context?.siblings ?? {});
|
|
35848
|
+
return (lid, sibling) => sgSiblingDecidedById(lid, sibling, records, properties);
|
|
35849
|
+
}
|
|
35850
|
+
function recordedRuleIdOf(record) {
|
|
35851
|
+
return recordedSgRuleId(record.attributes) ?? (typeof record.physicalId === "string" && SG_RULE_ID_PATTERN.test(record.physicalId) ? record.physicalId : void 0);
|
|
35852
|
+
}
|
|
35853
|
+
function siblingRecordedSgRuleIds(groupId, records, direction) {
|
|
35854
|
+
const ids = /* @__PURE__ */ new Map();
|
|
35855
|
+
if (typeof groupId !== "string" || groupId === "" || records === void 0) return ids;
|
|
35856
|
+
for (const [, record] of records) {
|
|
35857
|
+
if (!isPlainRecord$3(record)) continue;
|
|
35858
|
+
const recordDirection = record.resourceType === RULE_TYPE.ingress ? "ingress" : record.resourceType === RULE_TYPE.egress ? "egress" : void 0;
|
|
35859
|
+
if (recordDirection === void 0) continue;
|
|
35860
|
+
if (direction !== void 0 && recordDirection !== direction) continue;
|
|
35861
|
+
const props = record.properties;
|
|
35862
|
+
if (!isPlainRecord$3(props) || props["GroupId"] !== groupId) continue;
|
|
35863
|
+
const id = recordedRuleIdOf(record);
|
|
35864
|
+
if (id !== void 0) ids.set(id, sgRuleOwnershipIdentity(props, recordDirection));
|
|
35865
|
+
}
|
|
35866
|
+
return ids;
|
|
35867
|
+
}
|
|
34812
35868
|
function withoutSiblingOwnedSgRules(rules, owned, direction) {
|
|
34813
35869
|
if (owned.size === 0) return [...rules];
|
|
34814
35870
|
return rules.filter((rule) => {
|
|
@@ -34828,19 +35884,20 @@ function stripSiblingOwnedSgRules(resourceType, physicalId, baseline, aws, prope
|
|
|
34828
35884
|
for (const direction of ["ingress", "egress"]) {
|
|
34829
35885
|
const owned = siblingOwnedSgRuleIdentities(physicalId, direction, properties, context);
|
|
34830
35886
|
if (owned.size === 0) continue;
|
|
35887
|
+
const liveOwned = siblingOwnedSgRuleIdentities(physicalId, direction, properties, context, skipSiblingsDecidedById(properties, context));
|
|
34831
35888
|
const key = LIST_KEY[direction];
|
|
34832
|
-
const strip = (bag) => {
|
|
35889
|
+
const strip = (bag, drop) => {
|
|
34833
35890
|
const list = bag[key];
|
|
34834
|
-
if (!Array.isArray(list)) return bag;
|
|
34835
|
-
const kept = withoutSiblingOwnedSgRules(list,
|
|
35891
|
+
if (!Array.isArray(list) || drop.size === 0) return bag;
|
|
35892
|
+
const kept = withoutSiblingOwnedSgRules(list, drop, direction);
|
|
34836
35893
|
return kept.length === list.length ? bag : {
|
|
34837
35894
|
...bag,
|
|
34838
35895
|
[key]: kept
|
|
34839
35896
|
};
|
|
34840
35897
|
};
|
|
34841
35898
|
out = {
|
|
34842
|
-
baseline: strip(out.baseline),
|
|
34843
|
-
aws: strip(out.aws)
|
|
35899
|
+
baseline: strip(out.baseline, owned),
|
|
35900
|
+
aws: strip(out.aws, liveOwned)
|
|
34844
35901
|
};
|
|
34845
35902
|
}
|
|
34846
35903
|
return out;
|
|
@@ -35187,7 +36244,7 @@ function helperOwnedLists(resourceType, physicalId, properties, context) {
|
|
|
35187
36244
|
if (resourceType === "AWS::EC2::SecurityGroup") for (const [key, direction] of [["SecurityGroupIngress", "ingress"], ["SecurityGroupEgress", "egress"]]) out.push({
|
|
35188
36245
|
key,
|
|
35189
36246
|
keyOf: (m) => sgRuleOwnershipIdentity(m, direction),
|
|
35190
|
-
owned: siblingOwnedSgRuleIdentities(physicalId, direction, properties, context)
|
|
36247
|
+
owned: siblingOwnedSgRuleIdentities(physicalId, direction, properties, context, skipSiblingsDecidedById(properties, context))
|
|
35191
36248
|
});
|
|
35192
36249
|
return out.filter((l) => l.owned.size > 0);
|
|
35193
36250
|
}
|
|
@@ -38033,22 +39090,22 @@ function sameJournaledOrphans(a, b) {
|
|
|
38033
39090
|
}
|
|
38034
39091
|
|
|
38035
39092
|
// src/provisioning/nested-stack-context.ts
|
|
38036
|
-
const storage = new AsyncLocalStorage();
|
|
39093
|
+
const storage$1 = new AsyncLocalStorage();
|
|
38037
39094
|
function withNestedStackContext(ctx, fn) {
|
|
38038
|
-
return storage.run(ctx, fn);
|
|
39095
|
+
return storage$1.run(ctx, fn);
|
|
38039
39096
|
}
|
|
38040
39097
|
function getCurrentNestedStackContext() {
|
|
38041
|
-
return storage.getStore();
|
|
39098
|
+
return storage$1.getStore();
|
|
38042
39099
|
}
|
|
38043
39100
|
async function collectNestedChildUnaddressed(fn) {
|
|
38044
|
-
const ctx = storage.getStore();
|
|
39101
|
+
const ctx = storage$1.getStore();
|
|
38045
39102
|
if (!ctx) return {
|
|
38046
39103
|
value: await fn(),
|
|
38047
39104
|
unaddressed: void 0
|
|
38048
39105
|
};
|
|
38049
39106
|
const slot = {};
|
|
38050
39107
|
return {
|
|
38051
|
-
value: await storage.run({
|
|
39108
|
+
value: await storage$1.run({
|
|
38052
39109
|
...ctx,
|
|
38053
39110
|
childUnaddressed: slot
|
|
38054
39111
|
}, fn),
|
|
@@ -39408,6 +40465,7 @@ var GeneratedNameMismatchError = class extends Error {
|
|
|
39408
40465
|
function provenNothingCreated(error, logicalId, resourceType) {
|
|
39409
40466
|
if (createdBeforeFailure(error, logicalId, resourceType) !== void 0) return false;
|
|
39410
40467
|
if (isAmbiguousOutcomeError(error) || isThrottlingError(error)) return false;
|
|
40468
|
+
if (isNameCollisionErrorFrom(error, logicalId)) return false;
|
|
39411
40469
|
let current = error;
|
|
39412
40470
|
for (let depth = 0; depth < 8 && current !== null && typeof current === "object"; depth++) {
|
|
39413
40471
|
const status = current.$metadata?.httpStatusCode;
|
|
@@ -39955,6 +41013,15 @@ function formatResourceLine(op, logicalId, resourceType, verbOverride) {
|
|
|
39955
41013
|
}
|
|
39956
41014
|
}
|
|
39957
41015
|
|
|
41016
|
+
// src/provisioning/licensed-name-holder.ts
|
|
41017
|
+
const storage = new AsyncLocalStorage();
|
|
41018
|
+
function withLicensedNameHolder(holder, fn) {
|
|
41019
|
+
return storage.run({ holder }, fn);
|
|
41020
|
+
}
|
|
41021
|
+
function licensedNameHolder() {
|
|
41022
|
+
return storage.getStore()?.holder;
|
|
41023
|
+
}
|
|
41024
|
+
|
|
39958
41025
|
// src/deployment/deploy-engine/update/noecho-macs.ts
|
|
39959
41026
|
function covers(coordinate, key, leafPath) {
|
|
39960
41027
|
if (coordinate[0] !== key) return false;
|
|
@@ -40187,7 +41254,7 @@ async function provisionCreate(engine, logicalId, change, stateResources, stackN
|
|
|
40187
41254
|
engine.generatedNameGuard?.noteSent(logicalId);
|
|
40188
41255
|
result = resumed;
|
|
40189
41256
|
} else {
|
|
40190
|
-
await refuseUnlicensedGeneratedName(engine, {
|
|
41257
|
+
const licensedHolder = await refuseUnlicensedGeneratedName(engine, {
|
|
40191
41258
|
logicalId,
|
|
40192
41259
|
resourceType,
|
|
40193
41260
|
stackName,
|
|
@@ -40206,10 +41273,10 @@ async function provisionCreate(engine, logicalId, change, stateResources, stackN
|
|
|
40206
41273
|
});
|
|
40207
41274
|
engine.generatedNameGuard?.noteSent(logicalId);
|
|
40208
41275
|
try {
|
|
40209
|
-
result = await engine.withRetry(() => withCurrentResourceSecrets(createSecrets, () => createProvider.create(logicalId, resourceType, createProps, {
|
|
41276
|
+
result = await engine.withRetry(() => withCurrentResourceSecrets(createSecrets, () => withLicensedNameHolder(licensedHolder, () => createProvider.create(logicalId, resourceType, createProps, {
|
|
40210
41277
|
maskSecrets: createSecretMasker(createSecrets),
|
|
40211
41278
|
...typedPayloadLeaves !== void 0 && { typedPayloadLeaves }
|
|
40212
|
-
})), logicalId, void 0, void 0, createProvider);
|
|
41279
|
+
}))), logicalId, void 0, void 0, createProvider);
|
|
40213
41280
|
} catch (error) {
|
|
40214
41281
|
engine.generatedNameGuard?.noteFailed(logicalId, error);
|
|
40215
41282
|
throw error;
|
|
@@ -40254,11 +41321,11 @@ async function provisionCreate(engine, logicalId, change, stateResources, stackN
|
|
|
40254
41321
|
async function guardedReplacementCreate(engine, input, create) {
|
|
40255
41322
|
const guard = engine.generatedNameGuard;
|
|
40256
41323
|
if (input.keepsName === true || guard?.candidate(input.logicalId) === void 0) return create();
|
|
40257
|
-
await refuseUnlicensedGeneratedName(engine, input);
|
|
41324
|
+
const licensedHolder = await refuseUnlicensedGeneratedName(engine, input);
|
|
40258
41325
|
guard.noteSent(input.logicalId);
|
|
40259
41326
|
let result;
|
|
40260
41327
|
try {
|
|
40261
|
-
result = await create
|
|
41328
|
+
result = await withLicensedNameHolder(licensedHolder, create);
|
|
40262
41329
|
} catch (error) {
|
|
40263
41330
|
guard.noteFailed(input.logicalId, error);
|
|
40264
41331
|
throw error;
|
|
@@ -40275,13 +41342,14 @@ async function refuseUnlicensedGeneratedName(engine, input) {
|
|
|
40275
41342
|
const subject = `${displaySafe(logicalId)} (${displaySafe(resourceType)})`;
|
|
40276
41343
|
const checked = engine.generatedNameGuard.candidate(logicalId) ?? asked;
|
|
40277
41344
|
const named = `the cdkd-generated ${checked.property ?? "name"} ${displaySafe(checked.name)}`;
|
|
40278
|
-
const
|
|
41345
|
+
const refusesItself = resourceType === "AWS::Logs::LogGroup";
|
|
41346
|
+
const adoptsText = refusesItself ? `cdkd checks a log group's name before its create, as CloudFormation refuses a taken one` : "its create API hands back or overwrites an existing resource of that name instead of refusing it";
|
|
40279
41347
|
const refuse = (message) => {
|
|
40280
41348
|
throw markNonRetryable(markRefusedBeforeApplying(new CdkdError(message, "GENERATED_NAME_HELD")));
|
|
40281
41349
|
};
|
|
40282
41350
|
switch (verdict.kind) {
|
|
40283
|
-
case "free":
|
|
40284
|
-
case "licensed": return;
|
|
41351
|
+
case "free": return;
|
|
41352
|
+
case "licensed": return verdict.holder;
|
|
40285
41353
|
case "unchecked":
|
|
40286
41354
|
engine.logger.warn(safeMsg`${subject} is created with ${named} without checking whether another resource already ` + safeMsg`holds it: the lookup was refused (${describeAwsFailure(verdict.error).summary}). ` + "Grant this identity the type's Describe / List permission to have cdkd refuse taking over another deployment's resource.");
|
|
40287
41355
|
return;
|
|
@@ -40302,9 +41370,9 @@ async function refuseUnlicensedGeneratedName(engine, input) {
|
|
|
40302
41370
|
}], recoveryCommandFlags(engine.options.refusalRecovery).flags).command, "`")}`;
|
|
40303
41371
|
if (verdict.ownIntent !== void 0) {
|
|
40304
41372
|
const why = verdict.ownIntent === "abandoned" ? "a deploy of this stack that was killed or force-unlocked" : "a create of this stack that came back failed (a timeout or a server error)";
|
|
40305
|
-
return refuse(`${subject} would be created with ${named}, which an existing resource (${displaySafe(verdict.holder)}) already holds. This stack's create-token ledger records that ${why} sent this name, but this type reports no creation time, so cdkd cannot tell that resource is the one it made rather than another deployment's created since. Since ${adoptsText}, creating it would take that resource over.
|
|
41373
|
+
return refuse(`${subject} would be created with ${named}, which an existing resource (${displaySafe(verdict.holder)}) already holds. This stack's create-token ledger records that ${why} sent this name, but this type reports no creation time, so cdkd cannot tell that resource is the one it made rather than another deployment's created since. ` + (refusesItself ? "" : `Since ${adoptsText}, creating it would take that resource over. `) + `${displaySafe(logicalId)} was not created. The likely cause: the resource is this stack's own, from that deploy. If it is, ${importLine} and re-run; if it is not, this stack is also deployed under another state backend.`);
|
|
40306
41374
|
}
|
|
40307
|
-
return refuse(`${subject} would be created with ${named}, which an existing resource (${displaySafe(verdict.holder)}) already holds, and nothing this stack records names that resource: not its state, its rollback journal or create-token ledger, nor what a destroy of it under this state prefix kept. Since ${adoptsText}, creating it would take that resource over, as CloudFormation refuses with "already exists".
|
|
41375
|
+
return refuse(`${subject} would be created with ${named}, which an existing resource (${displaySafe(verdict.holder)}) already holds, and nothing this stack records names that resource: not its state, its rollback journal or create-token ledger, nor what a destroy of it under this state prefix kept. ` + (refusesItself ? `CloudFormation refuses it with "already exists". ` : `Since ${adoptsText}, creating it would take that resource over, as CloudFormation refuses with "already exists". `) + `${displaySafe(logicalId)} was not created. The likely cause: this stack is also deployed under another state backend (another --state-prefix, --state-bucket or account), where cdkd generates the same names. One stack name per account and region is supported: deploy it under one backend only, or give this stack another name. If the resource is this stack's own, ${importLine} and re-run.`);
|
|
40308
41376
|
}
|
|
40309
41377
|
}
|
|
40310
41378
|
}
|
|
@@ -40322,7 +41390,8 @@ async function refuseTakenCreateName(engine, input) {
|
|
|
40322
41390
|
const shown = (value) => displaySafe(maskName(value));
|
|
40323
41391
|
const subject = `${displaySafe(logicalId)} (${displaySafe(resourceType)})`;
|
|
40324
41392
|
const named = `${question.property} ${shown(question.desiredName)}`;
|
|
40325
|
-
const
|
|
41393
|
+
const refusesItself = resourceType === "AWS::Logs::LogGroup";
|
|
41394
|
+
const adoptsText = refusesItself ? `cdkd checks a log group's name before its create, as CloudFormation refuses a taken one` : "its create API hands back or overwrites an existing resource of that name instead of refusing it";
|
|
40326
41395
|
const refuse = (message, cause, redactedCause = false) => {
|
|
40327
41396
|
const refusal = new CdkdError(maskName(message), "NAMED_CREATE_COLLISION", cause instanceof Error ? cause : void 0);
|
|
40328
41397
|
throw markNonRetryable(markRefusedBeforeApplying(redactedCause && cause instanceof Error ? markRedactedCause(refusal) : refusal));
|
|
@@ -40358,7 +41427,7 @@ async function refuseTakenCreateName(engine, input) {
|
|
|
40358
41427
|
if (found === null) return;
|
|
40359
41428
|
const holderId = found.physicalId;
|
|
40360
41429
|
const ownHolder = Object.entries(input.stateResources).find(([otherId, record]) => otherId !== logicalId && record.resourceType === resourceType && probeFoundSameId(resourceType, record.physicalId, holderId));
|
|
40361
|
-
if (ownHolder !== void 0) return refuse(`${subject} is created with ${named}, which this stack's ${displaySafe(ownHolder[0])} (${shown(holderId)}) already holds — a construct moved or renamed keeps its explicit name under a new logical id. Since ${adoptsText}, the create would hand back that resource and the removal of ${displaySafe(ownHolder[0])} would then delete it. Nothing was created. Give the new resource another name, or deploy the removal of ${displaySafe(ownHolder[0])} first. Do not delete or import that resource: it is already this stack's.`);
|
|
41430
|
+
if (ownHolder !== void 0) return refuse(`${subject} is created with ${named}, which this stack's ${displaySafe(ownHolder[0])} (${shown(holderId)}) already holds — a construct moved or renamed keeps its explicit name under a new logical id. ` + (refusesItself ? "" : `Since ${adoptsText}, the create would hand back that resource and the removal of ${displaySafe(ownHolder[0])} would then delete it. `) + `Nothing was created. Give the new resource another name, or deploy the removal of ${displaySafe(ownHolder[0])} first. Do not delete or import that resource: it is already this stack's.`);
|
|
40362
41431
|
const ownCase = "if the resource is this stack's own (left by an earlier interrupted deploy, or kept by an earlier `cdkd destroy` under DeletionPolicy: Retain)";
|
|
40363
41432
|
const built = input.stackName.includes("~") || resourceType === "AWS::S3::Bucket" ? void 0 : pasteableCommand("cdkd import", [{
|
|
40364
41433
|
value: input.stackName,
|
|
@@ -40371,7 +41440,7 @@ async function refuseTakenCreateName(engine, input) {
|
|
|
40371
41440
|
const adopt = built !== void 0 && maskName(built.command) === built.command ? built : void 0;
|
|
40372
41441
|
const ownRemedy = input.stackName.includes("~") ? `${ownCase}, delete it and re-run.` : adopt !== void 0 ? `${ownCase}, delete it, or adopt it with ${proseQuoted(cdkdRemedy("cdkd import"), "`")} using the command below and re-run.` : `${ownCase}, delete it or adopt it with ${proseQuoted(cdkdRemedy("cdkd import"), "`")} and re-run.`;
|
|
40373
41442
|
const holeNote = adopt === void 0 || adopt.withheld.length === 0 ? "" : " The command below prints a quoted hole in place of a value cdkd will not name on a command line; replace it whole, quotes included, with your stack name or '<logicalId>=<physicalId>', shell-quoted.";
|
|
40374
|
-
return refuse(`${subject} is created with ${named}, and an existing resource (${shown(holderId)}) already holds that name. Since ${adoptsText}, creating it would take that resource over and record it as this stack's, for a later \`cdkd destroy\` to delete. Nothing was created. Choose a name no other resource holds; ` + ownRemedy + holeNote + (adopt === void 0 ? "" : `
|
|
41443
|
+
return refuse(`${subject} is created with ${named}, and an existing resource (${shown(holderId)}) already holds that name. ` + (refusesItself ? `A log group's create refuses a taken name, as CloudFormation's does. ` : `Since ${adoptsText}, creating it would take that resource over and record it as this stack's, for a later \`cdkd destroy\` to delete. `) + `Nothing was created. Choose a name no other resource holds; ` + ownRemedy + holeNote + (adopt === void 0 ? "" : `
|
|
40375
41444
|
CONFIRM IT IS YOURS FIRST: another stack or app may own a resource of that name, and adopting it hands that resource to this stack's \`cdkd destroy\`.\nAdopt with: ${adopt.command}`));
|
|
40376
41445
|
}
|
|
40377
41446
|
async function resumeAbandonedCreate(engine, args) {
|
|
@@ -40979,6 +42048,8 @@ async function retryCarriedSupersededResources(engine, host, carried, resources,
|
|
|
40979
42048
|
maskSecrets: createSecretMasker(bag),
|
|
40980
42049
|
stop: () => engine.interrupted,
|
|
40981
42050
|
once: options.waitInUse !== true,
|
|
42051
|
+
holderProvider: () => engine.providerRegistry.getProvider(resourceType),
|
|
42052
|
+
warn: (message) => engine.logger.warn(safeMsg` ⚠ Old ${logicalId} (${physicalId}): ${message}`),
|
|
40982
42053
|
preDeleteSnapshot: {
|
|
40983
42054
|
clients: engine.options.finalSnapshotClients ?? getAwsClients(),
|
|
40984
42055
|
logger: {
|
|
@@ -41004,6 +42075,14 @@ async function retryCarriedSupersededResources(engine, host, carried, resources,
|
|
|
41004
42075
|
}
|
|
41005
42076
|
removeSuperseded(host, entry);
|
|
41006
42077
|
changed = true;
|
|
42078
|
+
if (outcome.kind === "gone") {
|
|
42079
|
+
engine.logger.info(safeMsg` ${green("✓")} Old ${logicalId} (${physicalId}) is already gone; no delete was sent`);
|
|
42080
|
+
return;
|
|
42081
|
+
}
|
|
42082
|
+
if (outcome.kind === "notOurs") {
|
|
42083
|
+
engine.logger.warn(safeMsg` ⚠ Old ${logicalId} (${physicalId}) was not deleted: ${outcome.cause}. The replaced resource is gone, and cdkd no longer tracks it in state.`);
|
|
42084
|
+
return;
|
|
42085
|
+
}
|
|
41007
42086
|
if (outcome.kind === "notDeleted") {
|
|
41008
42087
|
engine.logger.warn(safeMsg` ⚠ ${deleteSkippedMessage(logicalId, physicalId, outcome.reason, "while cleaning up the superseded resource", { commandFreeLine: true })}. Delete it manually — it is no longer tracked in state.`);
|
|
41009
42088
|
return;
|
|
@@ -44712,6 +45791,136 @@ function protectedDeleteMessage(logicalId, shownTable, regions, stackDestroy, al
|
|
|
44712
45791
|
return safeMsg`DynamoDB GlobalTable ${logicalId} (${shownTable}) has deletion protection enabled in ${regions.join(", ")}; ` + `${changed} ${remedy}`;
|
|
44713
45792
|
}
|
|
44714
45793
|
|
|
45794
|
+
// src/provisioning/tags-own-write-baseline.ts
|
|
45795
|
+
const TAGS_BASELINE_REREAD_DELAYS_MS = [
|
|
45796
|
+
500,
|
|
45797
|
+
1e3,
|
|
45798
|
+
2e3,
|
|
45799
|
+
4e3
|
|
45800
|
+
];
|
|
45801
|
+
const tagWrites = /* @__PURE__ */ new Map();
|
|
45802
|
+
function recordTagWrite(resourceType, id, set, removed) {
|
|
45803
|
+
let byId = tagWrites.get(resourceType);
|
|
45804
|
+
if (byId === void 0) {
|
|
45805
|
+
byId = /* @__PURE__ */ new Map();
|
|
45806
|
+
tagWrites.set(resourceType, byId);
|
|
45807
|
+
}
|
|
45808
|
+
const write = byId.get(id) ?? {
|
|
45809
|
+
set: /* @__PURE__ */ new Map(),
|
|
45810
|
+
removed: /* @__PURE__ */ new Set()
|
|
45811
|
+
};
|
|
45812
|
+
for (const key of removed) {
|
|
45813
|
+
write.set.delete(key);
|
|
45814
|
+
write.removed.add(key);
|
|
45815
|
+
}
|
|
45816
|
+
for (const [key, value] of set) {
|
|
45817
|
+
write.removed.delete(key);
|
|
45818
|
+
write.set.set(key, value);
|
|
45819
|
+
}
|
|
45820
|
+
byId.set(id, write);
|
|
45821
|
+
}
|
|
45822
|
+
function takeTagWrite(resourceType, id) {
|
|
45823
|
+
const byId = tagWrites.get(resourceType);
|
|
45824
|
+
const write = byId?.get(id);
|
|
45825
|
+
byId?.delete(id);
|
|
45826
|
+
return write;
|
|
45827
|
+
}
|
|
45828
|
+
function clearTagWrites(resourceType, owned) {
|
|
45829
|
+
const byId = tagWrites.get(resourceType);
|
|
45830
|
+
if (byId === void 0) return;
|
|
45831
|
+
for (const id of byId.keys()) if (owned(id)) byId.delete(id);
|
|
45832
|
+
}
|
|
45833
|
+
function isDynamoDBTableArnIn(arn, tableName, regions) {
|
|
45834
|
+
const parts = arn.split(":");
|
|
45835
|
+
return parts.length === 6 && parts[2] === "dynamodb" && regions.has(parts[3] ?? "") && parts[5] === `table/${tableName}`;
|
|
45836
|
+
}
|
|
45837
|
+
function tagsShowWrite(read, write) {
|
|
45838
|
+
if (!Array.isArray(read)) return false;
|
|
45839
|
+
const live = /* @__PURE__ */ new Map();
|
|
45840
|
+
for (const entry of read) {
|
|
45841
|
+
if (typeof entry !== "object" || entry === null) return false;
|
|
45842
|
+
const { Key: key, Value: value } = entry;
|
|
45843
|
+
if (typeof key !== "string") return false;
|
|
45844
|
+
live.set(key, value);
|
|
45845
|
+
}
|
|
45846
|
+
for (const [key, value] of write.set) if (live.get(key) !== value) return false;
|
|
45847
|
+
for (const key of write.removed) if (live.has(key)) return false;
|
|
45848
|
+
return true;
|
|
45849
|
+
}
|
|
45850
|
+
function overlayTagWrite(read, write) {
|
|
45851
|
+
const seen = /* @__PURE__ */ new Set();
|
|
45852
|
+
const out = [];
|
|
45853
|
+
for (const tag of read) {
|
|
45854
|
+
if (write.removed.has(tag.Key) || seen.has(tag.Key)) continue;
|
|
45855
|
+
seen.add(tag.Key);
|
|
45856
|
+
const value = write.set.get(tag.Key);
|
|
45857
|
+
out.push(value === void 0 ? tag : {
|
|
45858
|
+
Key: tag.Key,
|
|
45859
|
+
Value: value
|
|
45860
|
+
});
|
|
45861
|
+
}
|
|
45862
|
+
for (const [Key, Value] of write.set) if (!seen.has(Key)) out.push({
|
|
45863
|
+
Key,
|
|
45864
|
+
Value
|
|
45865
|
+
});
|
|
45866
|
+
return out;
|
|
45867
|
+
}
|
|
45868
|
+
async function settleWrittenTags(first, reRead, write, delaysMs, onUnsettled, terminal = () => false) {
|
|
45869
|
+
let newest;
|
|
45870
|
+
let firstError;
|
|
45871
|
+
let answered = false;
|
|
45872
|
+
const take = (answer) => {
|
|
45873
|
+
if (terminal(answer) || tagsShowWrite(answer, write)) return true;
|
|
45874
|
+
newest = answer;
|
|
45875
|
+
return false;
|
|
45876
|
+
};
|
|
45877
|
+
try {
|
|
45878
|
+
const answer = await first();
|
|
45879
|
+
answered = true;
|
|
45880
|
+
if (take(answer)) return answer;
|
|
45881
|
+
} catch (err) {
|
|
45882
|
+
if (memberReadFailure(err) === "refused") throw err;
|
|
45883
|
+
firstError = err;
|
|
45884
|
+
}
|
|
45885
|
+
for (const delayMs of delaysMs) {
|
|
45886
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
45887
|
+
let answer;
|
|
45888
|
+
try {
|
|
45889
|
+
answer = await reRead();
|
|
45890
|
+
} catch (err) {
|
|
45891
|
+
if (!answered && memberReadFailure(err) === "failed") continue;
|
|
45892
|
+
break;
|
|
45893
|
+
}
|
|
45894
|
+
answered = true;
|
|
45895
|
+
if (take(answer)) return answer;
|
|
45896
|
+
}
|
|
45897
|
+
if (newest === void 0) throw firstError;
|
|
45898
|
+
onUnsettled();
|
|
45899
|
+
return overlayTagWrite(newest, write);
|
|
45900
|
+
}
|
|
45901
|
+
function declaredTagsReadback(desired) {
|
|
45902
|
+
const read = readTagList(desired, "desired");
|
|
45903
|
+
if (read.kind !== "tags") return void 0;
|
|
45904
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
45905
|
+
for (const tag of read.tags) byKey.set(tag.Key, tag.Value);
|
|
45906
|
+
return [...byKey].filter(([key]) => !key.startsWith("aws:")).map(([Key, Value]) => ({
|
|
45907
|
+
Key,
|
|
45908
|
+
Value
|
|
45909
|
+
}));
|
|
45910
|
+
}
|
|
45911
|
+
function tagsMatchDeclared(read, declared) {
|
|
45912
|
+
if (!Array.isArray(read)) return false;
|
|
45913
|
+
const live = /* @__PURE__ */ new Map();
|
|
45914
|
+
for (const entry of read) {
|
|
45915
|
+
if (typeof entry !== "object" || entry === null) return false;
|
|
45916
|
+
const { Key: key, Value: value } = entry;
|
|
45917
|
+
if (typeof key !== "string") return false;
|
|
45918
|
+
if (!key.startsWith("aws:")) live.set(key, value);
|
|
45919
|
+
}
|
|
45920
|
+
const want = declared.filter((t) => !t.Key.startsWith("aws:"));
|
|
45921
|
+
return live.size === want.length && want.every((t) => live.get(t.Key) === t.Value);
|
|
45922
|
+
}
|
|
45923
|
+
|
|
44715
45924
|
// src/provisioning/providers/dynamodb-globaltable/update-plan.ts
|
|
44716
45925
|
async function updatePhasePlan(scope) {
|
|
44717
45926
|
const { physicalId, logicalId, maskSecrets, currentRegion, properties, previousProperties, context, warn, resourceType, log } = scope;
|
|
@@ -45365,6 +46574,8 @@ async function updatePhaseIndexes(scope) {
|
|
|
45365
46574
|
|
|
45366
46575
|
// src/provisioning/providers/dynamodb-globaltable/update.ts
|
|
45367
46576
|
async function update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
46577
|
+
const replicaRegions = /* @__PURE__ */ new Set([...declaredReplicaRegions(properties), ...declaredReplicaRegions(previousProperties)]);
|
|
46578
|
+
clearTagWrites("AWS::DynamoDB::GlobalTable", (arn) => isDynamoDBTableArnIn(arn, physicalId, replicaRegions));
|
|
45368
46579
|
return unsettledScope.run({
|
|
45369
46580
|
mark: (key) => context?.markUnsettled?.(key),
|
|
45370
46581
|
unsettled: context?.unsettledProperties ?? /* @__PURE__ */ new Set(),
|
|
@@ -45595,6 +46806,7 @@ async function applyTagDiffOnClient(client, tableArn, resourceType, id, oldTagsR
|
|
|
45595
46806
|
ResourceArn: tableArn,
|
|
45596
46807
|
TagKeys: tagsToRemove
|
|
45597
46808
|
}));
|
|
46809
|
+
recordTagWrite("AWS::DynamoDB::GlobalTable", tableArn, [], tagsToRemove);
|
|
45598
46810
|
this.logger.debug(maskSecrets(`Removed ${tagsToRemove.length} tag(s) from DynamoDB GlobalTable ${tableArn}`));
|
|
45599
46811
|
}
|
|
45600
46812
|
if (tagsToAdd.length > 0) {
|
|
@@ -45602,6 +46814,7 @@ async function applyTagDiffOnClient(client, tableArn, resourceType, id, oldTagsR
|
|
|
45602
46814
|
ResourceArn: tableArn,
|
|
45603
46815
|
Tags: tagsToAdd
|
|
45604
46816
|
}));
|
|
46817
|
+
recordTagWrite("AWS::DynamoDB::GlobalTable", tableArn, tagsToAdd.map((t) => [t.Key, t.Value]), []);
|
|
45605
46818
|
if (region !== void 0 && REGION_SEGMENT.test(region)) {
|
|
45606
46819
|
let recordedKeys;
|
|
45607
46820
|
try {
|
|
@@ -45614,6 +46827,14 @@ async function applyTagDiffOnClient(client, tableArn, resourceType, id, oldTagsR
|
|
|
45614
46827
|
this.logger.debug(maskSecrets(`Added/updated ${tagsToAdd.length} tag(s) on DynamoDB GlobalTable ${tableArn}`));
|
|
45615
46828
|
}
|
|
45616
46829
|
}
|
|
46830
|
+
function declaredReplicaRegions(bag) {
|
|
46831
|
+
const replicas = bag["Replicas"];
|
|
46832
|
+
if (!Array.isArray(replicas)) return [];
|
|
46833
|
+
return replicas.flatMap((r) => {
|
|
46834
|
+
const region = typeof r === "object" && r !== null ? r["Region"] : void 0;
|
|
46835
|
+
return typeof region === "string" ? [region] : [];
|
|
46836
|
+
});
|
|
46837
|
+
}
|
|
45617
46838
|
|
|
45618
46839
|
// src/provisioning/providers/dynamodb-globaltable/autoscaling.ts
|
|
45619
46840
|
async function applyAutoScalingDiff(tableName, dimension, oldSettings, newSettings, client, indexName, budget, maskSecrets = (text) => text, progress) {
|
|
@@ -46068,6 +47289,344 @@ async function deleteGlobalTableResource(logicalId, physicalId, resourceType, co
|
|
|
46068
47289
|
}
|
|
46069
47290
|
}
|
|
46070
47291
|
|
|
47292
|
+
// src/provisioning/dynamodb-stream-members.ts
|
|
47293
|
+
const STREAM_SPECIFICATION_KEY = "StreamSpecification";
|
|
47294
|
+
const STREAM_POLICY_KEY = "ResourcePolicy";
|
|
47295
|
+
const STREAM_TAGS_KEY = "Tags";
|
|
47296
|
+
const POLICY_PATH = `${STREAM_SPECIFICATION_KEY}.${STREAM_POLICY_KEY}`;
|
|
47297
|
+
const TAGS_PATH = `${STREAM_SPECIFICATION_KEY}.${STREAM_TAGS_KEY}`;
|
|
47298
|
+
function isPlainObject$2(value) {
|
|
47299
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
47300
|
+
}
|
|
47301
|
+
function refusalOf(guard) {
|
|
47302
|
+
try {
|
|
47303
|
+
guard();
|
|
47304
|
+
return;
|
|
47305
|
+
} catch (error) {
|
|
47306
|
+
return describeAwsFailure(error).detail;
|
|
47307
|
+
}
|
|
47308
|
+
}
|
|
47309
|
+
function blockMembers(block) {
|
|
47310
|
+
return isPlainObject$2(block) ? block : {};
|
|
47311
|
+
}
|
|
47312
|
+
function readStreamPolicy(block) {
|
|
47313
|
+
const value = blockMembers(block)[STREAM_POLICY_KEY];
|
|
47314
|
+
if (value === void 0 || value === null) return { kind: "absent" };
|
|
47315
|
+
const containerRefusal = refusalOf(() => requireConfigObject(value, POLICY_PATH));
|
|
47316
|
+
if (containerRefusal !== void 0) return {
|
|
47317
|
+
kind: "unusable",
|
|
47318
|
+
reason: containerRefusal
|
|
47319
|
+
};
|
|
47320
|
+
const documentPath = `${POLICY_PATH}.PolicyDocument`;
|
|
47321
|
+
const document = value["PolicyDocument"];
|
|
47322
|
+
if (typeof document === "string") return document.trim() === "" ? {
|
|
47323
|
+
kind: "unusable",
|
|
47324
|
+
reason: `${documentPath} must not be a blank string`
|
|
47325
|
+
} : {
|
|
47326
|
+
kind: "usable",
|
|
47327
|
+
document
|
|
47328
|
+
};
|
|
47329
|
+
if (document === void 0 || document === null) return {
|
|
47330
|
+
kind: "unusable",
|
|
47331
|
+
reason: `${documentPath} is required when ${POLICY_PATH} is declared`
|
|
47332
|
+
};
|
|
47333
|
+
const documentRefusal = refusalOf(() => requireConfigObject(document, documentPath));
|
|
47334
|
+
if (documentRefusal !== void 0) return {
|
|
47335
|
+
kind: "unusable",
|
|
47336
|
+
reason: documentRefusal
|
|
47337
|
+
};
|
|
47338
|
+
return {
|
|
47339
|
+
kind: "usable",
|
|
47340
|
+
document: JSON.stringify(document)
|
|
47341
|
+
};
|
|
47342
|
+
}
|
|
47343
|
+
function readStreamTags(block) {
|
|
47344
|
+
const value = blockMembers(block)[STREAM_TAGS_KEY];
|
|
47345
|
+
if (value === void 0 || value === null) return { kind: "absent" };
|
|
47346
|
+
if (!Array.isArray(value)) return {
|
|
47347
|
+
kind: "unusable",
|
|
47348
|
+
reason: `${TAGS_PATH} must be an array of {Key, Value} entries`
|
|
47349
|
+
};
|
|
47350
|
+
const tags = /* @__PURE__ */ new Map();
|
|
47351
|
+
for (const [position, entry] of value.entries()) {
|
|
47352
|
+
const entryPath = `${TAGS_PATH}[${position}]`;
|
|
47353
|
+
const refusal = refusalOf(() => requireConfigObject(entry, entryPath)) ?? configStringRefusal(entry, "Key", "required", entryPath) ?? configStringRefusal(entry, "Value", "", entryPath);
|
|
47354
|
+
if (refusal !== void 0) return {
|
|
47355
|
+
kind: "unusable",
|
|
47356
|
+
reason: refusal
|
|
47357
|
+
};
|
|
47358
|
+
const { Key: key, Value: tagValue } = entry;
|
|
47359
|
+
if (typeof key !== "string") return {
|
|
47360
|
+
kind: "unusable",
|
|
47361
|
+
reason: `${entryPath}.Key is required`
|
|
47362
|
+
};
|
|
47363
|
+
tags.set(key, typeof tagValue === "string" ? tagValue : "");
|
|
47364
|
+
}
|
|
47365
|
+
return {
|
|
47366
|
+
kind: "usable",
|
|
47367
|
+
tags
|
|
47368
|
+
};
|
|
47369
|
+
}
|
|
47370
|
+
function streamMemberRefusals(block) {
|
|
47371
|
+
const refusals = [];
|
|
47372
|
+
const policy = readStreamPolicy(block);
|
|
47373
|
+
if (policy.kind === "unusable") refusals.push(policy.reason);
|
|
47374
|
+
const tags = readStreamTags(block);
|
|
47375
|
+
if (tags.kind === "unusable") refusals.push(tags.reason);
|
|
47376
|
+
return refusals;
|
|
47377
|
+
}
|
|
47378
|
+
function planStreamMemberOps(desiredBlock, previousBlock, options, onUnusable) {
|
|
47379
|
+
let desiredPolicy = readStreamPolicy(desiredBlock);
|
|
47380
|
+
let desiredTags = readStreamTags(desiredBlock);
|
|
47381
|
+
if (desiredPolicy.kind === "unusable") onUnusable(desiredPolicy.reason);
|
|
47382
|
+
if (desiredTags.kind === "unusable") onUnusable(desiredTags.reason);
|
|
47383
|
+
let previousPolicy = readStreamPolicy(previousBlock);
|
|
47384
|
+
let previousTags = readStreamTags(previousBlock);
|
|
47385
|
+
if (options.freshStream) {
|
|
47386
|
+
if (desiredPolicy.kind === "unusable" && previousPolicy.kind === "usable") desiredPolicy = previousPolicy;
|
|
47387
|
+
if (desiredTags.kind === "unusable" && previousTags.kind === "usable") desiredTags = previousTags;
|
|
47388
|
+
previousPolicy = { kind: "absent" };
|
|
47389
|
+
previousTags = { kind: "absent" };
|
|
47390
|
+
} else if (options.contentsUnknown === true) {
|
|
47391
|
+
previousPolicy = {
|
|
47392
|
+
kind: "unusable",
|
|
47393
|
+
reason: ""
|
|
47394
|
+
};
|
|
47395
|
+
previousTags = { kind: "absent" };
|
|
47396
|
+
}
|
|
47397
|
+
const tagOps = [];
|
|
47398
|
+
if (desiredTags.kind !== "unusable") {
|
|
47399
|
+
const desired = desiredTags.kind === "usable" ? desiredTags.tags : /* @__PURE__ */ new Map();
|
|
47400
|
+
const previous = previousTags.kind === "usable" ? previousTags.tags : /* @__PURE__ */ new Map();
|
|
47401
|
+
const keysToRemove = [...previous.keys()].filter((key) => !desired.has(key));
|
|
47402
|
+
if (keysToRemove.length > 0) tagOps.push({
|
|
47403
|
+
kind: "untag",
|
|
47404
|
+
keys: keysToRemove
|
|
47405
|
+
});
|
|
47406
|
+
const tagsToSet = [...desired].filter(([key, value]) => previous.get(key) !== value).map(([Key, Value]) => ({
|
|
47407
|
+
Key,
|
|
47408
|
+
Value
|
|
47409
|
+
}));
|
|
47410
|
+
if (tagsToSet.length > 0) tagOps.push({
|
|
47411
|
+
kind: "tag",
|
|
47412
|
+
tags: tagsToSet
|
|
47413
|
+
});
|
|
47414
|
+
}
|
|
47415
|
+
const policyPut = desiredPolicy.kind === "usable" && !(previousPolicy.kind === "usable" && samePolicyDocument(previousPolicy.document, desiredPolicy.document));
|
|
47416
|
+
const policyDelete = previousPolicy.kind !== "absent" && (desiredPolicy.kind === "absent" || policyPut && tagOps.length > 0);
|
|
47417
|
+
const ops = [];
|
|
47418
|
+
if (policyDelete) ops.push({ kind: "deletePolicy" });
|
|
47419
|
+
ops.push(...tagOps);
|
|
47420
|
+
if (policyPut && desiredPolicy.kind === "usable") ops.push({
|
|
47421
|
+
kind: "putPolicy",
|
|
47422
|
+
document: desiredPolicy.document
|
|
47423
|
+
});
|
|
47424
|
+
return ops;
|
|
47425
|
+
}
|
|
47426
|
+
function samePolicyDocument(left, right) {
|
|
47427
|
+
if (left === right) return true;
|
|
47428
|
+
try {
|
|
47429
|
+
return canonicalJson$1(JSON.parse(left)) === canonicalJson$1(JSON.parse(right));
|
|
47430
|
+
} catch {
|
|
47431
|
+
return false;
|
|
47432
|
+
}
|
|
47433
|
+
}
|
|
47434
|
+
function streamDeclaresPolicy(desiredBlock) {
|
|
47435
|
+
return readStreamPolicy(desiredBlock).kind === "usable";
|
|
47436
|
+
}
|
|
47437
|
+
function streamDeclaresTags(desiredBlock) {
|
|
47438
|
+
return readStreamTags(desiredBlock).kind === "usable";
|
|
47439
|
+
}
|
|
47440
|
+
function reverseMapStreamPolicy(livePolicy, desiredBlock) {
|
|
47441
|
+
if (livePolicy === void 0 || livePolicy === "") return void 0;
|
|
47442
|
+
const declared = blockMembers(blockMembers(desiredBlock)[STREAM_POLICY_KEY])["PolicyDocument"];
|
|
47443
|
+
let parsed;
|
|
47444
|
+
try {
|
|
47445
|
+
parsed = JSON.parse(livePolicy);
|
|
47446
|
+
} catch {
|
|
47447
|
+
return { PolicyDocument: livePolicy };
|
|
47448
|
+
}
|
|
47449
|
+
if (typeof declared !== "string") return { PolicyDocument: parsed };
|
|
47450
|
+
let declaredParsed;
|
|
47451
|
+
try {
|
|
47452
|
+
declaredParsed = JSON.parse(declared);
|
|
47453
|
+
} catch {
|
|
47454
|
+
return { PolicyDocument: livePolicy };
|
|
47455
|
+
}
|
|
47456
|
+
return { PolicyDocument: canonicalJson$1(declaredParsed) === canonicalJson$1(parsed) ? declared : livePolicy };
|
|
47457
|
+
}
|
|
47458
|
+
function streamPolicyMatchesDeclared(livePolicy, desiredBlock) {
|
|
47459
|
+
const declared = readStreamPolicy(desiredBlock);
|
|
47460
|
+
if (declared.kind !== "usable" || livePolicy === void 0) return false;
|
|
47461
|
+
try {
|
|
47462
|
+
return canonicalJson$1(JSON.parse(livePolicy)) === canonicalJson$1(JSON.parse(declared.document));
|
|
47463
|
+
} catch {
|
|
47464
|
+
return false;
|
|
47465
|
+
}
|
|
47466
|
+
}
|
|
47467
|
+
function declaredStreamPolicyMember(desiredBlock) {
|
|
47468
|
+
const declared = readStreamPolicy(desiredBlock);
|
|
47469
|
+
return declared.kind === "usable" ? reverseMapStreamPolicy(declared.document, desiredBlock) : void 0;
|
|
47470
|
+
}
|
|
47471
|
+
function declaredStreamTagsMember(desiredBlock) {
|
|
47472
|
+
const declared = readStreamTags(desiredBlock);
|
|
47473
|
+
return declared.kind === "usable" ? [...declared.tags].map(([Key, Value]) => ({
|
|
47474
|
+
Key,
|
|
47475
|
+
Value
|
|
47476
|
+
})) : void 0;
|
|
47477
|
+
}
|
|
47478
|
+
function streamTagsMatchDeclared(liveTags, desiredBlock) {
|
|
47479
|
+
const declared = readStreamTags(desiredBlock);
|
|
47480
|
+
if (declared.kind !== "usable" || liveTags.length !== declared.tags.size) return false;
|
|
47481
|
+
return liveTags.every((tag) => declared.tags.get(tag.Key) === tag.Value);
|
|
47482
|
+
}
|
|
47483
|
+
function canonicalJson$1(value) {
|
|
47484
|
+
if (Array.isArray(value)) return `[${value.map(canonicalJson$1).join(",")}]`;
|
|
47485
|
+
if (isPlainObject$2(value)) return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson$1(value[key])}`).join(",")}}`;
|
|
47486
|
+
return JSON.stringify(value) ?? "null";
|
|
47487
|
+
}
|
|
47488
|
+
|
|
47489
|
+
// src/provisioning/providers/dynamodb-globaltable/read-support.ts
|
|
47490
|
+
async function readReplicaSubSpecs(client, tableName, regionLabel, declaredReplica) {
|
|
47491
|
+
const out = {};
|
|
47492
|
+
try {
|
|
47493
|
+
const ci = await client.send(new DescribeContributorInsightsCommand({ TableName: tableName }));
|
|
47494
|
+
const block = reverseMapReplicaContributorInsights(ci.ContributorInsightsStatus, ci.ContributorInsightsMode, declaredReplica?.["ContributorInsightsSpecification"]);
|
|
47495
|
+
if (block !== void 0) out["ContributorInsightsSpecification"] = block;
|
|
47496
|
+
} catch (err) {
|
|
47497
|
+
if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
|
|
47498
|
+
this.logger.debug(`Could not read ContributorInsights for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
|
|
47499
|
+
}
|
|
47500
|
+
try {
|
|
47501
|
+
const description = (await client.send(new DescribeContinuousBackupsCommand({ TableName: tableName }))).ContinuousBackupsDescription?.PointInTimeRecoveryDescription;
|
|
47502
|
+
const block = reverseMapReplicaPitr(description?.PointInTimeRecoveryStatus, description?.RecoveryPeriodInDays, declaredReplica?.["PointInTimeRecoverySpecification"]);
|
|
47503
|
+
if (block !== void 0) out["PointInTimeRecoverySpecification"] = block;
|
|
47504
|
+
} catch (err) {
|
|
47505
|
+
if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
|
|
47506
|
+
this.logger.debug(`Could not read PointInTimeRecovery for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
|
|
47507
|
+
}
|
|
47508
|
+
try {
|
|
47509
|
+
const active = ((await client.send(new DescribeKinesisStreamingDestinationCommand({ TableName: tableName }))).KinesisDataStreamDestinations ?? []).find((d) => d.DestinationStatus === "ACTIVE" || d.DestinationStatus === "ENABLING");
|
|
47510
|
+
if (active?.StreamArn) {
|
|
47511
|
+
const ksOut = { StreamArn: active.StreamArn };
|
|
47512
|
+
if (active.ApproximateCreationDateTimePrecision !== void 0) ksOut["ApproximateCreationDateTimePrecision"] = active.ApproximateCreationDateTimePrecision;
|
|
47513
|
+
out["KinesisStreamSpecification"] = ksOut;
|
|
47514
|
+
}
|
|
47515
|
+
} catch (err) {
|
|
47516
|
+
if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
|
|
47517
|
+
this.logger.debug(`Could not read KinesisStreamingDestination for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
|
|
47518
|
+
}
|
|
47519
|
+
return out;
|
|
47520
|
+
}
|
|
47521
|
+
async function readReplicaPolicies(client, tableName, regionLabel, tableArn, streamArn, declaredReplica, afterOwnWrite, entry) {
|
|
47522
|
+
if (declaredReplica === void 0) return;
|
|
47523
|
+
const readOne = async (what, arn, container) => {
|
|
47524
|
+
if (arn === void 0 || arn === "") return void 0;
|
|
47525
|
+
const declaredMember = () => declaredStreamPolicyMember(container);
|
|
47526
|
+
let last;
|
|
47527
|
+
const read = async () => {
|
|
47528
|
+
try {
|
|
47529
|
+
last = (await client.send(new GetResourcePolicyCommand({ ResourceArn: arn }))).Policy;
|
|
47530
|
+
} catch (err) {
|
|
47531
|
+
if (!(err instanceof PolicyNotFoundException)) throw err;
|
|
47532
|
+
last = void 0;
|
|
47533
|
+
}
|
|
47534
|
+
return last;
|
|
47535
|
+
};
|
|
47536
|
+
try {
|
|
47537
|
+
let live = await read();
|
|
47538
|
+
for (const delayMs of afterOwnWrite ? this.policyRereadDelaysMs : []) {
|
|
47539
|
+
if (streamPolicyMatchesDeclared(live, container)) break;
|
|
47540
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
47541
|
+
live = await read();
|
|
47542
|
+
}
|
|
47543
|
+
if (afterOwnWrite && !streamPolicyMatchesDeclared(live, container)) {
|
|
47544
|
+
this.logger.debug(safeMsg`Kept the declared ${what} of the ${regionLabel} replica of ${tableName} in the baseline captured after its write: the read never settled on it`);
|
|
47545
|
+
return declaredMember();
|
|
47546
|
+
}
|
|
47547
|
+
return reverseMapStreamPolicy(live, container);
|
|
47548
|
+
} catch (err) {
|
|
47549
|
+
if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
|
|
47550
|
+
this.logger.debug(safeMsg`Could not read the ${what} of the ${regionLabel} replica of ${tableName}: ${describeAwsFailure(err).detail}`);
|
|
47551
|
+
if (afterOwnWrite && (last !== void 0 && last !== "" || isThrottlingError(err) || isTransientServerError(err) || isAmbiguousOutcomeError(err) || err instanceof ResourceNotFoundException$1)) return declaredMember();
|
|
47552
|
+
return;
|
|
47553
|
+
}
|
|
47554
|
+
};
|
|
47555
|
+
if (readTablePolicy(declaredReplica).kind === "usable") {
|
|
47556
|
+
const member = await readOne("ResourcePolicy", tableArn, declaredReplica);
|
|
47557
|
+
if (member !== void 0) entry["ResourcePolicy"] = member;
|
|
47558
|
+
}
|
|
47559
|
+
if (readStreamPolicy$1(declaredReplica).kind === "usable") {
|
|
47560
|
+
const member = await readOne("stream ResourcePolicy", streamArn, declaredReplica["ReplicaStreamSpecification"]);
|
|
47561
|
+
if (member !== void 0) entry["ReplicaStreamSpecification"] = { ResourcePolicy: member };
|
|
47562
|
+
}
|
|
47563
|
+
}
|
|
47564
|
+
async function readAutoScalingSettings(tableName, scalableDimension, client, indexName) {
|
|
47565
|
+
const resourceId = autoScalingResourceId(tableName, indexName);
|
|
47566
|
+
try {
|
|
47567
|
+
const asClient = client ?? new ApplicationAutoScalingClient({
|
|
47568
|
+
...ambientClientDefaults(),
|
|
47569
|
+
region: await this.dynamoDBClient.config.region() ?? ""
|
|
47570
|
+
});
|
|
47571
|
+
const targets = (await asClient.send(new DescribeScalableTargetsCommand({
|
|
47572
|
+
ServiceNamespace: "dynamodb",
|
|
47573
|
+
ResourceIds: [resourceId],
|
|
47574
|
+
ScalableDimension: scalableDimension
|
|
47575
|
+
}))).ScalableTargets ?? [];
|
|
47576
|
+
if (targets.length === 0) return null;
|
|
47577
|
+
const target = targets[0];
|
|
47578
|
+
if (target.MinCapacity === void 0 || target.MaxCapacity === void 0) return null;
|
|
47579
|
+
const targetTracking = ((await asClient.send(new DescribeScalingPoliciesCommand({
|
|
47580
|
+
ServiceNamespace: "dynamodb",
|
|
47581
|
+
ResourceId: resourceId,
|
|
47582
|
+
ScalableDimension: scalableDimension
|
|
47583
|
+
}))).ScalingPolicies ?? []).find((p) => p.PolicyType === "TargetTrackingScaling");
|
|
47584
|
+
if (!targetTracking) return null;
|
|
47585
|
+
const cfg = targetTracking.TargetTrackingScalingPolicyConfiguration;
|
|
47586
|
+
if (!cfg || cfg.TargetValue === void 0) return null;
|
|
47587
|
+
const tttConfig = { TargetValue: cfg.TargetValue };
|
|
47588
|
+
if (cfg.DisableScaleIn !== void 0) tttConfig["DisableScaleIn"] = cfg.DisableScaleIn;
|
|
47589
|
+
if (cfg.ScaleInCooldown !== void 0) tttConfig["ScaleInCooldown"] = cfg.ScaleInCooldown;
|
|
47590
|
+
if (cfg.ScaleOutCooldown !== void 0) tttConfig["ScaleOutCooldown"] = cfg.ScaleOutCooldown;
|
|
47591
|
+
return {
|
|
47592
|
+
MinCapacity: target.MinCapacity,
|
|
47593
|
+
MaxCapacity: target.MaxCapacity,
|
|
47594
|
+
TargetTrackingScalingPolicyConfiguration: tttConfig
|
|
47595
|
+
};
|
|
47596
|
+
} catch (err) {
|
|
47597
|
+
if (strictFor(indexName !== void 0 ? "GlobalSecondaryIndexes" : scalableDimension.includes("Write") ? "WriteProvisionedThroughputSettings" : "Replicas")) throw err;
|
|
47598
|
+
this.logger.debug(`Could not read application-autoscaling settings for ${resourceId} (${scalableDimension}): ${describeAwsFailure(err).detail}`);
|
|
47599
|
+
return null;
|
|
47600
|
+
}
|
|
47601
|
+
}
|
|
47602
|
+
async function importResource(input) {
|
|
47603
|
+
const explicit = resolveExplicitPhysicalId(input, "TableName");
|
|
47604
|
+
if (explicit) try {
|
|
47605
|
+
const resp = await this.dynamoDBClient.send(new DescribeTableCommand({ TableName: explicit }));
|
|
47606
|
+
return {
|
|
47607
|
+
physicalId: explicit,
|
|
47608
|
+
attributes: definedAttributes({
|
|
47609
|
+
Arn: resp.Table?.TableArn,
|
|
47610
|
+
TableId: resp.Table?.TableId,
|
|
47611
|
+
StreamArn: resp.Table?.LatestStreamArn,
|
|
47612
|
+
TableName: resp.Table?.TableName ?? explicit
|
|
47613
|
+
})
|
|
47614
|
+
};
|
|
47615
|
+
} catch (err) {
|
|
47616
|
+
if (err instanceof ResourceNotFoundException$1) return null;
|
|
47617
|
+
throw err;
|
|
47618
|
+
}
|
|
47619
|
+
return null;
|
|
47620
|
+
}
|
|
47621
|
+
function writtenReplicaTags(afterOwnWrite, replicaArn, declaredReplica) {
|
|
47622
|
+
if (!afterOwnWrite) return void 0;
|
|
47623
|
+
const written = takeTagWrite("AWS::DynamoDB::GlobalTable", replicaArn);
|
|
47624
|
+
return declaredReplica === void 0 ? void 0 : written;
|
|
47625
|
+
}
|
|
47626
|
+
function settleReplicaTags(listTags, written, logicalId) {
|
|
47627
|
+
return settleWrittenTags(listTags, listTags, written, this.tagsBaselineRereadDelaysMs, () => warnUnsettledMember(this.logger, logicalId, "AWS::DynamoDB::GlobalTable", "Tags"));
|
|
47628
|
+
}
|
|
47629
|
+
|
|
46071
47630
|
// src/provisioning/providers/dynamodb-globaltable/read.ts
|
|
46072
47631
|
async function isSameResource(journaledPhysicalId, record, resourceType, context) {
|
|
46073
47632
|
if (resourceType !== "AWS::DynamoDB::GlobalTable") return "unknown";
|
|
@@ -46164,7 +47723,7 @@ async function unsettledInTransition(physicalId, _logicalId, _resourceType, name
|
|
|
46164
47723
|
return names;
|
|
46165
47724
|
}
|
|
46166
47725
|
}
|
|
46167
|
-
async function readCurrentState(physicalId,
|
|
47726
|
+
async function readCurrentState(physicalId, logicalId, _resourceType, properties, context) {
|
|
46168
47727
|
const afterOwnWrite = context?.afterOwnWrite === true;
|
|
46169
47728
|
try {
|
|
46170
47729
|
const table = (await this.dynamoDBClient.send(new DescribeTableCommand({ TableName: physicalId }))).Table;
|
|
@@ -46224,21 +47783,23 @@ async function readCurrentState(physicalId, _logicalId, _resourceType, propertie
|
|
|
46224
47783
|
if (typeof protection === "boolean") entry["DeletionProtectionEnabled"] = protection;
|
|
46225
47784
|
if (typeof disassociationProtection === "boolean" && declaredReplica?.["DisassociationProtectionEnabled"] !== void 0) entry[DISASSOCIATION_PROTECTION_KEY] = disassociationProtection;
|
|
46226
47785
|
await this.readReplicaPolicies(client, tableNameForSubs, regionLabel, replicaArn, streamArn, declaredReplica, afterOwnWrite, entry);
|
|
46227
|
-
if (replicaArn)
|
|
46228
|
-
const
|
|
46229
|
-
|
|
46230
|
-
|
|
46231
|
-
|
|
46232
|
-
|
|
46233
|
-
if (
|
|
46234
|
-
|
|
46235
|
-
|
|
46236
|
-
|
|
46237
|
-
|
|
46238
|
-
|
|
47786
|
+
if (replicaArn) {
|
|
47787
|
+
const listTags = async () => normalizeAwsTagsToCfn((await client.send(new ListTagsOfResourceCommand({ ResourceArn: replicaArn }))).Tags);
|
|
47788
|
+
const tagsDeclared = writtenReplicaTags(afterOwnWrite, replicaArn, declaredReplica);
|
|
47789
|
+
try {
|
|
47790
|
+
entry["Tags"] = tagsDeclared === void 0 ? await listTags() : await this.settleReplicaTags(listTags, tagsDeclared, logicalId);
|
|
47791
|
+
} catch (tagErr) {
|
|
47792
|
+
if (strictFor("Replicas") && !(tagErr instanceof ResourceNotFoundException$1)) throw tagErr;
|
|
47793
|
+
if (tagErr instanceof ResourceNotFoundException$1) {
|
|
47794
|
+
if (isLocal) throw tagErr;
|
|
47795
|
+
this.logger.debug(`Cross-region replica ${regionLabel} returned RNF on ListTagsOfResource; omitting Tags`);
|
|
47796
|
+
entry["Tags"] = [];
|
|
47797
|
+
} else {
|
|
47798
|
+
this.logger.warn(`Could not fetch tags for DynamoDB GlobalTable ${tableNameForSubs} in ${regionLabel}: ${describeAwsFailure(tagErr).detail}`);
|
|
47799
|
+
entry["Tags"] = [];
|
|
47800
|
+
}
|
|
46239
47801
|
}
|
|
46240
|
-
}
|
|
46241
|
-
else entry["Tags"] = [];
|
|
47802
|
+
} else entry["Tags"] = [];
|
|
46242
47803
|
if (billingMode === "PROVISIONED") {
|
|
46243
47804
|
const replicaAutoScalingClient = isLocal ? void 0 : this.getRegionalAutoScalingClient(regionLabel);
|
|
46244
47805
|
const readAutoScaling = await this.readAutoScalingSettings(tableNameForSubs, "dynamodb:table:ReadCapacityUnits", replicaAutoScalingClient);
|
|
@@ -46327,336 +47888,6 @@ async function readCurrentState(physicalId, _logicalId, _resourceType, propertie
|
|
|
46327
47888
|
}
|
|
46328
47889
|
}
|
|
46329
47890
|
|
|
46330
|
-
// src/provisioning/dynamodb-stream-members.ts
|
|
46331
|
-
const STREAM_SPECIFICATION_KEY = "StreamSpecification";
|
|
46332
|
-
const STREAM_POLICY_KEY = "ResourcePolicy";
|
|
46333
|
-
const STREAM_TAGS_KEY = "Tags";
|
|
46334
|
-
const POLICY_PATH = `${STREAM_SPECIFICATION_KEY}.${STREAM_POLICY_KEY}`;
|
|
46335
|
-
const TAGS_PATH = `${STREAM_SPECIFICATION_KEY}.${STREAM_TAGS_KEY}`;
|
|
46336
|
-
function isPlainObject$2(value) {
|
|
46337
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
46338
|
-
}
|
|
46339
|
-
function refusalOf(guard) {
|
|
46340
|
-
try {
|
|
46341
|
-
guard();
|
|
46342
|
-
return;
|
|
46343
|
-
} catch (error) {
|
|
46344
|
-
return describeAwsFailure(error).detail;
|
|
46345
|
-
}
|
|
46346
|
-
}
|
|
46347
|
-
function blockMembers(block) {
|
|
46348
|
-
return isPlainObject$2(block) ? block : {};
|
|
46349
|
-
}
|
|
46350
|
-
function readStreamPolicy(block) {
|
|
46351
|
-
const value = blockMembers(block)[STREAM_POLICY_KEY];
|
|
46352
|
-
if (value === void 0 || value === null) return { kind: "absent" };
|
|
46353
|
-
const containerRefusal = refusalOf(() => requireConfigObject(value, POLICY_PATH));
|
|
46354
|
-
if (containerRefusal !== void 0) return {
|
|
46355
|
-
kind: "unusable",
|
|
46356
|
-
reason: containerRefusal
|
|
46357
|
-
};
|
|
46358
|
-
const documentPath = `${POLICY_PATH}.PolicyDocument`;
|
|
46359
|
-
const document = value["PolicyDocument"];
|
|
46360
|
-
if (typeof document === "string") return document.trim() === "" ? {
|
|
46361
|
-
kind: "unusable",
|
|
46362
|
-
reason: `${documentPath} must not be a blank string`
|
|
46363
|
-
} : {
|
|
46364
|
-
kind: "usable",
|
|
46365
|
-
document
|
|
46366
|
-
};
|
|
46367
|
-
if (document === void 0 || document === null) return {
|
|
46368
|
-
kind: "unusable",
|
|
46369
|
-
reason: `${documentPath} is required when ${POLICY_PATH} is declared`
|
|
46370
|
-
};
|
|
46371
|
-
const documentRefusal = refusalOf(() => requireConfigObject(document, documentPath));
|
|
46372
|
-
if (documentRefusal !== void 0) return {
|
|
46373
|
-
kind: "unusable",
|
|
46374
|
-
reason: documentRefusal
|
|
46375
|
-
};
|
|
46376
|
-
return {
|
|
46377
|
-
kind: "usable",
|
|
46378
|
-
document: JSON.stringify(document)
|
|
46379
|
-
};
|
|
46380
|
-
}
|
|
46381
|
-
function readStreamTags(block) {
|
|
46382
|
-
const value = blockMembers(block)[STREAM_TAGS_KEY];
|
|
46383
|
-
if (value === void 0 || value === null) return { kind: "absent" };
|
|
46384
|
-
if (!Array.isArray(value)) return {
|
|
46385
|
-
kind: "unusable",
|
|
46386
|
-
reason: `${TAGS_PATH} must be an array of {Key, Value} entries`
|
|
46387
|
-
};
|
|
46388
|
-
const tags = /* @__PURE__ */ new Map();
|
|
46389
|
-
for (const [position, entry] of value.entries()) {
|
|
46390
|
-
const entryPath = `${TAGS_PATH}[${position}]`;
|
|
46391
|
-
const refusal = refusalOf(() => requireConfigObject(entry, entryPath)) ?? configStringRefusal(entry, "Key", "required", entryPath) ?? configStringRefusal(entry, "Value", "", entryPath);
|
|
46392
|
-
if (refusal !== void 0) return {
|
|
46393
|
-
kind: "unusable",
|
|
46394
|
-
reason: refusal
|
|
46395
|
-
};
|
|
46396
|
-
const { Key: key, Value: tagValue } = entry;
|
|
46397
|
-
if (typeof key !== "string") return {
|
|
46398
|
-
kind: "unusable",
|
|
46399
|
-
reason: `${entryPath}.Key is required`
|
|
46400
|
-
};
|
|
46401
|
-
tags.set(key, typeof tagValue === "string" ? tagValue : "");
|
|
46402
|
-
}
|
|
46403
|
-
return {
|
|
46404
|
-
kind: "usable",
|
|
46405
|
-
tags
|
|
46406
|
-
};
|
|
46407
|
-
}
|
|
46408
|
-
function streamMemberRefusals(block) {
|
|
46409
|
-
const refusals = [];
|
|
46410
|
-
const policy = readStreamPolicy(block);
|
|
46411
|
-
if (policy.kind === "unusable") refusals.push(policy.reason);
|
|
46412
|
-
const tags = readStreamTags(block);
|
|
46413
|
-
if (tags.kind === "unusable") refusals.push(tags.reason);
|
|
46414
|
-
return refusals;
|
|
46415
|
-
}
|
|
46416
|
-
function planStreamMemberOps(desiredBlock, previousBlock, options, onUnusable) {
|
|
46417
|
-
let desiredPolicy = readStreamPolicy(desiredBlock);
|
|
46418
|
-
let desiredTags = readStreamTags(desiredBlock);
|
|
46419
|
-
if (desiredPolicy.kind === "unusable") onUnusable(desiredPolicy.reason);
|
|
46420
|
-
if (desiredTags.kind === "unusable") onUnusable(desiredTags.reason);
|
|
46421
|
-
let previousPolicy = readStreamPolicy(previousBlock);
|
|
46422
|
-
let previousTags = readStreamTags(previousBlock);
|
|
46423
|
-
if (options.freshStream) {
|
|
46424
|
-
if (desiredPolicy.kind === "unusable" && previousPolicy.kind === "usable") desiredPolicy = previousPolicy;
|
|
46425
|
-
if (desiredTags.kind === "unusable" && previousTags.kind === "usable") desiredTags = previousTags;
|
|
46426
|
-
previousPolicy = { kind: "absent" };
|
|
46427
|
-
previousTags = { kind: "absent" };
|
|
46428
|
-
} else if (options.contentsUnknown === true) {
|
|
46429
|
-
previousPolicy = {
|
|
46430
|
-
kind: "unusable",
|
|
46431
|
-
reason: ""
|
|
46432
|
-
};
|
|
46433
|
-
previousTags = { kind: "absent" };
|
|
46434
|
-
}
|
|
46435
|
-
const tagOps = [];
|
|
46436
|
-
if (desiredTags.kind !== "unusable") {
|
|
46437
|
-
const desired = desiredTags.kind === "usable" ? desiredTags.tags : /* @__PURE__ */ new Map();
|
|
46438
|
-
const previous = previousTags.kind === "usable" ? previousTags.tags : /* @__PURE__ */ new Map();
|
|
46439
|
-
const keysToRemove = [...previous.keys()].filter((key) => !desired.has(key));
|
|
46440
|
-
if (keysToRemove.length > 0) tagOps.push({
|
|
46441
|
-
kind: "untag",
|
|
46442
|
-
keys: keysToRemove
|
|
46443
|
-
});
|
|
46444
|
-
const tagsToSet = [...desired].filter(([key, value]) => previous.get(key) !== value).map(([Key, Value]) => ({
|
|
46445
|
-
Key,
|
|
46446
|
-
Value
|
|
46447
|
-
}));
|
|
46448
|
-
if (tagsToSet.length > 0) tagOps.push({
|
|
46449
|
-
kind: "tag",
|
|
46450
|
-
tags: tagsToSet
|
|
46451
|
-
});
|
|
46452
|
-
}
|
|
46453
|
-
const policyPut = desiredPolicy.kind === "usable" && !(previousPolicy.kind === "usable" && samePolicyDocument(previousPolicy.document, desiredPolicy.document));
|
|
46454
|
-
const policyDelete = previousPolicy.kind !== "absent" && (desiredPolicy.kind === "absent" || policyPut && tagOps.length > 0);
|
|
46455
|
-
const ops = [];
|
|
46456
|
-
if (policyDelete) ops.push({ kind: "deletePolicy" });
|
|
46457
|
-
ops.push(...tagOps);
|
|
46458
|
-
if (policyPut && desiredPolicy.kind === "usable") ops.push({
|
|
46459
|
-
kind: "putPolicy",
|
|
46460
|
-
document: desiredPolicy.document
|
|
46461
|
-
});
|
|
46462
|
-
return ops;
|
|
46463
|
-
}
|
|
46464
|
-
function samePolicyDocument(left, right) {
|
|
46465
|
-
if (left === right) return true;
|
|
46466
|
-
try {
|
|
46467
|
-
return canonicalJson$1(JSON.parse(left)) === canonicalJson$1(JSON.parse(right));
|
|
46468
|
-
} catch {
|
|
46469
|
-
return false;
|
|
46470
|
-
}
|
|
46471
|
-
}
|
|
46472
|
-
function streamDeclaresPolicy(desiredBlock) {
|
|
46473
|
-
return readStreamPolicy(desiredBlock).kind === "usable";
|
|
46474
|
-
}
|
|
46475
|
-
function streamDeclaresTags(desiredBlock) {
|
|
46476
|
-
return readStreamTags(desiredBlock).kind === "usable";
|
|
46477
|
-
}
|
|
46478
|
-
function reverseMapStreamPolicy(livePolicy, desiredBlock) {
|
|
46479
|
-
if (livePolicy === void 0 || livePolicy === "") return void 0;
|
|
46480
|
-
const declared = blockMembers(blockMembers(desiredBlock)[STREAM_POLICY_KEY])["PolicyDocument"];
|
|
46481
|
-
let parsed;
|
|
46482
|
-
try {
|
|
46483
|
-
parsed = JSON.parse(livePolicy);
|
|
46484
|
-
} catch {
|
|
46485
|
-
return { PolicyDocument: livePolicy };
|
|
46486
|
-
}
|
|
46487
|
-
if (typeof declared !== "string") return { PolicyDocument: parsed };
|
|
46488
|
-
let declaredParsed;
|
|
46489
|
-
try {
|
|
46490
|
-
declaredParsed = JSON.parse(declared);
|
|
46491
|
-
} catch {
|
|
46492
|
-
return { PolicyDocument: livePolicy };
|
|
46493
|
-
}
|
|
46494
|
-
return { PolicyDocument: canonicalJson$1(declaredParsed) === canonicalJson$1(parsed) ? declared : livePolicy };
|
|
46495
|
-
}
|
|
46496
|
-
function streamPolicyMatchesDeclared(livePolicy, desiredBlock) {
|
|
46497
|
-
const declared = readStreamPolicy(desiredBlock);
|
|
46498
|
-
if (declared.kind !== "usable" || livePolicy === void 0) return false;
|
|
46499
|
-
try {
|
|
46500
|
-
return canonicalJson$1(JSON.parse(livePolicy)) === canonicalJson$1(JSON.parse(declared.document));
|
|
46501
|
-
} catch {
|
|
46502
|
-
return false;
|
|
46503
|
-
}
|
|
46504
|
-
}
|
|
46505
|
-
function declaredStreamPolicyMember(desiredBlock) {
|
|
46506
|
-
const declared = readStreamPolicy(desiredBlock);
|
|
46507
|
-
return declared.kind === "usable" ? reverseMapStreamPolicy(declared.document, desiredBlock) : void 0;
|
|
46508
|
-
}
|
|
46509
|
-
function declaredStreamTagsMember(desiredBlock) {
|
|
46510
|
-
const declared = readStreamTags(desiredBlock);
|
|
46511
|
-
return declared.kind === "usable" ? [...declared.tags].map(([Key, Value]) => ({
|
|
46512
|
-
Key,
|
|
46513
|
-
Value
|
|
46514
|
-
})) : void 0;
|
|
46515
|
-
}
|
|
46516
|
-
function streamTagsMatchDeclared(liveTags, desiredBlock) {
|
|
46517
|
-
const declared = readStreamTags(desiredBlock);
|
|
46518
|
-
if (declared.kind !== "usable" || liveTags.length !== declared.tags.size) return false;
|
|
46519
|
-
return liveTags.every((tag) => declared.tags.get(tag.Key) === tag.Value);
|
|
46520
|
-
}
|
|
46521
|
-
function canonicalJson$1(value) {
|
|
46522
|
-
if (Array.isArray(value)) return `[${value.map(canonicalJson$1).join(",")}]`;
|
|
46523
|
-
if (isPlainObject$2(value)) return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson$1(value[key])}`).join(",")}}`;
|
|
46524
|
-
return JSON.stringify(value) ?? "null";
|
|
46525
|
-
}
|
|
46526
|
-
|
|
46527
|
-
// src/provisioning/providers/dynamodb-globaltable/read-support.ts
|
|
46528
|
-
async function readReplicaSubSpecs(client, tableName, regionLabel, declaredReplica) {
|
|
46529
|
-
const out = {};
|
|
46530
|
-
try {
|
|
46531
|
-
const ci = await client.send(new DescribeContributorInsightsCommand({ TableName: tableName }));
|
|
46532
|
-
const block = reverseMapReplicaContributorInsights(ci.ContributorInsightsStatus, ci.ContributorInsightsMode, declaredReplica?.["ContributorInsightsSpecification"]);
|
|
46533
|
-
if (block !== void 0) out["ContributorInsightsSpecification"] = block;
|
|
46534
|
-
} catch (err) {
|
|
46535
|
-
if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
|
|
46536
|
-
this.logger.debug(`Could not read ContributorInsights for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
|
|
46537
|
-
}
|
|
46538
|
-
try {
|
|
46539
|
-
const description = (await client.send(new DescribeContinuousBackupsCommand({ TableName: tableName }))).ContinuousBackupsDescription?.PointInTimeRecoveryDescription;
|
|
46540
|
-
const block = reverseMapReplicaPitr(description?.PointInTimeRecoveryStatus, description?.RecoveryPeriodInDays, declaredReplica?.["PointInTimeRecoverySpecification"]);
|
|
46541
|
-
if (block !== void 0) out["PointInTimeRecoverySpecification"] = block;
|
|
46542
|
-
} catch (err) {
|
|
46543
|
-
if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
|
|
46544
|
-
this.logger.debug(`Could not read PointInTimeRecovery for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
|
|
46545
|
-
}
|
|
46546
|
-
try {
|
|
46547
|
-
const active = ((await client.send(new DescribeKinesisStreamingDestinationCommand({ TableName: tableName }))).KinesisDataStreamDestinations ?? []).find((d) => d.DestinationStatus === "ACTIVE" || d.DestinationStatus === "ENABLING");
|
|
46548
|
-
if (active?.StreamArn) {
|
|
46549
|
-
const ksOut = { StreamArn: active.StreamArn };
|
|
46550
|
-
if (active.ApproximateCreationDateTimePrecision !== void 0) ksOut["ApproximateCreationDateTimePrecision"] = active.ApproximateCreationDateTimePrecision;
|
|
46551
|
-
out["KinesisStreamSpecification"] = ksOut;
|
|
46552
|
-
}
|
|
46553
|
-
} catch (err) {
|
|
46554
|
-
if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
|
|
46555
|
-
this.logger.debug(`Could not read KinesisStreamingDestination for ${tableName} in ${regionLabel}: ${describeAwsFailure(err).detail}`);
|
|
46556
|
-
}
|
|
46557
|
-
return out;
|
|
46558
|
-
}
|
|
46559
|
-
async function readReplicaPolicies(client, tableName, regionLabel, tableArn, streamArn, declaredReplica, afterOwnWrite, entry) {
|
|
46560
|
-
if (declaredReplica === void 0) return;
|
|
46561
|
-
const readOne = async (what, arn, container) => {
|
|
46562
|
-
if (arn === void 0 || arn === "") return void 0;
|
|
46563
|
-
const declaredMember = () => declaredStreamPolicyMember(container);
|
|
46564
|
-
let last;
|
|
46565
|
-
const read = async () => {
|
|
46566
|
-
try {
|
|
46567
|
-
last = (await client.send(new GetResourcePolicyCommand({ ResourceArn: arn }))).Policy;
|
|
46568
|
-
} catch (err) {
|
|
46569
|
-
if (!(err instanceof PolicyNotFoundException)) throw err;
|
|
46570
|
-
last = void 0;
|
|
46571
|
-
}
|
|
46572
|
-
return last;
|
|
46573
|
-
};
|
|
46574
|
-
try {
|
|
46575
|
-
let live = await read();
|
|
46576
|
-
for (const delayMs of afterOwnWrite ? this.policyRereadDelaysMs : []) {
|
|
46577
|
-
if (streamPolicyMatchesDeclared(live, container)) break;
|
|
46578
|
-
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
46579
|
-
live = await read();
|
|
46580
|
-
}
|
|
46581
|
-
if (afterOwnWrite && !streamPolicyMatchesDeclared(live, container)) {
|
|
46582
|
-
this.logger.debug(safeMsg`Kept the declared ${what} of the ${regionLabel} replica of ${tableName} in the baseline captured after its write: the read never settled on it`);
|
|
46583
|
-
return declaredMember();
|
|
46584
|
-
}
|
|
46585
|
-
return reverseMapStreamPolicy(live, container);
|
|
46586
|
-
} catch (err) {
|
|
46587
|
-
if (strictFor("Replicas") && !(err instanceof ResourceNotFoundException$1)) throw err;
|
|
46588
|
-
this.logger.debug(safeMsg`Could not read the ${what} of the ${regionLabel} replica of ${tableName}: ${describeAwsFailure(err).detail}`);
|
|
46589
|
-
if (afterOwnWrite && (last !== void 0 && last !== "" || isThrottlingError(err) || isTransientServerError(err) || isAmbiguousOutcomeError(err) || err instanceof ResourceNotFoundException$1)) return declaredMember();
|
|
46590
|
-
return;
|
|
46591
|
-
}
|
|
46592
|
-
};
|
|
46593
|
-
if (readTablePolicy(declaredReplica).kind === "usable") {
|
|
46594
|
-
const member = await readOne("ResourcePolicy", tableArn, declaredReplica);
|
|
46595
|
-
if (member !== void 0) entry["ResourcePolicy"] = member;
|
|
46596
|
-
}
|
|
46597
|
-
if (readStreamPolicy$1(declaredReplica).kind === "usable") {
|
|
46598
|
-
const member = await readOne("stream ResourcePolicy", streamArn, declaredReplica["ReplicaStreamSpecification"]);
|
|
46599
|
-
if (member !== void 0) entry["ReplicaStreamSpecification"] = { ResourcePolicy: member };
|
|
46600
|
-
}
|
|
46601
|
-
}
|
|
46602
|
-
async function readAutoScalingSettings(tableName, scalableDimension, client, indexName) {
|
|
46603
|
-
const resourceId = autoScalingResourceId(tableName, indexName);
|
|
46604
|
-
try {
|
|
46605
|
-
const asClient = client ?? new ApplicationAutoScalingClient({
|
|
46606
|
-
...ambientClientDefaults(),
|
|
46607
|
-
region: await this.dynamoDBClient.config.region() ?? ""
|
|
46608
|
-
});
|
|
46609
|
-
const targets = (await asClient.send(new DescribeScalableTargetsCommand({
|
|
46610
|
-
ServiceNamespace: "dynamodb",
|
|
46611
|
-
ResourceIds: [resourceId],
|
|
46612
|
-
ScalableDimension: scalableDimension
|
|
46613
|
-
}))).ScalableTargets ?? [];
|
|
46614
|
-
if (targets.length === 0) return null;
|
|
46615
|
-
const target = targets[0];
|
|
46616
|
-
if (target.MinCapacity === void 0 || target.MaxCapacity === void 0) return null;
|
|
46617
|
-
const targetTracking = ((await asClient.send(new DescribeScalingPoliciesCommand({
|
|
46618
|
-
ServiceNamespace: "dynamodb",
|
|
46619
|
-
ResourceId: resourceId,
|
|
46620
|
-
ScalableDimension: scalableDimension
|
|
46621
|
-
}))).ScalingPolicies ?? []).find((p) => p.PolicyType === "TargetTrackingScaling");
|
|
46622
|
-
if (!targetTracking) return null;
|
|
46623
|
-
const cfg = targetTracking.TargetTrackingScalingPolicyConfiguration;
|
|
46624
|
-
if (!cfg || cfg.TargetValue === void 0) return null;
|
|
46625
|
-
const tttConfig = { TargetValue: cfg.TargetValue };
|
|
46626
|
-
if (cfg.DisableScaleIn !== void 0) tttConfig["DisableScaleIn"] = cfg.DisableScaleIn;
|
|
46627
|
-
if (cfg.ScaleInCooldown !== void 0) tttConfig["ScaleInCooldown"] = cfg.ScaleInCooldown;
|
|
46628
|
-
if (cfg.ScaleOutCooldown !== void 0) tttConfig["ScaleOutCooldown"] = cfg.ScaleOutCooldown;
|
|
46629
|
-
return {
|
|
46630
|
-
MinCapacity: target.MinCapacity,
|
|
46631
|
-
MaxCapacity: target.MaxCapacity,
|
|
46632
|
-
TargetTrackingScalingPolicyConfiguration: tttConfig
|
|
46633
|
-
};
|
|
46634
|
-
} catch (err) {
|
|
46635
|
-
if (strictFor(indexName !== void 0 ? "GlobalSecondaryIndexes" : scalableDimension.includes("Write") ? "WriteProvisionedThroughputSettings" : "Replicas")) throw err;
|
|
46636
|
-
this.logger.debug(`Could not read application-autoscaling settings for ${resourceId} (${scalableDimension}): ${describeAwsFailure(err).detail}`);
|
|
46637
|
-
return null;
|
|
46638
|
-
}
|
|
46639
|
-
}
|
|
46640
|
-
async function importResource(input) {
|
|
46641
|
-
const explicit = resolveExplicitPhysicalId(input, "TableName");
|
|
46642
|
-
if (explicit) try {
|
|
46643
|
-
const resp = await this.dynamoDBClient.send(new DescribeTableCommand({ TableName: explicit }));
|
|
46644
|
-
return {
|
|
46645
|
-
physicalId: explicit,
|
|
46646
|
-
attributes: definedAttributes({
|
|
46647
|
-
Arn: resp.Table?.TableArn,
|
|
46648
|
-
TableId: resp.Table?.TableId,
|
|
46649
|
-
StreamArn: resp.Table?.LatestStreamArn,
|
|
46650
|
-
TableName: resp.Table?.TableName ?? explicit
|
|
46651
|
-
})
|
|
46652
|
-
};
|
|
46653
|
-
} catch (err) {
|
|
46654
|
-
if (err instanceof ResourceNotFoundException$1) return null;
|
|
46655
|
-
throw err;
|
|
46656
|
-
}
|
|
46657
|
-
return null;
|
|
46658
|
-
}
|
|
46659
|
-
|
|
46660
47891
|
// src/provisioning/providers/dynamodb-globaltable/drift.ts
|
|
46661
47892
|
function getDriftUnknownPaths(_resourceType, properties) {
|
|
46662
47893
|
const paths = ["TableType"];
|
|
@@ -47099,6 +48330,10 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
47099
48330
|
readReplicaPolicies(...args) {
|
|
47100
48331
|
return readReplicaPolicies.call(this, ...args);
|
|
47101
48332
|
}
|
|
48333
|
+
tagsBaselineRereadDelaysMs = TAGS_BASELINE_REREAD_DELAYS_MS;
|
|
48334
|
+
settleReplicaTags(...args) {
|
|
48335
|
+
return settleReplicaTags.call(this, ...args);
|
|
48336
|
+
}
|
|
47102
48337
|
readAutoScalingSettings(...args) {
|
|
47103
48338
|
return readAutoScalingSettings.call(this, ...args);
|
|
47104
48339
|
}
|
|
@@ -49867,7 +51102,7 @@ async function updateInPlace(engine, { changedProperties, noEchoOnlyChangedPrope
|
|
|
49867
51102
|
}
|
|
49868
51103
|
const dischargedByReplacement = result.wasReplaced === true && result.physicalId !== currentResource.physicalId;
|
|
49869
51104
|
const keepsParameterRefusal = !dischargedByReplacement && hasUnverifiableParameterRefusal(currentResource);
|
|
49870
|
-
const carriedAttributes =
|
|
51105
|
+
const carriedAttributes = attributesAfterUpdate(resourceType, currentResource.attributes, result, (key) => engine.logger.warn(differingIdentityWarning(logicalId, resourceType, key)));
|
|
49871
51106
|
registerNoEchoAttributes(engine.secretsRun, engine.maskingDeps(), logicalId, {
|
|
49872
51107
|
...carriedAttributes && { attributes: carriedAttributes },
|
|
49873
51108
|
...result.noEchoAttributes === true && { noEchoAttributes: true },
|
|
@@ -50870,6 +52105,14 @@ async function provisionCreateUpdateNode(run, createUpdateExecutor, enqueueLostC
|
|
|
50870
52105
|
...journaledUpdatePolicyField(change.changeType, engine.options.updatePolicy, template, logicalId, engine.resolvedUpdatePolicies.get(logicalId))
|
|
50871
52106
|
};
|
|
50872
52107
|
failedOperations.push(failedOp);
|
|
52108
|
+
const deadRecord = newResources[logicalId];
|
|
52109
|
+
if (change.changeType === "UPDATE" && engine.replacementRun.oldDeletedBeforeCreate.has(logicalId) && deadRecord !== void 0) {
|
|
52110
|
+
const attributes = replaceDeadIdentity(deadRecord.resourceType, deadRecord.attributes, previousState?.attributes, markedCreatedId === deadRecord.physicalId ? createdResourceIdentityBeforeFailure(provisionError, logicalId, change.resourceType) : void 0);
|
|
52111
|
+
if (attributes !== deadRecord.attributes) newResources[logicalId] = {
|
|
52112
|
+
...deadRecord,
|
|
52113
|
+
...attributes && { attributes }
|
|
52114
|
+
};
|
|
52115
|
+
}
|
|
50873
52116
|
const heldNow = newResources[logicalId];
|
|
50874
52117
|
if (attemptedGeneration !== void 0 && heldNow !== void 0) newResources[logicalId] = withNameGenerationReached(heldNow, logicalId, attemptedGeneration);
|
|
50875
52118
|
let replacementOrphanOp;
|
|
@@ -53319,5 +54562,5 @@ var DeployEngine = class {
|
|
|
53319
54562
|
}
|
|
53320
54563
|
};
|
|
53321
54564
|
|
|
53322
|
-
export { sendTtlWaitingOutRateLimit as $, getReadOnlyPropertyPaths as $a, findSdkUnwiredProperties as $c, secretNamePrintingBag as $i, parseAssetManifestBody as $l, sgProtocolKey as $n, referenceProvenanceOf as $o, reachableDivergentParameters as $r, malformedScrubResourceEntriesRefusalMessage as $s, displacedPhysicalIdShown as $t, recordedProtectionEvidence as A, responsePresignClient as Aa, refuseMalformedOutputs as Ac, isSupersededResourceRecord as Ai, renderNestedTemplateTreeDefect as Al, findDestructiveChanges as An, regionLessSecretName as Ao, replacementNeverSwapped as Ar, maskedPropertyFingerprintsOf as As, S3_AUTO_DELETE_OBJECTS_TAG as At, declaredStreamTagsMember as B, localCustomResourceCommand as Ba, refuseMalformedResourcesForExport as Bc, red as Bi, buildAssetRedirectMap as Bl, differingRemedy as Bn, cfnRefValueFromPhysicalId as Bo, removeProtectionTypeList as Br, malformedOrphanRecordsWarning as Bs, sameMove as Bt, pendingMovesOutOf as C, ProviderRegistry as Ca, repairMalformedOrphansForReadOnly as Cc, replacedDeleteFailureVerdict as Ci, isSecretValuedAttribute as Cl, NOECHO_MAC_KEY_ALIAS as Cn, AWS_CREDENTIAL_ENV_KEYS as Co, seedsDeleteFirstGuard as Cr, isWarmThroughputDecrease as Cs, INDEX_SETTLE_POLL_INTERVAL_MS as Ct, describeFileReadFailure as Cu, findServiceTokenRefusals as D, CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID as Da, malformedOutputsRefusalMessage as Dc, findNestedStackTypeChanges as Di, findNestedTemplateTreeDefect as Dl, noEchoMacVerdict as Dn, classifyRecordedSecretRegion as Do, planFailedOps as Dr, getTopLevelKeysHoldingUnreadableCreateOnly as Ds, relayedIndexBusyDelete as Dt, resolveAssemblyPath as Du, deferredServiceTokenWarning as E, wouldReturnToSdkProvider as Ea, malformedLocalOutputsWarning as Ec, withPreviousPolicies as Ei, missingStateBucketRemedy as El, noEchoMacParametersOf as En, envCredentialsAreAssumedRole as Eo, isReplacementOrphan as Er, getSettledWriteOnlyPropertyPaths as Es, maskedLogger as Et, renderAssemblyPathEscape as Eu, readProtection as F, withPrintingSecrets as Fa, malformedRenderedContainersWarning as Fc, withoutSuperseded as Fi, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as Fl, rollbackOrphanIds as Fn, s3BucketWebsiteUrl as Fo, REDACTED_DELETE_ADDRESS_SKIP_REASON as Fr, declaresNoEcho as Fs, readRefactorMarker as Ft, streamDeclaresTags as G, CloudControlProvider as Ga, withheldAccountClause as Gc, noEchoParameterNamesOf as Gi, isDefaultBootstrapRepoName as Gl, propertiesChangedReason as Gn, parseWebACLArn as Go, retiredAfterRollback as Gr, refuseMalformedOrphansForOrphan as Gs, chunks as Gt, readStreamPolicy as H, setLocalCustomResourceRuntimeEnabled as Ha, repairMalformedResourcesForReadOnly as Hc, noEchoAttributeNamesOf as Hi, createLazyAssetModeContext as Hl, looselyEqual as Hn, refStateLookupFromResource as Ho, nameGenerationCarriedFrom as Hr, previewableOrphanRecords as Hs, macWriteOnlyKeys as Ht, DynamoDBGlobalTableProvider as I, NO_LOCAL_CUSTOM_RESOURCES_FLAG as Ia, malformedResourcesWarning as Ic, bold as Ii, purgeNoncurrentKeyVersions as Il, withMovedTo as In, coerceParameterTypedValue as Io, isRedactedRecordedValue as Ir, maskedPropertyFingerprint as Is, readRefactorMarkerOnce as It, streamTagsMatchDeclared as J, UNSPECIFIED_SKIP_REASON as Ja, displayLogicalId as Jc, completedReplayEntries as Ji, redirectFileAsset as Jl, siblingOwnedRevertDesired as Jn, keepHeldTokenProvenance as Jo, withNameGenerationReached as Jr, unreadableOrphanRecords as Js, withApiLimit as Jt, streamMemberRefusals as K, waitForGoneAfterDelete as Ka, STATE_RESOURCES_MALFORMED as Kc, withAttemptedItemsMasked as Ki, loadPublishableAssetManifest as Kl, proposeRenames as Kn, extractGetAttRefs as Ko, retiredNameGenerationsAfter as Kr, repairMalformedOrphanRecordsForReadOnly as Ks, isAccessDeniedError as Kt, STREAM_POLICY_KEY as L, customResourceStackName as La, malformedStateRefusalMessage as Lc, cyan as Li, decodeListingKey as Ll, changedReferenceInDiff as Ln, isUnboundTemplateParameter as Lo, redactedDeleteAddressFields as Lr, deployRefusesOrphanRowsReason as Ls, refactorMarkerMovesOf as Lt, PROTECTION_PROPERTY_BY_TYPE as M, readsNoEchoDeleteValues as Ma, repairMalformedOutputsForReadOnly as Mc, supersededHeldByOtherTypeWarning as Mi, SSM_PARAMETER_VALUE_PREFIX as Ml, findRefactorHints as Mn, s3BucketDomainName as Mo, computeImplicitDeleteEdges as Mr, parameterInputsFor as Ms, isTruthyCfnBoolean as Mt, isProtectionValueActive as N, isCustomResourceType as Na, STATE_REGION_DIVERGED as Nc, supersededHolderOf as Ni, isListParameterType as Nl, hintSidesOf as Nn, s3BucketDualStackDomainName as No, attemptUsesCompletedCreate as Nr, maskedInputProof as Ns, keptForRetainedRecord as Nt, serviceTokenBlockingReason as O, applyCustomResourceResponseExpiration as Oa, malformedOutputsWarning as Oc, deleteSupersededEntry as Oi, isAbsoluteAssetPath as Ol, noEchoValueMacsOf as On, classifyReplaySecretRegion as Oo, recheckFailedPlan as Or, tryGetTopLevelWriteOnlyProperties as Os, waitForIndexesSettled as Ot, clearBucketRegionCache as Ou, perType as P, getCurrentResourceSecrets as Pa, refuseDivergentRecordRegionForDestroy as Pc, supersededResourcesOf as Pi, ssmResolvedValueType as Pl, movedToHint as Pn, s3BucketRegionalDomainName as Po, readsRegeneratingSecret as Pr, passedParameterClassesOf as Ps, recordRetainedForReadoption as Pt, readTtlSpec as Q, withIndeterminateGuard as Qa, findHandledUnwrittenCreateOnly as Qc, orphanRecordsPrintingBag as Qi, isCfnTemplateAssetPath as Ql, cfnIngressPortValue as Qn, recordedReferenceRegions as Qo, namesAnyDeclaredParameter as Qr, malformedResourceEntriesWarning as Qs, displacedOpClause as Qt, STREAM_TAGS_KEY as R, customResourcesFailedWithoutApp as Ra, refuseMalformedResourcesForDeploy as Rc, gray as Ri, rememberSynthesizedStacks as Rl, changedReferencePath as Rn, parameterTypeMayLoseSecretIdentity as Ro, redactedDeleteAddressSkip as Rr, isReadableOrphanRecord as Rs, refactorMarkerRefusalMessage as Rt, hasPendingMovesOut as S, CC_BROKEN_REASON as Sa, refuseMalformedOrphansForDestroy as Sc, withStackRecords as Si, withStackInstanceIdWithheld as Sl, crossStackReadsForPartialSave as Sn, sendableAssumeRoleCommand as So, planRollback as Sr, coerceWarmThroughput as Ss, DELETE_INDEX_WAIT_PROCEED_NOTE as St, assemblyPathEscape as Su, refusePendingMovesOut as T, isCustomResource as Ta, malformedExportSourceWarning as Tc, resolveReplacementOldType as Ti, stringifyValue as Tl, noEchoMacBinding as Tn, callerEnvCredentials as To, isJournaledOrphan as Tr, toFiniteNumber as Ts, deleteTableWithIndexBusyRetry as Tt, namesTheSameDirectory as Tu, reverseMapStreamPolicy as U, withCustomResourceStack as Ua, JSON_LISTING_HOLE_VALUE as Uc, noEchoComparisonForTemplate as Ui, flattenAssetPlaceholders as Ul, mappingPairs as Un, lacksRecordedRefArn as Uo, nameGenerationHighWaterOf as Ur, refuseMalformedOrphanRecords as Us, readsOnlyNoEchoParameters as Ut, planStreamMemberOps as V, localCustomResourceRuntimeActive as Va, refuseMalformedState as Vc, yellow as Vi, createAssetRedirectResolver as Vl, isPairableType as Vn, isStalePlaceholderArnAttribute as Vo, orphanNeedsIdentity as Vr, malformedOrphanRowsKeptWarning as Vs, updateRefactorMarker as Vt, streamDeclaresPolicy as W, waitForLambdaFunctionActive as Wa, accountArgs as Wc, noEchoExactEchoLeavesOf as Wi, isDefaultBootstrapBucketName as Wl, parseMappingFile as Wn, lacksRecordedTableArn as Wo, nameScopeOf as Wr, refuseMalformedOrphanRecordsForDestroy as Ws, formatResourceLine as Wt, isTtlRateLimited as X, deleteLeftInPlace as Xa, hasReadableResources as Xc, maskEventTextWithBoundBags as Xi, AssetManifestLoader as Xl, siblingOwnedSgRuleIdentities as Xn, recordedOutputReferenceRegions as Xo, inheritProducerRegions as Xr, malformedLocalResourceEntriesWarning as Xs, resolvePendingCloudControlRequests as Xt, isTtlAlreadyDisabled as Y, deleteIndeterminateGuards as Ya, hasReadableOutputs as Yc, journaledOrphanPrintingBag as Yi, rewriteTemplateAssetReferences as Yl, stripSiblingOwnedParentMembers as Yn, outputReferenceProvenanceOf as Yo, getCurrentProducerRegions as Yr, isReadableResourceEntry as Ys, pendingRequestCount as Yt, planTimeToLive as Z, deleteSkipReason as Za, findActionableSdkUnwired as Zc, namingSecretsWithRecordedNoEcho as Zi, getDockerImageBySourceHash as Zl, withoutSiblingOwnedSgRules as Zn, recordedProvenanceOf as Zo, computeParameterTaint as Zr, malformedLocalResourcesWarning as Zs, NESTED_PENDING_PARENT_REASON as Zt, conditionFingerprint as _, collectManagedPolicyArnsAttachedBySiblings as _a, UNREADABLE_ORPHANS_CONTAINER_ROW as _c, DEFAULT_RESOURCE_WARN_AFTER_MS as _i, applyCrossPrefixScan as _l, makeForeignHolderScan as _n, assertFlagRoleArn as _o, earliestDefined as _r, MULTI_REGION_RECREATE_BLOCKED_TYPES as _s, beginDeleteWait as _t, hasOwnKey as _u, scanActiveConsumers as a, extractDeploymentEventError as aa, refuseMalformedResourceEntriesForImportSave as ac, secretBearingStateKeyWarning as ai, hasNoCloudControlHandlers as al, revertedNestedRowIds as an, poisonRenderedSpellingsCollidingIn as ao, recordAfterRollbackUpdate as ar, carriesDynamicReference as as, CONTRIBUTOR_INSIGHTS_KEY as at, buildDenyExternalAccessPolicy as au, readRecordedConditionVerdicts as b, withoutSiblingAttachedArns as ba, malformedOrphansWarning as bc, destroyStackRecordsView as bi, isNotImplemented as bl, DeploymentEventsReader as bn, isIamRoleArn as bo, withCreateTokenLedger as br, renderStatefulReason as bs, resolveDynamoDbDeleteBudgetClock as bt, ownValue as bu, nestedSsmNameDeferredNote as c, ccRoutedFinalSnapshotError as ca, unreadableResourceEntries as cc, exportNameNoEchoParameters as ci, S3StateBackend as cl, getCurrentNestedStackContext as cn, APPSYNC_APIKEY_ARN_RESOURCE_PATH as co, calculateResourceDrift as cr, namesRecreatedParent as cs, planContributorInsightsOp as ct, getBootstrapMarkerKey as cu, slashedSsmNameHealAdoptedNote as d, isFinalSnapshotError as da, refuseMalformedResourceProperties as dc, noEchoParameterValueSeed as di, readOnlyStateVersionOf as dl, dropFailedCommands as dn, secretSegmentsOfState as do, undeclaredEmptyObservedKeys as dr, markNewValueKnownAfterDeploy as ds, reverseMapIndexContributorInsights as dt, validateAssetBucketName as du, secretNamePrintingBags as ea, refuseMalformedResourceAttributesForOrphan as ec, resourcesNamingDeclaredParameter as ei, unwrittenCreateOnlyReplacement as el, dropSettledNestedJournals as en, isWaitAbandonedError as eo, canonicalizeIpProtocolValue as er, referenceTokensIn as es, planVectorIndexUpdates as et, resolveFileAssetSourcePath as eu, slashedSsmNameHealNote as f, refusesFinalSnapshot as fa, refuseMalformedResourcePropertiesForDestroy as fc, collectDeclaredOutputNames as fi, hasReasonlessBaselineRefusal as fl, dropFailedHint as fn, withSecretPhysicalIdsMaskedInState as fo, verbatimEchoDriftKeys as fr, replacementSidesForLog as fs, reverseMapTableContributorInsights as ft, validateContainerRepoName as fu, makeCanonicalizePropertiesFn as g, collectGroupsAddedBySiblings as ga, repairMalformedResourcePropertiesForReadOnly as gc, DEFAULT_RESOURCE_TIMEOUT_MS as gi, CrossPrefixScanCache as gl, sameJournaledOrphans as gn, applyRoleArnIfSet as go, replacementCreateRoutesToCloudControl as gr, shownType as gs, DYNAMODB_DELETE_POLL_COST_MS as gt, defineOwnKey as gu, inheritedProvenanceForChildDiff as h, buildFinalSnapshotIdentifier as ha, refuseMalformedResourcePropertiesForOrphan as hc, bindingSkippedOutputs as hi, CrossPrefixReadError as hl, loadJournaledOrphans as hn, refuseUnreadableCdkCrossAccountRefs as ho, findUpdatePolicyReplacementRefusals as hr, isPlainReferenceTo as hs, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as ht, getCdkdContainerRepoName as hu, mergeNoChangeOutputs as i, storedSecretNameNeedles as ia, refuseMalformedResourceEntriesForImport as ic, secretBearing as ii, NO_CC_HANDLERS_REASON as il, revertNestedChildFromJournal as in, isAlwaysLiveAttribute as io, buildReadCurrentStateContext as ir, isNamelessDynamicReferenceError as is, vectorIndexesShapeDetail as it, ensureAssetStorage as iu, recordedProtectionNote as j, TemplateNoEchoReresolver as ja, refuseMalformedOutputsForDestroy as jc, supersededAfterRollback as ji, templateIdentity as jl, formatDestructiveChange as jn, s3BucketArn as jo, IMPLICIT_DELETE_DEPENDENCIES as jr, movedMaskedProperties as js, hasCdkAutoDeleteTag as jt, diffSecurity as k, customResourceResponseExpirationWarning as ka, refuseMalformedNestedChildOutputs as kc, holdsSupersededResources as ki, listNestedTemplateRows as kl, constructPathOf as kn, producerRegionsFromState as ko, recordUnderIdIsNotOwn as kr, inputFingerprinter as ks, ECR_AUTO_DELETE_IMAGES_TAG as kt, resolveBucketRegion as ku, nestedSsmNameRowNote as l, ccRoutedInstanceTakesNoSnapshot as la, malformedDriftResourcePropertiesWarning as lc, exportNameSecretExposure as li, splitImportedOps as ll, withNestedStackContext as ln, maskedSecretSegment as lo, equalModuloMarkedMask as lr, INTRINSIC_KEYS as ls, planIndexContributorInsightsOps as lt, parseBootstrapMarker as lu, crossStackOutputProvenanceSource as m, createPreDeleteFinalSnapshot as ma, refuseMalformedResourcePropertiesForExport as mc, isExportAliasCollision as mi, rebuildClientForBucketRegion as ml, journaledOrphanLines as mn, producerLookupOver as mo, updatePartialReason as mr, findReplacedReadersOfRecreateTargets as ms, DYNAMODB_DELETE_DEADLINE_MARGIN_MS as mt, getCdkdAssetBucketName as mu, isSecretBearingReferenceString as n, secretNamedRecordNeedles as na, refuseMalformedResourceEntriesForDeploy as nc, displayTextOrWithheld as ni, withoutSdkUnwiredProperties as nl, nestedChildStackName as nn, IntrinsicFunctionResolver as no, replayRollback as nr, isImpossibleEmptyStoredAttribute as ns, vectorIndexesForCreate as nt, warnWholeAssemblyAsSource as nu, inRunStackKey as o, ATOMIC_FINAL_SNAPSHOT_TYPES as oa, refuseMalformedResourceEntriesForOrphan as oc, secretSafeKeyDisplay as oi, PROPERTY_COVERAGE_BY_TYPE as ol, withNestedRevertRun as on, stackIdTailOf as oo, settleUnsettledPrevious as or, keepsSecretReferenceToken as os, contributorInsightsRefusals as ot, assertAssetBucketRegion as ou, slashedSsmNameHealPendingNote as p, unsupportedFinalSnapshotError as pa, refuseMalformedResourcePropertiesForDrift as pc, collectPublishedOutputNames as pi, hasUnverifiableParameterRefusal as pl, isHandledOrphan as pn, resolveDynamicReferences as po, updatePartialMessage as pr, siblingsOf as ps, stripIndexContributorInsights as pt, BOOTSTRAP_MARKER_PREFIX as pu, streamPolicyMatchesDeclared as q, RollbackInlinePolicyWriters as qa, UNREADABLE_RESOURCES_MAP_ROW as qc, createReadOnlyAttributeHealerFactory as qi, redirectDockerAsset as ql, referencedLogicalIds as qn, promoteInPlaceAttributeDependents as qo, retiredNameGenerationsLeaving as qr, unpreviewableOrphanRecords as qs, lookupEachName as qt, keptWholeReasonText as r, stateSecretNameNeedles as ra, refuseMalformedResourceEntriesForDestroy as rc, exportAliasCollisionScrubWarning as ri, withoutUnwrittenSdkUnwiredProperties as rl, recordDisplacedSkips as rn, isSelectOutOfBounds as ro, DELETED_RESOURCE_REMEDY as rr, carriesFetchableDynamicReference as rs, vectorIndexesSettled as rt, AssetModeResolver as ru, checkNestedSsmNames as s, PRE_DELETE_SNAPSHOT_TYPES as sa, repairMalformedResourceEntriesForReadOnly as sc, carriedExportAliasExposure as si, TemplateParser as sl, collectNestedChildUnaddressed as sn, isSettledInstanceState as so, withUnprovenUnsettled as sr, withSharedDrainBudget as ss, indexDeclaresContributorInsights as st, isCrossRegionRedirect as su, DeployEngine as t, secretNamedAttributeNamesOf as ta, refuseMalformedResourceEntries as tc, WITHHELD_NAME_DISPLAY as ti, withoutAcceptedSdkUnwiredProperties as tl, getNestedRevertRun as tn, markWaitAbandoned as to, replayFailedOperations as tr, getAccountInfo as ts, readbackVectorIndexes as tt, warnAbsoluteAssetPath as tu, healSlashedSsmParameterNames as u, effectiveDeletionPolicy as ua, malformedResourcePropertiesWarning as uc, isWholeDynamicReferenceValue as ui, isKnownTokenFreeState as ul, deleteJournaledOrphans as un, secretPhysicalIdSegment as uo, equalModuloMask as ur, containsIntrinsic as us, readContributorInsightsSpec as ut, readBootstrapMarkerBody as uu, conditionInputsFrom as v, collectPrincipalsAttachingPolicy as va, hasReadableOrphans as vc, maskingRetryLogger as vi, crossPrefixDeniedWarning as vl, makeSiblingClaimReader as vn, assertSendableRoleArn as vo, ledgerForStack as vr, isStatefulRecreateTargetForReplace as vs, compensateRemovedDeletionProtection as vt, hasPlainPrototype as vu, pendingMovesRefusalMessage as w, ccBrokenReason as wa, malformedExportNamesWarning as wc, snapshotSegmentSurvivors as wi, isSensitiveAttributeName as wl, createNoEchoValueMacs as wn, applyCallerIdentityCredentials as wo, demoteSupersededOrphans as wr, toCfnInteger as ws, TABLE_INDEX_NOUN as wt, displayAssemblyPath as wu, childTemplateLoader as x, withoutSiblingOwned as xa, refuseMalformedOrphans as xc, getStackRecords as xi, stackInstanceIdOf as xl, DeploymentEventsStore as xn, parseIamRoleArn as xo, acquireIdempotencyToken as xr, WARM_THROUGHPUT_MEMBERS as xs, resolveDynamoDbDeleteBudgetMs as xt, absoluteAssemblyPathEscape as xu, parentSuppliedValues as y, isStoredExpression as ya, malformedOrphansRefusalMessage as yc, awaitInFlightSibling as yi, isAccessDenied$1 as yl, planOrphanAdoption as yn, explicitRoleArnOrThrow as yo, reserveStackCreateToken as yr, isStatefulRecreateTargetSync as ys, deleteBudgetKey as yt, nullPrototypeRecord as yu, declaredStreamPolicyMember as z, customResourcesRunWithoutApp as za, refuseMalformedResourcesForDestroy as zc, green as zi, synthesizedStacks as zl, changedReferenceReason as zn, AWS_NO_VALUE as zo, segmentCleanupOptions as zr, malformedOrphanRecordsRefusalMessage as zs, refuseRefactorMarker as zt };
|
|
53323
|
-
//# sourceMappingURL=deploy-engine-
|
|
54565
|
+
export { recordTagWrite as $, ProviderRegistry as $a, refuseMalformedResourcePropertiesForDrift as $c, gray as $i, hasUnverifiableParameterRefusal as $l, parseMappingFile as $n, producerLookupOver as $o, redactedDeleteAddressSkip as $r, siblingsOf as $s, formatResourceLine as $t, BOOTSTRAP_MARKER_PREFIX as $u, recordedProtectionEvidence as A, buildFinalSnapshotIdentifier as Aa, refuseMalformedOrphanRecordsForDestroy as Ac, bindingSkippedOutputs as Ai, accountArgs as Al, DeploymentEventsStore as An, differingIdentityWarning as Ao, findUpdatePolicyReplacementRefusals as Ar, lacksRecordedTableArn as As, DELETE_INDEX_WAIT_PROCEED_NOTE as At, isDefaultBootstrapBucketName as Au, declaredStreamTagsMember as B, SNS_DEFAULT_POLICY_ID as Ba, refuseMalformedResourceAttributesForOrphan as Bc, isSupersededResourceRecord as Bi, unwrittenCreateOnlyReplacement as Bl, formatDestructiveChange as Bn, IntrinsicFunctionResolver as Bo, isJournaledOrphan as Br, referenceTokensIn as Bs, isTruthyCfnBoolean as Bt, resolveFileAssetSourcePath as Bu, pendingMovesOutOf as C, ccRoutedFinalSnapshotError as Ca, deployRefusesOrphanRowsReason as Cc, exportNameNoEchoParameters as Ci, malformedStateRefusalMessage as Cl, journaledOrphanLines as Cn, withCustomResourceStack as Co, calculateResourceDrift as Cr, isUnboundTemplateParameter as Cs, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as Ct, decodeListingKey as Cu, findServiceTokenRefusals as D, refusesFinalSnapshot as Da, malformedOrphanRowsKeptWarning as Dc, collectDeclaredOutputNames as Di, refuseMalformedState as Dl, makeSiblingClaimReader as Dn, RecordedIdentityError as Do, verbatimEchoDriftKeys as Dr, isStalePlaceholderArnAttribute as Ds, deleteBudgetKey as Dt, createAssetRedirectResolver as Du, deferredServiceTokenWarning as E, isFinalSnapshotError as Ea, malformedOrphanRecordsWarning as Ec, noEchoParameterValueSeed as Ei, refuseMalformedResourcesForExport as El, makeForeignHolderScan as En, waitForGoneAfterDelete as Eo, undeclaredEmptyObservedKeys as Er, cfnRefValueFromPhysicalId as Es, compensateRemovedDeletionProtection as Et, buildAssetRedirectMap as Eu, readProtection as F, withoutSiblingAttachedArns as Fa, isReadableResourceEntry as Fc, destroyStackRecordsView as Fi, hasReadableOutputs as Fl, noEchoMacParametersOf as Fn, deleteSkipReason as Fo, withCreateTokenLedger as Fr, outputReferenceProvenanceOf as Fs, relayedIndexBusyDelete as Ft, rewriteTemplateAssetReferences as Fu, streamDeclaresTags as G, memberReadFailure as Ga, refuseMalformedResourceEntriesForImportSave as Gc, withoutSuperseded as Gi, hasNoCloudControlHandlers as Gl, withMovedTo as Gn, isSettledInstanceState as Go, replacementNeverSwapped as Gr, carriesDynamicReference as Gs, refactorMarkerMovesOf as Gt, buildDenyExternalAccessPolicy as Gu, readStreamPolicy as H, declaredPolicyDocument as Ha, refuseMalformedResourceEntriesForDeploy as Hc, supersededHeldByOtherTypeWarning as Hi, withoutSdkUnwiredProperties as Hl, hintSidesOf as Hn, isAlwaysLiveAttribute as Ho, planFailedOps as Hr, isImpossibleEmptyStoredAttribute as Hs, recordRetainedForReadoption as Ht, warnWholeAssemblyAsSource as Hu, DynamoDBGlobalTableProvider as I, withoutSiblingOwned as Ia, malformedLocalResourceEntriesWarning as Ic, getStackRecords as Ii, hasReadableResources as Il, noEchoMacVerdict as In, withIndeterminateGuard as Io, acquireIdempotencyToken as Ir, recordedOutputReferenceRegions as Is, waitForIndexesSettled as It, AssetManifestLoader as Iu, streamTagsMatchDeclared as J, settleDeclaredMember as Ja, unreadableResourceEntries as Jc, resolveReplacementOldType as Ji, S3StateBackend as Jl, changedReferenceReason as Jn, maskedSecretSegment as Jo, attemptUsesCompletedCreate as Jr, namesRecreatedParent as Js, sameMove as Jt, getBootstrapMarkerKey as Ju, streamMemberRefusals as K, policyDocumentMatchesDeclared as Ka, refuseMalformedResourceEntriesForOrphan as Kc, replacedDeleteFailureVerdict as Ki, PROPERTY_COVERAGE_BY_TYPE as Kl, changedReferenceInDiff as Kn, APPSYNC_APIKEY_ARN_RESOURCE_PATH as Ko, IMPLICIT_DELETE_DEPENDENCIES as Kr, keepsSecretReferenceToken as Ks, refactorMarkerRefusalMessage as Kt, assertAssetBucketRegion as Ku, STREAM_POLICY_KEY as L, KMS_DEFAULT_KEY_POLICY_ID as La, malformedLocalResourcesWarning as Lc, withStackRecords as Li, findActionableSdkUnwired as Ll, noEchoValueMacsOf as Ln, getReadOnlyPropertyPaths as Lo, planRollback as Lr, recordedProvenanceOf as Ls, ECR_AUTO_DELETE_IMAGES_TAG as Lt, getDockerImageBySourceHash as Lu, PROTECTION_PROPERTY_BY_TYPE as M, collectManagedPolicyArnsAttachedBySiblings as Ma, repairMalformedOrphanRecordsForReadOnly as Mc, DEFAULT_RESOURCE_WARN_AFTER_MS as Mi, STATE_RESOURCES_MALFORMED as Ml, NOECHO_MAC_KEY_ALIAS as Mn, UNSPECIFIED_SKIP_REASON as Mo, earliestDefined as Mr, extractGetAttRefs as Ms, TABLE_INDEX_NOUN as Mt, loadPublishableAssetManifest as Mu, isProtectionValueActive as N, collectPrincipalsAttachingPolicy as Na, unpreviewableOrphanRecords as Nc, maskingRetryLogger as Ni, UNREADABLE_RESOURCES_MAP_ROW as Nl, createNoEchoValueMacs as Nn, deleteIndeterminateGuards as No, ledgerForStack as Nr, promoteInPlaceAttributeDependents as Ns, deleteTableWithIndexBusyRetry as Nt, redirectDockerAsset as Nu, serviceTokenBlockingReason as O, unsupportedFinalSnapshotError as Oa, previewableOrphanRecords as Oc, collectPublishedOutputNames as Oi, repairMalformedResourcesForReadOnly as Ol, planOrphanAdoption as On, RecordedIdentityMismatchError as Oo, updatePartialMessage as Or, refStateLookupFromResource as Os, resolveDynamoDbDeleteBudgetClock as Ot, createLazyAssetModeContext as Ou, perType as P, isStoredExpression as Pa, unreadableOrphanRecords as Pc, awaitInFlightSibling as Pi, displayLogicalId as Pl, noEchoMacBinding as Pn, deleteLeftInPlace as Po, reserveStackCreateToken as Pr, keepHeldTokenProvenance as Ps, maskedLogger as Pt, redirectFileAsset as Pu, isDynamoDBTableArnIn as Q, CC_BROKEN_REASON as Qa, refuseMalformedResourcePropertiesForDestroy as Qc, cyan as Qi, hasReasonlessBaselineRefusal as Ql, mappingPairs as Qn, resolveDynamicReferences as Qo, redactedDeleteAddressFields as Qr, replacementSidesForLog as Qs, licensedNameHolder as Qt, validateContainerRepoName as Qu, STREAM_TAGS_KEY as R, LAMBDA_PERMISSION_STATEMENT_KEYS as Ra, malformedResourceEntriesWarning as Rc, deleteSupersededEntry as Ri, findHandledUnwrittenCreateOnly as Rl, constructPathOf as Rn, isWaitAbandonedError as Ro, seedsDeleteFirstGuard as Rr, recordedReferenceRegions as Rs, S3_AUTO_DELETE_OBJECTS_TAG as Rt, isCfnTemplateAssetPath as Ru, hasPendingMovesOut as S, PRE_DELETE_SNAPSHOT_TYPES as Sa, maskedPropertyFingerprint as Sc, carriedExportAliasExposure as Si, malformedResourcesWarning as Sl, isHandledOrphan as Sn, setLocalCustomResourceRuntimeEnabled as So, withUnprovenUnsettled as Sr, coerceParameterTypedValue as Ss, DYNAMODB_DELETE_DEADLINE_MARGIN_MS as St, purgeNoncurrentKeyVersions as Su, refusePendingMovesOut as T, effectiveDeletionPolicy as Ta, malformedOrphanRecordsRefusalMessage as Tc, isWholeDynamicReferenceValue as Ti, refuseMalformedResourcesForDestroy as Tl, sameJournaledOrphans as Tn, CloudControlProvider as To, equalModuloMask as Tr, AWS_NO_VALUE as Ts, beginDeleteWait as Tt, synthesizedStacks as Tu, reverseMapStreamPolicy as U, efsPolicyMatchesDeclared as Ua, refuseMalformedResourceEntriesForDestroy as Uc, supersededHolderOf as Ui, withoutUnwrittenSdkUnwiredProperties as Ul, movedToHint as Un, poisonRenderedSpellingsCollidingIn as Uo, recheckFailedPlan as Ur, carriesFetchableDynamicReference as Us, readRefactorMarker as Ut, AssetModeResolver as Uu, planStreamMemberOps as V, declaredMemberDocument as Va, refuseMalformedResourceEntries as Vc, supersededAfterRollback as Vi, withoutAcceptedSdkUnwiredProperties as Vl, findRefactorHints as Vn, isSelectOutOfBounds as Vo, isReplacementOrphan as Vr, getAccountInfo as Vs, keptForRetainedRecord as Vt, warnAbsoluteAssetPath as Vu, streamDeclaresPolicy as W, lambdaPermissionMatchesDeclared as Wa, refuseMalformedResourceEntriesForImport as Wc, supersededResourcesOf as Wi, NO_CC_HANDLERS_REASON as Wl, rollbackOrphanIds as Wn, stackIdTailOf as Wo, recordUnderIdIsNotOwn as Wr, isNamelessDynamicReferenceError as Ws, readRefactorMarkerOnce as Wt, ensureAssetStorage as Wu, clearTagWrites as X, attemptedPolicyDocument as Xa, malformedResourcePropertiesWarning as Xc, findNestedStackTypeChanges as Xi, isKnownTokenFreeState as Xl, isPairableType as Xn, secretSegmentsOfState as Xo, REDACTED_DELETE_ADDRESS_SKIP_REASON as Xr, containsIntrinsic as Xs, macWriteOnlyKeys as Xt, readBootstrapMarkerBody as Xu, TAGS_BASELINE_REREAD_DELAYS_MS as Y, warnUnsettledMember as Ya, malformedDriftResourcePropertiesWarning as Yc, withPreviousPolicies as Yi, splitImportedOps as Yl, differingRemedy as Yn, secretPhysicalIdSegment as Yo, readsRegeneratingSecret as Yr, INTRINSIC_KEYS as Ys, updateRefactorMarker as Yt, parseBootstrapMarker as Yu, declaredTagsReadback as Z, policyContentKey as Za, refuseMalformedResourceProperties as Zc, bold as Zi, readOnlyStateVersionOf as Zl, looselyEqual as Zn, withSecretPhysicalIdsMaskedInState as Zo, isRedactedRecordedValue as Zr, markNewValueKnownAfterDeploy as Zs, readsOnlyNoEchoParameters as Zt, validateAssetBucketName as Zu, conditionFingerprint as _, secretNamedRecordNeedles as _a, movedMaskedProperties as _c, displayTextOrWithheld as _i, refuseMalformedOutputsForDestroy as _l, getCurrentNestedStackContext as _n, customResourceStackName as _o, replayRollback as _r, s3BucketArn as _s, planIndexContributorInsightsOps as _t, templateIdentity as _u, scanActiveConsumers as a, noEchoExactEchoLeavesOf as aa, isStatefulRecreateTargetSync as ac, nullPrototypeRecord as ad, nameScopeOf as ai, malformedOrphansRefusalMessage as al, resolvePendingCloudControlRequests as an, classifyHandleUrl as ao, recordedRuleIdOf as ar, isIamRoleArn as as, planTimeToLive as at, isAccessDenied$1 as au, readRecordedConditionVerdicts as b, extractDeploymentEventError as ba, passedParameterClassesOf as bc, secretBearingStateKeyWarning as bi, refuseDivergentRecordRegionForDestroy as bl, dropFailedCommands as bn, localCustomResourceCommand as bo, recordAfterRollbackUpdate as br, s3BucketRegionalDomainName as bs, reverseMapTableContributorInsights as bt, ssmResolvedValueType as bu, nestedSsmNameDeferredNote as c, createReadOnlyAttributeHealerFactory as ca, coerceWarmThroughput as cc, assemblyPathEscape as cd, retiredNameGenerationsLeaving as ci, refuseMalformedOrphansForDestroy as cl, displacedPhysicalIdShown as cn, applyCustomResourceResponseExpiration as co, siblingOwnedSgRuleIdentities as cr, AWS_CREDENTIAL_ENV_KEYS as cs, planVectorIndexUpdates as ct, withStackInstanceIdWithheld as cu, slashedSsmNameHealAdoptedNote as d, maskEventTextWithBoundBags as da, toFiniteNumber as dc, namesTheSameDirectory as dd, inheritProducerRegions as di, malformedExportSourceWarning as dl, nestedChildStackName as dn, TemplateNoEchoReresolver as do, SG_RULE_ID_PATTERN as dr, envCredentialsAreAssumedRole as ds, vectorIndexesSettled as dt, stringifyValue as du, green as ea, findReplacedReadersOfRecreateTargets as ec, getCdkdAssetBucketName as ed, segmentCleanupOptions as ei, refuseMalformedResourcePropertiesForExport as el, chunks as en, ccBrokenReason as eo, propertiesChangedReason as er, refuseUnreadableCdkCrossAccountRefs as es, settleWrittenTags as et, rebuildClientForBucketRegion as eu, slashedSsmNameHealNote as f, namingSecretsWithRecordedNoEcho as fa, getSettledWriteOnlyPropertyPaths as fc, renderAssemblyPathEscape as fd, computeParameterTaint as fi, malformedLocalOutputsWarning as fl, recordDisplacedSkips as fn, readsNoEchoDeleteValues as fo, cfnIngressPortValue as fr, classifyRecordedSecretRegion as fs, vectorIndexesShapeDetail as ft, missingStateBucketRemedy as fu, makeCanonicalizePropertiesFn as g, secretNamedAttributeNamesOf as ga, maskedPropertyFingerprintsOf as gc, WITHHELD_NAME_DISPLAY as gi, refuseMalformedOutputs as gl, collectNestedChildUnaddressed as gn, NO_LOCAL_CUSTOM_RESOURCES_FLAG as go, replayFailedOperations as gr, isUnexposedRecordedIdentity as gs, planContributorInsightsOp as gt, renderNestedTemplateTreeDefect as gu, inheritedProvenanceForChildDiff as h, secretNamePrintingBags as ha, inputFingerprinter as hc, resolveBucketRegion as hd, resourcesNamingDeclaredParameter as hi, refuseMalformedNestedChildOutputs as hl, withNestedRevertRun as hn, withPrintingSecrets as ho, canonicalizeIpProtocolValue as hr, regionLessSecretName as hs, indexDeclaresContributorInsights as ht, listNestedTemplateRows as hu, mergeNoChangeOutputs as i, noEchoComparisonForTemplate as ia, isStatefulRecreateTargetForReplace as ic, hasPlainPrototype as id, nameGenerationHighWaterOf as ii, hasReadableOrphans as il, pendingRequestCount as in, WaitConditionSignalStore as io, stripSiblingOwnedParentMembers as ir, explicitRoleArnOrThrow as is, isTtlRateLimited as it, crossPrefixDeniedWarning as iu, recordedProtectionNote as j, collectGroupsAddedBySiblings as ja, refuseMalformedOrphansForOrphan as jc, DEFAULT_RESOURCE_TIMEOUT_MS as ji, withheldAccountClause as jl, crossStackReadsForPartialSave as jn, RollbackInlinePolicyWriters as jo, replacementCreateRoutesToCloudControl as jr, parseWebACLArn as js, INDEX_SETTLE_POLL_INTERVAL_MS as jt, isDefaultBootstrapRepoName as ju, diffSecurity as k, createPreDeleteFinalSnapshot as ka, refuseMalformedOrphanRecords as kc, isExportAliasCollision as ki, JSON_LISTING_HOLE_VALUE as kl, DeploymentEventsReader as kn, assertRecordedIdentity as ko, updatePartialReason as kr, lacksRecordedRefArn as ks, resolveDynamoDbDeleteBudgetMs as kt, flattenAssetPlaceholders as ku, nestedSsmNameRowNote as l, completedReplayEntries as la, isWarmThroughputDecrease as lc, describeFileReadFailure as ld, withNameGenerationReached as li, repairMalformedOrphansForReadOnly as ll, dropSettledNestedJournals as ln, customResourceResponseExpirationWarning as lo, siblingRecordedSgRuleIds as lr, applyCallerIdentityCredentials as ls, readbackVectorIndexes as lt, isSecretValuedAttribute as lu, crossStackOutputProvenanceSource as m, secretNamePrintingBag as ma, tryGetTopLevelWriteOnlyProperties as mc, clearBucketRegionCache as md, reachableDivergentParameters as mi, malformedOutputsWarning as ml, revertedNestedRowIds as mn, getCurrentResourceSecrets as mo, sgProtocolKey as mr, producerRegionsFromState as ms, contributorInsightsRefusals as mt, isAbsoluteAssetPath as mu, isSecretBearingReferenceString as n, yellow as na, shownType as nc, defineOwnKey as nd, orphanNeedsIdentity as ni, repairMalformedResourcePropertiesForReadOnly as nl, lookupEachName as nn, wouldReturnToSdkProvider as no, referencedLogicalIds as nr, assertFlagRoleArn as ns, takeTagWrite as nt, CrossPrefixScanCache as nu, inRunStackKey as o, noEchoParameterNamesOf as oa, renderStatefulReason as oc, ownValue as od, retiredAfterRollback as oi, malformedOrphansWarning as ol, NESTED_PENDING_PARENT_REASON as on, evaluateSignals as oo, sgRuleOwnershipIdentity as or, parseIamRoleArn as os, readTtlSpec as ot, isNotImplemented as ou, slashedSsmNameHealPendingNote as p, orphanRecordsPrintingBag as pa, getTopLevelKeysHoldingUnreadableCreateOnly as pc, resolveAssemblyPath as pd, namesAnyDeclaredParameter as pi, malformedOutputsRefusalMessage as pl, revertNestedChildFromJournal as pn, isCustomResourceType as po, recordedSgRuleId as pr, classifyReplaySecretRegion as ps, CONTRIBUTOR_INSIGHTS_KEY as pt, findNestedTemplateTreeDefect as pu, streamPolicyMatchesDeclared as q, reReadUntilSettled as qa, repairMalformedResourceEntriesForReadOnly as qc, snapshotSegmentSurvivors as qi, TemplateParser as ql, changedReferencePath as qn, displayPhysicalId as qo, computeImplicitDeleteEdges as qr, withSharedDrainBudget as qs, refuseRefactorMarker as qt, isCrossRegionRedirect as qu, keptWholeReasonText as r, noEchoAttributeNamesOf as ra, MULTI_REGION_RECREATE_BLOCKED_TYPES as rc, hasOwnKey as rd, nameGenerationCarriedFrom as ri, UNREADABLE_ORPHANS_CONTAINER_ROW as rl, withApiLimit as rn, LEGACY_HANDLE_ID_PREFIX as ro, siblingOwnedRevertDesired as rr, assertSendableRoleArn as rs, isTtlAlreadyDisabled as rt, applyCrossPrefixScan as ru, checkNestedSsmNames as s, withAttemptedItemsMasked as sa, WARM_THROUGHPUT_MEMBERS as sc, absoluteAssemblyPathEscape as sd, retiredNameGenerationsAfter as si, refuseMalformedOrphans as sl, displacedOpClause as sn, CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID as so, sgSiblingDecidedById as sr, sendableAssumeRoleCommand as ss, sendTtlWaitingOutRateLimit as st, stackInstanceIdOf as su, DeployEngine as t, red as ta, isPlainReferenceTo as tc, getCdkdContainerRepoName as td, removeProtectionTypeList as ti, refuseMalformedResourcePropertiesForOrphan as tl, isAccessDeniedError as tn, isCustomResource as to, proposeRenames as tr, applyRoleArnIfSet as ts, tagsMatchDeclared as tt, CrossPrefixReadError as tu, healSlashedSsmParameterNames as u, journaledOrphanPrintingBag as ua, toCfnInteger as uc, displayAssemblyPath as ud, getCurrentProducerRegions as ui, malformedExportNamesWarning as ul, getNestedRevertRun as un, responsePresignClient as uo, withoutSiblingOwnedSgRules as ur, callerEnvCredentials as us, vectorIndexesForCreate as ut, isSensitiveAttributeName as uu, conditionInputsFrom as v, stateSecretNameNeedles as va, parameterInputsFor as vc, exportAliasCollisionScrubWarning as vi, repairMalformedOutputsForReadOnly as vl, withNestedStackContext as vn, customResourcesFailedWithoutApp as vo, DELETED_RESOURCE_REMEDY as vr, s3BucketDomainName as vs, readContributorInsightsSpec as vt, SSM_PARAMETER_VALUE_PREFIX as vu, pendingMovesRefusalMessage as w, ccRoutedInstanceTakesNoSnapshot as wa, isReadableOrphanRecord as wc, exportNameSecretExposure as wi, refuseMalformedResourcesForDeploy as wl, loadJournaledOrphans as wn, waitForLambdaFunctionActive as wo, equalModuloMarkedMask as wr, parameterTypeMayLoseSecretIdentity as ws, DYNAMODB_DELETE_POLL_COST_MS as wt, rememberSynthesizedStacks as wu, childTemplateLoader as x, ATOMIC_FINAL_SNAPSHOT_TYPES as xa, declaresNoEcho as xc, secretSafeKeyDisplay as xi, malformedRenderedContainersWarning as xl, dropFailedHint as xn, localCustomResourceRuntimeActive as xo, settleUnsettledPrevious as xr, s3BucketWebsiteUrl as xs, stripIndexContributorInsights as xt, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as xu, parentSuppliedValues as y, storedSecretNameNeedles as ya, maskedInputProof as yc, secretBearing as yi, STATE_REGION_DIVERGED as yl, deleteJournaledOrphans as yn, customResourcesRunWithoutApp as yo, buildReadCurrentStateContext as yr, s3BucketDualStackDomainName as ys, reverseMapIndexContributorInsights as yt, isListParameterType as yu, declaredStreamPolicyMember as z, OWN_WRITE_REREAD_DELAYS_MS as za, malformedScrubResourceEntriesRefusalMessage as zc, holdsSupersededResources as zi, findSdkUnwiredProperties as zl, findDestructiveChanges as zn, markWaitAbandoned as zo, demoteSupersededOrphans as zr, referenceProvenanceOf as zs, hasCdkAutoDeleteTag as zt, parseAssetManifestBody as zu };
|
|
54566
|
+
//# sourceMappingURL=deploy-engine-P7CPgaVx.js.map
|