@go-to-k/cdkd 0.296.13 → 0.296.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/{asg-provider-DeeIdM5B.js → asg-provider-BbWC_1l5.js} +4 -4
  2. package/dist/{asg-provider-DeeIdM5B.js.map → asg-provider-BbWC_1l5.js.map} +1 -1
  3. package/dist/{logger-DAaB7GFO.js → aws-failure-text-BaWeCWRz.js} +45 -2
  4. package/dist/aws-failure-text-BaWeCWRz.js.map +1 -0
  5. package/dist/cli.js +2 -2
  6. package/dist/{deploy-engine-FDsHckZR.js → deploy-engine-CjLZZzyn.js} +553 -481
  7. package/dist/deploy-engine-CjLZZzyn.js.map +1 -0
  8. package/dist/{iam-policy-targets-elNafvpb.js → iam-policy-targets-BoZuWtxK.js} +43 -49
  9. package/dist/iam-policy-targets-BoZuWtxK.js.map +1 -0
  10. package/dist/{iam-role-provider-BuWI_oJp.js → iam-role-provider-DAqNwSNR.js} +4 -4
  11. package/dist/{iam-role-provider-BuWI_oJp.js.map → iam-role-provider-DAqNwSNR.js.map} +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +4 -4
  14. package/dist/{neptune-provider-Bdc1YYxL.js → neptune-provider-DlSon_pZ.js} +4 -4
  15. package/dist/{neptune-provider-Bdc1YYxL.js.map → neptune-provider-DlSon_pZ.js.map} +1 -1
  16. package/dist/{program-1S4fU3m4.js → program-CqKPsOUR.js} +175 -119
  17. package/dist/program-CqKPsOUR.js.map +1 -0
  18. package/dist/{provider-classes-hW6X0dKh.js → provider-classes-Drnm0GAz.js} +193 -74
  19. package/dist/provider-classes-Drnm0GAz.js.map +1 -0
  20. package/dist/{rds-provider-Q1U7N7ee.js → rds-provider-e6XtJAGl.js} +4 -4
  21. package/dist/{rds-provider-Q1U7N7ee.js.map → rds-provider-e6XtJAGl.js.map} +1 -1
  22. package/dist/{version-B9EuX7Oh.js → version-Bdg2mYAM.js} +2 -2
  23. package/dist/{version-B9EuX7Oh.js.map → version-Bdg2mYAM.js.map} +1 -1
  24. package/package.json +1 -1
  25. package/dist/deploy-engine-FDsHckZR.js.map +0 -1
  26. package/dist/iam-policy-targets-elNafvpb.js.map +0 -1
  27. package/dist/logger-DAaB7GFO.js.map +0 -1
  28. package/dist/program-1S4fU3m4.js.map +0 -1
  29. package/dist/provider-classes-hW6X0dKh.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
- 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 { $ as endCommandInterruptScope, $n as retryClassificationText, An as pasteableCommand, At as UNREPRODUCIBLE_LOCK_CLAUSE, Bt as injectiveKey, C as assertRegionMatch, Cn as TIMEOUT_FLAG_RESOURCE_TYPE, Dn as commandHole, Fn as shellQuote, Ft as formatLockOperation, Gt as withPasteableAwsProfile, H as runDeleteAttempt, Ht as producerCoordinateKey, In as withheldTargetClause, It as formatLockOwner, J as isAwsCliLiteral, Jt as clientDefaultsFor, Kt as ambientClientDefaults, Ln as setPasteableRunFlags, Mn as plainOrDescribed, Mt as buildLockContentionMessage, Nn as quotedOrDescribed, Nt as forceQuitRecoveryClause, Pn as shellBoundedDisplay, Pt as formatLockExpiry, Q as beginCommandInterruptScope, Qn as isTransientServerError, Qt as CdkdError, Rn as setPasteableVerbFlags, Rt as CUSTOM_RESOURCE_RESPONSE_PREFIX, S as RESOURCE_NOT_FOUND, Sn as withErrorHandling, Tn as SHELL_ACTIVE_WHY, Ut as producerRecordKey, Wt as setPasteableAwsProfile, Xt as AccountIdUnavailableError, Yn as isAmbiguousOutcomeError, Yt as credentialFingerprint, Zn as isRetryableTransientError, an as LocalInvokeBuildError$1, ar as isThrottlingError, dn as PartialFailureError, dt as resourceTypeShown, en as CrossAccountSecretRefusalError, er as describeAwsFailure, et as interruptWatchListenerCount, fn as ProvisioningError, gn as StackTerminationProtectionError, hn as StackHasActiveImportsError, in as IntrinsicResolutionRefusalError, ir as isMarkedNonRetryable, j as remedyLogicalId, jt as buildForceUnlockCommand, kn as isInertUnquoted, ln as MalformedProducerRecordRefusalError, lt as logicalIdShown, mn as ResourceUpdateNotSupportedError, n as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, nn as DeployCancelledError, nr as safeStringify, on as LocalStartServiceError, or as markNonRetryable, pn as ResourceTimeoutError, qt as ambientCredentialConfig, rn as DynamicReferenceRegionAmbiguousError, s as readRecordedPrincipals, t as IAM_PRINCIPAL_NAME, tt as isInterruptedWaitError, un as NestedStackChildDirectDestroyError, vn as SynthesisError, w as VALUE_NOT_SHOWN, xn as normalizeAwsError, zt as DEFAULT_STATE_PREFIX } from "./iam-policy-targets-elNafvpb.js";
2
+ import { A as UNRENDERABLE, B as stringifyJsonPayload, D as SAFE_MSG_ALTERED_CHAR, F as displayStackName, I as isPasteableIdent, M as displayAwsMessage, N as displayIdent, O as SECRET_REF_MAX_CODE_POINTS, P as displaySafe, R as plainIdentOr, T as withStackName, V as truncateCodePoints, _ as derivesPatternBName, a as getLogger, f as getLiveRenderer, h as PATTERN_B_RESOURCE_TYPES, j as cutMarker, k as STACK_REF_MAX_CODE_POINTS, l as runStackBuffered, m as PATTERN_B_NAME_PROPERTIES, o as isStdoutReservedForPayload, p as PATTERN_B_NAME_OPTIONS, r as safeStringify, s as reserveStdoutForPayload, t as describeAwsFailure, v as explicitNamePropertyFor, w as withSkipPrefix, y as generateResourceName, z as safeMsg } from "./aws-failure-text-BaWeCWRz.js";
3
+ import { $t as AccountIdUnavailableError, An as commandHole, Bn as setPasteableRunFlags, D as VALUE_NOT_SHOWN, E as assertRegionMatch, En as TIMEOUT_FLAG_RESOURCE_TYPE, Fn as plainOrDescribed, Ft as buildLockContentionMessage, G as runDeleteAttempt, Gt as producerCoordinateKey, Ht as DEFAULT_STATE_PREFIX, In as quotedOrDescribed, It as forceQuitRecoveryClause, Jt as withPasteableAwsProfile, Kt as producerRecordKey, Ln as shellBoundedDisplay, Lt as formatLockExpiry, Mn as isInertUnquoted, Nn as pasteableCommand, Nt as UNREPRODUCIBLE_LOCK_CLAUSE, On as SHELL_ACTIVE_WHY, P as remedyLogicalId, Pt as buildForceUnlockCommand, Qn as isAmbiguousOutcomeError, Qt as credentialFingerprint, Rn as shellQuote, Rt as formatLockOperation, T as RESOURCE_NOT_FOUND, Tn as withErrorHandling, Ut as injectiveKey, Vn as setPasteableVerbFlags, Vt as CUSTOM_RESOURCE_RESPONSE_PREFIX, Xt as ambientCredentialConfig, Yt as ambientClientDefaults, Z as isAwsCliLiteral, Zt as clientDefaultsFor, _n as ResourceUpdateNotSupportedError, an as DeployCancelledError, ar as isThrottlingError, cn as LocalInvokeBuildError$1, er as isRetryableTransientError, fn as MalformedProducerRecordRefusalError, ft as logicalIdShown, gn as ResourceTimeoutError, hn as ProvisioningError, ir as isMarkedNonRetryable, it as isInterruptedWaitError, ln as LocalStartServiceError, mn as PartialFailureError, mt as resourceTypeShown, n as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, nr as retryClassificationText, nt as endCommandInterruptScope, on as DynamicReferenceRegionAmbiguousError, or as markNonRetryable, pn as NestedStackChildDirectDestroyError, qt as setPasteableAwsProfile, rn as CrossAccountSecretRefusalError, rt as interruptWatchListenerCount, s as readRecordedPrincipals, sn as IntrinsicResolutionRefusalError, t as IAM_PRINCIPAL_NAME, tn as CdkdError, tr as isTransientServerError, tt as beginCommandInterruptScope, vn as StackHasActiveImportsError, wn as normalizeAwsError, xn as SynthesisError, yn as StackTerminationProtectionError, zn as withheldTargetClause, zt as formatLockOwner } from "./iam-policy-targets-BoZuWtxK.js";
4
4
  import { n as awsClientDefaults, r as getAssumedRoleCredentials, u as formatAuthority } from "./aws-client-defaults-D0q0z4dG.js";
