@cdkd/cli 0.350.0 → 0.350.2
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-7acjxfyN.js → ambient-client-defaults-nYbcw8Dc.js} +9 -166
- package/dist/ambient-client-defaults-nYbcw8Dc.js.map +1 -0
- package/dist/{asg-provider-Dvy_jqxt.js → asg-provider-C2lKCOu5.js} +9 -8
- package/dist/asg-provider-C2lKCOu5.js.map +1 -0
- package/dist/cli.js +3 -23
- package/dist/cli.js.map +1 -1
- package/dist/{custom-resource-runtime-BJmM5h_B.js → custom-resource-runtime-BcxDxd28.js} +96 -15
- package/dist/custom-resource-runtime-BcxDxd28.js.map +1 -0
- package/dist/{db-instance-modify-retry-pFWx2ED5.js → db-instance-modify-retry-EpoVdg4u.js} +4 -4
- package/dist/{db-instance-modify-retry-pFWx2ED5.js.map → db-instance-modify-retry-EpoVdg4u.js.map} +1 -1
- package/dist/{deploy-engine-C_cFqAUx.js → deploy-engine-DWLm19jg.js} +606 -403
- package/dist/deploy-engine-DWLm19jg.js.map +1 -0
- package/dist/{diff-calculator-CLik-y3v.js → diff-calculator-DNuEc3vO.js} +21 -29
- package/dist/diff-calculator-DNuEc3vO.js.map +1 -0
- package/dist/{ec2-termination-protection-BM1Zt3Fn.js → ec2-termination-protection-BrCiVso0.js} +26 -8
- package/dist/ec2-termination-protection-BrCiVso0.js.map +1 -0
- package/dist/{ecr-uri-C3_6QVgR.js → ecr-uri-JpCbWN50.js} +2 -2
- package/dist/{ecr-uri-C3_6QVgR.js.map → ecr-uri-JpCbWN50.js.map} +1 -1
- package/dist/{expected-bucket-owner-CGoY_YS8.js → expected-bucket-owner-IaiC3JwO.js} +2 -2
- package/dist/{expected-bucket-owner-CGoY_YS8.js.map → expected-bucket-owner-IaiC3JwO.js.map} +1 -1
- package/dist/{iam-role-provider-BaN9MMWs.js → iam-role-provider-fNKzA1U5.js} +6 -5
- package/dist/iam-role-provider-fNKzA1U5.js.map +1 -0
- package/dist/{image-plan-PsGpMjv7.js → image-plan-C87HDsmb.js} +93 -28
- package/dist/image-plan-C87HDsmb.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{logger-DmQRya0S.js → logger-CD1O0WGI.js} +3 -121
- package/dist/logger-CD1O0WGI.js.map +1 -0
- package/dist/{neptune-provider-BYgFNrtZ.js → neptune-provider-BYb2XZFH.js} +8 -7
- package/dist/neptune-provider-BYb2XZFH.js.map +1 -0
- package/dist/{program-C7rUgzkB.js → program-DJWAG98-.js} +485 -266
- package/dist/program-DJWAG98-.js.map +1 -0
- package/dist/{provider-classes-WNwnshId.js → provider-classes-B8WD5ucF.js} +204 -118
- package/dist/provider-classes-B8WD5ucF.js.map +1 -0
- package/dist/{rds-provider-DKZjtd50.js → rds-provider-B5Ox8FBm.js} +19 -18
- package/dist/rds-provider-B5Ox8FBm.js.map +1 -0
- package/dist/{read-replica-C5e4xpYi.js → read-replica-6SDKYiLa.js} +3 -3
- package/dist/{read-replica-C5e4xpYi.js.map → read-replica-6SDKYiLa.js.map} +1 -1
- package/dist/{replacement-rules-01_01yDU.js → replacement-rules-Dpkm5pWN.js} +3 -2
- package/dist/replacement-rules-Dpkm5pWN.js.map +1 -0
- package/dist/{resource-deadline-TfDpwRQ_.js → resource-deadline-P1IssiEh.js} +4 -4
- package/dist/{resource-deadline-TfDpwRQ_.js.map → resource-deadline-P1IssiEh.js.map} +1 -1
- package/dist/run-cli-CXI5umz9.js +34 -0
- package/dist/run-cli-CXI5umz9.js.map +1 -0
- package/dist/{update-removal-D-FspP88.js → update-removal-C8I2P2bf.js} +30 -8
- package/dist/update-removal-C8I2P2bf.js.map +1 -0
- package/dist/version-Cu2oblwQ.js +300 -0
- package/dist/version-Cu2oblwQ.js.map +1 -0
- package/package.json +2 -2
- package/dist/ambient-client-defaults-7acjxfyN.js.map +0 -1
- package/dist/asg-provider-Dvy_jqxt.js.map +0 -1
- package/dist/custom-resource-runtime-BJmM5h_B.js.map +0 -1
- package/dist/deploy-engine-C_cFqAUx.js.map +0 -1
- package/dist/diff-calculator-CLik-y3v.js.map +0 -1
- package/dist/ec2-termination-protection-BM1Zt3Fn.js.map +0 -1
- package/dist/iam-role-provider-BaN9MMWs.js.map +0 -1
- package/dist/image-plan-PsGpMjv7.js.map +0 -1
- package/dist/logger-DmQRya0S.js.map +0 -1
- package/dist/neptune-provider-BYgFNrtZ.js.map +0 -1
- package/dist/program-C7rUgzkB.js.map +0 -1
- package/dist/provider-classes-WNwnshId.js.map +0 -1
- package/dist/rds-provider-DKZjtd50.js.map +0 -1
- package/dist/replacement-rules-01_01yDU.js.map +0 -1
- package/dist/update-removal-D-FspP88.js.map +0 -1
- package/dist/version-DeKI8TvP.js +0 -11
- package/dist/version-DeKI8TvP.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as
|
|
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-Cu2oblwQ.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-CD1O0WGI.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, 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-nYbcw8Dc.js";
|
|
3
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";
|
|
4
5
|
import { l as s3ClientDefaults, r as getAwsClients } from "./aws-clients-DOkPjjAW.js";
|
|
5
|
-
import { A as
|
|
6
|
+
import { A as describeJsonParseFailure, C as PhaseClock, E as recordPhase, M as parseFailureDebugDetail, N as parseJsonNamingNoBody, O as timePhase, P as utf8ByteLength, S as CREATE_ONLY_PATHS_SNAPSHOT, T as phaseTimingsEnabled, _ as hasNoRegistrySchema, a as reDisableInstanceApiTermination, b as IAM_PROPAGATION_MAX_DELAY_MS, c as unchangedBehindSecretReference, d as getCreateOnlyPropertyPaths, f as isIntrinsicShaped, g as describeTypeWithThrottleRetry, h as parseCreateOnlyPropertyPointers, i as observeThenDisableInstanceApiTermination, j as jsonParseFailureStandIn, k as timePhaseSync, l as cachedCreateOnlyPropertyPaths, m as templateResourceTypes, n as ec2InstanceProtectionSite, o as reEnableInstanceApiTermination, p as prefetchCreateOnlyPropertyPaths, r as isTerminationProtectionPropagationError, v as isAwsEmulatorRegistryMiss, w as phaseScopeForStack, x as withRetry, y as reportAwsEmulatorRegistryMiss } from "./ec2-termination-protection-BrCiVso0.js";
|
|
6
7
|
import { i as sameRegion, n as canonicalizeRegion, r as derivePartitionAndUrlSuffix } from "./aws-partition-DA0r2sr-.js";
|
|
7
|
-
import { t as expectedOwnerParam } from "./expected-bucket-owner-
|
|
8
|
-
import { At as
|
|
8
|
+
import { t as expectedOwnerParam } from "./expected-bucket-owner-IaiC3JwO.js";
|
|
9
|
+
import { At as resourceTypeShown, Ct as startInterruptWatch, Et as compositeIdSeparatorRefusal, Ft as isSecretDerivedValue, G as markNotGone, Gt as isAuxiliaryFailure, H as RESOURCE_NOT_FOUND, Ht as createdBeforeFailure, I as isQuotableImportValue, It as maskDeep, Jt as markCreatedBeforeFailure, K as compensateProtectionFlip, Kt as isAuxiliaryMarkOf, L as normalizeAwsTagsToCfn, Lt as maskerOrIdentity, Mt as stateOrphanRecordRemedy, Nt as createMaskedLogSinks, Ot as logicalIdShown, Pt as createMaskedRetryLogger, R as quotedRemedyLogicalId, Rt as withDerivedNameMasks, St as isInterruptedWaitError, U as assertRegionMatch, Ut as createdResourceIdentityBeforeFailure, V as resolveExplicitPhysicalId, W as isMarkedNotGone, Y as observeThenDisableProtection, _t as protectedReplacementAdvice, an as sanitizeRecoveryValue, at as ProtectionFlipRegistry, c as clearCreatedReport, cn as injectiveKey, ct as runDeleteAttempt, dn as producerRecordKey, dt as monotonicNowMs, f as retractCreatedResource, ft as DELETION_PROTECTION_DOC_POINTER, gt as pasteableAwsCommand, in as recoveryCommandFlags, j as withoutServerErrorRetries, jt as segmentAfterAnchor, l as collectCreatedResources, lt as ElapsedBudget, mn as withPasteableAwsProfile, n as prepareRemovalForUpdate, o as withoutInjectedRemovals, on as CUSTOM_RESOURCE_RESPONSE_PREFIX, ot as isTerminalDeleteFailure, q as deleteWithProtectionCompensation, qt as markAuxiliaryFailure, r as removalWarning, s as CreatedResourceSink, sn as DEFAULT_STATE_PREFIX, st as protectionFlipKey, u as reportCreatedResource, ut as ElapsedBudgetRegistry, wt as canonicalizeRoute53QueryName, x as withUnchangedSecretPrincipalLists, z as refusalTypeShown, zt as RETRY_AUXILIARY_OWNER } from "./update-removal-C8I2P2bf.js";
|
|
9
10
|
import { a as acceptedCreateOnlyDropsOf, d as isReadableBag, f as orphansAfterRollback, g as stackInstanceIdCarriedFrom, h as skippedOutputsCarriedFrom, i as slowCcOperationTimeoutMs, l as importableOutputKeys, m as shouldRetainResource, n as isRefusedByName, o as describeRegionValueKind, p as orphansCarriedFrom, r as markDeleteStarted, s as exportNamesCarriedFrom, t as isDeleteStarted, u as importableOutputs } from "./delete-started-Co5Gt1jH.js";
|
|
10
|
-
import { $t as withdrawRenderedParameterSpelling, A as witnessNormalize, An as recordProvenPublicExpression, At as withoutPhysicalNameCopies, B as redactionClaimOf, Bt as splitOutsideDynamicReferences, Ct as withLegacyOverlapScan, D as recordedNoEchoValuesOf, Dt as replaceEmbeddedPhysicalNameRewrites, E as recordPassedNoEchoParameters, Et as repairPhysicalNameCopyLeaves, F as markLeafCertifiedBag, Fn as isSingleDynamicReferenceToken, G as foldRecording, Gt as recordInheritedPseudoParameters, H as mixedLiteralAnswered, Ht as recordDroppedArrayElements, I as markSameGenerationBag, In as maskMatchSpans, J as hasPassProvenance, Jt as inheritedParameterExpression, K as openRecordingScope, Kt as templateRereadsAccountId, L as mergeResolvedPairs, Lt as arrayPairsWhateverDrops, M as carryRedactionMarks, Mn as withoutNoEchoParameterEntries, Mt as DYNAMIC_REFERENCE_TOKEN_SCAN, N as intrinsicLeafResolutionOf, Nt as dynamicReferenceTokens, O as replaceAtCoordinates, On as recordNoEchoAttributeValues, Ot as scrubResourceRecord, P as isSameGenerationBag, Pn as isDynamicReferenceString, Q as recordReferenceResolution, Qt as redactInheritedParameterValue, R as recordIntrinsicLeafResolution, S as noEchoParametersReadBy, Sn as pinScopedSecretVerdict, St as replaceWholeLeaves, Tn as recordFreshNoEchoValuesIn, Tt as repairEmbeddedPhysicalNamesTowards, U as withLegacyMixedScan, Ut as recordTakenIfBranch, V as resolvedPlaintextOf, Vt as standsForInheritedSecret, W as redactForState, Wt as inheritedPseudoValue, X as passReadVersionsFor, Xt as recordInheritedParameterRead, Y as passProvenanceFor, Yt as inheritedRenderedToken, Z as recordReferenceProvenanceEntry, Zt as recordInheritedParameterValue, _ as noEchoComparison, _n as isNoEchoParameterPlaintext, _t as maskSecretsInText, an as physicalNameCopiesOf, at as literalSplitDelimitersOf, bn as markNoEchoParameterClass, bt as legacyReferenceLeavesOnly, c as parseLambdaFunctionAddress, cn as recordNestedStackParameterExpressions, ct as recordLogOnlyParameterValue, d as canonicalJson$5, dn as splitGetAttStringForm, dt as shareLogOnlyValues, en as carriesFreshNoEchoValue, et as carryLogOnlyValues, f as isMarkedCoordinate, fn as carriesSecretMask, ft as unionOfSecretBags, g as maskedLeafCoordinatesOf, gn as isMaskOnlyPlaintext, gt as maskSecretsInError, h as maskWholeValue, hn as freshNoEchoValuesOf, ht as maskRecordedSecretsInText, in as recoverMaskedOutput, it as hasMaskableValues, jn as wholeStringLeavesOf, jt as spanNamesResolvableService, k as valueAtCoordinate, kn as recordNoEchoParameterFreshValue, kt as withPhysicalNameCopies, ln as crossStackSourceKey, lt as recordLogOnlySplitFragments, m as maskReadbackAtCoordinates, mn as contradictProvenPublicExpression, mt as errorCauseChain, nn as freshNoEchoLeafPositions, nt as createUnionSecretMasker, p as maskAtCoordinates, pn as carryFreshNoEchoMark, pt as createSecretMasker, q as recordSecretResolution, qt as inheritNestedStackParameterAssociations, rn as recordRecoverableMaskedOutput, rt as hasLogOnlyValues, sn as recordPhysicalNameCopy, st as printingCorpusOf, t as ReplacementRulesRegistry, tn as embedsFreshNoEchoValue, tt as carryLogOnlyValuesCarriedBy, u as canonicalCoordinates, un as recordCrossStackExpression, ut as recordLogOnlyValue, v as noEchoCoordinatesOf, vn as isScopedSecretVerdict, vt as differingStringLeaves, w as readbackPathFor, wn as recordDerivedMaskOnlyValue, wt as embeddedPhysicalNameRewrites, x as noEchoParameterNodesAt, xn as noEchoParameterPlaintextsOf, xt as overlapRuleAnswered, y as noEchoLeavesOf, yn as isSecretExpressionByVerdictOrSpelling, yt as legacyLeavesWithoutMask, z as recordIntrinsicLeafResolutionAs, zt as rereadParameterExpression } from "./replacement-rules-
|
|
11
|
-
import { C as unsettledItemsTopKey, D as withoutUnsettledProperties, E as withUnsettledProperties, S as unsettledItemsOf, T as withUnsettledItems, b as unsettledContextOf, c as refuseRestoreFromItself, g as refuseMalformedDesiredTags, h as readTagList, i as withResourceDeadline, m as planTagDiff, n as enclosingDeadlineRemainingMs, r as whileEnclosingDeadlinesPaused, t as enclosingDeadlineExpired, u as definedAttributes, v as tagPlanWarning, w as unsettledPropertiesOf, x as unsettledItemsField, y as isUsableAttemptedName } from "./resource-deadline-
|
|
12
|
-
import { t as getCdkdVersion } from "./version-DeKI8TvP.js";
|
|
11
|
+
import { $t as withdrawRenderedParameterSpelling, A as witnessNormalize, An as recordProvenPublicExpression, At as withoutPhysicalNameCopies, B as redactionClaimOf, Bt as splitOutsideDynamicReferences, Ct as withLegacyOverlapScan, D as recordedNoEchoValuesOf, Dt as replaceEmbeddedPhysicalNameRewrites, E as recordPassedNoEchoParameters, Et as repairPhysicalNameCopyLeaves, F as markLeafCertifiedBag, Fn as isSingleDynamicReferenceToken, G as foldRecording, Gt as recordInheritedPseudoParameters, H as mixedLiteralAnswered, Ht as recordDroppedArrayElements, I as markSameGenerationBag, In as maskMatchSpans, J as hasPassProvenance, Jt as inheritedParameterExpression, K as openRecordingScope, Kt as templateRereadsAccountId, L as mergeResolvedPairs, Lt as arrayPairsWhateverDrops, M as carryRedactionMarks, Mn as withoutNoEchoParameterEntries, Mt as DYNAMIC_REFERENCE_TOKEN_SCAN, N as intrinsicLeafResolutionOf, Nt as dynamicReferenceTokens, O as replaceAtCoordinates, On as recordNoEchoAttributeValues, Ot as scrubResourceRecord, P as isSameGenerationBag, Pn as isDynamicReferenceString, Q as recordReferenceResolution, Qt as redactInheritedParameterValue, R as recordIntrinsicLeafResolution, S as noEchoParametersReadBy, Sn as pinScopedSecretVerdict, St as replaceWholeLeaves, Tn as recordFreshNoEchoValuesIn, Tt as repairEmbeddedPhysicalNamesTowards, U as withLegacyMixedScan, Ut as recordTakenIfBranch, V as resolvedPlaintextOf, Vt as standsForInheritedSecret, W as redactForState, Wt as inheritedPseudoValue, X as passReadVersionsFor, Xt as recordInheritedParameterRead, Y as passProvenanceFor, Yt as inheritedRenderedToken, Z as recordReferenceProvenanceEntry, Zt as recordInheritedParameterValue, _ as noEchoComparison, _n as isNoEchoParameterPlaintext, _t as maskSecretsInText, an as physicalNameCopiesOf, at as literalSplitDelimitersOf, bn as markNoEchoParameterClass, bt as legacyReferenceLeavesOnly, c as parseLambdaFunctionAddress, cn as recordNestedStackParameterExpressions, ct as recordLogOnlyParameterValue, d as canonicalJson$5, dn as splitGetAttStringForm, dt as shareLogOnlyValues, en as carriesFreshNoEchoValue, et as carryLogOnlyValues, f as isMarkedCoordinate, fn as carriesSecretMask, ft as unionOfSecretBags, g as maskedLeafCoordinatesOf, gn as isMaskOnlyPlaintext, gt as maskSecretsInError, h as maskWholeValue, hn as freshNoEchoValuesOf, ht as maskRecordedSecretsInText, in as recoverMaskedOutput, it as hasMaskableValues, jn as wholeStringLeavesOf, jt as spanNamesResolvableService, k as valueAtCoordinate, kn as recordNoEchoParameterFreshValue, kt as withPhysicalNameCopies, ln as crossStackSourceKey, lt as recordLogOnlySplitFragments, m as maskReadbackAtCoordinates, mn as contradictProvenPublicExpression, mt as errorCauseChain, nn as freshNoEchoLeafPositions, nt as createUnionSecretMasker, p as maskAtCoordinates, pn as carryFreshNoEchoMark, pt as createSecretMasker, q as recordSecretResolution, qt as inheritNestedStackParameterAssociations, rn as recordRecoverableMaskedOutput, rt as hasLogOnlyValues, sn as recordPhysicalNameCopy, st as printingCorpusOf, t as ReplacementRulesRegistry, tn as embedsFreshNoEchoValue, tt as carryLogOnlyValuesCarriedBy, u as canonicalCoordinates, un as recordCrossStackExpression, ut as recordLogOnlyValue, v as noEchoCoordinatesOf, vn as isScopedSecretVerdict, vt as differingStringLeaves, w as readbackPathFor, wn as recordDerivedMaskOnlyValue, wt as embeddedPhysicalNameRewrites, x as noEchoParameterNodesAt, xn as noEchoParameterPlaintextsOf, xt as overlapRuleAnswered, y as noEchoLeavesOf, yn as isSecretExpressionByVerdictOrSpelling, yt as legacyLeavesWithoutMask, z as recordIntrinsicLeafResolutionAs, zt as rereadParameterExpression } from "./replacement-rules-Dpkm5pWN.js";
|
|
12
|
+
import { C as unsettledItemsTopKey, D as withoutUnsettledProperties, E as withUnsettledProperties, S as unsettledItemsOf, T as withUnsettledItems, b as unsettledContextOf, c as refuseRestoreFromItself, g as refuseMalformedDesiredTags, h as readTagList, i as withResourceDeadline, m as planTagDiff, n as enclosingDeadlineRemainingMs, r as whileEnclosingDeadlinesPaused, t as enclosingDeadlineExpired, u as definedAttributes, v as tagPlanWarning, w as unsettledPropertiesOf, x as unsettledItemsField, y as isUsableAttemptedName } from "./resource-deadline-P1IssiEh.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, 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-IaiC3JwO.js").then((n) => n.n);
|
|
86
86
|
return (await client.send(new GetBucketLocationCommand({
|
|
87
87
|
Bucket: bucketName,
|
|
88
88
|
...await expectedOwnerParam(client)
|
|
@@ -278,6 +278,15 @@ function nullPrototypeRecord() {
|
|
|
278
278
|
return Object.create(null);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
+
// src/synthesis/synthesized-stacks.ts
|
|
282
|
+
let lastSynthesizedStacks = [];
|
|
283
|
+
function rememberSynthesizedStacks(stacks) {
|
|
284
|
+
lastSynthesizedStacks = stacks;
|
|
285
|
+
}
|
|
286
|
+
function synthesizedStacks() {
|
|
287
|
+
return lastSynthesizedStacks;
|
|
288
|
+
}
|
|
289
|
+
|
|
281
290
|
// src/utils/s3-listing-keys.ts
|
|
282
291
|
function decodeListingKey(value) {
|
|
283
292
|
if (value === void 0) return void 0;
|
|
@@ -606,6 +615,12 @@ function ssmResolvedValueType(type) {
|
|
|
606
615
|
return inner.length > 0 ? inner : void 0;
|
|
607
616
|
}
|
|
608
617
|
|
|
618
|
+
// src/utils/missing-state-bucket-remedy.ts
|
|
619
|
+
function missingStateBucketRemedy(what) {
|
|
620
|
+
if (!awsEndpointOverrideActive()) return `Run ${proseQuoted(cdkdRemedy("cdkd bootstrap"))} to create ${what}.`;
|
|
621
|
+
return `AWS Emulator keeps nothing across restarts, so a new or restarted emulator has no cdkd bootstrap yet. A cdkd deploy without --dry-run creates the state bucket on its own; or bootstrap the emulator now with:\n${cdkdRemedy("cdkd bootstrap")}`;
|
|
622
|
+
}
|
|
623
|
+
|
|
609
624
|
// src/assets/absolute-asset-path-warning.ts
|
|
610
625
|
function warnWholeAssemblyAsSource(w) {
|
|
611
626
|
getLogger().child("assets").warn(`${w.subject} has ${w.field} naming the output directory ITSELF: ${displayAssemblyPath(w.outdir)}. cdkd will ${w.sink} — that is the WHOLE assembly, every template and every staged asset, not one asset directory. No CDK synth emits this, so treat this assembly as untrusted unless you wrote that path yourself.`);
|
|
@@ -809,12 +824,12 @@ function parseBootstrapMarker(body, markerKey) {
|
|
|
809
824
|
parsed = JSON.parse(body);
|
|
810
825
|
} catch (error) {
|
|
811
826
|
getLogger().debug(safeMsg`${markerSubject(markerKey)} failed to parse: ${parseFailureDebugDetail(error)}`);
|
|
812
|
-
throw new CdkdError(`${markerSubject(markerKey)} in the state bucket is not valid JSON. Re-run
|
|
827
|
+
throw new CdkdError(`${markerSubject(markerKey)} in the state bucket is not valid JSON. Re-run ${proseQuoted(cdkdRemedy("cdkd bootstrap"))} for this region to rewrite it.`, "INVALID_BOOTSTRAP_MARKER", jsonParseFailureStandIn(error, utf8ByteLength(body)));
|
|
813
828
|
}
|
|
814
829
|
const marker = parsed;
|
|
815
830
|
if (typeof marker.assetSupportVersion === "number" && marker.assetSupportVersion > 1) throw new CdkdError(`${markerSubject(markerKey)} has assetSupportVersion ${marker.assetSupportVersion}, but this cdkd only understands up to ${1}. Upgrade cdkd to deploy in this region.`, "UNSUPPORTED_BOOTSTRAP_MARKER_VERSION");
|
|
816
|
-
if (typeof marker.assetBucket !== "string" || marker.assetBucket.length === 0 || typeof marker.containerRepo !== "string" || marker.containerRepo.length === 0 || typeof marker.assetSupportVersion !== "number") throw new CdkdError(`${markerSubject(markerKey)} in the state bucket is malformed (missing assetBucket / containerRepo / assetSupportVersion). Re-run
|
|
817
|
-
if (!ASSET_BUCKET_NAME_PATTERN.test(marker.assetBucket) || !isValidContainerRepoName(marker.containerRepo)) throw new CdkdError(`${markerSubject(markerKey)} in the state bucket is malformed (its asset bucket or container repository name is not a valid name). Re-run
|
|
831
|
+
if (typeof marker.assetBucket !== "string" || marker.assetBucket.length === 0 || typeof marker.containerRepo !== "string" || marker.containerRepo.length === 0 || typeof marker.assetSupportVersion !== "number") throw new CdkdError(`${markerSubject(markerKey)} in the state bucket is malformed (missing assetBucket / containerRepo / assetSupportVersion). Re-run ${proseQuoted(cdkdRemedy("cdkd bootstrap"))} for this region to rewrite it.`, "INVALID_BOOTSTRAP_MARKER");
|
|
832
|
+
if (!ASSET_BUCKET_NAME_PATTERN.test(marker.assetBucket) || !isValidContainerRepoName(marker.containerRepo)) throw new CdkdError(`${markerSubject(markerKey)} in the state bucket is malformed (its asset bucket or container repository name is not a valid name). Re-run ${proseQuoted(cdkdRemedy("cdkd bootstrap"))} for this region to rewrite it.`, "INVALID_BOOTSTRAP_MARKER");
|
|
818
833
|
return {
|
|
819
834
|
assetBucket: marker.assetBucket,
|
|
820
835
|
containerRepo: marker.containerRepo,
|
|
@@ -1878,8 +1893,8 @@ function stateCommand(verb, s, prefix) {
|
|
|
1878
1893
|
function releaseRemedy(s, prefixes, destroyToo) {
|
|
1879
1894
|
const first = prefixes[0];
|
|
1880
1895
|
if (prefixes.length === 1 && destroyToo) return `\`${stateCommand("destroy", s, first)}\` deletes its resources and its record, \`${stateCommand("orphan", s, first)}\` drops only its record.`;
|
|
1881
|
-
if (prefixes.length === 1) return `drop the other record with
|
|
1882
|
-
return `release each other record with
|
|
1896
|
+
if (prefixes.length === 1) return `drop the other record with ${proseQuoted(cdkdRemedy("cdkd state orphan"), "`")} (it removes only the record, never a resource): \`${stateCommand("orphan", s, first)}\`.`;
|
|
1897
|
+
return `release each other record with ${proseQuoted(cdkdRemedy("cdkd state orphan"), "`")} (it removes only the record, never a resource; a destroy under one of them is refused while another still records the stack, and the check stops at the first ones it finds, so re-run it until none is named), e.g. \`${stateCommand("orphan", s, first)}\`, then the same with each other prefix.`;
|
|
1883
1898
|
}
|
|
1884
1899
|
const VERB = {
|
|
1885
1900
|
deploy: "deploy",
|
|
@@ -2330,7 +2345,7 @@ async function verifyBucketExists(options = {}) {
|
|
|
2330
2345
|
}));
|
|
2331
2346
|
} catch (error) {
|
|
2332
2347
|
const name = error.name;
|
|
2333
|
-
if (name === "NotFound" || name === "NoSuchBucket") throw new StateError(`State bucket '${this.config.bucket}' does not exist. Run
|
|
2348
|
+
if (name === "NotFound" || name === "NoSuchBucket") throw new StateError(`State bucket '${this.config.bucket}' does not exist. ` + (awsEndpointOverrideActive() ? missingStateBucketRemedy("it") : `Run ${proseQuoted(cdkdRemedy("cdkd bootstrap"))} to create it, or specify an existing bucket via --state-bucket, CDKD_STATE_BUCKET, or cdk.json context.cdkd.stateBucket.`), error instanceof Error ? error : void 0);
|
|
2334
2349
|
const normalized = normalizeAwsError(error, {
|
|
2335
2350
|
bucket: this.config.bucket,
|
|
2336
2351
|
operation: "HeadBucket"
|
|
@@ -7632,15 +7647,22 @@ function dropRecordLine(recovery) {
|
|
|
7632
7647
|
}
|
|
7633
7648
|
const JSON_LISTING_HOLE_VALUE = "the value decoded from its JSON string, then shell-quoted";
|
|
7634
7649
|
const LISTING_SOURCE_TAIL = "which prints each name as a JSON string, escaped but never trimmed or sanitized, and act on the one whose stackName and region match (a legacy record that names no region lists it as null)";
|
|
7635
|
-
|
|
7650
|
+
function listingCommand() {
|
|
7651
|
+
return proseQuoted(cdkdRemedy("cdkd state list", "--json"));
|
|
7652
|
+
}
|
|
7653
|
+
function listingSourceUnflagged() {
|
|
7654
|
+
return `${listingCommand()}, ${LISTING_SOURCE_TAIL}`;
|
|
7655
|
+
}
|
|
7636
7656
|
function listingSource(flagged) {
|
|
7637
|
-
return flagged ?
|
|
7657
|
+
return flagged ? `${listingCommand()} run with the same account flags as the command at the end of this line, ${LISTING_SOURCE_TAIL}` : listingSourceUnflagged();
|
|
7658
|
+
}
|
|
7659
|
+
function withheldListingPointerProse() {
|
|
7660
|
+
return `${listingSourceUnflagged()}, filling the Inspect command's holes from it — replacing each quoted hole, quotes included, with ${JSON_LISTING_HOLE_VALUE}`;
|
|
7638
7661
|
}
|
|
7639
|
-
const WITHHELD_LISTING_POINTER = `${LISTING_SOURCE}, filling the Inspect command's holes from it — replacing each quoted hole, quotes included, with ${JSON_LISTING_HOLE_VALUE}`;
|
|
7640
7662
|
function withheldListingPointer(recovery) {
|
|
7641
7663
|
const args = accountArgs(recovery);
|
|
7642
7664
|
if (args.length === 0) return {
|
|
7643
|
-
pointer:
|
|
7665
|
+
pointer: withheldListingPointerProse(),
|
|
7644
7666
|
line: void 0
|
|
7645
7667
|
};
|
|
7646
7668
|
return {
|
|
@@ -7705,7 +7727,7 @@ function withheldAccountValues(recovery) {
|
|
|
7705
7727
|
return pasteableCommand("cdkd", accountArgs(recovery)).withheld;
|
|
7706
7728
|
}
|
|
7707
7729
|
function confirmKeyListing(recovery) {
|
|
7708
|
-
return accountArgs(recovery).length === 0 ?
|
|
7730
|
+
return accountArgs(recovery).length === 0 ? proseQuoted(cdkdRemedy("cdkd state list", "--long")) : `${proseQuoted(cdkdRemedy("cdkd state list", "--long"))} run with the same account flags as the command lines below`;
|
|
7709
7731
|
}
|
|
7710
7732
|
function destroyAccountClause(recovery) {
|
|
7711
7733
|
const clause = withheldAccountClause(recovery, "the command lines below print");
|
|
@@ -7890,7 +7912,7 @@ function orphanInspectClause(stackName, region, recovery, legacyLead = LISTED_LE
|
|
|
7890
7912
|
const prefix = exactPrefix === void 0 || exactPrefix !== "" && !exactPrefix.split("/").every((seg) => isPasteableIdent(seg)) ? void 0 : exactPrefix;
|
|
7891
7913
|
const stackShown = isInertUnquoted(stackName);
|
|
7892
7914
|
const key = shellQuote(`${prefix ?? "<prefix>"}/${stackShown ? stackName : "<stack>"}/state.json`);
|
|
7893
|
-
const stackFill = stackShown ? "" : ` The stack name ${SHELL_ACTIVE_WHY}, so the key shows the hole '<stack>' in its place; take the name from
|
|
7915
|
+
const stackFill = stackShown ? "" : ` The stack name ${SHELL_ACTIVE_WHY}, so the key shows the hole '<stack>' in its place; take the name from ${proseQuoted(cdkdRemedy("cdkd state list", "--json"))} and put it there, inside the outer quotes.`;
|
|
7894
7916
|
return {
|
|
7895
7917
|
sentence: `${lead}: the 'Object key' line below names it${where}.${recovery?.statePrefix === void 0 ? ` Its prefix is 'cdkd' unless '--state-prefix' was given.` : prefix === void 0 ? " The prefix you passed is not shown here, because it did not render exactly or one of its '/'-separated parts is not a plain identifier, so the key shows the hole '<prefix>' where it belongs; put your own value there, inside the outer quotes." : ""}${stackFill}`,
|
|
7896
7918
|
locations: [`Object key: ${key}`, ...locations]
|
|
@@ -7917,7 +7939,7 @@ function malformedDestroyResourcesRefusalMessage(stackName, region, recovery) {
|
|
|
7917
7939
|
const detail = malformedStateDiagnosis(exact ? stackName : void 0, exact ? region : void 0);
|
|
7918
7940
|
const listing = withheldListingPointer(recovery);
|
|
7919
7941
|
return [
|
|
7920
|
-
`${detail} This command DELETES state, so it refuses rather than continuing: the resource map IS the list of what to delete, so an unreadable one counts as ZERO resources and the run takes the empty-stack fast path, which removes state.json and reports success while every resource the record named is still live in AWS and no longer referenced by anything. Reading the bag as EMPTY is that same outcome rather than an alternative to it, so there is no repair available here. Repair or remove the record first. ${exact ? `To drop the record deliberately and leave the live resources standing, run
|
|
7942
|
+
`${detail} This command DELETES state, so it refuses rather than continuing: the resource map IS the list of what to delete, so an unreadable one counts as ZERO resources and the run takes the empty-stack fast path, which removes state.json and reports success while every resource the record named is still live in AWS and no longer referenced by anything. Reading the bag as EMPTY is that same outcome rather than an alternative to it, so there is no repair available here. Repair or remove the record first. ${exact ? `To drop the record deliberately and leave the live resources standing, run ${proseQuoted(cdkdRemedy("cdkd state orphan"))} against the stack and the region THE RECORD'S S3 KEY holds. It is spelled as a template on its own line below rather than handed over ready to run, because that command DELETES a record and a key segment is chosen by anyone who can write this bucket: the key says WHICH record this is, which is not the same as vouching for it as a delete target. Confirm the key with ${confirmKeyListing(recovery)} — a legacy record shows none, and for one of those the flag must be OMITTED or it selects nothing.` : `This record's stack name or region does NOT render exactly — what is printed above is a sanitized form, and another record may render identically — so this message names no target and offers no command against one. List the records with ${listing.pointer}.`}` + destroyAccountClause(recovery),
|
|
7921
7943
|
...!exact && listing.line !== void 0 ? [listing.line] : [],
|
|
7922
7944
|
`Inspect the record: ${inspectCommand(exact ? stackName : void 0, exact ? region : void 0, recovery)}`,
|
|
7923
7945
|
...exact ? [dropRecordLine(recovery)] : []
|
|
@@ -7972,7 +7994,7 @@ function divergentRecordRegionRefusalMessage(stackName, keyRegion, divergentBody
|
|
|
7972
7994
|
const kind = describeRegionValueKind(divergentBodyRegion);
|
|
7973
7995
|
const opening = exact ? `cdkd will not destroy stack ${shellQuote(safeIdentifier(stackName, cap))} (${shellQuote(safeIdentifier(keyRegion, cap))}): the state record read from that region's key carries a 'region' of its own (${kind}) that is not the key's, and ${lists}` : `cdkd will not destroy the state record this command loaded: it carries a 'region' of its own (${kind}) that is not the region of the key it was read from, and ${lists}`;
|
|
7974
7996
|
const listing = withheldListingPointer(recovery);
|
|
7975
|
-
const remedy = exact ? verboseAwareText("Re-run with --verbose to see what the record's region field holds, then either destroy ", "The debug output shows what the record's region field holds. Either destroy ") + "against the region the resources are really in, or repair that field to match the key it is stored under and re-run. " + withheldAccountClause(recovery, "the command at the end of this message prints") + "To drop the record and leave the live resources standing, spelled out rather than pasteable because that command DELETES a record: " + dropRecordTemplate(recovery) : "This record's stack name or region does NOT render exactly — what any surrounding output shows is a sanitized form, and another record may render identically — so this message names no target and offers no command against one. List the records with " + (listing.line === void 0 ? `${
|
|
7997
|
+
const remedy = exact ? verboseAwareText("Re-run with --verbose to see what the record's region field holds, then either destroy ", "The debug output shows what the record's region field holds. Either destroy ") + "against the region the resources are really in, or repair that field to match the key it is stored under and re-run. " + withheldAccountClause(recovery, "the command at the end of this message prints") + "To drop the record and leave the live resources standing, spelled out rather than pasteable because that command DELETES a record: " + dropRecordTemplate(recovery) : "This record's stack name or region does NOT render exactly — what any surrounding output shows is a sanitized form, and another record may render identically — so this message names no target and offers no command against one. List the records with " + (listing.line === void 0 ? `${withheldListingPointerProse()}. Inspect it with: ${inspectCommand(void 0, void 0)}` : `${listing.pointer}.` + destroyAccountClause(recovery) + `\n${listing.line}\nInspect it with: ${inspectCommand(void 0, void 0, recovery)}`);
|
|
7976
7998
|
return `${opening} ${resourceCount === void 0 ? `— so cdkd can neither count what it would delete nor tell which region it is in` : `— so cdkd cannot tell which region those resources are in`}. cdkd stamps the key's region into every record it writes, so this record was not written by cdkd. Destroying against the key's region would issue every delete there; if the record's own region is the honest half, each delete comes back not-found, which this command reads as ALREADY DELETED — it would report success, remove the record, and leave every resource standing in the other region with nothing naming it. ${remedy}`;
|
|
7977
7999
|
}
|
|
7978
8000
|
function refuseDivergentRecordRegionForDestroy(state, stackName, keyRegion, divergentBodyRegion, recovery, provenOrphans = 0) {
|
|
@@ -8061,7 +8083,7 @@ function malformedDestroyOrphansRefusalMessage(stackName, region, recovery) {
|
|
|
8061
8083
|
const exact = mayNameTargetWithDestructiveRemedy(stackName, region);
|
|
8062
8084
|
const listing = withheldListingPointer(recovery);
|
|
8063
8085
|
return [
|
|
8064
|
-
`${`${stackClause(exact ? stackName : void 0, exact ? region : void 0)} has no readable 'orphans' list — the record is malformed or truncated.`} This command DELETES state, so it refuses rather than continuing: an unreadable container counts as no orphans, so the run would proceed through resource deletion to removing state.json while the record's evidence that an earlier failed deploy left resources live in AWS was never read — and that evidence goes with the record. Reading it as EMPTY is that outcome rather than an alternative to it, so there is no repair available here. Repair or remove the record first. ${exact ? `To drop the record deliberately and leave every live resource standing, run
|
|
8086
|
+
`${`${stackClause(exact ? stackName : void 0, exact ? region : void 0)} has no readable 'orphans' list — the record is malformed or truncated.`} This command DELETES state, so it refuses rather than continuing: an unreadable container counts as no orphans, so the run would proceed through resource deletion to removing state.json while the record's evidence that an earlier failed deploy left resources live in AWS was never read — and that evidence goes with the record. Reading it as EMPTY is that outcome rather than an alternative to it, so there is no repair available here. Repair or remove the record first. ${exact ? `To drop the record deliberately and leave every live resource standing, run ${proseQuoted(cdkdRemedy("cdkd state orphan"))} against the stack and the region THE RECORD'S S3 KEY holds. It is spelled as a template on its own line below rather than handed over ready to run, because that command DELETES a record and a key segment is chosen by anyone who can write this bucket: the key says WHICH record this is, which is not the same as vouching for it as a delete target. Confirm the key with ${confirmKeyListing(recovery)} — a legacy record shows none, and for one of those the flag must be OMITTED or it selects nothing.` : `This record's stack name or region does NOT render exactly, so this message names no target and offers no command against one. List the records with ${listing.pointer}.`}` + destroyAccountClause(recovery),
|
|
8065
8087
|
...!exact && listing.line !== void 0 ? [listing.line] : [],
|
|
8066
8088
|
`Inspect the record: ${inspectCommand(exact ? stackName : void 0, exact ? region : void 0, recovery)}`,
|
|
8067
8089
|
...exact ? [dropRecordLine(recovery)] : []
|
|
@@ -8147,7 +8169,7 @@ function malformedDriftResourcePropertiesWarning(rawStackName, rawRegion, logica
|
|
|
8147
8169
|
function malformedExportResourcePropertiesRefusalMessage(rawStackName, rawRegion, logicalIds, recovery) {
|
|
8148
8170
|
const stackName = absentIfEmpty(rawStackName);
|
|
8149
8171
|
const region = absentIfEmpty(rawRegion);
|
|
8150
|
-
return inspectTail(`${namedPropertyBagsDiagnosis(stackName, region, logicalIds, true)} ${EXPORT_DELETES_STATE} The export reads this map to build the CloudFormation import identifier, to check it for the redaction mask, and to find what a phase-2 pre-delete removes, so a map it cannot read makes each of those answers wrong — and the record showing the damage is deleted once the export succeeds. Nothing was imported and no state was written. Repair the record by hand, or re-import each named resource with a selective
|
|
8172
|
+
return inspectTail(`${namedPropertyBagsDiagnosis(stackName, region, logicalIds, true)} ${EXPORT_DELETES_STATE} The export reads this map to build the CloudFormation import identifier, to check it for the redaction mask, and to find what a phase-2 pre-delete removes, so a map it cannot read makes each of those answers wrong — and the record showing the damage is deleted once the export succeeds. Nothing was imported and no state was written. Repair the record by hand, or re-import each named resource with a selective ${proseQuoted(cdkdRemedy("cdkd import", "--force"))}, which records the properties resolved from the template; then export again.`, stackName, region, recovery, EXPORT_LEGACY_LEAD);
|
|
8151
8173
|
}
|
|
8152
8174
|
function refuseMalformedResourcePropertiesForExport(state, stackName, region, recovery) {
|
|
8153
8175
|
const unreadable = unreadableResourcePropertyBags(state);
|
|
@@ -9408,6 +9430,10 @@ function getTopLevelWriteOnlyProperties(resourceType) {
|
|
|
9408
9430
|
return result;
|
|
9409
9431
|
}).catch((error) => {
|
|
9410
9432
|
writeOnlyPropertiesCache.delete(resourceType);
|
|
9433
|
+
if (isAwsEmulatorRegistryMiss(error)) {
|
|
9434
|
+
reportAwsEmulatorRegistryMiss(resourceType, "updates use a minimal patch");
|
|
9435
|
+
return /* @__PURE__ */ new Set();
|
|
9436
|
+
}
|
|
9411
9437
|
const message = describeAwsFailure(error).detail;
|
|
9412
9438
|
getLogger().child("WriteOnlyProperties").warn(`Failed to resolve write-only properties for ${resourceType} via cloudformation:DescribeType (${message}). Falling back to a minimal update patch — write-only properties (if any) may be dropped by the Cloud Control read-modify-write update. Grant cloudformation:DescribeType to enable write-only property re-inclusion.`);
|
|
9413
9439
|
return /* @__PURE__ */ new Set();
|
|
@@ -12305,13 +12331,13 @@ function s3BucketWebsiteUrl(bucketName, region) {
|
|
|
12305
12331
|
|
|
12306
12332
|
// src/deployment/intrinsic-resolver/getatt-heal.ts
|
|
12307
12333
|
function staleRecordRemedy(resolver, outcome, context) {
|
|
12308
|
-
const touch =
|
|
12309
|
-
if (outcome === void 0) return `Run
|
|
12334
|
+
const touch = `change any property of the resource so its next update re-records the attributes, or re-import it with ${proseQuoted(cdkdRemedy("cdkd import"))}`;
|
|
12335
|
+
if (outcome === void 0) return `Run ${proseQuoted(cdkdRemedy("cdkd deploy"))}: it re-reads a stale record's attributes from AWS and heals the record. Otherwise ${touch}.`;
|
|
12310
12336
|
const preview = context?.attributeHealer?.readOnly === true;
|
|
12311
12337
|
const attempted = preview ? `This preview re-read the attributes from AWS` : `cdkd tried to re-read the attributes from AWS to heal the record`;
|
|
12312
12338
|
switch (outcome.kind) {
|
|
12313
12339
|
case "failed": return `${attempted}, but ${describeFailureObserved(resolver, "the provider read", outcome.error, context)}. ` + (preview ? `A preview writes nothing to state; 'cdkd deploy' issues the same read and records the attribute once the read returns it. Fix the read (a missing read permission is the usual cause), or ${touch}.` : `Fix that (a missing read permission is the usual cause) and deploy again — cdkd retries the read on every deploy until the record is healed — or ${touch}.`);
|
|
12314
|
-
case "not-found": return `${attempted}, but AWS reports no resource behind the recorded physical id — it was probably deleted outside cdkd. Check it with
|
|
12340
|
+
case "not-found": return `${attempted}, but AWS reports no resource behind the recorded physical id — it was probably deleted outside cdkd. Check it with ${proseQuoted(cdkdRemedy("cdkd drift"))}, then re-create it (change the resource so it is replaced) or remove it from state.`;
|
|
12315
12341
|
case "read":
|
|
12316
12342
|
if ((outcome.withheldKeys?.length ?? 0) > 0) return withheldRemedy(resolver, context);
|
|
12317
12343
|
return preview ? `This preview re-read the resource from AWS and the read reports no usable value for this attribute either; ${touch}.` : `cdkd re-read the resource from AWS and the read reports no usable value for this attribute either, so there is nothing to heal the record with; ${touch}.`;
|
|
@@ -12584,6 +12610,96 @@ async function constructAttributeForCoreTypes(resolver, resource, attributeName,
|
|
|
12584
12610
|
remedy: "Check the VPC in the console, or reference the attribute from a later deploy."
|
|
12585
12611
|
});
|
|
12586
12612
|
}
|
|
12613
|
+
case "DefaultNetworkAcl": {
|
|
12614
|
+
if (!/^vpc-[0-9a-f]+$/.test(physicalId)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Fn::GetAtt [${displayMasked(resolver, logicalId, context)}, DefaultNetworkAcl] for AWS::EC2::VPC: the state record's physical id ${quotedRender(displayMasked(resolver, physicalId, context).slice(0, 64), "\"")} is not a VPC id (vpc-<hex>), so cdkd will not use it as an EC2 filter value. Repair the record (cdkd import, or re-create the VPC) and deploy again.`));
|
|
12615
|
+
let aclId;
|
|
12616
|
+
try {
|
|
12617
|
+
aclId = (await resolver.clients.clientsForRegion(resolver.explicitRegion).ec2.send(new DescribeNetworkAclsCommand({ Filters: [{
|
|
12618
|
+
Name: "vpc-id",
|
|
12619
|
+
Values: [physicalId]
|
|
12620
|
+
}, {
|
|
12621
|
+
Name: "default",
|
|
12622
|
+
Values: ["true"]
|
|
12623
|
+
}] }))).NetworkAcls?.[0]?.NetworkAclId;
|
|
12624
|
+
} catch (err) {
|
|
12625
|
+
refuseUnservedAttribute(resolver, {
|
|
12626
|
+
logicalId,
|
|
12627
|
+
attributeName,
|
|
12628
|
+
resourceType,
|
|
12629
|
+
physicalId,
|
|
12630
|
+
context,
|
|
12631
|
+
observed: describeFailureObserved(resolver, "DescribeNetworkAcls", err, context),
|
|
12632
|
+
remedy: "Fix the read (the vpc-id / default filtered DescribeNetworkAcls permission, or the region) and deploy again."
|
|
12633
|
+
});
|
|
12634
|
+
}
|
|
12635
|
+
if (aclId) return aclId;
|
|
12636
|
+
refuseUnservedAttribute(resolver, {
|
|
12637
|
+
logicalId,
|
|
12638
|
+
attributeName,
|
|
12639
|
+
resourceType,
|
|
12640
|
+
physicalId,
|
|
12641
|
+
context,
|
|
12642
|
+
observed: "DescribeNetworkAcls found no default network ACL in the VPC",
|
|
12643
|
+
remedy: "Check the VPC in the console, or reference the attribute from a later deploy."
|
|
12644
|
+
});
|
|
12645
|
+
}
|
|
12646
|
+
case "CidrBlockAssociations": {
|
|
12647
|
+
let associationIds;
|
|
12648
|
+
let vpcFound = false;
|
|
12649
|
+
try {
|
|
12650
|
+
const vpc = (await resolver.clients.clientsForRegion(resolver.explicitRegion).ec2.send(new DescribeVpcsCommand({ VpcIds: [physicalId] }))).Vpcs?.[0];
|
|
12651
|
+
if (vpc) {
|
|
12652
|
+
vpcFound = true;
|
|
12653
|
+
associationIds = (vpc.CidrBlockAssociationSet ?? []).filter((a) => {
|
|
12654
|
+
const state = a.CidrBlockState?.State;
|
|
12655
|
+
return state === "associated" || state === "associating";
|
|
12656
|
+
}).map((a) => a.AssociationId).filter((id) => typeof id === "string" && id !== "");
|
|
12657
|
+
}
|
|
12658
|
+
} catch (err) {
|
|
12659
|
+
refuseUnservedAttribute(resolver, {
|
|
12660
|
+
logicalId,
|
|
12661
|
+
attributeName,
|
|
12662
|
+
resourceType,
|
|
12663
|
+
physicalId,
|
|
12664
|
+
context,
|
|
12665
|
+
observed: describeFailureObserved(resolver, "DescribeVpcs", err, context),
|
|
12666
|
+
remedy: "Fix the read (the DescribeVpcs permission, or the region) and deploy again."
|
|
12667
|
+
});
|
|
12668
|
+
}
|
|
12669
|
+
if (associationIds && associationIds.length > 0) return associationIds;
|
|
12670
|
+
if (!vpcFound) refuseUnservedAttribute(resolver, {
|
|
12671
|
+
logicalId,
|
|
12672
|
+
attributeName,
|
|
12673
|
+
resourceType,
|
|
12674
|
+
physicalId,
|
|
12675
|
+
context,
|
|
12676
|
+
observed: "DescribeVpcs found no VPC with this id",
|
|
12677
|
+
remedy: "Check the VPC in the console, or reference the attribute from a later deploy."
|
|
12678
|
+
});
|
|
12679
|
+
refuseUnservedAttribute(resolver, {
|
|
12680
|
+
logicalId,
|
|
12681
|
+
attributeName,
|
|
12682
|
+
resourceType,
|
|
12683
|
+
physicalId,
|
|
12684
|
+
context,
|
|
12685
|
+
observed: "DescribeVpcs returned no associated CIDR block for the VPC",
|
|
12686
|
+
remedy: "Check the VPC in the console, or reference the attribute from a later deploy."
|
|
12687
|
+
});
|
|
12688
|
+
}
|
|
12689
|
+
default: return guardedPhysicalIdFallback(resolver, logicalId, attributeName, resourceType, physicalId, context);
|
|
12690
|
+
}
|
|
12691
|
+
if (resourceType === "AWS::IAM::ManagedPolicy") switch (attributeName) {
|
|
12692
|
+
case "PolicyArn": return physicalId;
|
|
12693
|
+
case "PolicyId":
|
|
12694
|
+
case "DefaultVersionId":
|
|
12695
|
+
healBeforeConstructing(resolver, context);
|
|
12696
|
+
refuseUnconstructibleAttribute(resolver, {
|
|
12697
|
+
logicalId,
|
|
12698
|
+
attributeName,
|
|
12699
|
+
resourceType,
|
|
12700
|
+
context,
|
|
12701
|
+
why: "cdkd cannot build it from the policy ARN"
|
|
12702
|
+
});
|
|
12587
12703
|
default: return guardedPhysicalIdFallback(resolver, logicalId, attributeName, resourceType, physicalId, context);
|
|
12588
12704
|
}
|
|
12589
12705
|
if (resourceType === "AWS::IAM::Policy") switch (attributeName) {
|
|
@@ -13582,7 +13698,7 @@ async function resolveGetStackOutput(resolver, arg, context) {
|
|
|
13582
13698
|
}
|
|
13583
13699
|
throw new Error(`Fn::GetStackOutput: stack ${loggedStackName} not found in region ${displayIdent(loggedRegion)}${roleArn ? ` (cross-account via ${shownReadRoleArn})` : ""}. ${!roleArn && resolver.cfnFallback ? "Searched cdkd state and CloudFormation stacks. Make sure the producer stack has been deployed (via cdkd or CloudFormation)." : `Make sure the producer stack has been deployed via cdkd.`}`);
|
|
13584
13700
|
}
|
|
13585
|
-
if (!hasReadableOutputs(stateData.state)) throw markNonRetryable(new MalformedProducerRecordRefusalError(`Fn::GetStackOutput: the state record of producer stack ${loggedStackName} (${displayIdent(loggedRegion)}) has no readable 'outputs' map — the record is malformed or truncated. cdkd refuses to resolve from it rather than reading it as a map: 'Object.hasOwn' answers TRUE for '0' on a string and for an index on a list, so continuing would resolve ONE CHARACTER or element of the record as this reference's value and this deploy would send it to AWS. Inspect the producer's record with
|
|
13701
|
+
if (!hasReadableOutputs(stateData.state)) throw markNonRetryable(new MalformedProducerRecordRefusalError(`Fn::GetStackOutput: the state record of producer stack ${loggedStackName} (${displayIdent(loggedRegion)}) has no readable 'outputs' map — the record is malformed or truncated. cdkd refuses to resolve from it rather than reading it as a map: 'Object.hasOwn' answers TRUE for '0' on a string and for an index on a list, so continuing would resolve ONE CHARACTER or element of the record as this reference's value and this deploy would send it to AWS. Inspect the producer's record with ${proseQuoted(cdkdRemedy("cdkd state show", "--json"))}, repair or remove it, then re-run.`));
|
|
13586
13702
|
const outputs = stateData.state.outputs ?? {};
|
|
13587
13703
|
if (!Object.hasOwn(outputs, outputName)) {
|
|
13588
13704
|
const available = describeAvailableOutputs(resolver, Object.keys(outputs), context);
|
|
@@ -14530,7 +14646,7 @@ async function readSubnetAttributeLive(resolver, attributeName, context, logical
|
|
|
14530
14646
|
return refuse(describeFailureObserved(resolver, "DescribeSubnets", err, context), "Fix the read (the ec2:DescribeSubnets permission, or the region) and deploy again.");
|
|
14531
14647
|
}
|
|
14532
14648
|
};
|
|
14533
|
-
const notFound = () => refuse("DescribeSubnets returned no subnet for it",
|
|
14649
|
+
const notFound = () => refuse("DescribeSubnets returned no subnet for it", `Check that the subnet still exists in this region, or repair the record with ${cdkdRemedy("cdkd import")}.`);
|
|
14534
14650
|
if (attributeName === "Ipv6CidrBlocks") {
|
|
14535
14651
|
const loggedId = displayMasked(resolver, physicalId, context);
|
|
14536
14652
|
const { attempts, delayMs } = subnetIpv6AttributeWait;
|
|
@@ -15187,7 +15303,7 @@ async function resolveRef(resolver, logicalId, context, onParameter) {
|
|
|
15187
15303
|
if (lacksRecordedTableArn(resource)) {
|
|
15188
15304
|
const tableArn = await resolveGetAtt(resolver, [logicalId, "TableARN"], context);
|
|
15189
15305
|
if (typeof tableArn === "string" && tableArn.startsWith("arn:") && !tableArn.includes("|")) return tableArn;
|
|
15190
|
-
throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Ref ${displayMasked(resolver, logicalId, context)}: the state records no usable TableARN for this S3 Tables table (a cdkd older than v0.201.0 recorded none), and CloudFormation's Ref of a table is its TableARN, which its physical id does not contain. No usable one could be read from AWS either. If the state records none, run
|
|
15306
|
+
throw markNonRetryable(new IntrinsicResolutionRefusalError(`Cannot resolve Ref ${displayMasked(resolver, logicalId, context)}: the state records no usable TableARN for this S3 Tables table (a cdkd older than v0.201.0 recorded none), and CloudFormation's Ref of a table is its TableARN, which its physical id does not contain. No usable one could be read from AWS either. If the state records none, run ${proseQuoted(cdkdRemedy("cdkd deploy"))} with permission to call s3tables:GetTable so cdkd records it; if it records a value that is not the table's ARN, re-import the table with ${proseQuoted(cdkdRemedy("cdkd import"))}.`));
|
|
15191
15307
|
}
|
|
15192
15308
|
const refValue = resolveRefValue(resolver, logicalId, resource, context);
|
|
15193
15309
|
recordSecretNamedRead(logicalId, refValue, context);
|
|
@@ -15417,7 +15533,7 @@ function referencesProvenLocal(value, logicalId, context) {
|
|
|
15417
15533
|
|
|
15418
15534
|
// src/deployment/intrinsic-resolver/getatt.ts
|
|
15419
15535
|
function isAlwaysLiveAttribute(resourceType, attributeName) {
|
|
15420
|
-
if (resourceType === "AWS::EC2::VPC") return attributeName === "Ipv6CidrBlocks";
|
|
15536
|
+
if (resourceType === "AWS::EC2::VPC") return attributeName === "Ipv6CidrBlocks" || attributeName === "CidrBlockAssociations";
|
|
15421
15537
|
if (resourceType !== "AWS::EC2::Subnet") return false;
|
|
15422
15538
|
return attributeName === "Ipv6CidrBlocks" || attributeName === "NetworkAclAssociationId" || attributeName === "BlockPublicAccessStates" || attributeName.startsWith("BlockPublicAccessStates.");
|
|
15423
15539
|
}
|
|
@@ -16738,6 +16854,10 @@ function isDefinitiveRefusal(error) {
|
|
|
16738
16854
|
}
|
|
16739
16855
|
const readOnlyPropertiesCache = /* @__PURE__ */ new Map();
|
|
16740
16856
|
const attributeNamesCache = /* @__PURE__ */ new Map();
|
|
16857
|
+
const emulatorRegistryMissTypes = /* @__PURE__ */ new Set();
|
|
16858
|
+
function isAwsEmulatorRegistryMissType(resourceType) {
|
|
16859
|
+
return emulatorRegistryMissTypes.has(resourceType);
|
|
16860
|
+
}
|
|
16741
16861
|
async function getTopLevelAttributeNames(resourceType) {
|
|
16742
16862
|
const readOnly = await getTopLevelReadOnlyProperties(resourceType);
|
|
16743
16863
|
if (readOnly === void 0) return void 0;
|
|
@@ -16767,6 +16887,7 @@ function getTopLevelReadOnlyProperties(resourceType) {
|
|
|
16767
16887
|
if (cached) return cached;
|
|
16768
16888
|
const entry = fetchTopLevelReadOnlyProperties(resourceType).catch((error) => {
|
|
16769
16889
|
if (!isDefinitiveRefusal(error)) readOnlyPropertiesCache.delete(resourceType);
|
|
16890
|
+
if (isAwsEmulatorRegistryMiss(error)) emulatorRegistryMissTypes.add(resourceType);
|
|
16770
16891
|
const message = describeAwsFailure(error).detail;
|
|
16771
16892
|
getLogger().child("ReadOnlyProperties").debug(`Failed to resolve read-only properties for ${displaySafe(resourceType, { asciiOnly: true })} via cloudformation:DescribeType (${message}).`);
|
|
16772
16893
|
});
|
|
@@ -16988,7 +17109,7 @@ function narrowToChangedFeatures(op, current) {
|
|
|
16988
17109
|
if (name === void 0) return op;
|
|
16989
17110
|
if (!isDeepStrictEqual(entry, byName.get(name))) changed.push(entry);
|
|
16990
17111
|
}
|
|
16991
|
-
if (changed.length === 0) throw markNonRetryable(/* @__PURE__ */ new Error(
|
|
17112
|
+
if (changed.length === 0) throw markNonRetryable(/* @__PURE__ */ new Error(`cannot revert Features: the live list differs from the recorded baseline only in the order of its entries or in entries GuardDuty added, which UpdateDetector cannot undo, so nothing on this detector was reverted. ${cdkdRemedy("cdkd drift", "--accept")} would record the live list, but it records the live value of EVERY drifted property of the stack, not only Features: revert any other drift on this detector first (for example with aws guardduty update-detector), then run it.`));
|
|
16992
17113
|
return {
|
|
16993
17114
|
...op,
|
|
16994
17115
|
value: changed
|
|
@@ -18198,7 +18319,7 @@ async function deleteInIdLogScope(logicalId, physicalId, resourceType, propertie
|
|
|
18198
18319
|
const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
|
|
18199
18320
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
18200
18321
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
18201
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
18322
|
+
const { ASGProvider } = await import("./asg-provider-C2lKCOu5.js");
|
|
18202
18323
|
const delegateRegion = ambientRegion();
|
|
18203
18324
|
let asgProvider = this.asgDeleteDelegates.get(delegateRegion);
|
|
18204
18325
|
if (asgProvider === void 0) {
|
|
@@ -18352,7 +18473,7 @@ async function sdkDeleteDelegateInCcRegion(resourceType, logicalId, physicalId)
|
|
|
18352
18473
|
const family = SDK_DELETE_FAMILIES.get(resourceType);
|
|
18353
18474
|
const cached = this.sdkDeleteDelegates.get(family);
|
|
18354
18475
|
if (cached !== void 0 && cached.region === ccRegion) return cached.provider;
|
|
18355
|
-
const provider = family === "rds" ? new (await (import("./rds-provider-
|
|
18476
|
+
const provider = family === "rds" ? new (await (import("./rds-provider-B5Ox8FBm.js"))).RDSProvider({ region: ccRegion }) : new (await (import("./neptune-provider-BYb2XZFH.js"))).NeptuneProvider({ region: ccRegion });
|
|
18356
18477
|
this.sdkDeleteDelegates.set(family, {
|
|
18357
18478
|
region: ccRegion,
|
|
18358
18479
|
provider
|
|
@@ -19265,7 +19386,7 @@ async function maskUncertifiedModelValues(model, resourceType, physicalId) {
|
|
|
19265
19386
|
if (attributeNames === void 0) {
|
|
19266
19387
|
if (!this.warnedUnresolvableSchemaTypes.has(resourceType)) {
|
|
19267
19388
|
this.warnedUnresolvableSchemaTypes.add(resourceType);
|
|
19268
|
-
this.logger.warn(`Could not resolve the CloudFormation schema for ${safeType}, so cdkd cannot tell which of its Cloud Control model keys are Fn::GetAtt attributes. Every imported attribute for this type is recorded as "${"***"}" rather than risking a credential in state.json; an Fn::GetAtt against such a resource fails with a named refusal until that resource is next created or updated by a deploy. Grant cloudformation:DescribeType and re-import to record its attributes
|
|
19389
|
+
this.logger.warn(`Could not resolve the CloudFormation schema for ${safeType}, so cdkd cannot tell which of its Cloud Control model keys are Fn::GetAtt attributes. Every imported attribute for this type is recorded as "${"***"}" rather than risking a credential in state.json; an Fn::GetAtt against such a resource fails with a named refusal until that resource is next created or updated by a ` + (isAwsEmulatorRegistryMissType(resourceType) ? "deploy. The AWS Emulator's CloudFormation registry has no schema for this type, so no permission change helps here." : "deploy. Grant cloudformation:DescribeType and re-import to record its attributes."));
|
|
19269
19390
|
}
|
|
19270
19391
|
}
|
|
19271
19392
|
const masked = Object.create(null);
|
|
@@ -19744,6 +19865,45 @@ const DELETE_ACCOUNT_LOOKUP_RETRY_DELAYS_MS = [
|
|
|
19744
19865
|
const CR_LOG_TAIL_BOILERPLATE = /^(START|END|REPORT|XRAY|INIT_START|INIT_REPORT|RESTORE_START|RESTORE_REPORT|EXTENSION) /;
|
|
19745
19866
|
const SNS_SERVICE_TOKEN_ARN_RE = /^arn:aws[a-z0-9-]*:sns:/;
|
|
19746
19867
|
|
|
19868
|
+
// src/local/custom-resource-runtime-gate.ts
|
|
19869
|
+
function localAwsEmulatorActive() {
|
|
19870
|
+
return getActiveWorkloadAwsWiring()?.mode === "emulator";
|
|
19871
|
+
}
|
|
19872
|
+
const NO_LOCAL_CUSTOM_RESOURCES_FLAG = "--no-local-custom-resources";
|
|
19873
|
+
let enabled = true;
|
|
19874
|
+
let commandPath;
|
|
19875
|
+
function setLocalCustomResourceRuntimeEnabled(value, command) {
|
|
19876
|
+
enabled = value;
|
|
19877
|
+
commandPath = command;
|
|
19878
|
+
}
|
|
19879
|
+
function localCustomResourceCommand() {
|
|
19880
|
+
return commandPath;
|
|
19881
|
+
}
|
|
19882
|
+
function localCustomResourceRuntimeActive() {
|
|
19883
|
+
return enabled && localAwsEmulatorActive();
|
|
19884
|
+
}
|
|
19885
|
+
function customResourcesRunWithoutApp() {
|
|
19886
|
+
return localCustomResourceRuntimeActive() && synthesizedStacks().length === 0;
|
|
19887
|
+
}
|
|
19888
|
+
const sentToEmulatorRuntime = /* @__PURE__ */ new Set();
|
|
19889
|
+
const failedWithoutApp = /* @__PURE__ */ new Set();
|
|
19890
|
+
function noteSentToEmulatorRuntime(logicalId) {
|
|
19891
|
+
if (customResourcesRunWithoutApp()) sentToEmulatorRuntime.add(logicalId);
|
|
19892
|
+
}
|
|
19893
|
+
function noteCustomResourceFailure(logicalId) {
|
|
19894
|
+
if (sentToEmulatorRuntime.has(logicalId)) failedWithoutApp.add(logicalId);
|
|
19895
|
+
}
|
|
19896
|
+
function customResourcesFailedWithoutApp() {
|
|
19897
|
+
return [...failedWithoutApp];
|
|
19898
|
+
}
|
|
19899
|
+
const destroyingStack = new AsyncLocalStorage();
|
|
19900
|
+
function withCustomResourceStack(stackName, fn) {
|
|
19901
|
+
return destroyingStack.run(stackName, fn);
|
|
19902
|
+
}
|
|
19903
|
+
function customResourceStackName() {
|
|
19904
|
+
return destroyingStack.getStore();
|
|
19905
|
+
}
|
|
19906
|
+
|
|
19747
19907
|
// src/provisioning/providers/custom-resource/delete-skip-reasons.ts
|
|
19748
19908
|
function deletePathMasker(callerMask, noEchoMask) {
|
|
19749
19909
|
if (callerMask === void 0) return noEchoMask;
|
|
@@ -19771,7 +19931,7 @@ function crDeployNoStateOrphan(logicalId) {
|
|
|
19771
19931
|
return `For a resource removed from the template, to give up on the delete and stop tracking it, drop the record with ${stateOrphanRecordRemedy(void 0, logicalId)}.`;
|
|
19772
19932
|
}
|
|
19773
19933
|
function crDeploySkipTail(logicalId) {
|
|
19774
|
-
return
|
|
19934
|
+
return `Meanwhile ${proseQuoted(cdkdRemedy("cdkd deploy", "--allow-unaddressed"))} exits 0 (a deploy-only flag; 'cdkd rollback' has none); the record stays and each deploy re-attempts the delete. A delete-first REPLACEMENT or a rollback delete usually FAILS the resource and keeps the record (https://github.com/go-to-k/cdkd/issues/1762). Where the other copy already exists (a replacement that created the new resource first, or a rollback that re-created the old one first), the skip only warns and the surviving copy is no longer tracked, so tear it down by hand. ` + crDeployNoStateOrphan(logicalId);
|
|
19775
19935
|
}
|
|
19776
19936
|
const CR_DEPLOY_HANDLER_SKIP_HEAD = "This delete is not part of a stack destroy (a 'cdkd deploy' template removal, replacement or rollback, or a 'cdkd rollback'). For a resource removed from the template the record is KEPT and the next 'cdkd deploy' re-sends the Delete: fix what made it fail (the handler's Delete logic, or what stopped the invoke) and re-deploy. That reaches the handler only while its function exists: if this deploy also deleted the backing Lambda, the next deploy finds it gone and DROPS the record with a warning, so tear down what the handler manages by hand. ";
|
|
19777
19937
|
const CR_DEPLOY_UNADDRESSABLE_HEAD = "This delete is not part of a stack destroy (a 'cdkd deploy' template removal, replacement or rollback, or a 'cdkd rollback'). For a resource removed from the template the record is KEPT and every 'cdkd deploy' skips it again until ServiceToken is restored: put the provider's Lambda function or SNS topic ARN back in state.json and re-deploy, which sends the Delete while that handler exists. If its Lambda function is gone, that deploy DROPS the record with a warning instead, so tear down what the handler manages by hand. ";
|
|
@@ -19786,7 +19946,7 @@ function crUnresolvedTokenUpdateRemedy() {
|
|
|
19786
19946
|
}
|
|
19787
19947
|
const CR_UNRESOLVED_TOKEN_CREATE_REMEDY = "This indicates an unresolved value in the template, or, on a rollback, in the resource's recorded state. Check that the template resolves ServiceToken to the provider's Lambda function or SNS topic ARN; a rollback replays the recorded value, so restore the template and re-deploy instead.";
|
|
19788
19948
|
function unresolvedTokenDeleteRemedy(context, logicalId) {
|
|
19789
|
-
return context?.stackDestroy === true ? `re-run
|
|
19949
|
+
return context?.stackDestroy === true ? `re-run ${proseQuoted(cdkdRemedy("cdkd import"))}, or drop the record with ${stateOrphanRecordRemedy(context, logicalId)}, to recover.` : `put the provider's Lambda function or SNS topic ARN back as ServiceToken in state.json and re-run to recover. ${crDeployNoStateOrphan(logicalId)}`;
|
|
19790
19950
|
}
|
|
19791
19951
|
function unaddressableServiceTokenRemedy(context, logicalId) {
|
|
19792
19952
|
return context?.stackDestroy === true ? crDestroyUnaddressableRemedy(context, logicalId) : `${CR_DEPLOY_UNADDRESSABLE_HEAD}${crDeploySkipTail(logicalId)}`;
|
|
@@ -19927,6 +20087,7 @@ async function create$1(logicalId, resourceType, properties, context) {
|
|
|
19927
20087
|
};
|
|
19928
20088
|
} catch (error) {
|
|
19929
20089
|
markAuxiliaryFailure(error, logicalId);
|
|
20090
|
+
noteCustomResourceFailure(logicalId);
|
|
19930
20091
|
const cause = error instanceof Error ? error : void 0;
|
|
19931
20092
|
throw this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to create custom resource ${logicalId}: ${text}`, resourceType, logicalId, void 0, cause));
|
|
19932
20093
|
}
|
|
@@ -19965,6 +20126,7 @@ async function update$1(logicalId, physicalId, resourceType, properties, previou
|
|
|
19965
20126
|
...cfnResponse.NoEcho === true && { noEchoAttributes: true }
|
|
19966
20127
|
};
|
|
19967
20128
|
} catch (error) {
|
|
20129
|
+
noteCustomResourceFailure(logicalId);
|
|
19968
20130
|
const cause = error instanceof Error ? error : void 0;
|
|
19969
20131
|
throw this.wrapCaughtError(context?.maskSecrets, error, (text) => new ProvisioningError(`Failed to update custom resource ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
|
|
19970
20132
|
}
|
|
@@ -20424,7 +20586,7 @@ async function deleteImpl(logicalId, physicalId, resourceType, properties, conte
|
|
|
20424
20586
|
};
|
|
20425
20587
|
}
|
|
20426
20588
|
if (carriesSecretMask(payload)) {
|
|
20427
|
-
this.logger.warn(safeMsg`Custom resource ${logicalId} is recorded in state with a property holding the ` + "'***' redaction mask, which no NoEcho coordinate of the record names, so cdkd cannot re-resolve it and its handler would receive the mask in ResourceProperties; skipping deletion — the handler is not invoked, so anything this custom resource manages is LEFT IN PLACE. For a record 'cdkd import' or 'cdkd scrub' wrote, a
|
|
20589
|
+
this.logger.warn(safeMsg`Custom resource ${logicalId} is recorded in state with a property holding the ` + "'***' redaction mask, which no NoEcho coordinate of the record names, so cdkd cannot re-resolve it and its handler would receive the mask in ResourceProperties; skipping deletion — the handler is not invoked, so anything this custom resource manages is " + safeMsg`LEFT IN PLACE. For a record 'cdkd import' or 'cdkd scrub' wrote, a ${proseQuoted(cdkdRemedy("cdkd deploy"))} of the ` + safeMsg`app first records which positions hold a NoEcho value, after which ${proseQuoted(cdkdRemedy("cdkd destroy"))} ` + `sends the delete. ` + safeMsg`${noEchoPropertiesRemedy(context, logicalId)}`);
|
|
20428
20590
|
return {
|
|
20429
20591
|
outcome: "skipped",
|
|
20430
20592
|
reason: CR_MASKED_PROPERTIES_SKIP_REASON
|
|
@@ -20900,31 +21062,6 @@ function debugWaiterRejections(logicalId, rejections) {
|
|
|
20900
21062
|
for (const line of waiterRejectionDebugLines(rejections)) this.logger.debug(safeMsg`Readiness waiter for ${logicalId} observed ${line}`);
|
|
20901
21063
|
}
|
|
20902
21064
|
|
|
20903
|
-
// src/local/custom-resource-runtime-gate.ts
|
|
20904
|
-
function localAwsEmulatorActive() {
|
|
20905
|
-
return getActiveWorkloadAwsWiring()?.mode === "emulator";
|
|
20906
|
-
}
|
|
20907
|
-
const NO_LOCAL_CUSTOM_RESOURCES_FLAG = "--no-local-custom-resources";
|
|
20908
|
-
let enabled = true;
|
|
20909
|
-
let commandPath;
|
|
20910
|
-
function setLocalCustomResourceRuntimeEnabled(value, command) {
|
|
20911
|
-
enabled = value;
|
|
20912
|
-
commandPath = command;
|
|
20913
|
-
}
|
|
20914
|
-
function localCustomResourceCommand() {
|
|
20915
|
-
return commandPath;
|
|
20916
|
-
}
|
|
20917
|
-
function localCustomResourceRuntimeActive() {
|
|
20918
|
-
return enabled && localAwsEmulatorActive();
|
|
20919
|
-
}
|
|
20920
|
-
const destroyingStack = new AsyncLocalStorage();
|
|
20921
|
-
function withCustomResourceStack(stackName, fn) {
|
|
20922
|
-
return destroyingStack.run(stackName, fn);
|
|
20923
|
-
}
|
|
20924
|
-
function customResourceStackName() {
|
|
20925
|
-
return destroyingStack.getStore();
|
|
20926
|
-
}
|
|
20927
|
-
|
|
20928
21065
|
// src/provisioning/providers/custom-resource/dispatch.ts
|
|
20929
21066
|
async function sendRequest(serviceToken, request, responseKey, logicalId, operation, onDelivered, mask) {
|
|
20930
21067
|
if (this.isSnsServiceToken(serviceToken)) {
|
|
@@ -21011,12 +21148,13 @@ async function publishToSns(topicArn, request) {
|
|
|
21011
21148
|
}
|
|
21012
21149
|
async function invokeLambda(serviceToken, request) {
|
|
21013
21150
|
if (localCustomResourceRuntimeActive()) {
|
|
21014
|
-
const { invokeCustomResourceFunctionLocally } = await import("./custom-resource-runtime-
|
|
21151
|
+
const { invokeCustomResourceFunctionLocally } = await import("./custom-resource-runtime-BcxDxd28.js");
|
|
21015
21152
|
const local = await invokeCustomResourceFunctionLocally({
|
|
21016
21153
|
lambda: this.lambdaClient,
|
|
21017
21154
|
s3: this.s3Client
|
|
21018
21155
|
}, serviceToken, request);
|
|
21019
21156
|
if (local !== void 0) return local;
|
|
21157
|
+
if (typeof request["LogicalResourceId"] === "string") noteSentToEmulatorRuntime(request["LogicalResourceId"]);
|
|
21020
21158
|
}
|
|
21021
21159
|
return await this.lambdaClient.send(new InvokeCommand({
|
|
21022
21160
|
FunctionName: serviceToken,
|
|
@@ -24159,7 +24297,7 @@ async function ccRoutedInstanceTakesNoSnapshot(input) {
|
|
|
24159
24297
|
if (resourceType !== "AWS::RDS::DBInstance") return false;
|
|
24160
24298
|
if (region === void 0 || region === "") return false;
|
|
24161
24299
|
const mask = input.mask ?? ((text) => text);
|
|
24162
|
-
const { describeDBInstanceInRegion, isLiveReadReplica } = await import("./read-replica-
|
|
24300
|
+
const { describeDBInstanceInRegion, isLiveReadReplica } = await import("./read-replica-6SDKYiLa.js").then((n) => n.l);
|
|
24163
24301
|
let reason;
|
|
24164
24302
|
try {
|
|
24165
24303
|
const live = await describeDBInstanceInRegion(physicalId, region);
|
|
@@ -24239,7 +24377,11 @@ function maskedRecordRemedyFor(reads, resources, causeScoped = false) {
|
|
|
24239
24377
|
{ literal: "--force" }
|
|
24240
24378
|
]).command}`);
|
|
24241
24379
|
}
|
|
24242
|
-
if (withheld.length > 0) parts.push(`${causeScoped ? "If cause (3) applies, re-import" : "Re-import"} the record that HOLDS the mask for ${withheld.map(shown).join(", ")}, but the command is withheld: that is not a plain CloudFormation logical id, so a pasted cdkd import line could be reshaped by the shell or name a different resource. Read the id from
|
|
24380
|
+
if (withheld.length > 0) parts.push(`${causeScoped ? "If cause (3) applies, re-import" : "Re-import"} the record that HOLDS the mask for ${withheld.map(shown).join(", ")}, but the command is withheld: that is not a plain CloudFormation logical id, so a pasted cdkd import line could be reshaped by the shell or name a different resource. Read the id from ${proseQuoted(cdkdRemedy("cdkd state show"))} and quote it yourself, in ${pasteableCommand("cdkd import", [
|
|
24381
|
+
{ hole: "stack" },
|
|
24382
|
+
{ literal: `--resource ${commandHole("id")}=${commandHole("physicalId")}` },
|
|
24383
|
+
{ literal: "--force" }
|
|
24384
|
+
]).command}.`);
|
|
24243
24385
|
}
|
|
24244
24386
|
if (unclearableTargets.length > 0) parts.push(`Do NOT re-import ${unclearableTargets.map(shown).join(", ")}: a custom resource's import records no attributes, so the masked bag is carried forward unchanged and the refusal repeats.` + (causeScoped ? ` Cause (1) above is the one that applies to it.` : ""));
|
|
24245
24387
|
if (foreignReads.length > 0) {
|
|
@@ -24442,7 +24584,7 @@ function skipUnaddressableReplay(scope, logger, op, what, source = "record") {
|
|
|
24442
24584
|
recordRollbackSkip(scope, op, UNADDRESSABLE_JOURNAL_SKIP_CAUSE);
|
|
24443
24585
|
return;
|
|
24444
24586
|
}
|
|
24445
|
-
logger.warn(safeMsg` Rollback: Cannot ${what} ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) ` + "— its state record has no non-empty string 'physicalId', so cdkd cannot address it in AWS and sent nothing for it. The resource and its state record are left exactly as they are. Repair the record's 'physicalId' (inspect it with
|
|
24587
|
+
logger.warn(safeMsg` Rollback: Cannot ${what} ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) ` + "— its state record has no non-empty string 'physicalId', so cdkd cannot address it in AWS and sent nothing for it. The resource and its state record are left exactly as they are. Repair the record's 'physicalId' (inspect it with " + safeMsg`${proseQuoted(cdkdRemedy("cdkd state show"), "`")}), then re-converge it with ` + safeMsg`${proseQuoted(cdkdRemedy("cdkd deploy"), "`")}.`);
|
|
24446
24588
|
recordRollbackSkip(scope, op, UNADDRESSABLE_SKIP_CAUSE);
|
|
24447
24589
|
}
|
|
24448
24590
|
async function keptForAnotherHolder(scope, logger, op, physicalId) {
|
|
@@ -24714,7 +24856,7 @@ function requireRestorableBaseline(bag, logger, { logicalId, consequence, remedy
|
|
|
24714
24856
|
return false;
|
|
24715
24857
|
}
|
|
24716
24858
|
const shape = bag === null ? "null" : Array.isArray(bag) ? "an array" : `a ${typeof bag}`;
|
|
24717
|
-
throw new CdkdError(`Cannot roll ${shownLogicalId(logicalId)} back: its recorded previous state has a \`properties\` field that is not a property bag (${shape}), so cdkd cannot tell what to restore it to. Replaying it would do one of two things, and cdkd does neither: send the malformed value to the provider as-is, or send an empty desired state (which would ${consequence}). The rollback JOURNAL record is kept: once that record holds a property bag again, ${retry}. Otherwise fix forward with
|
|
24859
|
+
throw new CdkdError(`Cannot roll ${shownLogicalId(logicalId)} back: its recorded previous state has a \`properties\` field that is not a property bag (${shape}), so cdkd cannot tell what to restore it to. Replaying it would do one of two things, and cdkd does neither: send the malformed value to the provider as-is, or send an empty desired state (which would ${consequence}). The rollback JOURNAL record is kept: once that record holds a property bag again, ${retry}. Otherwise fix forward with ${proseQuoted(cdkdRemedy("cdkd deploy"), "`")}, or remove the stack with ${proseQuoted(cdkdRemedy("cdkd destroy"), "`")}.`, "ROLLBACK_UNUSABLE_BASELINE");
|
|
24718
24860
|
}
|
|
24719
24861
|
function isRestorableBag(bag) {
|
|
24720
24862
|
return typeof bag === "object" && bag !== null && !Array.isArray(bag);
|
|
@@ -25564,7 +25706,7 @@ function refuseRedactedAttributeReads(logicalId, resourceType, context) {
|
|
|
25564
25706
|
const producers = [...new Set(reads.map((read) => read.logicalId).filter((id) => !!id))];
|
|
25565
25707
|
throw new ProvisioningError(safeMsg`Cannot resolve ${reads.map((read) => read.display).join(", ")} for ${logicalId}: ` + safeMsg`${producers.map((id) => displayIdent(id)).join(", ")} declared ${reads.length === 1 ? "that attribute" : "those attributes"} NoEcho, ` + safeMsg`so cdkd's recorded state holds only the redaction mask for ${reads.length === 1 ? "it" : "them"}, ` + `and cdkd does not re-run a producer to recover a value. Remedy: deploy a change to the ` + safeMsg`producer in the SAME run as ${logicalId} (for a custom resource, change one of its ` + "properties, e.g. a nonce / version property, so its handler runs again and supplies the value), or stop declaring the value NoEcho.", resourceType, logicalId);
|
|
25566
25708
|
}
|
|
25567
|
-
throw new ProvisioningError(safeMsg`Cannot resolve ${reads.map((read) => read.display).join(", ")} for ${logicalId}: cdkd's recorded state holds only the ` + `redaction mask there, and the value is not recoverable from state. There are four ways a record comes to hold the mask. (1) A custom resource handler declared its response NoEcho: true — the value is generated by the handler, so cdkd has nothing to re-derive it from and must not write the literal mask to AWS. Remedies: force that custom resource to update (change one of its properties, e.g. a nonce / version property) so its handler runs again and supplies the value in this same run; or stop setting NoEcho on that response. If the value comes from ANOTHER stack, the producer and this stack must deploy in ONE run (cdkd deploy --all, or cdkd deploy '**' when either is inside a CDK Stage) with the producer's custom resource actually running — re-deploying the producer by itself does not help, because it re-masks the value on the way into its own state. (2) The value holds the Fn::Base64 encoding of a secret value (a {{resolve:...}} dynamic reference under Fn::Base64, such as EC2 UserData), which cdkd never records — so a deploy that leaves the resource or output holding it unchanged reads the mask again, and a re-import does not recover it. Remedy: have this resource build the value itself from the SECRET's own reference (the {{resolve:secretsmanager:...}} or {{resolve:ssm-secure:...}} reference, or a {{resolve:ssm:...}} of a SecureString parameter, that the encoding was made from) under its own Fn::Base64, instead of reading it from another resource's attribute or another stack's output — not by a {{resolve:ssm:...}} read of a String parameter holding the encoding, which cdkd treats as public and would record in state in the clear. (3) The resource is recorded through the Cloud Control fallback (by a deploy or by 'cdkd import'), which keeps in the clear only the Fn::GetAtt attributes it can vouch for and masks the rest. If the name above is not an Fn::GetAtt attribute CloudFormation accepts for that resource type, no record will ever hold it: stop reading it. If it is one, 'cdkd import' masked it because it could not vouch for the value, or could not read the schema and warned about it when it happened (if that warning named a missing cloudformation:DescribeType permission, grant it first); a deploy that creates or updates the resource records it, unless its value came from a secret. (4) Two secret values cdkd resolved overlap inside the value, so no single {{resolve:...}} reference renders it and cdkd stored the mask rather than part of a secret: change the producer's value (or rotate one of the secrets) so that they no longer overlap, and deploy the producer in the same run as this resource. See https://github.com/go-to-k/cdkd/issues/2449. ${DeployEngine.maskedRecordRemedyFor(reads, context.resources, true)}`, resourceType, logicalId);
|
|
25709
|
+
throw new ProvisioningError(safeMsg`Cannot resolve ${reads.map((read) => read.display).join(", ")} for ${logicalId}: cdkd's recorded state holds only the ` + `redaction mask there, and the value is not recoverable from state. There are four ways a record comes to hold the mask. (1) A custom resource handler declared its response NoEcho: true — the value is generated by the handler, so cdkd has nothing to re-derive it from and must not write the literal mask to AWS. Remedies: force that custom resource to update (change one of its properties, e.g. a nonce / version property) so its handler runs again and supplies the value in this same run; or stop setting NoEcho on that response. If the value comes from ANOTHER stack, the producer and this stack must deploy in ONE run (${cdkdRemedy("cdkd deploy", "--all")}, or ${cdkdRemedy("cdkd deploy", "'**'")} when either is inside a CDK Stage) with the producer's custom resource actually running — re-deploying the producer by itself does not help, because it re-masks the value on the way into its own state. (2) The value holds the Fn::Base64 encoding of a secret value (a {{resolve:...}} dynamic reference under Fn::Base64, such as EC2 UserData), which cdkd never records — so a deploy that leaves the resource or output holding it unchanged reads the mask again, and a re-import does not recover it. Remedy: have this resource build the value itself from the SECRET's own reference (the {{resolve:secretsmanager:...}} or {{resolve:ssm-secure:...}} reference, or a {{resolve:ssm:...}} of a SecureString parameter, that the encoding was made from) under its own Fn::Base64, instead of reading it from another resource's attribute or another stack's output — not by a {{resolve:ssm:...}} read of a String parameter holding the encoding, which cdkd treats as public and would record in state in the clear. (3) The resource is recorded through the Cloud Control fallback (by a deploy or by 'cdkd import'), which keeps in the clear only the Fn::GetAtt attributes it can vouch for and masks the rest. If the name above is not an Fn::GetAtt attribute CloudFormation accepts for that resource type, no record will ever hold it: stop reading it. If it is one, 'cdkd import' masked it because it could not vouch for the value, or could not read the schema and warned about it when it happened (if that warning named a missing cloudformation:DescribeType permission, grant it first); a deploy that creates or updates the resource records it, unless its value came from a secret. (4) Two secret values cdkd resolved overlap inside the value, so no single {{resolve:...}} reference renders it and cdkd stored the mask rather than part of a secret: change the producer's value (or rotate one of the secrets) so that they no longer overlap, and deploy the producer in the same run as this resource. See https://github.com/go-to-k/cdkd/issues/2449. ${DeployEngine.maskedRecordRemedyFor(reads, context.resources, true)}`, resourceType, logicalId);
|
|
25568
25710
|
}
|
|
25569
25711
|
|
|
25570
25712
|
// src/deployment/deploy-engine/masking.ts
|
|
@@ -26071,7 +26213,7 @@ function generatedReplacementHolderAdvice(input) {
|
|
|
26071
26213
|
const old = displaySafe(input.mask(input.oldPhysicalId), { asciiOnly: true });
|
|
26072
26214
|
const lead = ` The colliding name ${isInertUnquoted(name) ? name : "the generated name"} is the one this replacement generates for its next name generation, so its holder is most likely the new resource an interrupted earlier attempt of this replacement created. If it is, `;
|
|
26073
26215
|
const tail = `, or delete it and re-run the deploy.`;
|
|
26074
|
-
if (input.stackName.includes("~")) return lead + `adopt it through the top-level stack with
|
|
26216
|
+
if (input.stackName.includes("~")) return lead + `adopt it through the top-level stack with ${proseQuoted(cdkdRemedy("cdkd import"), "`")} (then delete ${old} by hand)` + tail;
|
|
26075
26217
|
const adopt = pasteableCommand("cdkd import", [{
|
|
26076
26218
|
value: input.stackName,
|
|
26077
26219
|
hole: "stack"
|
|
@@ -26081,7 +26223,7 @@ function generatedReplacementHolderAdvice(input) {
|
|
|
26081
26223
|
hole: "logicalId=physicalId"
|
|
26082
26224
|
}]);
|
|
26083
26225
|
const command = input.mask(adopt.command) === adopt.command ? adopt.command : void 0;
|
|
26084
|
-
return lead + (command === void 0 ? `adopt it with
|
|
26226
|
+
return lead + (command === void 0 ? `adopt it with ${proseQuoted(cdkdRemedy("cdkd import"), "`")}` : `adopt it with ${proseQuoted(command, "`")} (using its physical id where the type records another)`) + ` and then delete ${old} by hand` + tail;
|
|
26085
26227
|
}
|
|
26086
26228
|
function orphanedNameCollisionAdvice(providerRegistry, changeType, logicalId, error) {
|
|
26087
26229
|
if (changeType !== "CREATE") return void 0;
|
|
@@ -27420,7 +27562,7 @@ var ReplayResolvers = class {
|
|
|
27420
27562
|
};
|
|
27421
27563
|
function regionAmbiguousReplaySecretError(logicalId, propertyPath, secretName, foreignProducerRegions, consumerRegion, execCtx) {
|
|
27422
27564
|
const where = propertyPath === "" ? "" : ` property ${quotedPlainOr(propertyPath, "property path")}`;
|
|
27423
|
-
const error = new CdkdError(`Rollback of ${shownLogicalId(logicalId)}${where} cannot re-resolve the secret reference ${quotedPlainOr(secretName, "secret name")}: the reference carries no region of its own, and this stack read across a region boundary (producer region(s) on record: ${foreignProducerRegions.map((r) => plainOrDescribed(r, "region")).join(", ")}), so it may have been resolved in one of those rather than in ${quotedOrDescribed(consumerRegion, "region")}. A secret of the same name in two regions is two independent values, so replaying this would write the WRONG secret to a live resource. Refusing instead. Resolve the reference in its own region and set the property directly (or spell it as a full ARN, which names its region and is resolved there), then re-run ${rerunRollbackPhrase(execCtx, "
|
|
27565
|
+
const error = new CdkdError(`Rollback of ${shownLogicalId(logicalId)}${where} cannot re-resolve the secret reference ${quotedPlainOr(secretName, "secret name")}: the reference carries no region of its own, and this stack read across a region boundary (producer region(s) on record: ${foreignProducerRegions.map((r) => plainOrDescribed(r, "region")).join(", ")}), so it may have been resolved in one of those rather than in ${quotedOrDescribed(consumerRegion, "region")}. A secret of the same name in two regions is two independent values, so replaying this would write the WRONG secret to a live resource. Refusing instead. Resolve the reference in its own region and set the property directly (or spell it as a full ARN, which names its region and is resolved there), then re-run ${rerunRollbackPhrase(execCtx, proseQuoted(cdkdRemedy("cdkd rollback")))}.`, "ROLLBACK_SECRET_REGION_AMBIGUOUS");
|
|
27424
27566
|
return markNonRetryable(error);
|
|
27425
27567
|
}
|
|
27426
27568
|
function refuseUnprovenReplaySecret(leaf, propertyPath, logicalId, execCtx, recordedRegions) {
|
|
@@ -27433,7 +27575,7 @@ function refuseUnprovenReplaySecret(leaf, propertyPath, logicalId, execCtx, reco
|
|
|
27433
27575
|
}
|
|
27434
27576
|
function regionUnknownReplaySecretError(logicalId, propertyPath, secretName, consumerRegion, execCtx) {
|
|
27435
27577
|
const where = propertyPath === "" ? "" : ` property ${quotedPlainOr(propertyPath, "property path")}`;
|
|
27436
|
-
return new CdkdError(`Rollback of ${shownLogicalId(logicalId)}${where} cannot re-resolve the secret reference ${quotedPlainOr(secretName, "secret name")}: the reference carries no region of its own, and this is a nested stack, and the cross-region reads its parent made are not known to this replay, so the parent may have resolved it in another region than ${quotedOrDescribed(consumerRegion, "region")}. A secret of the same name in two regions is two independent values, so replaying this could write the WRONG secret to a live resource. Refusing instead. Where the journal of the top-level stack still holds this run, roll back the top-level stack instead, which supplies its regions. Otherwise resolve the reference in its own region and set the property directly (or spell it as a full ARN, which names its region and is resolved there), then re-run ${rerunRollbackPhrase(execCtx, "
|
|
27578
|
+
return new CdkdError(`Rollback of ${shownLogicalId(logicalId)}${where} cannot re-resolve the secret reference ${quotedPlainOr(secretName, "secret name")}: the reference carries no region of its own, and this is a nested stack, and the cross-region reads its parent made are not known to this replay, so the parent may have resolved it in another region than ${quotedOrDescribed(consumerRegion, "region")}. A secret of the same name in two regions is two independent values, so replaying this could write the WRONG secret to a live resource. Refusing instead. Where the journal of the top-level stack still holds this run, roll back the top-level stack instead, which supplies its regions. Otherwise resolve the reference in its own region and set the property directly (or spell it as a full ARN, which names its region and is resolved there), then re-run ${rerunRollbackPhrase(execCtx, proseQuoted(cdkdRemedy("cdkd rollback")))}.`, "ROLLBACK_SECRET_REGION_AMBIGUOUS");
|
|
27437
27579
|
}
|
|
27438
27580
|
async function resolveLeafByRegion(leaf, propertyPath, logicalId, execCtx, resolvers, resolverContext, recordedRegions) {
|
|
27439
27581
|
const verdicts = dynamicReferenceTokens(leaf).map((token) => [token, classifyRecordedSecretRegion(token, execCtx.region, execCtx.importedProducerRegions, recordedRegions)]);
|
|
@@ -27762,7 +27904,7 @@ async function journaledOrphanKeepReason(op, foreignHolder, ctx) {
|
|
|
27762
27904
|
keep: `${holding.by} holds a resource of that type under the same physical id now`,
|
|
27763
27905
|
finish: "it now belongs to that stack: leave it to that stack"
|
|
27764
27906
|
};
|
|
27765
|
-
if (holding?.kind === "unreadable") return { retry: `${holding.what} leaves open whether another stack holds it now; once that record can be read (re-deploy or inspect it with
|
|
27907
|
+
if (holding?.kind === "unreadable") return { retry: `${holding.what} leaves open whether another stack holds it now; once that record can be read (re-deploy or inspect it with ${proseQuoted(cdkdRemedy("cdkd state show"), "`")}, or retry when the bucket is reachable), re-run` };
|
|
27766
27908
|
const created = await createdResourceStillThere(op, ctx);
|
|
27767
27909
|
if (created === "gone") return "gone";
|
|
27768
27910
|
if (created === "mismatch") return { keep: "the resource now under that id is another one (its identity differs from the one the failed deploy recorded, so its name was reused)" };
|
|
@@ -27948,7 +28090,7 @@ async function restoreHeldInlinePolicies(writers, stateResources, stackName, ctx
|
|
|
27948
28090
|
async function restoreOne({ kind, holders, unreadable, unsettled }, stateResources, stackName, ctx, result, refuseAll) {
|
|
27949
28091
|
const { logger } = ctx;
|
|
27950
28092
|
const ids = [...new Set(holders.map((h) => h.logicalId))].map((id) => safe(id)).join(", ");
|
|
27951
|
-
const lost = safeMsg`the ${kind} it is on lacks that inline policy until the resource is next updated, or ` +
|
|
28093
|
+
const lost = safeMsg`the ${kind} it is on lacks that inline policy until the resource is next updated, or ` + safeMsg`${proseQuoted(pasteableCommand("cdkd drift", [{ hole: "stack" }, { literal: "--revert" }]).command)} restores it`;
|
|
27952
28094
|
if (refuseAll || unsettled.length > 0) {
|
|
27953
28095
|
const pending = refuseAll ? ids : unsettled.map((id) => safe(id)).join(", ");
|
|
27954
28096
|
logger.warn(safeMsg` Rollback: an inline policy this rollback removed is recorded by ${ids}, but the ` + safeMsg`rollback of ${pending} has not completed, so that record may be the failed ` + safeMsg`deploy's and cdkd did not put it back; ${lost}.`);
|
|
@@ -28107,7 +28249,7 @@ function resolveReplacementOldType(op) {
|
|
|
28107
28249
|
}
|
|
28108
28250
|
function unroutableReplacementError(op, reason, remedyCtx) {
|
|
28109
28251
|
const remedy = orphanRemedy(op.logicalId, remedyCtx);
|
|
28110
|
-
return ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): ${reason}, so cdkd will not guess which provider re-creates the old resource. Nothing was changed. The journal is kept: fix forward with cdkd deploy` + (remedy.offered ? ", or leave this resource as it is and let the rest of the rollback proceed by re-running with the command below." : ".") + `${remedy.clause}${remedy.line}`, "ROLLBACK_REPLACEMENT_UNROUTABLE")));
|
|
28252
|
+
return ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): ${reason}, so cdkd will not guess which provider re-creates the old resource. Nothing was changed. The journal is kept: fix forward with ${cdkdRemedy("cdkd deploy")}` + (remedy.offered ? ", or leave this resource as it is and let the rest of the rollback proceed by re-running with the command below." : ".") + `${remedy.clause}${remedy.line}`, "ROLLBACK_REPLACEMENT_UNROUTABLE")));
|
|
28111
28253
|
}
|
|
28112
28254
|
function isTypeChangeOp(op) {
|
|
28113
28255
|
const { stamped, recorded } = journaledOldTypes(op);
|
|
@@ -28225,6 +28367,292 @@ function withPreviousPolicies(current, previous) {
|
|
|
28225
28367
|
};
|
|
28226
28368
|
}
|
|
28227
28369
|
|
|
28370
|
+
// src/analyzer/implicit-delete-deps.ts
|
|
28371
|
+
const IMPLICIT_DELETE_DEPENDENCIES = {
|
|
28372
|
+
"AWS::EC2::InternetGateway": ["AWS::EC2::VPCGatewayAttachment", "AWS::EC2::NatGateway"],
|
|
28373
|
+
"AWS::EC2::VPCGatewayAttachment": ["AWS::EC2::NatGateway"],
|
|
28374
|
+
"AWS::Events::EventBus": ["AWS::Events::Rule"],
|
|
28375
|
+
"AWS::Athena::WorkGroup": ["AWS::Athena::NamedQuery"],
|
|
28376
|
+
"AWS::CloudFront::ResponseHeadersPolicy": ["AWS::CloudFront::Distribution"],
|
|
28377
|
+
"AWS::CloudFront::CachePolicy": ["AWS::CloudFront::Distribution"],
|
|
28378
|
+
"AWS::CloudFront::OriginAccessControl": ["AWS::CloudFront::Distribution"],
|
|
28379
|
+
"AWS::EC2::VPC": [
|
|
28380
|
+
"AWS::EC2::Subnet",
|
|
28381
|
+
"AWS::EC2::SecurityGroup",
|
|
28382
|
+
"AWS::EC2::InternetGateway",
|
|
28383
|
+
"AWS::EC2::EgressOnlyInternetGateway",
|
|
28384
|
+
"AWS::EC2::VPCGatewayAttachment",
|
|
28385
|
+
"AWS::EC2::RouteTable"
|
|
28386
|
+
],
|
|
28387
|
+
"AWS::EC2::Subnet": ["AWS::EC2::SubnetRouteTableAssociation", "AWS::Lambda::Function"],
|
|
28388
|
+
"AWS::EC2::RouteTable": ["AWS::EC2::Route", "AWS::EC2::SubnetRouteTableAssociation"],
|
|
28389
|
+
"AWS::EC2::SecurityGroup": [
|
|
28390
|
+
"AWS::EC2::SecurityGroupIngress",
|
|
28391
|
+
"AWS::EC2::SecurityGroupEgress",
|
|
28392
|
+
"AWS::Lambda::Function"
|
|
28393
|
+
]
|
|
28394
|
+
};
|
|
28395
|
+
const ALARM_RULE_FUNCTION_REGEX = /\b(?:ALARM|OK|INSUFFICIENT_DATA)\s*\(\s*([^)]*?)\s*\)/gi;
|
|
28396
|
+
function extractReferencedAlarmNames(alarmRule) {
|
|
28397
|
+
const names = /* @__PURE__ */ new Set();
|
|
28398
|
+
for (const match of alarmRule.matchAll(ALARM_RULE_FUNCTION_REGEX)) {
|
|
28399
|
+
let arg = (match[1] ?? "").trim();
|
|
28400
|
+
if (arg.length === 0) continue;
|
|
28401
|
+
if (arg.startsWith("\"") && arg.endsWith("\"") || arg.startsWith("'") && arg.endsWith("'")) arg = arg.slice(1, -1);
|
|
28402
|
+
if (arg.length === 0) continue;
|
|
28403
|
+
const arnAlarmMatch = /:alarm:(.+)$/.exec(arg);
|
|
28404
|
+
if (arnAlarmMatch?.[1]) names.add(arnAlarmMatch[1]);
|
|
28405
|
+
else names.add(arg);
|
|
28406
|
+
}
|
|
28407
|
+
return [...names];
|
|
28408
|
+
}
|
|
28409
|
+
function computeImplicitDeleteEdges(resources) {
|
|
28410
|
+
const edges = [];
|
|
28411
|
+
const alarmTypes = /* @__PURE__ */ new Set(["AWS::CloudWatch::Alarm", "AWS::CloudWatch::CompositeAlarm"]);
|
|
28412
|
+
const nameToLogicalId = /* @__PURE__ */ new Map();
|
|
28413
|
+
for (const [logicalId, resource] of Object.entries(resources)) {
|
|
28414
|
+
if (!alarmTypes.has(resource.resourceType)) continue;
|
|
28415
|
+
const alarmName = typeof resource.properties?.["AlarmName"] === "string" ? resource.properties["AlarmName"] : resource.physicalId;
|
|
28416
|
+
if (alarmName) nameToLogicalId.set(alarmName, logicalId);
|
|
28417
|
+
}
|
|
28418
|
+
for (const [logicalId, resource] of Object.entries(resources)) {
|
|
28419
|
+
if (resource.resourceType !== "AWS::CloudWatch::CompositeAlarm") continue;
|
|
28420
|
+
const alarmRule = resource.properties?.["AlarmRule"];
|
|
28421
|
+
if (typeof alarmRule !== "string") continue;
|
|
28422
|
+
for (const referencedName of extractReferencedAlarmNames(alarmRule)) {
|
|
28423
|
+
const referencedLogicalId = nameToLogicalId.get(referencedName);
|
|
28424
|
+
if (!referencedLogicalId || referencedLogicalId === logicalId) continue;
|
|
28425
|
+
edges.push({
|
|
28426
|
+
before: logicalId,
|
|
28427
|
+
after: referencedLogicalId
|
|
28428
|
+
});
|
|
28429
|
+
}
|
|
28430
|
+
}
|
|
28431
|
+
return edges;
|
|
28432
|
+
}
|
|
28433
|
+
|
|
28434
|
+
// src/deployment/dag-executor.ts
|
|
28435
|
+
var DagExecutor = class {
|
|
28436
|
+
nodes = /* @__PURE__ */ new Map();
|
|
28437
|
+
logger = getLogger().child("DagExecutor");
|
|
28438
|
+
priorityById = null;
|
|
28439
|
+
timingScope;
|
|
28440
|
+
constructor(timingScope) {
|
|
28441
|
+
this.timingScope = timingScope;
|
|
28442
|
+
}
|
|
28443
|
+
add(node) {
|
|
28444
|
+
this.nodes.set(node.id, node);
|
|
28445
|
+
}
|
|
28446
|
+
computePriorities() {
|
|
28447
|
+
if (this.priorityById) return this.priorityById;
|
|
28448
|
+
const dependentsOf = /* @__PURE__ */ new Map();
|
|
28449
|
+
for (const node of this.nodes.values()) for (const depId of node.dependencies) {
|
|
28450
|
+
if (!this.nodes.has(depId)) continue;
|
|
28451
|
+
let set = dependentsOf.get(depId);
|
|
28452
|
+
if (!set) {
|
|
28453
|
+
set = /* @__PURE__ */ new Set();
|
|
28454
|
+
dependentsOf.set(depId, set);
|
|
28455
|
+
}
|
|
28456
|
+
set.add(node.id);
|
|
28457
|
+
}
|
|
28458
|
+
const memo = /* @__PURE__ */ new Map();
|
|
28459
|
+
const visiting = /* @__PURE__ */ new Set();
|
|
28460
|
+
const collect = (id) => {
|
|
28461
|
+
const cached = memo.get(id);
|
|
28462
|
+
if (cached) return cached;
|
|
28463
|
+
const acc = /* @__PURE__ */ new Set();
|
|
28464
|
+
if (visiting.has(id)) return acc;
|
|
28465
|
+
visiting.add(id);
|
|
28466
|
+
for (const dependent of dependentsOf.get(id) ?? []) {
|
|
28467
|
+
acc.add(dependent);
|
|
28468
|
+
for (const t of collect(dependent)) acc.add(t);
|
|
28469
|
+
}
|
|
28470
|
+
visiting.delete(id);
|
|
28471
|
+
memo.set(id, acc);
|
|
28472
|
+
return acc;
|
|
28473
|
+
};
|
|
28474
|
+
const priorities = /* @__PURE__ */ new Map();
|
|
28475
|
+
for (const id of this.nodes.keys()) priorities.set(id, collect(id).size);
|
|
28476
|
+
this.priorityById = priorities;
|
|
28477
|
+
return priorities;
|
|
28478
|
+
}
|
|
28479
|
+
has(id) {
|
|
28480
|
+
return this.nodes.has(id);
|
|
28481
|
+
}
|
|
28482
|
+
size() {
|
|
28483
|
+
return this.nodes.size;
|
|
28484
|
+
}
|
|
28485
|
+
values() {
|
|
28486
|
+
return this.nodes.values();
|
|
28487
|
+
}
|
|
28488
|
+
async execute(concurrency, fn, cancelled = () => false) {
|
|
28489
|
+
let active = 0;
|
|
28490
|
+
const errors = [];
|
|
28491
|
+
const priority = this.computePriorities();
|
|
28492
|
+
const timingScope = phaseTimingsEnabled() ? this.timingScope : void 0;
|
|
28493
|
+
const readySince = /* @__PURE__ */ new Map();
|
|
28494
|
+
return new Promise((resolve, reject) => {
|
|
28495
|
+
const dispatch = () => {
|
|
28496
|
+
let changed = true;
|
|
28497
|
+
while (changed) {
|
|
28498
|
+
changed = false;
|
|
28499
|
+
for (const node of this.nodes.values()) {
|
|
28500
|
+
if (node.state !== "pending") continue;
|
|
28501
|
+
if ([...node.dependencies].some((depId) => {
|
|
28502
|
+
const dep = this.nodes.get(depId);
|
|
28503
|
+
return dep && (dep.state === "failed" || dep.state === "skipped");
|
|
28504
|
+
})) {
|
|
28505
|
+
node.state = "skipped";
|
|
28506
|
+
changed = true;
|
|
28507
|
+
this.logger.debug(`Skipped ${node.id}: dependency failed or was skipped`);
|
|
28508
|
+
}
|
|
28509
|
+
}
|
|
28510
|
+
}
|
|
28511
|
+
const ready = [];
|
|
28512
|
+
for (const node of this.nodes.values()) {
|
|
28513
|
+
if (node.state !== "pending") continue;
|
|
28514
|
+
if ([...node.dependencies].every((depId) => {
|
|
28515
|
+
const dep = this.nodes.get(depId);
|
|
28516
|
+
return !dep || dep.state === "completed";
|
|
28517
|
+
})) ready.push(node);
|
|
28518
|
+
}
|
|
28519
|
+
ready.sort((a, b) => (priority.get(b.id) ?? 0) - (priority.get(a.id) ?? 0));
|
|
28520
|
+
if (timingScope !== void 0) {
|
|
28521
|
+
const now = performance.now();
|
|
28522
|
+
for (const node of ready) if (!readySince.has(node.id)) readySince.set(node.id, now);
|
|
28523
|
+
}
|
|
28524
|
+
if (!cancelled()) for (const node of ready) {
|
|
28525
|
+
if (active >= concurrency) break;
|
|
28526
|
+
node.state = "running";
|
|
28527
|
+
active++;
|
|
28528
|
+
if (timingScope !== void 0) recordPhase(timingScope, "ready, waiting for a --concurrency slot", performance.now() - (readySince.get(node.id) ?? performance.now()), node.id);
|
|
28529
|
+
fn(node).then(() => {
|
|
28530
|
+
node.state = "completed";
|
|
28531
|
+
}).catch((error) => {
|
|
28532
|
+
node.state = "failed";
|
|
28533
|
+
errors.push({
|
|
28534
|
+
id: node.id,
|
|
28535
|
+
error
|
|
28536
|
+
});
|
|
28537
|
+
}).finally(() => {
|
|
28538
|
+
active--;
|
|
28539
|
+
dispatch();
|
|
28540
|
+
});
|
|
28541
|
+
}
|
|
28542
|
+
if (active === 0) {
|
|
28543
|
+
if (errors.length > 0) {
|
|
28544
|
+
reject(errors[0].error);
|
|
28545
|
+
return;
|
|
28546
|
+
}
|
|
28547
|
+
if ([...this.nodes.values()].some((n) => n.state === "pending") && !cancelled()) {
|
|
28548
|
+
const pending = [...this.nodes.values()].filter((n) => n.state === "pending").map((n) => n.id);
|
|
28549
|
+
reject(/* @__PURE__ */ new Error(`Deadlock detected: ${pending.length} node(s) stuck with unresolvable dependencies (${pending.join(", ")})`));
|
|
28550
|
+
return;
|
|
28551
|
+
}
|
|
28552
|
+
resolve();
|
|
28553
|
+
}
|
|
28554
|
+
};
|
|
28555
|
+
dispatch();
|
|
28556
|
+
});
|
|
28557
|
+
}
|
|
28558
|
+
};
|
|
28559
|
+
|
|
28560
|
+
// src/deployment/deploy-engine/dependencies.ts
|
|
28561
|
+
function hasPending(executor) {
|
|
28562
|
+
for (const node of executor.values()) if (node.state === "pending") return true;
|
|
28563
|
+
return false;
|
|
28564
|
+
}
|
|
28565
|
+
function nearestMemberDependencies(ids, dependenciesOf, isMember) {
|
|
28566
|
+
const through = /* @__PURE__ */ new Map();
|
|
28567
|
+
const visiting = /* @__PURE__ */ new Set();
|
|
28568
|
+
let guardHits = 0;
|
|
28569
|
+
const collect = (deps, into) => {
|
|
28570
|
+
for (const dep of deps) {
|
|
28571
|
+
if (isMember(dep)) {
|
|
28572
|
+
into.add(dep);
|
|
28573
|
+
continue;
|
|
28574
|
+
}
|
|
28575
|
+
for (const reached of membersBehind(dep)) into.add(reached);
|
|
28576
|
+
}
|
|
28577
|
+
};
|
|
28578
|
+
const membersBehind = (id) => {
|
|
28579
|
+
const cached = through.get(id);
|
|
28580
|
+
if (cached) return cached;
|
|
28581
|
+
const reached = /* @__PURE__ */ new Set();
|
|
28582
|
+
if (visiting.has(id)) {
|
|
28583
|
+
guardHits++;
|
|
28584
|
+
return reached;
|
|
28585
|
+
}
|
|
28586
|
+
const hitsBefore = guardHits;
|
|
28587
|
+
visiting.add(id);
|
|
28588
|
+
collect(dependenciesOf(id), reached);
|
|
28589
|
+
visiting.delete(id);
|
|
28590
|
+
if (guardHits === hitsBefore) through.set(id, reached);
|
|
28591
|
+
return reached;
|
|
28592
|
+
};
|
|
28593
|
+
const result = /* @__PURE__ */ new Map();
|
|
28594
|
+
for (const id of ids) {
|
|
28595
|
+
const reached = /* @__PURE__ */ new Set();
|
|
28596
|
+
collect(dependenciesOf(id), reached);
|
|
28597
|
+
reached.delete(id);
|
|
28598
|
+
result.set(id, reached);
|
|
28599
|
+
}
|
|
28600
|
+
return result;
|
|
28601
|
+
}
|
|
28602
|
+
function recordedDependencies(resources) {
|
|
28603
|
+
return (id) => {
|
|
28604
|
+
const deps = Object.hasOwn(resources, id) ? resources[id]?.dependencies : void 0;
|
|
28605
|
+
return Array.isArray(deps) ? deps.filter((d) => typeof d === "string") : [];
|
|
28606
|
+
};
|
|
28607
|
+
}
|
|
28608
|
+
function buildDeletionDependencies(deleteIds, state, logger) {
|
|
28609
|
+
const dependedBy = /* @__PURE__ */ new Map();
|
|
28610
|
+
for (const id of deleteIds) dependedBy.set(id, /* @__PURE__ */ new Set());
|
|
28611
|
+
const nearest = nearestMemberDependencies(deleteIds, recordedDependencies(state.resources), (d) => deleteIds.has(d));
|
|
28612
|
+
for (const [id, deps] of nearest) for (const dep of deps) dependedBy.get(dep).add(id);
|
|
28613
|
+
addImplicitDeleteDependencies(deleteIds, state, dependedBy, logger);
|
|
28614
|
+
return dependedBy;
|
|
28615
|
+
}
|
|
28616
|
+
function addImplicitDeleteDependencies(deleteIds, state, dependedBy, logger) {
|
|
28617
|
+
const typeToIds = /* @__PURE__ */ new Map();
|
|
28618
|
+
for (const id of deleteIds) {
|
|
28619
|
+
const resource = state.resources[id];
|
|
28620
|
+
if (!resource) continue;
|
|
28621
|
+
const ids = typeToIds.get(resource.resourceType) ?? [];
|
|
28622
|
+
ids.push(id);
|
|
28623
|
+
typeToIds.set(resource.resourceType, ids);
|
|
28624
|
+
}
|
|
28625
|
+
for (const id of deleteIds) {
|
|
28626
|
+
const resource = state.resources[id];
|
|
28627
|
+
if (!resource) continue;
|
|
28628
|
+
const mustDeleteAfter = IMPLICIT_DELETE_DEPENDENCIES[resource.resourceType];
|
|
28629
|
+
if (!mustDeleteAfter) continue;
|
|
28630
|
+
for (const depType of mustDeleteAfter) {
|
|
28631
|
+
const depIds = typeToIds.get(depType);
|
|
28632
|
+
if (!depIds) continue;
|
|
28633
|
+
for (const depId of depIds) {
|
|
28634
|
+
if (!dependedBy.has(id)) dependedBy.set(id, /* @__PURE__ */ new Set());
|
|
28635
|
+
if (!dependedBy.get(id).has(depId)) {
|
|
28636
|
+
dependedBy.get(id).add(depId);
|
|
28637
|
+
logger.debug(safeMsg`Implicit delete dependency: ${depId} (${depType}) must be deleted before ${id} (${resource.resourceType})`);
|
|
28638
|
+
}
|
|
28639
|
+
}
|
|
28640
|
+
}
|
|
28641
|
+
}
|
|
28642
|
+
const scoped = {};
|
|
28643
|
+
for (const id of deleteIds) {
|
|
28644
|
+
const resource = state.resources[id];
|
|
28645
|
+
if (resource) scoped[id] = resource;
|
|
28646
|
+
}
|
|
28647
|
+
for (const { before, after } of computeImplicitDeleteEdges(scoped)) {
|
|
28648
|
+
if (!dependedBy.has(after)) dependedBy.set(after, /* @__PURE__ */ new Set());
|
|
28649
|
+
if (!dependedBy.get(after).has(before)) {
|
|
28650
|
+
dependedBy.get(after).add(before);
|
|
28651
|
+
logger.debug(safeMsg`Implicit delete dependency: ${before} (${scoped[before]?.resourceType}) must be deleted before ${after} (${scoped[after]?.resourceType})`);
|
|
28652
|
+
}
|
|
28653
|
+
}
|
|
28654
|
+
}
|
|
28655
|
+
|
|
28228
28656
|
// src/deployment/rollback-executor/plan/failed-ops.ts
|
|
28229
28657
|
function failedCreateRecordedNoPhysicalId(op) {
|
|
28230
28658
|
return op.changeType === "CREATE" && !op.physicalId;
|
|
@@ -28493,14 +28921,10 @@ function sortRollbackCreates(createOps, stateResources, logger) {
|
|
|
28493
28921
|
}
|
|
28494
28922
|
const dependedBy = /* @__PURE__ */ new Map();
|
|
28495
28923
|
for (const id of deleteIds) if (!dependedBy.has(id)) dependedBy.set(id, /* @__PURE__ */ new Set());
|
|
28496
|
-
|
|
28497
|
-
|
|
28498
|
-
if (!
|
|
28499
|
-
|
|
28500
|
-
if (!deleteIds.has(dep)) continue;
|
|
28501
|
-
if (!dependedBy.has(dep)) dependedBy.set(dep, /* @__PURE__ */ new Set());
|
|
28502
|
-
dependedBy.get(dep).add(id);
|
|
28503
|
-
}
|
|
28924
|
+
const nearest = nearestMemberDependencies(deleteIds, recordedDependencies(stateResources), (d) => deleteIds.has(d));
|
|
28925
|
+
for (const [id, deps] of nearest) for (const dep of deps) {
|
|
28926
|
+
if (!dependedBy.has(dep)) dependedBy.set(dep, /* @__PURE__ */ new Set());
|
|
28927
|
+
dependedBy.get(dep).add(id);
|
|
28504
28928
|
}
|
|
28505
28929
|
const sorted = [];
|
|
28506
28930
|
let remaining = new Set(deleteIds);
|
|
@@ -29042,14 +29466,14 @@ function shownPaths(coordinates) {
|
|
|
29042
29466
|
}
|
|
29043
29467
|
function unreadableNoEchoLeafRefusal(logicalId, coordinates, failure) {
|
|
29044
29468
|
const why = failure === "read-failed" ? "reading the resource back from AWS failed, so cdkd could not learn the value AWS holds there (re-running the rollback retries the read)" : "cdkd cannot read the value AWS holds there (the property is write-only, AWS does not return it, or cdkd has no readback for this resource type)";
|
|
29045
|
-
return markNonRetryable(new CdkdError(`Cannot roll ${shownLogicalId(logicalId)} back: its recorded baseline holds a NoEcho value only as the redaction mask ('${"***"}') at ${shownPaths(coordinates)}, and ${why}. cdkd sent nothing rather than write the mask to the live resource. Restore the property with
|
|
29469
|
+
return markNonRetryable(new CdkdError(`Cannot roll ${shownLogicalId(logicalId)} back: its recorded baseline holds a NoEcho value only as the redaction mask ('${"***"}') at ${shownPaths(coordinates)}, and ${why}. cdkd sent nothing rather than write the mask to the live resource. Restore the property with ${proseQuoted(cdkdRemedy("cdkd deploy"))}, which sends the NoEcho parameter's value again (a NoEcho attribute of a custom resource is sent again only when that custom resource updates in the same deploy).`, "ROLLBACK_REDACTED_BASELINE"));
|
|
29046
29470
|
}
|
|
29047
29471
|
function refuseMarkedNoEchoRecreate(props, marked, logicalId) {
|
|
29048
29472
|
if (props === void 0 || marked === void 0 || marked.length === 0) return;
|
|
29049
29473
|
const masked = maskedLeafCoordinatesOf(props);
|
|
29050
29474
|
if (masked.length === 0 || !masksOnlyAt(props, marked)) return;
|
|
29051
29475
|
const shown = marked.filter((outer) => masked.some((inner) => isMarkedCoordinate(inner, [outer])));
|
|
29052
|
-
throw new CdkdError(`Cannot re-create ${shownLogicalId(logicalId)} while reversing its replacement: its recorded baseline holds a NoEcho value only as the redaction mask ('${"***"}') at ${shownPaths(shown)}, and there is no live resource to read that value back from, so cdkd sent nothing rather than create the resource with the mask. Restore the stack with
|
|
29476
|
+
throw new CdkdError(`Cannot re-create ${shownLogicalId(logicalId)} while reversing its replacement: its recorded baseline holds a NoEcho value only as the redaction mask ('${"***"}') at ${shownPaths(shown)}, and there is no live resource to read that value back from, so cdkd sent nothing rather than create the resource with the mask. Restore the stack with ${proseQuoted(cdkdRemedy("cdkd deploy"))}, which sends the NoEcho parameter's value again.`, "ROLLBACK_REDACTED_BASELINE");
|
|
29053
29477
|
}
|
|
29054
29478
|
function masksOnlyAt(props, marked) {
|
|
29055
29479
|
return maskedLeafCoordinatesOf(props).every((c) => isMarkedCoordinate(c, marked));
|
|
@@ -29290,7 +29714,11 @@ var ReplayPins = class {
|
|
|
29290
29714
|
function refuseMaskedReplayBaseline(props, logicalId, inert = []) {
|
|
29291
29715
|
if (props === void 0 || !carriesSecretMask(props)) return;
|
|
29292
29716
|
if (inert.length > 0 && masksOnlyAt(props, inert)) return;
|
|
29293
|
-
throw new CdkdError(`Cannot roll ${shownLogicalId(logicalId)} back: its recorded baseline holds the redaction mask ('${"***"}'), so cdkd would write that literal to the live resource. There are five ways a baseline comes to hold it. (1) A NoEcho custom-resource value was resolved there: restore the property with
|
|
29717
|
+
throw new CdkdError(`Cannot roll ${shownLogicalId(logicalId)} back: its recorded baseline holds the redaction mask ('${"***"}'), so cdkd would write that literal to the live resource. There are five ways a baseline comes to hold it. (1) A NoEcho custom-resource value was resolved there: restore the property with ${proseQuoted(cdkdRemedy("cdkd deploy"))} AFTER forcing that custom resource to update (change one of its properties, e.g. a nonce), so its handler runs again and supplies the real value — an ordinary re-deploy leaves the resource unchanged, so the handler does not run and the mask stays. (2) The Fn::Base64 encoding of a secret value (a {{resolve:...}} dynamic reference under Fn::Base64, such as EC2 UserData), which cdkd never records: restore the property with a ${proseQuoted(cdkdRemedy("cdkd deploy"))} that changes this resource, which sends it the encoded value again — a re-deploy that leaves this resource unchanged sends it nothing. Every rollback to such a baseline refuses, so to end this, stop encoding the secret into the property (have the resource read the secret at run time instead — not by writing the secret's plaintext into the template, which cdkd would then record in state in the clear). (3) The value was SPLICED from a masked record of ANOTHER resource — by 'cdkd orphan --force', or by 'cdkd import' resolving an Fn::GetAtt or a Ref over a value the Cloud Control fallback had masked. Repair the record that HOLDS the mask (${pasteableCommand("cdkd import", [
|
|
29718
|
+
{ hole: "stack" },
|
|
29719
|
+
{ literal: `--resource ${commandHole("logicalId")}=${commandHole("physicalId")}` },
|
|
29720
|
+
{ literal: "--force" }
|
|
29721
|
+
]).command}, granting cloudformation:DescribeType first if the import warned that it could not read the schema), then re-run whichever command wrote this property. (4) A NoEcho template parameter's value, which cdkd stores only as the mask: restore the property with ${proseQuoted(cdkdRemedy("cdkd deploy"))}, which sends the parameter's value again. (5) Two secret values cdkd resolved overlap inside the value, so no single {{resolve:...}} reference renders it and cdkd stored the mask rather than part of a secret: restore the property with a ${proseQuoted(cdkdRemedy("cdkd deploy"))} that changes this resource, which sends it the value again. Every rollback to such a baseline refuses while the two values still overlap there, so to end this, change the property (or rotate one of the secrets) so that they no longer overlap. See https://github.com/go-to-k/cdkd/issues/2449.`, "ROLLBACK_REDACTED_BASELINE");
|
|
29294
29722
|
}
|
|
29295
29723
|
|
|
29296
29724
|
// src/analyzer/drift-normalize.ts
|
|
@@ -29544,7 +29972,7 @@ async function readLive(args, names) {
|
|
|
29544
29972
|
}
|
|
29545
29973
|
function refusal(args, names, why) {
|
|
29546
29974
|
const list = [...names].sort().join(", ");
|
|
29547
|
-
return new ProvisioningError(`${args.logicalId} (${args.resourceType}): an earlier failed update left ${list} unsettled, and ${why} — nothing was updated. Re-run the deploy once the resource has settled` + (args.provider.readCurrentState !== void 0 ?
|
|
29975
|
+
return new ProvisioningError(`${args.logicalId} (${args.resourceType}): an earlier failed update left ${list} unsettled, and ${why} — nothing was updated. Re-run the deploy once the resource has settled` + (args.provider.readCurrentState !== void 0 ? `, or, to keep what AWS holds instead, run ${proseQuoted(cdkdRemedy("cdkd drift", "--accept"))} once it has.` : "."), args.resourceType, args.logicalId, args.physicalId);
|
|
29548
29976
|
}
|
|
29549
29977
|
async function settleUnsettledPrevious(args) {
|
|
29550
29978
|
const { names, previous, provider } = args;
|
|
@@ -29817,13 +30245,13 @@ async function replayReadopt(s, survivor) {
|
|
|
29817
30245
|
const oldShown = hasAddressablePhysicalId({ physicalId: prev.physicalId }) ? displaySafe(mask(prev.physicalId)) : "no recorded id";
|
|
29818
30246
|
const unprovenCopyRefusal = (reason) => {
|
|
29819
30247
|
const remedy = orphanRemedy(op.logicalId, ctx);
|
|
29820
|
-
return ownRemedyError(markNonRetryable(new CdkdError(safeMsg`Cannot reverse the replacement of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): ` + reason + ` The ${oldKind} old resource (${oldShown}) is named only by the rollback journal, so the JOURNAL is kept. Check both resources by hand.` + (remedy.offered ? ` To leave this one as it is, re-run ${rerunRollbackPhrase(ctx, "
|
|
30248
|
+
return ownRemedyError(markNonRetryable(new CdkdError(safeMsg`Cannot reverse the replacement of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): ` + reason + ` The ${oldKind} old resource (${oldShown}) is named only by the rollback journal, so the JOURNAL is kept. Check both resources by hand.` + (remedy.offered ? ` To leave this one as it is, re-run ${rerunRollbackPhrase(ctx, proseQuoted(cdkdRemedy("cdkd rollback"), "`"))} with the command below; that also drops the journal's only record of the ${oldKind} old resource (${oldShown}), so note that id first.` : ` No repair of the state record makes this op succeed on a re-run.`) + remedy.clause + remedy.line, STATE_RESOURCES_MALFORMED)));
|
|
29821
30249
|
};
|
|
29822
30250
|
const opIdUnusable = op.physicalId !== void 0 && !hasAddressablePhysicalId(op);
|
|
29823
30251
|
if (!rollbackRetainsNewResource(current) && rollbackCannotAddress(current, op.resourceType, current.provisionedBy ?? op.provisionedBy, current.physicalId)) {
|
|
29824
30252
|
if (opIdUnusable) throw unprovenCopyRefusal("neither its state record nor its rollback journal entry has a non-empty string 'physicalId' for the replacement's new resource, so cdkd cannot address that resource in AWS or tell which resource it is, and sent nothing.");
|
|
29825
30253
|
const target = op.physicalId === void 0 ? void 0 : refusalPhysicalId(mask(String(op.physicalId)));
|
|
29826
|
-
const repair = target === void 0 ? `Repair the record's 'physicalId' to the id of the replacement's NEW resource (inspect it with
|
|
30254
|
+
const repair = target === void 0 ? `Repair the record's 'physicalId' to the id of the replacement's NEW resource (inspect it with ${proseQuoted(cdkdRemedy("cdkd state show"), "`")}): the journal does not record that id, and the re-run DELETES the resource the repaired record names as the new copy, so name the right one. Then re-run ${rerunRollbackPhrase(ctx, proseQuoted(cdkdRemedy("cdkd rollback"), "`"))}.` : `Repair the record's 'physicalId' to ${target}, the replacement's new resource the journal records (inspect it with ${proseQuoted(cdkdRemedy("cdkd state show"), "`")}); the re-run deletes it and re-adopts the old one. Any other id stops the revert and drops the journal's only record of the ${oldKind} old resource (${oldShown}). Then re-run ${rerunRollbackPhrase(ctx, proseQuoted(cdkdRemedy("cdkd rollback"), "`"))}.` + (describedPhysicalIdPointer(target) !== "" ? " That id is left out of the prose above: it is not a plain identifier — read it from the rollback journal." : target.includes("***") ? ` That id is shown masked — read the full value from the rollback journal.` : "");
|
|
29827
30255
|
throw new CdkdError(safeMsg`Cannot reverse the replacement of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): ` + `its state record has no non-empty string 'physicalId', so cdkd cannot address the new resource in AWS to delete it, and sent nothing. The ${oldKind} old resource (${oldShown}) is named only by the rollback journal, so the JOURNAL is kept. ` + repair, STATE_RESOURCES_MALFORMED);
|
|
29828
30256
|
}
|
|
29829
30257
|
if (!rollbackRetainsNewResource(current) && opIdUnusable && current.physicalId !== op.physicalId) throw unprovenCopyRefusal("its rollback journal entry has no non-empty string 'physicalId' for the replacement's new resource, so cdkd cannot tell whether the resource state records under this id is that one, and did not delete it; nothing was sent.");
|
|
@@ -29896,8 +30324,8 @@ async function replayRevert(s) {
|
|
|
29896
30324
|
if (!requireRestorableBaseline(previousState.properties, logger, {
|
|
29897
30325
|
logicalId: op.logicalId,
|
|
29898
30326
|
consequence: "be applied as a complete desired state: a patch provider removes every property, and an SDK provider may reset a subset or replace the resource",
|
|
29899
|
-
remedy:
|
|
29900
|
-
retry: `re-running ${rerunRollbackPhrase(ctx, "
|
|
30327
|
+
remedy: `Re-run ${proseQuoted(cdkdRemedy("cdkd deploy"), "`")} to re-converge it.`,
|
|
30328
|
+
retry: `re-running ${rerunRollbackPhrase(ctx, proseQuoted(cdkdRemedy("cdkd rollback"), "`"))} retries this op`
|
|
29901
30329
|
})) {
|
|
29902
30330
|
recordRollbackSkip(s, op, ABSENT_BASELINE_SKIP_CAUSE);
|
|
29903
30331
|
return;
|
|
@@ -30120,19 +30548,19 @@ async function recreateOldResource(s, r) {
|
|
|
30120
30548
|
if (!holder.holds) {
|
|
30121
30549
|
const remedy = orphanRemedy(op.logicalId, ctx);
|
|
30122
30550
|
const oldShown = refusalPhysicalId(mask(prev.physicalId));
|
|
30123
|
-
throw ownRemedyError(markNonRetryable(new CdkdError(mask(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create of the old resource (${oldShown}) collided (why is on the Collision diagnosis line below) — so ` + (holder.known ? `another resource holds the colliding name` : `if another resource holds the name it collided on`) + " (an orphan of an earlier attempt, or one made outside this stack), deleting the new resource would destroy it and collide again. Nothing was deleted. Remove or rename whatever holds that name if it is yours — if that is the new resource itself, delete it by hand — then re-run ") + rerunRollbackPhrase(ctx, "cdkd rollback") + mask(`, which proceeds: the journal is kept, so the revert resumes from here.` + (remedy.offered ? " To leave THIS resource alone and let the rest of the rollback proceed, re-run with the command below." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown)}\nCollision diagnosis: ${holder.diagnosis}\nUnderlying collision: ${collisionLine(mask(msg))}`) + remedy.line, "NAMED_REPLACEMENT_COLLISION", maskSecretsInError(createError instanceof Error ? createError : void 0, secrets))));
|
|
30551
|
+
throw ownRemedyError(markNonRetryable(new CdkdError(mask(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create of the old resource (${oldShown}) collided (why is on the Collision diagnosis line below) — so ` + (holder.known ? `another resource holds the colliding name` : `if another resource holds the name it collided on`) + " (an orphan of an earlier attempt, or one made outside this stack), deleting the new resource would destroy it and collide again. Nothing was deleted. Remove or rename whatever holds that name if it is yours — if that is the new resource itself, delete it by hand — then re-run ") + rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback")) + mask(`, which proceeds: the journal is kept, so the revert resumes from here.` + (remedy.offered ? " To leave THIS resource alone and let the rest of the rollback proceed, re-run with the command below." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown)}\nCollision diagnosis: ${holder.diagnosis}\nUnderlying collision: ${collisionLine(mask(msg))}`) + remedy.line, "NAMED_REPLACEMENT_COLLISION", maskSecretsInError(createError instanceof Error ? createError : void 0, secrets))));
|
|
30124
30552
|
}
|
|
30125
30553
|
if (rollbackRetainsNewResource(current)) {
|
|
30126
30554
|
const remedy = orphanRemedy(op.logicalId, ctx);
|
|
30127
30555
|
const oldShown = refusalPhysicalId(mask(prev.physicalId));
|
|
30128
30556
|
const newShown = refusalPhysicalId(mask(current.physicalId));
|
|
30129
|
-
throw ownRemedyError(markNonRetryable(new CdkdError(mask(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create of the old resource (${oldShown}) collided with the name still held by the new one (${newShown}), and UpdateReplacePolicy: Retain pins that new resource in place, so cdkd will not delete it to free the name. Delete the new resource yourself, or remove UpdateReplacePolicy: Retain, then re-run `) + rerunRollbackPhrase(ctx, "cdkd rollback") + mask(` — the journal is kept, so the revert resumes from here.` + (remedy.offered ? " To leave THIS resource alone and let the rest of the rollback proceed, re-run with the command below: one op failure stops the segment loop, so a single pinned resource otherwise halts every OLDER segment too." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown, newShown)}\nUnderlying collision: ${collisionLine(mask(msg))}`) + remedy.line, "NAMED_REPLACEMENT_COLLISION", maskSecretsInError(createError instanceof Error ? createError : void 0, secrets))));
|
|
30557
|
+
throw ownRemedyError(markNonRetryable(new CdkdError(mask(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create of the old resource (${oldShown}) collided with the name still held by the new one (${newShown}), and UpdateReplacePolicy: Retain pins that new resource in place, so cdkd will not delete it to free the name. Delete the new resource yourself, or remove UpdateReplacePolicy: Retain, then re-run `) + rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback")) + mask(` — the journal is kept, so the revert resumes from here.` + (remedy.offered ? " To leave THIS resource alone and let the rest of the rollback proceed, re-run with the command below: one op failure stops the segment loop, so a single pinned resource otherwise halts every OLDER segment too." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown, newShown)}\nUnderlying collision: ${collisionLine(mask(msg))}`) + remedy.line, "NAMED_REPLACEMENT_COLLISION", maskSecretsInError(createError instanceof Error ? createError : void 0, secrets))));
|
|
30130
30558
|
}
|
|
30131
30559
|
if (deleteFirstBlocked !== void 0) {
|
|
30132
30560
|
const remedy = orphanRemedy(op.logicalId, ctx);
|
|
30133
30561
|
const oldShown = refusalPhysicalId(mask(prev.physicalId));
|
|
30134
30562
|
const newShown = refusalPhysicalId(mask(current.physicalId));
|
|
30135
|
-
throw ownRemedyError(markNonRetryable(new CdkdError(mask(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create of the old resource (${oldShown}) collided with the name still held by the new one (${newShown}), and the old resource's properties name what ${refusalLogicalId(deleteFirstBlocked.logicalId)} was before the same deploy replaced or deleted it, which this rollback may not be able to restore, so cdkd will not delete the new resource to free the name. Nothing was deleted. Re-deploy to fix forward, or re-run `) + rerunRollbackPhrase(ctx, "cdkd rollback") + mask(` once the old resource can be re-created — the journal is kept.` + (remedy.offered ? " To leave THIS resource alone and let the rest of the rollback proceed, re-run with the command below." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown, newShown)}\nUnderlying collision: ${collisionLine(mask(msg))}`) + remedy.line, "NAMED_REPLACEMENT_COLLISION", maskSecretsInError(createError instanceof Error ? createError : void 0, secrets))));
|
|
30563
|
+
throw ownRemedyError(markNonRetryable(new CdkdError(mask(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create of the old resource (${oldShown}) collided with the name still held by the new one (${newShown}), and the old resource's properties name what ${refusalLogicalId(deleteFirstBlocked.logicalId)} was before the same deploy replaced or deleted it, which this rollback may not be able to restore, so cdkd will not delete the new resource to free the name. Nothing was deleted. Re-deploy to fix forward, or re-run `) + rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback")) + mask(` once the old resource can be re-created — the journal is kept.` + (remedy.offered ? " To leave THIS resource alone and let the rest of the rollback proceed, re-run with the command below." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown, newShown)}\nUnderlying collision: ${collisionLine(mask(msg))}`) + remedy.line, "NAMED_REPLACEMENT_COLLISION", maskSecretsInError(createError instanceof Error ? createError : void 0, secrets))));
|
|
30136
30564
|
}
|
|
30137
30565
|
logger.info(` Rollback: re-create collided with the new resource's name — deleting the new resource (${displaySafe(mask(current.physicalId))}) first...` + (typeChanged ? ` (this op changed the resource's Type, ${safe(op.resourceType)} -> ${safe(oldType)}, which share a name space)` : ""));
|
|
30138
30566
|
await deleteNewResourceFirst("while clearing the new resource so the old one could be re-created");
|
|
@@ -30165,7 +30593,7 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
|
|
|
30165
30593
|
}) && !deletedNewFirst && createResult.physicalId === current.physicalId;
|
|
30166
30594
|
if (adoptedLiveNewResource) {
|
|
30167
30595
|
const liveShown = refusalPhysicalId(mask(current.physicalId));
|
|
30168
|
-
logger.warn(` ⚠ ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create returned the LIVE new resource (${liveShown}) instead of re-creating the old one — its Create API is name-idempotent and the new resource still holds the same user-supplied name. Skipping the delete-new step (it would delete that very resource). The old resource's ORIGINAL properties may NOT have been re-applied; state now records the pre-replacement properties, so inspect the drift and run
|
|
30596
|
+
logger.warn(` ⚠ ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the re-create returned the LIVE new resource (${liveShown}) instead of re-creating the old one — its Create API is name-idempotent and the new resource still holds the same user-supplied name. Skipping the delete-new step (it would delete that very resource). The old resource's ORIGINAL properties may NOT have been re-applied; state now records the pre-replacement properties, so inspect the drift and ` + safeMsg`run ${proseQuoted(cdkdRemedy("cdkd deploy"))} to reconcile, or rename the resource to make the replacement ` + `reversible.${describedPhysicalIdPointer(liveShown)}\nInspect it with: ${pasteableCommand("cdkd drift", [{
|
|
30169
30597
|
value: stackName,
|
|
30170
30598
|
hole: "stack"
|
|
30171
30599
|
}, {
|
|
@@ -30243,7 +30671,7 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
|
|
|
30243
30671
|
reason: mask(survivorReason),
|
|
30244
30672
|
...survivorProvisionedBy && { provisionedBy: survivorProvisionedBy }
|
|
30245
30673
|
},
|
|
30246
|
-
...adoptedLiveNewResource && { reason: mask(
|
|
30674
|
+
...adoptedLiveNewResource && { reason: mask(`The re-create returned the live new resource instead of re-creating the old one (its Create API is name-idempotent), so the replacement was NOT fully reversed: the old resource's original properties may not have been re-applied. Inspect it with ${proseQuoted(cdkdRemedy("cdkd drift"), "`")} and run ${proseQuoted(cdkdRemedy("cdkd deploy"), "`")} to reconcile.`) }
|
|
30247
30675
|
});
|
|
30248
30676
|
return survivorReason === void 0;
|
|
30249
30677
|
};
|
|
@@ -30267,7 +30695,7 @@ async function finishReverseReplacement(s, r, createResult, deletedNewFirst) {
|
|
|
30267
30695
|
let gone = false;
|
|
30268
30696
|
try {
|
|
30269
30697
|
if (supersededHolderOf(superseded, stateResources) !== void 0) {
|
|
30270
|
-
logger.warn(safeMsg` Rollback: not deleting the new ${shownLogicalId(op.logicalId)} ` + safeMsg`(${mask(current.physicalId)}): a record of this stack now holds its ` + `physical id. Check it with cdkd drift.`);
|
|
30698
|
+
logger.warn(safeMsg` Rollback: not deleting the new ${shownLogicalId(op.logicalId)} ` + safeMsg`(${mask(current.physicalId)}): a record of this stack now holds its ` + safeMsg`physical id. Check it with ${cdkdRemedy("cdkd drift")}.`);
|
|
30271
30699
|
result.warnings++;
|
|
30272
30700
|
ctx.recordEvent?.({
|
|
30273
30701
|
eventType: "ROLLBACK_RESOURCE_SUCCEEDED",
|
|
@@ -30311,13 +30739,13 @@ function refuseSameIdParentReversal(s) {
|
|
|
30311
30739
|
const remedy = orphanRemedy(op.logicalId, ctx);
|
|
30312
30740
|
const shown = children.slice(0, 5).map(refusalLogicalId).join(", ");
|
|
30313
30741
|
const more = children.length > 5 ? ` and ${children.length - 5} more` : "";
|
|
30314
|
-
throw ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the deploy deleted it and re-created it under the same physical id, so reversing it deletes it again, and with it what AWS stores inside it (${shown}${more}), which this rollback does not re-create. Nothing was deleted. The journal is kept: fix forward by deploying the previous version of the template with
|
|
30742
|
+
throw ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the deploy deleted it and re-created it under the same physical id, so reversing it deletes it again, and with it what AWS stores inside it (${shown}${more}), which this rollback does not re-create. Nothing was deleted. The journal is kept: fix forward by deploying the previous version of the template with ${deployReplaceCommand()}, which re-creates both` + (remedy.offered ? ", or leave this resource as it is and let the rest of the rollback proceed by re-running with the command below." : ".") + `${remedy.clause}${remedy.line}`, "ROLLBACK_SAME_ID_PARENT")));
|
|
30315
30743
|
}
|
|
30316
30744
|
function refuseUndecidableSameIdReversal(s) {
|
|
30317
30745
|
const { op, stateResources, ctx } = s;
|
|
30318
30746
|
if (!sameIdReversalUndecidable(op, stateResources[op.logicalId])) return;
|
|
30319
30747
|
const remedy = orphanRemedy(op.logicalId, ctx);
|
|
30320
|
-
throw ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the deploy deleted it and re-created it under the same physical id, and its state record cannot tell whether an earlier rollback already reversed it (its recorded properties read the same before and after the deploy and hold a redacted value, which may hide what changed, or the deploy's properties were not journaled). Nothing was deleted. The journal is kept: fix forward by deploying the previous version of the template with
|
|
30748
|
+
throw ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): the deploy deleted it and re-created it under the same physical id, and its state record cannot tell whether an earlier rollback already reversed it (its recorded properties read the same before and after the deploy and hold a redacted value, which may hide what changed, or the deploy's properties were not journaled). Nothing was deleted. The journal is kept: fix forward by deploying the previous version of the template with ${deployReplaceCommand()}` + (remedy.offered ? ", or leave this resource as it is and let the rest of the rollback proceed by re-running with the command below." : ".") + `${remedy.clause}${remedy.line}`, "ROLLBACK_SAME_ID_UNDECIDABLE")));
|
|
30321
30749
|
}
|
|
30322
30750
|
async function replayReverseReplacement(s) {
|
|
30323
30751
|
const { op, stateResources, stackName, ctx, resolver, result, inlinePolicyWriters, logger, secrets, opMasker, mask } = s;
|
|
@@ -30335,9 +30763,9 @@ async function replayReverseReplacement(s) {
|
|
|
30335
30763
|
if (survivor === "exists" && op.oldResourceMaySurvive !== "kept") throw survivorUnprovenRefusal(s, oldType, "maybe-deleting");
|
|
30336
30764
|
if (survivor === "exists") {
|
|
30337
30765
|
const oldShown = refusalPhysicalId(mask(String(prev.physicalId)));
|
|
30338
|
-
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 cdkd drift after the rollback.${describedPhysicalIdPointer(oldShown)}`);
|
|
30766
|
+
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)}`);
|
|
30339
30767
|
result.warnings++;
|
|
30340
|
-
return replayReadopt(s, { reason:
|
|
30768
|
+
return 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")}` });
|
|
30341
30769
|
}
|
|
30342
30770
|
if (survivor !== "gone") throw survivorUnprovenRefusal(s, oldType, survivor);
|
|
30343
30771
|
logger.info(safeMsg` Rollback: the old resource of ${safe(op.logicalId)} (${mask(String(prev.physicalId))}) is gone — re-creating it`);
|
|
@@ -30346,8 +30774,8 @@ async function replayReverseReplacement(s) {
|
|
|
30346
30774
|
if (!requireRestorableBaseline(prev.properties, logger, {
|
|
30347
30775
|
logicalId: op.logicalId,
|
|
30348
30776
|
consequence: "create a default-configured resource and then delete the live one",
|
|
30349
|
-
remedy:
|
|
30350
|
-
retry: `re-running ${rerunRollbackPhrase(ctx, "
|
|
30777
|
+
remedy: `Re-run ${proseQuoted(cdkdRemedy("cdkd deploy"), "`")} to re-converge it.`,
|
|
30778
|
+
retry: `re-running ${rerunRollbackPhrase(ctx, proseQuoted(cdkdRemedy("cdkd rollback"), "`"))} retries this op`
|
|
30351
30779
|
})) {
|
|
30352
30780
|
recordRollbackSkip(s, op, ABSENT_BASELINE_SKIP_CAUSE);
|
|
30353
30781
|
return;
|
|
@@ -30432,7 +30860,7 @@ function survivorUnprovenRefusal(s, oldType, verdict) {
|
|
|
30432
30860
|
const remedy = orphanRemedy(op.logicalId, ctx);
|
|
30433
30861
|
const oldId = op.previousState?.physicalId;
|
|
30434
30862
|
const oldShown = hasAddressablePhysicalId({ physicalId: oldId }) ? refusalPhysicalId(mask(String(oldId))) : "no recorded id";
|
|
30435
|
-
const rerun = rerunRollbackPhrase(ctx, "cdkd rollback");
|
|
30863
|
+
const rerun = rerunRollbackPhrase(ctx, cdkdRemedy("cdkd rollback"));
|
|
30436
30864
|
const why = 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}`;
|
|
30437
30865
|
return ownRemedyError(markNonRetryable(new CdkdError(`Cannot reverse the replacement of ${refusalLogicalId(op.logicalId)} (${refusalResourceType(oldType)}): 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, then delete the old resource by hand if it still exists." : "") + `${remedy.clause}${describedPhysicalIdPointer(oldShown)}` + remedy.line, "REPLACED_SURVIVOR_UNPROVEN")));
|
|
30438
30866
|
}
|
|
@@ -30697,7 +31125,7 @@ async function partitionDeletedOutsideCdkd(deps, ops) {
|
|
|
30697
31125
|
};
|
|
30698
31126
|
}
|
|
30699
31127
|
function deletedOutsideCdkdMessage(op, recordDropped) {
|
|
30700
|
-
return safeMsg`${op.logicalId} (${op.resourceType}): AWS reports this resource no longer exists ` + `(deleted outside cdkd), so its failed update has nothing to revert` + (recordDropped ? ` and no rollback record is kept for it.` : ` and
|
|
31128
|
+
return safeMsg`${op.logicalId} (${op.resourceType}): AWS reports this resource no longer exists ` + `(deleted outside cdkd), so its failed update has nothing to revert` + (recordDropped ? ` and no rollback record is kept for it.` : ` and ${proseQuoted(cdkdRemedy("cdkd rollback", "--revert-failed"))} drops its record.`) + safeMsg` ${DELETED_RESOURCE_REMEDY}`;
|
|
30701
31129
|
}
|
|
30702
31130
|
const DELETED_OUTSIDE_SKIP_CAUSE = "AWS reports the resource no longer exists (deleted outside cdkd), so its failed update has nothing to revert; the rollback dropped its record from the journal.";
|
|
30703
31131
|
|
|
@@ -30793,7 +31221,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
|
|
|
30793
31221
|
recordRollbackSkip(skipScope, op, "No previous state is available for the failed UPDATE, so there is nothing to revert it to.");
|
|
30794
31222
|
break;
|
|
30795
31223
|
case "skip-failed-type-change":
|
|
30796
|
-
logger.warn(` Rollback: cannot revert failed UPDATE of ${shownLogicalId(op.logicalId)} in place — it was a Type change (${refusalResourceType(op.previousState?.resourceType)} -> ${refusalResourceType(op.resourceType)}), which is a replacement, and its remote state is unknown. Inspect it with
|
|
31224
|
+
logger.warn(` Rollback: cannot revert failed UPDATE of ${shownLogicalId(op.logicalId)} in place — it was a Type change (${refusalResourceType(op.previousState?.resourceType)} -> ${refusalResourceType(op.resourceType)}), which is a replacement, and its remote state is unknown. Inspect it with ${proseQuoted(cdkdRemedy("cdkd drift"), "`")} and re-converge with ${proseQuoted(cdkdRemedy("cdkd deploy"), "`")}. Skipping.`);
|
|
30797
31225
|
recordRollbackSkip(skipScope, op, `The failed UPDATE was a Type change (${String(op.previousState?.resourceType)} -> ${String(op.resourceType)}), which is a replacement, and its remote state is unknown, so it cannot be reverted in place.`);
|
|
30798
31226
|
break;
|
|
30799
31227
|
case "orphan-failed-create-retain": {
|
|
@@ -30861,7 +31289,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
|
|
|
30861
31289
|
});
|
|
30862
31290
|
break;
|
|
30863
31291
|
}
|
|
30864
|
-
if (verdict !== void 0 && "retry" in verdict) throw new Error(`${String(op.physicalId)} is not deleted: ${verdict.retry}. The journal keeps it for a re-run;
|
|
31292
|
+
if (verdict !== void 0 && "retry" in verdict) throw new Error(`${String(op.physicalId)} is not deleted: ${verdict.retry}. The journal keeps it for a re-run; ${proseQuoted(cdkdRemedy("cdkd rollback", "--drop-failed"), "`")} removes only that record and leaves the resource in AWS`);
|
|
30865
31293
|
if (verdict !== void 0) {
|
|
30866
31294
|
const keep = verdict.keep;
|
|
30867
31295
|
const finish = verdict.finish ?? "if it is not in use, delete it by hand";
|
|
@@ -30938,8 +31366,8 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
|
|
|
30938
31366
|
if (!requireRestorableBaseline(prev.properties, logger, {
|
|
30939
31367
|
logicalId: op.logicalId,
|
|
30940
31368
|
consequence: "be applied as a complete desired state: a patch provider removes every property, and an SDK provider may reset a subset or replace the resource",
|
|
30941
|
-
remedy:
|
|
30942
|
-
retry:
|
|
31369
|
+
remedy: `Inspect it with ${proseQuoted(cdkdRemedy("cdkd drift"), "`")} (this op died mid-flight, so its remote state is unknown) and re-converge with ${proseQuoted(cdkdRemedy("cdkd drift", "--revert"), "`")} or ${proseQuoted(cdkdRemedy("cdkd deploy"), "`")}.`,
|
|
31370
|
+
retry: `re-running ${proseQuoted(cdkdRemedy("cdkd rollback", "--revert-failed"), "`")} retries this op (a plain \`cdkd rollback\` replays only the COMPLETED ops and then pops the whole segment, discarding this record)`
|
|
30943
31371
|
})) {
|
|
30944
31372
|
recordRollbackSkip(skipScope, op, ABSENT_BASELINE_SKIP_CAUSE);
|
|
30945
31373
|
break;
|
|
@@ -31667,13 +32095,13 @@ function changedReferencePath(reference) {
|
|
|
31667
32095
|
return `${REFERENCE_PATH_PREFIX}${reference}`;
|
|
31668
32096
|
}
|
|
31669
32097
|
function differingRemedy(paths) {
|
|
31670
|
-
return paths.some((p) => p.startsWith(REFERENCE_PATH_PREFIX)) ?
|
|
32098
|
+
return paths.some((p) => p.startsWith(REFERENCE_PATH_PREFIX)) ? `As cdk refactor does, cdkd treats it as a new resource (a Lambda version or an API Gateway deployment after a change is one). If it was renamed, revert that change, run ${cdkdRemedy("cdkd refactor")}, then deploy the change.` : `cdkd refactor keeps only an unchanged resource: revert the property change, run ${cdkdRemedy("cdkd refactor")}, then deploy the change.`;
|
|
31671
32099
|
}
|
|
31672
32100
|
function changedReferenceReason(reference) {
|
|
31673
|
-
return `it references ${reference}, which the next deploy changes, so cdkd treats it as a new resource, as cdk refactor does (a Lambda version or an API Gateway deployment after a change is one). If it is a renamed one, revert the change to ${reference}, run cdkd refactor, then deploy the change`;
|
|
32101
|
+
return `it references ${reference}, which the next deploy changes, so cdkd treats it as a new resource, as cdk refactor does (a Lambda version or an API Gateway deployment after a change is one). If it is a renamed one, revert the change to ${reference}, run ${cdkdRemedy("cdkd refactor")}, then deploy the change`;
|
|
31674
32102
|
}
|
|
31675
32103
|
function propertiesChangedReason(paths) {
|
|
31676
|
-
return `its properties also changed (${paths.join(", ")}); cdkd refactor keeps only an unchanged resource. Revert the property change, run cdkd refactor, then deploy the change`;
|
|
32104
|
+
return `its properties also changed (${paths.join(", ")}); cdkd refactor keeps only an unchanged resource. Revert the property change, run ${cdkdRemedy("cdkd refactor")}, then deploy the change`;
|
|
31677
32105
|
}
|
|
31678
32106
|
function isIntrinsic(value) {
|
|
31679
32107
|
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
@@ -31823,7 +32251,7 @@ function hintSidesOf(changes, template, exclude = /* @__PURE__ */ new Set()) {
|
|
|
31823
32251
|
};
|
|
31824
32252
|
}
|
|
31825
32253
|
function movedToHint(movedTo) {
|
|
31826
|
-
return ` (moved to ${displayIdent(movedTo.stackName)}.${displayIdent(movedTo.logicalId)}, run
|
|
32254
|
+
return ` (moved to ${displayIdent(movedTo.stackName)}.${displayIdent(movedTo.logicalId)}, run ${proseQuoted(cdkdRemedy("cdkd refactor"))} to keep it)`;
|
|
31827
32255
|
}
|
|
31828
32256
|
function withMovedTo(changes, hints) {
|
|
31829
32257
|
return changes.map((change) => {
|
|
@@ -32069,7 +32497,7 @@ var NoEchoValueMacs = class {
|
|
|
32069
32497
|
} catch (error) {
|
|
32070
32498
|
const name = errorNameOf(error, abort.signal.aborted);
|
|
32071
32499
|
if (this.options.purpose === "diff") logger.debug(safeMsg`cdkd diff: NoEcho value MACs unavailable (${name} from kms:GenerateMac on ${NOECHO_MAC_KEY_ALIAS} in ${region}); the preview does not compare them`);
|
|
32072
|
-
else if (name === "NotFoundException") logger.debug(safeMsg`NoEcho value MACs: no KMS key ${NOECHO_MAC_KEY_ALIAS} in ${region} (run
|
|
32500
|
+
else if (name === "NotFoundException") logger.debug(safeMsg`NoEcho value MACs: no KMS key ${NOECHO_MAC_KEY_ALIAS} in ${region} (run ${proseQuoted(cdkdRemedy("cdkd bootstrap"))} to create it); a write-only property a NoEcho parameter feeds is re-sent on every deploy`);
|
|
32073
32501
|
else logger.info(safeMsg`NoEcho value MACs unavailable (${name} from kms:GenerateMac on ${NOECHO_MAC_KEY_ALIAS} in ${region}): a write-only property a NoEcho parameter feeds is re-sent on every deploy. Grant the deploying identity kms:GenerateMac on that key to compare the values instead.`);
|
|
32074
32502
|
return;
|
|
32075
32503
|
} finally {
|
|
@@ -32699,7 +33127,7 @@ async function planOrphanAdoption(params) {
|
|
|
32699
33127
|
if (params.managedLogicalIds.has(record.logicalId)) continue;
|
|
32700
33128
|
outcome.remaining.push(record);
|
|
32701
33129
|
if ((params.template.Resources?.[record.logicalId])?.Type !== record.state.resourceType) continue;
|
|
32702
|
-
outcome.warnings.push(`${displayIdent(record.logicalId)} (${displayIdent(record.state.resourceType)}) was left in AWS by an earlier rollback as ${displaySafe(record.state.physicalId)} (DeletionPolicy: Retain). This deploy does not take it back: it creates a new resource under a new name, as CloudFormation does. To manage the kept resource again, adopt it with
|
|
33130
|
+
outcome.warnings.push(`${displayIdent(record.logicalId)} (${displayIdent(record.state.resourceType)}) was left in AWS by an earlier rollback as ${displaySafe(record.state.physicalId)} (DeletionPolicy: Retain). This deploy does not take it back: it creates a new resource under a new name, as CloudFormation does. To manage the kept resource again, adopt it with: ${cdkdRemedy("cdkd import")}`);
|
|
32703
33131
|
}
|
|
32704
33132
|
return outcome;
|
|
32705
33133
|
}
|
|
@@ -33301,7 +33729,7 @@ async function settleJournaledOrphansOnSuccess(args) {
|
|
|
33301
33729
|
try {
|
|
33302
33730
|
await stateBackend.dropRollbackJournalFailedOperations(stackName, region, (op, segment) => isHandledOrphan(cleared, segment, op));
|
|
33303
33731
|
} catch (err) {
|
|
33304
|
-
logger.warn(safeMsg`Failed to remove the settled entries from the rollback journal of stack ${stack}: ` + safeMsg`${errorDetail(err)}. A cdkd rollback or cdkd destroy could act on them again; run a ` +
|
|
33732
|
+
logger.warn(safeMsg`Failed to remove the settled entries from the rollback journal of stack ${stack}: ` + safeMsg`${errorDetail(err)}. A cdkd rollback or cdkd destroy could act on them again; run a ` + safeMsg`successful ${cdkdRemedy("cdkd deploy")} of the stack first, which settles them again.`);
|
|
33305
33733
|
}
|
|
33306
33734
|
};
|
|
33307
33735
|
if (kept.length === 0) {
|
|
@@ -33564,7 +33992,7 @@ async function revertNestedChildFromJournal(args) {
|
|
|
33564
33992
|
const runId = run.runId;
|
|
33565
33993
|
const shownChild = displayIdent(childStackName);
|
|
33566
33994
|
const refuse = (detail) => {
|
|
33567
|
-
throw markNonRetryable(/* @__PURE__ */ new Error(`Cannot revert nested stack ${shownChild} (row ${displayIdent(logicalId)}): ${detail} The child was NOT (fully) reverted and may still hold the failed deploy's configuration. Inspect it with
|
|
33995
|
+
throw markNonRetryable(/* @__PURE__ */ new Error(`Cannot revert nested stack ${shownChild} (row ${displayIdent(logicalId)}): ${detail} The child was NOT (fully) reverted and may still hold the failed deploy's configuration. Inspect it with ${proseQuoted(cdkdRemedy("cdkd state show"))}; re-run the rollback once the cause is fixed (its journal is kept), or re-deploy the parent to converge.`));
|
|
33568
33996
|
};
|
|
33569
33997
|
if (runId === void 0) refuse("the rollback carries no deploy run id to select its journal segments by.");
|
|
33570
33998
|
await ctx.lockManager.acquireLockWithRetry(childStackName, region, void 0, "rollback");
|
|
@@ -34057,8 +34485,8 @@ async function settlePending(params, pending) {
|
|
|
34057
34485
|
settlements.set(token, { kind: "resume" });
|
|
34058
34486
|
break;
|
|
34059
34487
|
}
|
|
34060
|
-
if (params.resume !== void 0 && !unique) logger.warn(safeMsg`The CREATE of ${named} ${ended} in AWS after cdkd stopped waiting, and made ` + safeMsg`${madeShown}. cdkd cannot prove its id is unique (it may be a name, which can ` + safeMsg`since belong to another resource), so this deploy does not take it over, and creating ${logicalIdShown(op.logicalId)} ` +
|
|
34061
|
-
else logger.warn(safeMsg`The CREATE of ${named} ${ended} in AWS after cdkd stopped waiting, and made ` + safeMsg`${madeShown}. It is now recorded in the rollback journal as a resource the failed ` +
|
|
34488
|
+
if (params.resume !== void 0 && !unique) logger.warn(safeMsg`The CREATE of ${named} ${ended} in AWS after cdkd stopped waiting, and made ` + safeMsg`${madeShown}. cdkd cannot prove its id is unique (it may be a name, which can ` + safeMsg`since belong to another resource), so this deploy does not take it over, and creating ${logicalIdShown(op.logicalId)} ` + safeMsg`again will ask for the name it holds. Adopt it with ${cdkdRemedy("cdkd import")} (--resource ` + safeMsg`${logicalIdShown(op.logicalId)}=<its id>), or delete it, then re-run. It is kept in the ` + "rollback journal as a resource the failed deploy created.");
|
|
34489
|
+
else logger.warn(safeMsg`The CREATE of ${named} ${ended} in AWS after cdkd stopped waiting, and made ` + safeMsg`${madeShown}. It is now recorded in the rollback journal as a resource the failed ` + safeMsg`deploy created: ${cdkdRemedy("cdkd destroy")}, ${cdkdRemedy("cdkd rollback", "--revert-failed")} and the next successful deploy ` + "delete it as its DeletionPolicy directs when cdkd can prove it is still the resource that create made, and otherwise name it in a warning for you to delete by hand.");
|
|
34062
34490
|
settlements.set(token, {
|
|
34063
34491
|
kind: "orphan",
|
|
34064
34492
|
physicalId: made,
|
|
@@ -34067,7 +34495,7 @@ async function settlePending(params, pending) {
|
|
|
34067
34495
|
break;
|
|
34068
34496
|
}
|
|
34069
34497
|
case "not-found":
|
|
34070
|
-
logger.warn(safeMsg`Cloud Control no longer has the CREATE request of ${named}: requests expire after ` + "seven days, and a request is not visible from another account or region. cdkd cannot tell whether it created the resource and stops tracking the request. If it exists, adopt it with cdkd import or delete it by hand
|
|
34498
|
+
logger.warn(safeMsg`Cloud Control no longer has the CREATE request of ${named}: requests expire after ` + "seven days, and a request is not visible from another account or region. cdkd cannot tell whether it created the resource and stops tracking the request. If it exists, " + safeMsg`adopt it with ${cdkdRemedy("cdkd import")} or delete it by hand.`);
|
|
34071
34499
|
settlements.set(token, { kind: "drop" });
|
|
34072
34500
|
break;
|
|
34073
34501
|
case "unresolved": {
|
|
@@ -34153,7 +34581,7 @@ function revertFailedHasNothingToDo(op) {
|
|
|
34153
34581
|
return op.changeType === "DELETE" || appliedNothing(op) || revertSkipsFailedCreate(op);
|
|
34154
34582
|
}
|
|
34155
34583
|
function unaddressableFailedCreateMessage(op) {
|
|
34156
|
-
return safeMsg`${op.logicalId} (${op.resourceType}): the failed CREATE recorded no physical id, ` + `so
|
|
34584
|
+
return safeMsg`${op.logicalId} (${op.resourceType}): the failed CREATE recorded no physical id, ` + `so ${proseQuoted(cdkdRemedy("cdkd rollback", "--revert-failed"))} cannot address it — if it was partially created in AWS, delete it manually.`;
|
|
34157
34585
|
}
|
|
34158
34586
|
|
|
34159
34587
|
// src/deployment/deploy-engine/rollback/journal-write.ts
|
|
@@ -34182,7 +34610,7 @@ async function writeRollbackJournalSegment(deps, stackName, completedOperations,
|
|
|
34182
34610
|
deps.logger.debug(safeMsg`Rollback journal segment written (${reason})`);
|
|
34183
34611
|
return true;
|
|
34184
34612
|
} catch (journalError) {
|
|
34185
|
-
deps.logger.warn(safeMsg`Failed to write rollback journal: ${asIsMessage(describeAwsFailure(journalError).detail)}. ` + `'cdkd rollback' will NOT be able to revert this deploy — use
|
|
34613
|
+
deps.logger.warn(safeMsg`Failed to write rollback journal: ${asIsMessage(describeAwsFailure(journalError).detail)}. ` + safeMsg`'cdkd rollback' will NOT be able to revert this deploy — use ${proseQuoted(cdkdRemedy("cdkd deploy"))} to resume or ${proseQuoted(cdkdRemedy("cdkd destroy"))} to clean up.`);
|
|
34186
34614
|
return false;
|
|
34187
34615
|
}
|
|
34188
34616
|
}
|
|
@@ -35539,14 +35967,14 @@ async function refuseUnlicensedGeneratedName(engine, input) {
|
|
|
35539
35967
|
case "held": {
|
|
35540
35968
|
const nested = input.stackName.includes("~");
|
|
35541
35969
|
const top = input.stackName.split("~")[0];
|
|
35542
|
-
const importLine = nested ? `adopt it through the top-level stack ${quotedOrDescribed(top, "stack name")} with
|
|
35970
|
+
const importLine = nested ? `adopt it through the top-level stack ${quotedOrDescribed(top, "stack name")} with ${proseQuoted(cdkdRemedy("cdkd import"), "`")}` : `adopt it with ${proseQuoted(pasteableCommand("cdkd import", [{
|
|
35543
35971
|
value: input.stackName,
|
|
35544
35972
|
hole: "stack"
|
|
35545
35973
|
}, {
|
|
35546
35974
|
flag: "--resource",
|
|
35547
35975
|
value: `${logicalId}=${verdict.holder}`,
|
|
35548
35976
|
hole: "logicalId=physicalId"
|
|
35549
|
-
}], recoveryCommandFlags(engine.options.refusalRecovery).flags).command}
|
|
35977
|
+
}], recoveryCommandFlags(engine.options.refusalRecovery).flags).command, "`")}`;
|
|
35550
35978
|
if (verdict.ownIntent !== void 0) {
|
|
35551
35979
|
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)";
|
|
35552
35980
|
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. ${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.`);
|
|
@@ -35616,7 +36044,7 @@ async function refuseTakenCreateName(engine, input) {
|
|
|
35616
36044
|
hole: "logicalId=physicalId"
|
|
35617
36045
|
}]);
|
|
35618
36046
|
const adopt = built !== void 0 && maskName(built.command) === built.command ? built : void 0;
|
|
35619
|
-
const ownRemedy = input.stackName.includes("~") ? `${ownCase}, delete it and re-run.` : adopt !== void 0 ? `${ownCase}, delete it, or adopt it with
|
|
36047
|
+
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.`;
|
|
35620
36048
|
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.";
|
|
35621
36049
|
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 ? "" : `
|
|
35622
36050
|
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}`));
|
|
@@ -35877,11 +36305,15 @@ function markerMovesInvolving(verdict, stackName, region) {
|
|
|
35877
36305
|
return verdict.moves.filter((m) => m.fromStack === stackName && m.fromRegion === region || m.toStack === stackName && m.toRegion === region);
|
|
35878
36306
|
}
|
|
35879
36307
|
function refactorMarkerRefusalMessage(verdict, stackName, region, command) {
|
|
35880
|
-
if (verdict.kind === "malformed") return safeMsg`${command} refused stack ${stackName} (${region}): the cdkd refactor marker ` + safeMsg`${verdict.key} cannot be read, so whether a move involving this stack is ` +
|
|
36308
|
+
if (verdict.kind === "malformed") return safeMsg`${command} refused stack ${stackName} (${region}): the cdkd refactor marker ` + safeMsg`${verdict.key} cannot be read, so whether a move involving this stack is ` + `unfinished is unknown. Inspect it in the state bucket; run ${cdkdRemedy("cdkd refactor")} to finish the moves it lists, or delete it once no move is in progress.`;
|
|
35881
36309
|
const involved = markerMovesInvolving(verdict, stackName, region);
|
|
35882
36310
|
if (involved.length === 0) return void 0;
|
|
35883
36311
|
const sources = [...new Set(involved.map((m) => m.fromStack))];
|
|
35884
|
-
return safeMsg`${command} refused stack ${stackName} (${region}): a cdkd refactor moving ` + safeMsg`${involved.map((m) => `${m.fromStack}.${m.from} -> ${m.toStack}.${m.to}`).join(", ")} ` + "did not finish, and acting on this stack now could delete a resource another stack owns or create it a second time. Run " + safeMsg
|
|
36312
|
+
return safeMsg`${command} refused stack ${stackName} (${region}): a cdkd refactor moving ` + safeMsg`${involved.map((m) => `${m.fromStack}.${m.from} -> ${m.toStack}.${m.to}`).join(", ")} ` + "did not finish, and acting on this stack now could delete a resource another stack owns or create it a second time. Run " + safeMsg`${proseQuoted(pasteableCommand("cdkd refactor", sources.map((source) => ({
|
|
36313
|
+
value: source,
|
|
36314
|
+
hole: "stack",
|
|
36315
|
+
opts: { patternMatched: true }
|
|
36316
|
+
}))).command)} to finish the move, then re-run.`;
|
|
35885
36317
|
}
|
|
35886
36318
|
function refuseRefactorMarker(verdict, stackName, region, command) {
|
|
35887
36319
|
const message = refactorMarkerRefusalMessage(verdict, stackName, region, command);
|
|
@@ -35899,7 +36331,7 @@ async function updateRefactorMarker(backend, update) {
|
|
|
35899
36331
|
}
|
|
35900
36332
|
if (await backend.saveRefactorMarker({ moves: update(moves) }, current === null ? null : current.etag) === "saved") return;
|
|
35901
36333
|
}
|
|
35902
|
-
throw new CdkdError(
|
|
36334
|
+
throw new CdkdError(`The cdkd refactor marker kept changing under concurrent refactors; re-run ${cdkdRemedy("cdkd refactor")}.`, "REFACTOR_STATE_CHANGED");
|
|
35903
36335
|
}
|
|
35904
36336
|
function sameMove(a, b) {
|
|
35905
36337
|
return a.fromStack === b.fromStack && a.fromRegion === b.fromRegion && a.from === b.from;
|
|
@@ -35937,7 +36369,7 @@ async function recordRetainedForReadoption(backend, stackName, region, kept, log
|
|
|
35937
36369
|
logger.warn(safeMsg`Recorded the ${String(kept.length)} kept resource(s) of ${displayStackName(stackName)}, ` + safeMsg`but their time could not be confirmed from S3 ` + safeMsg`(${describeAwsFailure(error.cause).summary}); they carry this machine's clock instead.`);
|
|
35938
36370
|
return;
|
|
35939
36371
|
}
|
|
35940
|
-
logger.warn(safeMsg`Could not record the ${String(kept.length)} kept resource(s) of ${displayStackName(stackName)} ` + safeMsg`(${describeAwsFailure(error).summary}). A later deploy may refuse to create one over ` + `its kept copy, or not name them; adopt a kept one with
|
|
36372
|
+
logger.warn(safeMsg`Could not record the ${String(kept.length)} kept resource(s) of ${displayStackName(stackName)} ` + safeMsg`(${describeAwsFailure(error).summary}). A later deploy may refuse to create one over ` + safeMsg`its kept copy, or not name them; adopt a kept one with ${proseQuoted(cdkdRemedy("cdkd import"))}.`);
|
|
35941
36373
|
}
|
|
35942
36374
|
}
|
|
35943
36375
|
var KeptForReadoption = class {
|
|
@@ -36108,7 +36540,7 @@ Drop the record with: ${dropCommand}`);
|
|
|
36108
36540
|
hole: nested ? "child-stack" : "stack",
|
|
36109
36541
|
opts: { plainIdent: true }
|
|
36110
36542
|
};
|
|
36111
|
-
deps.logger.warn(safeMsg`${deleteSkippedMessage(logicalId, currentResource.physicalId, deleteSkipped, "while removing it from the template")}` + ". Its cdkd state record was KEPT, so the next 'cdkd deploy' re-attempts the delete. Repair the record first (for a nested stack it is the CHILD's own state, whose other resources may already be gone), or delete the resource by hand and drop the record." + (interrupted ?
|
|
36543
|
+
deps.logger.warn(safeMsg`${deleteSkippedMessage(logicalId, currentResource.physicalId, deleteSkipped, "while removing it from the template")}` + ". Its cdkd state record was KEPT, so the next 'cdkd deploy' re-attempts the delete. Repair the record first (for a nested stack it is the CHILD's own state, whose other resources may already be gone), or delete the resource by hand and drop the record." + (interrupted ? ` The commands name the child stack record. Its destroy was interrupted: re-run ` + safeMsg`${proseQuoted(cdkdRemedy("cdkd deploy"))} to resume it, and drop the child record only if that cannot finish, ` + "after deleting by hand what the child still holds (the inspect command with --show-nested lists every level; a child with nested stacks of its own has records under '<child>~<logicalId>' too, each needing the same drop)." : nested ? " The commands name the child stack record. Dropping it drops every record the child still has and nothing reaches those resources again, so first delete by hand what the child still holds (the inspect command with --show-nested lists every level; a child with nested stacks of its own has records under '<child>~<logicalId>' too, each needing the same drop). The next 'cdkd deploy' then removes this row." : " Keep '--resource' on the drop: without it the command drops the record of every resource in this still-deployed stack.") + (accountClause === "" ? "" : safeMsg` ${accountClause}`) + safeMsg`\nInspect it with: ${pasteableCommand("cdkd state show", [
|
|
36112
36544
|
stackArg,
|
|
36113
36545
|
{
|
|
36114
36546
|
flag: "--stack-region",
|
|
@@ -36204,255 +36636,6 @@ async function retryCarriedSupersededResources(engine, host, carried, resources,
|
|
|
36204
36636
|
return changed;
|
|
36205
36637
|
}
|
|
36206
36638
|
|
|
36207
|
-
// src/deployment/dag-executor.ts
|
|
36208
|
-
var DagExecutor = class {
|
|
36209
|
-
nodes = /* @__PURE__ */ new Map();
|
|
36210
|
-
logger = getLogger().child("DagExecutor");
|
|
36211
|
-
priorityById = null;
|
|
36212
|
-
timingScope;
|
|
36213
|
-
constructor(timingScope) {
|
|
36214
|
-
this.timingScope = timingScope;
|
|
36215
|
-
}
|
|
36216
|
-
add(node) {
|
|
36217
|
-
this.nodes.set(node.id, node);
|
|
36218
|
-
}
|
|
36219
|
-
computePriorities() {
|
|
36220
|
-
if (this.priorityById) return this.priorityById;
|
|
36221
|
-
const dependentsOf = /* @__PURE__ */ new Map();
|
|
36222
|
-
for (const node of this.nodes.values()) for (const depId of node.dependencies) {
|
|
36223
|
-
if (!this.nodes.has(depId)) continue;
|
|
36224
|
-
let set = dependentsOf.get(depId);
|
|
36225
|
-
if (!set) {
|
|
36226
|
-
set = /* @__PURE__ */ new Set();
|
|
36227
|
-
dependentsOf.set(depId, set);
|
|
36228
|
-
}
|
|
36229
|
-
set.add(node.id);
|
|
36230
|
-
}
|
|
36231
|
-
const memo = /* @__PURE__ */ new Map();
|
|
36232
|
-
const visiting = /* @__PURE__ */ new Set();
|
|
36233
|
-
const collect = (id) => {
|
|
36234
|
-
const cached = memo.get(id);
|
|
36235
|
-
if (cached) return cached;
|
|
36236
|
-
const acc = /* @__PURE__ */ new Set();
|
|
36237
|
-
if (visiting.has(id)) return acc;
|
|
36238
|
-
visiting.add(id);
|
|
36239
|
-
for (const dependent of dependentsOf.get(id) ?? []) {
|
|
36240
|
-
acc.add(dependent);
|
|
36241
|
-
for (const t of collect(dependent)) acc.add(t);
|
|
36242
|
-
}
|
|
36243
|
-
visiting.delete(id);
|
|
36244
|
-
memo.set(id, acc);
|
|
36245
|
-
return acc;
|
|
36246
|
-
};
|
|
36247
|
-
const priorities = /* @__PURE__ */ new Map();
|
|
36248
|
-
for (const id of this.nodes.keys()) priorities.set(id, collect(id).size);
|
|
36249
|
-
this.priorityById = priorities;
|
|
36250
|
-
return priorities;
|
|
36251
|
-
}
|
|
36252
|
-
has(id) {
|
|
36253
|
-
return this.nodes.has(id);
|
|
36254
|
-
}
|
|
36255
|
-
size() {
|
|
36256
|
-
return this.nodes.size;
|
|
36257
|
-
}
|
|
36258
|
-
values() {
|
|
36259
|
-
return this.nodes.values();
|
|
36260
|
-
}
|
|
36261
|
-
async execute(concurrency, fn, cancelled = () => false) {
|
|
36262
|
-
let active = 0;
|
|
36263
|
-
const errors = [];
|
|
36264
|
-
const priority = this.computePriorities();
|
|
36265
|
-
const timingScope = phaseTimingsEnabled() ? this.timingScope : void 0;
|
|
36266
|
-
const readySince = /* @__PURE__ */ new Map();
|
|
36267
|
-
return new Promise((resolve, reject) => {
|
|
36268
|
-
const dispatch = () => {
|
|
36269
|
-
let changed = true;
|
|
36270
|
-
while (changed) {
|
|
36271
|
-
changed = false;
|
|
36272
|
-
for (const node of this.nodes.values()) {
|
|
36273
|
-
if (node.state !== "pending") continue;
|
|
36274
|
-
if ([...node.dependencies].some((depId) => {
|
|
36275
|
-
const dep = this.nodes.get(depId);
|
|
36276
|
-
return dep && (dep.state === "failed" || dep.state === "skipped");
|
|
36277
|
-
})) {
|
|
36278
|
-
node.state = "skipped";
|
|
36279
|
-
changed = true;
|
|
36280
|
-
this.logger.debug(`Skipped ${node.id}: dependency failed or was skipped`);
|
|
36281
|
-
}
|
|
36282
|
-
}
|
|
36283
|
-
}
|
|
36284
|
-
const ready = [];
|
|
36285
|
-
for (const node of this.nodes.values()) {
|
|
36286
|
-
if (node.state !== "pending") continue;
|
|
36287
|
-
if ([...node.dependencies].every((depId) => {
|
|
36288
|
-
const dep = this.nodes.get(depId);
|
|
36289
|
-
return !dep || dep.state === "completed";
|
|
36290
|
-
})) ready.push(node);
|
|
36291
|
-
}
|
|
36292
|
-
ready.sort((a, b) => (priority.get(b.id) ?? 0) - (priority.get(a.id) ?? 0));
|
|
36293
|
-
if (timingScope !== void 0) {
|
|
36294
|
-
const now = performance.now();
|
|
36295
|
-
for (const node of ready) if (!readySince.has(node.id)) readySince.set(node.id, now);
|
|
36296
|
-
}
|
|
36297
|
-
if (!cancelled()) for (const node of ready) {
|
|
36298
|
-
if (active >= concurrency) break;
|
|
36299
|
-
node.state = "running";
|
|
36300
|
-
active++;
|
|
36301
|
-
if (timingScope !== void 0) recordPhase(timingScope, "ready, waiting for a --concurrency slot", performance.now() - (readySince.get(node.id) ?? performance.now()), node.id);
|
|
36302
|
-
fn(node).then(() => {
|
|
36303
|
-
node.state = "completed";
|
|
36304
|
-
}).catch((error) => {
|
|
36305
|
-
node.state = "failed";
|
|
36306
|
-
errors.push({
|
|
36307
|
-
id: node.id,
|
|
36308
|
-
error
|
|
36309
|
-
});
|
|
36310
|
-
}).finally(() => {
|
|
36311
|
-
active--;
|
|
36312
|
-
dispatch();
|
|
36313
|
-
});
|
|
36314
|
-
}
|
|
36315
|
-
if (active === 0) {
|
|
36316
|
-
if (errors.length > 0) {
|
|
36317
|
-
reject(errors[0].error);
|
|
36318
|
-
return;
|
|
36319
|
-
}
|
|
36320
|
-
if ([...this.nodes.values()].some((n) => n.state === "pending") && !cancelled()) {
|
|
36321
|
-
const pending = [...this.nodes.values()].filter((n) => n.state === "pending").map((n) => n.id);
|
|
36322
|
-
reject(/* @__PURE__ */ new Error(`Deadlock detected: ${pending.length} node(s) stuck with unresolvable dependencies (${pending.join(", ")})`));
|
|
36323
|
-
return;
|
|
36324
|
-
}
|
|
36325
|
-
resolve();
|
|
36326
|
-
}
|
|
36327
|
-
};
|
|
36328
|
-
dispatch();
|
|
36329
|
-
});
|
|
36330
|
-
}
|
|
36331
|
-
};
|
|
36332
|
-
|
|
36333
|
-
// src/analyzer/implicit-delete-deps.ts
|
|
36334
|
-
const IMPLICIT_DELETE_DEPENDENCIES = {
|
|
36335
|
-
"AWS::EC2::InternetGateway": ["AWS::EC2::VPCGatewayAttachment", "AWS::EC2::NatGateway"],
|
|
36336
|
-
"AWS::EC2::VPCGatewayAttachment": ["AWS::EC2::NatGateway"],
|
|
36337
|
-
"AWS::Events::EventBus": ["AWS::Events::Rule"],
|
|
36338
|
-
"AWS::Athena::WorkGroup": ["AWS::Athena::NamedQuery"],
|
|
36339
|
-
"AWS::CloudFront::ResponseHeadersPolicy": ["AWS::CloudFront::Distribution"],
|
|
36340
|
-
"AWS::CloudFront::CachePolicy": ["AWS::CloudFront::Distribution"],
|
|
36341
|
-
"AWS::CloudFront::OriginAccessControl": ["AWS::CloudFront::Distribution"],
|
|
36342
|
-
"AWS::EC2::VPC": [
|
|
36343
|
-
"AWS::EC2::Subnet",
|
|
36344
|
-
"AWS::EC2::SecurityGroup",
|
|
36345
|
-
"AWS::EC2::InternetGateway",
|
|
36346
|
-
"AWS::EC2::EgressOnlyInternetGateway",
|
|
36347
|
-
"AWS::EC2::VPCGatewayAttachment",
|
|
36348
|
-
"AWS::EC2::RouteTable"
|
|
36349
|
-
],
|
|
36350
|
-
"AWS::EC2::Subnet": ["AWS::EC2::SubnetRouteTableAssociation", "AWS::Lambda::Function"],
|
|
36351
|
-
"AWS::EC2::RouteTable": ["AWS::EC2::Route", "AWS::EC2::SubnetRouteTableAssociation"],
|
|
36352
|
-
"AWS::EC2::SecurityGroup": [
|
|
36353
|
-
"AWS::EC2::SecurityGroupIngress",
|
|
36354
|
-
"AWS::EC2::SecurityGroupEgress",
|
|
36355
|
-
"AWS::Lambda::Function"
|
|
36356
|
-
]
|
|
36357
|
-
};
|
|
36358
|
-
const ALARM_RULE_FUNCTION_REGEX = /\b(?:ALARM|OK|INSUFFICIENT_DATA)\s*\(\s*([^)]*?)\s*\)/gi;
|
|
36359
|
-
function extractReferencedAlarmNames(alarmRule) {
|
|
36360
|
-
const names = /* @__PURE__ */ new Set();
|
|
36361
|
-
for (const match of alarmRule.matchAll(ALARM_RULE_FUNCTION_REGEX)) {
|
|
36362
|
-
let arg = (match[1] ?? "").trim();
|
|
36363
|
-
if (arg.length === 0) continue;
|
|
36364
|
-
if (arg.startsWith("\"") && arg.endsWith("\"") || arg.startsWith("'") && arg.endsWith("'")) arg = arg.slice(1, -1);
|
|
36365
|
-
if (arg.length === 0) continue;
|
|
36366
|
-
const arnAlarmMatch = /:alarm:(.+)$/.exec(arg);
|
|
36367
|
-
if (arnAlarmMatch?.[1]) names.add(arnAlarmMatch[1]);
|
|
36368
|
-
else names.add(arg);
|
|
36369
|
-
}
|
|
36370
|
-
return [...names];
|
|
36371
|
-
}
|
|
36372
|
-
function computeImplicitDeleteEdges(resources) {
|
|
36373
|
-
const edges = [];
|
|
36374
|
-
const alarmTypes = /* @__PURE__ */ new Set(["AWS::CloudWatch::Alarm", "AWS::CloudWatch::CompositeAlarm"]);
|
|
36375
|
-
const nameToLogicalId = /* @__PURE__ */ new Map();
|
|
36376
|
-
for (const [logicalId, resource] of Object.entries(resources)) {
|
|
36377
|
-
if (!alarmTypes.has(resource.resourceType)) continue;
|
|
36378
|
-
const alarmName = typeof resource.properties?.["AlarmName"] === "string" ? resource.properties["AlarmName"] : resource.physicalId;
|
|
36379
|
-
if (alarmName) nameToLogicalId.set(alarmName, logicalId);
|
|
36380
|
-
}
|
|
36381
|
-
for (const [logicalId, resource] of Object.entries(resources)) {
|
|
36382
|
-
if (resource.resourceType !== "AWS::CloudWatch::CompositeAlarm") continue;
|
|
36383
|
-
const alarmRule = resource.properties?.["AlarmRule"];
|
|
36384
|
-
if (typeof alarmRule !== "string") continue;
|
|
36385
|
-
for (const referencedName of extractReferencedAlarmNames(alarmRule)) {
|
|
36386
|
-
const referencedLogicalId = nameToLogicalId.get(referencedName);
|
|
36387
|
-
if (!referencedLogicalId || referencedLogicalId === logicalId) continue;
|
|
36388
|
-
edges.push({
|
|
36389
|
-
before: logicalId,
|
|
36390
|
-
after: referencedLogicalId
|
|
36391
|
-
});
|
|
36392
|
-
}
|
|
36393
|
-
}
|
|
36394
|
-
return edges;
|
|
36395
|
-
}
|
|
36396
|
-
|
|
36397
|
-
// src/deployment/deploy-engine/dependencies.ts
|
|
36398
|
-
function hasPending(executor) {
|
|
36399
|
-
for (const node of executor.values()) if (node.state === "pending") return true;
|
|
36400
|
-
return false;
|
|
36401
|
-
}
|
|
36402
|
-
function buildDeletionDependencies(deleteIds, state, logger) {
|
|
36403
|
-
const dependedBy = /* @__PURE__ */ new Map();
|
|
36404
|
-
for (const id of deleteIds) dependedBy.set(id, /* @__PURE__ */ new Set());
|
|
36405
|
-
for (const id of deleteIds) {
|
|
36406
|
-
const resource = state.resources[id];
|
|
36407
|
-
if (!resource?.dependencies) continue;
|
|
36408
|
-
for (const dep of resource.dependencies) {
|
|
36409
|
-
if (!deleteIds.has(dep)) continue;
|
|
36410
|
-
dependedBy.get(dep).add(id);
|
|
36411
|
-
}
|
|
36412
|
-
}
|
|
36413
|
-
addImplicitDeleteDependencies(deleteIds, state, dependedBy, logger);
|
|
36414
|
-
return dependedBy;
|
|
36415
|
-
}
|
|
36416
|
-
function addImplicitDeleteDependencies(deleteIds, state, dependedBy, logger) {
|
|
36417
|
-
const typeToIds = /* @__PURE__ */ new Map();
|
|
36418
|
-
for (const id of deleteIds) {
|
|
36419
|
-
const resource = state.resources[id];
|
|
36420
|
-
if (!resource) continue;
|
|
36421
|
-
const ids = typeToIds.get(resource.resourceType) ?? [];
|
|
36422
|
-
ids.push(id);
|
|
36423
|
-
typeToIds.set(resource.resourceType, ids);
|
|
36424
|
-
}
|
|
36425
|
-
for (const id of deleteIds) {
|
|
36426
|
-
const resource = state.resources[id];
|
|
36427
|
-
if (!resource) continue;
|
|
36428
|
-
const mustDeleteAfter = IMPLICIT_DELETE_DEPENDENCIES[resource.resourceType];
|
|
36429
|
-
if (!mustDeleteAfter) continue;
|
|
36430
|
-
for (const depType of mustDeleteAfter) {
|
|
36431
|
-
const depIds = typeToIds.get(depType);
|
|
36432
|
-
if (!depIds) continue;
|
|
36433
|
-
for (const depId of depIds) {
|
|
36434
|
-
if (!dependedBy.has(id)) dependedBy.set(id, /* @__PURE__ */ new Set());
|
|
36435
|
-
if (!dependedBy.get(id).has(depId)) {
|
|
36436
|
-
dependedBy.get(id).add(depId);
|
|
36437
|
-
logger.debug(safeMsg`Implicit delete dependency: ${depId} (${depType}) must be deleted before ${id} (${resource.resourceType})`);
|
|
36438
|
-
}
|
|
36439
|
-
}
|
|
36440
|
-
}
|
|
36441
|
-
}
|
|
36442
|
-
const scoped = {};
|
|
36443
|
-
for (const id of deleteIds) {
|
|
36444
|
-
const resource = state.resources[id];
|
|
36445
|
-
if (resource) scoped[id] = resource;
|
|
36446
|
-
}
|
|
36447
|
-
for (const { before, after } of computeImplicitDeleteEdges(scoped)) {
|
|
36448
|
-
if (!dependedBy.has(after)) dependedBy.set(after, /* @__PURE__ */ new Set());
|
|
36449
|
-
if (!dependedBy.get(after).has(before)) {
|
|
36450
|
-
dependedBy.get(after).add(before);
|
|
36451
|
-
logger.debug(safeMsg`Implicit delete dependency: ${before} (${scoped[before]?.resourceType}) must be deleted before ${after} (${scoped[after]?.resourceType})`);
|
|
36452
|
-
}
|
|
36453
|
-
}
|
|
36454
|
-
}
|
|
36455
|
-
|
|
36456
36639
|
// src/provisioning/changed-properties-consumers.ts
|
|
36457
36640
|
const CHANGED_PROPERTIES_CONSUMER_TYPES = /* @__PURE__ */ new Set(["AWS::ServiceDiscovery::Service"]);
|
|
36458
36641
|
|
|
@@ -38804,7 +38987,7 @@ async function createPhaseCommit(scope) {
|
|
|
38804
38987
|
retractCreatedResource(logicalId, resourceType, tableName);
|
|
38805
38988
|
} catch (cleanupErr) {
|
|
38806
38989
|
tableLeftBehind = true;
|
|
38807
|
-
warn(`Partial-create cleanup failed for ${tableName}: ${this.cleanupFailureText(log, `Partial-create cleanup failed for ${tableName}: `, cleanupErr)} ` + (registeredBeforeReplicas.length > 0 ?
|
|
38990
|
+
warn(`Partial-create cleanup failed for ${tableName}: ${this.cleanupFailureText(log, `Partial-create cleanup failed for ${tableName}: `, cleanupErr)} ` + (registeredBeforeReplicas.length > 0 ? `Its write scalable targets and scaling policies may still be registered. To remove the table and them, run ${cdkdRemedy("cdkd rollback", "--revert-failed")}.` : `To remove the orphaned AWS-side table, run: ` + pasteableAwsCommand(maskSecrets)`aws dynamodb delete-table --table-name ${tableName}`.render()));
|
|
38808
38991
|
}
|
|
38809
38992
|
markAuxiliaryFailure(wiringError, logicalId);
|
|
38810
38993
|
const cause = wiringError instanceof Error ? wiringError : void 0;
|
|
@@ -40649,8 +40832,8 @@ async function updateInScope(logicalId, physicalId, resourceType, properties, pr
|
|
|
40649
40832
|
if (context?.replayingState !== true && context?.desiredFromAwsReadback !== true) throw new ProvisioningError(log.mask(disassociationRefusal), resourceType, logicalId, physicalId);
|
|
40650
40833
|
warn(`${disassociationRefusal} Proceeding: this update restores a recorded or read-back configuration.`);
|
|
40651
40834
|
}
|
|
40652
|
-
const replaceFlags = "cdkd deploy --replace --force-stateful-recreation";
|
|
40653
40835
|
const replaceRemedy = async () => {
|
|
40836
|
+
const replaceFlags = deployReplaceCommand(true);
|
|
40654
40837
|
let guardRegion = "";
|
|
40655
40838
|
try {
|
|
40656
40839
|
guardRegion = await this.dynamoDBClient.config.region() ?? "";
|
|
@@ -41395,7 +41578,7 @@ async function readUnsettled(physicalId, logicalId, resourceType, names, recorde
|
|
|
41395
41578
|
if (!Object.hasOwn(out, name)) continue;
|
|
41396
41579
|
out[name] = projectNamed(out[name], recordedProperties?.[name], desiredProperties?.[name], name, unnamed, attemptedItems);
|
|
41397
41580
|
}
|
|
41398
|
-
for (const entry of unnamed.filter((e) => e.ambiguous === true)) this.logger.warn(safeMsg`${logicalId} (${resourceType}): ${entry.path} on AWS has entries cdkd cannot key by an identity, so convergence keeps the recorded ${entry.path} rather than risk removing an entry neither the record nor the template declares. Check it with
|
|
41581
|
+
for (const entry of unnamed.filter((e) => e.ambiguous === true)) this.logger.warn(safeMsg`${logicalId} (${resourceType}): ${entry.path} on AWS has entries cdkd cannot key by an identity, so convergence keeps the recorded ${entry.path} rather than risk removing an entry neither the record nor the template declares. Check it with ${proseQuoted(cdkdRemedy("cdkd drift"))}.`);
|
|
41399
41582
|
for (const entry of unnamed.filter((e) => e.ambiguous !== true)) this.logger.warn(safeMsg`${logicalId} (${resourceType}): ${entry.path} on AWS holds ${entry.identity} ${entry.value}, which neither the record nor the template declares, so cdkd leaves it in place. If the failed update added it and it should not be there, remove it by hand (for a replica: aws dynamodb update-table --replica-updates Delete; for an index: --global-secondary-index-updates Delete; for a vector index: --vector-index-updates Delete).`);
|
|
41400
41583
|
return out;
|
|
41401
41584
|
}
|
|
@@ -44401,7 +44584,7 @@ async function replaceCreateFirst(engine, { currentResource, equalIdIsSameResour
|
|
|
44401
44584
|
}) + ` Underlying collision: ${createMsg}`, updateSecrets), "NAMED_REPLACEMENT_COLLISION", createError instanceof Error ? createError : void 0));
|
|
44402
44585
|
}
|
|
44403
44586
|
if (updateReplacePolicy === "Retain") throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its physical name ` + `is still held by the existing resource AND UpdateReplacePolicy: Retain ` + safeMsg`pins that resource in place. ${nameOrigin.descriptor}. ` + safeMsg`${nameOrigin.remedy} — with Retain, the old resource keeps the name, so a ` + `same-name replacement can never proceed.`, "NAMED_REPLACEMENT_COLLISION");
|
|
44404
|
-
if (engine.options.replace !== true) throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but the create-first ` + safeMsg`attempt collided with the existing resource: ${createSentence}. ` + safeMsg`${nameOrigin.descriptor}, so the CloudFormation-style safe replacement ` + "order (create the new resource before deleting the old) cannot reuse the occupied name — CloudFormation refuses this shape with \"cannot update a stack when a custom-named resource requires replacing\". " + safeMsg`${nameOrigin.remedy}, or re-run with
|
|
44587
|
+
if (engine.options.replace !== true) throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but the create-first ` + safeMsg`attempt collided with the existing resource: ${createSentence}. ` + safeMsg`${nameOrigin.descriptor}, so the CloudFormation-style safe replacement ` + "order (create the new resource before deleting the old) cannot reuse the occupied name — CloudFormation refuses this shape with \"cannot update a stack when a custom-named resource requires replacing\". " + safeMsg`${nameOrigin.remedy}, or re-run with ${deployReplaceCommand()} to delete ` + "the old resource FIRST and recreate it under the same name (the resource is briefly unavailable while it is recreated).", "NAMED_REPLACEMENT_COLLISION");
|
|
44405
44588
|
engine.logger.info(` Create-first collided with the existing resource's name and --replace is ` + safeMsg`set — deleting old ${logicalId} (${currentResource.physicalId}) first...`);
|
|
44406
44589
|
deletedOldFirst = true;
|
|
44407
44590
|
createResult = await replaceDeleteFirstAndRecreate(engine.replacementRun, engine.replacementDeps(), logicalId, resourceType, oldResourceType, currentResource, oldDeleteProvider, replaceProvider, replaceProps, updateSecrets, updateReplacePolicy, oldDeleteRoute.provisionedBy, noEchoDeleteValues);
|
|
@@ -44409,7 +44592,7 @@ async function replaceCreateFirst(engine, { currentResource, equalIdIsSameResour
|
|
|
44409
44592
|
if (equalIdIsSameResource && !deletedOldFirst && createResult.physicalId === currentResource.physicalId) {
|
|
44410
44593
|
const idempotentNameOrigin = replacementNameOrigin(logicalId, currentResource.physicalId);
|
|
44411
44594
|
if (updateReplacePolicy === "Retain") throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its Create API is ` + `name-idempotent: the create-first attempt returned the existing resource ` + safeMsg`(${currentResource.physicalId}) instead of creating a new one, and ` + `UpdateReplacePolicy: Retain pins that resource in place. ` + safeMsg`${idempotentNameOrigin.descriptor}. ${idempotentNameOrigin.remedy} — with ` + "Retain, the old resource keeps the name, so a same-name replacement can never proceed.", "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
|
|
44412
|
-
if (engine.options.replace !== true) throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its Create API is ` + `name-idempotent: the create-first attempt returned the EXISTING resource ` + safeMsg`(${currentResource.physicalId}) instead of creating a new one, so deleting ` + `the "old" resource would silently destroy the resource the deploy just ` + safeMsg`reported as created. ${idempotentNameOrigin.descriptor}; ` + safeMsg`${idempotentNameOrigin.remedy}, or re-run with ` +
|
|
44595
|
+
if (engine.options.replace !== true) throw new CdkdError(safeMsg`${logicalId} (${resourceType}) requires replacement, but its Create API is ` + `name-idempotent: the create-first attempt returned the EXISTING resource ` + safeMsg`(${currentResource.physicalId}) instead of creating a new one, so deleting ` + `the "old" resource would silently destroy the resource the deploy just ` + safeMsg`reported as created. ${idempotentNameOrigin.descriptor}; ` + safeMsg`${idempotentNameOrigin.remedy}, or re-run with ` + `${deployReplaceCommand()} to delete the old resource FIRST and recreate it under the same name (the resource is briefly unavailable while it is recreated). Note: this branch is also reached when the old resource was deleted out-of-band and the physical id is name-derived — there the create was a genuine fresh create; \`--replace\` converges that case too.`, "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
|
|
44413
44596
|
engine.logger.info(` Create-first returned the existing resource (name-idempotent Create API) ` + safeMsg`and --replace is set — deleting old ${logicalId} ` + safeMsg`(${currentResource.physicalId}) first...`);
|
|
44414
44597
|
deletedOldFirst = true;
|
|
44415
44598
|
createResult = await replaceDeleteFirstAndRecreate(engine.replacementRun, engine.replacementDeps(), logicalId, resourceType, oldResourceType, currentResource, oldDeleteProvider, replaceProvider, replaceProps, updateSecrets, updateReplacePolicy, oldDeleteRoute.provisionedBy, noEchoDeleteValues);
|
|
@@ -45388,7 +45571,7 @@ function nowWrittenCreateOnlyRefusal(input) {
|
|
|
45388
45571
|
const keep = [.../* @__PURE__ */ new Set([...stillDropped, ...routeDriving])].filter((property) => !nowWritten.includes(property)).sort((a, b) => a.localeCompare(b)).map((property) => `${resourceType}:${property}`).join(",");
|
|
45389
45572
|
const routed = [...routeDriving].sort((a, b) => a.localeCompare(b)).join(", ");
|
|
45390
45573
|
const replaceFlags = unwrittenReplaceFlags(logicalId, nested);
|
|
45391
|
-
return safeMsg`${logicalId} (${resourceType}): ${list} ${one ? "is" : "are"} create-only, and the ` + `state record holds ${one ? "it" : "them"} although the SDK provider that built the resource did not write ${one ? "it" : "them"} (an earlier deploy accepted dropping ${one ? "it" : "them"} with --prefer-sdk-route), so AWS does not. ` + safeMsg`This cdkd version's SDK provider writes ${written}, so no flag keeps ` + `${writtenOne ? "it" : "them"} dropped any more` + (routed.length > 0 ? safeMsg`, and this deploy routes the resource through Cloud Control (--prefer-sdk-route does not cover ${routed})` : "") + "; applying a create-only property means replacing the resource, which cdkd does not do on its own. This " + safeMsg`resource was not changed. To replace it and apply ${list}, re-run with ${replaceFlags}; a ` + `stateful resource also needs --force-stateful-recreation.` + (protectionEvidence !== void 0 ? safeMsg` ${recordedProtectionNote(protectionEvidence, nested ? "--replace" : `--recreate-via-cc-api ${logicalId} or --replace`)}` : "") + safeMsg` To keep the resource as it is, remove ${written} from the template` + (keep.length > 0 ? safeMsg` and re-run with --prefer-sdk-route ${keep}.` : ".") + (nested || stillDropped.length > 0 || (input.evidence ?? []).some((property) => !nowWritten.includes(property)) ? "" : safeMsg` If AWS already holds ${written} (cdkd drift compares it), re-record the ` + safeMsg`resource instead: cdkd import with --resource '${logicalId}=PHYSICAL_ID' (its physical ` + `id, quoted) and --force writes a record without this evidence and changes nothing in AWS.`);
|
|
45574
|
+
return safeMsg`${logicalId} (${resourceType}): ${list} ${one ? "is" : "are"} create-only, and the ` + `state record holds ${one ? "it" : "them"} although the SDK provider that built the resource did not write ${one ? "it" : "them"} (an earlier deploy accepted dropping ${one ? "it" : "them"} with --prefer-sdk-route), so AWS does not. ` + safeMsg`This cdkd version's SDK provider writes ${written}, so no flag keeps ` + `${writtenOne ? "it" : "them"} dropped any more` + (routed.length > 0 ? safeMsg`, and this deploy routes the resource through Cloud Control (--prefer-sdk-route does not cover ${routed})` : "") + "; applying a create-only property means replacing the resource, which cdkd does not do on its own. This " + safeMsg`resource was not changed. To replace it and apply ${list}, re-run with ${replaceFlags}; a ` + `stateful resource also needs --force-stateful-recreation.` + (protectionEvidence !== void 0 ? safeMsg` ${recordedProtectionNote(protectionEvidence, nested ? "--replace" : `--recreate-via-cc-api ${logicalId} or --replace`)}` : "") + safeMsg` To keep the resource as it is, remove ${written} from the template` + (keep.length > 0 ? safeMsg` and re-run with --prefer-sdk-route ${keep}.` : ".") + (nested || stillDropped.length > 0 || (input.evidence ?? []).some((property) => !nowWritten.includes(property)) ? "" : safeMsg` If AWS already holds ${written} (cdkd drift compares it), re-record the ` + safeMsg`resource instead: ${cdkdRemedy("cdkd import")} with --resource '${logicalId}=PHYSICAL_ID' (its physical ` + `id, quoted) and --force writes a record without this evidence and changes nothing in AWS.`);
|
|
45392
45575
|
}
|
|
45393
45576
|
|
|
45394
45577
|
// src/deployment/deploy-engine/update/provision-update.ts
|
|
@@ -45966,16 +46149,19 @@ function enqueueLostChildren(run, executor) {
|
|
|
45966
46149
|
engine.logger.info(survivesParent(change.resourceType) ? safeMsg` ${id} was attached to a resource the update-failure fallback re-created under the same name: attaching it again` : safeMsg` ${id} went with a resource the update-failure fallback re-created under the same id: re-creating it`);
|
|
45967
46150
|
}
|
|
45968
46151
|
if (progress) progress.total += lostIds.length;
|
|
46152
|
+
const lost = new Set(lostIds);
|
|
46153
|
+
const isMember = (id) => executor.has(id) || lost.has(id);
|
|
46154
|
+
const dependenciesOf = (id) => engine.dagBuilder.getDirectDependencies(dag, id);
|
|
46155
|
+
const lostDeps = nearestMemberDependencies(lostIds, dependenciesOf, isMember);
|
|
45969
46156
|
for (const id of lostIds) executor.add({
|
|
45970
46157
|
id,
|
|
45971
|
-
dependencies:
|
|
46158
|
+
dependencies: lostDeps.get(id),
|
|
45972
46159
|
state: "pending",
|
|
45973
46160
|
data: changes.get(id)
|
|
45974
46161
|
});
|
|
45975
|
-
|
|
45976
|
-
|
|
45977
|
-
|
|
45978
|
-
}
|
|
46162
|
+
const pending = [...executor.values()].filter((node) => node.state === "pending" && !lost.has(node.id));
|
|
46163
|
+
const pendingDeps = nearestMemberDependencies(pending.map((node) => node.id), dependenciesOf, isMember);
|
|
46164
|
+
for (const node of pending) for (const dep of pendingDeps.get(node.id)) if (lost.has(dep)) node.dependencies.add(dep);
|
|
45979
46165
|
}
|
|
45980
46166
|
|
|
45981
46167
|
// src/deployment/deploy-engine/execute/provision-node.ts
|
|
@@ -46156,6 +46342,22 @@ async function settleFailedDeployRecords(run) {
|
|
|
46156
46342
|
}
|
|
46157
46343
|
|
|
46158
46344
|
// src/deployment/deploy-engine/execute/rollback-after-failure.ts
|
|
46345
|
+
function interruptedRemedy(parentStack, stackName) {
|
|
46346
|
+
if (parentStack === void 0) return partialStateRemedy(stackName);
|
|
46347
|
+
return "This is a nested stack: recover it through its top-level stack. " + partialStateRemedy(parentStack.split("~")[0]);
|
|
46348
|
+
}
|
|
46349
|
+
function partialStateRemedy(stackName) {
|
|
46350
|
+
const stack = {
|
|
46351
|
+
value: stackName,
|
|
46352
|
+
hole: "stack"
|
|
46353
|
+
};
|
|
46354
|
+
const matched = {
|
|
46355
|
+
...stack,
|
|
46356
|
+
opts: { patternMatched: true }
|
|
46357
|
+
};
|
|
46358
|
+
return `Resume, revert, or clean up with one of:
|
|
46359
|
+
${pasteableCommand("cdkd deploy", [matched]).command}\n ${pasteableCommand("cdkd rollback", [stack]).command}\n ${pasteableCommand("cdkd destroy", [matched]).command}`;
|
|
46360
|
+
}
|
|
46159
46361
|
async function rollbackFailedDeploy(run, error, initialDeploy, currentEtag) {
|
|
46160
46362
|
const { engine, stackName, currentState, newResources, completedOperations, failedOperations } = run;
|
|
46161
46363
|
let autoRollbackClean = false;
|
|
@@ -46167,13 +46369,13 @@ async function rollbackFailedDeploy(run, error, initialDeploy, currentEtag) {
|
|
|
46167
46369
|
let rollbackRemainingFailedOps = failedOperations;
|
|
46168
46370
|
if (error instanceof InterruptedError || isInterruptedWaitError(error) || engine.interruptCause === "user") {
|
|
46169
46371
|
await writeRollbackJournalSegment(engine.rollbackDeps(), stackName, completedOperations, failedOperations, "interrupted", initialDeploy);
|
|
46170
|
-
engine.logger.info(safeMsg`Partial state saved (${Object.keys(newResources).length} resources).
|
|
46372
|
+
engine.logger.info(safeMsg`Partial state saved (${Object.keys(newResources).length} resources). ${asIsMessage(interruptedRemedy(engine.rollbackDeps().options.parentStackInfo?.parentStack, stackName))}`);
|
|
46171
46373
|
throw error;
|
|
46172
46374
|
}
|
|
46173
46375
|
if (engine.options.noRollback) {
|
|
46174
46376
|
await writeRollbackJournalSegment(engine.rollbackDeps(), stackName, completedOperations, failedOperations, "no-rollback-failure", initialDeploy);
|
|
46175
46377
|
engine.logger.warn("Deployment failed. --no-rollback is set, skipping rollback.");
|
|
46176
|
-
engine.logger.warn(safeMsg`Partial state has been saved. ${recoveryHint(engine.rollbackDeps(),
|
|
46378
|
+
engine.logger.warn(safeMsg`Partial state has been saved. ${asIsMessage(recoveryHint(engine.rollbackDeps(), partialStateRemedy(stackName)))}`);
|
|
46177
46379
|
} else {
|
|
46178
46380
|
autoRollbackJournaled = await writeRollbackJournalSegment(engine.rollbackDeps(), stackName, completedOperations, failedOperations, "auto-rollback-started", initialDeploy);
|
|
46179
46381
|
const rollbackResult = await performRollback(engine.rollbackDeps(), completedOperations, newResources, stackName, currentState, failedOperations, currentState.orphans ?? [], {
|
|
@@ -46367,11 +46569,7 @@ async function executeDeployment(engine, template, currentState, changes, dag, e
|
|
|
46367
46569
|
engine.logger.info(safeMsg`${cyan("Deploying")} ${cyan(createUpdateIds.length)} resource(s) (DAG: ${executionLevels.length} levels, max parallel: ${concurrency})`);
|
|
46368
46570
|
const createUpdateExecutor = new DagExecutor(phaseScope);
|
|
46369
46571
|
const provisionable = new Set(createUpdateIds);
|
|
46370
|
-
const createUpdateDeps =
|
|
46371
|
-
for (const id of createUpdateIds) {
|
|
46372
|
-
const allDeps = engine.dagBuilder.getDirectDependencies(dag, id);
|
|
46373
|
-
createUpdateDeps.set(id, new Set(allDeps.filter((d) => provisionable.has(d))));
|
|
46374
|
-
}
|
|
46572
|
+
const createUpdateDeps = nearestMemberDependencies(createUpdateIds, (id) => engine.dagBuilder.getDirectDependencies(dag, id), (id) => provisionable.has(id));
|
|
46375
46573
|
const levelOf = /* @__PURE__ */ new Map();
|
|
46376
46574
|
executionLevels.forEach((level, at) => {
|
|
46377
46575
|
for (const id of level) levelOf.set(id, at);
|
|
@@ -46586,7 +46784,12 @@ function hasPendingMovesOut(state) {
|
|
|
46586
46784
|
function pendingMovesRefusalMessage(state, stackName, region, command) {
|
|
46587
46785
|
const { moves } = pendingMovesOutOf(state);
|
|
46588
46786
|
const listed = moves.length > 0 ? moves.map((m) => `${m.from} -> ${m.toStack}.${m.to}`).join(", ") : "a move this binary cannot read";
|
|
46589
|
-
|
|
46787
|
+
const refactorCommand = pasteableCommand("cdkd refactor", [{
|
|
46788
|
+
value: stackName,
|
|
46789
|
+
hole: "stack",
|
|
46790
|
+
opts: { patternMatched: true }
|
|
46791
|
+
}]).command;
|
|
46792
|
+
return safeMsg`${command} refused stack ${stackName} (${region}): a cdkd refactor that moved ` + safeMsg`resources out of it did not finish (${listed}). The destination may already hold ` + `them, so acting on this stack now could delete a resource another stack owns. Run ${proseQuoted(refactorCommand)} to finish the move, then re-run.`;
|
|
46590
46793
|
}
|
|
46591
46794
|
function refusePendingMovesOut(state, stackName, region, command) {
|
|
46592
46795
|
if (!hasPendingMovesOut(state)) return;
|
|
@@ -47715,7 +47918,7 @@ async function prepareChangeExecution(engine, { stackName, currentState, effecti
|
|
|
47715
47918
|
if (idArrivesLater) {
|
|
47716
47919
|
startGeneratedNameGuard();
|
|
47717
47920
|
const kept = await retainedForWarning ?? [];
|
|
47718
|
-
if (kept.length > 0) engine.logger.warn(safeMsg`An earlier deployment of ${displayStackName(stackName)} kept ${String(kept.length)} ` + "resource(s) here (DeletionPolicy: Retain). This deploy does not take them back: it creates new resources under new names, as CloudFormation does. To manage a kept resource again, adopt it with
|
|
47921
|
+
if (kept.length > 0) engine.logger.warn(safeMsg`An earlier deployment of ${displayStackName(stackName)} kept ${String(kept.length)} ` + "resource(s) here (DeletionPolicy: Retain). This deploy does not take them back: it creates new resources under new names, as CloudFormation does. To manage a " + safeMsg`kept resource again, adopt it with: ${cdkdRemedy("cdkd import")}`);
|
|
47719
47922
|
}
|
|
47720
47923
|
engine.generatedNameGuard?.recordPlannedIntents();
|
|
47721
47924
|
}
|
|
@@ -48320,5 +48523,5 @@ var DeployEngine = class {
|
|
|
48320
48523
|
}
|
|
48321
48524
|
};
|
|
48322
48525
|
|
|
48323
|
-
export { vectorIndexesForCreate as $, applyCallerIdentityCredentials as $a, isDefaultBootstrapRepoName as $c, isFinalSnapshotError as $i, withUnprovenUnsettled as $n, toFiniteNumber as $o, noEchoParameterValueSeed as $r, malformedOutputsRefusalMessage as $s, displacedOpClause as $t, PROTECTION_PROPERTY_BY_TYPE as A, UNSPECIFIED_SKIP_REASON as Aa, NO_CC_HANDLERS_REASON as Ac, withAttemptedItemsMasked as Ai, hasPlainPrototype as Al, findDestructiveChanges as An, isImpossibleEmptyStoredAttribute as Ao, nameGenerationCarriedFrom as Ar, refuseMalformedResourceEntriesForImport as As, IMPLICIT_DELETE_DEPENDENCIES as At, reverseMapStreamPolicy as B, stackIdTailOf as Ba, CrossPrefixScanCache as Bc, secretNamedRecordNeedles as Bi, clearBucketRegionCache as Bl, differingRemedy as Bn, replacementSidesForLog as Bo, namesAnyDeclaredParameter as Br, refuseMalformedResourcePropertiesForExport as Bs, updateRefactorMarker as Bt, refusePendingMovesOut as C, withPrintingSecrets as Ca, findActionableSdkUnwired as Cc, green as Ci, isListParameterType as Cl, NOECHO_MAC_KEY_ALIAS as Cn, outputReferenceProvenanceOf as Co, REDACTED_DELETE_ADDRESS_SKIP_REASON as Cr, malformedLocalResourcesWarning as Cs, maskedLogger as Ct, diffSecurity as D, resolvedResourceTimeoutMs as Da, withoutAcceptedSdkUnwiredProperties as Dc, noEchoComparisonForTemplate as Di, decodeListingKey as Dl, noEchoMacVerdict as Dn, referenceProvenanceOf as Do, segmentCleanupOptions as Dr, refuseMalformedResourceEntries as Ds, S3_AUTO_DELETE_OBJECTS_TAG as Dt, serviceTokenBlockingReason as E, waitForGoneAfterDelete as Ea, unwrittenCreateOnlyReplacement as Ec, noEchoAttributeNamesOf as Ei, purgeNoncurrentKeyVersions as El, noEchoMacParametersOf as En, recordedReferenceRegions as Eo, redactedDeleteAddressSkip as Er, refuseMalformedResourceAttributesForOrphan as Es, ECR_AUTO_DELETE_IMAGES_TAG as Et, STREAM_POLICY_KEY as F, isWaitAbandonedError as Fa, isKnownTokenFreeState as Fc, namingSecretsWithRecordedNoEcho as Fi, describeFileReadFailure as Fl, rollbackOrphanIds as Fn, withSharedDrainBudget as Fo, retiredNameGenerationsLeaving as Fr, malformedDriftResourcePropertiesWarning as Fs, readRefactorMarkerOnce as Ft, streamTagsMatchDeclared as G, applyRoleArnIfSet as Ga, stackInstanceIdOf as Gc, maskedSecretSegment as Gi, propertiesChangedReason as Gn, MULTI_REGION_RECREATE_BLOCKED_TYPES as Go, exportAliasCollisionScrubWarning as Gr, malformedOrphansRefusalMessage as Gs, formatResourceLine as Gt, streamDeclaresTags as H, resolveDynamicReferences as Ha, crossPrefixDeniedWarning as Hc, storedSecretNameNeedles as Hi, looselyEqual as Hn, findReplacedReadersOfRecreateTargets as Ho, resourcesNamingDeclaredParameter as Hr, repairMalformedResourcePropertiesForReadOnly as Hs, readsOnlyNoEchoParameters as Ht, STREAM_TAGS_KEY as I, IntrinsicFunctionResolver as Ia, hasReasonlessBaselineRefusal as Ic, orphanRecordsPrintingBag as Ii, displayAssemblyPath as Il, withMovedTo as In, namesRecreatedParent as Io, withNameGenerationReached as Ir, malformedResourcePropertiesWarning as Is, refactorMarkerMovesOf as It, planTimeToLive as J, explicitRoleArnOrThrow as Ja, stringifyValue as Jc, ATOMIC_FINAL_SNAPSHOT_TYPES as Ji, replayFailedOperations as Jn, renderStatefulReason as Jo, secretSafeKeyDisplay as Jr, refuseMalformedOrphansForDestroy as Js, lookupEachName as Jt, isTtlAlreadyDisabled as K, assertFlagRoleArn as Ka, withStackInstanceIdWithheld as Kc, secretSegmentsOfState as Ki, proposeRenames as Kn, isStatefulRecreateTargetForReplace as Ko, secretBearing as Kr, malformedOrphansWarning as Ks, chunks as Kt, declaredStreamPolicyMember as L, isSelectOutOfBounds as La, hasUnverifiableParameterRefusal as Lc, secretNamePrintingBag as Li, namesTheSameDirectory as Ll, changedReferenceInDiff as Ln, INTRINSIC_KEYS as Lo, getCurrentProducerRegions as Lr, refuseMalformedResourceProperties as Ls, refactorMarkerRefusalMessage as Lt, perType as M, deleteLeftInPlace as Ma, TemplateParser as Mc, completedReplayEntries as Mi, ownValue as Ml, findRefactorHints as Mn, isNamelessDynamicReferenceError as Mo, nameScopeOf as Mr, refuseMalformedResourceEntriesForOrphan as Ms, keptForRetainedRecord as Mt, readProtection as N, deleteSkipReason as Na, S3StateBackend as Nc, journaledOrphanPrintingBag as Ni, absoluteAssemblyPathEscape as Nl, hintSidesOf as Nn, carriesDynamicReference as No, retiredAfterRollback as Nr, repairMalformedResourceEntriesForReadOnly as Ns, recordRetainedForReadoption as Nt, recordedProtectionEvidence as O, setResolvedResourceTimeouts as Oa, withoutSdkUnwiredProperties as Oc, noEchoExactEchoLeavesOf as Oi, defineOwnKey as Ol, noEchoValueMacsOf as On, referenceTokensIn as Oo, removeProtectionTypeList as Or, refuseMalformedResourceEntriesForDeploy as Os, hasCdkAutoDeleteTag as Ot, DynamoDBGlobalTableProvider as P, withIndeterminateGuard as Pa, splitImportedOps as Pc, maskEventTextWithBoundBags as Pi, assemblyPathEscape as Pl, movedToHint as Pn, keepsSecretReferenceToken as Po, retiredNameGenerationsAfter as Pr, unreadableResourceEntries as Ps, readRefactorMarker as Pt, readbackVectorIndexes as Q, AWS_CREDENTIAL_ENV_KEYS as Qa, isDefaultBootstrapBucketName as Qc, effectiveDeletionPolicy as Qi, settleUnsettledPrevious as Qn, toCfnInteger as Qo, isWholeDynamicReferenceValue as Qr, malformedLocalOutputsWarning as Qs, NESTED_PENDING_PARENT_REASON as Qt, declaredStreamTagsMember as R, isAlwaysLiveAttribute as Ra, rebuildClientForBucketRegion as Rc, secretNamePrintingBags as Ri, renderAssemblyPathEscape as Rl, changedReferencePath as Rn, containsIntrinsic as Ro, inheritProducerRegions as Rr, refuseMalformedResourcePropertiesForDestroy as Rs, refuseRefactorMarker as Rt, pendingMovesRefusalMessage as S, getCurrentResourceSecrets as Sa, hasReadableResources as Sc, gray as Si, SSM_PARAMETER_VALUE_PREFIX as Sl, DeploymentEventsStore as Sn, keepHeldTokenProvenance as So, findNestedStackTypeChanges as Sr, malformedLocalResourceEntriesWarning as Ss, deleteTableWithIndexBusyRetry as St, findServiceTokenRefusals as T, CloudControlProvider as Ta, findSdkUnwiredProperties as Tc, yellow as Ti, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as Tl, noEchoMacBinding as Tn, recordedProvenanceOf as To, redactedDeleteAddressFields as Tr, malformedScrubResourceEntriesRefusalMessage as Ts, waitForIndexesSettled as Tt, streamMemberRefusals as U, producerLookupOver as Ua, isAccessDenied$1 as Uc, extractDeploymentEventError as Ui, mappingPairs as Un, isPlainReferenceTo as Uo, WITHHELD_NAME_DISPLAY as Ur, UNREADABLE_ORPHANS_CONTAINER_ROW as Us, getPriorAttempts as Ut, streamDeclaresPolicy as V, isSettledInstanceState as Va, applyCrossPrefixScan as Vc, stateSecretNameNeedles as Vi, resolveBucketRegion as Vl, isPairableType as Vn, siblingsOf as Vo, reachableDivergentParameters as Vr, refuseMalformedResourcePropertiesForOrphan as Vs, macWriteOnlyKeys as Vt, streamPolicyMatchesDeclared as W, refuseUnreadableCdkCrossAccountRefs as Wa, isNotImplemented as Wc, APPSYNC_APIKEY_ARN_RESOURCE_PATH as Wi, parseMappingFile as Wn, shownType as Wo, displayTextOrWithheld as Wr, hasReadableOrphans as Ws, markRefusedBeforeApplying as Wt, sendTtlWaitingOutRateLimit as X, parseIamRoleArn as Xa, createAssetRedirectResolver as Xc, ccRoutedFinalSnapshotError as Xi, DELETED_RESOURCE_REMEDY as Xn, coerceWarmThroughput as Xo, exportNameNoEchoParameters as Xr, malformedExportNamesWarning as Xs, pendingRequestCount as Xt, readTtlSpec as Y, isIamRoleArn as Ya, buildAssetRedirectMap as Yc, PRE_DELETE_SNAPSHOT_TYPES as Yi, replayRollback as Yn, WARM_THROUGHPUT_MEMBERS as Yo, carriedExportAliasExposure as Yr, repairMalformedOrphansForReadOnly as Ys, withApiLimit as Yt, planVectorIndexUpdates as Z, sendableAssumeRoleCommand as Za, flattenAssetPlaceholders as Zc, ccRoutedInstanceTakesNoSnapshot as Zi, recordAfterRollbackUpdate as Zn, isWarmThroughputDecrease as Zo, exportNameSecretExposure as Zr, malformedExportSourceWarning as Zs, resolvePendingCloudControlRequests as Zt, listNestedTemplateRows as _, customResourceResponseExpirationWarning as _a, withheldAccountClause as _c, supersededHolderOf as _i, isCfnTemplateAssetPath as _l, sameJournaledOrphans as _n, lacksRecordedTableArn as _o, recheckFailedPlan as _r, refuseMalformedOrphansForOrphan as _s, resolveDynamoDbDeleteBudgetClock as _t, scanActiveConsumers as a, ProviderRegistry as aa, STATE_REGION_DIVERGED as ac, DEFAULT_RESOURCE_WARN_AFTER_MS as ai, ensureAssetStorage as al, revertNestedChildFromJournal as an, regionLessSecretName as ao, updatePartialReason as ar, maskedInputProof as as, planContributorInsightsOp as at, hasPendingMovesOut as b, readsNoEchoDeleteValues as ba, displayLogicalId as bc, bold as bi, warnAbsoluteAssetPath as bl, planOrphanAdoption as bn, extractGetAttRefs as bo, resolveReplacementOldType as br, unreadableOrphanRecords as bs, INDEX_SETTLE_POLL_INTERVAL_MS as bt, inheritedProvenanceForChildDiff as c, wouldReturnToSdkProvider as ca, malformedResourcesWarning as cc, destroyStackRecordsView as ci, isCrossRegionRedirect as cl, collectNestedChildUnaddressed as cn, s3BucketDualStackDomainName as co, reserveStackCreateToken as cr, maskedPropertyFingerprint as cs, reverseMapIndexContributorInsights as ct, conditionInputsFrom as d, localCustomResourceCommand as da, refuseMalformedResourcesForDestroy as dc, replacedDeleteFailureVerdict as di, readBootstrapMarkerBody as dl, deleteJournaledOrphans as dn, coerceParameterTypedValue as do, planRollback as dr, malformedOrphanRecordsRefusalMessage as ds, DYNAMODB_DELETE_DEADLINE_MARGIN_MS as dt, refusesFinalSnapshot as ea, malformedOutputsWarning as ec, collectDeclaredOutputNames as ei, loadPublishableAssetManifest as el, displacedPhysicalIdShown as en, callerEnvCredentials as eo, calculateResourceDrift as er, tryGetTopLevelWriteOnlyProperties as es, vectorIndexesSettled as et, parentSuppliedValues as f, localCustomResourceRuntimeActive as fa, refuseMalformedResourcesForExport as fc, deleteSupersededEntry as fi, validateAssetBucketName as fl, dropFailedCommands as fn, isUnboundTemplateParameter as fo, seedsDeleteFirstGuard as fr, malformedOrphanRecordsWarning as fs, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as ft, isAbsoluteAssetPath as g, applyCustomResourceResponseExpiration as ga, accountArgs as gc, supersededHeldByOtherTypeWarning as gi, getDockerImageBySourceHash as gl, loadJournaledOrphans as gn, isStalePlaceholderArnAttribute as go, planFailedOps as gr, refuseMalformedOrphanRecordsForDestroy as gs, deleteBudgetKey as gt, findNestedTemplateTreeDefect as h, CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID as ha, JSON_LISTING_HOLE_VALUE as hc, supersededAfterRollback as hi, AssetManifestLoader as hl, journaledOrphanLines as hn, cfnRefValueFromPhysicalId as ho, isReplacementOrphan as hr, refuseMalformedOrphanRecords as hs, compensateRemovedDeletionProtection as ht, mergeNoChangeOutputs as i, CC_BROKEN_REASON as ia, repairMalformedOutputsForReadOnly as ic, DEFAULT_RESOURCE_TIMEOUT_MS as ii, AssetModeResolver as il, recordDisplacedSkips as in, producerRegionsFromState as io, updatePartialMessage as ir, parameterInputsFor as is, indexDeclaresContributorInsights as it, isProtectionValueActive as j, deleteIndeterminateGuards as ja, hasNoCloudControlHandlers as jc, createReadOnlyAttributeHealerFactory as ji, nullPrototypeRecord as jl, formatDestructiveChange as jn, carriesFetchableDynamicReference as jo, nameGenerationHighWaterOf as jr, refuseMalformedResourceEntriesForImportSave as js, computeImplicitDeleteEdges as jt, recordedProtectionNote as k, RollbackInlinePolicyWriters as ka, withoutUnwrittenSdkUnwiredProperties as kc, noEchoParameterNamesOf as ki, hasOwnKey as kl, constructPathOf as kn, getAccountInfo as ko, orphanNeedsIdentity as kr, refuseMalformedResourceEntriesForDestroy as ks, isTruthyCfnBoolean as kt, makeCanonicalizePropertiesFn as l, NO_LOCAL_CUSTOM_RESOURCES_FLAG as la, malformedStateRefusalMessage as lc, getStackRecords as li, getBootstrapMarkerKey as ll, getCurrentNestedStackContext as ln, s3BucketRegionalDomainName as lo, withCreateTokenLedger as lr, deployRefusesOrphanRowsReason as ls, reverseMapTableContributorInsights as lt, childTemplateLoader as m, withCustomResourceStack as ma, repairMalformedResourcesForReadOnly as mc, isSupersededResourceRecord as mi, BOOTSTRAP_MARKER_PREFIX as ml, isHandledOrphan as mn, AWS_NO_VALUE as mo, isJournaledOrphan as mr, previewableOrphanRecords as ms, beginDeleteWait as mt, isSecretBearingReferenceString as n, createPreDeleteFinalSnapshot as na, refuseMalformedOutputs as nc, isExportAliasCollision as ni, redirectFileAsset as nl, getNestedRevertRun as nn, classifyRecordedSecretRegion as no, equalModuloMask as nr, maskedPropertyFingerprintsOf as ns, CONTRIBUTOR_INSIGHTS_KEY as nt, inRunStackKey as o, ccBrokenReason as oa, refuseDivergentRecordRegionForDestroy as oc, maskingRetryLogger as oi, buildDenyExternalAccessPolicy as ol, revertedNestedRowIds as on, s3BucketArn as oo, earliestDefined as or, passedParameterClassesOf as os, planIndexContributorInsightsOps as ot, readRecordedConditionVerdicts as p, setLocalCustomResourceRuntimeEnabled as pa, refuseMalformedState as pc, holdsSupersededResources as pi, validateContainerRepoName as pl, dropFailedHint as pn, parameterTypeMayLoseSecretIdentity as po, demoteSupersededOrphans as pr, malformedOrphanRowsKeptWarning as ps, DYNAMODB_DELETE_POLL_COST_MS as pt, isTtlRateLimited as q, assertSendableRoleArn as qa, isSensitiveAttributeName as qc, withSecretPhysicalIdsMaskedInState as qi, referencedLogicalIds as qn, isStatefulRecreateTargetSync as qo, secretBearingStateKeyWarning as qr, refuseMalformedOrphans as qs, isAccessDeniedError as qt, keptWholeReasonText as r, buildFinalSnapshotIdentifier as ra, refuseMalformedOutputsForDestroy as rc, bindingSkippedOutputs as ri, rewriteTemplateAssetReferences as rl, nestedChildStackName as rn, classifyReplaySecretRegion as ro, undeclaredEmptyObservedKeys as rr, movedMaskedProperties as rs, contributorInsightsRefusals as rt, crossStackOutputProvenanceSource as s, isCustomResource as sa, malformedRenderedContainersWarning as sc, awaitInFlightSibling as si, assertAssetBucketRegion as sl, withNestedRevertRun as sn, s3BucketDomainName as so, ledgerForStack as sr, declaresNoEcho as ss, readContributorInsightsSpec as st, DeployEngine as t, unsupportedFinalSnapshotError as ta, refuseMalformedNestedChildOutputs as tc, collectPublishedOutputNames as ti, redirectDockerAsset as tl, dropSettledNestedJournals as tn, envCredentialsAreAssumedRole as to, equalModuloMarkedMask as tr, inputFingerprinter as ts, vectorIndexesShapeDetail as tt, conditionFingerprint as u, customResourceStackName as ua, refuseMalformedResourcesForDeploy as uc, withStackRecords as ui, parseBootstrapMarker as ul, withNestedStackContext as un, s3BucketWebsiteUrl as uo, acquireIdempotencyToken as ur, isReadableOrphanRecord as us, stripIndexContributorInsights as ut, renderNestedTemplateTreeDefect as v, responsePresignClient as va, STATE_RESOURCES_MALFORMED as vc, supersededResourcesOf as vi, parseAssetManifestBody as vl, makeForeignHolderScan as vn, refStateLookupFromResource as vo, recordUnderIdIsNotOwn as vr, repairMalformedOrphanRecordsForReadOnly as vs, resolveDynamoDbDeleteBudgetMs as vt, deferredServiceTokenWarning as w, waitForLambdaFunctionActive as wa, findHandledUnwrittenCreateOnly as wc, red as wi, ssmResolvedValueType as wl, createNoEchoValueMacs as wn, recordedOutputReferenceRegions as wo, isRedactedRecordedValue as wr, malformedResourceEntriesWarning as ws, relayedIndexBusyDelete as wt, pendingMovesOutOf as x, isCustomResourceType as xa, hasReadableOutputs as xc, cyan as xi, warnWholeAssemblyAsSource as xl, DeploymentEventsReader as xn, promoteInPlaceAttributeDependents as xo, withPreviousPolicies as xr, isReadableResourceEntry as xs, TABLE_INDEX_NOUN as xt, templateIdentity as y, TemplateNoEchoReresolver as ya, UNREADABLE_RESOURCES_MAP_ROW as yc, withoutSuperseded as yi, resolveFileAssetSourcePath as yl, makeSiblingClaimReader as yn, parseWebACLArn as yo, replacementNeverSwapped as yr, unpreviewableOrphanRecords as ys, DELETE_INDEX_WAIT_PROCEED_NOTE as yt, planStreamMemberOps as z, poisonRenderedSpellingsCollidingIn as za, CrossPrefixReadError as zc, secretNamedAttributeNamesOf as zi, resolveAssemblyPath as zl, changedReferenceReason as zn, markNewValueKnownAfterDeploy as zo, computeParameterTaint as zr, refuseMalformedResourcePropertiesForDrift as zs, sameMove as zt };
|
|
48324
|
-
//# sourceMappingURL=deploy-engine-
|
|
48526
|
+
export { vectorIndexesForCreate as $, sendableAssumeRoleCommand as $a, flattenAssetPlaceholders as $c, isFinalSnapshotError as $i, equalModuloMarkedMask as $n, isWarmThroughputDecrease as $o, noEchoParameterValueSeed as $r, malformedExportSourceWarning as $s, dropSettledNestedJournals as $t, PROTECTION_PROPERTY_BY_TYPE as A, setResolvedResourceTimeouts as Aa, withoutSdkUnwiredProperties as Ac, withAttemptedItemsMasked as Ai, decodeListingKey as Al, findRefactorHints as An, referenceTokensIn as Ao, nameGenerationCarriedFrom as Ar, refuseMalformedResourceEntriesForDeploy as As, keptForRetainedRecord as At, reverseMapStreamPolicy as B, isAlwaysLiveAttribute as Ba, rebuildClientForBucketRegion as Bc, secretNamedRecordNeedles as Bi, describeFileReadFailure as Bl, looselyEqual as Bn, containsIntrinsic as Bo, namesAnyDeclaredParameter as Br, refuseMalformedResourcePropertiesForDestroy as Bs, readsOnlyNoEchoParameters as Bt, refusePendingMovesOut as C, localCustomResourceRuntimeActive as Ca, hasReadableOutputs as Cc, green as Ci, warnWholeAssemblyAsSource as Cl, noEchoMacBinding as Cn, promoteInPlaceAttributeDependents as Co, REDACTED_DELETE_ADDRESS_SKIP_REASON as Cr, isReadableResourceEntry as Cs, maskedLogger as Ct, diffSecurity as D, CloudControlProvider as Da, findSdkUnwiredProperties as Dc, noEchoComparisonForTemplate as Di, ssmResolvedValueType as Dl, constructPathOf as Dn, recordedProvenanceOf as Do, segmentCleanupOptions as Dr, malformedScrubResourceEntriesRefusalMessage as Ds, S3_AUTO_DELETE_OBJECTS_TAG as Dt, serviceTokenBlockingReason as E, waitForLambdaFunctionActive as Ea, findHandledUnwrittenCreateOnly as Ec, noEchoAttributeNamesOf as Ei, isListParameterType as El, noEchoValueMacsOf as En, recordedOutputReferenceRegions as Eo, redactedDeleteAddressSkip as Er, malformedResourceEntriesWarning as Es, ECR_AUTO_DELETE_IMAGES_TAG as Et, STREAM_POLICY_KEY as F, deleteSkipReason as Fa, S3StateBackend as Fc, namingSecretsWithRecordedNoEcho as Fi, hasPlainPrototype as Fl, changedReferenceInDiff as Fn, carriesDynamicReference as Fo, retiredNameGenerationsLeaving as Fr, repairMalformedResourceEntriesForReadOnly as Fs, refactorMarkerRefusalMessage as Ft, streamTagsMatchDeclared as G, producerLookupOver as Ga, isAccessDenied$1 as Gc, maskedSecretSegment as Gi, clearBucketRegionCache as Gl, referencedLogicalIds as Gn, isPlainReferenceTo as Go, exportAliasCollisionScrubWarning as Gr, UNREADABLE_ORPHANS_CONTAINER_ROW as Gs, isAccessDeniedError as Gt, streamDeclaresTags as H, stackIdTailOf as Ha, CrossPrefixScanCache as Hc, storedSecretNameNeedles as Hi, namesTheSameDirectory as Hl, parseMappingFile as Hn, replacementSidesForLog as Ho, resourcesNamingDeclaredParameter as Hr, refuseMalformedResourcePropertiesForExport as Hs, markRefusedBeforeApplying as Ht, STREAM_TAGS_KEY as I, withIndeterminateGuard as Ia, splitImportedOps as Ic, orphanRecordsPrintingBag as Ii, nullPrototypeRecord as Il, changedReferencePath as In, keepsSecretReferenceToken as Io, withNameGenerationReached as Ir, unreadableResourceEntries as Is, refuseRefactorMarker as It, planTimeToLive as J, assertFlagRoleArn as Ja, withStackInstanceIdWithheld as Jc, ATOMIC_FINAL_SNAPSHOT_TYPES as Ji, DELETED_RESOURCE_REMEDY as Jn, isStatefulRecreateTargetForReplace as Jo, secretSafeKeyDisplay as Jr, malformedOrphansWarning as Js, pendingRequestCount as Jt, isTtlAlreadyDisabled as K, refuseUnreadableCdkCrossAccountRefs as Ka, isNotImplemented as Kc, secretSegmentsOfState as Ki, resolveBucketRegion as Kl, replayFailedOperations as Kn, shownType as Ko, secretBearing as Kr, hasReadableOrphans as Ks, lookupEachName as Kt, declaredStreamPolicyMember as L, isWaitAbandonedError as La, isKnownTokenFreeState as Lc, secretNamePrintingBag as Li, ownValue as Ll, changedReferenceReason as Ln, withSharedDrainBudget as Lo, getCurrentProducerRegions as Lr, malformedDriftResourcePropertiesWarning as Ls, sameMove as Lt, perType as M, UNSPECIFIED_SKIP_REASON as Ma, NO_CC_HANDLERS_REASON as Mc, completedReplayEntries as Mi, synthesizedStacks as Ml, movedToHint as Mn, isImpossibleEmptyStoredAttribute as Mo, nameScopeOf as Mr, refuseMalformedResourceEntriesForImport as Ms, readRefactorMarker as Mt, readProtection as N, deleteIndeterminateGuards as Na, hasNoCloudControlHandlers as Nc, journaledOrphanPrintingBag as Ni, defineOwnKey as Nl, rollbackOrphanIds as Nn, carriesFetchableDynamicReference as No, retiredAfterRollback as Nr, refuseMalformedResourceEntriesForImportSave as Ns, readRefactorMarkerOnce as Nt, recordedProtectionEvidence as O, waitForGoneAfterDelete as Oa, unwrittenCreateOnlyReplacement as Oc, noEchoExactEchoLeavesOf as Oi, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as Ol, findDestructiveChanges as On, recordedReferenceRegions as Oo, removeProtectionTypeList as Or, refuseMalformedResourceAttributesForOrphan as Os, hasCdkAutoDeleteTag as Ot, DynamoDBGlobalTableProvider as P, deleteLeftInPlace as Pa, TemplateParser as Pc, maskEventTextWithBoundBags as Pi, hasOwnKey as Pl, withMovedTo as Pn, isNamelessDynamicReferenceError as Po, retiredNameGenerationsAfter as Pr, refuseMalformedResourceEntriesForOrphan as Ps, refactorMarkerMovesOf as Pt, readbackVectorIndexes as Q, parseIamRoleArn as Qa, createAssetRedirectResolver as Qc, effectiveDeletionPolicy as Qi, calculateResourceDrift as Qn, coerceWarmThroughput as Qo, isWholeDynamicReferenceValue as Qr, malformedExportNamesWarning as Qs, displacedPhysicalIdShown as Qt, declaredStreamTagsMember as R, IntrinsicFunctionResolver as Ra, hasReasonlessBaselineRefusal as Rc, secretNamePrintingBags as Ri, absoluteAssemblyPathEscape as Rl, differingRemedy as Rn, namesRecreatedParent as Ro, inheritProducerRegions as Rr, malformedResourcePropertiesWarning as Rs, updateRefactorMarker as Rt, pendingMovesRefusalMessage as S, localCustomResourceCommand as Sa, displayLogicalId as Sc, gray as Si, warnAbsoluteAssetPath as Sl, createNoEchoValueMacs as Sn, extractGetAttRefs as So, findNestedStackTypeChanges as Sr, unreadableOrphanRecords as Ss, deleteTableWithIndexBusyRetry as St, findServiceTokenRefusals as T, withCustomResourceStack as Ta, findActionableSdkUnwired as Tc, yellow as Ti, SSM_PARAMETER_VALUE_PREFIX as Tl, noEchoMacVerdict as Tn, outputReferenceProvenanceOf as To, redactedDeleteAddressFields as Tr, malformedLocalResourcesWarning as Ts, waitForIndexesSettled as Tt, streamMemberRefusals as U, isSettledInstanceState as Ua, applyCrossPrefixScan as Uc, extractDeploymentEventError as Ui, renderAssemblyPathEscape as Ul, propertiesChangedReason as Un, siblingsOf as Uo, WITHHELD_NAME_DISPLAY as Ur, refuseMalformedResourcePropertiesForOrphan as Us, formatResourceLine as Ut, streamDeclaresPolicy as V, poisonRenderedSpellingsCollidingIn as Va, CrossPrefixReadError as Vc, stateSecretNameNeedles as Vi, displayAssemblyPath as Vl, mappingPairs as Vn, markNewValueKnownAfterDeploy as Vo, reachableDivergentParameters as Vr, refuseMalformedResourcePropertiesForDrift as Vs, getPriorAttempts as Vt, streamPolicyMatchesDeclared as W, resolveDynamicReferences as Wa, crossPrefixDeniedWarning as Wc, APPSYNC_APIKEY_ARN_RESOURCE_PATH as Wi, resolveAssemblyPath as Wl, proposeRenames as Wn, findReplacedReadersOfRecreateTargets as Wo, displayTextOrWithheld as Wr, repairMalformedResourcePropertiesForReadOnly as Ws, chunks as Wt, sendTtlWaitingOutRateLimit as X, explicitRoleArnOrThrow as Xa, stringifyValue as Xc, ccRoutedFinalSnapshotError as Xi, settleUnsettledPrevious as Xn, renderStatefulReason as Xo, exportNameNoEchoParameters as Xr, refuseMalformedOrphansForDestroy as Xs, NESTED_PENDING_PARENT_REASON as Xt, readTtlSpec as Y, assertSendableRoleArn as Ya, isSensitiveAttributeName as Yc, PRE_DELETE_SNAPSHOT_TYPES as Yi, recordAfterRollbackUpdate as Yn, isStatefulRecreateTargetSync as Yo, carriedExportAliasExposure as Yr, refuseMalformedOrphans as Ys, resolvePendingCloudControlRequests as Yt, planVectorIndexUpdates as Z, isIamRoleArn as Za, buildAssetRedirectMap as Zc, ccRoutedInstanceTakesNoSnapshot as Zi, withUnprovenUnsettled as Zn, WARM_THROUGHPUT_MEMBERS as Zo, exportNameSecretExposure as Zr, repairMalformedOrphansForReadOnly as Zs, displacedOpClause as Zt, listNestedTemplateRows as _, withPrintingSecrets as _a, JSON_LISTING_HOLE_VALUE as _c, supersededHolderOf as _i, AssetManifestLoader as _l, makeSiblingClaimReader as _n, cfnRefValueFromPhysicalId as _o, replacementNeverSwapped as _r, refuseMalformedOrphanRecords as _s, resolveDynamoDbDeleteBudgetClock as _t, scanActiveConsumers as a, ProviderRegistry as aa, refuseMalformedOutputsForDestroy as ac, DEFAULT_RESOURCE_WARN_AFTER_MS as ai, rewriteTemplateAssetReferences as al, withNestedRevertRun as an, classifyReplaySecretRegion as ao, ledgerForStack as ar, movedMaskedProperties as as, planContributorInsightsOp as at, hasPendingMovesOut as b, customResourcesFailedWithoutApp as ba, STATE_RESOURCES_MALFORMED as bc, bold as bi, parseAssetManifestBody as bl, DeploymentEventsStore as bn, refStateLookupFromResource as bo, resolveReplacementOldType as br, repairMalformedOrphanRecordsForReadOnly as bs, INDEX_SETTLE_POLL_INTERVAL_MS as bt, inheritedProvenanceForChildDiff as c, wouldReturnToSdkProvider as ca, refuseDivergentRecordRegionForDestroy as cc, destroyStackRecordsView as ci, buildDenyExternalAccessPolicy as cl, withNestedStackContext as cn, s3BucketArn as co, acquireIdempotencyToken as cr, passedParameterClassesOf as cs, reverseMapIndexContributorInsights as ct, conditionInputsFrom as d, customResourceResponseExpirationWarning as da, malformedStateRefusalMessage as dc, replacedDeleteFailureVerdict as di, getBootstrapMarkerKey as dl, dropFailedHint as dn, s3BucketRegionalDomainName as do, demoteSupersededOrphans as dr, deployRefusesOrphanRowsReason as ds, DYNAMODB_DELETE_DEADLINE_MARGIN_MS as dt, refusesFinalSnapshot as ea, malformedLocalOutputsWarning as ec, collectDeclaredOutputNames as ei, isDefaultBootstrapBucketName as el, getNestedRevertRun as en, AWS_CREDENTIAL_ENV_KEYS as eo, equalModuloMask as er, toCfnInteger as es, vectorIndexesSettled as et, parentSuppliedValues as f, responsePresignClient as fa, refuseMalformedResourcesForDeploy as fc, deleteSupersededEntry as fi, parseBootstrapMarker as fl, isHandledOrphan as fn, s3BucketWebsiteUrl as fo, isJournaledOrphan as fr, isReadableOrphanRecord as fs, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as ft, isAbsoluteAssetPath as g, getCurrentResourceSecrets as ga, repairMalformedResourcesForReadOnly as gc, supersededHeldByOtherTypeWarning as gi, BOOTSTRAP_MARKER_PREFIX as gl, makeForeignHolderScan as gn, AWS_NO_VALUE as go, recordUnderIdIsNotOwn as gr, previewableOrphanRecords as gs, deleteBudgetKey as gt, findNestedTemplateTreeDefect as h, isCustomResourceType as ha, refuseMalformedState as hc, supersededAfterRollback as hi, validateContainerRepoName as hl, sameJournaledOrphans as hn, parameterTypeMayLoseSecretIdentity as ho, recheckFailedPlan as hr, malformedOrphanRowsKeptWarning as hs, compensateRemovedDeletionProtection as ht, mergeNoChangeOutputs as i, CC_BROKEN_REASON as ia, refuseMalformedOutputs as ic, DEFAULT_RESOURCE_TIMEOUT_MS as ii, redirectFileAsset as il, revertedNestedRowIds as in, classifyRecordedSecretRegion as io, earliestDefined as ir, maskedPropertyFingerprintsOf as is, indexDeclaresContributorInsights as it, isProtectionValueActive as j, RollbackInlinePolicyWriters as ja, withoutUnwrittenSdkUnwiredProperties as jc, createReadOnlyAttributeHealerFactory as ji, rememberSynthesizedStacks as jl, hintSidesOf as jn, getAccountInfo as jo, nameGenerationHighWaterOf as jr, refuseMalformedResourceEntriesForDestroy as js, recordRetainedForReadoption as jt, recordedProtectionNote as k, resolvedResourceTimeoutMs as ka, withoutAcceptedSdkUnwiredProperties as kc, noEchoParameterNamesOf as ki, purgeNoncurrentKeyVersions as kl, formatDestructiveChange as kn, referenceProvenanceOf as ko, orphanNeedsIdentity as kr, refuseMalformedResourceEntries as ks, isTruthyCfnBoolean as kt, makeCanonicalizePropertiesFn as l, CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID as la, malformedRenderedContainersWarning as lc, getStackRecords as li, assertAssetBucketRegion as ll, deleteJournaledOrphans as ln, s3BucketDomainName as lo, planRollback as lr, declaresNoEcho as ls, reverseMapTableContributorInsights as lt, childTemplateLoader as m, readsNoEchoDeleteValues as ma, refuseMalformedResourcesForExport as mc, isSupersededResourceRecord as mi, validateAssetBucketName as ml, loadJournaledOrphans as mn, isUnboundTemplateParameter as mo, planFailedOps as mr, malformedOrphanRecordsWarning as ms, beginDeleteWait as mt, isSecretBearingReferenceString as n, createPreDeleteFinalSnapshot as na, malformedOutputsWarning as nc, isExportAliasCollision as ni, loadPublishableAssetManifest as nl, recordDisplacedSkips as nn, callerEnvCredentials as no, updatePartialMessage as nr, tryGetTopLevelWriteOnlyProperties as ns, CONTRIBUTOR_INSIGHTS_KEY as nt, inRunStackKey as o, ccBrokenReason as oa, repairMalformedOutputsForReadOnly as oc, maskingRetryLogger as oi, AssetModeResolver as ol, collectNestedChildUnaddressed as on, producerRegionsFromState as oo, reserveStackCreateToken as or, parameterInputsFor as os, planIndexContributorInsightsOps as ot, readRecordedConditionVerdicts as p, TemplateNoEchoReresolver as pa, refuseMalformedResourcesForDestroy as pc, holdsSupersededResources as pi, readBootstrapMarkerBody as pl, journaledOrphanLines as pn, coerceParameterTypedValue as po, isReplacementOrphan as pr, malformedOrphanRecordsRefusalMessage as ps, DYNAMODB_DELETE_POLL_COST_MS as pt, isTtlRateLimited as q, applyRoleArnIfSet as qa, stackInstanceIdOf as qc, withSecretPhysicalIdsMaskedInState as qi, replayRollback as qn, MULTI_REGION_RECREATE_BLOCKED_TYPES as qo, secretBearingStateKeyWarning as qr, malformedOrphansRefusalMessage as qs, withApiLimit as qt, keptWholeReasonText as r, buildFinalSnapshotIdentifier as ra, refuseMalformedNestedChildOutputs as rc, bindingSkippedOutputs as ri, redirectDockerAsset as rl, revertNestedChildFromJournal as rn, envCredentialsAreAssumedRole as ro, updatePartialReason as rr, inputFingerprinter as rs, contributorInsightsRefusals as rt, crossStackOutputProvenanceSource as s, isCustomResource as sa, STATE_REGION_DIVERGED as sc, awaitInFlightSibling as si, ensureAssetStorage as sl, getCurrentNestedStackContext as sn, regionLessSecretName as so, withCreateTokenLedger as sr, maskedInputProof as ss, readContributorInsightsSpec as st, DeployEngine as t, unsupportedFinalSnapshotError as ta, malformedOutputsRefusalMessage as tc, collectPublishedOutputNames as ti, isDefaultBootstrapRepoName as tl, nestedChildStackName as tn, applyCallerIdentityCredentials as to, undeclaredEmptyObservedKeys as tr, toFiniteNumber as ts, vectorIndexesShapeDetail as tt, conditionFingerprint as u, applyCustomResourceResponseExpiration as ua, malformedResourcesWarning as uc, withStackRecords as ui, isCrossRegionRedirect as ul, dropFailedCommands as un, s3BucketDualStackDomainName as uo, seedsDeleteFirstGuard as ur, maskedPropertyFingerprint as us, stripIndexContributorInsights as ut, renderNestedTemplateTreeDefect as v, NO_LOCAL_CUSTOM_RESOURCES_FLAG as va, accountArgs as vc, supersededResourcesOf as vi, getDockerImageBySourceHash as vl, planOrphanAdoption as vn, isStalePlaceholderArnAttribute as vo, IMPLICIT_DELETE_DEPENDENCIES as vr, refuseMalformedOrphanRecordsForDestroy as vs, resolveDynamoDbDeleteBudgetMs as vt, deferredServiceTokenWarning as w, setLocalCustomResourceRuntimeEnabled as wa, hasReadableResources as wc, red as wi, missingStateBucketRemedy as wl, noEchoMacParametersOf as wn, keepHeldTokenProvenance as wo, isRedactedRecordedValue as wr, malformedLocalResourceEntriesWarning as ws, relayedIndexBusyDelete as wt, pendingMovesOutOf as x, customResourcesRunWithoutApp as xa, UNREADABLE_RESOURCES_MAP_ROW as xc, cyan as xi, resolveFileAssetSourcePath as xl, NOECHO_MAC_KEY_ALIAS as xn, parseWebACLArn as xo, withPreviousPolicies as xr, unpreviewableOrphanRecords as xs, TABLE_INDEX_NOUN as xt, templateIdentity as y, customResourceStackName as ya, withheldAccountClause as yc, withoutSuperseded as yi, isCfnTemplateAssetPath as yl, DeploymentEventsReader as yn, lacksRecordedTableArn as yo, computeImplicitDeleteEdges as yr, refuseMalformedOrphansForOrphan as ys, DELETE_INDEX_WAIT_PROCEED_NOTE as yt, planStreamMemberOps as z, isSelectOutOfBounds as za, hasUnverifiableParameterRefusal as zc, secretNamedAttributeNamesOf as zi, assemblyPathEscape as zl, isPairableType as zn, INTRINSIC_KEYS as zo, computeParameterTaint as zr, refuseMalformedResourceProperties as zs, macWriteOnlyKeys as zt };
|
|
48527
|
+
//# sourceMappingURL=deploy-engine-DWLm19jg.js.map
|