@go-to-k/cdkd 0.296.7 → 0.296.9
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/{asg-provider-BU0YONBp.js → asg-provider-B0IrI6EW.js} +3 -3
- package/dist/{asg-provider-BU0YONBp.js.map → asg-provider-B0IrI6EW.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-wyaJUA8V.js → deploy-engine-B-oaHd2t.js} +142 -96
- package/dist/deploy-engine-B-oaHd2t.js.map +1 -0
- package/dist/{iam-policy-targets-td1X_kKN.js → iam-policy-targets-BREzwsG6.js} +9 -8
- package/dist/iam-policy-targets-BREzwsG6.js.map +1 -0
- package/dist/{iam-role-provider-obY72uH2.js → iam-role-provider-DsJM0NT3.js} +3 -3
- package/dist/{iam-role-provider-obY72uH2.js.map → iam-role-provider-DsJM0NT3.js.map} +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/{neptune-provider-C3f-vDOh.js → neptune-provider-DGaKBQxm.js} +3 -3
- package/dist/{neptune-provider-C3f-vDOh.js.map → neptune-provider-DGaKBQxm.js.map} +1 -1
- package/dist/{program-DEnDp4o0.js → program-DTXVCX29.js} +226 -121
- package/dist/program-DTXVCX29.js.map +1 -0
- package/dist/{provider-classes-CsF7Ia5F.js → provider-classes-y-yYsSvB.js} +137 -23
- package/dist/provider-classes-y-yYsSvB.js.map +1 -0
- package/dist/{rds-provider-Cf5P2so_.js → rds-provider-B0YTjZKU.js} +3 -3
- package/dist/{rds-provider-Cf5P2so_.js.map → rds-provider-B0YTjZKU.js.map} +1 -1
- package/dist/{version-LalLOhpQ.js → version-Dqnp1Xj8.js} +2 -2
- package/dist/{version-LalLOhpQ.js.map → version-Dqnp1Xj8.js.map} +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-wyaJUA8V.js.map +0 -1
- package/dist/iam-policy-targets-td1X_kKN.js.map +0 -1
- package/dist/program-DEnDp4o0.js.map +0 -1
- package/dist/provider-classes-CsF7Ia5F.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as runWithStackAwsClients, i as resetAwsClients, o as setAwsClients, t as AwsClients } from "./aws-clients-CnmtbrxD.js";
|
|
2
2
|
import { A as displayIdent, D as UNRENDERABLE, E as STACK_REF_MAX_CODE_POINTS, F as plainIdentOr, I as safeMsg, L as stringifyJsonPayload, M as displayStackName, N as isPasteableIdent, O as cutMarker, R as truncateCodePoints, S as withStackName, T as SECRET_REF_MAX_CODE_POINTS, d as PATTERN_B_NAME_PROPERTIES, f as PATTERN_B_RESOURCE_TYPES, g as generateResourceName, h as explicitNamePropertyFor, i as reserveStdoutForPayload, j as displaySafe, k as displayAwsMessage, l as getLiveRenderer, m as derivesPatternBName, n as getLogger, o as runStackBuffered, r as isStdoutReservedForPayload, u as PATTERN_B_NAME_OPTIONS, w as SAFE_MSG_ALTERED_CHAR, x as withSkipPrefix } from "./logger-DAaB7GFO.js";
|
|
3
|
-
import { An as setPasteableVerbFlags, At as CUSTOM_RESOURCE_RESPONSE_PREFIX, Bt as clientDefaultsFor, Ct as buildForceUnlockCommand, Dn as shellQuote, Dt as formatLockOperation, En as shellBoundedDisplay, Et as formatLockExpiry, F as runDeleteAttempt, Ft as producerRecordKey, G as beginCommandInterruptScope, Gn as retryClassificationText, Ht as AccountIdUnavailableError, It as setPasteableAwsProfile, J as isInterruptedWaitError, Jn as safeStringify, Jt as DeployCancelledError, K as endCommandInterruptScope, Kn as describeAwsFailure, Kt as CrossAccountSecretRefusalError, Lt as withPasteableAwsProfile, Mt as injectiveKey, On as withheldTargetClause, Ot as formatLockOwner, Pt as producerCoordinateKey, Qn as markNonRetryable, Qt as LocalStartServiceError, Rt as ambientClientDefaults, Sn as pasteableCommand, St as UNREPRODUCIBLE_LOCK_CLAUSE, Tn as quotedOrDescribed, Tt as forceQuitRecoveryClause, Un as isRetryableTransientError, V as isAwsCliLiteral, Vn as isAmbiguousOutcomeError, Vt as credentialFingerprint, Wn as isTransientServerError, Wt as CdkdError, Xn as isMarkedNonRetryable, Xt as IntrinsicResolutionRefusalError, Yt as DynamicReferenceRegionAmbiguousError, Zn as isThrottlingError, Zt as LocalInvokeBuildError$1, _ as VALUE_NOT_SHOWN, _n as SHELL_ACTIVE_WHY, an as ResourceTimeoutError, cn as StackTerminationProtectionError, g as assertRegionMatch, h as RESOURCE_NOT_FOUND, hn as TIMEOUT_FLAG_RESOURCE_TYPE, in as ProvisioningError, it as resourceTypeShown, jt as DEFAULT_STATE_PREFIX, kn as setPasteableRunFlags, mn as withErrorHandling, n as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, nn as NestedStackChildDirectDestroyError, nt as logicalIdShown, on as ResourceUpdateNotSupportedError, pn as normalizeAwsError, q as interruptWatchListenerCount, rn as PartialFailureError, s as readRecordedPrincipals, sn as StackHasActiveImportsError, t as IAM_PRINCIPAL_NAME, tn as MalformedProducerRecordRefusalError, un as SynthesisError, w as remedyLogicalId, wn as plainOrDescribed, wt as buildLockContentionMessage, xn as isInertUnquoted, yn as commandHole, zt as ambientCredentialConfig } from "./iam-policy-targets-
|
|
3
|
+
import { An as setPasteableVerbFlags, At as CUSTOM_RESOURCE_RESPONSE_PREFIX, Bt as clientDefaultsFor, Ct as buildForceUnlockCommand, Dn as shellQuote, Dt as formatLockOperation, En as shellBoundedDisplay, Et as formatLockExpiry, F as runDeleteAttempt, Ft as producerRecordKey, G as beginCommandInterruptScope, Gn as retryClassificationText, Ht as AccountIdUnavailableError, It as setPasteableAwsProfile, J as isInterruptedWaitError, Jn as safeStringify, Jt as DeployCancelledError, K as endCommandInterruptScope, Kn as describeAwsFailure, Kt as CrossAccountSecretRefusalError, Lt as withPasteableAwsProfile, Mt as injectiveKey, On as withheldTargetClause, Ot as formatLockOwner, Pt as producerCoordinateKey, Qn as markNonRetryable, Qt as LocalStartServiceError, Rt as ambientClientDefaults, Sn as pasteableCommand, St as UNREPRODUCIBLE_LOCK_CLAUSE, Tn as quotedOrDescribed, Tt as forceQuitRecoveryClause, Un as isRetryableTransientError, V as isAwsCliLiteral, Vn as isAmbiguousOutcomeError, Vt as credentialFingerprint, Wn as isTransientServerError, Wt as CdkdError, Xn as isMarkedNonRetryable, Xt as IntrinsicResolutionRefusalError, Yt as DynamicReferenceRegionAmbiguousError, Zn as isThrottlingError, Zt as LocalInvokeBuildError$1, _ as VALUE_NOT_SHOWN, _n as SHELL_ACTIVE_WHY, an as ResourceTimeoutError, cn as StackTerminationProtectionError, g as assertRegionMatch, h as RESOURCE_NOT_FOUND, hn as TIMEOUT_FLAG_RESOURCE_TYPE, in as ProvisioningError, it as resourceTypeShown, jt as DEFAULT_STATE_PREFIX, kn as setPasteableRunFlags, mn as withErrorHandling, n as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, nn as NestedStackChildDirectDestroyError, nt as logicalIdShown, on as ResourceUpdateNotSupportedError, pn as normalizeAwsError, q as interruptWatchListenerCount, rn as PartialFailureError, s as readRecordedPrincipals, sn as StackHasActiveImportsError, t as IAM_PRINCIPAL_NAME, tn as MalformedProducerRecordRefusalError, un as SynthesisError, w as remedyLogicalId, wn as plainOrDescribed, wt as buildLockContentionMessage, xn as isInertUnquoted, yn as commandHole, zt as ambientCredentialConfig } from "./iam-policy-targets-BREzwsG6.js";
|
|
4
4
|
import { n as awsClientDefaults, r as getAssumedRoleCredentials, u as formatAuthority } from "./aws-client-defaults-D0q0z4dG.js";
|
|
5
|
-
import { $ as resourcesNamingDeclaredParameter, $a as maskSecretsInError, $i as repairMalformedResourceEntriesForReadOnly, $n as deleteSkipReason, $o as ensureAssetStorage, $r as deployRefusesOrphanRowsReason, $s as derivePartitionAndUrlSuffix, $t as effectiveDeletionPolicy, Ai as refuseMalformedOrphans, Ao as acceptedCreateOnlyDropsOf, As as getDefaultStateBucketName, At as planRollback, Ba as TemplateParser, Bi as refuseMalformedResourceEntriesForImportSave, Bn as CC_BROKEN_REASON, Bo as orphansCarriedFrom, Br as AWS_NO_VALUE, Bs as stateBucketExistenceConfirmed, Bt as updatePartialMessage, C as perType, Ci as malformedScrubResourceEntriesRefusalMessage, Cn as findDestructiveChanges, Co as WHOLE_DYNAMIC_REFERENCE_PATTERN, Cr as callerEnvCredentials, Cs as warnFinchArgvExposure, Dn as ledgerForStack, Do as S3StateBackend, Ds as getDockerImageBySourceHash, Dt as isJournaledOrphan, Ei as refuseDivergentRecordRegionForDestroy, Eo as isLockInfoExpired, Es as AssetManifestLoader, Et as demoteSupersededOrphans, Fa as withRetry, Fi as refuseMalformedResourceAttributesForOrphan, Fo as hasUnverifiableParameterRefusal, Fr as isImpossibleEmptyStoredAttribute, Fs as resolveCaptureObservedState, Ft as inheritProducerRegions, G as cyan, Ga as literalSplitDelimitersOf, Gi as refuseMalformedResourcePropertiesForOrphan, Go as WorkGraph, Gr as withSharedDrainBudget, Gs as MIGRATE_TMP_PREFIX, Gt as orphanRecordsPrintingBag, H as formatResourceLine, Ha as carryLogOnlyValues, Hi as refuseMalformedResourcePropertiesForDestroy, Hn as ccBrokenReason, Ho as AssetPublisher, Hr as isStalePlaceholderArnAttribute, Hs as ssmResolvedValueType, Ht as completedReplayEntries, Ii as refuseMalformedResourceEntries, Io as importableOutputKeys, Ir as carriesDynamicReference, Is as resolveSkipPrefix, J as red, Ja as recordLogOnlyParameterValue, Ji as refuseMalformedResourcesForExport, Jn as slowCcOperationTimeoutMs, Jo as loadPublishableAssetManifest, Jr as JSON_LISTING_HOLE_VALUE, Js as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Jt as ATOMIC_FINAL_SNAPSHOT_TYPES, K as gray, Ka as logOnlyValueCount, Ki as refuseMalformedResourcesForDeploy, Kn as withPrintingSecrets, Ko as buildAssetRedirectMap, Kr as parameterInputsFor, Ks as findLargeInlineResources, Kt as secretNamePrintingBag, Li as refuseMalformedResourceEntriesForDeploy, Lo as importableOutputs, Lr as carriesFetchableDynamicReference, Ls as resolveStateBucketWithDefault, Ma as prefetchCreateOnlyPropertyPaths, Mi as refuseMalformedOrphansForOrphan, Mo as exportNamesCarriedFrom, Mr as isUnboundTemplateParameter, Ms as loadCdkJson, Mt as resolveReplacementOldType, Na as templateResourceTypes, Ni as refuseMalformedOutputs, No as hasReadableExportSet, Nr as parameterTypeMayLoseSecretIdentity, Ns as resolveApp, Nt as findNestedStackTypeChanges, Oi as refuseMalformedOrphanRecords, Oo as rebuildClientForBucketRegion, Os as Synthesizer, Ot as isReplacementOrphan, Pa as describeTypeWithThrottleRetry, Pi as refuseMalformedOutputsForDestroy, Po as hasReasonlessBaselineRefusal, Pr as getAccountInfo, Ps as resolveAutoAssetStorage, Q as reachableDivergentParameters, Qa as errorCauseChain, Qi as repairMalformedOutputsForReadOnly, Qn as deleteIndeterminateGuards, Qo as assertAssetBucketRegion, Qr as UNREADABLE_RESOURCES_MAP_ROW, Qs as canonicalizeRegion, Qt as createPreDeleteFinalSnapshot, Ri as refuseMalformedResourceEntriesForDestroy, Ro as isReadableBag, Rr as isNamelessDynamicReferenceError, Rs as resolveStateBucketWithDefaultAndSource, S as isProtectionValueActive, Si as malformedResourcesWarning, Sn as constructPathOf, So as TEMPLATE_SOURCED_RULES, Sr as applyCallerIdentityCredentials, Ss as runDockerStreaming, St as destroyStackRecordsView, Ti as previewableOrphanRecords, Tn as RollbackInlinePolicyWriters, To as LockManager, Ts as stripControlChars, Tt as recordAfterRollbackUpdate, U as createReadOnlyAttributeHealerFactory, Ua as createUnionSecretMasker, Ui as refuseMalformedResourcePropertiesForDrift, Un as wouldReturnToSdkProvider, Uo as isSensitiveAttributeName, Ur as refStateLookupFromResource, Us as CFN_TEMPLATE_BODY_LIMIT, Ut as journaledOrphanPrintingBag, Va as liveMatchesUnresolvedTokenFrame, Vi as refuseMalformedResourceEntriesForOrphan, Vn as ProviderRegistry, Vo as shouldRetainResource, Vr as cfnRefValueFromPhysicalId, Vs as warnDeprecatedNoPrefixCliFlag, Vt as updatePartialReason, W as bold, Wa as hasMaskableValues, Wi as refuseMalformedResourcePropertiesForExport, Wn as isCustomResourceType$1, Wo as stringifyValue, Ws as CFN_TEMPLATE_URL_LIMIT, Wt as maskEventTextWithBoundBags, X as computeParameterTaint, Xa as shareLogOnlyValues, Xi as repairMalformedOrphanRecordsForReadOnly, Xo as AssetModeResolver, Xr as STATE_RESOURCES_MALFORMED, Xs as expectedOwnerParam, Xt as buildFinalSnapshotIdentifier, Y as yellow, Ya as recordLogOnlyValue, Yi as refuseMalformedState, Yn as ccProtectionRegistryTypes, Yo as rewriteTemplateAssetReferences, Yr as STATE_REGION_DIVERGED, Ys as decodeListingKey, Yt as PRE_DELETE_SNAPSHOT_TYPES, Z as namesAnyDeclaredParameter, Za as createSecretMasker, Zi as repairMalformedOrphansForReadOnly, Zn as UNSPECIFIED_SKIP_REASON, Zo as BOOTSTRAP_MARKER_PREFIX, Zr as UNREADABLE_ORPHANS_CONTAINER_ROW, Zs as PARTITION_TABLE, Zt as ccRoutedFinalSnapshotError, _ as makeCanonicalizePropertiesFn, _i as malformedOutputsRefusalMessage, _n as isExportAliasCollision, _o as recordProvenPublicExpression, _r as assertSendableRoleArn, _s as isMalformedEnvKey, a as findNestedTemplateTreeDefect, aa as findActionableSilentDrops, ac as hasPlainPrototype, ai as isReadableResourceEntry, an as extractDeploymentEventError, ao as dynamicReferenceTokens, as as validateContainerRepoName, at as makeSiblingClaimReader, b as recordedProtectionNote, bi as malformedResourceEntriesWarning, bn as DEFAULT_RESOURCE_WARN_AFTER_MS, bo as STATE_SOURCED_CROSS_GENERATION_RULES, br as sendableAssumeRoleCommand, bs as redactedDockerCause, bt as replayRollback, c as renderNestedTemplateTreeDefect, cc as absoluteAssemblyPathEscape, ci as malformedExportSourceWarning, cn as exportAliasCollisionScrubWarning, co as inheritNestedStackParameterAssociations, cs as resolveDockerContextDirectory, ct as displacedOpClause, d as conditionInputsFrom, da as findReplacedReadersOfRecreateTargets, dc as renderAssemblyPathEscape, di as malformedLocalResourcesWarning, dn as secretSafeKeyDisplay, do as identityKeyFor, dr as IntrinsicFunctionResolver, ds as describeDockerFailure, ea as repairMalformedResourcePropertiesForReadOnly, ec as AssemblyReader, ei as displayLogicalId, en as isFinalSnapshotError, eo as maskSecretsInText, es as getBootstrapMarkerKey, et as deleteJournaledOrphans, f as parentSuppliedValues, fa as shownType, fc as resolveAssemblyPath, fi as malformedOrphanRecordsRefusalMessage, fn as exportNameSecretExposure, fo as carriesSecretMask, fr as classifyReplaySecretRegion, fs as dockerSpawnEnvWithSensitive, ft as nestedChildStackName$1, g as mergeNoChangeOutputs, ga as renderStatefulReason, gi as malformedOrphansWarning, gn as collectPublishedOutputNames, go as recordNoEchoAttributeValues, gr as assertFlagRoleArn, gs as isDockerClientEnvKey, gt as withNestedRevertRun, h as keptWholeReasonText, ha as isStatefulRecreateTargetSync, hi as malformedOrphansRefusalMessage, hn as collectDeclaredOutputNames, ho as recordMaskOnlyValuesIn, hr as applyRoleArnIfSet, hs as getDockerCmd, ht as revertedNestedRowIds, i as childTemplateLoader, ia as unreadableResourceEntries, ic as hasOwnKey, ii as isReadableOrphanRecord, in as DeploymentEventsStore, io as DYNAMIC_REFERENCE_TOKEN_SCAN, is as validateAssetBucketName, it as sameJournaledOrphans, ji as refuseMalformedOrphansForDestroy, jo as describeRegionValueKind, jr as coerceParameterTypedValue, js as getLegacyStateBucketName, jt as replacementNeverSwapped, ki as refuseMalformedOrphanRecordsForDestroy, kn as withCreateTokenLedger, ko as splitImportedOps, ks as synthesisStatusMessage, kt as planFailedOps, l as templateIdentity, la as NO_CC_HANDLERS_REASON, lc as describeFileReadFailure, li as malformedLocalOutputsWarning, ln as secretBearing, lo as recordNestedStackParameterExpressions, lr as DiffCalculator, ls as describeDockerCapturedOutput, lt as displacedPhysicalIdShown, m as isSecretBearingReferenceString, ma as isStatefulRecreateTargetForReplace, mc as resolveBucketRegion, mi as malformedOrphanRowsKeptWarning, mn as noEchoParameterValueSeed, mo as recordMaskOnlyValue, mr as regionLessSecretName, ms as formatDockerLoginError, n as IMPLICIT_DELETE_DEPENDENCIES, na as unpreviewableOrphanRecords, nc as processStackMessages, ni as hasReadableOutputs, nn as unsupportedFinalSnapshotError, no as redactSecretsForState, ns as parseBootstrapMarker, nt as journaledOrphanLines, o as isAbsoluteAssetPath, oc as nullPrototypeRecord, oi as malformedDriftResourcePropertiesWarning, on as WITHHELD_NAME_DISPLAY, oo as isUncertifiedBaselineMaskPosition, os as buildDenyExternalAccessPolicy, ot as planOrphanAdoption, p as readRecordedConditionVerdicts, pa as MULTI_REGION_RECREATE_BLOCKED_TYPES, pi as malformedOrphanRecordsWarning, pn as isWholeDynamicReferenceValue, po as provenPublicValue, pr as producerRegionsFromState, ps as finchSecretArgvRefusal, pt as recordDisplacedSkips, q as green, qa as printingCorpusOf, qi as refuseMalformedResourcesForDestroy, qn as CloudControlProvider, qo as createAssetRedirectResolver, qs as uploadCfnTemplate, qt as stateSecretNameNeedles, r as computeImplicitDeleteEdges, ra as unreadableOrphanRecords, rc as defineOwnKey, ri as hasReadableResources, rn as DeploymentEventsReader, ro as scrubResourceRecord, rs as readBootstrapMarkerBody, rt as loadJournaledOrphans, s as listNestedTemplateRows, sa as unwrittenCreateOnlyReplacement, sc as ownValue, si as malformedExportNamesWarning, sn as displayTextOrWithheld, so as pathCrossesDottedKey, ss as buildDockerImage, st as NESTED_PENDING_PARENT_REASON, t as DeployEngine, ta as repairMalformedResourcesForReadOnly, tc as StageLoadError, ti as hasReadableOrphans, tn as refusesFinalSnapshot, to as markSameGenerationBag, tr as isWaitAbandonedError, ts as isCrossRegionRedirect, tt as isHandledOrphan, u as conditionFingerprint, ua as hasNoCloudControlHandlers, uc as displayAssemblyPath, ui as malformedLocalResourceEntriesWarning, un as secretBearingStateKeyWarning, ur as INTRINSIC_KEYS, us as describeDockerExecFailure, ut as dropSettledNestedJournals, v as withResourceDeadline, vi as malformedOutputsWarning, vn as bindingSkippedOutputs, vo as wholeStringLeavesOf, vr as explicitRoleArnOrThrow, vs as partitionSensitiveEnv, vt as withNestedStackContext, w as readProtection, wi as malformedStateRefusalMessage, wn as formatDestructiveChange, wo as isSingleDynamicReferenceToken, wr as envCredentialsAreAssumedRole, ws as escapeRegExp, wt as withStackRecords, x as PROTECTION_PROPERTY_BY_TYPE, xi as malformedResourcePropertiesWarning, xn as maskingRetryLogger, xo as STATE_SOURCED_READBACK_RULES, xr as AWS_CREDENTIAL_ENV_KEYS, xs as runDockerForeground, y as recordedProtectionEvidence, yi as malformedRenderedContainersWarning, yn as DEFAULT_RESOURCE_TIMEOUT_MS, yo as STATE_SOURCED_BASELINE_RULES, yr as isIamRoleArn, ys as redactDockerArgvValues, yt as replayFailedOperations, za as DagBuilder, zi as refuseMalformedResourceEntriesForImport, zo as orphansAfterRollback, zr as keepsSecretReferenceToken, zs as resolveUseCdkBootstrapAssets } from "./deploy-engine-wyaJUA8V.js";
|
|
6
|
-
import { t as getCdkdVersion } from "./version-
|
|
5
|
+
import { $ as resourcesNamingDeclaredParameter, $a as createSecretMasker, $i as repairMalformedOutputsForReadOnly, $n as deleteSkipReason, $o as BOOTSTRAP_MARKER_PREFIX, $r as accountArgs, $s as PARTITION_TABLE, $t as effectiveDeletionPolicy, Ai as refuseMalformedOrphanRecordsForDestroy, Ao as rebuildClientForBucketRegion, As as Synthesizer, At as planRollback, Bi as refuseMalformedResourceEntriesForImport, Bn as CC_BROKEN_REASON, Bo as isReadableBag, Br as AWS_NO_VALUE, Bs as resolveStateBucketWithDefaultAndSource, Bt as updatePartialMessage, C as perType, Ci as malformedResourcesWarning, Cn as findDestructiveChanges, Co as STATE_SOURCED_READBACK_RULES, Cr as callerEnvCredentials, Cs as runDockerForeground, Di as refuseDivergentRecordRegionForDestroy, Dn as ledgerForStack, Do as LockManager, Ds as stripControlChars, Dt as isJournaledOrphan, Ei as previewableOrphanRecords, Eo as isSingleDynamicReferenceToken, Es as escapeRegExp, Et as demoteSupersededOrphans, Fa as templateResourceTypes, Fi as refuseMalformedOutputsForDestroy, Fo as hasReadableExportSet, Fr as isImpossibleEmptyStoredAttribute, Fs as resolveApp, Ft as inheritProducerRegions, G as cyan, Ga as createUnionSecretMasker, Gi as refuseMalformedResourcePropertiesForExport, Go as isSensitiveAttributeName, Gr as withSharedDrainBudget, Gs as CFN_TEMPLATE_BODY_LIMIT, Gt as orphanRecordsPrintingBag, H as formatResourceLine, Ha as TemplateParser, Hi as refuseMalformedResourceEntriesForOrphan, Hn as ccBrokenReason, Ho as orphansCarriedFrom, Hr as isStalePlaceholderArnAttribute, Hs as stateBucketExistenceConfirmed, Ht as completedReplayEntries, Ia as describeTypeWithThrottleRetry, Ii as refuseMalformedResourceAttributesForOrphan, Io as hasReasonlessBaselineRefusal, Ir as carriesDynamicReference, Is as resolveAutoAssetStorage, J as red, Ja as logOnlyValueCount, Ji as refuseMalformedResourcesForDestroy, Jn as slowCcOperationTimeoutMs, Jo as buildAssetRedirectMap, Jr as JSON_LISTING_HOLE_VALUE, Js as findLargeInlineResources, Jt as ATOMIC_FINAL_SNAPSHOT_TYPES, K as gray, Ka as hasMaskableValues, Ki as refuseMalformedResourcePropertiesForOrphan, Kn as withPrintingSecrets, Ko as stringifyValue, Kr as parameterInputsFor, Ks as CFN_TEMPLATE_URL_LIMIT, Kt as secretNamePrintingBag, La as withRetry, Li as refuseMalformedResourceEntries, Lo as hasUnverifiableParameterRefusal, Lr as carriesFetchableDynamicReference, Ls as resolveCaptureObservedState, Mi as refuseMalformedOrphansForDestroy, Mo as acceptedCreateOnlyDropsOf, Mr as isUnboundTemplateParameter, Ms as getDefaultStateBucketName, Mt as resolveReplacementOldType, Ni as refuseMalformedOrphansForOrphan, No as describeRegionValueKind, Nr as parameterTypeMayLoseSecretIdentity, Ns as getLegacyStateBucketName, Nt as findNestedStackTypeChanges, Oo as isLockInfoExpired, Os as AssetManifestLoader, Ot as isReplacementOrphan, Pa as prefetchCreateOnlyPropertyPaths, Pi as refuseMalformedOutputs, Po as exportNamesCarriedFrom, Pr as getAccountInfo, Ps as loadCdkJson, Q as reachableDivergentParameters, Qa as shareLogOnlyValues, Qi as repairMalformedOrphansForReadOnly, Qn as deleteIndeterminateGuards, Qo as AssetModeResolver, Qr as UNREADABLE_RESOURCES_MAP_ROW, Qs as expectedOwnerParam, Qt as createPreDeleteFinalSnapshot, Ri as refuseMalformedResourceEntriesForDeploy, Ro as importableOutputKeys, Rr as isNamelessDynamicReferenceError, Rs as resolveSkipPrefix, S as isProtectionValueActive, Si as malformedResourcePropertiesWarning, Sn as constructPathOf, So as STATE_SOURCED_CROSS_GENERATION_RULES, Sr as applyCallerIdentityCredentials, Ss as redactedDockerCause, St as destroyStackRecordsView, Ti as malformedStateRefusalMessage, Tn as RollbackInlinePolicyWriters, To as WHOLE_DYNAMIC_REFERENCE_PATTERN, Ts as warnFinchArgvExposure, Tt as recordAfterRollbackUpdate, U as createReadOnlyAttributeHealerFactory, Ua as liveMatchesUnresolvedTokenFrame, Ui as refuseMalformedResourcePropertiesForDestroy, Un as wouldReturnToSdkProvider, Uo as shouldRetainResource, Ur as refStateLookupFromResource, Us as warnDeprecatedNoPrefixCliFlag, Ut as journaledOrphanPrintingBag, Va as DagBuilder, Vi as refuseMalformedResourceEntriesForImportSave, Vn as ProviderRegistry, Vo as orphansAfterRollback, Vr as cfnRefValueFromPhysicalId, Vs as resolveUseCdkBootstrapAssets, Vt as updatePartialReason, W as bold, Wa as carryLogOnlyValues, Wi as refuseMalformedResourcePropertiesForDrift, Wn as isCustomResourceType$1, Wo as AssetPublisher, Ws as ssmResolvedValueType, Wt as maskEventTextWithBoundBags, X as computeParameterTaint, Xa as recordLogOnlyParameterValue, Xi as refuseMalformedState, Xo as loadPublishableAssetManifest, Xr as STATE_RESOURCES_MALFORMED, Xs as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Xt as buildFinalSnapshotIdentifier, Y as yellow, Ya as printingCorpusOf, Yi as refuseMalformedResourcesForExport, Yn as ccProtectionRegistryTypes, Yo as createAssetRedirectResolver, Yr as STATE_REGION_DIVERGED, Ys as uploadCfnTemplate, Yt as PRE_DELETE_SNAPSHOT_TYPES, Z as namesAnyDeclaredParameter, Za as recordLogOnlyValue, Zi as repairMalformedOrphanRecordsForReadOnly, Zn as UNSPECIFIED_SKIP_REASON, Zo as rewriteTemplateAssetReferences, Zr as UNREADABLE_ORPHANS_CONTAINER_ROW, Zs as decodeListingKey, Zt as ccRoutedFinalSnapshotError, _ as makeCanonicalizePropertiesFn, _a as isStatefulRecreateTargetSync, _i as malformedOrphansWarning, _n as isExportAliasCollision, _o as recordMaskOnlyValuesIn, _r as assertSendableRoleArn, _s as getDockerCmd, a as findNestedTemplateTreeDefect, aa as unreadableResourceEntries, ac as defineOwnKey, ai as isReadableOrphanRecord, an as extractDeploymentEventError, ao as scrubResourceRecord, as as readBootstrapMarkerBody, at as makeSiblingClaimReader, b as recordedProtectionNote, bi as malformedRenderedContainersWarning, bn as DEFAULT_RESOURCE_WARN_AFTER_MS, bo as wholeStringLeavesOf, br as sendableAssumeRoleCommand, bs as partitionSensitiveEnv, bt as replayRollback, c as renderNestedTemplateTreeDefect, cc as nullPrototypeRecord, ci as malformedExportNamesWarning, cn as exportAliasCollisionScrubWarning, co as isUncertifiedBaselineMaskPosition, cs as buildDenyExternalAccessPolicy, ct as displacedOpClause, d as conditionInputsFrom, da as NO_CC_HANDLERS_REASON, dc as describeFileReadFailure, di as malformedLocalResourceEntriesWarning, dn as secretSafeKeyDisplay, do as recordNestedStackParameterExpressions, dr as IntrinsicFunctionResolver, ds as describeDockerCapturedOutput, ea as repairMalformedResourceEntriesForReadOnly, ec as canonicalizeRegion, ei as deployRefusesOrphanRowsReason, en as isFinalSnapshotError, eo as errorCauseChain, es as assertAssetBucketRegion, et as deleteJournaledOrphans, f as parentSuppliedValues, fa as hasNoCloudControlHandlers, fc as displayAssemblyPath, fi as malformedLocalResourcesWarning, fn as exportNameSecretExposure, fr as classifyReplaySecretRegion, fs as describeDockerExecFailure, ft as nestedChildStackName$1, g as mergeNoChangeOutputs, ga as isStatefulRecreateTargetForReplace, gc as resolveBucketRegion, gi as malformedOrphansRefusalMessage, gn as collectPublishedOutputNames, go as recordMaskOnlyValue, gr as assertFlagRoleArn, gs as formatDockerLoginError, gt as withNestedRevertRun, h as keptWholeReasonText, ha as MULTI_REGION_RECREATE_BLOCKED_TYPES, hi as malformedOrphanRowsKeptWarning, hn as collectDeclaredOutputNames, ho as provenPublicValue, hr as applyRoleArnIfSet, hs as finchSecretArgvRefusal, ht as revertedNestedRowIds, i as childTemplateLoader, ia as unreadableOrphanRecords, ic as processStackMessages, ii as hasReadableResources, in as DeploymentEventsStore, io as redactSecretsForState, is as parseBootstrapMarker, it as sameJournaledOrphans, ji as refuseMalformedOrphans, jo as splitImportedOps, jr as coerceParameterTypedValue, js as synthesisStatusMessage, jt as replacementNeverSwapped, ki as refuseMalformedOrphanRecords, kn as withCreateTokenLedger, ko as S3StateBackend, ks as getDockerImageBySourceHash, kt as planFailedOps, l as templateIdentity, la as unwrittenCreateOnlyReplacement, lc as ownValue, li as malformedExportSourceWarning, ln as secretBearing, lo as pathCrossesDottedKey, lr as DiffCalculator, ls as buildDockerImage, lt as displacedPhysicalIdShown, m as isSecretBearingReferenceString, ma as shownType, mc as resolveAssemblyPath, mi as malformedOrphanRecordsWarning, mn as noEchoParameterValueSeed, mo as carriesSecretMask, mr as regionLessSecretName, ms as dockerSpawnEnvWithSensitive, n as IMPLICIT_DELETE_DEPENDENCIES, na as repairMalformedResourcesForReadOnly, nc as AssemblyReader, ni as hasReadableOrphans, nn as unsupportedFinalSnapshotError, no as maskSecretsInText, ns as getBootstrapMarkerKey, nt as journaledOrphanLines, o as isAbsoluteAssetPath, oa as withheldAccountClause, oc as hasOwnKey, oi as isReadableResourceEntry, on as WITHHELD_NAME_DISPLAY, oo as DYNAMIC_REFERENCE_TOKEN_SCAN, os as validateAssetBucketName, ot as planOrphanAdoption, p as readRecordedConditionVerdicts, pa as findReplacedReadersOfRecreateTargets, pc as renderAssemblyPathEscape, pi as malformedOrphanRecordsRefusalMessage, pn as isWholeDynamicReferenceValue, po as identityKeyFor, pr as producerRegionsFromState, ps as describeDockerFailure, pt as recordDisplacedSkips, q as green, qa as literalSplitDelimitersOf, qi as refuseMalformedResourcesForDeploy, qn as CloudControlProvider, qo as WorkGraph, qs as MIGRATE_TMP_PREFIX, qt as stateSecretNameNeedles, r as computeImplicitDeleteEdges, ra as unpreviewableOrphanRecords, rc as StageLoadError, ri as hasReadableOutputs, rn as DeploymentEventsReader, ro as markSameGenerationBag, rs as isCrossRegionRedirect, rt as loadJournaledOrphans, s as listNestedTemplateRows, sa as findActionableSilentDrops, sc as hasPlainPrototype, si as malformedDriftResourcePropertiesWarning, sn as displayTextOrWithheld, so as dynamicReferenceTokens, ss as validateContainerRepoName, st as NESTED_PENDING_PARENT_REASON, t as DeployEngine, ta as repairMalformedResourcePropertiesForReadOnly, tc as derivePartitionAndUrlSuffix, ti as displayLogicalId, tn as refusesFinalSnapshot, to as maskSecretsInError, tr as isWaitAbandonedError, ts as ensureAssetStorage, tt as isHandledOrphan, u as conditionFingerprint, uc as absoluteAssemblyPathEscape, ui as malformedLocalOutputsWarning, un as secretBearingStateKeyWarning, uo as inheritNestedStackParameterAssociations, ur as INTRINSIC_KEYS, us as resolveDockerContextDirectory, ut as dropSettledNestedJournals, v as withResourceDeadline, va as renderStatefulReason, vi as malformedOutputsRefusalMessage, vn as bindingSkippedOutputs, vo as recordNoEchoAttributeValues, vr as explicitRoleArnOrThrow, vs as isDockerClientEnvKey, vt as withNestedStackContext, w as readProtection, wi as malformedScrubResourceEntriesRefusalMessage, wn as formatDestructiveChange, wo as TEMPLATE_SOURCED_RULES, wr as envCredentialsAreAssumedRole, ws as runDockerStreaming, wt as withStackRecords, x as PROTECTION_PROPERTY_BY_TYPE, xi as malformedResourceEntriesWarning, xn as maskingRetryLogger, xo as STATE_SOURCED_BASELINE_RULES, xr as AWS_CREDENTIAL_ENV_KEYS, xs as redactDockerArgvValues, y as recordedProtectionEvidence, yi as malformedOutputsWarning, yn as DEFAULT_RESOURCE_TIMEOUT_MS, yo as recordProvenPublicExpression, yr as isIamRoleArn, ys as isMalformedEnvKey, yt as replayFailedOperations, zi as refuseMalformedResourceEntriesForDestroy, zo as importableOutputs, zr as keepsSecretReferenceToken, zs as resolveStateBucketWithDefault } from "./deploy-engine-B-oaHd2t.js";
|
|
6
|
+
import { t as getCdkdVersion } from "./version-Dqnp1Xj8.js";
|
|
7
7
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
8
8
|
import { CopyObjectCommand, CreateBucketCommand, DeleteBucketCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetObjectCommand, HeadBucketCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, NotFound, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutBucketVersioningCommand, PutObjectCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
9
9
|
import { GetRoleCommand, GetUserCommand } from "@aws-sdk/client-iam";
|
|
@@ -2051,6 +2051,7 @@ var ExportIndexStore = class {
|
|
|
2051
2051
|
stateBackend;
|
|
2052
2052
|
loadState = { kind: "unloaded" };
|
|
2053
2053
|
opts;
|
|
2054
|
+
profile;
|
|
2054
2055
|
writeChain = Promise.resolve();
|
|
2055
2056
|
clientResolved = false;
|
|
2056
2057
|
resolveInFlight = null;
|
|
@@ -2060,9 +2061,11 @@ var ExportIndexStore = class {
|
|
|
2060
2061
|
this.prefix = prefix;
|
|
2061
2062
|
this.region = region;
|
|
2062
2063
|
this.stateBackend = stateBackend;
|
|
2064
|
+
const { profile, ...retry } = opts;
|
|
2065
|
+
this.profile = profile;
|
|
2063
2066
|
this.opts = {
|
|
2064
2067
|
...DEFAULT_OPTIONS,
|
|
2065
|
-
...
|
|
2068
|
+
...retry
|
|
2066
2069
|
};
|
|
2067
2070
|
}
|
|
2068
2071
|
indexKey() {
|
|
@@ -2245,7 +2248,11 @@ var ExportIndexStore = class {
|
|
|
2245
2248
|
if (state.outputs === void 0) continue;
|
|
2246
2249
|
const region = ref.region ?? this.region;
|
|
2247
2250
|
if (!hasReadableExportSet(state)) {
|
|
2248
|
-
this.logger.warn(malformedExportSourceWarning(ref.stackName, region
|
|
2251
|
+
this.logger.warn(malformedExportSourceWarning(ref.stackName, region, {
|
|
2252
|
+
profile: this.profile,
|
|
2253
|
+
stateBucket: this.bucket,
|
|
2254
|
+
statePrefix: this.prefix
|
|
2255
|
+
}));
|
|
2249
2256
|
continue;
|
|
2250
2257
|
}
|
|
2251
2258
|
const stateModified = state.lastModified ?? 0;
|
|
@@ -2414,7 +2421,7 @@ function collectCrossStackRefs(node, onRef) {
|
|
|
2414
2421
|
//#region src/provisioning/register-providers.ts
|
|
2415
2422
|
let providerClasses;
|
|
2416
2423
|
function loadProviderClasses() {
|
|
2417
|
-
providerClasses ??= import("./provider-classes-
|
|
2424
|
+
providerClasses ??= import("./provider-classes-y-yYsSvB.js");
|
|
2418
2425
|
return providerClasses;
|
|
2419
2426
|
}
|
|
2420
2427
|
function registerAllProviders(registry, classes) {
|
|
@@ -2709,7 +2716,7 @@ async function deployCommand(stacks, options) {
|
|
|
2709
2716
|
return {
|
|
2710
2717
|
stateBucket,
|
|
2711
2718
|
preflightStateBackend,
|
|
2712
|
-
exportIndexStore: new ExportIndexStore(awsClients.s3, stateBucket, options.statePrefix, region, preflightStateBackend)
|
|
2719
|
+
exportIndexStore: new ExportIndexStore(awsClients.s3, stateBucket, options.statePrefix, region, preflightStateBackend, { profile: options.profile })
|
|
2713
2720
|
};
|
|
2714
2721
|
})();
|
|
2715
2722
|
let deployInterrupted = false;
|
|
@@ -2740,6 +2747,11 @@ Force-quit: stack locks may not be released. If the next run reports a lock, run
|
|
|
2740
2747
|
const [result, statePrep] = await Promise.all([synthesizer.synthesize(synthOptions), statePrepPromise]);
|
|
2741
2748
|
const { stateBucket, preflightStateBackend, exportIndexStore } = statePrep;
|
|
2742
2749
|
synthOptions.stateBucket = stateBucket;
|
|
2750
|
+
const refusalRecovery = {
|
|
2751
|
+
profile: options.profile,
|
|
2752
|
+
stateBucket,
|
|
2753
|
+
statePrefix: options.statePrefix
|
|
2754
|
+
};
|
|
2743
2755
|
const { stacks: allStacks } = result;
|
|
2744
2756
|
logger.debug(`Found ${allStacks.length} stack(s) in assembly`);
|
|
2745
2757
|
const stackPatterns = stacks.length > 0 ? stacks : options.stack ? [options.stack] : [];
|
|
@@ -2925,8 +2937,8 @@ Force-quit: stack locks may not be released. If the next run reports a lock, run
|
|
|
2925
2937
|
if (options.recreateViaCcApi?.length || options.recreateViaSdkProvider?.length) {
|
|
2926
2938
|
const stateForRecreateCheck = await stackStateBackend.getState(stackInfo.stackName, stackRegion);
|
|
2927
2939
|
if (stateForRecreateCheck) {
|
|
2928
|
-
refuseMalformedResourcesForDeploy(stateForRecreateCheck.state, stackInfo.stackName, stackRegion);
|
|
2929
|
-
refuseMalformedResourceEntriesForDeploy(stateForRecreateCheck.state, stackInfo.stackName, stackRegion);
|
|
2940
|
+
refuseMalformedResourcesForDeploy(stateForRecreateCheck.state, stackInfo.stackName, stackRegion, refusalRecovery);
|
|
2941
|
+
refuseMalformedResourceEntriesForDeploy(stateForRecreateCheck.state, stackInfo.stackName, stackRegion, refusalRecovery);
|
|
2930
2942
|
}
|
|
2931
2943
|
const syncValidation = validateRecreateTargets({
|
|
2932
2944
|
template: stackInfo.template,
|
|
@@ -2997,6 +3009,7 @@ Force-quit: stack locks may not be released. If the next run reports a lock, run
|
|
|
2997
3009
|
dryRun: options.dryRun,
|
|
2998
3010
|
noRollback: !options.rollback,
|
|
2999
3011
|
...options.roleArn && { roleArn: options.roleArn },
|
|
3012
|
+
refusalRecovery,
|
|
3000
3013
|
...assetRedirect && { assetRedirect },
|
|
3001
3014
|
...eventRecorder && { eventRecorder },
|
|
3002
3015
|
...migrationGate && { onCurrentStateLoaded: migrationGate },
|
|
@@ -4175,38 +4188,38 @@ function indexNestedChildTemplates(template, templatePath) {
|
|
|
4175
4188
|
}
|
|
4176
4189
|
return result;
|
|
4177
4190
|
}
|
|
4178
|
-
async function loadStateOrEmpty(stackName, region, stateBackend) {
|
|
4191
|
+
async function loadStateOrEmpty(stackName, region, stateBackend, refusalRecovery) {
|
|
4179
4192
|
const result = await stateBackend.getState(stackName, region);
|
|
4180
4193
|
if (result) {
|
|
4181
4194
|
const unreadable = [];
|
|
4182
4195
|
const unreadableContainers = [];
|
|
4183
4196
|
const deployRefusals = [];
|
|
4184
4197
|
if (repairMalformedResourcesForReadOnly(result.state)) {
|
|
4185
|
-
logger.warn(malformedResourcesWarning(stackName, region));
|
|
4198
|
+
logger.warn(malformedResourcesWarning(stackName, region, refusalRecovery));
|
|
4186
4199
|
unreadableContainers.push("resources");
|
|
4187
4200
|
deployRefusals.push(DEPLOY_REFUSES_RESOURCES_BAG_REASON);
|
|
4188
4201
|
}
|
|
4189
4202
|
const dropped = repairMalformedResourceEntriesForReadOnly(result.state);
|
|
4190
4203
|
if (dropped.length > 0) {
|
|
4191
|
-
logger.warn(malformedResourceEntriesWarning(stackName, region, dropped));
|
|
4204
|
+
logger.warn(malformedResourceEntriesWarning(stackName, region, dropped, refusalRecovery));
|
|
4192
4205
|
for (const id of dropped) unreadable.push(id);
|
|
4193
4206
|
deployRefusals.push(deployRefusesResourceEntriesReason(dropped));
|
|
4194
4207
|
}
|
|
4195
4208
|
const unreadableProps = repairMalformedResourcePropertiesForReadOnly(result.state);
|
|
4196
4209
|
if (unreadableProps.length > 0) {
|
|
4197
|
-
logger.warn(malformedResourcePropertiesWarning(stackName, region, unreadableProps));
|
|
4210
|
+
logger.warn(malformedResourcePropertiesWarning(stackName, region, unreadableProps, refusalRecovery));
|
|
4198
4211
|
deployRefusals.push(deployRefusesPropertiesReason(unreadableProps));
|
|
4199
4212
|
}
|
|
4200
4213
|
if (repairMalformedOutputsForReadOnly(result.state)) {
|
|
4201
|
-
logger.warn(malformedOutputsWarning(stackName, region));
|
|
4214
|
+
logger.warn(malformedOutputsWarning(stackName, region, refusalRecovery));
|
|
4202
4215
|
deployRefusals.push(DEPLOY_REFUSES_OUTPUTS_REASON);
|
|
4203
4216
|
}
|
|
4204
4217
|
if (repairMalformedOrphansForReadOnly(result.state)) {
|
|
4205
|
-
logger.warn(malformedOrphansWarning(stackName, region));
|
|
4218
|
+
logger.warn(malformedOrphansWarning(stackName, region, refusalRecovery));
|
|
4206
4219
|
unreadableContainers.push("orphans");
|
|
4207
4220
|
deployRefusals.push(DEPLOY_REFUSES_ORPHANS_CONTAINER_REASON);
|
|
4208
4221
|
}
|
|
4209
|
-
if (isReadableBag(result.state.outputs) && !hasReadableExportSet(result.state)) logger.warn(malformedExportNamesWarning(stackName, region));
|
|
4222
|
+
if (isReadableBag(result.state.outputs) && !hasReadableExportSet(result.state)) logger.warn(malformedExportNamesWarning(stackName, region, refusalRecovery));
|
|
4210
4223
|
return {
|
|
4211
4224
|
state: result.state,
|
|
4212
4225
|
unreadable,
|
|
@@ -4522,7 +4535,7 @@ async function computeStackDiff(currentState, template, region, stackName, state
|
|
|
4522
4535
|
for (const id of unpreviewableOrphanRecords(currentState)) unreadableOrphans.push(id);
|
|
4523
4536
|
const readableOrphans = previewableOrphanRecords(currentState);
|
|
4524
4537
|
if (unreadableOrphans.length > 0) {
|
|
4525
|
-
logger.warn(malformedOrphanRecordsWarning(stackName, region, unreadableOrphans.map((id) => id ?? ""), false));
|
|
4538
|
+
logger.warn(malformedOrphanRecordsWarning(stackName, region, unreadableOrphans.map((id) => id ?? ""), false, options.refusalRecovery));
|
|
4526
4539
|
deployRefusals.push(deployRefusesDroppedOrphanRowsReason(unreadableOrphans));
|
|
4527
4540
|
}
|
|
4528
4541
|
let reportedByTheAdoptedPropertiesArm = [];
|
|
@@ -4545,14 +4558,14 @@ async function computeStackDiff(currentState, template, region, stackName, state
|
|
|
4545
4558
|
const tornAdopted = repairMalformedResourcePropertiesForReadOnly(stateForDiff);
|
|
4546
4559
|
reportedByTheAdoptedPropertiesArm = tornAdopted;
|
|
4547
4560
|
if (tornAdopted.length > 0) {
|
|
4548
|
-
logger.warn(malformedResourcePropertiesWarning(stackName, region, tornAdopted));
|
|
4561
|
+
logger.warn(malformedResourcePropertiesWarning(stackName, region, tornAdopted, options.refusalRecovery));
|
|
4549
4562
|
deployRefusals.push(deployRefusesPropertiesReason(tornAdopted));
|
|
4550
4563
|
}
|
|
4551
4564
|
}
|
|
4552
4565
|
const alreadyReported = new Set(reportedByTheAdoptedPropertiesArm);
|
|
4553
4566
|
const previewedRowsTheDeployRefuses = readableOrphans.filter((record) => !isReadableOrphanRecord(record)).map((record) => record.logicalId).filter((logicalId) => !alreadyReported.has(logicalId));
|
|
4554
4567
|
if (previewedRowsTheDeployRefuses.length > 0) {
|
|
4555
|
-
logger.warn(malformedOrphanRowsKeptWarning(stackName, region, previewedRowsTheDeployRefuses));
|
|
4568
|
+
logger.warn(malformedOrphanRowsKeptWarning(stackName, region, previewedRowsTheDeployRefuses, options.refusalRecovery));
|
|
4556
4569
|
deployRefusals.push(deployRefusesOrphanRowsReason(previewedRowsTheDeployRefuses));
|
|
4557
4570
|
}
|
|
4558
4571
|
}
|
|
@@ -4591,7 +4604,7 @@ async function computeStackDiff(currentState, template, region, stackName, state
|
|
|
4591
4604
|
}
|
|
4592
4605
|
} };
|
|
4593
4606
|
}
|
|
4594
|
-
const changes = await diffCalculator.calculateDiff(stateForDiff, effectiveTemplate, resolveFn, canonicalizeProperties, void 0, void 0, maskForLog, void 0, maskedInputs);
|
|
4607
|
+
const changes = await diffCalculator.calculateDiff(stateForDiff, effectiveTemplate, resolveFn, canonicalizeProperties, void 0, void 0, maskForLog, void 0, maskedInputs, options.refusalRecovery);
|
|
4595
4608
|
const nestedStackTypeChanges = findNestedStackTypeChanges({
|
|
4596
4609
|
changes,
|
|
4597
4610
|
stateResources: stateForDiff.resources
|
|
@@ -4858,9 +4871,9 @@ function recordedTemplateResources(template, state) {
|
|
|
4858
4871
|
return recorded;
|
|
4859
4872
|
}
|
|
4860
4873
|
async function buildDiffTree(args) {
|
|
4861
|
-
const { stackName, displayName, region, template, nestedTemplates, recursive, stateBackend, diffCalculator, parentHasSecretReference, parameters, parentUnresolvedParameters, canonicalizeProperties, assetRedirect, cfnFallback, previewOrphanAdoption, attributeHealerFor, ancestorTemplatePaths, isNestedChild, inheritedSecrets } = args;
|
|
4874
|
+
const { stackName, displayName, region, template, nestedTemplates, recursive, stateBackend, diffCalculator, parentHasSecretReference, parameters, parentUnresolvedParameters, canonicalizeProperties, assetRedirect, cfnFallback, previewOrphanAdoption, attributeHealerFor, ancestorTemplatePaths, isNestedChild, inheritedSecrets, refusalRecovery } = args;
|
|
4862
4875
|
const attributeHealer = attributeHealerFor?.(stackName, region);
|
|
4863
|
-
const { state, unreadable, unreadableContainers, deployRefusals } = await loadStateOrEmpty(stackName, region, stateBackend);
|
|
4876
|
+
const { state, unreadable, unreadableContainers, deployRefusals } = await loadStateOrEmpty(stackName, region, stateBackend, refusalRecovery);
|
|
4864
4877
|
const createOnlyPrefetch = prefetchCreateOnlyPropertyPaths(templateResourceTypes(recordedTemplateResources(template, state)));
|
|
4865
4878
|
const secretBearingAbove = parentHasSecretReference === true || templateHasSecretDynamicReference(template);
|
|
4866
4879
|
let stackDiff;
|
|
@@ -4873,6 +4886,7 @@ async function buildDiffTree(args) {
|
|
|
4873
4886
|
...previewOrphanAdoption && { previewOrphanAdoption },
|
|
4874
4887
|
...inheritedSecrets && { inheritedSecrets },
|
|
4875
4888
|
...attributeHealer && { attributeHealer },
|
|
4889
|
+
...refusalRecovery && { refusalRecovery },
|
|
4876
4890
|
inheritSecretBearingTemplate: false,
|
|
4877
4891
|
previewMaskedInputs: !isNestedChild,
|
|
4878
4892
|
nestedTemplates
|
|
@@ -4943,7 +4957,8 @@ async function buildDiffTree(args) {
|
|
|
4943
4957
|
ancestorTemplatePaths: childAncestorTemplatePaths,
|
|
4944
4958
|
isNestedChild: true,
|
|
4945
4959
|
parentHasSecretReference: secretBearingAbove,
|
|
4946
|
-
inheritedSecrets: printingSecrets
|
|
4960
|
+
inheritedSecrets: printingSecrets,
|
|
4961
|
+
...refusalRecovery && { refusalRecovery }
|
|
4947
4962
|
}));
|
|
4948
4963
|
}
|
|
4949
4964
|
if (!isNestedChild) {
|
|
@@ -4953,15 +4968,16 @@ async function buildDiffTree(args) {
|
|
|
4953
4968
|
for (const [logicalId, resource] of Object.entries(state.resources ?? {})) {
|
|
4954
4969
|
if (resource.resourceType !== "AWS::CloudFormation::Stack") continue;
|
|
4955
4970
|
if (templateChildIds.has(logicalId)) continue;
|
|
4956
|
-
node.children.push(await buildDeletedSubtree(`${stackName}~${logicalId}`, region, stateBackend, diffCalculator, secretBearingAbove, printingSecrets));
|
|
4971
|
+
node.children.push(await buildDeletedSubtree(`${stackName}~${logicalId}`, region, stateBackend, diffCalculator, secretBearingAbove, printingSecrets, refusalRecovery));
|
|
4957
4972
|
}
|
|
4958
4973
|
return node;
|
|
4959
4974
|
}
|
|
4960
|
-
async function buildDeletedSubtree(stackName, region, stateBackend, diffCalculator, parentHasSecretReference, inheritedSecrets) {
|
|
4961
|
-
const { state, unreadable, unreadableContainers } = await loadStateOrEmpty(stackName, region, stateBackend);
|
|
4975
|
+
async function buildDeletedSubtree(stackName, region, stateBackend, diffCalculator, parentHasSecretReference, inheritedSecrets, refusalRecovery) {
|
|
4976
|
+
const { state, unreadable, unreadableContainers } = await loadStateOrEmpty(stackName, region, stateBackend, refusalRecovery);
|
|
4962
4977
|
const { changes, outputChanges } = await computeStackDiff(state, EMPTY_TEMPLATE, region, stackName, stateBackend, diffCalculator, {
|
|
4963
4978
|
inheritSecretBearingTemplate: parentHasSecretReference,
|
|
4964
|
-
inheritedSecrets
|
|
4979
|
+
inheritedSecrets,
|
|
4980
|
+
...refusalRecovery && { refusalRecovery }
|
|
4965
4981
|
});
|
|
4966
4982
|
const node = {
|
|
4967
4983
|
stackName,
|
|
@@ -4980,7 +4996,7 @@ async function buildDeletedSubtree(stackName, region, stateBackend, diffCalculat
|
|
|
4980
4996
|
};
|
|
4981
4997
|
for (const [logicalId, resource] of Object.entries(state.resources ?? {})) {
|
|
4982
4998
|
if (resource.resourceType !== "AWS::CloudFormation::Stack") continue;
|
|
4983
|
-
node.children.push(await buildDeletedSubtree(`${stackName}~${logicalId}`, region, stateBackend, diffCalculator, parentHasSecretReference, inheritedSecrets));
|
|
4999
|
+
node.children.push(await buildDeletedSubtree(`${stackName}~${logicalId}`, region, stateBackend, diffCalculator, parentHasSecretReference, inheritedSecrets, refusalRecovery));
|
|
4984
5000
|
}
|
|
4985
5001
|
return node;
|
|
4986
5002
|
}
|
|
@@ -5355,6 +5371,11 @@ async function diffCommand(stacks, options) {
|
|
|
5355
5371
|
...options.profile && { profile: options.profile }
|
|
5356
5372
|
});
|
|
5357
5373
|
const diffCalculator = new DiffCalculator();
|
|
5374
|
+
const refusalRecovery = {
|
|
5375
|
+
profile: options.profile,
|
|
5376
|
+
stateBucket,
|
|
5377
|
+
statePrefix: options.statePrefix
|
|
5378
|
+
};
|
|
5358
5379
|
const diffProviderRegistry = new ProviderRegistry();
|
|
5359
5380
|
registerAllProviders(diffProviderRegistry, providerClasses);
|
|
5360
5381
|
const canonicalizeProperties = makeCanonicalizePropertiesFn(diffProviderRegistry);
|
|
@@ -5446,7 +5467,8 @@ async function diffCommand(stacks, options) {
|
|
|
5446
5467
|
...options.cfnFallback === false && { cfnFallback: false },
|
|
5447
5468
|
previewOrphanAdoption,
|
|
5448
5469
|
attributeHealerFor,
|
|
5449
|
-
isNestedChild: false
|
|
5470
|
+
isNestedChild: false,
|
|
5471
|
+
refusalRecovery
|
|
5450
5472
|
}));
|
|
5451
5473
|
}
|
|
5452
5474
|
if (options.json) process.stdout.write(`${stringifyJsonPayload(trees.map(diffTreeToJson))}\n`);
|
|
@@ -5879,6 +5901,11 @@ async function scrubCommand(stacks, options) {
|
|
|
5879
5901
|
bucket: stateBucket,
|
|
5880
5902
|
prefix: options.statePrefix
|
|
5881
5903
|
};
|
|
5904
|
+
const refusalRecovery = {
|
|
5905
|
+
profile: options.profile,
|
|
5906
|
+
stateBucket,
|
|
5907
|
+
statePrefix: options.statePrefix
|
|
5908
|
+
};
|
|
5882
5909
|
const stateS3 = new AwsClients({
|
|
5883
5910
|
region,
|
|
5884
5911
|
...options.profile && { profile: options.profile }
|
|
@@ -5921,7 +5948,7 @@ async function scrubCommand(stacks, options) {
|
|
|
5921
5948
|
const exportIndexFor = (indexRegion) => {
|
|
5922
5949
|
const existing = exportIndexStores.get(indexRegion);
|
|
5923
5950
|
if (existing) return existing;
|
|
5924
|
-
const store = new ExportIndexStore(stateS3.s3, stateBucket, options.statePrefix, indexRegion, stateBackend);
|
|
5951
|
+
const store = new ExportIndexStore(stateS3.s3, stateBucket, options.statePrefix, indexRegion, stateBackend, { profile: options.profile });
|
|
5925
5952
|
exportIndexStores.set(indexRegion, store);
|
|
5926
5953
|
return store;
|
|
5927
5954
|
};
|
|
@@ -5960,7 +5987,8 @@ async function scrubCommand(stacks, options) {
|
|
|
5960
5987
|
logger,
|
|
5961
5988
|
appStacks: allStacks,
|
|
5962
5989
|
...nestedChild && { nestedChild },
|
|
5963
|
-
readConsumerRecords: loadConsumerRecords
|
|
5990
|
+
readConsumerRecords: loadConsumerRecords,
|
|
5991
|
+
refusalRecovery
|
|
5964
5992
|
});
|
|
5965
5993
|
} catch (err) {
|
|
5966
5994
|
failures.push({ stackName });
|
|
@@ -7145,43 +7173,43 @@ async function scrubStack(stack, region, stateBackend, lockManager, opts) {
|
|
|
7145
7173
|
if (opts.dryRun) {
|
|
7146
7174
|
if (repairMalformedResourcesForReadOnly(state)) {
|
|
7147
7175
|
malformedResources = true;
|
|
7148
|
-
logger.warn(malformedResourcesWarning(stack.stackName, region));
|
|
7176
|
+
logger.warn(malformedResourcesWarning(stack.stackName, region, opts.refusalRecovery));
|
|
7149
7177
|
}
|
|
7150
|
-
} else if (!hasReadableResources(state)) throw new ScrubRefusalError(malformedStateRefusalMessage(stack.stackName, region), STATE_RESOURCES_MALFORMED);
|
|
7178
|
+
} else if (!hasReadableResources(state)) throw new ScrubRefusalError(malformedStateRefusalMessage(stack.stackName, region, opts.refusalRecovery), STATE_RESOURCES_MALFORMED);
|
|
7151
7179
|
let malformedResourceRows;
|
|
7152
7180
|
if (opts.dryRun) {
|
|
7153
7181
|
const droppedRows = repairMalformedResourceEntriesForReadOnly(state);
|
|
7154
7182
|
if (droppedRows.length > 0) {
|
|
7155
7183
|
malformedResourceRows = true;
|
|
7156
|
-
logger.warn(malformedResourceEntriesWarning(stack.stackName, region, droppedRows));
|
|
7184
|
+
logger.warn(malformedResourceEntriesWarning(stack.stackName, region, droppedRows, opts.refusalRecovery));
|
|
7157
7185
|
}
|
|
7158
7186
|
} else {
|
|
7159
7187
|
const unreadableRows = unreadableResourceEntries(state);
|
|
7160
|
-
if (unreadableRows.length > 0) throw new ScrubRefusalError(malformedScrubResourceEntriesRefusalMessage(stack.stackName, region, unreadableRows), STATE_RESOURCES_MALFORMED);
|
|
7188
|
+
if (unreadableRows.length > 0) throw new ScrubRefusalError(malformedScrubResourceEntriesRefusalMessage(stack.stackName, region, unreadableRows, opts.refusalRecovery), STATE_RESOURCES_MALFORMED);
|
|
7161
7189
|
}
|
|
7162
7190
|
let malformedOutputs;
|
|
7163
7191
|
if (opts.dryRun) {
|
|
7164
7192
|
if (repairMalformedOutputsForReadOnly(state)) {
|
|
7165
7193
|
malformedOutputs = true;
|
|
7166
|
-
logger.warn(malformedOutputsWarning(stack.stackName, region));
|
|
7194
|
+
logger.warn(malformedOutputsWarning(stack.stackName, region, opts.refusalRecovery));
|
|
7167
7195
|
}
|
|
7168
|
-
} else if (!hasReadableOutputs(state)) throw new ScrubRefusalError(malformedOutputsRefusalMessage(stack.stackName, region), STATE_RESOURCES_MALFORMED);
|
|
7196
|
+
} else if (!hasReadableOutputs(state)) throw new ScrubRefusalError(malformedOutputsRefusalMessage(stack.stackName, region, opts.refusalRecovery), STATE_RESOURCES_MALFORMED);
|
|
7169
7197
|
let malformedOrphans;
|
|
7170
7198
|
let malformedOrphanRows;
|
|
7171
7199
|
if (opts.dryRun) {
|
|
7172
7200
|
if (repairMalformedOrphansForReadOnly(state)) {
|
|
7173
7201
|
malformedOrphans = true;
|
|
7174
|
-
logger.warn(malformedOrphansWarning(stack.stackName, region));
|
|
7202
|
+
logger.warn(malformedOrphansWarning(stack.stackName, region, opts.refusalRecovery));
|
|
7175
7203
|
}
|
|
7176
7204
|
const droppedRows = repairMalformedOrphanRecordsForReadOnly(state);
|
|
7177
7205
|
if (droppedRows.length > 0) {
|
|
7178
7206
|
malformedOrphanRows = true;
|
|
7179
|
-
logger.warn(malformedOrphanRecordsWarning(stack.stackName, region, droppedRows, true));
|
|
7207
|
+
logger.warn(malformedOrphanRecordsWarning(stack.stackName, region, droppedRows, true, opts.refusalRecovery));
|
|
7180
7208
|
}
|
|
7181
|
-
} else if (!hasReadableOrphans(state)) throw new ScrubRefusalError(malformedOrphansRefusalMessage(stack.stackName, region), STATE_RESOURCES_MALFORMED);
|
|
7209
|
+
} else if (!hasReadableOrphans(state)) throw new ScrubRefusalError(malformedOrphansRefusalMessage(stack.stackName, region, opts.refusalRecovery), STATE_RESOURCES_MALFORMED);
|
|
7182
7210
|
else {
|
|
7183
7211
|
const unreadableRows = unreadableOrphanRecords(state);
|
|
7184
|
-
if (unreadableRows.length > 0) throw new ScrubRefusalError(malformedOrphanRecordsRefusalMessage(stack.stackName, region, unreadableRows), STATE_RESOURCES_MALFORMED);
|
|
7212
|
+
if (unreadableRows.length > 0) throw new ScrubRefusalError(malformedOrphanRecordsRefusalMessage(stack.stackName, region, unreadableRows, opts.refusalRecovery), STATE_RESOURCES_MALFORMED);
|
|
7185
7213
|
}
|
|
7186
7214
|
const perResourceTemplateProps = /* @__PURE__ */ new Map();
|
|
7187
7215
|
const outputsTemplateSource = {};
|
|
@@ -8303,9 +8331,15 @@ async function driftCommand(stacks, options) {
|
|
|
8303
8331
|
try {
|
|
8304
8332
|
const region = namedCliRegion(options.region) ?? "us-east-1";
|
|
8305
8333
|
const bucket = await resolveStateBucketWithDefault(options.stateBucket, region);
|
|
8334
|
+
const prefix = options.statePrefix;
|
|
8306
8335
|
const stateConfig = {
|
|
8307
8336
|
bucket,
|
|
8308
|
-
prefix
|
|
8337
|
+
prefix
|
|
8338
|
+
};
|
|
8339
|
+
const refusalRecovery = {
|
|
8340
|
+
profile: options.profile,
|
|
8341
|
+
stateBucket: bucket,
|
|
8342
|
+
statePrefix: prefix
|
|
8309
8343
|
};
|
|
8310
8344
|
const stateBackend = new S3StateBackend(awsClients.s3, stateConfig, {
|
|
8311
8345
|
region,
|
|
@@ -8363,7 +8397,7 @@ async function driftCommand(stacks, options) {
|
|
|
8363
8397
|
}
|
|
8364
8398
|
const stackRegion = ref.region;
|
|
8365
8399
|
const scope = stackRegionScope(stackRegion);
|
|
8366
|
-
const report = await runWithStackAwsClients(scope.clients, () => runDriftForStack(ref.stackName, stackRegion, stateBackend, scope.registry, scope.ccApiFallback, resolvePrincipalUniqueId, options.accept || options.revert ? "refuse" : "repair", nestedChildRecord));
|
|
8400
|
+
const report = await runWithStackAwsClients(scope.clients, () => runDriftForStack(ref.stackName, stackRegion, stateBackend, scope.registry, scope.ccApiFallback, resolvePrincipalUniqueId, options.accept || options.revert ? "refuse" : "repair", nestedChildRecord, refusalRecovery));
|
|
8367
8401
|
reports.push(report);
|
|
8368
8402
|
}
|
|
8369
8403
|
if (options.json) writeJsonReport(reports);
|
|
@@ -8817,7 +8851,7 @@ function redactDriftChanges(changes, secrets, secretPaths, maskPaths) {
|
|
|
8817
8851
|
maskedPaths
|
|
8818
8852
|
};
|
|
8819
8853
|
}
|
|
8820
|
-
async function runDriftForStack(stackName, region, stateBackend, providerRegistry, ccApiFallback, resolvePrincipalUniqueId, malformedRecordMode, nestedChildRecord) {
|
|
8854
|
+
async function runDriftForStack(stackName, region, stateBackend, providerRegistry, ccApiFallback, resolvePrincipalUniqueId, malformedRecordMode, nestedChildRecord, refusalRecovery) {
|
|
8821
8855
|
const result = await stateBackend.getState(stackName, region);
|
|
8822
8856
|
if (!result) throw new Error(`No state found for stack '${stackName}' (${region}). Run 'cdkd state list' to see available stacks.`);
|
|
8823
8857
|
return await withStackName(stackName, async () => {
|
|
@@ -8826,12 +8860,12 @@ async function runDriftForStack(stackName, region, stateBackend, providerRegistr
|
|
|
8826
8860
|
const logger = getLogger();
|
|
8827
8861
|
let unreadablePropertyBags = /* @__PURE__ */ new Set();
|
|
8828
8862
|
if (malformedRecordMode === "refuse") {
|
|
8829
|
-
refuseMalformedState(state, stackName, region);
|
|
8830
|
-
refuseMalformedResourceEntries(state, stackName, region);
|
|
8831
|
-
refuseMalformedResourcePropertiesForDrift(state, stackName, region);
|
|
8863
|
+
refuseMalformedState(state, stackName, region, refusalRecovery);
|
|
8864
|
+
refuseMalformedResourceEntries(state, stackName, region, refusalRecovery);
|
|
8865
|
+
refuseMalformedResourcePropertiesForDrift(state, stackName, region, refusalRecovery);
|
|
8832
8866
|
} else {
|
|
8833
8867
|
if (repairMalformedResourcesForReadOnly(state)) {
|
|
8834
|
-
logger.warn(malformedResourcesWarning(stackName, region));
|
|
8868
|
+
logger.warn(malformedResourcesWarning(stackName, region, refusalRecovery));
|
|
8835
8869
|
outcomes.push({
|
|
8836
8870
|
kind: "notCompared",
|
|
8837
8871
|
logicalId: UNREADABLE_RESOURCES_MAP_ROW,
|
|
@@ -8841,7 +8875,7 @@ async function runDriftForStack(stackName, region, stateBackend, providerRegistr
|
|
|
8841
8875
|
}
|
|
8842
8876
|
const dropped = repairMalformedResourceEntriesForReadOnly(state);
|
|
8843
8877
|
if (dropped.length > 0) {
|
|
8844
|
-
logger.warn(malformedResourceEntriesWarning(stackName, region, dropped));
|
|
8878
|
+
logger.warn(malformedResourceEntriesWarning(stackName, region, dropped, refusalRecovery));
|
|
8845
8879
|
for (const logicalId of dropped) outcomes.push({
|
|
8846
8880
|
kind: "notCompared",
|
|
8847
8881
|
logicalId,
|
|
@@ -8851,7 +8885,7 @@ async function runDriftForStack(stackName, region, stateBackend, providerRegistr
|
|
|
8851
8885
|
}
|
|
8852
8886
|
const repaired = repairMalformedResourcePropertiesForReadOnly(state);
|
|
8853
8887
|
if (repaired.length > 0) {
|
|
8854
|
-
logger.warn(malformedDriftResourcePropertiesWarning(stackName, region, repaired));
|
|
8888
|
+
logger.warn(malformedDriftResourcePropertiesWarning(stackName, region, repaired, refusalRecovery));
|
|
8855
8889
|
unreadablePropertyBags = new Set(repaired);
|
|
8856
8890
|
}
|
|
8857
8891
|
}
|
|
@@ -10576,18 +10610,22 @@ async function runDestroyForStack(stackName, state, ctx) {
|
|
|
10576
10610
|
const stateTargetFor = (logicalId, resourceType) => resourceType === NESTED_STACK_TYPE ? `${stackName}~${logicalId}` : stackName;
|
|
10577
10611
|
const skippedStateTargets = /* @__PURE__ */ new Set();
|
|
10578
10612
|
const failedStateTargets = /* @__PURE__ */ new Set();
|
|
10579
|
-
const hintCommand = (command, t) => pasteableCommand(command, [
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10588
|
-
|
|
10613
|
+
const hintCommand = (command, t) => pasteableCommand(command, [
|
|
10614
|
+
{
|
|
10615
|
+
value: t,
|
|
10616
|
+
hole: "stack",
|
|
10617
|
+
opts: { plainIdent: true }
|
|
10618
|
+
},
|
|
10619
|
+
{
|
|
10620
|
+
flag: "--stack-region",
|
|
10621
|
+
value: regionForState,
|
|
10622
|
+
hole: "region",
|
|
10623
|
+
opts: { plainIdent: true }
|
|
10624
|
+
},
|
|
10625
|
+
...accountArgs(refusalRecovery)
|
|
10626
|
+
]);
|
|
10589
10627
|
const hintFor = (command, targets, label) => [...new Set(targets.map((t) => `\n${label}: ${hintCommand(command, t).command}`))].join("");
|
|
10590
|
-
const hintHolesClause = (targets) => targets.every((t) => hintCommand("cdkd state show", t).withheld.
|
|
10628
|
+
const hintHolesClause = (targets) => (targets.every((t) => hintCommand("cdkd state show", t).withheld.every((w) => w.hole !== "stack" && w.hole !== "region")) ? "" : " A target that is not a plain identifier is printed as a quoted '<stack>' or '<region>' placeholder; list the records as stored with 'cdkd state list --long'.") + (targets.length === 0 ? "" : ((clause) => clause === "" ? "" : ` ${clause}`)(withheldAccountClause(refusalRecovery, "the command lines below print").trimEnd()));
|
|
10591
10629
|
let secretPrincipalRegions;
|
|
10592
10630
|
const buildDestroySnapshot = () => {
|
|
10593
10631
|
const { imports: _imports, outputReads: _outputReads, ...rest } = state;
|
|
@@ -10953,7 +10991,7 @@ async function runDestroyForStack(stackName, state, ctx) {
|
|
|
10953
10991
|
const droppableSkipped = journaledOrphanFailures > 0 ? skippedTargets.filter((t) => t !== stackName) : skippedTargets;
|
|
10954
10992
|
const skippedCommands = hintFor("cdkd state show", skippedTargets, "Inspect it with") + hintFor("cdkd state orphan", droppableSkipped, "Drop the record with");
|
|
10955
10993
|
const dedupedCommands = (lines) => [...new Set(lines.split("\n").filter((l) => l !== ""))].map((l) => `\n${l}`).join("");
|
|
10956
|
-
logger.warn(`\n${yellow("⚠")} ${bold(`Stack ${plainOrDescribed(stackName, "stack name")} partially destroyed`)} (${green(result.deletedCount)} deleted${retainedSuffix}${skippedSuffix}${guardSuffix}, ${red(result.errorCount)} errors). State preserved — re-run 'cdkd destroy' / 'cdkd state destroy' to clean up. ` + (journaledOrphanFailures > 0 ? `${journaledOrphanFailures} of the failures are resources a failed deploy created that only the rollback journal records: re-run the destroy to retry them. Do not drop this stack's state record — that also deletes the journal, their only record.` : "If the same resource keeps failing, dropping the state record is the last resort: it removes the record without deleting AWS resources.") + skippedClause + hintHolesClause([...failedTargets, ...skippedTargets]) + dedupedCommands(orphanHint + skippedCommands));
|
|
10994
|
+
logger.warn(`\n${yellow("⚠")} ${bold(`Stack ${plainOrDescribed(stackName, "stack name")} partially destroyed`)} (${green(result.deletedCount)} deleted${retainedSuffix}${skippedSuffix}${guardSuffix}, ${red(result.errorCount)} errors). State preserved — re-run 'cdkd destroy' / 'cdkd state destroy' to clean up. ` + (journaledOrphanFailures > 0 ? `${journaledOrphanFailures} of the failures are resources a failed deploy created that only the rollback journal records: re-run the destroy to retry them. Do not drop this stack's state record — that also deletes the journal, their only record.` : "If the same resource keeps failing, dropping the state record is the last resort: it removes the record without deleting AWS resources.") + skippedClause + hintHolesClause([...orphanHint === "" ? [] : failedTargets, ...skippedTargets]) + dedupedCommands(orphanHint + skippedCommands));
|
|
10957
10995
|
}
|
|
10958
10996
|
} finally {
|
|
10959
10997
|
try {
|
|
@@ -11048,6 +11086,15 @@ async function destroyCommand(stackArgs, options) {
|
|
|
11048
11086
|
});
|
|
11049
11087
|
const region = namedCliRegion(options.region) ?? "us-east-1";
|
|
11050
11088
|
const stateBucket = await resolveStateBucketWithDefault(options.stateBucket, region);
|
|
11089
|
+
const accountRecovery = {
|
|
11090
|
+
profile: options.profile,
|
|
11091
|
+
stateBucket,
|
|
11092
|
+
statePrefix: options.statePrefix
|
|
11093
|
+
};
|
|
11094
|
+
const stateCommandAccount = {
|
|
11095
|
+
args: accountArgs(accountRecovery),
|
|
11096
|
+
clause: withheldAccountClause(accountRecovery, "the command lines below print")
|
|
11097
|
+
};
|
|
11051
11098
|
logger.info("Starting stack destruction...");
|
|
11052
11099
|
logger.debug("Options:", options);
|
|
11053
11100
|
if (options.region) {
|
|
@@ -11078,7 +11125,7 @@ async function destroyCommand(stackArgs, options) {
|
|
|
11078
11125
|
});
|
|
11079
11126
|
await stateBackend.verifyBucketExists();
|
|
11080
11127
|
const lockManager = new LockManager(awsClients.s3, stateConfig);
|
|
11081
|
-
const exportIndexStore = new ExportIndexStore(awsClients.s3, stateBucket, options.statePrefix, region, stateBackend);
|
|
11128
|
+
const exportIndexStore = new ExportIndexStore(awsClients.s3, stateBucket, options.statePrefix, region, stateBackend, { profile: options.profile });
|
|
11082
11129
|
const providerRegistry = new ProviderRegistry();
|
|
11083
11130
|
registerAllProviders(providerRegistry, providerClasses);
|
|
11084
11131
|
providerRegistry.setCustomResourceResponseBucket(stateBucket);
|
|
@@ -11192,7 +11239,7 @@ async function destroyCommand(stackArgs, options) {
|
|
|
11192
11239
|
const refRegion = allStateRefs.find((r) => r.stackName === pattern)?.region ?? region;
|
|
11193
11240
|
const stateOnlyResult = await stateBackend.getState(pattern, refRegion);
|
|
11194
11241
|
if (stateOnlyResult?.state.parentStack) {
|
|
11195
|
-
const err = new NestedStackChildDirectDestroyError(pattern, stateOnlyResult.state.parentStack, stateOnlyResult.state.parentLogicalId);
|
|
11242
|
+
const err = new NestedStackChildDirectDestroyError(pattern, stateOnlyResult.state.parentStack, stateOnlyResult.state.parentLogicalId, void 0, stateCommandAccount);
|
|
11196
11243
|
logger.error(` ✗ ${err.message}`);
|
|
11197
11244
|
totalErrors++;
|
|
11198
11245
|
} else if (appStacks.length > 0 && !notInApp.includes(pattern)) notInApp.push(pattern);
|
|
@@ -11224,7 +11271,10 @@ async function destroyCommand(stackArgs, options) {
|
|
|
11224
11271
|
if (synthStack?.terminationProtection === true) {
|
|
11225
11272
|
if (options.removeProtection) logger.warn(`Stack ${displaySafe(stackName)} has terminationProtection: true — bypassing because --remove-protection set`);
|
|
11226
11273
|
else {
|
|
11227
|
-
const err = new StackTerminationProtectionError(stackName
|
|
11274
|
+
const err = new StackTerminationProtectionError(stackName, void 0, {
|
|
11275
|
+
args: stateCommandAccount.args,
|
|
11276
|
+
clause: withheldAccountClause(accountRecovery, "the command below prints")
|
|
11277
|
+
});
|
|
11228
11278
|
logger.error(` ✗ ${err.message}`);
|
|
11229
11279
|
totalErrors++;
|
|
11230
11280
|
continue;
|
|
@@ -11241,15 +11291,20 @@ async function destroyCommand(stackArgs, options) {
|
|
|
11241
11291
|
} else if (synthRegion && refs.some((r) => r.region === synthRegion)) stackTargetRegion = synthRegion;
|
|
11242
11292
|
else {
|
|
11243
11293
|
const regions = refs.map((r) => r.region === void 0 ? "(legacy)" : plainOrDescribed(r.region, "region")).join(", ");
|
|
11244
|
-
const
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11294
|
+
const orphanOneClause = withheldAccountClause(accountRecovery, "the command below prints").trimEnd();
|
|
11295
|
+
const orphanOne = pasteableCommand("cdkd state orphan", [
|
|
11296
|
+
{
|
|
11297
|
+
value: stackName,
|
|
11298
|
+
hole: "stack",
|
|
11299
|
+
opts: { plainIdent: true }
|
|
11300
|
+
},
|
|
11301
|
+
{
|
|
11302
|
+
flag: "--stack-region",
|
|
11303
|
+
hole: "region"
|
|
11304
|
+
},
|
|
11305
|
+
...stateCommandAccount.args
|
|
11306
|
+
]);
|
|
11307
|
+
throw new Error(`Stack ${quotedOrDescribed(stackName, "stack name")} has state in multiple regions: ${regions}. Remove cdkd's record for ONE region with the command below (fill in the region), or run destroy from a CDK app whose env.region matches one of them.` + withheldTargetClause(orphanOne, "stack", "cdkd state orphan", "This stack's name") + (orphanOneClause === "" ? "" : ` ${orphanOneClause}`) + `\nRemove one record with: ${orphanOne.command}`);
|
|
11253
11308
|
}
|
|
11254
11309
|
const stateResult = await stateBackend.getState(stackName, stackTargetRegion);
|
|
11255
11310
|
if (!stateResult) {
|
|
@@ -11257,7 +11312,7 @@ async function destroyCommand(stackArgs, options) {
|
|
|
11257
11312
|
continue;
|
|
11258
11313
|
}
|
|
11259
11314
|
if (stateResult.state.parentStack) {
|
|
11260
|
-
const err = new NestedStackChildDirectDestroyError(stackName, stateResult.state.parentStack, stateResult.state.parentLogicalId);
|
|
11315
|
+
const err = new NestedStackChildDirectDestroyError(stackName, stateResult.state.parentStack, stateResult.state.parentLogicalId, void 0, stateCommandAccount);
|
|
11261
11316
|
logger.error(` ✗ ${err.message}`);
|
|
11262
11317
|
totalErrors++;
|
|
11263
11318
|
continue;
|
|
@@ -13226,7 +13281,7 @@ async function exportCommand(stackArg, options) {
|
|
|
13226
13281
|
reportDriftBaselineGaps(state, logger, {
|
|
13227
13282
|
stackName: resolvedStackName,
|
|
13228
13283
|
region: migrationPending ? void 0 : targetRegion
|
|
13229
|
-
}, options.template ? void 0 : template);
|
|
13284
|
+
}, options.template ? void 0 : template, lockRecovery);
|
|
13230
13285
|
if (allSynthStacks.length > 0) {
|
|
13231
13286
|
const crossRefs = scanCrossStackReferences(allSynthStacks, resolvedStackName);
|
|
13232
13287
|
if (crossRefs.length > 0) {
|
|
@@ -13318,7 +13373,7 @@ async function exportCommand(stackArg, options) {
|
|
|
13318
13373
|
reportDriftBaselineGaps(state, logger, {
|
|
13319
13374
|
stackName: resolvedStackName,
|
|
13320
13375
|
region: migrationPending ? void 0 : targetRegion
|
|
13321
|
-
}, options.template ? void 0 : template);
|
|
13376
|
+
}, options.template ? void 0 : template, lockRecovery);
|
|
13322
13377
|
if (allSynthStacks.length > 0) {
|
|
13323
13378
|
const crossRefs = scanCrossStackReferences(allSynthStacks, resolvedStackName);
|
|
13324
13379
|
if (crossRefs.length > 0) {
|
|
@@ -14398,12 +14453,12 @@ function refreshWithheldReason(built) {
|
|
|
14398
14453
|
default: throw new Error(`refreshWithheldReason: unhandled WithholdReason ${String(reason)}`);
|
|
14399
14454
|
}
|
|
14400
14455
|
}
|
|
14401
|
-
function reportDriftBaselineGaps(state, logger, loaded, template) {
|
|
14456
|
+
function reportDriftBaselineGaps(state, logger, loaded, template, recovery) {
|
|
14402
14457
|
const stackName = loaded?.stackName ?? state.stackName;
|
|
14403
14458
|
const rawRegion = loaded ? loaded.region : state.region;
|
|
14404
14459
|
const region = typeof rawRegion === "string" && rawRegion !== "" ? rawRegion : void 0;
|
|
14405
14460
|
if (!hasReadableResources(state)) {
|
|
14406
|
-
logger.warn(malformedResourcesWarning(stackName, region));
|
|
14461
|
+
logger.warn(malformedResourcesWarning(stackName, region, recovery));
|
|
14407
14462
|
return;
|
|
14408
14463
|
}
|
|
14409
14464
|
const entries = Object.entries(state.resources);
|
|
@@ -15507,10 +15562,17 @@ async function setupStateBackend(options) {
|
|
|
15507
15562
|
region,
|
|
15508
15563
|
bucket,
|
|
15509
15564
|
prefix,
|
|
15510
|
-
exportIndexStore: new ExportIndexStore(awsClients.s3, bucket, prefix, region, stateBackend),
|
|
15565
|
+
exportIndexStore: new ExportIndexStore(awsClients.s3, bucket, prefix, region, stateBackend, { profile: options.profile }),
|
|
15511
15566
|
dispose: () => awsClients.destroy()
|
|
15512
15567
|
};
|
|
15513
15568
|
}
|
|
15569
|
+
function renderRecovery(options, setup) {
|
|
15570
|
+
return {
|
|
15571
|
+
profile: options.profile,
|
|
15572
|
+
stateBucket: setup.bucket,
|
|
15573
|
+
statePrefix: setup.prefix
|
|
15574
|
+
};
|
|
15575
|
+
}
|
|
15514
15576
|
function sortRefs(refs) {
|
|
15515
15577
|
return refs.slice().sort((a, b) => {
|
|
15516
15578
|
if (a.stackName < b.stackName) return -1;
|
|
@@ -15638,8 +15700,8 @@ async function stateResourcesCommand(stackName, options) {
|
|
|
15638
15700
|
if (!ref.region) throw legacyRecordRefusal(stackName);
|
|
15639
15701
|
const stateResult = await setup.stateBackend.getState(stackName, ref.region);
|
|
15640
15702
|
if (!stateResult) throw new Error(`No state found for stack ${formatStackRefSafe(ref)} in s3://${setup.bucket}/${setup.prefix}/. Run 'cdkd state list' to see available stacks.`);
|
|
15641
|
-
if (repairMalformedResourcesForReadOnly(stateResult.state)) logger.warn(malformedResourcesWarning(stackName, ref.region));
|
|
15642
|
-
if (options.long || options.json) repairRenderedContainers(stateResult.state, RESOURCES_RENDERED_CONTAINERS, stackName, ref.region, logger);
|
|
15703
|
+
if (repairMalformedResourcesForReadOnly(stateResult.state)) logger.warn(malformedResourcesWarning(stackName, ref.region, renderRecovery(options, setup)));
|
|
15704
|
+
if (options.long || options.json) repairRenderedContainers(stateResult.state, RESOURCES_RENDERED_CONTAINERS, stackName, ref.region, logger, renderRecovery(options, setup));
|
|
15643
15705
|
const resources = stateResult.state.resources;
|
|
15644
15706
|
const details = Object.entries(resources).map(([logicalId, entry]) => {
|
|
15645
15707
|
const resource = entry ?? {};
|
|
@@ -15738,11 +15800,11 @@ async function stateShowCommand(stackName, options) {
|
|
|
15738
15800
|
if (options.showNested) {
|
|
15739
15801
|
const treeWithLocks = await loadLocksForTree(await buildCdkdStateStackTree(stackName, ref.region, setup.stateBackend, stateResult.state), setup.lockManager, lockInfo);
|
|
15740
15802
|
if (options.json) {
|
|
15741
|
-
warnUnreadableTreeNodes(treeWithLocks, logger);
|
|
15803
|
+
warnUnreadableTreeNodes(treeWithLocks, logger, renderRecovery(options, setup));
|
|
15742
15804
|
process.stdout.write(`${stringifyJsonPayload(treeToShowJson(treeWithLocks))}\n`);
|
|
15743
15805
|
return;
|
|
15744
15806
|
}
|
|
15745
|
-
repairTreeForTextRender(treeWithLocks, logger);
|
|
15807
|
+
repairTreeForTextRender(treeWithLocks, logger, renderRecovery(options, setup));
|
|
15746
15808
|
const lines = renderTreeWithChildren(treeWithLocks);
|
|
15747
15809
|
process.stdout.write(`${lines.join("\n")}\n`);
|
|
15748
15810
|
return;
|
|
@@ -15754,7 +15816,7 @@ async function stateShowCommand(stackName, options) {
|
|
|
15754
15816
|
})}\n`);
|
|
15755
15817
|
return;
|
|
15756
15818
|
}
|
|
15757
|
-
repairRecordForTextRender(stateResult.state, stackName, ref.region, logger);
|
|
15819
|
+
repairRecordForTextRender(stateResult.state, stackName, ref.region, logger, renderRecovery(options, setup));
|
|
15758
15820
|
process.stdout.write(`${renderStateBlock(stateResult.state, lockInfo, true).join("\n")}\n`);
|
|
15759
15821
|
} finally {
|
|
15760
15822
|
setup.dispose();
|
|
@@ -15789,7 +15851,7 @@ const RENDERED_CONTAINER_ORDER = [
|
|
|
15789
15851
|
];
|
|
15790
15852
|
const SHOW_RENDERED_CONTAINERS = new Set(RENDERED_CONTAINER_ORDER);
|
|
15791
15853
|
const RESOURCES_RENDERED_CONTAINERS = /* @__PURE__ */ new Set(["attributes"]);
|
|
15792
|
-
function repairRenderedContainers(state, walked, stackName, region, logger) {
|
|
15854
|
+
function repairRenderedContainers(state, walked, stackName, region, logger, recovery) {
|
|
15793
15855
|
const repaired = /* @__PURE__ */ new Set();
|
|
15794
15856
|
const emptyIfUnwalkable = (owner, name) => {
|
|
15795
15857
|
if (!walked.has(name)) return;
|
|
@@ -15809,19 +15871,19 @@ function repairRenderedContainers(state, walked, stackName, region, logger) {
|
|
|
15809
15871
|
emptyIfUnwalkable(fields, "properties");
|
|
15810
15872
|
}
|
|
15811
15873
|
if (repaired.size === 0) return;
|
|
15812
|
-
logger.warn(malformedRenderedContainersWarning(stackName, region, RENDERED_CONTAINER_ORDER.filter((name) => repaired.has(name))));
|
|
15874
|
+
logger.warn(malformedRenderedContainersWarning(stackName, region, RENDERED_CONTAINER_ORDER.filter((name) => repaired.has(name)), recovery));
|
|
15813
15875
|
}
|
|
15814
|
-
function repairRecordForTextRender(state, stackName, region, logger) {
|
|
15815
|
-
if (repairMalformedResourcesForReadOnly(state)) logger.warn(malformedResourcesWarning(stackName, region));
|
|
15816
|
-
repairRenderedContainers(state, SHOW_RENDERED_CONTAINERS, stackName, region, logger);
|
|
15876
|
+
function repairRecordForTextRender(state, stackName, region, logger, recovery) {
|
|
15877
|
+
if (repairMalformedResourcesForReadOnly(state)) logger.warn(malformedResourcesWarning(stackName, region, recovery));
|
|
15878
|
+
repairRenderedContainers(state, SHOW_RENDERED_CONTAINERS, stackName, region, logger, recovery);
|
|
15817
15879
|
}
|
|
15818
|
-
function repairTreeForTextRender(node, logger) {
|
|
15819
|
-
repairRecordForTextRender(node.state, node.stackName, node.region, logger);
|
|
15820
|
-
for (const child of node.children) repairTreeForTextRender(child, logger);
|
|
15880
|
+
function repairTreeForTextRender(node, logger, recovery) {
|
|
15881
|
+
repairRecordForTextRender(node.state, node.stackName, node.region, logger, recovery);
|
|
15882
|
+
for (const child of node.children) repairTreeForTextRender(child, logger, recovery);
|
|
15821
15883
|
}
|
|
15822
|
-
function warnUnreadableTreeNodes(node, logger) {
|
|
15823
|
-
if (!hasReadableResources(node.state)) logger.warn(malformedResourcesWarning(node.stackName, node.region));
|
|
15824
|
-
for (const child of node.children) warnUnreadableTreeNodes(child, logger);
|
|
15884
|
+
function warnUnreadableTreeNodes(node, logger, recovery) {
|
|
15885
|
+
if (!hasReadableResources(node.state)) logger.warn(malformedResourcesWarning(node.stackName, node.region, recovery));
|
|
15886
|
+
for (const child of node.children) warnUnreadableTreeNodes(child, logger, recovery);
|
|
15825
15887
|
}
|
|
15826
15888
|
function renderStateBlock(state, lockInfo, withLegend) {
|
|
15827
15889
|
const lines = [];
|
|
@@ -15975,6 +16037,11 @@ async function stateOrphanCommand(stackArgs, options) {
|
|
|
15975
16037
|
}
|
|
15976
16038
|
if (!options.yes && !options.force) {
|
|
15977
16039
|
const targetList = targets.map((t) => describedStackRef(t)).join(", ");
|
|
16040
|
+
const bannerAccount = {
|
|
16041
|
+
profile: options.profile,
|
|
16042
|
+
stateBucket: setup.bucket,
|
|
16043
|
+
statePrefix: options.statePrefix
|
|
16044
|
+
};
|
|
15978
16045
|
const destroyCmd = pasteableCommand("cdkd destroy", [{
|
|
15979
16046
|
value: stackName,
|
|
15980
16047
|
hole: "stack",
|
|
@@ -15982,8 +16049,9 @@ async function stateOrphanCommand(stackArgs, options) {
|
|
|
15982
16049
|
patternMatched: true,
|
|
15983
16050
|
plainIdent: true
|
|
15984
16051
|
}
|
|
15985
|
-
}]);
|
|
15986
|
-
|
|
16052
|
+
}, ...accountArgs(bannerAccount)]);
|
|
16053
|
+
const bannerAccountClause = withheldAccountClause(bannerAccount, "the command below prints").trimEnd();
|
|
16054
|
+
process.stdout.write(`\nWARNING: This removes cdkd's state record for [${targetList}] only. AWS resources will NOT be deleted.` + (targets.some(refIsDescribed) ? ` ${STATE_LIST_POINTER}` : "") + "\nDelete the actual resources instead with the command below." + withheldTargetClause(destroyCmd, "stack", "cdkd destroy") + (bannerAccountClause === "" ? "" : ` ${bannerAccountClause}`) + `\nDestroy with: ${destroyCmd.command}\n\n`);
|
|
15987
16055
|
if (!await confirmStateOrphanRemoval(`Remove state for ${targetList} from s3://${setup.bucket}/${setup.prefix}/?`)) {
|
|
15988
16056
|
logger.info(safeMsg`Cancelled removal of state for stack: ${plainOrDescribed(stackName, "stack name")}`);
|
|
15989
16057
|
continue;
|
|
@@ -16051,17 +16119,22 @@ async function stateOrphanResources(stackName, requested, options) {
|
|
|
16051
16119
|
const childRef = childRefs.find((r) => r.region === region) ?? childRefs[0];
|
|
16052
16120
|
if (childRef === void 0) continue;
|
|
16053
16121
|
const otherRegions = childRefs.length - 1;
|
|
16054
|
-
const childCommand = pasteableCommand("cdkd state orphan", [
|
|
16055
|
-
|
|
16056
|
-
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
|
|
16062
|
-
|
|
16063
|
-
|
|
16064
|
-
|
|
16122
|
+
const childCommand = pasteableCommand("cdkd state orphan", [
|
|
16123
|
+
{
|
|
16124
|
+
value: child,
|
|
16125
|
+
hole: "stack",
|
|
16126
|
+
opts: { plainIdent: true }
|
|
16127
|
+
},
|
|
16128
|
+
...childRef.region !== void 0 ? [{
|
|
16129
|
+
flag: "--stack-region",
|
|
16130
|
+
value: childRef.region,
|
|
16131
|
+
hole: "region",
|
|
16132
|
+
opts: { plainIdent: true }
|
|
16133
|
+
}] : [],
|
|
16134
|
+
...accountArgs(recovery)
|
|
16135
|
+
]);
|
|
16136
|
+
const accountClause = withheldAccountClause(recovery, "the command below prints").trimEnd();
|
|
16137
|
+
throw new Error(`${capitalize(plainOrDescribed(id, "logical id"))} has a nested stack's state record of its own. The child's resources are recorded there, and removing this row would leave that record behind with nothing that removes it. Drop the child's record first (it keeps the child's AWS resources; a child with nested stacks of its own has records under '<child>~<logicalId>' too), then re-run.` + withheldTargetClause(childCommand, "stack", "cdkd state orphan") + (otherRegions > 0 ? ` The child also has records in ${otherRegions} other region(s); 'cdkd state list' shows them, and each needs the same drop.` : "") + (accountClause === "" ? "" : ` ${accountClause}`) + `\nDrop the child with: ${childCommand.command}`);
|
|
16065
16138
|
}
|
|
16066
16139
|
clients = new AwsClients({
|
|
16067
16140
|
region,
|
|
@@ -17724,7 +17797,7 @@ function collectAssetReferences(stateDocument, marker, refs) {
|
|
|
17724
17797
|
};
|
|
17725
17798
|
walk(stateDocument);
|
|
17726
17799
|
}
|
|
17727
|
-
async function scanReferencedAssets(stateBackend, marker, logger) {
|
|
17800
|
+
async function scanReferencedAssets(stateBackend, marker, logger, account) {
|
|
17728
17801
|
const refs = {
|
|
17729
17802
|
s3Keys: /* @__PURE__ */ new Set(),
|
|
17730
17803
|
imageTags: /* @__PURE__ */ new Set(),
|
|
@@ -17743,7 +17816,12 @@ async function scanReferencedAssets(stateBackend, marker, logger) {
|
|
|
17743
17816
|
parsed = JSON.parse(body);
|
|
17744
17817
|
} catch (error) {
|
|
17745
17818
|
const { stack, region } = parseStateKey(key, STATE_FILE_SUFFIX, DEFAULT_STATE_PREFIX);
|
|
17746
|
-
const
|
|
17819
|
+
const pasteable = isPasteableIdent(stack) && (region === void 0 || isPasteableIdent(region));
|
|
17820
|
+
const recovery = {
|
|
17821
|
+
...account,
|
|
17822
|
+
statePrefix: keyPrefixOf(key, stack, region)
|
|
17823
|
+
};
|
|
17824
|
+
const inspectHint = pasteable ? pasteableCommand("cdkd state show", [...region === void 0 ? [{
|
|
17747
17825
|
value: stack,
|
|
17748
17826
|
hole: "stack"
|
|
17749
17827
|
}] : [{
|
|
@@ -17753,9 +17831,13 @@ async function scanReferencedAssets(stateBackend, marker, logger) {
|
|
|
17753
17831
|
flag: "--stack-region",
|
|
17754
17832
|
value: region,
|
|
17755
17833
|
hole: "region"
|
|
17756
|
-
}]).command : void 0;
|
|
17834
|
+
}], ...accountArgs(recovery)]).command : void 0;
|
|
17835
|
+
const accountClause = inspectHint === void 0 ? "" : [withheldAccountClause({
|
|
17836
|
+
...recovery,
|
|
17837
|
+
statePrefix: void 0
|
|
17838
|
+
}, "the command below prints").trimEnd(), keyPrefixHoleSentence(recovery.statePrefix)].filter((part) => part !== "").join(" ");
|
|
17757
17839
|
const inspect = inspectHint === void 0 ? "its stack name is not safe to paste into a command, so inspect the object at that key directly" : `see the command below`;
|
|
17758
|
-
throw new CdkdError(`State file ${displayIdent(key, { maxCodePoints: STATE_KEY_MAX_CODE_POINTS })} is not valid JSON — aborting: gc must know every referenced asset before deleting anything, and this file's references are unreadable. Repair or remove the corrupt state file (${inspect}), then re-run.` + (inspectHint === void 0 ? "" : `\nInspect it with: ${inspectHint}`), "GC_STATE_UNREADABLE", error);
|
|
17840
|
+
throw new CdkdError(`State file ${displayIdent(key, { maxCodePoints: STATE_KEY_MAX_CODE_POINTS })} is not valid JSON — aborting: gc must know every referenced asset before deleting anything, and this file's references are unreadable. Repair or remove the corrupt state file (${inspect}), then re-run.` + (accountClause === "" ? "" : ` ${accountClause}`) + (inspectHint === void 0 ? "" : `\nInspect it with: ${inspectHint}`), "GC_STATE_UNREADABLE", error);
|
|
17759
17841
|
}
|
|
17760
17842
|
collectAssetReferences(parsed, marker, refs);
|
|
17761
17843
|
}
|
|
@@ -18000,7 +18082,10 @@ async function gcCommand(options) {
|
|
|
18000
18082
|
let s3Candidates = [];
|
|
18001
18083
|
let ecrCandidates = [];
|
|
18002
18084
|
if (marker !== null) {
|
|
18003
|
-
const refs = await scanReferencedAssets(stateBackend, marker, logger
|
|
18085
|
+
const refs = await scanReferencedAssets(stateBackend, marker, logger, {
|
|
18086
|
+
profile: options.profile,
|
|
18087
|
+
stateBucket: bucketName
|
|
18088
|
+
});
|
|
18004
18089
|
s3Candidates = await listS3Candidates(awsClients.s3, marker.assetBucket, accountId, refs, cutoffMs, logger);
|
|
18005
18090
|
ecrCandidates = await listEcrCandidates(ecrClient, marker.containerRepo, refs, cutoffMs, logger);
|
|
18006
18091
|
}
|
|
@@ -18070,6 +18155,15 @@ function createGcCommand() {
|
|
|
18070
18155
|
commonOptions.forEach((opt) => cmd.addOption(opt));
|
|
18071
18156
|
return cmd;
|
|
18072
18157
|
}
|
|
18158
|
+
function keyPrefixOf(key, stack, region) {
|
|
18159
|
+
const tail = `/${stack}${region === void 0 ? "" : `/${region}`}/${STATE_FILE_SUFFIX.replace(/^\//, "")}`;
|
|
18160
|
+
return key.endsWith(tail) ? key.slice(0, -tail.length) : void 0;
|
|
18161
|
+
}
|
|
18162
|
+
function keyPrefixHoleSentence(prefix) {
|
|
18163
|
+
const reason = pasteableCommand("cdkd", accountArgs({ statePrefix: prefix })).withheld.find((w) => w.hole === "prefix")?.reason;
|
|
18164
|
+
if (reason === void 0) return "";
|
|
18165
|
+
return `The state prefix of the key above ${reason === "option-shaped" ? `begins with a '-'` : reason === "altered" ? "does not render exactly" : reason === "too-long" ? "is too long to print" : prefix !== void 0 && prefix.includes("/") ? `has a '/'-separated part that is not a plain identifier` : "is not a plain identifier"}, so the command below prints '<prefix>' in its place: replace it whole, quotes included, with that prefix shell-quoted -- the part of the key before '/<stack>/<region>/state.json' ('/<stack>/state.json' for a legacy key), since 'cdkd gc' takes no --state-prefix.`;
|
|
18166
|
+
}
|
|
18073
18167
|
|
|
18074
18168
|
//#endregion
|
|
18075
18169
|
//#region src/cli/commands/publish-assets.ts
|
|
@@ -19500,7 +19594,8 @@ async function loadStateForStack(stackName, synthRegion, opts) {
|
|
|
19500
19594
|
logger.debug(`${prefix}: loaded state for ${stackName} (${targetRegion})`);
|
|
19501
19595
|
return {
|
|
19502
19596
|
state: stateData.state,
|
|
19503
|
-
region: targetRegion
|
|
19597
|
+
region: targetRegion,
|
|
19598
|
+
stateBucket
|
|
19504
19599
|
};
|
|
19505
19600
|
} finally {
|
|
19506
19601
|
resetAwsClients();
|
|
@@ -19582,7 +19677,12 @@ async function buildCrossStackResolver(consumerRegion, opts) {
|
|
|
19582
19677
|
logger.warn(`${prefix}: cross-stack resolver could not access state bucket '${stateBucket}': ${err instanceof Error ? err.message : String(err)}. Fn::ImportValue / Fn::GetStackOutput env entries will warn-and-drop.`);
|
|
19583
19678
|
return;
|
|
19584
19679
|
}
|
|
19585
|
-
const exportIndex = new ExportIndexStore(awsClients.s3, stateBucket, opts.statePrefix, consumerRegion, stateBackend);
|
|
19680
|
+
const exportIndex = new ExportIndexStore(awsClients.s3, stateBucket, opts.statePrefix, consumerRegion, stateBackend, { profile: opts.profile });
|
|
19681
|
+
const refusalRecovery = {
|
|
19682
|
+
profile: opts.profile,
|
|
19683
|
+
stateBucket,
|
|
19684
|
+
statePrefix: opts.statePrefix
|
|
19685
|
+
};
|
|
19586
19686
|
return {
|
|
19587
19687
|
resolver: {
|
|
19588
19688
|
async resolveImport(exportName) {
|
|
@@ -19630,7 +19730,7 @@ async function buildCrossStackResolver(consumerRegion, opts) {
|
|
|
19630
19730
|
const recordKey = producerRecordKey(producerStack, recordRegion);
|
|
19631
19731
|
if (!warnedMalformedProducers.has(recordKey)) {
|
|
19632
19732
|
warnedMalformedProducers.add(recordKey);
|
|
19633
|
-
logger.warn(`${prefix}: ${malformedLocalOutputsWarning(producerStack, recordRegion)}`);
|
|
19733
|
+
logger.warn(`${prefix}: ${malformedLocalOutputsWarning(producerStack, recordRegion, refusalRecovery)}`);
|
|
19634
19734
|
}
|
|
19635
19735
|
return;
|
|
19636
19736
|
}
|
|
@@ -19692,10 +19792,15 @@ var S3LocalStateProvider = class {
|
|
|
19692
19792
|
};
|
|
19693
19793
|
const loaded = await loadStateForStack(stackName, synthRegion, loadOpts);
|
|
19694
19794
|
if (!loaded) return void 0;
|
|
19695
|
-
|
|
19696
|
-
|
|
19795
|
+
const refusalRecovery = {
|
|
19796
|
+
profile: this.opts.profile,
|
|
19797
|
+
stateBucket: loaded.stateBucket,
|
|
19798
|
+
statePrefix: this.opts.statePrefix
|
|
19799
|
+
};
|
|
19800
|
+
if (repairMalformedOutputsForReadOnly(loaded.state)) getLogger().warn(malformedLocalOutputsWarning(stackName, loaded.region, refusalRecovery));
|
|
19801
|
+
if (repairMalformedResourcesForReadOnly(loaded.state)) getLogger().warn(malformedLocalResourcesWarning(stackName, loaded.region, refusalRecovery));
|
|
19697
19802
|
const droppedRows = repairMalformedResourceEntriesForReadOnly(loaded.state);
|
|
19698
|
-
if (droppedRows.length > 0) getLogger().warn(malformedLocalResourceEntriesWarning(stackName, loaded.region, droppedRows));
|
|
19803
|
+
if (droppedRows.length > 0) getLogger().warn(malformedLocalResourceEntriesWarning(stackName, loaded.region, droppedRows, refusalRecovery));
|
|
19699
19804
|
const outputs = {};
|
|
19700
19805
|
for (const [k, v] of Object.entries(loaded.state.outputs ?? {})) if (typeof v === "string") outputs[k] = v;
|
|
19701
19806
|
else if (typeof v === "number" || typeof v === "boolean") outputs[k] = String(v);
|
|
@@ -26832,4 +26937,4 @@ function collectVerbFlags(program) {
|
|
|
26832
26937
|
|
|
26833
26938
|
//#endregion
|
|
26834
26939
|
export { canonicalizeIpProtocolValue as a, buildProgram, resolveSecretDerivedPrincipals as i, runDestroyForStack as n, resolvedResourceTimeoutMs as o, isResolvableSecretPrincipalList as r, canonicalizeIpv4Cidr as t };
|
|
26835
|
-
//# sourceMappingURL=program-
|
|
26940
|
+
//# sourceMappingURL=program-DTXVCX29.js.map
|