5
- import { $ as recordDisplacedSkips, $a as noEchoLeavesOf, $i as refuseMalformedResourcesForDeploy, $n as withPrintingSecrets, $o as importableOutputs, $s as resolveStateBucketWithDefault, $t as secretNamePrintingBag, A as gray, Ac as resolveBucketRegion, Ai as malformedScrubResourceEntriesRefusalMessage, An as findDestructiveChanges, Ao as recordMaskOnlyValue, Ar as envCredentialsAreAssumedRole, As as formatDockerLoginError, At as removeProtectionTypeList, B as isHandledOrphan, Ba as prefetchCreateOnlyPropertyPaths, Bi as refuseMalformedOutputs, Bo as isSingleDynamicReferenceToken, Br as getAccountInfo, Bs as escapeRegExp, Bt as findNestedStackTypeChanges, C as recordedProtectionNote, Ca as isStatefulRecreateTargetSync, Cc as ownValue, Ci as malformedOrphansWarning, Cn as collectPublishedOutputNames, Co as pathCrossesDottedKey, Cr as assertSendableRoleArn, Cs as buildDockerImage, D as createReadOnlyAttributeHealerFactory, Dc as renderAssemblyPathEscape, Di as malformedResourceEntriesWarning, Dn as DEFAULT_RESOURCE_WARN_AFTER_MS, Do as identityKeyFor, Dr as AWS_CREDENTIAL_ENV_KEYS, Ds as describeDockerFailure, E as formatResourceLine, Ec as displayAssemblyPath, Ei as malformedRenderedContainersWarning, En as DEFAULT_RESOURCE_TIMEOUT_MS, Er as sendableAssumeRoleCommand, Es as describeDockerExecFailure, F as namesAnyDeclaredParameter, Fi as refuseMalformedOrphanRecords, Fo as STATE_SOURCED_BASELINE_RULES, Fs as redactDockerArgvValues, Ft as isReplacementOrphan, G as makeSiblingClaimReader, Gi as refuseMalformedResourceEntriesForDestroy, Go as splitImportedOps, Gr as keepsSecretReferenceToken, Gs as synthesisStatusMessage, H as loadJournaledOrphans, Ha as describeTypeWithThrottleRetry, Hi as refuseMalformedResourceAttributesForOrphan, Ho as isLockInfoExpired, Hr as carriesDynamicReference, Hs as AssetManifestLoader, Ht as inheritProducerRegions, I as reachableDivergentParameters, Ii as refuseMalformedOrphanRecordsForDestroy, In as withCreateTokenLedger, Io as STATE_SOURCED_CROSS_GENERATION_RULES, Is as redactedDockerCause, It as planFailedOps, J as displacedOpClause, Ja as TemplateParser, Ji as refuseMalformedResourceEntriesForOrphan, Jn as ProviderRegistry, Jo as exportNamesCarriedFrom, Jr as isStalePlaceholderArnAttribute, Js as loadCdkJson, Jt as updatePartialReason, K as planOrphanAdoption, Ki as refuseMalformedResourceEntriesForImport, Ko as acceptedCreateOnlyDropsOf, Kr as AWS_NO_VALUE, Ks as getDefaultStateBucketName, L as resourcesNamingDeclaredParameter, Li as refuseMalformedOrphans, Lo as STATE_SOURCED_READBACK_RULES, Lr as coerceParameterTypedValue, Ls as runDockerForeground, Lt as planRollback, M as red, Mi as previewableOrphanRecords, Mn as RollbackInlinePolicyWriters, Mo as recordNoEchoAttributeValues, Ms as isDockerClientEnvKey, Mt as recordAfterRollbackUpdate, N as yellow, Ni as refuseDivergentRecordRegionForDestroy, No as recordProvenPublicExpression, Ns as isMalformedEnvKey, Nt as demoteSupersededOrphans, O as bold, Oc as resolveAssemblyPath, Oi as malformedResourcePropertiesWarning, On as maskingRetryLogger, Oo as carriesSecretMask, Or as applyCallerIdentityCredentials, Os as dockerSpawnEnvWithSensitive, P as computeParameterTaint, Pn as ledgerForStack, Po as wholeStringLeavesOf, Ps as partitionSensitiveEnv, Pt as isJournaledOrphan, Q as nestedChildStackName$1, Qa as maskedLeafCoordinatesOf, Qi as refuseMalformedResourcePropertiesForOrphan, Qo as importableOutputKeys, Qr as parameterInputsFor, Qs as resolveSkipPrefix, Qt as orphanRecordsPrintingBag, R as deleteJournaledOrphans, Ri as refuseMalformedOrphansForDestroy, Ro as TEMPLATE_SOURCED_RULES, Rr as isUnboundTemplateParameter, Rs as runDockerStreaming, Rt as replacementNeverSwapped, S as recordedProtectionEvidence, Sa as isStatefulRecreateTargetForReplace, Sc as nullPrototypeRecord, Si as malformedOrphansRefusalMessage, Sn as collectDeclaredOutputNames, So as isUncertifiedBaselineMaskPosition, Sr as assertFlagRoleArn, Ss as buildDenyExternalAccessPolicy, Tc as describeFileReadFailure, Ti as malformedOutputsWarning, Tn as bindingSkippedOutputs, To as recordNestedStackParameterExpressions, Tr as isIamRoleArn, Ts as describeDockerCapturedOutput, U as makeForeignHolderScan, Ua as withRetry, Ui as refuseMalformedResourceEntries, Uo as S3StateBackend, Ur as carriesFetchableDynamicReference, Us as getDockerImageBySourceHash, V as journaledOrphanLines, Va as templateResourceTypes, Vi as refuseMalformedOutputsForDestroy, Vo as LockManager, Vr as isImpossibleEmptyStoredAttribute, Vs as stripControlChars, W as sameJournaledOrphans, Wi as refuseMalformedResourceEntriesForDeploy, Wo as rebuildClientForBucketRegion, Wr as isNamelessDynamicReferenceError, Ws as Synthesizer, X as dropSettledNestedJournals, Xa as maskReadbackAtCoordinates, Xi as refuseMalformedResourcePropertiesForDrift, Xn as wouldReturnToSdkProvider, Xo as hasReasonlessBaselineRefusal, Xs as resolveAutoAssetStorage, Xt as journaledOrphanPrintingBag, Y as displacedPhysicalIdShown, Ya as isMarkedCoordinate, Yi as refuseMalformedResourcePropertiesForDestroy, Yn as ccBrokenReason, Yo as hasReadableExportSet, Yr as refStateLookupFromResource, Ys as resolveApp, Yt as completedReplayEntries, Za as maskWholeValue, Zi as refuseMalformedResourcePropertiesForExport, Zn as isCustomResourceType$1, Zo as hasUnverifiableParameterRefusal, Zr as withSharedDrainBudget, Zs as resolveCaptureObservedState, Zt as maskEventTextWithBoundBags, _ as makeCanonicalizePropertiesFn, _a as NO_CC_HANDLERS_REASON, _c as StageLoadError, _i as malformedLocalResourceEntriesWarning, _n as secretBearingStateKeyWarning, _o as markSameGenerationBag, _r as IntrinsicFunctionResolver, _s as isCrossRegionRedirect, a as findNestedTemplateTreeDefect, aa as repairMalformedOutputsForReadOnly, ac as CFN_TEMPLATE_BODY_LIMIT, ai as accountArgs, an as createPreDeleteFinalSnapshot, ao as createUnionSecretMasker, ar as deleteSkipReason, as as isSensitiveAttributeName, at as replayFailedOperations, b as noEchoParameterNamesOf, ba as shownType, bc as hasOwnKey, bi as malformedOrphanRecordsWarning, bn as isWholeDynamicReferenceValue, bo as DYNAMIC_REFERENCE_TOKEN_SCAN, br as regionLessSecretName, bs as validateAssetBucketName, c as renderNestedTemplateTreeDefect, ca as repairMalformedResourcesForReadOnly, cc as findLargeInlineResources, ci as hasReadableOrphans, cn as refusesFinalSnapshot, co as logOnlyValueCount, cs as buildAssetRedirectMap, ct as destroyStackRecordsView, d as conditionInputsFrom, da as unreadableResourceEntries, dc as decodeListingKey, di as isReadableOrphanRecord, dn as DeploymentEventsStore, do as recordLogOnlyValue, ds as rewriteTemplateAssetReferences, dt as PROTECTION_PROPERTY_BY_TYPE, ea as refuseMalformedResourcesForDestroy, ec as resolveStateBucketWithDefaultAndSource, ei as JSON_LISTING_HOLE_VALUE, en as stateSecretNameNeedles, eo as noEchoOutputsComparison, er as CloudControlProvider, es as isReadableBag, f as parentSuppliedValues, fa as withheldAccountClause, fc as expectedOwnerParam, fi as isReadableResourceEntry, fn as extractDeploymentEventError, fo as shareLogOnlyValues, fs as AssetModeResolver, ft as isProtectionValueActive, g as mergeNoChangeOutputs, gc as AssemblyReader, gi as malformedLocalOutputsWarning, gn as secretBearing, go as maskSecretsInText, gr as INTRINSIC_KEYS, gs as getBootstrapMarkerKey, h as keptWholeReasonText, ha as unwrittenCreateOnlyReplacement, hc as derivePartitionAndUrlSuffix, hi as malformedExportSourceWarning, hn as exportAliasCollisionScrubWarning, ho as maskSecretsInError, hr as DiffCalculator, hs as ensureAssetStorage, i as childTemplateLoader, ia as repairMalformedOrphansForReadOnly, ic as ssmResolvedValueType, ii as UNREADABLE_RESOURCES_MAP_ROW, in as ccRoutedFinalSnapshotError, io as carryLogOnlyValues, ir as deleteIndeterminateGuards, is as AssetPublisher, it as withNestedStackContext, j as green, ji as malformedStateRefusalMessage, jn as formatDestructiveChange, jo as recordMaskOnlyValuesIn, js as getDockerCmd, jt as orphanDeleteNeedsIdentity, k as cyan, ki as malformedResourcesWarning, kn as constructPathOf, ko as provenPublicValue, kr as callerEnvCredentials, ks as finchSecretArgvRefusal, l as templateIdentity, la as unpreviewableOrphanRecords, lc as uploadCfnTemplate, li as hasReadableOutputs, ln as unsupportedFinalSnapshotError, lo as printingCorpusOf, ls as createAssetRedirectResolver, m as isSecretBearingReferenceString, mc as canonicalizeRegion, mi as malformedExportNamesWarning, mn as displayTextOrWithheld, mo as errorCauseChain, ms as assertAssetBucketRegion, mt as readProtection, n as IMPLICIT_DELETE_DEPENDENCIES, na as refuseMalformedState, nc as stateBucketExistenceConfirmed, ni as STATE_RESOURCES_MALFORMED, nn as PRE_DELETE_SNAPSHOT_TYPES, no as readsNoEchoSource, ns as orphansCarriedFrom, nt as withNestedRevertRun, o as isAbsoluteAssetPath, oa as repairMalformedResourceEntriesForReadOnly, oc as CFN_TEMPLATE_URL_LIMIT, oi as deployRefusesOrphanRowsReason, on as effectiveDeletionPolicy, oo as hasMaskableValues, os as stringifyValue, ot as replayRollback, p as readRecordedConditionVerdicts, pa as findActionableSilentDrops, pc as PARTITION_TABLE, pi as malformedDriftResourcePropertiesWarning, pn as WITHHELD_NAME_DISPLAY, po as createSecretMasker, ps as BOOTSTRAP_MARKER_PREFIX, pt as perType, q as NESTED_PENDING_PARENT_REASON, qa as DagBuilder, qi as refuseMalformedResourceEntriesForImportSave, qn as CC_BROKEN_REASON, qo as describeRegionValueKind, qr as cfnRefValueFromPhysicalId, qs as getLegacyStateBucketName, qt as updatePartialMessage, r as computeImplicitDeleteEdges, ra as repairMalformedOrphanRecordsForReadOnly, rc as warnDeprecatedNoPrefixCliFlag, ri as UNREADABLE_ORPHANS_CONTAINER_ROW, rn as buildFinalSnapshotIdentifier, ro as liveMatchesUnresolvedTokenFrame, rr as UNSPECIFIED_SKIP_REASON, rs as shouldRetainResource, s as listNestedTemplateRows, sa as repairMalformedResourcePropertiesForReadOnly, sc as MIGRATE_TMP_PREFIX, si as displayLogicalId, sn as isFinalSnapshotError, so as literalSplitDelimitersOf, sr as isWaitAbandonedError, ss as WorkGraph, t as DeployEngine, ta as refuseMalformedResourcesForExport, tc as resolveUseCdkBootstrapAssets, ti as STATE_REGION_DIVERGED, tn as ATOMIC_FINAL_SNAPSHOT_TYPES, tr as slowCcOperationTimeoutMs, ts as orphansAfterRollback, tt as revertedNestedRowIds, u as conditionFingerprint, ua as unreadableOrphanRecords, uc as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, ui as hasReadableResources, un as DeploymentEventsReader, uo as recordLogOnlyParameterValue, us as loadPublishableAssetManifest, ut as withStackRecords, v as noEchoAttributeNamesOf, va as hasNoCloudControlHandlers, vc as processStackMessages, vi as malformedLocalResourcesWarning, vn as secretSafeKeyDisplay, vo as redactSecretsForState, vr as classifyReplaySecretRegion, vs as parseBootstrapMarker, wa as renderStatefulReason, wc as absoluteAssemblyPathEscape, wi as malformedOutputsRefusalMessage, wn as isExportAliasCollision, wo as inheritNestedStackParameterAssociations, wr as explicitRoleArnOrThrow, ws as resolveDockerContextDirectory, x as withResourceDeadline, xa as MULTI_REGION_RECREATE_BLOCKED_TYPES, xc as hasPlainPrototype, xi as malformedOrphanRowsKeptWarning, xn as noEchoParameterValueSeed, xo as dynamicReferenceTokens, xr as applyRoleArnIfSet, xs as validateContainerRepoName, y as noEchoComparisonForTemplate, ya as findReplacedReadersOfRecreateTargets, yc as defineOwnKey, yi as malformedOrphanRecordsRefusalMessage, yn as exportNameSecretExposure, yo as scrubResourceRecord, yr as producerRegionsFromState, ys as readBootstrapMarkerBody, z as dropFailedHint, zi as refuseMalformedOrphansForOrphan, zo as WHOLE_DYNAMIC_REFERENCE_PATTERN, zr as parameterTypeMayLoseSecretIdentity, zs as warnFinchArgvExposure, zt as resolveReplacementOldType } from "./deploy-engine-FDsHckZR.js";
6
- import { t as getCdkdVersion } from "./version-B9EuX7Oh.js";
5
+ import { $ as dropFailedHint, $a as maskReadbackAtCoordinates, $i as refuseMalformedResourcePropertiesForDrift, $n as wouldReturnToSdkProvider, $o as hasReasonlessBaselineRefusal, $s as resolveAutoAssetStorage, $t as secretNamePrintingBag, A as gray, Ac as renderAssemblyPathEscape, Ai as malformedResourceEntriesWarning, An as maskingRetryLogger, Ao as identityKeyFor, Ar as AWS_CREDENTIAL_ENV_KEYS, As as describeDockerFailure, At as removeProtectionTypeList, B as NESTED_PENDING_PARENT_REASON, Bi as refuseMalformedOrphans, Bo as STATE_SOURCED_READBACK_RULES, Br as coerceParameterTypedValue, Bs as runDockerForeground, Bt as findNestedStackTypeChanges, C as recordedProtectionNote, Ca as shownType, Cc as hasOwnKey, Ci as malformedOrphanRecordsWarning, Cn as noEchoParameterValueSeed, Co as DYNAMIC_REFERENCE_TOKEN_SCAN, Cr as regionLessSecretName, Cs as validateAssetBucketName, D as createReadOnlyAttributeHealerFactory, Da as renderStatefulReason, Dc as absoluteAssemblyPathEscape, Di as malformedOutputsRefusalMessage, Dn as bindingSkippedOutputs, Do as inheritNestedStackParameterAssociations, Dr as explicitRoleArnOrThrow, Ds as resolveDockerContextDirectory, E as formatResourceLine, Ea as isStatefulRecreateTargetSync, Ec as ownValue, Ei as malformedOrphansWarning, En as isExportAliasCollision, Eo as pathCrossesDottedKey, Er as assertSendableRoleArn, Es as buildDockerImage, F as namesAnyDeclaredParameter, Fi as previewableOrphanRecords, Fo as recordNoEchoAttributeValues, Fs as isDockerClientEnvKey, Ft as isReplacementOrphan, G as nestedChildStackName$1, Ga as describeTypeWithThrottleRetry, Gi as refuseMalformedResourceAttributesForOrphan, Go as isLockInfoExpired, Gr as carriesDynamicReference, Gs as AssetManifestLoader, H as displacedPhysicalIdShown, Hi as refuseMalformedOrphansForOrphan, Ho as WHOLE_DYNAMIC_REFERENCE_PATTERN, Hr as parameterTypeMayLoseSecretIdentity, Hs as warnFinchArgvExposure, Ht as inheritProducerRegions, I as reachableDivergentParameters, Ii as refuseDivergentRecordRegionForDestroy, In as ledgerForStack, Io as recordProvenPublicExpression, Is as isMalformedEnvKey, It as planFailedOps, J as revertedNestedRowIds, Ji as refuseMalformedResourceEntriesForDestroy, Jo as splitImportedOps, Jr as keepsSecretReferenceToken, Js as synthesisStatusMessage, Jt as updatePartialReason, K as recordDisplacedSkips, Ka as withRetry, Ki as refuseMalformedResourceEntries, Ko as S3StateBackend, Kr as carriesFetchableDynamicReference, Ks as getDockerImageBySourceHash, L as resourcesNamingDeclaredParameter, Lo as wholeStringLeavesOf, Ls as partitionSensitiveEnv, Lt as planRollback, M as red, Mi as malformedResourcesWarning, Mn as findDestructiveChanges, Mo as provenPublicValue, Mr as callerEnvCredentials, Ms as finchSecretArgvRefusal, Mt as recordAfterRollbackUpdate, N as yellow, Nc as resolveBucketRegion, Ni as malformedScrubResourceEntriesRefusalMessage, Nn as formatDestructiveChange, No as recordMaskOnlyValue, Nr as envCredentialsAreAssumedRole, Ns as formatDockerLoginError, Nt as demoteSupersededOrphans, O as bold, Oc as describeFileReadFailure, Oi as malformedOutputsWarning, On as DEFAULT_RESOURCE_TIMEOUT_MS, Oo as recordNestedStackParameterExpressions, Or as isIamRoleArn, Os as describeDockerCapturedOutput, P as computeParameterTaint, Pi as malformedStateRefusalMessage, Pn as RollbackInlinePolicyWriters, Po as recordMaskOnlyValuesIn, Ps as getDockerCmd, Pt as isJournaledOrphan, Q as deleteJournaledOrphans, Qa as isMarkedCoordinate, Qi as refuseMalformedResourcePropertiesForDestroy, Qn as isCustomResource, Qo as hasReadableExportSet, Qr as refStateLookupFromResource, Qs as resolveApp, Qt as orphanRecordsPrintingBag, R as makeSiblingClaimReader, Ri as refuseMalformedOrphanRecords, Rn as withCreateTokenLedger, Ro as STATE_SOURCED_BASELINE_RULES, Rs as redactDockerArgvValues, Rt as replacementNeverSwapped, S as recordedProtectionEvidence, Sa as findReplacedReadersOfRecreateTargets, Sc as defineOwnKey, Si as malformedOrphanRecordsRefusalMessage, Sn as isWholeDynamicReferenceValue, So as scrubResourceRecord, Sr as producerRegionsFromState, Ss as readBootstrapMarkerBody, Ta as isStatefulRecreateTargetForReplace, Tc as nullPrototypeRecord, Ti as malformedOrphansRefusalMessage, Tn as collectPublishedOutputNames, To as isUncertifiedBaselineMaskPosition, Tr as assertFlagRoleArn, Ts as buildDenyExternalAccessPolicy, U as dropSettledNestedJournals, Ua as prefetchCreateOnlyPropertyPaths, Ui as refuseMalformedOutputs, Uo as isSingleDynamicReferenceToken, Ur as getAccountInfo, Us as escapeRegExp, V as displacedOpClause, Vi as refuseMalformedOrphansForDestroy, Vo as TEMPLATE_SOURCED_RULES, Vr as isUnboundTemplateParameter, Vs as runDockerStreaming, Wa as templateResourceTypes, Wi as refuseMalformedOutputsForDestroy, Wo as LockManager, Wr as isImpossibleEmptyStoredAttribute, Ws as stripControlChars, Xa as DagBuilder, Xi as refuseMalformedResourceEntriesForImportSave, Xn as ProviderRegistry, Xo as describeRegionValueKind, Xr as cfnRefValueFromPhysicalId, Xs as getLegacyStateBucketName, Xt as journaledOrphanPrintingBag, Y as withNestedRevertRun, Yi as refuseMalformedResourceEntriesForImport, Yn as CC_BROKEN_REASON, Yo as acceptedCreateOnlyDropsOf, Yr as AWS_NO_VALUE, Ys as getDefaultStateBucketName, Yt as completedReplayEntries, Z as withNestedStackContext, Za as TemplateParser, Zi as refuseMalformedResourceEntriesForOrphan, Zn as ccBrokenReason, Zo as exportNamesCarriedFrom, Zr as isStalePlaceholderArnAttribute, Zs as loadCdkJson, Zt as maskEventTextWithBoundBags, _ as makeCanonicalizePropertiesFn, _c as canonicalizeRegion, _i as malformedExportNamesWarning, _n as secretBearingStateKeyWarning, _o as errorCauseChain, _s as assertAssetBucketRegion, a as findNestedTemplateTreeDefect, aa as refuseMalformedState, ac as stateBucketExistenceConfirmed, ai as STATE_RESOURCES_MALFORMED, an as createPreDeleteFinalSnapshot, ao as readsNoEchoSource, as as orphansCarriedFrom, at as replayFailedOperations, b as noEchoParameterNamesOf, ba as NO_CC_HANDLERS_REASON, bc as StageLoadError, bi as malformedLocalResourceEntriesWarning, bn as exportNameNoEchoParameters, bo as markSameGenerationBag, br as IntrinsicFunctionResolver, bs as isCrossRegionRedirect, c as renderNestedTemplateTreeDefect, ca as repairMalformedOutputsForReadOnly, cc as CFN_TEMPLATE_BODY_LIMIT, ci as accountArgs, cn as refusesFinalSnapshot, co as createUnionSecretMasker, cr as deleteSkipReason, cs as isSensitiveAttributeName, ct as destroyStackRecordsView, d as conditionInputsFrom, da as repairMalformedResourcesForReadOnly, dc as findLargeInlineResources, di as hasReadableOrphans, dn as DeploymentEventsStore, do as logOnlyValueCount, ds as buildAssetRedirectMap, dt as PROTECTION_PROPERTY_BY_TYPE, ea as refuseMalformedResourcePropertiesForExport, ec as resolveCaptureObservedState, ei as withSharedDrainBudget, en as stateSecretNameNeedles, eo as maskWholeValue, er as isCustomResourceType$1, es as hasUnverifiableParameterRefusal, et as isHandledOrphan, f as parentSuppliedValues, fa as unpreviewableOrphanRecords, fc as uploadCfnTemplate, fi as hasReadableOutputs, fn as extractDeploymentEventError, fo as printingCorpusOf, fs as createAssetRedirectResolver, ft as isProtectionValueActive, g as mergeNoChangeOutputs, ga as findActionableSilentDrops, gc as PARTITION_TABLE, gi as malformedDriftResourcePropertiesWarning, gn as secretBearing, go as createSecretMasker, gs as BOOTSTRAP_MARKER_PREFIX, h as keptWholeReasonText, ha as withheldAccountClause, hc as expectedOwnerParam, hi as isReadableResourceEntry, hn as exportAliasCollisionScrubWarning, ho as shareLogOnlyValues, hs as AssetModeResolver, i as childTemplateLoader, ia as refuseMalformedResourcesForExport, ic as resolveUseCdkBootstrapAssets, ii as STATE_REGION_DIVERGED, in as ccRoutedFinalSnapshotError, ir as slowCcOperationTimeoutMs, is as orphansAfterRollback, it as sameJournaledOrphans, j as green, jc as resolveAssemblyPath, ji as malformedResourcePropertiesWarning, jn as constructPathOf, jo as carriesSecretMask, jr as applyCallerIdentityCredentials, js as dockerSpawnEnvWithSensitive, jt as orphanDeleteNeedsIdentity, k as cyan, kc as displayAssemblyPath, ki as malformedRenderedContainersWarning, kn as DEFAULT_RESOURCE_WARN_AFTER_MS, kr as sendableAssumeRoleCommand, ks as describeDockerExecFailure, l as templateIdentity, la as repairMalformedResourceEntriesForReadOnly, lc as CFN_TEMPLATE_URL_LIMIT, li as deployRefusesOrphanRowsReason, ln as unsupportedFinalSnapshotError, lo as hasMaskableValues, ls as stringifyValue, m as isSecretBearingReferenceString, ma as unreadableResourceEntries, mc as decodeListingKey, mi as isReadableOrphanRecord, mn as displayTextOrWithheld, mo as recordLogOnlyValue, ms as rewriteTemplateAssetReferences, mt as readProtection, n as IMPLICIT_DELETE_DEPENDENCIES, na as refuseMalformedResourcesForDeploy, nc as resolveStateBucketWithDefault, nn as PRE_DELETE_SNAPSHOT_TYPES, no as noEchoLeavesOf, nr as withPrintingSecrets, ns as importableOutputs, nt as loadJournaledOrphans, o as isAbsoluteAssetPath, oa as repairMalformedOrphanRecordsForReadOnly, oc as warnDeprecatedNoPrefixCliFlag, oi as UNREADABLE_ORPHANS_CONTAINER_ROW, on as effectiveDeletionPolicy, oo as liveMatchesUnresolvedTokenFrame, or as UNSPECIFIED_SKIP_REASON, os as shouldRetainResource, ot as replayRollback, p as readRecordedConditionVerdicts, pa as unreadableOrphanRecords, pc as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, pi as hasReadableResources, pn as WITHHELD_NAME_DISPLAY, po as recordLogOnlyParameterValue, ps as loadPublishableAssetManifest, pt as perType, qi as refuseMalformedResourceEntriesForDeploy, qo as rebuildClientForBucketRegion, qr as isNamelessDynamicReferenceError, qs as Synthesizer, qt as updatePartialMessage, r as computeImplicitDeleteEdges, ra as refuseMalformedResourcesForDestroy, rc as resolveStateBucketWithDefaultAndSource, ri as JSON_LISTING_HOLE_VALUE, rn as buildFinalSnapshotIdentifier, ro as noEchoOutputsComparison, rr as CloudControlProvider, rs as isReadableBag, rt as makeForeignHolderScan, s as listNestedTemplateRows, sa as repairMalformedOrphansForReadOnly, sc as ssmResolvedValueType, si as UNREADABLE_RESOURCES_MAP_ROW, sn as isFinalSnapshotError, so as carryLogOnlyValues, sr as deleteIndeterminateGuards, ss as AssetPublisher, t as DeployEngine, ta as refuseMalformedResourcePropertiesForOrphan, tc as resolveSkipPrefix, ti as parameterInputsFor, tn as ATOMIC_FINAL_SNAPSHOT_TYPES, to as maskedLeafCoordinatesOf, ts as importableOutputKeys, tt as journaledOrphanLines, u as conditionFingerprint, ua as repairMalformedResourcePropertiesForReadOnly, uc as MIGRATE_TMP_PREFIX, ui as displayLogicalId, un as DeploymentEventsReader, uo as literalSplitDelimitersOf, ur as isWaitAbandonedError, us as WorkGraph, ut as withStackRecords, v as noEchoAttributeNamesOf, va as unwrittenCreateOnlyReplacement, vc as derivePartitionAndUrlSuffix, vi as malformedExportSourceWarning, vn as secretSafeKeyDisplay, vo as maskSecretsInError, vr as DiffCalculator, vs as ensureAssetStorage, wa as MULTI_REGION_RECREATE_BLOCKED_TYPES, wc as hasPlainPrototype, wi as malformedOrphanRowsKeptWarning, wn as collectDeclaredOutputNames, wo as dynamicReferenceTokens, wr as applyRoleArnIfSet, ws as validateContainerRepoName, x as withResourceDeadline, xa as hasNoCloudControlHandlers, xc as processStackMessages, xi as malformedLocalResourcesWarning, xn as exportNameSecretExposure, xo as redactSecretsForState, xr as classifyReplaySecretRegion, xs as parseBootstrapMarker, y as noEchoComparisonForTemplate, yc as AssemblyReader, yi as malformedLocalOutputsWarning, yn as carriedExportAliasExposure, yo as maskSecretsInText, yr as INTRINSIC_KEYS, ys as getBootstrapMarkerKey, z as planOrphanAdoption, zi as refuseMalformedOrphanRecordsForDestroy, zo as STATE_SOURCED_CROSS_GENERATION_RULES, zs as redactedDockerCause, zt as resolveReplacementOldType } from "./deploy-engine-CjLZZzyn.js";
6
+ import { t as getCdkdVersion } from "./version-Bdg2mYAM.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";
@@ -1449,7 +1449,8 @@ function validateRecreateTargets(input) {
1449
1449
  property
1450
1450
  });
1451
1451
  }
1452
- if (recordedResource.provisionedBy === "cc-api" && ccBrokenReason(templateResource.Type) === void 0) blockedAlreadyCcApi.push(target);
1452
+ const onCcAnyway = input.hasSdkProvider !== void 0 && !nestedStackRow && noCcRoute === void 0 && !isCustomResource(resourceType) && !isCustomResource(templateResource.Type) && !input.hasSdkProvider(resourceType) && !input.hasSdkProvider(templateResource.Type);
1453
+ if ((recordedResource.provisionedBy === "cc-api" || onCcAnyway) && ccBrokenReason(templateResource.Type) === void 0) blockedAlreadyCcApi.push(target);
1453
1454
  } else {
1454
1455
  const actionableDrops = findActionableSilentDrops(resourceType, templateResource.Properties, input.allowUnsupportedProperties, recordedResource.properties, { unresolvedAs: "changed" });
1455
1456
  for (const { property } of actionableDrops) ambiguousIntentSdk.push({
@@ -1543,7 +1544,7 @@ function renderRecreateTargetsErrors(validation) {
1543
1544
  }
1544
1545
  if (validation.blockedAlreadyCcApi.length > 0) {
1545
1546
  if (lines.length > 0) lines.push("");
1546
- lines.push(`--recreate-via-cc-api named ${validation.blockedAlreadyCcApi.length} resource(s) that are ALREADY sticky on Cloud Control API (the migration is a no-op):`);
1547
+ lines.push(`--recreate-via-cc-api named ${validation.blockedAlreadyCcApi.length} resource(s) that are ALREADY sticky on Cloud Control API, or whose type has no SDK provider (the migration is a no-op):`);
1547
1548
  for (const blocked of validation.blockedAlreadyCcApi) lines.push(` - ${blocked.logicalId} (${recordedTypeShown(blocked.resourceType)})`);
1548
1549
  lines.push(" Fix: drop these logical ids from --recreate-via-cc-api. They are already CC-managed; a destroy + recreate cycle would produce the same end state at the cost of unnecessary downtime.");
1549
1550
  }
@@ -1621,7 +1622,7 @@ async function probeStatefulRecreateTargetsAsync(targets, clients, logger = getL
1621
1622
  promoted.push({ ...target });
1622
1623
  continue;
1623
1624
  }
1624
- logger.warn(`--recreate-via-cc-api / --recreate-via-sdk-provider: live S3 probe failed for ${target.logicalId} (bucket ${target.physicalId}); leaving stateful guard at the sync result. If the bucket might be non-empty, re-run with --force-stateful-recreation. Underlying error: ${e instanceof Error ? e.message : String(e)}`);
1625
+ logger.warn(`--recreate-via-cc-api / --recreate-via-sdk-provider: live S3 probe failed for ${target.logicalId} (bucket ${target.physicalId}); leaving stateful guard at the sync result. If the bucket might be non-empty, re-run with --force-stateful-recreation. Underlying error: ${describeAwsFailure(e).detail}`);
1625
1626
  promoted.push({
1626
1627
  ...target,
1627
1628
  probeUnresolved: true
@@ -1678,7 +1679,7 @@ async function probeStatefulRecreateTargetsAsync(targets, clients, logger = getL
1678
1679
  });
1679
1680
  continue;
1680
1681
  }
1681
- logger.warn(`--recreate-via-cc-api / --recreate-via-sdk-provider: live CloudWatch Logs probe failed for ${target.logicalId} (log group ${target.physicalId}); treating the log group as NOT provably empty. An unset or zero RetentionInDays is CloudWatch Logs' "never expire", so an unprovable emptiness must not read as empty. Fixes, cheapest first: grant logs:DescribeLogStreams and re-run, or re-run as-is if this was transient (CloudWatch Logs throttles this API aggressively). Only if the log group really is disposable, re-run with --force-stateful-recreation — that flag has NO per-resource granularity and clears the guard for every target in the run. Underlying error: ${e instanceof Error ? e.message : String(e)}`);
1682
+ logger.warn(`--recreate-via-cc-api / --recreate-via-sdk-provider: live CloudWatch Logs probe failed for ${target.logicalId} (log group ${target.physicalId}); treating the log group as NOT provably empty. An unset or zero RetentionInDays is CloudWatch Logs' "never expire", so an unprovable emptiness must not read as empty. Fixes, cheapest first: grant logs:DescribeLogStreams and re-run, or re-run as-is if this was transient (CloudWatch Logs throttles this API aggressively). Only if the log group really is disposable, re-run with --force-stateful-recreation — that flag has NO per-resource granularity and clears the guard for every target in the run. Underlying error: ${describeAwsFailure(e).detail}`);
1682
1683
  promoted.push({
1683
1684
  ...target,
1684
1685
  statefulReason: "has-log-events"
@@ -2209,7 +2210,7 @@ var ExportIndexStore = class {
2209
2210
  state: (await this.stateBackend.getState(ref.stackName, ref.region ?? this.region))?.state
2210
2211
  };
2211
2212
  } catch (err) {
2212
- this.logger.warn(`Failed to read state for ${ref.stackName} (${ref.region ?? ""}) during index rebuild: ${err instanceof Error ? err.message : String(err)}`);
2213
+ this.logger.warn(`Failed to read state for ${ref.stackName} (${ref.region ?? ""}) during index rebuild: ${describeAwsFailure(err).detail}`);
2213
2214
  return {
2214
2215
  ref,
2215
2216
  state: null
@@ -2322,10 +2323,10 @@ var ExportIndexStore = class {
2322
2323
  await new Promise((resolve) => setTimeout(resolve, backoff));
2323
2324
  continue;
2324
2325
  }
2325
- this.logger.warn(`Exports index ${label} failed (non-retryable): ${err instanceof Error ? err.message : String(err)}; continuing without index update`);
2326
+ this.logger.warn(`Exports index ${label} failed (non-retryable): ${describeAwsFailure(err).detail}; continuing without index update`);
2326
2327
  return false;
2327
2328
  }
2328
- this.logger.warn(`Exports index ${label} exhausted ${this.opts.maxWriteRetries} retries due to concurrent writers; continuing without index update. Last error: ${lastErr instanceof Error ? lastErr.message : String(lastErr)}`);
2329
+ this.logger.warn(`Exports index ${label} exhausted ${this.opts.maxWriteRetries} retries due to concurrent writers; continuing without index update. Last error: ${describeAwsFailure(lastErr).detail}`);
2329
2330
  return false;
2330
2331
  }
2331
2332
  isNoSuchKey(err) {
@@ -2395,7 +2396,7 @@ function collectCrossStackRefs(node, onRef) {
2395
2396
  //#region src/provisioning/register-providers.ts
2396
2397
  let providerClasses;
2397
2398
  function loadProviderClasses() {
2398
- providerClasses ??= import("./provider-classes-hW6X0dKh.js");
2399
+ providerClasses ??= import("./provider-classes-Drnm0GAz.js");
2399
2400
  return providerClasses;
2400
2401
  }
2401
2402
  function registerAllProviders(registry, classes) {
@@ -3265,6 +3266,7 @@ async function resolveTemplateOutputs(template, resolveFn, conditions, storedOut
3265
3266
  const declaredKeys = /* @__PURE__ */ new Set();
3266
3267
  const templateHasSecretReference = containsSecretDynamicReference(template);
3267
3268
  const secretBearingExportNames = [];
3269
+ const refusedNoEchoExportNames = [];
3268
3270
  let resolutionFailed = false;
3269
3271
  let passResolvesSecret = false;
3270
3272
  const spellsToken = (raw) => {
@@ -3291,7 +3293,8 @@ async function resolveTemplateOutputs(template, resolveFn, conditions, storedOut
3291
3293
  declaredKeys,
3292
3294
  templateHasSecretReference,
3293
3295
  resolutionFailed,
3294
- secretBearingExportNames
3296
+ secretBearingExportNames,
3297
+ refusedNoEchoExportNames
3295
3298
  };
3296
3299
  const recordFailure = (outputKey, output) => {
3297
3300
  failedKeys.add(outputKey);
@@ -3381,6 +3384,7 @@ async function resolveTemplateOutputs(template, resolveFn, conditions, storedOut
3381
3384
  exportName,
3382
3385
  value,
3383
3386
  declaredExportIsIntrinsic,
3387
+ nameSource: output.Export.Name,
3384
3388
  nameBag
3385
3389
  });
3386
3390
  else {
@@ -3391,8 +3395,13 @@ async function resolveTemplateOutputs(template, resolveFn, conditions, storedOut
3391
3395
  if (outputsPass !== void 0) for (const [plaintext, expression] of nameBag) outputsPass.secrets.set(plaintext, expression);
3392
3396
  }
3393
3397
  }
3394
- for (const { outputKey, exportName, value, declaredExportIsIntrinsic, nameBag } of resolvedNames) if (refusesNoEchoName(exportName, nameBag)) logger.debug(safeMsg`Diff skipping export alias of ${ownerDisplay(outputKey)} — the name carries a value this pass recorded as secret`);
3395
- else if (declaredExportIsIntrinsic && keepsSecretReferenceToken(exportName)) logger.debug(`Diff skipping export alias of ${stripControlChars(outputKey)} — the name carries a secret reference`);
3398
+ for (const { outputKey, exportName, value, declaredExportIsIntrinsic, nameSource, nameBag } of resolvedNames) if (exportNameNoEchoParameters(nameSource, outputsPass?.noEchoNameSources).length > 0) {
3399
+ refusedNoEchoExportNames.push(exportName);
3400
+ logger.debug(safeMsg`Diff skipping export alias of ${ownerDisplay(outputKey)} — the name reads a NoEcho parameter`);
3401
+ } else if (refusesNoEchoName(exportName, nameBag)) {
3402
+ refusedNoEchoExportNames.push(exportName);
3403
+ logger.debug(safeMsg`Diff skipping export alias of ${ownerDisplay(outputKey)} — the name carries a value this pass recorded as secret`);
3404
+ } else if (declaredExportIsIntrinsic && keepsSecretReferenceToken(exportName)) logger.debug(`Diff skipping export alias of ${stripControlChars(outputKey)} — the name carries a secret reference`);
3396
3405
  else if (isExportAliasCollision(exportName, outputKey, publishedOutputNames)) logger.debug(`Diff skipping export alias ${stripControlChars(exportName)} of ${stripControlChars(outputKey)} — collides with an output name`);
3397
3406
  else pendingAliases.push({
3398
3407
  outputKey,
@@ -3427,7 +3436,8 @@ async function resolveTemplateOutputs(template, resolveFn, conditions, storedOut
3427
3436
  declaredKeys,
3428
3437
  templateHasSecretReference,
3429
3438
  resolutionFailed,
3430
- secretBearingExportNames
3439
+ secretBearingExportNames,
3440
+ refusedNoEchoExportNames
3431
3441
  };
3432
3442
  }
3433
3443
  function computeOutputsDiff(current, desired, exportNames, secretSourceKeys = /* @__PURE__ */ new Set(), unaccountableScan = {}) {
@@ -3463,8 +3473,9 @@ function computeOutputsDiff(current, desired, exportNames, secretSourceKeys = /*
3463
3473
  const accountable = (name) => declaredKeys.has(name) || Object.prototype.hasOwnProperty.call(desired, name);
3464
3474
  const storedExportNames = unaccountableScan.storedExportNames === void 0 ? void 0 : new Set(unaccountableScan.storedExportNames);
3465
3475
  const withholdsAliasName = (name) => unaccountableScan.templateHasSecretReference === true && !accountable(name) && /[^A-Za-z0-9]/.test(name) && (storedExportNames === void 0 || storedExportNames.has(name));
3476
+ const refusedNoEchoNames = new Set(unaccountableScan.refusedNoEchoExportNames ?? []);
3466
3477
  const nameDisplay = (name) => {
3467
- if (withholdsAliasName(name)) return { nameDisplay: { kind: "withheld" } };
3478
+ if (withholdsAliasName(name) || refusedNoEchoNames.has(name)) return { nameDisplay: { kind: "withheld" } };
3468
3479
  let corpus = recordCorpus;
3469
3480
  let forceMask;
3470
3481
  if (!accountable(name)) {
@@ -3734,7 +3745,7 @@ async function drainTemplateUploads(cleanups, stateBucket, labels) {
3734
3745
  for (const cleanup of cleanups) try {
3735
3746
  await cleanup();
3736
3747
  } catch (cleanupErr) {
3737
- const msg = cleanupErr instanceof Error ? cleanupErr.message : String(cleanupErr);
3748
+ const msg = describeAwsFailure(cleanupErr).detail;
3738
3749
  logger.warn(`Failed to delete ${labels.what} from '${stateBucket}'${labels.when ? ` ${labels.when}` : ""}. Clean up manually under prefix '${MIGRATE_TMP_PREFIX}/'. Cause: ${msg}`);
3739
3750
  }
3740
3751
  }
@@ -3830,7 +3841,7 @@ async function retireCloudFormationStack(options) {
3830
3841
  }));
3831
3842
  updateRan = true;
3832
3843
  } catch (err) {
3833
- const msg = err instanceof Error ? err.message : String(err);
3844
+ const msg = describeAwsFailure(err).detail;
3834
3845
  if (/No updates are to be performed/i.test(msg)) logger.info(` CloudFormation reports no updates needed — proceeding to delete.`);
3835
3846
  else throw err;
3836
3847
  }
@@ -3920,7 +3931,7 @@ async function injectRetainPoliciesRecursive(rootTemplateBody, rootCfnStackName,
3920
3931
  cleanups
3921
3932
  };
3922
3933
  } catch (err) {
3923
- throw new RecursiveRetainInjectionError(err instanceof Error ? err.message : String(err), cleanups, err instanceof Error ? err : void 0);
3934
+ throw new RecursiveRetainInjectionError(describeAwsFailure(err).detail, cleanups, err instanceof Error ? err : void 0);
3924
3935
  }
3925
3936
  }
3926
3937
  var RecursiveRetainInjectionError = class extends Error {
@@ -4020,7 +4031,7 @@ async function tryGetCloudFormationResourceMap(stackName, cfnClient) {
4020
4031
  logger.debug(`No CloudFormation stack named '${stackName}'.`);
4021
4032
  return null;
4022
4033
  }
4023
- const reason = err instanceof Error ? err.message : String(err);
4034
+ const reason = describeAwsFailure(err).detail;
4024
4035
  const subject = isPasteableIdent(stackName) ? `CloudFormation stack '${stackName}'` : "a CloudFormation stack whose name is not a plain identifier";
4025
4036
  logger.warn(`Could not read ${subject} to resolve physical IDs (${reason}).\nFalling back to per-resource lookup; resources whose physical name CloudFormation generated may be reported as not found. Grant cloudformation:DescribeStackResources, or pass --resource ${commandHole("LogicalId")}=${commandHole("physicalId")} for those resources.`);
4026
4037
  return null;
@@ -4593,10 +4604,16 @@ async function computeStackDiff(currentState, template, region, stackName, state
4593
4604
  for (const reason of findUnwrittenCreateOnlyRefusals(changes, stateForDiff.resources)) logger.warn(printing.mask(reason));
4594
4605
  const changedLogicalIds = new Set([...changes.values()].filter((c) => c.changeType !== "NO_CHANGE").map((c) => c.logicalId));
4595
4606
  const bindingSkipped = bindingSkippedOutputs(outputsDigestSource, currentState.skippedOutputs, changedLogicalIds);
4607
+ const noEchoSeed = noEchoParameterValueSeed(effectiveTemplate.Parameters, mergedParameters, inheritedForResolver, parameters);
4608
+ const knownConditions = conditions === void 0 ? void 0 : Object.fromEntries(Object.entries(conditions).filter(([name]) => !stillUnknown.includes(name)));
4596
4609
  const resolved = await resolveTemplateOutputs(effectiveTemplate, resolveFn, conditions, currentState.outputs, bindingSkipped, {
4597
4610
  resolveInto: (bag) => resolveRecordingInto(bag, diffSecrets),
4598
4611
  secrets: outputsPassSecrets,
4599
- noEchoParameterValues: noEchoParameterValueSeed(effectiveTemplate.Parameters, mergedParameters, inheritedForResolver, parameters)
4612
+ noEchoParameterValues: noEchoSeed,
4613
+ noEchoNameSources: {
4614
+ parameters: noEchoParametersOf(effectiveTemplate),
4615
+ ...knownConditions !== void 0 && { conditions: knownConditions }
4616
+ }
4600
4617
  });
4601
4618
  const templateHasSecretReference = resolved.templateHasSecretReference || inheritSecretBearingTemplate === true || !everyConditionKnown && templateHasSecretDynamicReference(template);
4602
4619
  const outputTemplateValues = Object.create(null);
@@ -4607,7 +4624,7 @@ async function computeStackDiff(currentState, template, region, stackName, state
4607
4624
  const names = (Object.hasOwn(stateForDiff.resources, logicalId) ? stateForDiff.resources[logicalId] : void 0)?.noEchoAttributeNames;
4608
4625
  return Array.isArray(names) && names.includes(attribute);
4609
4626
  },
4610
- ...conditions !== void 0 && { conditions: Object.fromEntries(Object.entries(conditions).filter(([name]) => !stillUnknown.includes(name))) }
4627
+ ...knownConditions !== void 0 && { conditions: knownConditions }
4611
4628
  });
4612
4629
  const diffOutputsAgainst = (rawDesired, exportNames, forceLegacyRecord = false) => {
4613
4630
  const { current: storedOutputs, desired } = compareNoEchoOutputs(currentState.outputs, rawDesired);
@@ -4616,6 +4633,7 @@ async function computeStackDiff(currentState, template, region, stackName, state
4616
4633
  templateHasSecretReference,
4617
4634
  forceLegacyRecord,
4618
4635
  secretBearingExportNames: resolved.secretBearingExportNames,
4636
+ refusedNoEchoExportNames: resolved.refusedNoEchoExportNames,
4619
4637
  storedExportNames: Array.isArray(currentState.exportNames) ? currentState.exportNames.filter((name) => typeof name === "string") : void 0
4620
4638
  });
4621
4639
  };
@@ -4628,7 +4646,8 @@ async function computeStackDiff(currentState, template, region, stackName, state
4628
4646
  resolved: withFailedOutputsUndefined(resolved.outputs, resolved.failedOutputKeys),
4629
4647
  declaredOutputs: effectiveTemplate.Outputs,
4630
4648
  previousExportNames: new Set(importableOutputKeys(currentState)),
4631
- resolvedExportNames: [...resolved.exportNames]
4649
+ resolvedExportNames: [...resolved.exportNames],
4650
+ refusesCarriedAlias: (_outputKey, exportName) => carriedExportAliasExposure(exportName, outputsPassSecrets, noEchoSeed) === void 0 ? void 0 : "refused"
4632
4651
  }) : void 0;
4633
4652
  if (merge?.kind === "merged") {
4634
4653
  const storedOutputs = currentState.outputs ?? {};
@@ -5554,7 +5573,7 @@ var ScrubRefusalError = class ScrubRefusalError extends CdkdError {
5554
5573
  }
5555
5574
  };
5556
5575
  function describeFailure(err) {
5557
- if (!(err instanceof Error)) return String(err);
5576
+ if (!(err instanceof Error)) return safeStringify(err);
5558
5577
  return errorCauseChain(err).map((link, i) => i === 0 ? link.message : `\n Caused by: ${link.message}`).join("");
5559
5578
  }
5560
5579
  function scrubStacksFailedError(failures) {
@@ -5667,7 +5686,7 @@ async function saveScrubbedState(stateBackend, stackName, region, state, loaded)
5667
5686
  try {
5668
5687
  survives = await stateBackend.getRawObject(legacyKey) !== null;
5669
5688
  } catch (err) {
5670
- throw new ScrubRefusalError(safeMsg`${displayStackName(stackName)} was rewritten to the region-scoped state key, ` + safeMsg`but whether its legacy key ${legacyKey} still holds the pre-scrub record ` + safeMsg`could not be verified (${err instanceof Error ? err.message : String(err)}). ` + "Check that key yourself and, if it exists, delete it (aws s3api delete-object --bucket <state-bucket> --key <that key>), then purge its earlier versions as docs/cli-scrub.md describes. A re-run will not check it again.", "SCRUB_LEGACY_STATE_KEY_UNVERIFIED");
5689
+ throw new ScrubRefusalError(safeMsg`${displayStackName(stackName)} was rewritten to the region-scoped state key, ` + safeMsg`but whether its legacy key ${legacyKey} still holds the pre-scrub record ` + safeMsg`could not be verified (${describeAwsFailure(err).detail}). ` + "Check that key yourself and, if it exists, delete it (aws s3api delete-object --bucket <state-bucket> --key <that key>), then purge its earlier versions as docs/cli-scrub.md describes. A re-run will not check it again.", "SCRUB_LEGACY_STATE_KEY_UNVERIFIED");
5671
5690
  }
5672
5691
  if (survives) throw new ScrubRefusalError(safeMsg`${displayStackName(stackName)} was rewritten to the region-scoped state key, ` + safeMsg`but its legacy key ${legacyKey} could not be deleted and still holds the ` + "pre-scrub record as its CURRENT object. Delete it (aws s3api delete-object --bucket <state-bucket> --key <that key>), then purge its earlier versions as docs/cli-scrub.md describes.", "SCRUB_LEGACY_STATE_KEY_SURVIVES");
5673
5692
  }
@@ -5811,7 +5830,7 @@ async function repairParentOutputAttributes(parentRow, region, stateBackend, loc
5811
5830
  };
5812
5831
  } finally {
5813
5832
  await lockManager.releaseLock(parentRow.stackName, region).catch((err) => {
5814
- logger.warn(safeMsg`Failed to release lock for ${displayStackName(parentRow.stackName)}: ${err instanceof Error ? err.message : String(err)}`);
5833
+ logger.warn(safeMsg`Failed to release lock for ${displayStackName(parentRow.stackName)}: ${describeAwsFailure(err).detail}`);
5815
5834
  });
5816
5835
  }
5817
5836
  }
@@ -6062,7 +6081,7 @@ async function scrubCommand(stacks, options) {
6062
6081
  } catch (err) {
6063
6082
  if (err instanceof ScrubIndexInvariantError) throw err;
6064
6083
  if (!indexUnreadable.some((u) => u.region === stackRegion)) {
6065
- const reason = displaySafe(err instanceof Error ? err.message : String(err));
6084
+ const reason = displaySafe(describeAwsFailure(err).detail);
6066
6085
  indexUnreadable.push({
6067
6086
  region: stackRegion,
6068
6087
  reason
@@ -6129,7 +6148,7 @@ async function scrubCommand(stacks, options) {
6129
6148
  try {
6130
6149
  entries = await store.readPersistedEntries();
6131
6150
  } catch (err) {
6132
- const reason = displaySafe(err instanceof Error ? err.message : String(err));
6151
+ const reason = displaySafe(describeAwsFailure(err).detail);
6133
6152
  indexUnreadable.push({
6134
6153
  region: indexRegion,
6135
6154
  reason
@@ -6354,7 +6373,7 @@ function regionAmbiguousScrubSecretError(origin, stackName, secretName, foreignP
6354
6373
  return new ScrubRefusalError(`Scrub of ${displayStackName(stackName)} cannot re-resolve the secret reference ${maskedIdent(secretName, secrets)} in ${origin}: the reference carries no region of its own, and this stack read across a region boundary (producer region(s) on record: ${foreignProducerRegions.map((r) => displayIdent(r)).join(", ")}), so it may have been resolved in one of those rather than in ${displayIdent(stackRegion)}. A secret of the same name in two regions is two independent values, so scrub would look for the WRONG plaintext — leaving the real one in state while reporting the stack clean, and using the foreign value as a needle that can rewrite an unrelated literal. Refusing instead. Spell the reference as a full ARN, which names its region and is resolved there, then re-run 'cdkd scrub'.`, "SCRUB_SECRET_REGION_AMBIGUOUS");
6355
6374
  }
6356
6375
  function unresolvableForeignScrubSecretError(origin, stackName, secretName, region, cause, secrets) {
6357
- return new ScrubRefusalError(`Scrub of ${displayStackName(stackName)} could not resolve the secret reference ${maskedIdent(secretName, secrets)} in ${origin} in the region its ARN names (${displayIdent(region)}): ${maskSecretsInText(cause instanceof Error ? cause.message : String(cause), secrets)}. Refusing rather than resolving it in the stack's own region, which would look for a different secret's value and report the stack clean over state that still holds the plaintext.`, "SCRUB_CROSS_REGION_SECRET_UNRESOLVED");
6376
+ return new ScrubRefusalError(`Scrub of ${displayStackName(stackName)} could not resolve the secret reference ${maskedIdent(secretName, secrets)} in ${origin} in the region its ARN names (${displayIdent(region)}): ${maskSecretsInText(describeAwsFailure(cause).detail, secrets)}. Refusing rather than resolving it in the stack's own region, which would look for a different secret's value and report the stack clean over state that still holds the plaintext.`, "SCRUB_CROSS_REGION_SECRET_UNRESOLVED");
6358
6377
  }
6359
6378
  const DYNAMIC_REFERENCE_OPENING = "{{resolve:";
6360
6379
  const SECRET_REFERENCE_OPENINGS = [
@@ -6527,7 +6546,7 @@ function effectiveIntrinsicKey(node) {
6527
6546
  return RESOLVER_INTRINSIC_PRECEDENCE.find((key) => key in node);
6528
6547
  }
6529
6548
  function unresolvableCrossStackReadError(origin, stackName, intrinsic, path, cause, secrets) {
6530
- return new ScrubRefusalError(`Scrub of ${displayStackName(stackName)} could not resolve the ${intrinsic} in ${origin}${path ? ` at ${maskedIdent(path, secrets)}` : ""}: ${maskSecretsInText(cause instanceof Error ? cause.message : String(cause), secrets)}. Refusing rather than continuing: the value that reference carries may be a secret, and scrub would then have no plaintext to look for — reporting the stack clean over state that still holds it. Deploy the producer stack (or correct the reference) and re-run 'cdkd scrub'.`, "SCRUB_CROSS_STACK_READ_UNRESOLVED");
6549
+ return new ScrubRefusalError(`Scrub of ${displayStackName(stackName)} could not resolve the ${intrinsic} in ${origin}${path ? ` at ${maskedIdent(path, secrets)}` : ""}: ${maskSecretsInText(describeAwsFailure(cause).detail, secrets)}. Refusing rather than continuing: the value that reference carries may be a secret, and scrub would then have no plaintext to look for — reporting the stack clean over state that still holds it. Deploy the producer stack (or correct the reference) and re-run 'cdkd scrub'.`, "SCRUB_CROSS_STACK_READ_UNRESOLVED");
6531
6550
  }
6532
6551
  function scrubRefusalWording(verdict, loggedExportKey, loggedProducerStack, loggedVia, maskedNames = /* @__PURE__ */ new Set()) {
6533
6552
  const chain = dedupePreservingOrder(loggedVia, "first");
@@ -6938,7 +6957,7 @@ function makeCrossStackPrePass(deps) {
6938
6957
  try {
6939
6958
  loaded = await backend.getState(producer.stack, producer.region);
6940
6959
  } catch (err) {
6941
- logger.debug(`Scrub of ${shownStackName}: could not re-read producer ${shownProducer} (${displayIdent(producer.region)}) to classify its stored value: ${maskSecretsInText(err instanceof Error ? err.message : String(err), secrets)}`);
6960
+ logger.debug(`Scrub of ${shownStackName}: could not re-read producer ${shownProducer} (${displayIdent(producer.region)}) to classify its stored value: ${maskSecretsInText(describeAwsFailure(err).detail, secrets)}`);
6942
6961
  return;
6943
6962
  }
6944
6963
  const outputs = loaded?.state?.outputs;
@@ -6972,17 +6991,17 @@ function makeCrossStackPrePass(deps) {
6972
6991
  await resolver.resolve({ [key]: node[key] }, probe);
6973
6992
  } catch (err) {
6974
6993
  if (!nodeCanRefuse) {
6975
- logger.debug(`Scrub of ${shownStackName}: ${where} could not be resolved, and this position cannot refuse: ${maskSecretsInText(err instanceof Error ? err.message : String(err), secrets)}`);
6994
+ logger.debug(`Scrub of ${shownStackName}: ${where} could not be resolved, and this position cannot refuse: ${maskSecretsInText(describeAwsFailure(err).detail, secrets)}`);
6976
6995
  return;
6977
6996
  }
6978
6997
  if (isByDesignRefusal(err)) {
6979
- const detail = `${where}: ${maskSecretsInText(err instanceof Error ? err.message : String(err), secrets)}`;
6998
+ const detail = `${where}: ${maskSecretsInText(describeAwsFailure(err).detail, secrets)}`;
6980
6999
  findings.unverifiable.push(detail);
6981
7000
  logger.warn(`Scrub of ${shownStackName} cannot verify ${detail} — cdkd declines this read by design, so no re-run can change it. The rest of the stack is still scrubbed; this stack is NOT reported clean.`);
6982
7001
  return;
6983
7002
  }
6984
7003
  if (isMalformedProducerRefusal(err)) {
6985
- const detail = `${where}: ${maskSecretsInText(err instanceof Error ? err.message : String(err), secrets)}`;
7004
+ const detail = `${where}: ${maskSecretsInText(describeAwsFailure(err).detail, secrets)}`;
6986
7005
  findings.unverifiable.push(detail);
6987
7006
  findings.damagedProducerRecords.push(detail);
6988
7007
  logger.warn(`Scrub of ${shownStackName} cannot verify ${detail} — the PRODUCER's state record is malformed or truncated, so this run cannot tell whether that producer still holds the plaintext. The rest of the stack is still scrubbed; this stack is NOT reported clean. Repair the producer's record and scrub it first, then re-run.`);
@@ -7079,7 +7098,7 @@ async function bindDefaultedParametersOneByOne(resolver, template, shownStack, l
7079
7098
  });
7080
7099
  if (Object.hasOwn(one, name)) bound[name] = one[name];
7081
7100
  } catch (err) {
7082
- logger.debug(safeMsg`Parameter ${name} of ${shownStack} left unbound: ${err instanceof Error ? err.message : String(err)}`);
7101
+ logger.debug(safeMsg`Parameter ${name} of ${shownStack} left unbound: ${describeAwsFailure(err).detail}`);
7083
7102
  }
7084
7103
  }
7085
7104
  return bound;
@@ -7233,10 +7252,10 @@ async function scrubStack(stack, region, stateBackend, lockManager, opts) {
7233
7252
  parameters = await resolver.resolveParameters(stack.template, nestedInput?.parameters, inheritedSecrets && { inheritedSecrets });
7234
7253
  } catch (err) {
7235
7254
  if (opts.nestedChild) {
7236
- const reason = maskSecretsInText(err instanceof Error ? err.message : String(err), inheritedSecrets ?? outputSecrets);
7255
+ const reason = maskSecretsInText(describeAwsFailure(err).detail, inheritedSecrets ?? outputSecrets);
7237
7256
  throw new ScrubRefusalError(`Nested stack ${shownStack}: its Parameters could not be resolved against its own template (${reason}), so its secrets cannot be identified. Its record was NOT examined and may still hold plaintext.`, "SCRUB_NESTED_CHILD_UNRESOLVABLE");
7238
7257
  }
7239
- logger.debug(`Parameter resolution skipped for ${shownStack}: ${maskSecretsInText(err instanceof Error ? err.message : String(err), outputSecrets)}`);
7258
+ logger.debug(`Parameter resolution skipped for ${shownStack}: ${maskSecretsInText(describeAwsFailure(err).detail, outputSecrets)}`);
7240
7259
  parameters = await bindDefaultedParametersOneByOne(resolver, stack.template, shownStack, logger);
7241
7260
  }
7242
7261
  const resolverStateBackend = memoizeCrossStackStateReads(stateBackend);
@@ -7282,7 +7301,7 @@ async function scrubStack(stack, region, stateBackend, lockManager, opts) {
7282
7301
  });
7283
7302
  }
7284
7303
  } catch (err) {
7285
- logger.debug(`Condition evaluation skipped for ${shownStack}: ${maskSecretsInText(err instanceof Error ? err.message : String(err), outputSecrets)}`);
7304
+ logger.debug(`Condition evaluation skipped for ${shownStack}: ${maskSecretsInText(describeAwsFailure(err).detail, outputSecrets)}`);
7286
7305
  }
7287
7306
  const templateResources = stack.template.Resources ?? {};
7288
7307
  const templateOutputs = stack.template.Outputs ?? {};
@@ -7342,7 +7361,7 @@ async function scrubStack(stack, region, stateBackend, lockManager, opts) {
7342
7361
  else ungateableAbandonedScans++;
7343
7362
  logger.warn(maskSecretsInText(abandonedScanWarning(propertyName ? `resource ${maskedIdent(logicalId, recordedSecretValues)} property ${maskedIdent(propertyName, recordedSecretValues)}` : `resource ${maskedIdent(logicalId, recordedSecretValues)}`, leafVerdict), recordedSecretValues));
7344
7363
  }
7345
- logger.debug(maskSecretsInText(`Resolution of ${maskedIdent(logicalId, recordedSecretValues)}${propertyName ? `.${maskedIdent(propertyName, recordedSecretValues)}` : ""} during scrub was partial: ${err instanceof Error ? err.message : String(err)}`, recordedSecretValues));
7364
+ logger.debug(maskSecretsInText(`Resolution of ${maskedIdent(logicalId, recordedSecretValues)}${propertyName ? `.${maskedIdent(propertyName, recordedSecretValues)}` : ""} during scrub was partial: ${describeAwsFailure(err).detail}`, recordedSecretValues));
7346
7365
  }
7347
7366
  }
7348
7367
  perResourceTemplateProps.set(logicalId, templateResource.Properties);
@@ -7380,7 +7399,7 @@ async function scrubStack(stack, region, stateBackend, lockManager, opts) {
7380
7399
  else ungateableAbandonedScans++;
7381
7400
  logger.warn(maskSecretsInText(abandonedScanWarning(`orphan record ${maskedIdent(record.logicalId, recordedSecretValues)} ${bagName}`, leafVerdict), recordedSecretValues));
7382
7401
  }
7383
- logger.debug(maskSecretsInText(`Resolution of orphan record ${maskedIdent(record.logicalId, recordedSecretValues)} ${bagName} during scrub was partial: ${err instanceof Error ? err.message : String(err)}`, recordedSecretValues));
7402
+ logger.debug(maskSecretsInText(`Resolution of orphan record ${maskedIdent(record.logicalId, recordedSecretValues)} ${bagName} during scrub was partial: ${describeAwsFailure(err).detail}`, recordedSecretValues));
7384
7403
  }
7385
7404
  }
7386
7405
  }
@@ -7416,7 +7435,7 @@ async function scrubStack(stack, region, stateBackend, lockManager, opts) {
7416
7435
  }
7417
7436
  if (nameFailed) {
7418
7437
  outputsSourceUntrusted = true;
7419
- logger.warn(`Export.Name of output ${maskedIdent(name, outputSecrets)} could not be resolved during scrub (${maskSecretsInText(nameError instanceof Error ? nameError.message : String(nameError), outputSecrets)}) — redacting this stack's outputs by value match instead of by template position, since state may be keyed under a name this run cannot reproduce.`);
7438
+ logger.warn(`Export.Name of output ${maskedIdent(name, outputSecrets)} could not be resolved during scrub (${maskSecretsInText(describeAwsFailure(nameError).detail, outputSecrets)}) — redacting this stack's outputs by value match instead of by template position, since state may be keyed under a name this run cannot reproduce.`);
7420
7439
  }
7421
7440
  }
7422
7441
  if (declaredExportName !== void 0 && typeof exportName !== "string") outputsSourceUntrusted = true;
@@ -7462,7 +7481,7 @@ async function scrubStack(stack, region, stateBackend, lockManager, opts) {
7462
7481
  else ungateableAbandonedScans++;
7463
7482
  logger.warn(maskSecretsInText(abandonedScanWarning(`output ${maskedIdent(name, outputSecrets)}`, leafVerdict), outputSecrets));
7464
7483
  }
7465
- logger.debug(`Resolution of output ${maskedIdent(name, outputSecrets)} during scrub was partial: ${maskSecretsInText(err instanceof Error ? err.message : String(err), outputSecrets)}`);
7484
+ logger.debug(`Resolution of output ${maskedIdent(name, outputSecrets)} during scrub was partial: ${maskSecretsInText(describeAwsFailure(err).detail, outputSecrets)}`);
7466
7485
  }
7467
7486
  }
7468
7487
  });
@@ -7655,7 +7674,7 @@ async function scrubStack(stack, region, stateBackend, lockManager, opts) {
7655
7674
  readers = findDroppedOutputReaders(stack.stackName, region, dropping, await (opts.readConsumerRecords ?? (() => readConsumerRecords(stateBackend, region)))());
7656
7675
  } catch (err) {
7657
7676
  droppedOutputReadersUnverified = true;
7658
- logger.warn(safeMsg`${shownStack}'s template no longer declares output key(s) ${shownKeys(dropping)}, ` + `but the other stacks' state could not be read to confirm none of them still ` + safeMsg`reads one (${maskSecretsInText(err instanceof Error ? err.message : String(err), corpus)}), ` + "so NONE was dropped and this stack is not reported clean. Fix the read and re-run cdkd scrub.");
7677
+ logger.warn(safeMsg`${shownStack}'s template no longer declares output key(s) ${shownKeys(dropping)}, ` + `but the other stacks' state could not be read to confirm none of them still ` + safeMsg`reads one (${maskSecretsInText(describeAwsFailure(err).detail, corpus)}), ` + "so NONE was dropped and this stack is not reported clean. Fix the read and re-run cdkd scrub.");
7659
7678
  dropping = /* @__PURE__ */ new Set();
7660
7679
  }
7661
7680
  if (readers !== void 0 && readers.length > 0) {
@@ -7734,7 +7753,7 @@ async function scrubStack(stack, region, stateBackend, lockManager, opts) {
7734
7753
  throw maskSecretsInError(err, boundaryNeedles);
7735
7754
  } finally {
7736
7755
  if (acquired) await lockManager.releaseLock(stack.stackName, region).catch((err) => {
7737
- logger.warn(`Failed to release lock for ${shownStack}: ${err instanceof Error ? err.message : String(err)}`);
7756
+ logger.warn(`Failed to release lock for ${shownStack}: ${describeAwsFailure(err).detail}`);
7738
7757
  });
7739
7758
  }
7740
7759
  }
@@ -8609,7 +8628,7 @@ function createIamPrincipalUniqueIdResolver(awsClients) {
8609
8628
  if (entityArn !== void 0 && entityArn.toLowerCase() === arn.toLowerCase()) uniqueId = entityId;
8610
8629
  else getLogger().debug(`Principal ${displayIdent(arn, { maxCodePoints: 613 })} resolved to ${entityArn === void 0 ? "no entity" : displayIdent(entityArn, { maxCodePoints: 613 })} — same name in this account or under another IAM path; leaving the policy principal comparison untouched.`);
8611
8630
  } catch (error) {
8612
- const message = error instanceof Error ? error.message : String(error);
8631
+ const message = describeAwsFailure(error).detail;
8613
8632
  const name = error instanceof Error ? error.name : "";
8614
8633
  const status = error?.$metadata?.httpStatusCode;
8615
8634
  const denied = /^AccessDenied|^NotAuthorized/i.test(name) || status === 403;
@@ -8776,7 +8795,7 @@ async function driftProducerRegionEvidence(state, stackName, region, stateBacken
8776
8795
  try {
8777
8796
  parent = await stateBackend.getState(parentName, parentRegion);
8778
8797
  } catch (error) {
8779
- noteUnreadableAncestor(parentName, parentRegion, `it could not be read (${error instanceof Error ? error.message : String(error)})`);
8798
+ noteUnreadableAncestor(parentName, parentRegion, `it could not be read (${describeAwsFailure(error).detail})`);
8780
8799
  return inheritProducerRegions(own, void 0);
8781
8800
  }
8782
8801
  if (!parent || parent.divergentBodyRegion !== void 0 || typeof parent.state !== "object" || parent.state === null) {
@@ -9148,7 +9167,7 @@ async function runDriftForStack(stackName, region, stateBackend, providerRegistr
9148
9167
  secretResolutionFailed = true;
9149
9168
  comparisonBaseline = baseline;
9150
9169
  const refused = isDriftSecretRefusal(err);
9151
- logger.warn(`${logicalId} (${resource.resourceType}): ` + (refused ? "refused to resolve a dynamic reference this resource's state records, so its secret-bearing properties are NOT compared — " : "could not resolve the dynamic reference(s) this resource's state records, so its secret-bearing properties are NOT compared — ") + `${maskSecretsInText(err instanceof Error ? err.message : String(err), secrets)}`);
9170
+ logger.warn(`${logicalId} (${resource.resourceType}): ` + (refused ? "refused to resolve a dynamic reference this resource's state records, so its secret-bearing properties are NOT compared — " : "could not resolve the dynamic reference(s) this resource's state records, so its secret-bearing properties are NOT compared — ") + `${maskSecretsInText(describeAwsFailure(err).detail, secrets)}`);
9152
9171
  for (const plaintext of secrets.keys()) recordLogOnlyValue(secrets, plaintext);
9153
9172
  secrets.clear();
9154
9173
  }
@@ -9196,7 +9215,7 @@ async function runDriftForStack(stackName, region, stateBackend, providerRegistr
9196
9215
  });
9197
9216
  } catch (err) {
9198
9217
  if (isNoReadHandlerError(err)) {
9199
- logger.debug(`${logicalId} (${resource.resourceType}): read threw with a no-READ-handler signature, reported as drift unknown — ${maskSecretsInText(err instanceof Error ? err.message : String(err), secrets)}`);
9218
+ logger.debug(`${logicalId} (${resource.resourceType}): read threw with a no-READ-handler signature, reported as drift unknown — ${maskSecretsInText(describeAwsFailure(err).detail, secrets)}`);
9200
9219
  noteReadReturned();
9201
9220
  outcomes.push({
9202
9221
  kind: "unsupported",
@@ -9219,7 +9238,7 @@ async function runDriftForStack(stackName, region, stateBackend, providerRegistr
9219
9238
  breakerTripped = true;
9220
9239
  }
9221
9240
  }
9222
- logger.warn(`${logicalId} (${resource.resourceType}): could not be compared — the read or comparison failed, so NONE of its properties were checked. ` + (trippedReadPaths.size > 0 ? "" : `cdkd goes on with the rest of this stack. `) + `${maskSecretsInText(err instanceof Error ? err.message : String(err), secrets)}`);
9241
+ logger.warn(`${logicalId} (${resource.resourceType}): could not be compared — the read or comparison failed, so NONE of its properties were checked. ` + (trippedReadPaths.size > 0 ? "" : `cdkd goes on with the rest of this stack. `) + `${maskSecretsInText(describeAwsFailure(err).detail, secrets)}`);
9223
9242
  if (breakerTripped) logger.warn(safeMsg`${5} reads in a row in this stack failed ` + safeMsg`${DRIFT_READ_PATH_LABELS[readPath]} — expired credentials, a revoked ` + "role, a permission all of them need, or a burst of throttling — so cdkd stops reading this stack's resources that way, and reports each one left as not compared. Fix the cause, or re-run if it was throttling.");
9224
9243
  if (err instanceof Error && err.stack) logger.debug(`${logicalId} (${resource.resourceType}): comparison failure detail`, maskSecretsInError(err, secrets).stack);
9225
9244
  continue;
@@ -9405,7 +9424,7 @@ async function runAccept(reports, stateBackend, stateConfig, awsClients, options
9405
9424
  logger.info(`✓ State updated for ${report.stackName} (${report.region}): ` + (acceptedResourceCount === 0 ? "0 resource(s) accepted — no drifted change was recorded, and this write carried only the positioned re-redaction." : `accepted drift on ${acceptedResourceCount} resource(s).`));
9406
9425
  } finally {
9407
9426
  await lockManager.releaseLock(report.stackName, report.region).catch((err) => {
9408
- logger.warn(`Failed to release lock for ${report.stackName} (${report.region}): ` + (err instanceof Error ? err.message : String(err)));
9427
+ logger.warn(`Failed to release lock for ${report.stackName} (${report.region}): ` + describeAwsFailure(err).detail);
9409
9428
  });
9410
9429
  }
9411
9430
  }
@@ -9808,7 +9827,7 @@ async function runRevert(reports, regionScope, stateBackend, stateConfig, awsCli
9808
9827
  stateBucket: stateConfig.bucket,
9809
9828
  statePrefix: stateConfig.prefix
9810
9829
  };
9811
- printRevertPlan(reports, out);
9830
+ printRevertPlan(reports, out, lockRecovery);
9812
9831
  if (options.dryRun) {
9813
9832
  logger.info("--dry-run: AWS will NOT be modified. Re-run without --dry-run to apply.");
9814
9833
  return;
@@ -9887,7 +9906,7 @@ async function runRevert(reports, regionScope, stateBackend, stateConfig, awsCli
9887
9906
  });
9888
9907
  } catch (err) {
9889
9908
  totalUnresolvable++;
9890
- logger.error(` ✗ ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): ` + (isDriftSecretRefusal(err) ? `refused to re-resolve a dynamic reference this resource's state records — ` : `could not re-resolve the dynamic reference(s) this resource's state records — `) + `${maskSecretsInText(err instanceof Error ? err.message : String(err), secrets)}`);
9909
+ logger.error(` ✗ ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): ` + (isDriftSecretRefusal(err) ? `refused to re-resolve a dynamic reference this resource's state records — ` : `could not re-resolve the dynamic reference(s) this resource's state records — `) + `${maskSecretsInText(describeAwsFailure(err).detail, secrets)}`);
9891
9910
  return;
9892
9911
  }
9893
9912
  const unrevertablePaths = outcome.changes.map((c) => c.path).filter((path) => (path.split(".", 1)[0] ?? "").includes("***"));
@@ -9928,7 +9947,7 @@ async function runRevert(reports, regionScope, stateBackend, stateConfig, awsCli
9928
9947
  newProperties = maskPreserved.properties;
9929
9948
  } catch (err) {
9930
9949
  totalFailed++;
9931
- logger.error(` ✗ ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): could not build the revert payload — ${maskSecretsInText(err instanceof Error ? err.message : String(err), secrets)}`);
9950
+ logger.error(` ✗ ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): could not build the revert payload — ${maskSecretsInText(describeAwsFailure(err).detail, secrets)}`);
9932
9951
  return;
9933
9952
  }
9934
9953
  try {
@@ -9949,7 +9968,7 @@ async function runRevert(reports, regionScope, stateBackend, stateConfig, awsCli
9949
9968
  if (Object.keys(delta).length > 0) narrowedByLogicalId.set(outcome.logicalId, keepBaselineAtUncertifiedPaths(redactSecretsForState(delta, secrets, revertBaseline, stateResource.observedProperties !== void 0 ? STATE_SOURCED_BASELINE_RULES : STATE_SOURCED_READBACK_RULES), [...outcome.uncertifiedPaths, ...outcome.noEchoParameterPaths ?? []], revertBaseline));
9950
9969
  }
9951
9970
  } catch (captureErr) {
9952
- logger.warn(` ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): reverted, but the provider's reported effective properties could not be read — ${maskSecretsInText(captureErr instanceof Error ? captureErr.message : String(captureErr), secrets)}`);
9971
+ logger.warn(` ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): reverted, but the provider's reported effective properties could not be read — ${maskSecretsInText(describeAwsFailure(captureErr).detail, secrets)}`);
9953
9972
  }
9954
9973
  try {
9955
9974
  if (updateResult !== void 0) {
@@ -9964,7 +9983,7 @@ async function runRevert(reports, regionScope, stateBackend, stateConfig, awsCli
9964
9983
  });
9965
9984
  }
9966
9985
  } catch (recordErr) {
9967
- logger.warn(safeMsg` ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): reverted, but the attributes the provider returned could not be recorded — ${maskSecretsInText(recordErr instanceof Error ? recordErr.message : String(recordErr), secrets)}`);
9986
+ logger.warn(safeMsg` ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): reverted, but the attributes the provider returned could not be recorded — ${maskSecretsInText(describeAwsFailure(recordErr).detail, secrets)}`);
9968
9987
  }
9969
9988
  } catch (err) {
9970
9989
  if (err instanceof ResourceUpdateNotSupportedError) {
@@ -9973,7 +9992,7 @@ async function runRevert(reports, regionScope, stateBackend, stateConfig, awsCli
9973
9992
  return;
9974
9993
  }
9975
9994
  totalFailed++;
9976
- const msg = maskSecretsInText(err instanceof Error ? err.message : String(err), secrets);
9995
+ const msg = maskSecretsInText(describeAwsFailure(err).detail, secrets);
9977
9996
  logger.error(` ✗ ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): AWS update failed — ${msg}`);
9978
9997
  }
9979
9998
  })), concurrency);
@@ -10039,12 +10058,12 @@ async function runRevert(reports, regionScope, stateBackend, stateConfig, awsCli
10039
10058
  } catch (err) {
10040
10059
  const revertAgain = revertCommandLine(report.stackName, report.region);
10041
10060
  const unrecorded = [...recordedCount > 0 ? ["the value the provider actually applied"] : [], ...reRecordedCount > 0 ? ["the identity the revert returned"] : []].join(" and ");
10042
- logger.warn(`Reverted ${report.stackName} (${report.region}), but could not record ${unrecorded}: ${err instanceof Error ? err.message : String(err)}.` + (reRecordedCount > 0 ? " The state record still holds the physical id and attributes from before the revert, which a later 'Fn::GetAtt' and 'cdkd export' read. Re-running the revert does not repair it, since the revert landed; a later deploy that updates this resource records the identity its update returns." : "") + (recordedCount > 0 ? ` The next 'cdkd drift' will report the same difference — ` + (revertAgain === void 0 ? `re-run 'cdkd drift --revert' for this stack once the state write can succeed.` : `re-run the command below once the state write can succeed.\nRevert with: ${revertAgain}`) : ""));
10061
+ logger.warn(`Reverted ${report.stackName} (${report.region}), but could not record ${unrecorded}: ${describeAwsFailure(err).detail}.` + (reRecordedCount > 0 ? " The state record still holds the physical id and attributes from before the revert, which a later 'Fn::GetAtt' and 'cdkd export' read. Re-running the revert does not repair it, since the revert landed; a later deploy that updates this resource records the identity its update returns." : "") + (recordedCount > 0 ? ` The next 'cdkd drift' will report the same difference — ` + (revertAgain === void 0 ? `re-run 'cdkd drift --revert' for this stack once the state write can succeed.` : `re-run the command below once the state write can succeed.\nRevert with: ${revertAgain}`) : ""));
10043
10062
  }
10044
10063
  }
10045
10064
  } finally {
10046
10065
  await lockManager.releaseLock(report.stackName, report.region).catch((err) => {
10047
- logger.warn(`Failed to release lock for ${report.stackName} (${report.region}): ` + (err instanceof Error ? err.message : String(err)));
10066
+ logger.warn(`Failed to release lock for ${report.stackName} (${report.region}): ` + describeAwsFailure(err).detail);
10048
10067
  });
10049
10068
  }
10050
10069
  });
@@ -10117,7 +10136,7 @@ function revertCommandLine(stackName, region) {
10117
10136
  hole: "region"
10118
10137
  }]).command} --revert`;
10119
10138
  }
10120
- function printRevertPlan(reports, out) {
10139
+ function printRevertPlan(reports, out, recovery) {
10121
10140
  for (const report of reports) {
10122
10141
  const drifted = report.outcomes.flatMap((o) => matchOutcome(o, {
10123
10142
  drifted: (d) => [d],
@@ -10156,15 +10175,20 @@ function printRevertPlan(reports, out) {
10156
10175
  const word = unbaselined.length === 1 ? "value" : "values";
10157
10176
  out.write(` ! this resource has no observed-capture baseline, so the revert pushes the raw TEMPLATE and LEAVES ${unbaselined.length} AWS-authored ${word} untouched:\n`);
10158
10177
  for (const path of unbaselined) out.write(` ${reportPath(maskSecretsInText(path, o.secrets))}\n`);
10159
- const refresh = mayNameTarget(report.stackName, report.region) ? pasteableCommand("cdkd state refresh-observed", [{
10160
- value: report.stackName,
10161
- hole: "stack"
10162
- }, {
10163
- flag: "--stack-region",
10164
- value: report.region,
10165
- hole: "region"
10166
- }]) : void 0;
10167
- out.write(" The template does not declare these, so cdkd cannot tell an AWS-authored value from an out-of-band change and will not reset either (issue #1626). " + (refresh === void 0 ? "Re-deploy if you want them reverted too; this record's identity cannot be named safely in a command, so none is offered.\n" : "Populate observedProperties with the command below, or re-deploy, if you want them reverted too.\n"));
10178
+ const refresh = mayNameTarget(report.stackName, report.region) ? pasteableCommand("cdkd state refresh-observed", [
10179
+ {
10180
+ value: report.stackName,
10181
+ hole: "stack"
10182
+ },
10183
+ {
10184
+ flag: "--stack-region",
10185
+ value: report.region,
10186
+ hole: "region"
10187
+ },
10188
+ ...accountArgs(recovery)
10189
+ ]) : void 0;
10190
+ const refreshAccountNote = refresh === void 0 ? "" : withheldAccountClause(recovery, "the command below prints").trimEnd();
10191
+ out.write(" The template does not declare these, so cdkd cannot tell an AWS-authored value from an out-of-band change and will not reset either (issue #1626). " + (refresh === void 0 ? "Re-deploy if you want them reverted too; this record's identity cannot be named safely in a command, so none is offered.\n" : `Populate observedProperties with the command below, or re-deploy, if you want them reverted too.${refreshAccountNote === "" ? "" : ` ${refreshAccountNote}`}\n`));
10168
10192
  if (refresh !== void 0) out.write(` Populate with: ${refresh.command}\n`);
10169
10193
  }
10170
10194
  }
@@ -11934,7 +11958,7 @@ var AttributeFetcher = class {
11934
11958
  value: chosen
11935
11959
  };
11936
11960
  } catch (err) {
11937
- return this.cacheFallback(orphanLogicalId, attribute, err instanceof Error ? err.message : String(err));
11961
+ return this.cacheFallback(orphanLogicalId, attribute, describeAwsFailure(err).detail);
11938
11962
  }
11939
11963
  }
11940
11964
  cacheFallback(orphanLogicalId, attribute, reason) {
@@ -12331,7 +12355,7 @@ async function orphanCommand(pathArgs, options) {
12331
12355
  logger.info(`Orphaned ${orphanLogicalIds.length} resource(s) from state: ${displayStackName(stackInfo.stackName)} (${displayIdent(targetRegion)}). AWS resources are still in AWS; cdkd will no longer manage them.`);
12332
12356
  } finally {
12333
12357
  if (!options.dryRun) await lockManager.releaseLock(stackInfo.stackName, targetRegion).catch((err) => {
12334
- logger.warn(`Failed to release lock: ${displayAwsMessage(err instanceof Error ? err.message : String(err))}`);
12358
+ logger.warn(`Failed to release lock: ${displayAwsMessage(describeAwsFailure(err).detail)}`);
12335
12359
  });
12336
12360
  }
12337
12361
  } finally {
@@ -13533,7 +13557,7 @@ async function exportCommand(stackArg, options) {
13533
13557
  }
13534
13558
  try {
13535
13559
  if (nestedStackRows.length > 0) {
13536
- const nestedStackTree = await buildCdkdStateStackTree(resolvedStackName, targetRegion, stateBackend, state);
13560
+ const nestedStackTree = await buildCdkdStateStackTree(resolvedStackName, targetRegion, stateBackend, state, lockRecovery);
13537
13561
  reportDriftBaselineGaps(state, logger, {
13538
13562
  stackName: resolvedStackName,
13539
13563
  region: migrationPending ? void 0 : targetRegion
@@ -13659,7 +13683,7 @@ async function exportCommand(stackArg, options) {
13659
13683
  logger.info(` ${preDeletedLine(entry.physicalId)}`);
13660
13684
  } catch (err) {
13661
13685
  const msg = err instanceof Error ? err.message : String(err);
13662
- const orphan = orphanCommandFor(resolvedStackName, targetRegion);
13686
+ const orphan = orphanCommandFor(resolvedStackName, targetRegion, lockRecovery);
13663
13687
  throw new Error(`Phase 1 (IMPORT) succeeded; pre-delete of ${plainOrNotShown(entry.logicalId)} (${plainOrNotShown(entry.resourceType)}, physicalId: ${recordValueOrNotShown(entry.physicalId)}) failed: ${displayAwsMessage(msg)}\n\nThe CloudFormation stack ${quotedOrNotShown(cfnStackName)} contains the phase-1 imports but the IMPORT-unsupported resources (${recreateBeforePhase2.length} total) still exist in AWS unmanaged. cdkd state is UNCHANGED. Re-running \`cdkd export\` does NOT work — the existing-stack check rejects it. To recover manually:\n 1. Fix the failure cause (typically IAM permissions for the underlying AWS API — iam:Delete{Role,User,Group}Policy for an inline policy).\n 2. Delete the remaining AWS-side IMPORT-unsupported resources by hand:\n` + preDeleteManualCommands(recreateBeforePhase2).map((line) => ` ${line}\n`).join("") + ` (one per entry in the pre-delete list logged above).
13664
13688
  3. Run the phase-2 UPDATE manually with the full synth template:
13665
13689
  ${phase2RetryCommand(cfnStackName)}\n 4. Once phase 2 succeeds, clean up cdkd's stale state record.${orphan.note}\n Run: ${orphan.command}`);
@@ -13679,7 +13703,7 @@ async function exportCommand(stackArg, options) {
13679
13703
  } catch (err) {
13680
13704
  const msg = err instanceof Error ? err.message : String(err);
13681
13705
  const recreateNote = recreateBeforePhase2.length > 0 ? ` - cdkd deleted ${recreateBeforePhase2.length} AWS resource(s) before phase 2 (Stage etc.). They are gone in AWS but absent from the CFn stack. Running phase 2 UPDATE manually will CFn-CREATE them fresh.\n` : "";
13682
- const orphan = orphanCommandFor(resolvedStackName, targetRegion);
13706
+ const orphan = orphanCommandFor(resolvedStackName, targetRegion, lockRecovery);
13683
13707
  throw new Error(`Phase 1 (IMPORT) succeeded; phase 2 (UPDATE) failed: ${displayAwsMessage(msg)}\n\nThe CloudFormation stack ${quotedOrNotShown(cfnStackName)} now contains the imported resources but is missing ${phase2Count} resource(s) (${phase2Creates.length} Custom Resource(s) + ${recreateBeforePhase2.length} IMPORT-unsupported). cdkd state is UNCHANGED so you can inspect what's in it, but DO NOT run \`cdkd deploy\` against this stack (the imported resources are now CFn-managed). To recover:\n` + recreateNote + ` 1. Fix the failure cause (typically an onCreate Lambda error).
13684
13708
  2. Re-run the phase 2 UPDATE manually with the full synth template:
13685
13709
  ${phase2RetryCommand(cfnStackName)}\n 3. Once phase 2 succeeds, clean up cdkd's stale state record.${orphan.note}\n Run: ${orphan.command}`);
@@ -13980,8 +14004,10 @@ function preDeleteListingLines(entry) {
13980
14004
  if (entry.unconfirmedPrincipals && entry.unconfirmedPrincipals.length > 0) lines.push(" phase 2 cannot be confirmed to re-attach it to " + entry.unconfirmedPrincipals.map((p) => `${p.kind} ${showRecordValue(p.name)}`).join(", ") + ": the template names its principals through a value cdkd cannot resolve");
13981
14005
  return lines;
13982
14006
  }
13983
- function orphanCommandFor(stackName, region) {
13984
- const built = pasteableCommand("cdkd state orphan", [{
14007
+ function orphanCommandFor(stackName, region, recovery) {
14008
+ const account = accountArgs(recovery);
14009
+ const accountNote = spacedAccountClause(recovery, "the next line's command prints");
14010
+ const identity = [{
13985
14011
  value: stackName,
13986
14012
  hole: "stack",
13987
14013
  opts: { plainIdent: true }
@@ -13990,16 +14016,24 @@ function orphanCommandFor(stackName, region) {
13990
14016
  value: region,
13991
14017
  hole: "region",
13992
14018
  opts: { plainIdent: true }
13993
- }]);
14019
+ }];
14020
+ const built = pasteableCommand("cdkd state orphan", identity);
13994
14021
  if (built.exact) return {
13995
- command: built.command,
13996
- note: ""
14022
+ command: pasteableCommand("cdkd state orphan", [...identity, ...account]).command,
14023
+ note: accountNote
13997
14024
  };
13998
14025
  const reasons = [orphanWithheldPart("stack name", stackName, built, "stack"), orphanWithheldPart("region", region, built, "region")].filter((part) => part !== "");
13999
14026
  const dashName = typeof stackName === "string" && stackName.startsWith("-");
14000
14027
  return {
14001
- command: `cdkd state orphan ${commandHole("stack")} --stack-region ${commandHole("region")}`,
14002
- note: ` The next line's command names neither value, because its record's ${reasons.join("; and its ")}. List the records with 'cdkd state list --json' and ` + (dashName ? "repair or remove the one whose stackName and region match by hand — this stack name begins with a '-' and could parse as an option in that position, so do not fill a hole with it." : `act on the one whose stackName and region match, replacing each quoted hole, quotes included, with ${JSON_LISTING_HOLE_VALUE}.`)
14028
+ command: pasteableCommand("cdkd state orphan", [
14029
+ { hole: "stack" },
14030
+ {
14031
+ flag: "--stack-region",
14032
+ hole: "region"
14033
+ },
14034
+ ...account
14035
+ ]).command,
14036
+ note: ` The next line's command names neither value, because its record's ${reasons.join("; and its ")}. List the records with ` + (account.length > 0 ? `'cdkd state list --json' run with the same account flags as the next line's command, and ` : `'cdkd state list --json' and `) + (dashName ? "repair or remove the one whose stackName and region match by hand — this stack name begins with a '-' and could parse as an option in that position, so do not fill a hole with it." : `act on the one whose stackName and region match, replacing each quoted hole, quotes included, with ${JSON_LISTING_HOLE_VALUE}.`) + accountNote
14003
14037
  };
14004
14038
  }
14005
14039
  function orphanWithheldPart(what, raw, built, hole) {
@@ -14020,7 +14054,7 @@ function orphanWithholdWhy(reason, positional) {
14020
14054
  default: throw new Error(`orphanWithholdWhy: unhandled WithholdReason ${String(reason)}`);
14021
14055
  }
14022
14056
  }
14023
- async function buildCdkdStateStackTree(rootStackName, region, stateBackend, prefetchedRootState) {
14057
+ async function buildCdkdStateStackTree(rootStackName, region, stateBackend, prefetchedRootState, recovery) {
14024
14058
  let rootState;
14025
14059
  if (prefetchedRootState !== void 0) rootState = prefetchedRootState;
14026
14060
  else {
@@ -14028,9 +14062,9 @@ async function buildCdkdStateStackTree(rootStackName, region, stateBackend, pref
14028
14062
  if (!rootResult) throw new Error(`No cdkd state found for stack ${quotedOrNotShown(rootStackName)} (${quotedRegion(region)}). Cannot build nested-stack tree.`);
14029
14063
  rootState = rootResult.state;
14030
14064
  }
14031
- return walkCdkdStateStackTree(rootStackName, region, rootState, stateBackend);
14065
+ return walkCdkdStateStackTree(rootStackName, region, rootState, stateBackend, recovery);
14032
14066
  }
14033
- async function walkCdkdStateStackTree(stackName, region, state, stateBackend) {
14067
+ async function walkCdkdStateStackTree(stackName, region, state, stateBackend, recovery) {
14034
14068
  const nestedChildren = /* @__PURE__ */ new Map();
14035
14069
  if (!hasReadableResources(state)) return {
14036
14070
  stackName,
@@ -14043,11 +14077,11 @@ async function walkCdkdStateStackTree(stackName, region, state, stateBackend) {
14043
14077
  const childStackName = `${stackName}~${logicalId}`;
14044
14078
  const childResult = await stateBackend.getState(childStackName, region);
14045
14079
  if (!childResult) {
14046
- const orphan = orphanCommandFor(stackName, region);
14080
+ const orphan = orphanCommandFor(stackName, region, recovery);
14047
14081
  throw new Error(`cdkd state is missing nested-child ${quotedOrNotShown(childStackName)} (${quotedRegion(region)}). Parent stack ${quotedOrNotShown(stackName)} lists ${quotedOrNotShown(logicalId)} as an ${NESTED_STACK_RESOURCE_TYPE} row but no child state file exists at ${quotedOrNotShown(`cdkd/${childStackName}/${region}/state.json`)}. The cdkd state tree is inconsistent — re-deploy the parent stack to refresh, or drop the parent's record and re-import.${orphan.note}\nDrop it with: ${orphan.command}`);
14048
14082
  }
14049
14083
  if (childResult.divergentBodyRegion !== void 0) throw new Error(`cdkd state region mismatch: nested-child ${quotedOrNotShown(childStackName)} has state.region=${quotedOrNotShown(childResult.divergentBodyRegion)} but its parent ${quotedOrNotShown(stackName)} is being walked against region=${quotedOrNotShown(region)}. AWS does not support cross-region nested stacks; the state tree appears corrupt — re-deploy the parent stack to refresh.`);
14050
- nestedChildren.set(logicalId, await walkCdkdStateStackTree(childStackName, region, childResult.state, stateBackend));
14084
+ nestedChildren.set(logicalId, await walkCdkdStateStackTree(childStackName, region, childResult.state, stateBackend, recovery));
14051
14085
  }
14052
14086
  return {
14053
14087
  stackName,
@@ -14135,7 +14169,7 @@ function indexNestedTemplatePaths(template, templateDir) {
14135
14169
  }
14136
14170
  return result;
14137
14171
  }
14138
- function buildPerStackImportNodes(rootStackName, rootTemplate, rootNestedTemplatePaths, rootTemplateFormat, tree) {
14172
+ function buildPerStackImportNodes(rootStackName, rootTemplate, rootNestedTemplatePaths, rootTemplateFormat, tree, recovery) {
14139
14173
  if (tree.stackName !== rootStackName) throw new Error(`buildPerStackImportNodes: tree root ${quotedOrNotShown(tree.stackName)} does not match expected root stack name ${quotedOrNotShown(rootStackName)}.`);
14140
14174
  const out = /* @__PURE__ */ new Map();
14141
14175
  walk(tree, rootTemplate, rootNestedTemplatePaths, rootTemplateFormat);
@@ -14151,7 +14185,7 @@ function buildPerStackImportNodes(rootStackName, rootTemplate, rootNestedTemplat
14151
14185
  for (const [childLogicalId, childNode] of node.nestedChildren) {
14152
14186
  const childTemplatePath = nodeNestedTemplatePaths[childLogicalId];
14153
14187
  if (!childTemplatePath) {
14154
- const orphan = orphanCommandFor(childNode.stackName, childNode.region);
14188
+ const orphan = orphanCommandFor(childNode.stackName, childNode.region, recovery);
14155
14189
  throw new Error(`cdkd export: nested-stack child ${quotedOrNotShown(childLogicalId)} under parent ${quotedOrNotShown(node.stackName)} has cdkd state but no Metadata['aws:asset:path'] in the parent template's ${quotedOrNotShown(childLogicalId)} row. The synth output and the cdkd state tree are out of sync — re-deploy the parent stack to refresh, or remove the cdkd state for the orphaned child.${orphan.note}\nRemove it with: ${orphan.command}`);
14156
14190
  }
14157
14191
  const { template: childTemplate, format: childFormat } = readNestedChildTemplateFile(childTemplatePath, childLogicalId);
@@ -14758,29 +14792,37 @@ function reportDriftBaselineGaps(state, logger, loaded, template, recovery) {
14758
14792
  maxCodePoints: 128
14759
14793
  }
14760
14794
  }];
14795
+ const account = accountArgs(recovery);
14796
+ const accountNote = (where) => withheldAccountClause(recovery, where);
14761
14797
  const refresh = pasteableCommand("cdkd state refresh-observed", refArgs);
14762
- const refreshCommand = region !== void 0 && refresh.exact ? refresh.command : void 0;
14798
+ const refreshCommand = region !== void 0 && refresh.exact ? pasteableCommand("cdkd state refresh-observed", [...refArgs, ...account]).command : void 0;
14799
+ const refreshNote = refreshCommand === void 0 ? "" : accountNote("the command at the end of this line prints");
14763
14800
  const refreshWithheld = region === void 0 ? "'cdkd state refresh-observed' for this stack once it is migrated: this record has no region, the legacy layout that command refuses, so migrate it first with any cdkd write, such as a deploy." : `'cdkd state refresh-observed' for this stack. The command is not printed: ${refreshWithheldReason(refresh)}`;
14764
14801
  const readable = entries.filter((entry) => isReadableResourceEntry(entry[1]));
14765
14802
  const unreadableCount = entries.length - readable.length;
14766
14803
  if (unreadableCount > 0) {
14767
14804
  const inspect = pasteableCommand("cdkd state show", refArgs);
14805
+ const inspectCommand = pasteableCommand("cdkd state show", [
14806
+ ...refArgs,
14807
+ { literal: "--json" },
14808
+ ...account
14809
+ ]).command;
14768
14810
  const unreadable = entries.filter(([, r]) => !isReadableResourceEntry(r)).map(([logicalId]) => logicalId);
14769
- logger.warn(`${unreadable.length} of ${entries.length} resource(s) in cdkd state have a record that is not readable as a resource — not an object, or carrying no resource type — so their drift baseline cannot be reported on. The state record is malformed or truncated. ` + (inspect.exact ? "" : `A quoted '<...>' hole in the command after the list below stands for a value cdkd could not ` + (stackName.startsWith("-") ? "print safely. This stack name begins with '-', which the CLI could read as an option however it is quoted, so do not fill the stack hole with it: repair or remove the record by hand. " : `print safely; fill it from 'cdkd state list --json', replacing the hole, quotes included, with ${JSON_LISTING_HOLE_VALUE}. `)) + `Inspect it with the command after the list below.`);
14811
+ logger.warn(`${unreadable.length} of ${entries.length} resource(s) in cdkd state have a record that is not readable as a resource — not an object, or carrying no resource type — so their drift baseline cannot be reported on. The state record is malformed or truncated. ` + (inspect.exact ? "" : `A quoted '<...>' hole in the command after the list below stands for a value cdkd could not ` + (stackName.startsWith("-") ? "print safely. This stack name begins with '-', which the CLI could read as an option however it is quoted, so do not fill the stack hole with it: repair or remove the record by hand. " : `print safely; fill it from 'cdkd state list --json'` + (account.length > 0 ? ` run with the same account flags as the command after the list below` : "") + `, replacing the hole, quotes included, with ${JSON_LISTING_HOLE_VALUE}. `)) + accountNote("the command after the list below prints") + `Inspect it with the command after the list below.`);
14770
14812
  for (const logicalId of unreadable.slice(0, NAMED_BASELINE_IDS)) logger.warn(` ${displayLogicalId(logicalId)}`);
14771
14813
  if (unreadable.length > NAMED_BASELINE_IDS) logger.warn(` ... and ${unreadable.length - NAMED_BASELINE_IDS} more`);
14772
- logger.warn(safeMsg`Inspect it with: ${inspect.command} --json`);
14814
+ logger.warn(safeMsg`Inspect it with: ${inspectCommand}`);
14773
14815
  }
14774
14816
  const missing = readable.filter(([, r]) => r.observedProperties === void 0);
14775
14817
  if (missing.length === 0) return;
14776
14818
  if (state.version !== void 0 && state.version < 3) {
14777
- logger.warn(`cdkd state schema is v${state.version} (pre-observedProperties). cdkd drift cannot reliably compare against AWS for this stack; the next 'cdk deploy' after migration may surface spurious changes if AWS has drifted from the ` + (unreadableCount > 0 ? `template. Repair the ${unreadableCount} unreadable record(s) named above first — 'cdkd state refresh-observed' refuses a record that holds one — then capture an AWS-current baseline before export.` : `template. Capture an AWS-current baseline before export — any redeploy does ` + (refreshCommand !== void 0 ? `it, or run: ${refreshCommand}` : `it, or run ${refreshWithheld}`)));
14819
+ logger.warn(`cdkd state schema is v${state.version} (pre-observedProperties). cdkd drift cannot reliably compare against AWS for this stack; the next 'cdk deploy' after migration may surface spurious changes if AWS has drifted from the ` + (unreadableCount > 0 ? `template. Repair the ${unreadableCount} unreadable record(s) named above first — 'cdkd state refresh-observed' refuses a record that holds one — then capture an AWS-current baseline before export.` : `template. ${refreshNote}Capture an AWS-current baseline before export — any redeploy does ` + (refreshCommand !== void 0 ? `it, or run: ${refreshCommand}` : `it, or run ${refreshWithheld}`)));
14778
14820
  return;
14779
14821
  }
14780
14822
  const refused = missing.filter(([, r]) => r.observedBaselineRefused === true);
14781
14823
  const refreshable = missing.filter(([, r]) => r.observedBaselineRefused !== true);
14782
14824
  if (refreshable.length > 0) {
14783
- logger.warn(`${refreshable.length} of ${entries.length} resource(s) in cdkd state lack an AWS-current baseline (observedProperties). cdkd drift may produce false positives for them; the next 'cdk deploy' after migration may surface unexpected changes. ` + (unreadableCount > 0 ? `Repair the ${unreadableCount} unreadable record(s) named above first — 'cdkd state refresh-observed' refuses a record that holds one. Then capture a baseline and run 'cdkd drift' to verify the stack matches AWS.` : refreshCommand !== void 0 ? `Capture a baseline before export, then run 'cdkd drift' to verify the stack matches AWS, with: ${refreshCommand}` : `Capture a baseline before export with ${refreshWithheld} Then run 'cdkd drift' to verify the stack matches AWS.`));
14825
+ logger.warn(`${refreshable.length} of ${entries.length} resource(s) in cdkd state lack an AWS-current baseline (observedProperties). cdkd drift may produce false positives for them; the next 'cdk deploy' after migration may surface unexpected changes. ` + (unreadableCount > 0 ? `Repair the ${unreadableCount} unreadable record(s) named above first — 'cdkd state refresh-observed' refuses a record that holds one. Then capture a baseline and run 'cdkd drift' to verify the stack matches AWS.` : refreshCommand !== void 0 ? `${refreshNote}Capture a baseline before export, then run 'cdkd drift' to verify the stack matches AWS, with: ${refreshCommand}` : `Capture a baseline before export with ${refreshWithheld} Then run 'cdkd drift' to verify the stack matches AWS.`));
14784
14826
  for (const [logicalId] of refreshable.slice(0, NAMED_BASELINE_IDS)) logger.warn(` ${displayLogicalId(logicalId)}`);
14785
14827
  if (refreshable.length > NAMED_BASELINE_IDS) logger.warn(` ... and ${refreshable.length - NAMED_BASELINE_IDS} more`);
14786
14828
  }
@@ -15265,7 +15307,7 @@ async function runPerStackImportLoop(args) {
15265
15307
  if (cdkdName === rootStackName) return cfnStackNameOverrides.root ?? cdkd2cfnStackName(cdkdName);
15266
15308
  return cfnStackNameOverrides.childMap.get(cdkdName) ?? cdkd2cfnStackName(cdkdName);
15267
15309
  };
15268
- const nodesByCdkdName = buildPerStackImportNodes(rootStackName, rootTemplate, rootStackInfoNestedTemplates, rootTemplateFormat, tree);
15310
+ const nodesByCdkdName = buildPerStackImportNodes(rootStackName, rootTemplate, rootStackInfoNestedTemplates, rootTemplateFormat, tree, args.lockRecovery);
15269
15311
  const leafFirst = flattenCdkdStateTreeLeafFirst(tree);
15270
15312
  for (const n of leafFirst) if (!nodesByCdkdName.has(n.stackName)) throw new Error(`runPerStackImportLoop: missing per-stack template for ${quotedOrNotShown(n.stackName)} — tree node has cdkd state but no synth template was loaded. This is a cdkd bug.`);
15271
15313
  for (const n of leafFirst) {
@@ -15402,7 +15444,7 @@ async function runPerStackImportLoop(args) {
15402
15444
  const completed = perStackPlans.slice(0, i);
15403
15445
  const notYetImported = perStackPlans.slice(i + 1).map((p) => quotedOrNotShown(p.cdkdName)).join(", ");
15404
15446
  const orphanLines = (plans) => plans.map((p) => {
15405
- const orphan = orphanCommandFor(p.cdkdName, p.region);
15447
+ const orphan = orphanCommandFor(p.cdkdName, p.region, args.lockRecovery);
15406
15448
  const target = isPasteableIdent(p.cfnName) ? `CloudFormation stack ${p.cfnName}` : "a CloudFormation stack whose name is not a plain identifier";
15407
15449
  return `${orphan.note ? `\n For the record targeting ${target}:${orphan.note}` : ""}\n ${orphan.command}`;
15408
15450
  }).join("");
@@ -15543,12 +15585,19 @@ async function runPerStackImportLoop(args) {
15543
15585
  region: node.region,
15544
15586
  reason: err instanceof Error ? err.message : String(err)
15545
15587
  });
15546
- const orphan = orphanCommandFor(node.stackName, node.region);
15588
+ const orphan = orphanCommandFor(node.stackName, node.region, args.lockRecovery);
15547
15589
  logger.warn(`Failed to delete cdkd state for ${quotedOrNotShown(node.stackName)} (${quotedRegion(node.region)}): ${safeDetail(err)}. The stack IS CFn-managed; clean up its state record.${orphan.note}\nClean up with: ${orphan.command}`);
15548
15590
  }
15549
15591
  if (stateDeletionFailures.length > 0) {
15550
15592
  const lines = stateDeletionFailures.map((f) => ` - ${quotedOrNotShown(`cdkd/${f.stackName}/${f.region}/state.json`)}: ${safeDetail(f.reason)}`).join("\n");
15551
- throw new Error(`${stateDeletionFailures.length} cdkd state record(s) could not be deleted after a successful per-stack IMPORT loop. Every stack in the tree IS CFn-managed (the migration succeeded AWS-side); orphan state remains under:\n${lines}\nRecover with the command below, once per record.\nRecover with: cdkd state orphan ${commandHole("stack")} --stack-region ${commandHole("region")}`);
15593
+ throw new Error(`${stateDeletionFailures.length} cdkd state record(s) could not be deleted after a successful per-stack IMPORT loop. Every stack in the tree IS CFn-managed (the migration succeeded AWS-side); orphan state remains under:\n${lines}\nRecover with the command below, once per record.` + spacedAccountClause(args.lockRecovery, "the command below prints") + `\nRecover with: ${pasteableCommand("cdkd state orphan", [
15594
+ { hole: "stack" },
15595
+ {
15596
+ flag: "--stack-region",
15597
+ hole: "region"
15598
+ },
15599
+ ...accountArgs(args.lockRecovery)
15600
+ ]).command}`);
15552
15601
  }
15553
15602
  if (sessionIntrinsicSkipped.size > 0) {
15554
15603
  const detail = [...sessionIntrinsicSkipped.entries()].map(([cdkdName, params]) => `${quotedOrNotShown(cdkdName)} (${params.map((n) => quotedOrNotShown(n)).join(", ")})`).join("; ");
@@ -15734,6 +15783,10 @@ function replaceAtCoordinate(node, coordinate, replacement) {
15734
15783
  }
15735
15784
  return node;
15736
15785
  }
15786
+ function spacedAccountClause(recovery, where) {
15787
+ const clause = withheldAccountClause(recovery, where).trimEnd();
15788
+ return clause === "" ? "" : ` ${clause}`;
15789
+ }
15737
15790
 
15738
15791
  //#endregion
15739
15792
  //#region src/cli/commands/state.ts
@@ -16099,7 +16152,7 @@ async function stateShowCommand(stackName, options) {
16099
16152
  const [stateResult, lockInfo] = await Promise.all([setup.stateBackend.getState(stackName, ref.region), setup.lockManager.getLockInfo(stackName, ref.region)]);
16100
16153
  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.`);
16101
16154
  if (options.showNested) {
16102
- const treeWithLocks = await loadLocksForTree(await buildCdkdStateStackTree(stackName, ref.region, setup.stateBackend, stateResult.state), setup.lockManager, lockInfo);
16155
+ const treeWithLocks = await loadLocksForTree(await buildCdkdStateStackTree(stackName, ref.region, setup.stateBackend, stateResult.state, renderRecovery(options, setup)), setup.lockManager, lockInfo);
16103
16156
  if (options.json) {
16104
16157
  warnUnreadableTreeNodes(treeWithLocks, logger, renderRecovery(options, setup));
16105
16158
  process.stdout.write(`${stringifyJsonPayload(treeToShowJson(treeWithLocks))}\n`);
@@ -16473,7 +16526,7 @@ async function stateOrphanResources(stackName, requested, options) {
16473
16526
  logger.info(safeMsg`✓ Removed ${logicalIds.length} resource record(s) from state: ${idList} ` + safeMsg`(${describedStackRef(ref)}). AWS resources are still in AWS; cdkd will no longer manage them.`);
16474
16527
  } finally {
16475
16528
  await setup.lockManager.releaseLock(stackName, region).catch((err) => {
16476
- logger.warn(safeMsg`Failed to release lock: ${displayAwsMessage(err instanceof Error ? err.message : String(err))}`);
16529
+ logger.warn(safeMsg`Failed to release lock: ${displayAwsMessage(describeAwsFailure(err).detail)}`);
16477
16530
  });
16478
16531
  }
16479
16532
  } finally {
@@ -17069,7 +17122,7 @@ async function refreshObservedForStack(stackName, region, stateBackend, lockMana
17069
17122
  refreshed++;
17070
17123
  } catch (err) {
17071
17124
  failed++;
17072
- logger.warn(safeMsg` ✗ ${displayStackName(stackName)}/${displayIdent(logicalId)} ` + safeMsg`(${displayIdent(resource.resourceType)}): ` + safeMsg`readCurrentState failed — ${err instanceof Error ? err.message : String(err)}`);
17125
+ logger.warn(safeMsg` ✗ ${displayStackName(stackName)}/${displayIdent(logicalId)} ` + safeMsg`(${displayIdent(resource.resourceType)}): ` + safeMsg`readCurrentState failed — ${describeAwsFailure(err).detail}`);
17073
17126
  }
17074
17127
  });
17075
17128
  await Promise.all(tasks);
@@ -17090,7 +17143,7 @@ async function refreshObservedForStack(stackName, region, stateBackend, lockMana
17090
17143
  };
17091
17144
  } finally {
17092
17145
  await lockManager.releaseLock(stackName, region).catch((err) => {
17093
- logger.warn(safeMsg`Failed to release lock for ${ref}: ${err instanceof Error ? err.message : String(err)}`);
17146
+ logger.warn(safeMsg`Failed to release lock for ${ref}: ${describeAwsFailure(err).detail}`);
17094
17147
  });
17095
17148
  }
17096
17149
  }
@@ -17398,7 +17451,7 @@ async function rollbackCommand(stackArg, options) {
17398
17451
  }
17399
17452
  logger.info("");
17400
17453
  if (!skipConfirmation) {
17401
- if (!await confirm(`Roll back ${stackRegionShown(stackName, region)}` + (options.removeProtection === true ? ", TURNING DELETION PROTECTION OFF on the resources it deletes from this stack?" : "?"))) {
17454
+ if (!await confirm(`Roll back ${stackRegionShown(stackName, region)}` + (options.removeProtection === true ? ", TURNING DELETION PROTECTION OFF on the resources it deletes from this stack and the nested stacks it reverts?" : "?"))) {
17402
17455
  logger.info("Rollback cancelled");
17403
17456
  return;
17404
17457
  }
@@ -17491,7 +17544,8 @@ async function rollbackCommand(stackArg, options) {
17491
17544
  destroyOptions: {
17492
17545
  ...options.profile && { profile: options.profile },
17493
17546
  statePrefix: options.statePrefix,
17494
- ...options.skipFinalSnapshot === true && { skipFinalSnapshot: true }
17547
+ ...options.skipFinalSnapshot === true && { skipFinalSnapshot: true },
17548
+ ...options.removeProtection === true && { removeProtection: true }
17495
17549
  }
17496
17550
  }, () => withNestedRevertRun(segment.runId, (run) => {
17497
17551
  nestedRun = run;
@@ -17687,7 +17741,7 @@ function applyFailedPlanToPreview(plan, previewState, skipFinalSnapshot) {
17687
17741
  }
17688
17742
  }
17689
17743
  function createRollbackCommand() {
17690
- const cmd = new Command("rollback").description("Revert a stack to its pre-deploy state after a failed --no-rollback / interrupted deploy or a partially-failed automatic rollback (state-driven, no synth needed).").argument("[stack]", "Stack name to roll back (defaults to the single journaled stack)").addOption(new Option("--force", "Skip the confirmation prompt").default(false)).addOption(new Option("--orphan <logicalId>", "Skip the given resource during replay (repeatable). Mirrors cdk rollback --orphan.").argParser((value, previous) => [...previous ?? [], value])).addOption(new Option("--revert-failed", "Also attempt to revert the resource whose operation FAILED mid-deploy. Off by default: the remote state of the failed resource is unknown, so force-applying its previous state is opt-in.").default(false)).addOption(new Option("--drop-failed <logicalId>", "Remove ONE journaled failed CREATE (a resource cdkd proved it made, journaled as its only record) from the rollback journal, after checking that resource by hand. Replays nothing and deletes nothing in AWS; every other entry is kept.")).addOption(skipFinalSnapshotOption).addOption(new Option("--remove-protection", `Turn deletion protection off before this stack's rollback deletes a resource the failed deploy left: one its state records from a completed CREATE, or one a failed CREATE left behind (a journaled orphan, or under --revert-failed the failed CREATE itself) when cdkd can prove it is that resource and no other stack holds it. A nested stack it deletes cascades the flag to that child's resources; a resource reverted inside an existing nested stack keeps its protection. Covers ${removeProtectionTypeList()}.`).default(false)).addOption(stackRegionOption()).addHelpText("after", [
17744
+ const cmd = new Command("rollback").description("Revert a stack to its pre-deploy state after a failed --no-rollback / interrupted deploy or a partially-failed automatic rollback (state-driven, no synth needed).").argument("[stack]", "Stack name to roll back (defaults to the single journaled stack)").addOption(new Option("--force", "Skip the confirmation prompt").default(false)).addOption(new Option("--orphan <logicalId>", "Skip the given resource during replay (repeatable). Mirrors cdk rollback --orphan.").argParser((value, previous) => [...previous ?? [], value])).addOption(new Option("--revert-failed", "Also attempt to revert the resource whose operation FAILED mid-deploy. Off by default: the remote state of the failed resource is unknown, so force-applying its previous state is opt-in.").default(false)).addOption(new Option("--drop-failed <logicalId>", "Remove ONE journaled failed CREATE (a resource cdkd proved it made, journaled as its only record) from the rollback journal, after checking that resource by hand. Replays nothing and deletes nothing in AWS; every other entry is kept.")).addOption(skipFinalSnapshotOption).addOption(new Option("--remove-protection", `Turn deletion protection off before this stack's rollback deletes a resource the failed deploy left: one its state records from a completed CREATE, or one a failed CREATE left behind (a journaled orphan, or under --revert-failed the failed CREATE itself) when cdkd can prove it is that resource and no other stack holds it. A nested stack it deletes cascades the flag to that child's resources, and a nested stack it reverts carries it into that child's revert. Covers ${removeProtectionTypeList()}.`).default(false)).addOption(stackRegionOption()).addHelpText("after", [
17691
17745
  "",
17692
17746
  "Examples:",
17693
17747
  " cdkd rollback MyStack",
@@ -18457,12 +18511,12 @@ async function gcCommand(options) {
18457
18511
  try {
18458
18512
  await stateBackend.deleteRawObjects(responseCandidates.map((c) => c.key));
18459
18513
  } catch (deleteError) {
18460
- throw new CdkdError(`Failed to delete abandoned custom-resource response placeholder(s) from ${bucketName}: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`, "GC_DELETE_FAILED");
18514
+ throw new CdkdError(`Failed to delete abandoned custom-resource response placeholder(s) from ${bucketName}: ${describeAwsFailure(deleteError).detail}`, "GC_DELETE_FAILED");
18461
18515
  } finally {
18462
18516
  await stateBackend.purgeNoncurrentVersions(responseCandidates.map((c) => c.key), {
18463
18517
  listPrefix: `${CUSTOM_RESOURCE_RESPONSE_PREFIX}/`,
18464
18518
  objectDescription: CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION
18465
- }).catch((purgeError) => logger.warn(`Could not purge noncurrent versions of the collected custom-resource response placeholder(s) in ${bucketName}; their previous versions survive and remain readable via GetObject with a VersionId. Underlying error: ${purgeError instanceof Error ? purgeError.message : String(purgeError)}`));
18519
+ }).catch((purgeError) => logger.warn(`Could not purge noncurrent versions of the collected custom-resource response placeholder(s) in ${bucketName}; their previous versions survive and remain readable via GetObject with a VersionId. Underlying error: ${describeAwsFailure(purgeError).detail}`));
18466
18520
  }
18467
18521
  logger.info(`✓ Deleted ${responseCandidates.length} abandoned custom-resource response placeholder(s) (${formatBytes(responseBytes)}) from ${bucketName}`);
18468
18522
  }
@@ -18720,7 +18774,7 @@ async function forceUnlockCommand(stackArgs, options) {
18720
18774
  await lockManager.forceReleaseLock(stackName, r);
18721
18775
  logger.info(`✓ Lock released for stack: ${where}`);
18722
18776
  } catch (error) {
18723
- const message = error instanceof Error ? error.message : String(error);
18777
+ const message = describeAwsFailure(error).detail;
18724
18778
  if (message.includes("No lock found") || message.includes("NoSuchKey")) logger.info(`No lock found for stack: ${where}`);
18725
18779
  else {
18726
18780
  const detail = displaySafe(message, { asciiOnly: true }) || "<unrenderable>";
@@ -19079,7 +19133,7 @@ async function importCommand(stackArg, options) {
19079
19133
  }
19080
19134
  } finally {
19081
19135
  await lockManager.releaseLock(stackInfo.stackName, targetRegion).catch((err) => {
19082
- logger.warn(`Failed to release lock: ${err instanceof Error ? err.message : String(err)}`);
19136
+ logger.warn(`Failed to release lock: ${describeAwsFailure(err).detail}`);
19083
19137
  });
19084
19138
  }
19085
19139
  } finally {
@@ -19104,7 +19158,7 @@ async function recordImportOnRollbackJournal(stateBackend, stackName, region, lo
19104
19158
  try {
19105
19159
  marked = await stateBackend.markRollbackJournalImported(stackName, region, marks);
19106
19160
  } catch (error) {
19107
- throw new Error(`Could not record this import on the rollback journal of ${stackShown(stackName)}, so state was NOT written: a later cdkd rollback could otherwise delete what was imported. Cause: ${displaySafe(error instanceof Error ? error.message : String(error))}`);
19161
+ throw new Error(`Could not record this import on the rollback journal of ${stackShown(stackName)}, so state was NOT written: a later cdkd rollback could otherwise delete what was imported. Cause: ${displaySafe(describeAwsFailure(error).detail)}`);
19108
19162
  }
19109
19163
  if (marked.length > 0) logger.info(safeMsg` The rollback journal of ${stackShown(stackName)} records ` + safeMsg`${marked.map((id) => logicalIdShown(id)).join(", ")} as imported: ` + "cdkd rollback leaves those resources as they are.");
19110
19164
  }
@@ -19276,7 +19330,8 @@ async function importOne(task) {
19276
19330
  outcome: "skipped-no-impl",
19277
19331
  reason: "no provider registered"
19278
19332
  };
19279
- const provider = providerRegistry.getProvider(resource.Type);
19333
+ const route = providerRegistry.getProviderFor({ resourceType: resource.Type });
19334
+ const provider = route.provider;
19280
19335
  if (!provider.import) return {
19281
19336
  logicalId,
19282
19337
  resourceType: resource.Type,
@@ -19305,10 +19360,11 @@ async function importOne(task) {
19305
19360
  resourceType: resource.Type,
19306
19361
  outcome: "imported",
19307
19362
  physicalId: result.physicalId,
19308
- ...result.attributes !== void 0 && { attributes: result.attributes }
19363
+ ...result.attributes !== void 0 && { attributes: result.attributes },
19364
+ provisionedBy: route.provisionedBy
19309
19365
  };
19310
19366
  } catch (error) {
19311
- const msg = error instanceof Error ? error.message : String(error);
19367
+ const msg = describeAwsFailure(error).detail;
19312
19368
  logger.error(`Failed to import ${logicalIdShown(logicalId)} (${resourceTypeShown(resource.Type)}): ${msg}`);
19313
19369
  return {
19314
19370
  logicalId,
@@ -19448,7 +19504,7 @@ function buildStackState(stackName, region, rows, templateParser, template, exis
19448
19504
  deletionPolicy: tmplResource.DeletionPolicy,
19449
19505
  updateReplacePolicy: tmplResource.UpdateReplacePolicy,
19450
19506
  ...constructPathField(constructPathOf(template, row.logicalId)),
19451
- provisionedBy: "sdk",
19507
+ provisionedBy: row.provisionedBy ?? "sdk",
19452
19508
  ...prior && prior.physicalId === row.physicalId && (hasUnverifiableParameterRefusal(prior) || hasReasonlessBaselineRefusal(prior) && (namesParameter ??= resourcesNamingDeclaredParameter(template))(row.logicalId)) && {
19453
19509
  observedBaselineRefused: true,
19454
19510
  observedBaselineRefusalReason: "unverifiable-parameter"
@@ -19487,12 +19543,12 @@ async function resolveImportedProperties(stackState, template, region, stateBack
19487
19543
  try {
19488
19544
  parameters = await resolver.resolveParameters(template);
19489
19545
  } catch (err) {
19490
- logger.debug(`Template parameter resolution failed during import-time property resolution: ${err instanceof Error ? err.message : String(err)} — retrying with the template's 'Default'-carrying parameters only; resources referencing an unbindable parameter will still be skipped per-resource.`);
19546
+ logger.debug(`Template parameter resolution failed during import-time property resolution: ${describeAwsFailure(err).detail} — retrying with the template's 'Default'-carrying parameters only; resources referencing an unbindable parameter will still be skipped per-resource.`);
19491
19547
  try {
19492
19548
  parameters = await resolver.resolveParameters(defaultOnlyParameterTemplate(template));
19493
19549
  } catch (defaultsErr) {
19494
19550
  parameters = {};
19495
- logger.debug(`'Default'-only template parameter resolution also failed during import-time property resolution: ${defaultsErr instanceof Error ? defaultsErr.message : String(defaultsErr)} — continuing without parameters; resources referencing them will be skipped per-resource.`);
19551
+ logger.debug(`'Default'-only template parameter resolution also failed during import-time property resolution: ${describeAwsFailure(defaultsErr).detail} — continuing without parameters; resources referencing them will be skipped per-resource.`);
19496
19552
  }
19497
19553
  }
19498
19554
  try {
@@ -19502,7 +19558,7 @@ async function resolveImportedProperties(stackState, template, region, stateBack
19502
19558
  parameters
19503
19559
  });
19504
19560
  } catch (err) {
19505
- logger.debug(`Template condition evaluation failed during import-time property resolution: ${err instanceof Error ? err.message : String(err)} — continuing without conditions.`);
19561
+ logger.debug(`Template condition evaluation failed during import-time property resolution: ${describeAwsFailure(err).detail} — continuing without conditions.`);
19506
19562
  }
19507
19563
  const unboundParameterNames = Object.keys(template.Parameters ?? {}).filter((name) => isUnboundTemplateParameter(name, template, parameters));
19508
19564
  let divergentParameters;
@@ -19544,7 +19600,7 @@ async function resolveImportedProperties(stackState, template, region, stateBack
19544
19600
  });
19545
19601
  resource.properties = recordedSecretValues.size > 0 ? redactSecretsForState(markSameGenerationBag(resolved), recordedSecretValues, unresolvedProperties) : resolved;
19546
19602
  } catch (err) {
19547
- logger.warn(`Failed to resolve intrinsics in Properties for imported resource ${logicalIdShown(logicalId)} (${resourceTypeShown(resource.resourceType)}): ${maskSecretsInText(err instanceof Error ? err.message : String(err), recordedSecretValues)}.\nState will be written with the raw intrinsic shape, which may cause 'cdkd destroy' to fail on this resource — re-import once every referenced sibling is in state, or remove this resource from state with 'cdkd orphan <StackPath>/<Path/To/Resource>'.` + (unboundParameterNames.length > 0 ? ` This template also declares parameter(s) with no 'Default' that an import cannot bind (${unboundParameterNames.map((name) => plainOrDescribed(name, "parameter name")).join(", ")}), and 'cdkd import' accepts no parameter values — if this property was built from one of those, re-importing a sibling will not change it: give the parameter a 'Default' in the template and re-import, or correct the recorded properties before the next 'cdkd deploy'.` : ""));
19603
+ logger.warn(`Failed to resolve intrinsics in Properties for imported resource ${logicalIdShown(logicalId)} (${resourceTypeShown(resource.resourceType)}): ${maskSecretsInText(describeAwsFailure(err).detail, recordedSecretValues)}.\nState will be written with the raw intrinsic shape, which may cause 'cdkd destroy' to fail on this resource — re-import once every referenced sibling is in state, or remove this resource from state with 'cdkd orphan <StackPath>/<Path/To/Resource>'.` + (unboundParameterNames.length > 0 ? ` This template also declares parameter(s) with no 'Default' that an import cannot bind (${unboundParameterNames.map((name) => plainOrDescribed(name, "parameter name")).join(", ")}), and 'cdkd import' accepts no parameter values — if this property was built from one of those, re-importing a sibling will not change it: give the parameter a 'Default' in the template and re-import, or correct the recorded properties before the next 'cdkd deploy'.` : ""));
19548
19604
  threw = true;
19549
19605
  }
19550
19606
  if (recordedSecretValues.size > 0 && resource.attributes !== void 0) resource.attributes = redactSecretsForState(resource.attributes, recordedSecretValues);
@@ -19828,7 +19884,7 @@ async function importNestedStackChildrenRecursive(args) {
19828
19884
  });
19829
19885
  } finally {
19830
19886
  await lockManager.releaseLock(childStackName, childRegion).catch((err) => {
19831
- logger.warn(`Failed to release lock for nested stack '${childStackName}' (${childRegion}): ${err instanceof Error ? err.message : String(err)}`);
19887
+ logger.warn(`Failed to release lock for nested stack '${childStackName}' (${childRegion}): ${describeAwsFailure(err).detail}`);
19832
19888
  });
19833
19889
  }
19834
19890
  }
@@ -27278,4 +27334,4 @@ function collectVerbFlags(program) {
27278
27334
 
27279
27335
  //#endregion
27280
27336
  export { canonicalizeIpProtocolValue as a, buildProgram, resolveSecretDerivedPrincipals as i, runDestroyForStack as n, resolvedResourceTimeoutMs as o, isResolvableSecretPrincipalList as r, canonicalizeIpv4Cidr as t };
27281
- //# sourceMappingURL=program-1S4fU3m4.js.map
27337
+ //# sourceMappingURL=program-CqKPsOUR.js.map