@cdkd/cli 0.372.0 → 0.373.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ambient-client-defaults-B9_o60dB.js → ambient-client-defaults-BLKND30a.js} +3 -3
- package/dist/{ambient-client-defaults-B9_o60dB.js.map → ambient-client-defaults-BLKND30a.js.map} +1 -1
- package/dist/{asg-provider-D6gQPSZu.js → asg-provider-DXL1CE4m.js} +8 -8
- package/dist/{asg-provider-D6gQPSZu.js.map → asg-provider-DXL1CE4m.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{created-resource-sink-CxezDoaQ.js → created-resource-sink-DlVo2nqB.js} +4 -4
- package/dist/{created-resource-sink-CxezDoaQ.js.map → created-resource-sink-DlVo2nqB.js.map} +1 -1
- package/dist/{custom-resource-runtime-BiP0vn3W.js → custom-resource-runtime-DK4-5kRC.js} +6 -6
- package/dist/{custom-resource-runtime-BiP0vn3W.js.map → custom-resource-runtime-DK4-5kRC.js.map} +1 -1
- package/dist/{db-associated-roles-BfvrD9UK.js → db-associated-roles-zv71gI1O.js} +2 -2
- package/dist/{db-associated-roles-BfvrD9UK.js.map → db-associated-roles-zv71gI1O.js.map} +1 -1
- package/dist/{delete-started-BtXSEHsh.js → delete-started-E38sSyUX.js} +4 -4
- package/dist/{delete-started-BtXSEHsh.js.map → delete-started-E38sSyUX.js.map} +1 -1
- package/dist/{deploy-engine-D6iEbD4R.js → deploy-engine-BDueF79_.js} +5524 -2511
- package/dist/deploy-engine-BDueF79_.js.map +1 -0
- package/dist/{ec2-termination-protection-DXZyU3Q0.js → ec2-termination-protection-DI-aPxET.js} +3 -3
- package/dist/{ec2-termination-protection-DXZyU3Q0.js.map → ec2-termination-protection-DI-aPxET.js.map} +1 -1
- package/dist/{ecr-uri-C0JbYdmm.js → ecr-uri-kW_K5U02.js} +2 -2
- package/dist/{ecr-uri-C0JbYdmm.js.map → ecr-uri-kW_K5U02.js.map} +1 -1
- package/dist/{emr-cluster-provider-BCu1qq9J.js → emr-cluster-provider-BcqnxYsN.js} +10 -10
- package/dist/{emr-cluster-provider-BCu1qq9J.js.map → emr-cluster-provider-BcqnxYsN.js.map} +1 -1
- package/dist/{expected-bucket-owner-C2OXO5oD.js → expected-bucket-owner-j5BCLzAB.js} +2 -2
- package/dist/{expected-bucket-owner-C2OXO5oD.js.map → expected-bucket-owner-j5BCLzAB.js.map} +1 -1
- package/dist/{iam-role-provider-DFBJRsvA.js → iam-role-provider-BlUbRjQo.js} +12 -12
- package/dist/{iam-role-provider-DFBJRsvA.js.map → iam-role-provider-BlUbRjQo.js.map} +1 -1
- package/dist/{identity-read-denied-C17mECu-.js → identity-read-denied-BhnkMyxk.js} +5 -5
- package/dist/{identity-read-denied-C17mECu-.js.map → identity-read-denied-BhnkMyxk.js.map} +1 -1
- package/dist/{image-plan-sEIpoR31.js → image-plan-CUvO0Qe2.js} +10 -9
- package/dist/image-plan-CUvO0Qe2.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{logger-BoDS8cs5.js → logger-B673mhBe.js} +2 -2
- package/dist/{logger-BoDS8cs5.js.map → logger-B673mhBe.js.map} +1 -1
- package/dist/{neptune-provider-CL5WtULJ.js → neptune-provider-BOIjF_i3.js} +9 -9
- package/dist/{neptune-provider-CL5WtULJ.js.map → neptune-provider-BOIjF_i3.js.map} +1 -1
- package/dist/{program-BBXUa34K.js → program-avOxa_7W.js} +385 -1111
- package/dist/program-avOxa_7W.js.map +1 -0
- package/dist/{provider-classes-BiWcIBLc.js → provider-classes-BMrkl7zN.js} +22 -22
- package/dist/{provider-classes-BiWcIBLc.js.map → provider-classes-BMrkl7zN.js.map} +1 -1
- package/dist/{rds-provider--XBD_TS8.js → rds-provider-DD8ka8NG.js} +13 -13
- package/dist/{rds-provider--XBD_TS8.js.map → rds-provider-DD8ka8NG.js.map} +1 -1
- package/dist/{read-replica-apcXpKN9.js → read-replica-Ddvkib9A.js} +3 -3
- package/dist/{read-replica-apcXpKN9.js.map → read-replica-Ddvkib9A.js.map} +1 -1
- package/dist/{redacted-delete-address-S_A40Diz.js → redacted-delete-address-CkcTwr-O.js} +4 -4
- package/dist/{redacted-delete-address-S_A40Diz.js.map → redacted-delete-address-CkcTwr-O.js.map} +1 -1
- package/dist/{replacement-rules-BArdRPgU.js → replacement-rules-BkUZIP44.js} +2166 -1663
- package/dist/replacement-rules-BkUZIP44.js.map +1 -0
- package/dist/{resource-deadline-DWvjidOS.js → resource-deadline-B2z0yyKo.js} +2 -2
- package/dist/{resource-deadline-DWvjidOS.js.map → resource-deadline-B2z0yyKo.js.map} +1 -1
- package/dist/{restore-source-guard-k9BQAviV.js → restore-source-guard-1UD7ucv5.js} +4 -4
- package/dist/{restore-source-guard-k9BQAviV.js.map → restore-source-guard-1UD7ucv5.js.map} +1 -1
- package/dist/{run-cli-DEVVmR3v.js → run-cli-Dm2l-FUd.js} +2 -2
- package/dist/{run-cli-DEVVmR3v.js.map → run-cli-Dm2l-FUd.js.map} +1 -1
- package/dist/{secret-reference-immutable-0mb2D0J5.js → secret-reference-immutable-Bk60ZfqH.js} +17 -8
- package/dist/{secret-reference-immutable-0mb2D0J5.js.map → secret-reference-immutable-Bk60ZfqH.js.map} +1 -1
- package/dist/{settle-own-write-members-DPTK_vVK.js → settle-own-write-members-YQxWAEvB.js} +11 -98
- package/dist/settle-own-write-members-YQxWAEvB.js.map +1 -0
- package/dist/{tag-list-B19O4m3W.js → tag-list-C8pMq_W3.js} +4 -4
- package/dist/{tag-list-B19O4m3W.js.map → tag-list-C8pMq_W3.js.map} +1 -1
- package/dist/{version-Byf_RTiH.js → version-D2qdiEuf.js} +2 -2
- package/dist/{version-Byf_RTiH.js.map → version-D2qdiEuf.js.map} +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-D6iEbD4R.js.map +0 -1
- package/dist/image-plan-sEIpoR31.js.map +0 -1
- package/dist/program-BBXUa34K.js.map +0 -1
- package/dist/replacement-rules-BArdRPgU.js.map +0 -1
- package/dist/settle-own-write-members-DPTK_vVK.js.map +0 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { A as displayStackName, C as STACK_REF_MAX_CODE_POINTS, D as displayAwsMessage, E as cutMarker, F as stringifyJsonPayload, I as terminalSafe, L as truncateCodePoints, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, T as asIsMessage, _ as shellQuote, b as setPasteableVerbFlags, c as deployReplaceCommand, d as pasteableCommand, g as shellBoundedDisplay, h as quotedOrDescribed, i as SHELL_ACTIVE_WHY, j as isPasteableIdent, k as displaySafe, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, t as getCdkdVersion, u as isInertUnquoted, v as withheldTargetClause, w as UNRENDERABLE, x as SAFE_MSG_ALTERED_CHAR, y as setPasteableRunFlags } from "./version-
|
|
2
|
-
import { $ as renderStacksNoLongerSelected, $t as contextOptions, A as followContainerLogs, At as namedEnvAwsRegion, B as resolveRuntimeCodeMountPath, Bt as regionNeedsReconciliation, C as waitForRieReady, Cn as
|
|
3
|
-
import { $t as buildLockContentionMessage, At as resourceTypeShown, C as VALUE_NOT_SHOWN, It as maskDeep, M as remedyLogicalId, Ot as logicalIdShown, P as isMarkedNotGone, Q as runDeleteAttempt, Qt as buildForceUnlockCommand, St as isInterruptedWaitError, Zt as UNREPRODUCIBLE_LOCK_CLAUSE, at as isAwsCliLiteral, b as assertRegionMatch, bt as endCommandInterruptScope, cn as WAIT_CONDITION_SIGNAL_PREFIX, ct as renderDisableCommand, dn as withPasteableAwsProfile, en as forceQuitRecoveryClause, fn as injectiveKey, gt as readRecordedPrincipals, hn as producerRecordKey, ln as setPasteableAwsCaBundle, lt as IAM_PRINCIPAL_NAME, mn as producerCoordinateKey, nn as formatLockOperation, on as CUSTOM_RESOURCE_RESPONSE_PREFIX, rn as formatLockOwner, sn as DEFAULT_STATE_PREFIX, tn as formatLockExpiry, un as setPasteableAwsProfile, ut as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, v as DriftReadRefusedError, xt as interruptWatchListenerCount, y as RESOURCE_NOT_FOUND, yt as beginCommandInterruptScope } from "./created-resource-sink-
|
|
1
|
+
import { A as displayStackName, C as STACK_REF_MAX_CODE_POINTS, D as displayAwsMessage, E as cutMarker, F as stringifyJsonPayload, I as terminalSafe, L as truncateCodePoints, N as plainIdentOr, O as displayIdent, P as safeMsg, S as SECRET_REF_MAX_CODE_POINTS, T as asIsMessage, _ as shellQuote, b as setPasteableVerbFlags, c as deployReplaceCommand, d as pasteableCommand, g as shellBoundedDisplay, h as quotedOrDescribed, i as SHELL_ACTIVE_WHY, j as isPasteableIdent, k as displaySafe, m as proseQuoted, o as cdkdRemedy, p as plainOrDescribed, s as commandHole, t as getCdkdVersion, u as isInertUnquoted, v as withheldTargetClause, w as UNRENDERABLE, x as SAFE_MSG_ALTERED_CHAR, y as setPasteableRunFlags } from "./version-D2qdiEuf.js";
|
|
2
|
+
import { $ as renderStacksNoLongerSelected, $t as contextOptions, A as followContainerLogs, An as parseStateKey, At as namedEnvAwsRegion, B as resolveRuntimeCodeMountPath, Bt as regionNeedsReconciliation, C as waitForRieReady, Cn as parsePositiveIntegerOption, Ct as resolveContainerRegion, Dn as describeStateKey, Dt as warnAwsEmulatorStateSourceHint, E as SENSITIVE_ENV_KEYS, En as STATE_KEY_MAX_CODE_POINTS, Et as taskRoleAssumedInRealAws, F as removeContainer, Ft as legacyStateBucketFallbackRegion, G as nestedOwnerOfLogicalId, Gt as withOtherIndexRemoval, H as resolveRuntimeImage, Ht as resolveEffectiveRegion, It as namedCliRegion, J as renderAllLeftOutStageStacks, Jt as annotationMessageOptions, K as partitionTopLevel, Kt as strandedProfileCredentialsNotice, L as runDetached, Lt as rawCliRegion, M as killAndDrainContainerLogs, Mt as adoptRegionFlag, N as pickFreePort, Nt as exportInferredRegionForSdk, O as ensureDockerAvailable, On as listAllLockKeys, Ot as workloadGetsEmulatorKeysOnly, P as pullImage, Pt as foldRegionOption, Q as renderNotInAppWarning, Qt as commonOptions, Rt as reconcileExportIndexRegion, S as invokeRie, Sn as cliArgParser, St as realAwsException, T as DockerRunnerError, Tn as STATE_FILE_SUFFIX, Tt as stateRoleRecordIsEmulatorSide, U as describeStack, Ut as stackRegionResolver, V as resolveRuntimeFileExtension, Vt as regionShown, W as matchStacks, Wt as stateWithRegion, X as renderAmbiguousTargetStack, Xt as applyWaitFlagEnv, Y as renderAllNoTopLevelStacks, Yt as appOptions, Z as renderNoStackMatch, Zt as collectRepeated, _ as probeHostGatewaySupport, _n as allowUnsupportedTypesOption, _t as localAwsEmulatorCredentials, a as materializeLayerFromArn, an as noCfnFallbackOption, at as unmatchedPatterns, b as substituteImagePlaceholders, bn as resourceTimeoutOptions, bt as prepareLocalLoopbackForwarder, cn as parseStackRegion, ct as resolveCdkPathToLogicalIds, d as resolveAssetCodeDirectory, dn as stackOptions, dt as activateLocalAwsAndRoleArn, en as deployOptions, et as renderUnmatchedPatternsWarning, f as architectureToPlatform, fn as stateOptions, ft as assertAwsEmulatorValue, g as HOST_GATEWAY_MIN_VERSION, gn as parseAssumeRoleToken, gt as localAwsEmulatorActive, h as layerAssetDirectory, hn as normalizeStartApiAssumeRole, ht as keepEmulatorIssuedCredentials, i as resolveInlineCodeFilePath, in as guardStackRegionOptions, it as stacksNoLongerSelected, jt as recordEmulatorDefaultRegion, k as flushStdio, kn as listAllStateKeys, kt as emulatorDefaultRegion, l as resolveLambdaLayers, ln as regionOption, lt as stackForConstructPath, m as copyLayerTreeLastWins, mn as effectiveAssumeRoleArn, mt as getActiveWorkloadAwsWiring$1, n as resolveTmpfsForLambda, nn as diffUpdatePolicyOptions, nt as stackMatchesPattern, o as resolveLambdaTarget, on as noLocalCustomResourcesOption, ot as buildCdkPathIndex, p as buildContainerImage$1, pn as useCdkBootstrapAssetsOption, pt as attachLocalLoopbackForwarder, q as refuseStackNameRegionCollisions, qt as writeProfileCredentialsFile, r as resolveZipImagePlan, rn as exclusivelyOption, rt as stacksForDependency, s as extractEphemeralStorageMb, sn as parseContextOptions, st as readCdkPathOrUndefined, t as resolveLocalBuildPlan$1, tn as destroyOptions, tt as selectTargetStack, u as assetPathDirs, un as skipFinalSnapshotOption, ut as stackForPathFormTarget, v as resolveHostGatewayExtraHosts, vn as diffReplaceResourceOption, vt as mixedModeActive, w as CONTAINER_LOG_DRAIN_TIMEOUT_MS, wn as LOCK_FILE_SUFFIX, wt as setContainerRegion, x as tryResolveImageFnJoin, xn as validateResourceTimeouts, xt as profileCredentialsForWorkload, y as derivePseudoParametersFromRegion$1, yn as parseDuration, yt as mixedModeEmulatorOverride, z as streamLogs, zt as reconcileMarkerRegionWithLegacyDefault } from "./image-plan-CUvO0Qe2.js";
|
|
3
|
+
import { $t as buildLockContentionMessage, At as resourceTypeShown, C as VALUE_NOT_SHOWN, It as maskDeep, M as remedyLogicalId, Ot as logicalIdShown, P as isMarkedNotGone, Q as runDeleteAttempt, Qt as buildForceUnlockCommand, St as isInterruptedWaitError, Zt as UNREPRODUCIBLE_LOCK_CLAUSE, at as isAwsCliLiteral, b as assertRegionMatch, bt as endCommandInterruptScope, cn as WAIT_CONDITION_SIGNAL_PREFIX, ct as renderDisableCommand, dn as withPasteableAwsProfile, en as forceQuitRecoveryClause, fn as injectiveKey, gt as readRecordedPrincipals, hn as producerRecordKey, ln as setPasteableAwsCaBundle, lt as IAM_PRINCIPAL_NAME, mn as producerCoordinateKey, nn as formatLockOperation, on as CUSTOM_RESOURCE_RESPONSE_PREFIX, rn as formatLockOwner, sn as DEFAULT_STATE_PREFIX, tn as formatLockExpiry, un as setPasteableAwsProfile, ut as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, v as DriftReadRefusedError, xt as interruptWatchListenerCount, y as RESOURCE_NOT_FOUND, yt as beginCommandInterruptScope } from "./created-resource-sink-DlVo2nqB.js";
|
|
4
4
|
import { a as runWithStackAwsClients, i as resetAwsClients, l as s3ClientDefaults, o as setAwsClients, s as resolveS3ClientDefaults, t as AwsClients, u as setS3ClientDefaultsDebugLog } from "./aws-clients-DOkPjjAW.js";
|
|
5
|
-
import { $ as withStackScope, A as configStringRefusal, B as generateResourceName, E as coerceCfnBoolean, F as requireConfigString, I as PATTERN_B_NAME_OPTIONS, L as PATTERN_B_NAME_PROPERTIES, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, Q as withSkipPrefix, R as PATTERN_B_RESOURCE_TYPES, S as explicitNamePropertyFor, X as isNameGeneration, a as reserveStdoutForPayload, f as isAwsAuthoredFailure, i as releaseStdoutForPayload, m as verboseAwareText, n as getLogger, p as safeStringify, r as isStdoutReservedForPayload, s as runStackBuffered, u as describeAwsFailure, y as getLiveRenderer, z as derivesPatternBName } from "./logger-
|
|
6
|
-
import { A as stripControlChars, B as retryClassificationText, F as isAmbiguousOutcomeError, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, Q as AccountIdUnavailableError, R as isRetryableTransientError, U as isThrottlingError, V as THROTTLING_ERROR_NAMES, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, _ as ResourceUpdateNotSupportedError, a as normalizeAwsError, at as ProvisioningError, ct as SynthesisError, et as CdkdError, g as PartialFailureError, h as NestedStackChildDirectDestroyError, i as credentialFingerprint, j as stripForDisplay, k as escapeRegExp, l as withErrorHandling, n as ambientCredentialConfig, o as formatError, ot as ResourceTimeoutError, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, rt as LocalInvokeBuildError$1, s as handleError, st as StateError, t as ambientClientDefaults, tt as DeployCancelledError, u as LocalStartServiceError, v as StackHasActiveImportsError, y as StackTerminationProtectionError, z as isTransientServerError } from "./ambient-client-defaults-
|
|
5
|
+
import { $ as withStackScope, A as configStringRefusal, B as generateResourceName, E as coerceCfnBoolean, F as requireConfigString, I as PATTERN_B_NAME_OPTIONS, L as PATTERN_B_NAME_PROPERTIES, N as requireConfigArray, O as configBooleanRefusal, P as requireConfigObject, Q as withSkipPrefix, R as PATTERN_B_RESOURCE_TYPES, S as explicitNamePropertyFor, X as isNameGeneration, a as reserveStdoutForPayload, f as isAwsAuthoredFailure, i as releaseStdoutForPayload, m as verboseAwareText, n as getLogger, p as safeStringify, r as isStdoutReservedForPayload, s as runStackBuffered, u as describeAwsFailure, y as getLiveRenderer, z as derivesPatternBName } from "./logger-B673mhBe.js";
|
|
6
|
+
import { A as stripControlChars, B as retryClassificationText, F as isAmbiguousOutcomeError, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, Q as AccountIdUnavailableError, R as isRetryableTransientError, U as isThrottlingError, V as THROTTLING_ERROR_NAMES, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, _ as ResourceUpdateNotSupportedError, a as normalizeAwsError, at as ProvisioningError, ct as SynthesisError, et as CdkdError, g as PartialFailureError, h as NestedStackChildDirectDestroyError, i as credentialFingerprint, j as stripForDisplay, k as escapeRegExp, l as withErrorHandling, n as ambientCredentialConfig, o as formatError, ot as ResourceTimeoutError, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, rt as LocalInvokeBuildError$1, s as handleError, st as StateError, t as ambientClientDefaults, tt as DeployCancelledError, u as LocalStartServiceError, v as StackHasActiveImportsError, y as StackTerminationProtectionError, z as isTransientServerError } from "./ambient-client-defaults-BLKND30a.js";
|
|
7
7
|
import { a as getAssumedRoleCredentials, c as setAssumedRoleCredentials, h as formatAuthority, l as setAwsEndpointOverrideSource, m as runInStackAwsScope, n as awsClientDefaults, r as awsEndpointOverrideActive, s as runWithRealAws } from "./aws-client-defaults-DAebi99J.js";
|
|
8
|
-
import { $ as
|
|
9
|
-
import { $a as journaledOrphanPrintingBag, $c as withSecretPhysicalIdsMaskedInState, $d as resolveAssemblyPath, $i as resourcesNamingDeclaredParameter, $l as malformedOutputsWarning, $n as recordDisplacedSkips, $o as wouldReturnToSdkProvider, $r as siblingRecordedSgRuleIds, $s as callerEnvCredentials, $u as findNestedTemplateTreeDefect, A as deferredServiceTokenWarning, Aa as withPreviousPolicies, Ac as carriesFetchableDynamicReference, Ad as ensureAssetStorage, Ai as recheckFailedPlan, Al as refuseMalformedResourceEntriesForImport, An as refuseRefactorMarker, Ao as revertStackRecordsView, Ar as findRefactorHints, As as getReadOnlyPropertyPaths, Au as providerReplacementOldDeleted, B as readProtection, Ba as bold, Bc as shownType, Bi as orphanNeedsIdentity, Bl as refuseMalformedResourcePropertiesForOrphan, Bn as macWriteOnlyKeys, Bo as lambdaPermissionMatchesDeclared, Br as looselyEqual, Bu as rebuildClientForBucketRegion, C as warnLegacySpelling, Ca as supersededHeldByOtherTypeWarning, Cc as keepHeldTokenProvenance, Cd as getDockerImageBySourceHash, Cl as malformedLocalResourcesWarning, Cn as NestedCleanupQueue, Cr as noEchoMacVerdict, Cu as findHandledUnwrittenCreateOnly, D as slashedSsmNameHealPendingNote, Dc as withoutVersionAttestation, Di as isJournaledOrphan, Dl as refuseMalformedResourceEntries, Dn as readRefactorMarkerOnce, Dr as formatChangeCounts, Ds as deleteLeftInPlace, Du as NO_CC_HANDLERS_REASON, E as slashedSsmNameHealNote, Ea as withoutSuperseded, Ec as recordedReferenceRegions, Ei as demoteSupersededOrphans, El as refuseMalformedResourceAttributesForOrphan, En as readRefactorMarker, Er as findDestructiveChanges, Es as deleteIndeterminateGuards, F as recordedProtectionEvidence, Fa as sgCidrKey, Fc as INTRINSIC_KEYS, Fd as parseBootstrapMarker, Fi as attemptUsesCompletedCreate, Fl as malformedDriftResourcePropertiesWarning, Fn as removeSignalReceiverNamed, Fr as changedReferenceInDiff, Fs as isSelectOutOfBounds, Fu as S3StateBackend, Ga as yellow, Gd as nullPrototypeRecord, Gi as retiredNameGenerationsAfter, Gl as malformedOrphansWarning, Gn as pendingRequestCount, Gr as referencedLogicalIds, Gs as assertFlagRoleArn, Gu as isAccessDenied, Ha as gray, Hc as isStatefulRecreateTargetForReplace, Hd as defineOwnKey, Hi as nameGenerationHighWaterOf, Hl as UNREADABLE_ORPHANS_CONTAINER_ROW, Ho as policyDocumentMatchesDeclared, Hr as parseMappingFile, Hs as producerLookupOver, Hu as CrossPrefixScanCache, I as recordedProtectionNote, Ia as sgProtocolKey, Ic as LEGACY_HANDLE_HEAL_REASON, Id as readBootstrapMarkerBody, Ii as readsRegeneratingSecret, Il as malformedResourcePropertiesWarning, In as settleStackTagChildRuns, Ir as changedReferencePath, Is as isAlwaysLiveAttribute, Iu as splitImportedOps, Ja as noEchoExactEchoLeavesOf, Jl as repairMalformedOrphansForReadOnly, Jn as displacedOpClause, Jr as undeclaredGrantSiblingMembers, Js as isIamRoleArn, Ju as withStackInstanceIdWithheld, Ka as noEchoAttributeNamesOf, Kd as ownValue, Ki as retiredNameGenerationsLeaving, Kl as refuseMalformedOrphans, Kn as resolvePendingCloudControlRequests, Ko as verbatimEchoDriftKeys, Kr as siblingOwnedRevertDesired, Ks as assertSendableRoleArn, Ku as isNotImplemented, L as PROTECTION_PROPERTY_BY_TYPE, Ld as validateAssetBucketName, Li as segmentCleanupOptions, Ll as refuseMalformedResourcePropertiesForDestroy, Lo as declaredMemberDocument, Lr as changedReferenceReason, Ls as poisonRenderedSpellingsCollidingIn, Lt as tagsMatchDeclared, Lu as readOnlyStateVersionOf, M as serviceTokenBlockingReason, Mc as carriesDynamicReference, Md as assertAssetBucketRegion, Mi as replacementNeverSwapped, Ml as refuseMalformedResourceEntriesForOrphan, Mn as updateRefactorMarker, Mo as withStackRecords, Mr as movedToHint, N as diffSecurity, Na as cfnIngressPortValue, Nc as keepsSecretReferenceToken, Nd as isCrossRegionRedirect, Ni as IMPLICIT_DELETE_DEPENDENCIES, Nl as repairMalformedResourceEntriesForReadOnly, Nn as deleteSignalReceiver, Nr as rollbackOrphanIds, Ns as DiffCalculator, Nt as declaredTagsReadback, O as scanActiveConsumers, Oa as snapshotSegmentSurvivors, Oc as getAccountInfo, Oi as isReplacementOrphan, Ol as refuseMalformedResourceEntriesForDeploy, On as refactorMarkerMovesOf, Oo as destroyStackRecordsView, Or as formatDestructiveChange, Os as deleteSkipReason, Ou as hasNoCloudControlHandlers, P as isScrutinizedProperty, Pa as recordedSgRuleId, Pc as withSharedDrainBudget, Pd as getBootstrapMarkerKey, Pi as computeImplicitDeleteEdges, Pl as unreadableResourceEntries, Pn as isReceiver, Po as LAMBDA_PERMISSION_STATEMENT_KEYS, Pr as withMovedTo, Ps as IntrinsicFunctionResolver, Pu as TemplateParser, Q as streamPolicyMatchesDeclared, Qa as completedReplayEntries, Qc as secretSegmentsOfState, Qd as renderAssemblyPathEscape, Qi as reachableDivergentParameters, Ql as malformedOutputsRefusalMessage, Qn as nestedChildStackName$1, Qo as isCustomResource, Qs as applyCallerIdentityCredentials, R as isProtectionValueActive, Ra as canonicalizeIpv4Cidr, Rd as validateContainerRepoName, Ri as removeProtectionTypeList, Rl as refuseMalformedResourcePropertiesForDrift, Rn as childStackTags, Ro as declaredPolicyDocument, Rr as differingRemedy, Rs as stackIdTailOf, Ru as hasReasonlessBaselineRefusal, S as refusePendingMovesOut, Sa as supersededDependentsFirst, Sd as AssetManifestLoader, Si as withCreateTokenLedger, Sl as malformedLocalResourceEntriesWarning, Sr as noEchoMacParametersOf, Ss as CloudControlProvider, Su as findActionableSdkUnwired, T as slashedSsmNameHealAdoptedNote, Ta as supersededResourcesOf, Tc as recordedOutputReferenceRegions, Ti as seedsDeleteFirstGuard, Tl as malformedScrubResourceEntriesRefusalMessage, Tn as recordRetainedForReadoption, Tr as constructPathOf$1, Ts as UNSPECIFIED_SKIP_REASON, Tu as unwrittenCreateOnlyReplacement, Ua as green, Uc as isStatefulRecreateTargetSync, Ud as hasOwnKey, Ui as nameScopeOf, Ul as hasReadableOrphans, Un as formatResourceLine, Uo as reReadUntilSettled, Ur as propertiesChangedReason, Us as refuseUnreadableCdkCrossAccountRefs, Uu as applyCrossPrefixScan, Va as cyan, Vc as MULTI_REGION_RECREATE_BLOCKED_TYPES, Vi as nameGenerationCarriedFrom, Vl as repairMalformedResourcePropertiesForReadOnly, Vn as readsOnlyNoEchoParameters, Vo as memberReadFailure, Vr as mappingPairs, Vs as resolveDynamicReferences, Vu as CrossPrefixReadError, Wa as red, Wc as renderStatefulReason, Wd as hasPlainPrototype, Wi as retiredAfterRollback, Wl as malformedOrphansRefusalMessage, Wn as startForceQuitFlushes, Wr as proposeRenames, Ws as applyRoleArnIfSet, Wu as crossPrefixDeniedWarning, Xa as withAttemptedItemsMasked, Xd as displayAssemblyPath, Xi as computeParameterTaint, Xl as malformedExportSourceWarning, Xn as dropSettledNestedJournals, Xo as ProviderRegistry, Xr as sgRuleOwnershipIdentity, Xs as sendableAssumeRoleCommand, Xu as isSensitiveAttributeName, Ya as noEchoParameterNamesOf, Yc as displayPhysicalId, Yd as describeFileReadFailure, Yi as inheritProducerRegions, Yl as malformedExportNamesWarning, Yn as displacedPhysicalIdShown, Yo as CC_BROKEN_REASON, Yr as recordedRuleIdOf, Ys as parseIamRoleArn, Yu as isSecretValuedAttribute, Za as createReadOnlyAttributeHealerFactory, Zc as secretPhysicalIdSegment, Zi as namesAnyDeclaredParameter, Zl as malformedLocalOutputsWarning, Zo as ccBrokenReason, Zr as sgSiblingDecidedById, Zs as AWS_CREDENTIAL_ENV_KEYS, _ as readRecordedConditionVerdicts, _a as maskingRetryLogger, _c as cfnRefValueFromPhysicalId, _i as findUpdatePolicyReplacementRefusals, _l as refuseMalformedOrphansForOrphan, _o as refusesFinalSnapshot, _r as DeploymentEventsStore, _s as localCustomResourceCommand, _u as STATE_RESOURCES_MALFORMED, a as mergeNoChangeOutputs, aa as secretSafeKeyDisplay, ac as withoutLapsedStaleShapeStamp, ai as earlyDeleteWhen, al as maskedInputProof, ar as withNestedStackContext, as as applyCustomResourceResponseExpiration, au as refuseDivergentRecordRegionForDestroy, b as pendingMovesOutOf, ba as isSupersededResourceRecord, bc as lacksRecordedRefArn, bi as ledgerForStack, bl as unreadableOrphanRecords, bo as buildFinalSnapshotIdentifier, br as createNoEchoValueMacs, bs as withCustomResourceStack, bu as hasReadableOutputs, c as nestedSsmNameRowNote, ca as exportNameSecretExposure, ci as recordAfterRollbackUpdate, cl as maskedPropertyFingerprint, co as stateSecretNameNeedles, cr as dropFailedHint, cs as TemplateNoEchoReresolver, cu as malformedStateRefusalMessage, d as makeCanonicalizePropertiesFn, da as collectDeclaredOutputNames, di as calculateResourceDrift, dl as malformedOrphanRecordsRefusalMessage, do as ATOMIC_FINAL_SNAPSHOT_TYPES, dr as loadJournaledOrphans, du as refuseMalformedResourcesForExport, ea as WITHHELD_NAME_DISPLAY, ec as envCredentialsAreAssumedRole, ed as isAbsoluteAssetPath, el as getSettledWriteOnlyPropertyPaths, eo as maskEventTextWithBoundBags, es as WaitConditionSignalStore, f as readDbInstanceAvailabilityZone, fa as collectPublishedOutputNames, fd as buildAssetRedirectMap, fi as equalModuloMarkedMask, fl as malformedOrphanRecordsWarning, fo as PRE_DELETE_SNAPSHOT_TYPES, fr as sameJournaledOrphans, fs as withPrintingSecrets, fu as refuseMalformedState, g as parentSuppliedValues, ga as DEFAULT_RESOURCE_WARN_AFTER_MS, gc as AWS_NO_VALUE, gi as updatePartialReason, gl as refuseMalformedOrphanRecordsForDestroy, go as isFinalSnapshotError, gr as DeploymentEventsReader, gs as customResourcesRunWithoutApp, gu as withheldAccountClause, h as conditionInputsFrom, ha as DEFAULT_RESOURCE_TIMEOUT_MS, hc as parameterTypeMayLoseSecretIdentity, hi as updatePartialMessage, hl as refuseMalformedOrphanRecords, ho as effectiveDeletionPolicy, hr as planOrphanAdoption, hs as customResourcesFailedWithoutApp, hu as accountArgs, i as keptWholeReasonText, ia as secretBearingStateKeyWarning, ic as regionLessSecretName, ii as PLANNED_EARLY_DELETE_CONSEQUENCE, il as parameterInputsFor, io as secretNamePrintingBags, ir as getCurrentNestedStackContext, is as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, iu as STATE_REGION_DIVERGED, j as findServiceTokenRefusals, ja as findNestedStackTypeChanges, jc as isNamelessDynamicReferenceError, jd as buildDenyExternalAccessPolicy, ji as recordUnderIdIsNotOwn, jl as refuseMalformedResourceEntriesForImportSave, jn as sameMove, jr as hintSidesOf, js as isWaitAbandonedError, k as inRunStackKey, ka as resolveReplacementOldType, kc as isImpossibleEmptyStoredAttribute, kd as AssetModeResolver, ki as planFailedOps, kl as refuseMalformedResourceEntriesForDestroy, kn as refactorMarkerRefusalMessage, kr as orphanedLogicalIds, ku as PROPERTY_COVERAGE_BY_TYPE, l as crossStackOutputProvenanceSource, la as isWholeDynamicReferenceValue, ld as decodeListingKey, li as settleUnsettledPrevious, ll as deployRefusesOrphanRowsReason, lo as storedSecretNameNeedles, lr as isHandledOrphan, ls as readsNoEchoDeleteValues, lu as refuseMalformedResourcesForDeploy, m as conditionFingerprint, ma as bindingSkippedOutputs, mc as isUnboundTemplateParameter, md as createLazyAssetModeContext, mi as undeclaredEmptyObservedKeys, ml as previewableOrphanRecords, mo as ccRoutedInstanceTakesNoSnapshot, mr as makeSiblingClaimReader, mu as JSON_LISTING_HOLE_VALUE, n as applyStackTagsToTemplate, na as exportAliasCollisionScrubWarning, nc as classifyReplaySecretRegion, nd as renderNestedTemplateTreeDefect, ni as replayRollback, nl as tryGetTopLevelWriteOnlyProperties, no as orphanRecordsPrintingBag, nr as withNestedRevertRun, nu as refuseMalformedOutputsForDestroy, o as checkNestedSsmNames, oa as carriedExportAliasExposure, oc as isUnexposedRecordedIdentity, od as ssmResolvedValueType, oi as earlyDeletedOld, oo as secretNamedRecordNeedles, or as deleteJournaledOrphans, os as customResourceResponseExpirationWarning, ou as malformedRenderedContainersWarning, p as healZonelessDbInstanceRecords, pa as isExportAliasCollision, pc as coerceParameterTypedValue, pd as createAssetRedirectResolver, pi as equalModuloMask, pl as malformedOrphanRowsKeptWarning, po as ccRoutedFinalSnapshotError, pr as makeForeignHolderScan, ps as NO_LOCAL_CUSTOM_RESOURCES_FLAG, pu as repairMalformedResourcesForReadOnly, q as readStreamPolicy, qa as noEchoComparisonForTemplate, qi as withNameGenerationReached, ql as refuseMalformedOrphansForDestroy, qn as NESTED_PENDING_PARENT_REASON, qr as stripSiblingOwnedParentMembers, qs as explicitRoleArnOrThrow, qu as stackInstanceIdOf, r as isSecretBearingReferenceString, ra as secretBearing, rc as producerRegionsFromState, rd as templateIdentity, ri as DELETED_RESOURCE_REMEDY, rl as maskedPropertyFingerprintsOf, ro as secretNamePrintingBag, rr as collectNestedChildUnaddressed, rs as isSignalKey, ru as repairMalformedOutputsForReadOnly, s as nestedSsmNameDeferredNote, sa as exportNameNoEchoParameters, sd as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, si as buildReadCurrentStateContext, sl as declaresNoEcho, so as stackSecretNamesMasker, sr as dropFailedCommands, su as malformedResourcesWarning, t as DeployEngine, ta as displayTextOrWithheld, tc as classifyRecordedSecretRegion, td as listNestedTemplateRows, tf as resolveBucketRegion, ti as replayFailedOperations, tl as getTopLevelKeysHoldingUnreadableCreateOnly, to as namingSecretsWithRecordedNoEcho, tr as revertedNestedRowIds, ts as classifyHandleUrl, tu as refuseMalformedOutputs, u as inheritedProvenanceForChildDiff, ua as noEchoParameterValueSeed, ui as withUnprovenUnsettled, ul as isReadableOrphanRecord, uo as extractDeploymentEventError, ur as journaledOrphanLines, us as isCustomResourceType$1, uu as refuseMalformedResourcesForDestroy, v as childTemplateLoader, va as deleteSupersededEntry, vc as isStalePlaceholderArnAttribute, vd as loadPublishableAssetManifest, vi as replacementCreateRoutesToCloudControl, vl as repairMalformedOrphanRecordsForReadOnly, vo as unsupportedFinalSnapshotError, vr as crossStackReadsForPartialSave, vu as UNREADABLE_RESOURCES_MAP_ROW, w as healSlashedSsmParameterNames, wa as supersededHolderOf, wi as planRollback, wl as malformedResourceEntriesWarning, wn as keptForRetainedRecord, wr as noEchoValueMacsOf, ws as RollbackInlinePolicyWriters, x as pendingMovesRefusalMessage, xa as supersededAfterRollback, xc as lacksRecordedTableArn, xd as rewriteTemplateAssetReferences, xl as isReadableResourceEntry, xr as noEchoMacBinding, xu as hasReadableResources, y as hasPendingMovesOut, ya as holdsSupersededResources, yc as refStateLookupFromResource, yl as unpreviewableOrphanRecords, yo as createPreDeleteFinalSnapshot, yr as NOECHO_MAC_KEY_ALIAS, ys as setLocalCustomResourceRuntimeEnabled, yu as displayLogicalId, z as perType, za as canonicalizeIpProtocolValue, zc as findReplacedReadersOfRecreateTargets, zd as BOOTSTRAP_MARKER_PREFIX, zi as removeProtectionTypes, zl as refuseMalformedResourcePropertiesForExport, zn as literalRowTags, zo as efsPolicyMatchesDeclared, zr as isPairableType, zu as hasUnverifiableParameterRefusal } from "./deploy-engine-D6iEbD4R.js";
|
|
8
|
+
import { $ as createLegacyAssetParameterBinder, A as runDockerForeground, B as resolveCaptureObservedState, C as finchSecretArgvRefusal, D as isMalformedEnvKey, E as isDockerClientEnvKey, F as getDefaultStateBucketName, G as resolveUpdatePolicy, H as resolveStateBucketWithDefault, I as getLegacyStateBucketName, J as warnDeprecatedNoPrefixCliFlag, K as resolveUseCdkBootstrapAssets, L as loadCdkJson, M as abortInFlightMultipartUploads, N as Synthesizer, O as formatDockerLoginError, P as synthesisStatusMessage, Q as bindLegacyStackAssetParameters, R as resolveApp, S as dockerSpawnEnvWithSensitive, T as warnFinchArgvExposure, U as resolveStateBucketWithDefaultAndSource, V as resolveSkipPrefix, W as resolveStateBucketWithSource, X as AssemblyReader, Y as refuseFailedLookups, Z as StageLoadError, _ as describeDockerExecFailure, at as setChildProcessAwsEnv, b as redactedDockerCause, d as isLockInfoExpired, et as legacyPlanAssetCount, f as AssetPublisher, h as resolveDockerContextDirectory, i as mergeDeclaredEntries, it as processStackMessages, j as runDockerStreaming, k as getDockerCmd, l as DagBuilder, m as buildDockerImage, n as declaredStringList, nt as prepareLegacyStackAssets, p as WorkGraph, q as stateBucketExistenceConfirmed, r as inlinePoliciesAreDeclared, rt as CdkToolkitBucketMissingError, s as stringListIsDeclared, t as declaredInlinePolicies, tt as predictedAutoCreatedAssetMode, u as LockManager, v as describeDockerFailure, w as partitionSensitiveEnv, x as redactDockerArgvValues, y as redactedCause, z as resolveAutoAssetStorage } from "./settle-own-write-members-YQxWAEvB.js";
|
|
9
|
+
import { $a as orphanRecordsPrintingBag, $d as loadPublishableAssetManifest, $i as computeParameterTaint, $l as malformedLocalResourceEntriesWarning, $r as sgSiblingDecidedById, $s as regionLessSecretName, $u as findActionableSdkUnwired, A as planReplaceResourceTargets, Ac as deleteRetiredCloudFormationStack, Ad as findNestedTemplateTreeDefect, Af as describeFileReadFailure, Ai as isReplacementOrphan, Al as getSettledWriteOnlyPropertyPaths, An as refactorMarkerMovesOf, Ar as withMovedTo, As as isSelectOutOfBounds, Au as malformedOutputsWarning, B as isProtectionValueActive, Bc as confirmOrRefuse, Bd as findLargeInlineResources, Bi as segmentCleanupOptions, Bl as deployRefusesOrphanRowsReason, Bn as childStackTags, Bo as reReadUntilSettled, Br as proposeRenames, Bs as assertFlagRoleArn, Bu as refuseMalformedResourcesForDeploy, C as warnLegacySpelling, Ca as isSupersededResourceRecord, Cc as mixedSecretRowKeys, Cd as isNotImplemented, Cf as defineOwnKey, Cr as formatChangeCounts, Cs as deleteSkipReason, Cu as refuseMalformedOrphans, D as slashedSsmNameHealPendingNote, Da as supersededHolderOf, Dc as securityDiffWithPassedSecretWithheld, Dd as isSensitiveAttributeName, Df as ownValue, Di as seedsDeleteFirstGuard, Dl as secretPhysicalIdSegment, Dn as recordRetainedForReadoption, Do as revertStackRecordsView, Dr as hintSidesOf, Du as malformedExportSourceWarning, E as slashedSsmNameHealNote, Ea as supersededHeldByOtherTypeWarning, Ec as recordedValuesOf, Ed as isSecretValuedAttribute, Ef as nullPrototypeRecord, Ei as planRollback, En as keptForRetainedRecord, Er as findRefactorHints, Es as isWaitAbandonedError, Eu as malformedExportNamesWarning, F as serviceTokenBlockingReason, Fc as parseCfnTemplate, Fi as IMPLICIT_DELETE_DEPENDENCIES, Fl as parameterInputsFor, Fn as deleteSignalReceiver, Fo as declaredPolicyDocument, Fr as isPairableType, Ft as declaredTagsReadback, Fu as STATE_REGION_DIVERGED, Ga as noEchoParameterNamesOf, Gc as cyan, Gi as nameGenerationHighWaterOf, Gl as previewableOrphanRecords, Gn as formatResourceLine, Gr as noEchoMacParametersOf, Gs as sendableAssumeRoleCommand, Gu as JSON_LISTING_HOLE_VALUE, H as readProtection, Ha as canonicalizeIpProtocolValue, Hc as serializePrompt, Hd as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Hi as removeProtectionTypes, Hl as malformedOrphanRecordsRefusalMessage, Hn as macWriteOnlyKeys, Hr as NOECHO_MAC_KEY_ALIAS, Hs as explicitRoleArnOrThrow, Hu as refuseMalformedResourcesForExport, I as diffSecurity, Ia as cfnIngressPortValue, Ic as parseCfnTemplateWithFormat, If as resolveBucketRegion, Ii as computeImplicitDeleteEdges, Il as maskedInputProof, In as isReceiver, Io as efsPolicyMatchesDeclared, Ir as looselyEqual, Is as resolveDynamicReferences, Iu as refuseDivergentRecordRegionForDestroy, Ja as createReadOnlyAttributeHealerFactory, Jc as red, Jd as createAssetRedirectResolver, Ji as retiredNameGenerationsAfter, Jl as refuseMalformedOrphansForOrphan, Jn as resolvePendingCloudControlRequests, Jo as ccBrokenReason, Jr as siblingOwnedRevertDesired, Js as callerEnvCredentials, Ju as STATE_RESOURCES_MALFORMED, Ka as withAttemptedItemsMasked, Kc as gray, Ki as nameScopeOf, Kl as refuseMalformedOrphanRecords, Kn as startForceQuitFlushes, Ko as CC_BROKEN_REASON, Kr as noEchoMacVerdict, Ks as AWS_CREDENTIAL_ENV_KEYS, Ku as accountArgs, L as recordedProtectionEvidence, La as recordedSgRuleId, Lc as stringifyCfnTemplate, Ld as ssmResolvedValueType, Li as typesDeletedBefore, Ln as removeSignalReceiverNamed, Lo as lambdaPermissionMatchesDeclared, Lr as mappingPairs, Ls as producerLookupOver, Lu as malformedRenderedContainersWarning, M as renderUnreplacedTarget, Ma as resolveReplacementOldType, Mc as findReplacedCfnResources, Md as listNestedTemplateRows, Mi as recheckFailedPlan, Ml as tryGetTopLevelWriteOnlyProperties, Mn as refuseRefactorMarker, Mr as changedReferencePath, Ms as poisonRenderedSpellingsCollidingIn, Mu as refuseMalformedOutputs, N as deferredServiceTokenWarning, Na as withPreviousPolicies, Nc as getCloudFormationResourceTree, Nd as renderNestedTemplateTreeDefect, Nf as renderAssemblyPathEscape, Ni as recordUnderIdIsNotOwn, Nl as publicReferencesOf, Nn as sameMove, Nr as changedReferenceReason, Ns as stackIdTailOf, Nu as refuseMalformedOutputsForDestroy, O as scanActiveConsumers, Oa as supersededResourcesOf, Oc as taintedNamesOf, Oi as demoteSupersededOrphans, Ol as secretSegmentsOfState, On as readRefactorMarker, Or as movedToHint, Os as DiffCalculator, Ou as malformedLocalOutputsWarning, P as findServiceTokenRefusals, Pa as findNestedStackTypeChanges, Pc as tryGetCloudFormationResourceMap, Pd as templateIdentity, Pf as resolveAssemblyPath, Pi as replacementNeverSwapped, Pl as maskedPropertyFingerprintsOf, Pn as updateRefactorMarker, Po as declaredMemberDocument, Pr as differingRemedy, Pu as repairMalformedOutputsForReadOnly, Qa as namingSecretsWithRecordedNoEcho, Qc as keepHeldTokenProvenance, Qi as inheritProducerRegions, Ql as isReadableResourceEntry, Qn as dropSettledNestedJournals, Qo as classifyHandleUrl, Qr as sgRuleOwnershipIdentity, Qs as producerRegionsFromState, Qu as hasReadableResources, R as recordedProtectionNote, Ra as sgCidrKey, Rc as SUPERSEDED_COPY_HINT, Rd as CFN_TEMPLATE_BODY_LIMIT, Ri as attemptUsesCompletedCreate, Rl as declaresNoEcho, Rn as settleStackTagChildRuns, Ro as memberReadFailure, Rr as parseMappingFile, Rs as refuseUnreadableCdkCrossAccountRefs, Ru as malformedResourcesWarning, S as refusePendingMovesOut, Sa as holdsSupersededResources, Sc as maskPassedSecretReasons, Sd as isAccessDenied, Si as ledgerForStack, Sr as findDestructiveChanges, Ss as deleteLeftInPlace, Su as malformedOrphansWarning, T as slashedSsmNameHealAdoptedNote, Ta as supersededDependentsFirst, Tc as readsTainted, Td as withStackInstanceIdWithheld, Tf as hasPlainPrototype, Tl as displayPhysicalId, Tn as NestedCleanupQueue, To as destroyStackRecordsView, Tr as orphanedLogicalIds, Ts as getReadOnlyPropertyPaths, Tu as repairMalformedOrphansForReadOnly, Ua as noEchoAttributeNamesOf, Uc as NESTED_STACK_RESOURCE_TYPE$1, Ui as orphanNeedsIdentity, Ul as malformedOrphanRecordsWarning, Un as readsOnlyNoEchoParameters, Uo as verbatimEchoDriftKeys, Ur as createNoEchoValueMacs, Us as isIamRoleArn, Uu as refuseMalformedState, V as perType, Va as canonicalizeIpv4Cidr, Vc as promptYesNo, Vd as uploadCfnTemplate, Vi as removeProtectionTypeList, Vl as isReadableOrphanRecord, Vn as literalRowTags, Vr as referencedLogicalIds, Vs as assertSendableRoleArn, Vu as refuseMalformedResourcesForDestroy, Wa as noEchoComparisonForTemplate, Wc as bold, Wd as decodeListingKey, Wi as nameGenerationCarriedFrom, Wl as malformedOrphanRowsKeptWarning, Wr as noEchoMacBinding, Ws as parseIamRoleArn, Wu as repairMalformedResourcesForReadOnly, Xa as journaledOrphanPrintingBag, Xi as withNameGenerationReached, Xl as unpreviewableOrphanRecords, Xn as displacedOpClause, Xo as wouldReturnToSdkProvider, Xr as undeclaredGrantSiblingMembers, Xs as classifyRecordedSecretRegion, Xu as displayLogicalId, Y as readStreamPolicy, Ya as completedReplayEntries, Yc as yellow, Yd as createLazyAssetModeContext, Yi as retiredNameGenerationsLeaving, Yl as repairMalformedOrphanRecordsForReadOnly, Yn as NESTED_PENDING_PARENT_REASON, Yo as isCustomResource, Yr as stripSiblingOwnedParentMembers, Ys as envCredentialsAreAssumedRole, Yu as UNREADABLE_RESOURCES_MAP_ROW, Za as maskEventTextWithBoundBags, Zc as withPrintingSecrets, Zl as unreadableOrphanRecords, Zn as displacedPhysicalIdShown, Zo as WaitConditionSignalStore, Zr as recordedRuleIdOf, Zs as classifyReplaySecretRegion, Zu as hasReadableOutputs, _ as readRecordedConditionVerdicts, _a as bindingSkippedOutputs, _d as rebuildClientForBucketRegion, _f as readBootstrapMarkerBody, _i as updatePartialMessage, _l as MULTI_REGION_RECREATE_BLOCKED_TYPES, _o as buildFinalSnapshotIdentifier, _r as planOrphanAdoption, _s as CloudControlProvider, _u as refuseMalformedResourcePropertiesForOrphan, a as mergeNoChangeOutputs, aa as exportAliasCollisionScrubWarning, ad as hasNoCloudControlHandlers, ai as DELETED_RESOURCE_REMEDY, al as carriesFetchableDynamicReference, ao as stateSecretNameNeedles, ar as collectNestedChildUnaddressed, as as TemplateNoEchoReresolver, au as refuseMalformedResourceEntriesForDeploy, b as pendingMovesOutOf, ba as maskingRetryLogger, bc as maskPassedSecretChanges, bd as applyCrossPrefixScan, bf as BOOTSTRAP_MARKER_PREFIX, bi as replacementCreateRoutesToCloudControl, bl as renderStatefulReason, br as crossStackReadsForPartialSave, bs as UNSPECIFIED_SKIP_REASON, bu as hasReadableOrphans, c as nestedSsmNameRowNote, ca as secretSafeKeyDisplay, cc as coerceParameterTypedValue, ci as earlyDeletedOld, cl as keepsSecretReferenceToken, co as ATOMIC_FINAL_SNAPSHOT_TYPES, cr as deleteJournaledOrphans, cs as NO_LOCAL_CUSTOM_RESOURCES_FLAG, cu as refuseMalformedResourceEntriesForImportSave, d as makeCanonicalizePropertiesFn, da as exportNameSecretExposure, dc as AWS_NO_VALUE, dd as TemplateParser, df as ensureAssetStorage, di as settleUnsettledPrevious, dl as LEGACY_HANDLE_HEAL_REASON, do as ccRoutedInstanceTakesNoSnapshot, dr as isHandledOrphan, ds as customResourcesRunWithoutApp, du as unreadableResourceEntries, ea as namesAnyDeclaredParameter, ec as withoutLapsedStaleShapeStamp, ed as findHandledUnwrittenCreateOnly, el as recordedOutputReferenceRegions, eo as secretNamePrintingBag, er as nestedChildStackName$1, es as isSignalKey, et as streamPolicyMatchesDeclared, eu as malformedLocalResourcesWarning, f as readDbInstanceAvailabilityZone, fa as isWholeDynamicReferenceValue, fc as cfnRefValueFromPhysicalId, fd as S3StateBackend, ff as buildDenyExternalAccessPolicy, fi as withUnprovenUnsettled, fo as effectiveDeletionPolicy, fr as journaledOrphanLines, fs as localCustomResourceCommand, fu as malformedDriftResourcePropertiesWarning, g as parentSuppliedValues, ga as isExportAliasCollision, gc as lacksRecordedTableArn, gd as hasUnverifiableParameterRefusal, gf as parseBootstrapMarker, gi as undeclaredEmptyObservedKeys, gl as shownType, go as createPreDeleteFinalSnapshot, gr as makeSiblingClaimReader, gu as refuseMalformedResourcePropertiesForExport, h as conditionInputsFrom, ha as collectPublishedOutputNames, hc as lacksRecordedRefArn, hd as hasReasonlessBaselineRefusal, hf as getBootstrapMarkerKey, hi as equalModuloMask, hl as refuseStatefulReplacedReaders, ho as unsupportedFinalSnapshotError, hr as makeForeignHolderScan, hs as withCustomResourceStack, hu as refuseMalformedResourcePropertiesForDrift, i as keptWholeReasonText, ia as displayTextOrWithheld, id as NO_CC_HANDLERS_REASON, if as getDockerImageBySourceHash, ii as replayRollback, il as isImpossibleEmptyStoredAttribute, io as stackSecretNamesMasker, ir as withNestedRevertRun, iu as refuseMalformedResourceEntries, j as refuseStatefulReplaceResourceTargets, ja as snapshotSegmentSurvivors, jc as prepareCloudFormationStackRetirement, jd as isAbsoluteAssetPath, jf as displayAssemblyPath, ji as planFailedOps, jl as getTopLevelKeysHoldingUnreadableCreateOnly, jn as refactorMarkerRefusalMessage, jo as LAMBDA_PERMISSION_STATEMENT_KEYS, jr as changedReferenceInDiff, js as isAlwaysLiveAttribute, k as inRunStackKey, ka as withoutSuperseded, kc as templateMixesDynamicReference, ki as isJournaledOrphan, kl as withSecretPhysicalIdsMaskedInState, kn as readRefactorMarkerOnce, ko as withStackRecords, kr as rollbackOrphanIds, ks as IntrinsicFunctionResolver, ku as malformedOutputsRefusalMessage, l as crossStackOutputProvenanceSource, la as carriedExportAliasExposure, lc as isUnboundTemplateParameter, li as buildReadCurrentStateContext, ll as withSharedDrainBudget, lo as PRE_DELETE_SNAPSHOT_TYPES, lr as dropFailedCommands, lu as refuseMalformedResourceEntriesForOrphan, m as conditionFingerprint, ma as collectDeclaredOutputNames, mc as refStateLookupFromResource, md as readOnlyStateVersionOf, mf as isCrossRegionRedirect, mi as equalModuloMarkedMask, ml as findReplacedReadersOfRecreateTargets, mo as refusesFinalSnapshot, mr as sameJournaledOrphans, ms as setLocalCustomResourceRuntimeEnabled, mu as refuseMalformedResourcePropertiesForDestroy, n as applyStackTagsToTemplate, na as resourcesNamingDeclaredParameter, nd as unwrittenCreateOnlyReplacement, nf as rewriteTemplateAssetReferences, nl as withoutVersionAttestation, ns as applyCustomResourceResponseExpiration, nu as malformedScrubResourceEntriesRefusalMessage, o as checkNestedSsmNames, oa as secretBearing, od as PROPERTY_COVERAGE_BY_TYPE, oi as PLANNED_EARLY_DELETE_CONSEQUENCE, ol as isNamelessDynamicReferenceError, oo as storedSecretNameNeedles, or as getCurrentNestedStackContext, os as readsNoEchoDeleteValues, ou as refuseMalformedResourceEntriesForDestroy, p as healZonelessDbInstanceRecords, pa as noEchoParameterValueSeed, pc as isStalePlaceholderArnAttribute, pd as splitImportedOps, pf as assertAssetBucketRegion, pi as calculateResourceDrift, po as isFinalSnapshotError, pr as loadJournaledOrphans, pu as malformedResourcePropertiesWarning, qa as noEchoExactEchoLeavesOf, qc as green, qd as buildAssetRedirectMap, qi as retiredAfterRollback, ql as refuseMalformedOrphanRecordsForDestroy, qn as pendingRequestCount, qo as ProviderRegistry, qr as noEchoValueMacsOf, qs as applyCallerIdentityCredentials, qu as withheldAccountClause, r as isSecretBearingReferenceString, ra as WITHHELD_NAME_DISPLAY, rf as AssetManifestLoader, ri as replayFailedOperations, rl as getAccountInfo, ro as secretNamedRecordNeedles, rr as revertedNestedRowIds, rs as customResourceResponseExpirationWarning, ru as refuseMalformedResourceAttributesForOrphan, s as nestedSsmNameDeferredNote, sa as secretBearingStateKeyWarning, sd as providerReplacementOldDeleted, si as earlyDeleteWhen, sl as carriesDynamicReference, so as extractDeploymentEventError, sr as withNestedStackContext, ss as isCustomResourceType$1, su as refuseMalformedResourceEntriesForImport, t as DeployEngine, ta as reachableDivergentParameters, tc as isUnexposedRecordedIdentity, ti as siblingRecordedSgRuleIds, tl as recordedReferenceRegions, to as secretNamePrintingBags, tr as recordDisplacedSkips, ts as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, tu as malformedResourceEntriesWarning, u as inheritedProvenanceForChildDiff, ua as exportNameNoEchoParameters, uc as parameterTypeMayLoseSecretIdentity, uf as AssetModeResolver, ui as recordAfterRollbackUpdate, ul as INTRINSIC_KEYS, uo as ccRoutedFinalSnapshotError, ur as dropFailedHint, us as customResourcesFailedWithoutApp, uu as repairMalformedResourceEntriesForReadOnly, v as childTemplateLoader, va as DEFAULT_RESOURCE_TIMEOUT_MS, vc as calculatorMaskingPassedSecretLines, vd as CrossPrefixReadError, vf as validateAssetBucketName, vi as updatePartialReason, vl as isStatefulRecreateTargetForReplace, vr as DeploymentEventsReader, vu as repairMalformedResourcePropertiesForReadOnly, w as healSlashedSsmParameterNames, wa as supersededAfterRollback, wc as mixedSecretTagKeys, wd as stackInstanceIdOf, wf as hasOwnKey, wi as withCreateTokenLedger, wr as formatDestructiveChange, wu as refuseMalformedOrphansForDestroy, x as pendingMovesRefusalMessage, xa as deleteSupersededEntry, xc as maskPassedSecretOutputs, xd as crossPrefixDeniedWarning, xr as constructPathOf$1, xs as deleteIndeterminateGuards, xu as malformedOrphansRefusalMessage, y as hasPendingMovesOut, ya as DEFAULT_RESOURCE_WARN_AFTER_MS, yc as crossStackTaintSeeds, yd as CrossPrefixScanCache, yf as validateContainerRepoName, yi as findUpdatePolicyReplacementRefusals, yl as isStatefulRecreateTargetSync, yr as DeploymentEventsStore, ys as RollbackInlinePolicyWriters, yu as UNREADABLE_ORPHANS_CONTAINER_ROW, z as PROTECTION_PROPERTY_BY_TYPE, za as sgProtocolKey, zc as cfnFailureText, zd as CFN_TEMPLATE_URL_LIMIT, zi as readsRegeneratingSecret, zl as maskedPropertyFingerprint, zo as policyDocumentMatchesDeclared, zr as propertiesChangedReason, zs as applyRoleArnIfSet, zt as tagsMatchDeclared, zu as malformedStateRefusalMessage } from "./deploy-engine-BDueF79_.js";
|
|
10
10
|
import { n as canonicalizeRegion, r as derivePartitionAndUrlSuffix, t as PARTITION_TABLE } from "./aws-partition-DA0r2sr-.js";
|
|
11
|
-
import { C as
|
|
12
|
-
import { l as setResolvedResourceTimeouts } from "./ec2-termination-protection-
|
|
13
|
-
import { t as expectedOwnerParam } from "./expected-bucket-owner-
|
|
14
|
-
import { Ct as isReadableBag, Et as shouldRetainResource, Ot as stackInstanceIdCarriedFrom, St as importableOutputs, Tt as orphansCarriedFrom, _t as acceptedCreateOnlyDropsOf, bt as hasReadableExportSet, gt as slowCcOperationTimeoutMs, vt as describeRegionValueKind, wt as orphansAfterRollback, xt as importableOutputKeys, yt as exportNamesCarriedFrom } from "./delete-started-
|
|
15
|
-
import {
|
|
16
|
-
import { S as unsettledPropertiesOf, T as withoutUnsettledProperties, b as unsettledItemsOf, w as withUnsettledProperties, y as unsettledItemsField } from "./restore-source-guard-
|
|
17
|
-
import { u as differingIdentityWarning } from "./identity-read-denied-
|
|
18
|
-
import { n as isRedactedRecordedValue } from "./redacted-delete-address-
|
|
19
|
-
import { a as withResourceDeadline } from "./resource-deadline-
|
|
20
|
-
import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-
|
|
11
|
+
import { A as utf8ByteLength, C as renderPhaseTimings, E as describeJsonParseFailure, O as parseFailureDebugDetail, _ as withRetry, a as getCreateOnlyPropertyPaths, c as templateResourceTypes, d as describeTypeWithThrottleRetry, s as prefetchCreateOnlyPropertyPaths, w as timePhase, y as PhaseClock } from "./secret-reference-immutable-Bk60ZfqH.js";
|
|
12
|
+
import { l as setResolvedResourceTimeouts } from "./ec2-termination-protection-DI-aPxET.js";
|
|
13
|
+
import { t as expectedOwnerParam } from "./expected-bucket-owner-j5BCLzAB.js";
|
|
14
|
+
import { Ct as isReadableBag, Et as shouldRetainResource, Ot as stackInstanceIdCarriedFrom, St as importableOutputs, Tt as orphansCarriedFrom, _t as acceptedCreateOnlyDropsOf, bt as hasReadableExportSet, gt as slowCcOperationTimeoutMs, vt as describeRegionValueKind, wt as orphansAfterRollback, xt as importableOutputKeys, yt as exportNamesCarriedFrom } from "./delete-started-E38sSyUX.js";
|
|
15
|
+
import { $n as WHOLE_DYNAMIC_REFERENCE_PATTERN, An as splitGetAttStringForm, C as maskedLeafCoordinatesOf, Cn as dynamicReferenceTokens, Ct as errorCauseChain, D as noEchoOutputsComparison, E as noEchoLeavesOf, Et as maskSecretsInText, Gt as identityKeyFor, Ht as spelledKeysOf, I as valueAtCoordinate, Jn as recordNoEchoAttributeValues, Kn as recordMaskOnlyValue, Lt as scrubResourceRecord, M as readsNoEchoSource, P as recordedNoEchoValuesOf, Q as redactForState, Qt as inheritNestedStackParameterAssociations, R as liveMatchesUnresolvedTokenFrame, Rt as withPhysicalNameCopies, S as maskWholeValue, St as createSecretMasker, T as noEchoCoordinatesOf, Tt as maskSecretsInError, Un as provenPublicValue, Ut as pathCrossesDottedKey, Vt as isUncertifiedBaselineMaskPosition, Xn as recordProvenPublicExpression, Yn as recordNoEchoParameterFreshValue, Zn as wholeStringLeavesOf, _n as physicalNameCopiesOf, _t as recordLogOnlyParameterValue, b as maskAtCoordinates, bt as shareLogOnlyValues, ct as carryLogOnlyValues, ft as hasMaskableValues, g as canonicalCoordinates, gt as printingCorpusOf, hn as keepTemplateLiteralLeaves, jn as carriesSecretMask, mt as logOnlyValueCount, pt as literalSplitDelimitersOf, qn as recordMaskOnlyValuesIn, tr as isSingleDynamicReferenceToken, un as recordNestedStackParameterExpressions, ut as createUnionSecretMasker, v as isMarkedCoordinate, x as maskReadbackAtCoordinates, xn as DYNAMIC_REFERENCE_TOKEN_SCAN, xt as unionOfSecretBags, yn as recordPhysicalNameCopy, yt as recordLogOnlyValue } from "./replacement-rules-BkUZIP44.js";
|
|
16
|
+
import { S as unsettledPropertiesOf, T as withoutUnsettledProperties, b as unsettledItemsOf, w as withUnsettledProperties, y as unsettledItemsField } from "./restore-source-guard-1UD7ucv5.js";
|
|
17
|
+
import { u as differingIdentityWarning } from "./identity-read-denied-BhnkMyxk.js";
|
|
18
|
+
import { n as isRedactedRecordedValue } from "./redacted-delete-address-CkcTwr-O.js";
|
|
19
|
+
import { a as withResourceDeadline } from "./resource-deadline-B2z0yyKo.js";
|
|
20
|
+
import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-kW_K5U02.js";
|
|
21
21
|
import { t as cdkdCacheHome } from "./cache-home-BVYKj3de.js";
|
|
22
22
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
23
23
|
import { CopyObjectCommand, CreateBucketCommand, DeleteBucketCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetObjectCommand, HeadBucketCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, NotFound, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutBucketVersioningCommand, PutObjectCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
24
24
|
import { GetRoleCommand, GetUserCommand } from "@aws-sdk/client-iam";
|
|
25
25
|
import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
26
26
|
import { DescribeSecurityGroupRulesCommand } from "@aws-sdk/client-ec2";
|
|
27
|
-
import {
|
|
27
|
+
import { CreateChangeSetCommand, DeleteChangeSetCommand, DescribeChangeSetCommand, DescribeStackEventsCommand, DescribeStacksCommand, ExecuteChangeSetCommand, GetTemplateCommand, UpdateStackCommand, waitUntilChangeSetCreateComplete, waitUntilStackImportComplete, waitUntilStackUpdateComplete } from "@aws-sdk/client-cloudformation";
|
|
28
28
|
import { GetSecretValueCommand, SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
|
|
29
29
|
import { GetParameterCommand, SSMClient } from "@aws-sdk/client-ssm";
|
|
30
30
|
import { DescribeLogStreamsCommand, ResourceNotFoundException as ResourceNotFoundException$1 } from "@aws-sdk/client-cloudwatch-logs";
|
|
@@ -39,10 +39,10 @@ import { CreateAliasCommand, CreateKeyCommand, DescribeKeyCommand, KMSClient, Sc
|
|
|
39
39
|
import { A2A_CONTAINER_PORT, A2A_PATH, AGENTCORE_A2A_PROTOCOL, AGENTCORE_AGUI_PROTOCOL, AGENTCORE_MCP_PROTOCOL, ConnectionRegistry, DEFAULT_AWS_EMULATOR_URL, DynamicReferenceResolver, EMULATOR_SCRUBBED_ENV_KEYS, EcsTaskResolutionError, MCP_CONTAINER_PORT, MCP_PATH, UNNAMED_WORKLOAD, a2aInvokeOnce, addAlbSpecificOptions, addAwsEndpointOptions, addCommonEcsServiceOptions, addImageOverrideOptions, addStartServiceSpecificOptions, albStrategy, applyWorkloadAwsWiringToEnv, attachAuthorizers, attachStageContext, availableApiIdentifiers, awaitLoopbackForwarderStatus, awsEmulatorEnvName, awsEmulatorRealServices, awsEmulatorSqsHostBlocks, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildNamespaceOwnerForwarderDockerArgs, buildStageMap, canonicalizeImageOverrideKeys, classifySourceChange, containsCrossStackIntrinsic, containsDynamicReference, createAuthorizerCache, createFileWatcher, createFileWatcher as createFileWatcher$1, createJwksCache, createMixedModeStateProvider, createWatchPredicates, defaultCredentialsLoader, describeAwsFailureForWarn, describeForwarderFailure, discoverRoutes, discoverWebSocketApis, dockerRegistryEnv, downloadAndExtractS3Bundle, effectiveLoopbackPorts, enforceImageOverrideOrphans, expandNestedStacks, filterRoutesByApiIdentifier, firstUsableRegion, getActiveWorkloadAwsWiring, getAwsEndpointOverride, groupRoutesByServer, groupWorkloadsRoutedApart, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, isAwsServiceRoutedToEmulator, keysNotFromTemplate, keysOverriddenBy, logMixedModeForWorkload, loopbackForwarderPlan, mcpInvokeOnce, noImplicitEcrPullArgs, parseAwsEndpoint, parseConnectionsPath, parseImageOverrideFlags, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, readAwsEmulatorEnvVarsFile, readEmulatorRunFiles, readEnvVarsFileText, readMtlsMaterialsFromDisk, realAwsServicesOf, resolveAgentCoreTarget, resolveAwsEmulatorOption, resolveDynamicReferencesInEnv, resolveEnvVars, resolveHostDefaultCredentials, resolveImageOverrides, resolveJwtAuthorizerIntrinsics, resolveSingleTarget, resolveWatchConfig, resolveWorkloadAwsWiring, runEcsServiceEmulator, runImageOverrideBuilds, setActiveWorkloadAwsWiring, setAwsEndpointOverride, signAgentCoreInvocation, startApiServer, topLevelStacks, verifyJwtViaDiscovery, waitForAgentCorePing, warnUnenforcedRouteAuthSettings, withNestedDescendants, withoutKeys } from "cdk-local/internal";
|
|
40
40
|
import { isDeepStrictEqual, promisify } from "node:util";
|
|
41
41
|
import graphlib from "graphlib";
|
|
42
|
-
import { Command, InvalidArgumentError, Option } from "commander";
|
|
43
42
|
import * as readline$1 from "node:readline/promises";
|
|
44
43
|
import readline from "node:readline/promises";
|
|
45
|
-
import { Document,
|
|
44
|
+
import { Document, Scalar, isScalar, parse, stringify, visit } from "yaml";
|
|
45
|
+
import { Command, InvalidArgumentError, Option } from "commander";
|
|
46
46
|
import { emitKeypressEvents } from "node:readline";
|
|
47
47
|
import { collectSsmParameterRefs, createLocalStartAgentCoreCommand, createLocalStartCloudFrontCommand, createLocalStartMicrovmCommand, createLocalStartWebFunctionCommand, createLocalStateProvider, getEmbedConfig, isCfnFlagPresent, listTargets, rejectExplicitCfnStackWithMultipleStacks, resolveCfnFallbackRegion, resolveCfnStackName, resolveSsmParameters, setEmbedConfig, substituteAgainstState, substituteAgainstStateAsync, substituteEnvVarsFromState, substituteEnvVarsFromStateAsync } from "cdk-local";
|
|
48
48
|
import { WebSocketServer } from "ws";
|
|
@@ -1176,40 +1176,6 @@ function createListCommand() {
|
|
|
1176
1176
|
return cmd;
|
|
1177
1177
|
}
|
|
1178
1178
|
|
|
1179
|
-
// src/cli/commands/confirm-prompt.ts
|
|
1180
|
-
let promptQueue = Promise.resolve();
|
|
1181
|
-
function serializePrompt(ask) {
|
|
1182
|
-
const asked = promptQueue.then(ask);
|
|
1183
|
-
promptQueue = asked.catch(() => void 0);
|
|
1184
|
-
return asked;
|
|
1185
|
-
}
|
|
1186
|
-
async function promptYesNo(prompt) {
|
|
1187
|
-
const rl = readline$1.createInterface({
|
|
1188
|
-
input: process.stdin,
|
|
1189
|
-
output: process.stdout
|
|
1190
|
-
});
|
|
1191
|
-
try {
|
|
1192
|
-
const ans = await rl.question(`${prompt} [Y/n] `);
|
|
1193
|
-
return /^(y(es)?)?$/i.test(ans.trim());
|
|
1194
|
-
} finally {
|
|
1195
|
-
rl.close();
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
const DEFAULT_CONFIRM_SUFFIX = " [y/N] ";
|
|
1199
|
-
async function confirmOrRefuse(prompt, options) {
|
|
1200
|
-
if (process.stdin.isTTY !== true) throw new CdkdError(options.refusal, "NON_INTERACTIVE_CONFIRM");
|
|
1201
|
-
const rl = readline$1.createInterface({
|
|
1202
|
-
input: process.stdin,
|
|
1203
|
-
output: options.output ?? process.stdout
|
|
1204
|
-
});
|
|
1205
|
-
try {
|
|
1206
|
-
const ans = await rl.question(`${prompt}${options.suffix ?? " [y/N] "}`);
|
|
1207
|
-
return /^y(es)?$/i.test(ans.trim());
|
|
1208
|
-
} finally {
|
|
1209
|
-
rl.close();
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
1179
|
// src/cli/commands/require-approval.ts
|
|
1214
1180
|
const REQUIRE_APPROVAL_VALUES = [
|
|
1215
1181
|
"never",
|
|
@@ -1595,7 +1561,7 @@ function collectCrossStackRefs(node, onRef, unconditional) {
|
|
|
1595
1561
|
// src/provisioning/register-providers.ts
|
|
1596
1562
|
let providerClasses;
|
|
1597
1563
|
function loadProviderClasses() {
|
|
1598
|
-
providerClasses ??= import("./provider-classes-
|
|
1564
|
+
providerClasses ??= import("./provider-classes-BMrkl7zN.js");
|
|
1599
1565
|
return providerClasses;
|
|
1600
1566
|
}
|
|
1601
1567
|
function registerAllProviders(registry, classes) {
|
|
@@ -2651,7 +2617,7 @@ function replaceResourcesForStack(ids, stackName, template) {
|
|
|
2651
2617
|
|
|
2652
2618
|
// src/deployment/recreate-targets/validate.ts
|
|
2653
2619
|
const EMPTY_ALLOW_SET$1 = /* @__PURE__ */ new Set();
|
|
2654
|
-
const NESTED_STACK_RESOURCE_TYPE
|
|
2620
|
+
const NESTED_STACK_RESOURCE_TYPE = "AWS::CloudFormation::Stack";
|
|
2655
2621
|
function validateRecreateTargets(input) {
|
|
2656
2622
|
const seenCcApi = new Set(input.recreateViaCcApi);
|
|
2657
2623
|
const seenSdk = new Set(input.recreateViaSdkProvider ?? []);
|
|
@@ -2758,7 +2724,7 @@ function validateRecreateTargets(input) {
|
|
|
2758
2724
|
blockedNoCcRoute,
|
|
2759
2725
|
blockedCcBroken,
|
|
2760
2726
|
conflictingDirections,
|
|
2761
|
-
nestedStackLogicalIds: Object.entries(input.template.Resources ?? {}).filter(([, resource]) => resource?.Type === NESTED_STACK_RESOURCE_TYPE
|
|
2727
|
+
nestedStackLogicalIds: Object.entries(input.template.Resources ?? {}).filter(([, resource]) => resource?.Type === NESTED_STACK_RESOURCE_TYPE).map(([id]) => id)
|
|
2762
2728
|
};
|
|
2763
2729
|
}
|
|
2764
2730
|
|
|
@@ -2797,7 +2763,7 @@ function renderRecreateTargetsErrors(validation) {
|
|
|
2797
2763
|
if (lines.length > 0) lines.push("");
|
|
2798
2764
|
lines.push(`${FLAG_UMBRELLA} refuses to operate on ${validation.blockedNestedStackTargets.length} nested-stack resource(s):`);
|
|
2799
2765
|
for (const blocked of validation.blockedNestedStackTargets) {
|
|
2800
|
-
const templateType = validation.nestedStackLogicalIds.includes(blocked.logicalId) ? NESTED_STACK_RESOURCE_TYPE
|
|
2766
|
+
const templateType = validation.nestedStackLogicalIds.includes(blocked.logicalId) ? NESTED_STACK_RESOURCE_TYPE : void 0;
|
|
2801
2767
|
const shown = templateType && templateType !== blocked.resourceType ? `${recordedTypeShown(blocked.resourceType)} in state, ${templateType} in the template` : recordedTypeShown(blocked.resourceType);
|
|
2802
2768
|
lines.push(` - ${blocked.logicalId} (${shown})`);
|
|
2803
2769
|
}
|
|
@@ -3603,6 +3569,28 @@ function checkPinCcApiOptions(options, targetStacks, logger) {
|
|
|
3603
3569
|
}
|
|
3604
3570
|
}
|
|
3605
3571
|
|
|
3572
|
+
// src/cli/commands/deploy/dependency-closure.ts
|
|
3573
|
+
function withDependencyStacks(selected, allStacks, onAdd) {
|
|
3574
|
+
const inferred = inferCrossStackDepsByStack(allStacks, { kinds: ["ImportValue"] });
|
|
3575
|
+
const inApp = new Set(allStacks);
|
|
3576
|
+
const out = [...selected];
|
|
3577
|
+
const included = new Set(selected);
|
|
3578
|
+
const add = (stack) => {
|
|
3579
|
+
const deps = /* @__PURE__ */ new Set();
|
|
3580
|
+
for (const depName of stack.dependencyNames) for (const dep of stacksForDependency(depName, stack, allStacks)) deps.add(dep);
|
|
3581
|
+
for (const producer of inferred.get(stack) ?? []) if (producer !== stack && inApp.has(producer)) deps.add(producer);
|
|
3582
|
+
for (const dep of deps) {
|
|
3583
|
+
if (included.has(dep)) continue;
|
|
3584
|
+
included.add(dep);
|
|
3585
|
+
out.push(dep);
|
|
3586
|
+
onAdd?.(dep, stack);
|
|
3587
|
+
add(dep);
|
|
3588
|
+
}
|
|
3589
|
+
};
|
|
3590
|
+
for (const stack of selected) add(stack);
|
|
3591
|
+
return out;
|
|
3592
|
+
}
|
|
3593
|
+
|
|
3606
3594
|
// src/cli/commands/deploy/command.ts
|
|
3607
3595
|
async function deployCommand(stacks, options) {
|
|
3608
3596
|
const runClock = new PhaseClock("run", { fromProcessStart: true });
|
|
@@ -3723,19 +3711,9 @@ async function deployCommand(stacks, options) {
|
|
|
3723
3711
|
for (const producer of inferred.get(stack) ?? []) if (producer !== stack && inPool.has(producer)) deps.add(producer);
|
|
3724
3712
|
return deps;
|
|
3725
3713
|
};
|
|
3726
|
-
const inferredStrongCrossStackDeps = inferCrossStackDepsByStack(allStacks, { kinds: ["ImportValue"] });
|
|
3727
3714
|
if (!options.exclusively) {
|
|
3728
|
-
const
|
|
3729
|
-
|
|
3730
|
-
for (const depStack of dependencyStacks(stack, inferredStrongCrossStackDeps, allStacks)) {
|
|
3731
|
-
if (included.has(depStack)) continue;
|
|
3732
|
-
included.add(depStack);
|
|
3733
|
-
targetStacks.push(depStack);
|
|
3734
|
-
logger.debug(`Auto-including dependency stack: ${depStack.stackName} (required by ${stack.stackName})`);
|
|
3735
|
-
addDependencies(depStack);
|
|
3736
|
-
}
|
|
3737
|
-
};
|
|
3738
|
-
for (const stack of [...targetStacks]) addDependencies(stack);
|
|
3715
|
+
const withDependencies = withDependencyStacks(targetStacks, allStacks, (dep, by) => logger.debug(`Auto-including dependency stack: ${dep.stackName} (required by ${by.stackName})`));
|
|
3716
|
+
targetStacks.splice(0, targetStacks.length, ...withDependencies);
|
|
3739
3717
|
}
|
|
3740
3718
|
const selectedNames = new Set(targetStacks.map((s) => s.stackName));
|
|
3741
3719
|
const selectedSet = new Set(targetStacks);
|
|
@@ -3962,6 +3940,38 @@ function createDeployCommand() {
|
|
|
3962
3940
|
var CrossStackPreview = class {
|
|
3963
3941
|
exports = /* @__PURE__ */ new Map();
|
|
3964
3942
|
outputs = /* @__PURE__ */ new Map();
|
|
3943
|
+
taintedExports = /* @__PURE__ */ new Set();
|
|
3944
|
+
taintedOutputs = /* @__PURE__ */ new Set();
|
|
3945
|
+
taintedTexts = /* @__PURE__ */ new Set();
|
|
3946
|
+
everyExportTainted = false;
|
|
3947
|
+
nestedOutputsTaintedOutside;
|
|
3948
|
+
exportTainted(_region, name) {
|
|
3949
|
+
return this.everyExportTainted || this.taintedExports.has(name);
|
|
3950
|
+
}
|
|
3951
|
+
stackOutputTainted(_region, stackName, outputName) {
|
|
3952
|
+
return this.taintedOutputs.has(JSON.stringify([stackName, outputName])) || this.nestedOutputsTaintedOutside !== void 0 && !this.nestedOutputsTaintedOutside.has(stackName);
|
|
3953
|
+
}
|
|
3954
|
+
markNestedOutputsTainted(topLevelStackNames) {
|
|
3955
|
+
this.nestedOutputsTaintedOutside = topLevelStackNames;
|
|
3956
|
+
}
|
|
3957
|
+
holdsAnyTaint() {
|
|
3958
|
+
return this.anyTainted() || this.taintedExports.size > 0;
|
|
3959
|
+
}
|
|
3960
|
+
anyTainted() {
|
|
3961
|
+
return this.everyExportTainted || this.taintedOutputs.size > 0;
|
|
3962
|
+
}
|
|
3963
|
+
taintedValues() {
|
|
3964
|
+
return this.taintedTexts;
|
|
3965
|
+
}
|
|
3966
|
+
markTainted(stackName, outputName, exportName, values = []) {
|
|
3967
|
+
const outputKey = JSON.stringify([stackName, outputName]);
|
|
3968
|
+
const added = !this.taintedOutputs.has(outputKey);
|
|
3969
|
+
this.taintedOutputs.add(outputKey);
|
|
3970
|
+
if (exportName === null) this.everyExportTainted = true;
|
|
3971
|
+
else if (exportName !== void 0) this.taintedExports.add(exportName);
|
|
3972
|
+
for (const value of values) if (isScalar$1(value) && value !== "" && value !== "***") this.taintedTexts.add(String(value));
|
|
3973
|
+
return added;
|
|
3974
|
+
}
|
|
3965
3975
|
exportValue(region, name) {
|
|
3966
3976
|
return this.exports.get(key(region, name));
|
|
3967
3977
|
}
|
|
@@ -4041,8 +4051,27 @@ async function resolvedExportNames(template, resolve) {
|
|
|
4041
4051
|
}
|
|
4042
4052
|
return names;
|
|
4043
4053
|
}
|
|
4054
|
+
async function markProducerTaint(preview, resolve, input, exportNames) {
|
|
4055
|
+
const reads = input.readsSecretFedName;
|
|
4056
|
+
if (reads === void 0) return;
|
|
4057
|
+
const exportNameOf = exportNames ?? await resolvedExportNames(input.template, resolve);
|
|
4058
|
+
const stored = input.storedOutputs ?? {};
|
|
4059
|
+
for (const [outputName, definition] of Object.entries(input.template.Outputs ?? {})) {
|
|
4060
|
+
const output = definition;
|
|
4061
|
+
const secretName = reads(output?.Export);
|
|
4062
|
+
if (!reads(output?.Value) && !secretName) continue;
|
|
4063
|
+
const exportName = exportNameOf.get(outputName) ?? (output?.Export === void 0 ? void 0 : null);
|
|
4064
|
+
preview.markTainted(input.stackName, outputName, exportName, [
|
|
4065
|
+
Object.hasOwn(input.desiredOutputs, outputName) ? input.desiredOutputs[outputName] : void 0,
|
|
4066
|
+
Object.hasOwn(stored, outputName) ? stored[outputName] : void 0,
|
|
4067
|
+
...typeof exportName === "string" ? [Object.hasOwn(stored, exportName) ? stored[exportName] : void 0] : [],
|
|
4068
|
+
...secretName && typeof exportName === "string" ? [exportName] : []
|
|
4069
|
+
]);
|
|
4070
|
+
}
|
|
4071
|
+
}
|
|
4044
4072
|
async function recordProducerPreview(preview, region, resolve, input) {
|
|
4045
4073
|
const exportNameOf = await resolvedExportNames(input.template, resolve);
|
|
4074
|
+
await markProducerTaint(preview, resolve, input, exportNameOf);
|
|
4046
4075
|
const readsUnknownPreview = (value) => crossStackReads(value).some((read) => {
|
|
4047
4076
|
return (read.kind === "export" ? preview.exportValue(region, read.name) : preview.stackOutput(read.region ?? region, read.stackName, read.outputName))?.kind === "unknown";
|
|
4048
4077
|
});
|
|
@@ -4100,636 +4129,131 @@ function orderProducersFirst(stacks, dependenciesOf) {
|
|
|
4100
4129
|
return ordered;
|
|
4101
4130
|
}
|
|
4102
4131
|
|
|
4103
|
-
// src/cli/commands/
|
|
4104
|
-
const
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
// src/cli/cfn-stack-states.ts
|
|
4109
|
-
const STABLE_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
4110
|
-
"CREATE_COMPLETE",
|
|
4111
|
-
"UPDATE_COMPLETE",
|
|
4112
|
-
"UPDATE_ROLLBACK_COMPLETE",
|
|
4113
|
-
"IMPORT_COMPLETE",
|
|
4114
|
-
"IMPORT_ROLLBACK_COMPLETE"
|
|
4115
|
-
]);
|
|
4116
|
-
|
|
4117
|
-
// src/cli/commands/retire-cfn-stack/failure-text.ts
|
|
4118
|
-
const SUPERSEDED_COPY_HINT = "If that update completes (now or later), CloudFormation may have replaced resources; each superseded copy is RETAINED and managed by neither CloudFormation nor cdkd. Find them in the stack's events: rows whose reason reads \"Requested update requires the creation of a new physical resource\" name the old physical id. A re-run does not report them, because the template then already carries the Retain policies and no update runs.";
|
|
4119
|
-
const MANUAL_RETIREMENT_ROUTE = "To retire the stack by hand: (1) UpdateStack with DeletionPolicy=Retain and UpdateReplacePolicy=Retain on every resource, (2) `cdkd import` without --migrate-from-cloudformation (it reads the physical ids from a same-named CloudFormation stack), (3) DeleteStack. The import must adopt every resource before you delete the stack: check its summary.";
|
|
4120
|
-
function describeStackWaiterFailure(error) {
|
|
4121
|
-
if (!(error instanceof Error)) return void 0;
|
|
4122
|
-
let parsed;
|
|
4123
|
-
try {
|
|
4124
|
-
parsed = JSON.parse(error.message);
|
|
4125
|
-
} catch {
|
|
4126
|
-
return;
|
|
4127
|
-
}
|
|
4128
|
-
if (typeof parsed !== "object" || parsed === null || !("state" in parsed)) return void 0;
|
|
4129
|
-
const result = parsed;
|
|
4130
|
-
const state = typeof result.state === "string" ? result.state : "FAILURE";
|
|
4131
|
-
const reason = result.reason;
|
|
4132
|
-
const stacks = typeof reason === "object" && reason !== null && "Stacks" in reason ? reason.Stacks : void 0;
|
|
4133
|
-
const stack = Array.isArray(stacks) && typeof stacks[0] === "object" ? stacks[0] : void 0;
|
|
4134
|
-
const status = typeof stack?.StackStatus === "string" ? stack.StackStatus : void 0;
|
|
4135
|
-
const statusReason = typeof stack?.StackStatusReason === "string" ? stack.StackStatusReason : void 0;
|
|
4136
|
-
return `waiter ${state}` + (status ? `, stack status ${status}` : typeof reason === "string" ? `: ${reason}` : "") + (statusReason ? ` (${statusReason})` : "");
|
|
4137
|
-
}
|
|
4138
|
-
function cfnFailureText(error) {
|
|
4139
|
-
const waiter = describeStackWaiterFailure(error);
|
|
4140
|
-
if (waiter !== void 0 && error instanceof Error) {
|
|
4141
|
-
try {
|
|
4142
|
-
Object.defineProperty(error, "message", {
|
|
4143
|
-
value: waiter,
|
|
4144
|
-
writable: true,
|
|
4145
|
-
configurable: true,
|
|
4146
|
-
enumerable: false
|
|
4147
|
-
});
|
|
4148
|
-
Object.defineProperty(error, "stack", {
|
|
4149
|
-
value: `${error.name}: ${waiter}`,
|
|
4150
|
-
writable: true,
|
|
4151
|
-
configurable: true,
|
|
4152
|
-
enumerable: false
|
|
4153
|
-
});
|
|
4154
|
-
} catch {}
|
|
4155
|
-
return waiter;
|
|
4156
|
-
}
|
|
4157
|
-
const failure = describeAwsFailure(error);
|
|
4158
|
-
if (failure.redacted) getLogger().debug(safeMsg`CloudFormation failure detail: ${failure.detail}`);
|
|
4159
|
-
return failure.summary.replace(/\.+$/, "");
|
|
4160
|
-
}
|
|
4161
|
-
var RetainUpdateFailedError = class extends Error {
|
|
4162
|
-
cause;
|
|
4163
|
-
constructor(cfnStackName, kind, cause) {
|
|
4164
|
-
const text = cfnFailureText(cause);
|
|
4165
|
-
super(safeMsg`The Retain-policy UpdateStack on CloudFormation stack ${displaySafe(cfnStackName)} ` + (kind === "rejected" ? "was rejected" : "did not complete") + safeMsg`: ${text}. cdkd state has not been written. ` + (kind === "unfinished" ? `${SUPERSEDED_COPY_HINT} ` : "") + "Re-run the same command once the cause is fixed. When the cause is a replacement CloudFormation cannot perform (a custom-named resource whose update requires replacing it), the same update by hand fails too: give that resource no custom name or a new one, or take it out of the stack, then re-run. To retire the stack by hand: (1) UpdateStack with DeletionPolicy=Retain and UpdateReplacePolicy=Retain on every resource, (2) `cdkd import` without --migrate-from-cloudformation (it reads the physical ids from a same-named CloudFormation stack), (3) DeleteStack. The import must adopt every resource before you delete the stack: check its summary.");
|
|
4166
|
-
this.name = "RetainUpdateFailedError";
|
|
4167
|
-
this.cause = cause;
|
|
4168
|
-
}
|
|
4169
|
-
};
|
|
4170
|
-
|
|
4171
|
-
// src/cli/yaml-cfn.ts
|
|
4172
|
-
const FN_TAGS = [
|
|
4173
|
-
"GetAtt",
|
|
4174
|
-
"Sub",
|
|
4175
|
-
"Join",
|
|
4176
|
-
"Select",
|
|
4177
|
-
"Split",
|
|
4178
|
-
"If",
|
|
4179
|
-
"Equals",
|
|
4180
|
-
"And",
|
|
4181
|
-
"Or",
|
|
4182
|
-
"Not",
|
|
4183
|
-
"FindInMap",
|
|
4184
|
-
"Base64",
|
|
4185
|
-
"Cidr",
|
|
4186
|
-
"GetAZs",
|
|
4187
|
-
"ImportValue",
|
|
4188
|
-
"Length",
|
|
4189
|
-
"ToJsonString",
|
|
4190
|
-
"ForEach"
|
|
4191
|
-
];
|
|
4192
|
-
function nodeJs(node) {
|
|
4193
|
-
if (node === null || node === void 0) return null;
|
|
4194
|
-
if (typeof node === "object" && node !== null && "toJSON" in node) return node.toJSON();
|
|
4195
|
-
return node;
|
|
4196
|
-
}
|
|
4197
|
-
function buildCustomTags() {
|
|
4198
|
-
const tags = [];
|
|
4199
|
-
tags.push({
|
|
4200
|
-
tag: "!Ref",
|
|
4201
|
-
resolve(value) {
|
|
4202
|
-
return { Ref: value };
|
|
4203
|
-
},
|
|
4204
|
-
identify: () => false
|
|
4205
|
-
});
|
|
4206
|
-
tags.push({
|
|
4207
|
-
tag: "!Condition",
|
|
4208
|
-
resolve(value) {
|
|
4209
|
-
return { Condition: value };
|
|
4210
|
-
},
|
|
4211
|
-
identify: () => false
|
|
4212
|
-
});
|
|
4213
|
-
tags.push({
|
|
4214
|
-
tag: "!Transform",
|
|
4215
|
-
collection: "map",
|
|
4216
|
-
resolve(node) {
|
|
4217
|
-
return { "Fn::Transform": nodeJs(node) };
|
|
4218
|
-
},
|
|
4219
|
-
identify: () => false
|
|
4220
|
-
});
|
|
4221
|
-
tags.push({
|
|
4222
|
-
tag: "!GetAtt",
|
|
4223
|
-
resolve(value) {
|
|
4224
|
-
const dot = value.indexOf(".");
|
|
4225
|
-
if (dot < 0) throw new Error(`${GETATT_SHAPE_REFUSAL}; got '${value}'`);
|
|
4226
|
-
return { "Fn::GetAtt": [value.slice(0, dot), value.slice(dot + 1)] };
|
|
4227
|
-
},
|
|
4228
|
-
identify: () => false
|
|
4229
|
-
});
|
|
4230
|
-
tags.push({
|
|
4231
|
-
tag: "!GetAtt",
|
|
4232
|
-
collection: "seq",
|
|
4233
|
-
resolve(node) {
|
|
4234
|
-
return { "Fn::GetAtt": nodeJs(node) };
|
|
4235
|
-
},
|
|
4236
|
-
identify: () => false
|
|
4237
|
-
});
|
|
4238
|
-
for (const name of FN_TAGS) {
|
|
4239
|
-
if (name === "GetAtt") continue;
|
|
4240
|
-
const longKey = `Fn::${name}`;
|
|
4241
|
-
tags.push({
|
|
4242
|
-
tag: `!${name}`,
|
|
4243
|
-
resolve(value) {
|
|
4244
|
-
return { [longKey]: value };
|
|
4245
|
-
},
|
|
4246
|
-
identify: () => false
|
|
4247
|
-
});
|
|
4248
|
-
tags.push({
|
|
4249
|
-
tag: `!${name}`,
|
|
4250
|
-
collection: "seq",
|
|
4251
|
-
resolve(node) {
|
|
4252
|
-
return { [longKey]: nodeJs(node) };
|
|
4253
|
-
},
|
|
4254
|
-
identify: () => false
|
|
4255
|
-
});
|
|
4256
|
-
tags.push({
|
|
4257
|
-
tag: `!${name}`,
|
|
4258
|
-
collection: "map",
|
|
4259
|
-
resolve(node) {
|
|
4260
|
-
return { [longKey]: nodeJs(node) };
|
|
4261
|
-
},
|
|
4262
|
-
identify: () => false
|
|
4263
|
-
});
|
|
4264
|
-
}
|
|
4265
|
-
return tags;
|
|
4266
|
-
}
|
|
4267
|
-
const CUSTOM_TAGS = buildCustomTags();
|
|
4268
|
-
const GETATT_SHAPE_REFUSAL = "!GetAtt requires '<LogicalId>.<Attribute>'";
|
|
4269
|
-
const YAML_ALIAS_EXHAUSTION = "Excessive alias count indicates a resource exhaustion attack";
|
|
4270
|
-
function describeYamlFinding(err) {
|
|
4271
|
-
if (err instanceof YAMLError) {
|
|
4272
|
-
const at = err.linePos?.[0];
|
|
4273
|
-
const where = at ? ` at line ${at.line}, column ${at.col}` : "";
|
|
4274
|
-
if (err.code === "TAG_RESOLVE_FAILED" && err.message.startsWith(GETATT_SHAPE_REFUSAL)) return `${GETATT_SHAPE_REFUSAL}${where}`;
|
|
4275
|
-
return `${err.name} ${err.code}${where}`;
|
|
4276
|
-
}
|
|
4277
|
-
if (err instanceof Error) return err.message === YAML_ALIAS_EXHAUSTION ? `${err.name}: ${YAML_ALIAS_EXHAUSTION}` : err.name || "Error";
|
|
4278
|
-
return describeAwsFailure(err).detail;
|
|
4279
|
-
}
|
|
4280
|
-
function parseYamlTemplate(body) {
|
|
4281
|
-
const doc = parseDocument(body, { customTags: CUSTOM_TAGS });
|
|
4282
|
-
const logger = getLogger();
|
|
4283
|
-
for (const warning of doc.warnings) {
|
|
4284
|
-
logger.debug(safeMsg`Template YAML warning: ${parseFailureDebugDetail(warning)}`);
|
|
4285
|
-
logger.warn(safeMsg`Template YAML warning: ${describeYamlFinding(warning)}`);
|
|
4286
|
-
}
|
|
4287
|
-
if (doc.errors.length > 0) throw doc.errors[0];
|
|
4288
|
-
return doc.toJS();
|
|
4289
|
-
}
|
|
4290
|
-
function parseCfnTemplate(text) {
|
|
4291
|
-
const format = detectTemplateFormat(text);
|
|
4292
|
-
const body = text.charCodeAt(0) === 65279 ? text.slice(1) : text;
|
|
4293
|
-
let parsed;
|
|
4294
|
-
if (format === "json") try {
|
|
4295
|
-
parsed = JSON.parse(body);
|
|
4296
|
-
} catch (err) {
|
|
4297
|
-
getLogger().debug(safeMsg`Template failed to parse as JSON: ${parseFailureDebugDetail(err)}`);
|
|
4298
|
-
throw new Error(`Template is not valid JSON. Cause: ${describeJsonParseFailure(err, utf8ByteLength(body))}`);
|
|
4299
|
-
}
|
|
4300
|
-
else try {
|
|
4301
|
-
parsed = parseYamlTemplate(body);
|
|
4302
|
-
} catch (err) {
|
|
4303
|
-
getLogger().debug(safeMsg`Template failed to parse as YAML: ${parseFailureDebugDetail(err)}`);
|
|
4304
|
-
throw new Error(`Template is not valid YAML. Cause: ${describeYamlFinding(err)}`);
|
|
4305
|
-
}
|
|
4306
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error(`Template root is not an object.`);
|
|
4307
|
-
return parsed;
|
|
4308
|
-
}
|
|
4309
|
-
function stringifyCfnTemplate(template, format) {
|
|
4310
|
-
if (format === "json") return JSON.stringify(template, null, 2);
|
|
4311
|
-
const doc = new Document();
|
|
4312
|
-
doc.contents = jsToYamlNode(template, doc);
|
|
4313
|
-
return stringify(doc, {
|
|
4314
|
-
aliasDuplicateObjects: false,
|
|
4315
|
-
lineWidth: 0
|
|
4316
|
-
});
|
|
4317
|
-
}
|
|
4318
|
-
function jsToYamlNode(value, doc) {
|
|
4319
|
-
if (value === null || value === void 0) return new Scalar(null);
|
|
4320
|
-
if (typeof value !== "object") return doc.createNode(value);
|
|
4321
|
-
if (Array.isArray(value)) {
|
|
4322
|
-
const seq = new YAMLSeq();
|
|
4323
|
-
for (const item of value) seq.items.push(jsToYamlNode(item, doc));
|
|
4324
|
-
return seq;
|
|
4325
|
-
}
|
|
4326
|
-
const keys = Object.keys(value);
|
|
4327
|
-
if (keys.length === 1) {
|
|
4328
|
-
const k = keys[0];
|
|
4329
|
-
const v = value[k];
|
|
4330
|
-
const tag = intrinsicShorthandFor(k);
|
|
4331
|
-
if (tag) return makeIntrinsicNode(tag, v, doc);
|
|
4332
|
-
}
|
|
4333
|
-
const map = new YAMLMap();
|
|
4334
|
-
for (const [k, v] of Object.entries(value)) map.items.push(new Pair(doc.createNode(k), jsToYamlNode(v, doc)));
|
|
4335
|
-
return map;
|
|
4336
|
-
}
|
|
4337
|
-
function intrinsicShorthandFor(key) {
|
|
4338
|
-
if (key === "Ref") return "!Ref";
|
|
4339
|
-
if (key === "Condition") return "!Condition";
|
|
4340
|
-
if (!key.startsWith("Fn::")) return null;
|
|
4341
|
-
const name = key.slice(4);
|
|
4342
|
-
if (name === "Transform") return "!Transform";
|
|
4343
|
-
if (name === "GetAtt") return "!GetAtt";
|
|
4344
|
-
if (FN_TAGS.includes(name)) return `!${name}`;
|
|
4345
|
-
return null;
|
|
4346
|
-
}
|
|
4347
|
-
function makeIntrinsicNode(tag, value, doc) {
|
|
4348
|
-
if (tag === "!Ref" || tag === "!Condition") {
|
|
4349
|
-
const s = new Scalar(typeof value === "string" ? value : String(value));
|
|
4350
|
-
s.tag = tag;
|
|
4351
|
-
return s;
|
|
4352
|
-
}
|
|
4353
|
-
if (tag === "!GetAtt") {
|
|
4354
|
-
if (Array.isArray(value) && value.length === 2 && typeof value[0] === "string" && typeof value[1] === "string") {
|
|
4355
|
-
const s = new Scalar(`${value[0]}.${value[1]}`);
|
|
4356
|
-
s.tag = tag;
|
|
4357
|
-
return s;
|
|
4358
|
-
}
|
|
4359
|
-
const node = jsToYamlNode(value, doc);
|
|
4360
|
-
node.tag = tag;
|
|
4361
|
-
return node;
|
|
4362
|
-
}
|
|
4363
|
-
const node = jsToYamlNode(value, doc);
|
|
4364
|
-
node.tag = tag;
|
|
4365
|
-
return node;
|
|
4366
|
-
}
|
|
4367
|
-
function detectTemplateFormat(text) {
|
|
4368
|
-
const trimmed = (text.charCodeAt(0) === 65279 ? text.slice(1) : text).trimStart();
|
|
4369
|
-
if (trimmed.length === 0) return "json";
|
|
4370
|
-
const first = trimmed.charCodeAt(0);
|
|
4371
|
-
if (first === 123 || first === 91) return "json";
|
|
4372
|
-
return "yaml";
|
|
4373
|
-
}
|
|
4374
|
-
function parseCfnTemplateWithFormat(text) {
|
|
4375
|
-
const format = detectTemplateFormat(text);
|
|
4376
|
-
return {
|
|
4377
|
-
template: parseCfnTemplate(text),
|
|
4378
|
-
format
|
|
4379
|
-
};
|
|
4380
|
-
}
|
|
4381
|
-
|
|
4382
|
-
// src/cli/commands/retire-cfn-stack/retain-injection.ts
|
|
4383
|
-
async function uploadTemplateForUpdateStack(args) {
|
|
4384
|
-
return uploadCfnTemplate({
|
|
4385
|
-
bucket: args.bucket,
|
|
4386
|
-
body: args.body,
|
|
4387
|
-
stackName: args.cfnStackName,
|
|
4388
|
-
...args.format && { format: args.format },
|
|
4389
|
-
...args.s3ClientOpts && { s3ClientOpts: args.s3ClientOpts }
|
|
4390
|
-
});
|
|
4132
|
+
// src/cli/commands/diff-recursive/nested-template.ts
|
|
4133
|
+
const EMPTY_TEMPLATE = { Resources: {} };
|
|
4134
|
+
function isAbsoluteCrossPlatform(p) {
|
|
4135
|
+
return path.isAbsolute(p) || /^[a-zA-Z]:[\\/]/.test(p) || p.startsWith("\\\\");
|
|
4391
4136
|
}
|
|
4392
|
-
function
|
|
4393
|
-
|
|
4394
|
-
let parsed;
|
|
4137
|
+
function readNestedTemplate(templatePath) {
|
|
4138
|
+
let raw;
|
|
4395
4139
|
try {
|
|
4396
|
-
|
|
4140
|
+
raw = fs.readFileSync(templatePath, "utf-8");
|
|
4397
4141
|
} catch (err) {
|
|
4398
|
-
throw new Error(`
|
|
4399
|
-
}
|
|
4400
|
-
if (!("Resources" in parsed) || typeof parsed["Resources"] !== "object" || parsed["Resources"] === null || Array.isArray(parsed["Resources"])) throw new Error(`Template for '${cfnStackName}' has no Resources section — refusing to retire.`);
|
|
4401
|
-
const modified = injectRetainPoliciesOnParsedResources(parsed["Resources"]);
|
|
4402
|
-
return {
|
|
4403
|
-
body: stringifyCfnTemplate(parsed, format),
|
|
4404
|
-
modified,
|
|
4405
|
-
format
|
|
4406
|
-
};
|
|
4407
|
-
}
|
|
4408
|
-
function templateContainsNestedStackRows(templateBody) {
|
|
4409
|
-
let parsed;
|
|
4410
|
-
try {
|
|
4411
|
-
parsed = parseCfnTemplate(templateBody);
|
|
4412
|
-
} catch {
|
|
4413
|
-
return false;
|
|
4414
|
-
}
|
|
4415
|
-
const resources = parsed["Resources"];
|
|
4416
|
-
if (!resources || typeof resources !== "object" || Array.isArray(resources)) return false;
|
|
4417
|
-
for (const resource of Object.values(resources)) {
|
|
4418
|
-
if (!resource || typeof resource !== "object" || Array.isArray(resource)) continue;
|
|
4419
|
-
if (resource["Type"] === "AWS::CloudFormation::Stack") return true;
|
|
4420
|
-
}
|
|
4421
|
-
return false;
|
|
4422
|
-
}
|
|
4423
|
-
function injectRetainPoliciesOnParsedResources(resources) {
|
|
4424
|
-
let modified = false;
|
|
4425
|
-
for (const [, resource] of Object.entries(resources)) {
|
|
4426
|
-
if (!resource || typeof resource !== "object" || Array.isArray(resource)) continue;
|
|
4427
|
-
const r = resource;
|
|
4428
|
-
if (r["Type"] === "AWS::CloudFormation::Stack") continue;
|
|
4429
|
-
if (r["DeletionPolicy"] !== "Retain") {
|
|
4430
|
-
r["DeletionPolicy"] = "Retain";
|
|
4431
|
-
modified = true;
|
|
4432
|
-
}
|
|
4433
|
-
if (r["UpdateReplacePolicy"] !== "Retain") {
|
|
4434
|
-
r["UpdateReplacePolicy"] = "Retain";
|
|
4435
|
-
modified = true;
|
|
4436
|
-
}
|
|
4142
|
+
throw new Error(`Failed to read nested template at ${displayAssemblyPath(templatePath)}: ${describeFileReadFailure(err, templatePath)}`);
|
|
4437
4143
|
}
|
|
4438
|
-
return modified;
|
|
4439
|
-
}
|
|
4440
|
-
async function injectRetainPoliciesRecursive(rootTemplateBody, rootCfnStackName, rootTree, deps) {
|
|
4441
|
-
const cleanups = [];
|
|
4442
4144
|
try {
|
|
4443
|
-
return
|
|
4444
|
-
...await injectRetainPoliciesRecursiveInternal(rootTemplateBody, rootCfnStackName, rootTree, deps, cleanups),
|
|
4445
|
-
cleanups
|
|
4446
|
-
};
|
|
4145
|
+
return JSON.parse(raw);
|
|
4447
4146
|
} catch (err) {
|
|
4448
|
-
throw new
|
|
4147
|
+
throw new Error(`Failed to parse nested template at ${displayAssemblyPath(templatePath)}: ${describeFileReadFailure(err, templatePath)}`);
|
|
4449
4148
|
}
|
|
4450
4149
|
}
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
if (
|
|
4459
|
-
|
|
4460
|
-
};
|
|
4461
|
-
|
|
4462
|
-
const format = detectTemplateFormat(templateBody);
|
|
4463
|
-
let parsed;
|
|
4464
|
-
try {
|
|
4465
|
-
parsed = parseCfnTemplate(templateBody);
|
|
4466
|
-
} catch (err) {
|
|
4467
|
-
throw new Error(`Template for '${cfnStackName}' is not a valid CloudFormation template. cdkd's --migrate-from-cloudformation flow supports both JSON and YAML templates (YAML via a CFn-aware codec that preserves !Ref / !GetAtt / !Sub shorthand). Cause: ${describeAwsFailure(err).detail}`);
|
|
4468
|
-
}
|
|
4469
|
-
if (!("Resources" in parsed) || typeof parsed["Resources"] !== "object" || parsed["Resources"] === null || Array.isArray(parsed["Resources"])) throw new Error(`Template for '${cfnStackName}' has no Resources section — refusing to retire.`);
|
|
4470
|
-
const resources = parsed["Resources"];
|
|
4471
|
-
let modified = false;
|
|
4472
|
-
for (const [logicalId, resource] of Object.entries(resources)) {
|
|
4473
|
-
if (!resource || typeof resource !== "object" || Array.isArray(resource)) continue;
|
|
4474
|
-
const r = resource;
|
|
4475
|
-
if (r["Type"] !== "AWS::CloudFormation::Stack") continue;
|
|
4476
|
-
const childNode = tree.nested.get(logicalId);
|
|
4477
|
-
if (!childNode) throw new Error(`Template for '${cfnStackName}' has nested-stack '${logicalId}' (Type: ${NESTED_STACK_RESOURCE_TYPE}) but the CloudFormation resource tree has no matching child entry. AWS may have removed the child since DescribeStackResources ran, or the template was hand-edited mid-flight — re-run ${proseQuoted(cdkdRemedy("cdkd import", "--migrate-from-cloudformation"), "`")} to refresh.`);
|
|
4478
|
-
const childTpl = await deps.cfnClient.send(new GetTemplateCommand({
|
|
4479
|
-
StackName: childNode.physicalId,
|
|
4480
|
-
TemplateStage: "Original"
|
|
4481
|
-
}));
|
|
4482
|
-
if (!childTpl.TemplateBody) throw new Error(`GetTemplate returned no body for nested stack '${logicalId}' (physicalId='${childNode.physicalId}', parent='${cfnStackName}').`);
|
|
4483
|
-
const childResult = await injectRetainPoliciesRecursiveInternal(childTpl.TemplateBody, childNode.stackName, childNode, deps, cleanups);
|
|
4484
|
-
if (childResult.modified) {
|
|
4485
|
-
if (childResult.body.length > TEMPLATE_URL_LIMIT) throw new Error(`Modified nested-stack template for '${logicalId}' is ${childResult.body.length} bytes, exceeds the CloudFormation TemplateURL limit (${TEMPLATE_URL_LIMIT}). cdkd state has not been written; shrink the child template and retry, or retire the stack manually: (1) UpdateStack with Retain policies on the parent and each child, (2) cdkd import, (3) DeleteStack on the parent.`);
|
|
4486
|
-
const uploaded = await uploadCfnTemplate({
|
|
4487
|
-
bucket: deps.stateBucket,
|
|
4488
|
-
body: childResult.body,
|
|
4489
|
-
stackName: `${cfnStackName}__nested__${logicalId}`,
|
|
4490
|
-
format: childResult.format,
|
|
4491
|
-
...deps.s3ClientOpts && { s3ClientOpts: deps.s3ClientOpts }
|
|
4492
|
-
});
|
|
4493
|
-
cleanups.push(uploaded.cleanup);
|
|
4494
|
-
const propsRaw = r["Properties"];
|
|
4495
|
-
const props = propsRaw && typeof propsRaw === "object" && !Array.isArray(propsRaw) ? propsRaw : r["Properties"] = {};
|
|
4496
|
-
props["TemplateURL"] = uploaded.url;
|
|
4497
|
-
modified = true;
|
|
4498
|
-
}
|
|
4150
|
+
function indexNestedChildTemplates(template, templatePath) {
|
|
4151
|
+
const dir = path.dirname(templatePath);
|
|
4152
|
+
const result = nullPrototypeRecord();
|
|
4153
|
+
for (const [logicalId, resource] of Object.entries(template.Resources ?? {})) {
|
|
4154
|
+
if (resource?.Type !== "AWS::CloudFormation::Stack") continue;
|
|
4155
|
+
const assetPath = resource.Metadata?.["aws:asset:path"];
|
|
4156
|
+
if (typeof assetPath !== "string" || assetPath.length === 0) continue;
|
|
4157
|
+
if (isAbsoluteCrossPlatform(assetPath)) throw new Error(`Nested stack ${displayIdent(logicalId)} has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which is absolute. CDK emits relative asset paths for nested templates; an absolute path indicates the synth output was hand-modified or generated by a non-CDK toolchain. Refusing to load.`);
|
|
4158
|
+
const resolved = resolveAssemblyPath(dir, assetPath);
|
|
4159
|
+
if (!resolved.contained) throw new Error(`Nested stack ${displayIdent(logicalId)} has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which ${renderAssemblyPathEscape(resolved, dir)}`);
|
|
4160
|
+
result[logicalId] = resolved.path;
|
|
4499
4161
|
}
|
|
4500
|
-
|
|
4501
|
-
return {
|
|
4502
|
-
body: stringifyCfnTemplate(parsed, format),
|
|
4503
|
-
modified,
|
|
4504
|
-
format
|
|
4505
|
-
};
|
|
4162
|
+
return result;
|
|
4506
4163
|
}
|
|
4507
4164
|
|
|
4508
|
-
// src/cli/commands/
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
const nestedChildren = [];
|
|
4516
|
-
for (const r of resp.StackResources ?? []) {
|
|
4517
|
-
if (!r.LogicalResourceId || !r.PhysicalResourceId) continue;
|
|
4518
|
-
resources.set(r.LogicalResourceId, r.PhysicalResourceId);
|
|
4519
|
-
if (r.ResourceType === "AWS::CloudFormation::Stack") nestedChildren.push({
|
|
4520
|
-
logicalId: r.LogicalResourceId,
|
|
4521
|
-
childArn: r.PhysicalResourceId
|
|
4522
|
-
});
|
|
4523
|
-
}
|
|
4524
|
-
const childPairs = await Promise.all(nestedChildren.map(async ({ logicalId, childArn }) => ({
|
|
4525
|
-
logicalId,
|
|
4526
|
-
node: await walkCfnStackTree(childArn, childArn, cfnClient)
|
|
4527
|
-
})));
|
|
4528
|
-
const nested = /* @__PURE__ */ new Map();
|
|
4529
|
-
for (const { logicalId, node } of childPairs) nested.set(logicalId, node);
|
|
4530
|
-
return {
|
|
4531
|
-
stackName,
|
|
4532
|
-
physicalId,
|
|
4533
|
-
resources,
|
|
4534
|
-
nested
|
|
4535
|
-
};
|
|
4165
|
+
// src/cli/commands/diff-recursive/cross-stack-taint.ts
|
|
4166
|
+
function crossStackTaintSeedsOf(template, region, preview) {
|
|
4167
|
+
if (preview === void 0 || !preview.anyTainted()) return /* @__PURE__ */ new Set();
|
|
4168
|
+
return crossStackTaintSeeds(template, (source) => {
|
|
4169
|
+
if (source === void 0) return true;
|
|
4170
|
+
return source.kind === "export" ? preview.exportTainted(region, source.name) : preview.stackOutputTainted(source.region ?? region, source.stackName, source.outputName);
|
|
4171
|
+
});
|
|
4536
4172
|
}
|
|
4537
|
-
function
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
const afterId = after.resources.get(logicalId);
|
|
4541
|
-
if (afterId !== void 0 && afterId !== beforeId) replaced.push({
|
|
4542
|
-
nestedPath,
|
|
4543
|
-
logicalId,
|
|
4544
|
-
before: beforeId,
|
|
4545
|
-
after: afterId
|
|
4546
|
-
});
|
|
4547
|
-
}
|
|
4548
|
-
for (const [childLogicalId, beforeChild] of before.nested) {
|
|
4549
|
-
const afterChild = after.nested.get(childLogicalId);
|
|
4550
|
-
if (afterChild) replaced.push(...findReplacedCfnResources(beforeChild, afterChild, [...nestedPath, childLogicalId]));
|
|
4551
|
-
}
|
|
4552
|
-
return replaced;
|
|
4173
|
+
function producerReadsSecretFedName(tainted) {
|
|
4174
|
+
if (tainted === void 0 || tainted.size === 0) return void 0;
|
|
4175
|
+
return (value) => readsTainted(value, tainted);
|
|
4553
4176
|
}
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
logger.debug(`No CloudFormation stack named '${stackName}'.`);
|
|
4562
|
-
return null;
|
|
4563
|
-
}
|
|
4564
|
-
const reason = describeAwsFailure(err).detail;
|
|
4565
|
-
const subject = isPasteableIdent(stackName) ? `CloudFormation stack '${stackName}'` : "a CloudFormation stack whose name is not a plain identifier";
|
|
4566
|
-
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.`);
|
|
4567
|
-
return null;
|
|
4568
|
-
}
|
|
4569
|
-
const resources = /* @__PURE__ */ new Map();
|
|
4570
|
-
for (const r of resp.StackResources ?? []) {
|
|
4571
|
-
if (!r.LogicalResourceId || !r.PhysicalResourceId) continue;
|
|
4572
|
-
resources.set(r.LogicalResourceId, r.PhysicalResourceId);
|
|
4573
|
-
}
|
|
4574
|
-
return resources;
|
|
4177
|
+
const MAX_NESTED_DEPTH$2 = 32;
|
|
4178
|
+
function taintedOutputsOf(template, tainted) {
|
|
4179
|
+
if (tainted.size === 0) return [];
|
|
4180
|
+
return Object.entries(template.Outputs ?? {}).filter(([, raw]) => {
|
|
4181
|
+
const output = raw;
|
|
4182
|
+
return readsTainted(output?.Value, tainted) || readsTainted(output?.Export, tainted);
|
|
4183
|
+
});
|
|
4575
4184
|
}
|
|
4576
|
-
function
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4185
|
+
function readChild(path, cache) {
|
|
4186
|
+
if (!cache.has(path)) try {
|
|
4187
|
+
const template = readNestedTemplate(path);
|
|
4188
|
+
cache.set(path, {
|
|
4189
|
+
template,
|
|
4190
|
+
children: indexNestedChildTemplates(template, path)
|
|
4191
|
+
});
|
|
4192
|
+
} catch {
|
|
4193
|
+
cache.set(path, null);
|
|
4194
|
+
}
|
|
4195
|
+
return cache.get(path) ?? null;
|
|
4196
|
+
}
|
|
4197
|
+
function subtreeTaintedNames(template, nestedTemplates, passed, preview, walk = {}) {
|
|
4198
|
+
const seeds = [...passed, ...crossStackTaintSeedsOf(template, "", preview)];
|
|
4199
|
+
let tainted = taintedNamesOf(template, seeds);
|
|
4200
|
+
const ancestors = walk.ancestors ?? /* @__PURE__ */ new Set();
|
|
4201
|
+
const depth = walk.depth ?? 0;
|
|
4202
|
+
if (nestedTemplates === void 0 || depth >= MAX_NESTED_DEPTH$2) return tainted;
|
|
4203
|
+
const cache = walk.cache ?? /* @__PURE__ */ new Map();
|
|
4204
|
+
const rows = /* @__PURE__ */ new Set();
|
|
4205
|
+
for (const [logicalId, raw] of Object.entries(template.Resources ?? {})) {
|
|
4206
|
+
if (raw?.Type !== "AWS::CloudFormation::Stack" || !Object.hasOwn(nestedTemplates, logicalId)) continue;
|
|
4207
|
+
const childPath = nestedTemplates[logicalId];
|
|
4208
|
+
if (ancestors.has(childPath)) continue;
|
|
4209
|
+
const child = readChild(childPath, cache);
|
|
4210
|
+
if (child === null) continue;
|
|
4211
|
+
const parameters = raw.Properties?.Parameters;
|
|
4212
|
+
const childPassed = [];
|
|
4213
|
+
if (parameters !== null && typeof parameters === "object" && !Array.isArray(parameters)) {
|
|
4214
|
+
for (const [key, value] of Object.entries(parameters)) if (readsTainted(value, tainted) || templateMixesDynamicReference(value)) childPassed.push(key);
|
|
4215
|
+
}
|
|
4216
|
+
const childTainted = subtreeTaintedNames(child.template, child.children, childPassed, preview, {
|
|
4217
|
+
...walk,
|
|
4218
|
+
cache,
|
|
4219
|
+
ancestors: /* @__PURE__ */ new Set([...ancestors, childPath]),
|
|
4220
|
+
depth: depth + 1
|
|
4221
|
+
});
|
|
4222
|
+
const outputs = taintedOutputsOf(child.template, childTainted);
|
|
4223
|
+
for (const [name, output] of outputs) walk.onChildOutput?.(childPath, name, output);
|
|
4224
|
+
if (outputs.length > 0) rows.add(logicalId);
|
|
4225
|
+
}
|
|
4226
|
+
if (rows.size > 0) tainted = taintedNamesOf(template, [...seeds, ...rows]);
|
|
4227
|
+
return tainted;
|
|
4580
4228
|
}
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
logger.warn(`Failed to delete ${labels.what} from '${stateBucket}'${labels.when ? ` ${labels.when}` : ""}. Clean up manually under prefix '${MIGRATE_TMP_PREFIX}/'. Cause: ${msg}`);
|
|
4229
|
+
function exportNameOf(output, stackName) {
|
|
4230
|
+
if (output?.Export === void 0) return void 0;
|
|
4231
|
+
const name = output.Export.Name;
|
|
4232
|
+
if (typeof name === "string") return name;
|
|
4233
|
+
const sub = name?.["Fn::Sub"];
|
|
4234
|
+
if (stackName !== void 0 && name !== null && typeof name === "object" && Object.keys(name).length === 1 && typeof sub === "string") {
|
|
4235
|
+
const resolved = sub.split("${AWS::StackName}").join(stackName);
|
|
4236
|
+
if (!resolved.includes("${")) return resolved;
|
|
4590
4237
|
}
|
|
4238
|
+
return null;
|
|
4591
4239
|
}
|
|
4592
|
-
|
|
4593
|
-
const
|
|
4594
|
-
const
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
TemplateStage: "Original"
|
|
4605
|
-
}));
|
|
4606
|
-
if (!tpl.TemplateBody) throw new Error(`GetTemplate returned no body for '${cfnStackName}'.`);
|
|
4607
|
-
const nestedCleanups = [];
|
|
4608
|
-
const hasNestedChildren = templateContainsNestedStackRows(tpl.TemplateBody);
|
|
4609
|
-
let newBody;
|
|
4610
|
-
let modified;
|
|
4611
|
-
let format;
|
|
4612
|
-
if (hasNestedChildren) {
|
|
4613
|
-
const tree = resourceTree ?? await getCloudFormationResourceTree(cfnStackName, cfnClient);
|
|
4614
|
-
try {
|
|
4615
|
-
const recursive = await injectRetainPoliciesRecursive(tpl.TemplateBody, cfnStackName, tree, {
|
|
4616
|
-
cfnClient,
|
|
4617
|
-
stateBucket,
|
|
4618
|
-
...s3ClientOpts && { s3ClientOpts }
|
|
4619
|
-
});
|
|
4620
|
-
newBody = recursive.body;
|
|
4621
|
-
modified = recursive.modified;
|
|
4622
|
-
format = recursive.format;
|
|
4623
|
-
nestedCleanups.push(...recursive.cleanups);
|
|
4624
|
-
} catch (err) {
|
|
4625
|
-
if (err instanceof RecursiveRetainInjectionError) await drainTemplateUploads(err.cleanups, stateBucket, {
|
|
4626
|
-
what: "partial nested-template upload",
|
|
4627
|
-
when: "during error recovery"
|
|
4628
|
-
});
|
|
4629
|
-
throw err;
|
|
4630
|
-
}
|
|
4631
|
-
} else ({body: newBody, modified, format} = injectRetainPolicies(tpl.TemplateBody, cfnStackName));
|
|
4632
|
-
if (!yes) {
|
|
4633
|
-
let proceed = false;
|
|
4634
|
-
try {
|
|
4635
|
-
proceed = await confirmPrompt$6(`Set DeletionPolicy=Retain and UpdateReplacePolicy=Retain on every resource in CloudFormation stack '${cfnStackName}', and delete the stack once cdkd state is written? AWS resources will NOT be deleted.`);
|
|
4636
|
-
} finally {
|
|
4637
|
-
if (!proceed) await drainTemplateUploads(nestedCleanups, stateBucket, {
|
|
4638
|
-
what: "temporary nested-template upload",
|
|
4639
|
-
when: "during cancel cleanup"
|
|
4640
|
-
});
|
|
4641
|
-
}
|
|
4642
|
-
if (!proceed) {
|
|
4643
|
-
logger.info("CloudFormation stack retirement cancelled. The stack is unchanged and will not be deleted.");
|
|
4644
|
-
return { outcome: "cancelled" };
|
|
4645
|
-
}
|
|
4646
|
-
}
|
|
4647
|
-
let templateUpdated = false;
|
|
4648
|
-
if (!modified) {
|
|
4649
|
-
logger.info(`[2/4] Template already has Retain on every resource — skipping UpdateStack.`);
|
|
4650
|
-
await drainTemplateUploads(nestedCleanups, stateBucket, { what: "temporary nested-template upload" });
|
|
4651
|
-
} else {
|
|
4652
|
-
logger.info(`[2/4] Injected DeletionPolicy=Retain and UpdateReplacePolicy=Retain.`);
|
|
4653
|
-
if (newBody.length > TEMPLATE_URL_LIMIT) throw new Error(`Modified template is ${newBody.length} bytes, exceeds the CloudFormation UpdateStack TemplateURL limit (${TEMPLATE_URL_LIMIT}). cdkd state has not been written; shrink or split the template and retry. ` + MANUAL_RETIREMENT_ROUTE);
|
|
4654
|
-
let updateInput;
|
|
4655
|
-
let s3Cleanup;
|
|
4656
|
-
if (newBody.length <= TEMPLATE_BODY_LIMIT) updateInput = { TemplateBody: newBody };
|
|
4657
|
-
else {
|
|
4658
|
-
logger.info(` Template is ${newBody.length} bytes (over ${TEMPLATE_BODY_LIMIT} inline limit) — uploading to state bucket '${stateBucket}'.`);
|
|
4659
|
-
const uploaded = await uploadTemplateForUpdateStack({
|
|
4660
|
-
bucket: stateBucket,
|
|
4661
|
-
body: newBody,
|
|
4662
|
-
cfnStackName,
|
|
4663
|
-
format,
|
|
4664
|
-
...s3ClientOpts && { s3ClientOpts }
|
|
4665
|
-
});
|
|
4666
|
-
updateInput = { TemplateURL: uploaded.url };
|
|
4667
|
-
s3Cleanup = uploaded.cleanup;
|
|
4668
|
-
}
|
|
4669
|
-
try {
|
|
4670
|
-
logger.info(`[3/4] Updating CloudFormation stack with Retain policies...`);
|
|
4671
|
-
let updateRan = false;
|
|
4672
|
-
try {
|
|
4673
|
-
const previousParameters = (stack.Parameters ?? []).map((p) => ({
|
|
4674
|
-
ParameterKey: p.ParameterKey,
|
|
4675
|
-
UsePreviousValue: true
|
|
4676
|
-
}));
|
|
4677
|
-
await cfnClient.send(new UpdateStackCommand({
|
|
4678
|
-
StackName: cfnStackName,
|
|
4679
|
-
...updateInput,
|
|
4680
|
-
Capabilities: capabilities,
|
|
4681
|
-
...previousParameters.length > 0 && { Parameters: previousParameters }
|
|
4682
|
-
}));
|
|
4683
|
-
updateRan = true;
|
|
4684
|
-
} catch (err) {
|
|
4685
|
-
const msg = describeAwsFailure(err).detail;
|
|
4686
|
-
if (/No updates are to be performed/i.test(msg)) logger.info(` CloudFormation reports no updates needed.`);
|
|
4687
|
-
else throw new RetainUpdateFailedError(cfnStackName, "rejected", err);
|
|
4688
|
-
}
|
|
4689
|
-
if (updateRan) {
|
|
4690
|
-
try {
|
|
4691
|
-
await waitUntilStackUpdateComplete({
|
|
4692
|
-
client: cfnClient,
|
|
4693
|
-
maxWaitTime: 1800,
|
|
4694
|
-
minDelay: 5,
|
|
4695
|
-
maxDelay: 10
|
|
4696
|
-
}, { StackName: cfnStackName });
|
|
4697
|
-
} catch (err) {
|
|
4698
|
-
throw new RetainUpdateFailedError(cfnStackName, "unfinished", err);
|
|
4240
|
+
function markAppProducerTaint(preview, stacks) {
|
|
4241
|
+
const topLevel = new Set(stacks.map((stack) => stack.stackName));
|
|
4242
|
+
const cache = /* @__PURE__ */ new Map();
|
|
4243
|
+
let grew = true;
|
|
4244
|
+
while (grew) {
|
|
4245
|
+
grew = false;
|
|
4246
|
+
for (const { stackName, template, nestedTemplates } of stacks) {
|
|
4247
|
+
const tainted = subtreeTaintedNames(template, nestedTemplates, [], preview, {
|
|
4248
|
+
cache,
|
|
4249
|
+
onChildOutput: (childPath, outputName, output) => {
|
|
4250
|
+
if (preview.markTainted(childPath, outputName, exportNameOf(output, void 0))) grew = true;
|
|
4251
|
+
preview.markNestedOutputsTainted(topLevel);
|
|
4699
4252
|
}
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
} finally {
|
|
4703
|
-
await drainTemplateUploads([...s3Cleanup ? [s3Cleanup] : [], ...nestedCleanups], stateBucket, { what: "temporary template upload" });
|
|
4253
|
+
});
|
|
4254
|
+
for (const [outputName, output] of taintedOutputsOf(template, tainted)) if (preview.markTainted(stackName, outputName, exportNameOf(output, stackName))) grew = true;
|
|
4704
4255
|
}
|
|
4705
4256
|
}
|
|
4706
|
-
return {
|
|
4707
|
-
outcome: "ready",
|
|
4708
|
-
templateUpdated
|
|
4709
|
-
};
|
|
4710
|
-
}
|
|
4711
|
-
async function confirmPrompt$6(prompt) {
|
|
4712
|
-
return confirmOrRefuse(prompt, { refusal: `The CloudFormation stack retirement confirmation prompt cannot run in a non-interactive environment. Pass -y / --yes on ${cdkdRemedy("cdkd import", "--migrate-from-cloudformation")}. Alternatively, run it from a real terminal. Nothing has been written yet: cdkd state and the CloudFormation stack are unchanged, so re-running with -y / --yes is the whole recovery.` });
|
|
4713
|
-
}
|
|
4714
|
-
|
|
4715
|
-
// src/cli/commands/retire-cfn-stack/delete-stack.ts
|
|
4716
|
-
async function deleteRetiredCloudFormationStack(cfnStackName, cfnClient) {
|
|
4717
|
-
const logger = getLogger();
|
|
4718
|
-
logger.info(`[4/4] Deleting CloudFormation stack '${cfnStackName}' (resources retained)...`);
|
|
4719
|
-
try {
|
|
4720
|
-
await cfnClient.send(new DeleteStackCommand({ StackName: cfnStackName }));
|
|
4721
|
-
await waitUntilStackDeleteComplete({
|
|
4722
|
-
client: cfnClient,
|
|
4723
|
-
maxWaitTime: 1800,
|
|
4724
|
-
minDelay: 5,
|
|
4725
|
-
maxDelay: 10
|
|
4726
|
-
}, { StackName: cfnStackName });
|
|
4727
|
-
} catch (err) {
|
|
4728
|
-
const error = /* @__PURE__ */ new Error(safeMsg`CloudFormation stack ${displaySafe(cfnStackName)} was NOT confirmed deleted: ` + safeMsg`${cfnFailureText(err)}. cdkd state is written and correct, and every resource ` + "carries DeletionPolicy=Retain, so deleting the stack deletes no resource. Delete the stack by hand once its cause is resolved (for example an export another stack still imports).");
|
|
4729
|
-
error.cause = err;
|
|
4730
|
-
throw error;
|
|
4731
|
-
}
|
|
4732
|
-
logger.info(`✓ CloudFormation stack '${cfnStackName}' retired. AWS resources are now solely managed by cdkd.`);
|
|
4733
4257
|
}
|
|
4734
4258
|
|
|
4735
4259
|
// src/cli/commands/diff-recursive/refusals.ts
|
|
@@ -4737,7 +4261,7 @@ function deployRefusesPropertiesReason(logicalIds) {
|
|
|
4737
4261
|
return `${logicalIds.length} resource record(s) hold a 'properties' map that cannot be read. This preview repaired them to empty; 'cdkd deploy' refuses the record instead, so the deploy this previews will not start.`;
|
|
4738
4262
|
}
|
|
4739
4263
|
function nestedStackTypeChangeReason(tc) {
|
|
4740
|
-
return `${displayIdent(tc.logicalId)}: Type changes from ${displayIdent(tc.currentType)} to ${displayIdent(tc.desiredType)}. cdkd does not replace a resource into or out of ${NESTED_STACK_RESOURCE_TYPE}; give the new resource a different logical id, or remove it in one deploy and add its replacement in the next.`;
|
|
4264
|
+
return `${displayIdent(tc.logicalId)}: Type changes from ${displayIdent(tc.currentType)} to ${displayIdent(tc.desiredType)}. cdkd does not replace a resource into or out of ${NESTED_STACK_RESOURCE_TYPE$1}; give the new resource a different logical id, or remove it in one deploy and add its replacement in the next.`;
|
|
4741
4265
|
}
|
|
4742
4266
|
function findUnroutableDropRefusals(template, stateResources, ccRouteUnavailableReason, conditionSettled = () => true) {
|
|
4743
4267
|
const reasons = [];
|
|
@@ -4791,38 +4315,20 @@ function deployRefusesDroppedOrphanRowsReason(logicalIds) {
|
|
|
4791
4315
|
return `${logicalIds.length} rollback-orphan record(s) in 'orphans' cannot be read as resources. This preview dropped them; 'cdkd deploy' refuses the record instead, so the deploy this previews will not start.`;
|
|
4792
4316
|
}
|
|
4793
4317
|
const EMPTY_ALLOW_SET = /* @__PURE__ */ new Set();
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
return JSON.parse(raw);
|
|
4809
|
-
} catch (err) {
|
|
4810
|
-
throw new Error(`Failed to parse nested template at ${displayAssemblyPath(templatePath)}: ${describeFileReadFailure(err, templatePath)}`);
|
|
4811
|
-
}
|
|
4812
|
-
}
|
|
4813
|
-
function indexNestedChildTemplates(template, templatePath) {
|
|
4814
|
-
const dir = path.dirname(templatePath);
|
|
4815
|
-
const result = nullPrototypeRecord();
|
|
4816
|
-
for (const [logicalId, resource] of Object.entries(template.Resources ?? {})) {
|
|
4817
|
-
if (resource?.Type !== "AWS::CloudFormation::Stack") continue;
|
|
4818
|
-
const assetPath = resource.Metadata?.["aws:asset:path"];
|
|
4819
|
-
if (typeof assetPath !== "string" || assetPath.length === 0) continue;
|
|
4820
|
-
if (isAbsoluteCrossPlatform(assetPath)) throw new Error(`Nested stack ${displayIdent(logicalId)} has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which is absolute. CDK emits relative asset paths for nested templates; an absolute path indicates the synth output was hand-modified or generated by a non-CDK toolchain. Refusing to load.`);
|
|
4821
|
-
const resolved = resolveAssemblyPath(dir, assetPath);
|
|
4822
|
-
if (!resolved.contained) throw new Error(`Nested stack ${displayIdent(logicalId)} has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which ${renderAssemblyPathEscape(resolved, dir)}`);
|
|
4823
|
-
result[logicalId] = resolved.path;
|
|
4824
|
-
}
|
|
4825
|
-
return result;
|
|
4318
|
+
function previewTypeAndServiceTokenRefusals(changes, stateResources, maskForLog) {
|
|
4319
|
+
const blocking = findNestedStackTypeChanges({
|
|
4320
|
+
changes,
|
|
4321
|
+
stateResources
|
|
4322
|
+
}).map(nestedStackTypeChangeReason);
|
|
4323
|
+
const serviceTokens = findServiceTokenRefusals({
|
|
4324
|
+
changes,
|
|
4325
|
+
stateResources
|
|
4326
|
+
});
|
|
4327
|
+
blocking.push(...serviceTokens.refused.map((refusal) => serviceTokenBlockingReason(refusal, maskForLog)));
|
|
4328
|
+
return {
|
|
4329
|
+
blocking,
|
|
4330
|
+
warnings: serviceTokens.deferred.map(deferredServiceTokenWarning)
|
|
4331
|
+
};
|
|
4826
4332
|
}
|
|
4827
4333
|
|
|
4828
4334
|
// src/cli/commands/diff-recursive/printing.ts
|
|
@@ -5843,7 +5349,7 @@ function noEchoFedChildParameters(parentStackRow, parentNoEchoParameters, parent
|
|
|
5843
5349
|
})) fed.add(name);
|
|
5844
5350
|
return fed;
|
|
5845
5351
|
}
|
|
5846
|
-
async function resolveChildStackParameters(parentStackRow, parentTemplate, parentState, region, parentStackName, stateBackend, parentParameters, parentConditions, cfnFallback, printingSecrets, attributeHealer, unresolvedKeys, trust, derivedNameSink, producerLookup, consumerAccount, secretTokens) {
|
|
5352
|
+
async function resolveChildStackParameters(parentStackRow, parentTemplate, parentState, region, parentStackName, stateBackend, parentParameters, parentConditions, cfnFallback, printingSecrets, attributeHealer, unresolvedKeys, trust, derivedNameSink, producerLookup, consumerAccount, secretTokens, crossStackPreview) {
|
|
5847
5353
|
const rawParams = parentStackRow.Properties?.["Parameters"];
|
|
5848
5354
|
if (!rawParams || typeof rawParams !== "object" || Array.isArray(rawParams)) return {};
|
|
5849
5355
|
const inheritedStandIns = standInTokensOf(secretTokens?.inherited);
|
|
@@ -5864,6 +5370,7 @@ async function resolveChildStackParameters(parentStackRow, parentTemplate, paren
|
|
|
5864
5370
|
secretNameSink: derivedNameSink ?? /* @__PURE__ */ new Map(),
|
|
5865
5371
|
stateBackend,
|
|
5866
5372
|
stackName: parentStackName,
|
|
5373
|
+
...crossStackPreview && { crossStackPreview },
|
|
5867
5374
|
stackIdTail: () => stackIdTailOf(parentState, parentStackName),
|
|
5868
5375
|
stackIdOverride: () => parentState?.signalReceiverStackId,
|
|
5869
5376
|
bestEffort: true,
|
|
@@ -6014,9 +5521,72 @@ async function previewNoEchoMacChanges(args) {
|
|
|
6014
5521
|
return moved;
|
|
6015
5522
|
}
|
|
6016
5523
|
|
|
5524
|
+
// src/cli/commands/diff-recursive/replace-resource-preview.ts
|
|
5525
|
+
async function previewReplaceResourceTargets(input) {
|
|
5526
|
+
if (input.targetIds === void 0 || input.targetIds.size === 0) return [];
|
|
5527
|
+
let replaced;
|
|
5528
|
+
try {
|
|
5529
|
+
const draft = new Map([...input.changes].map(([id, change]) => [id, { ...change }]));
|
|
5530
|
+
const plan = planReplaceResourceTargets(draft, input.targetIds);
|
|
5531
|
+
replaced = plan.replaced;
|
|
5532
|
+
for (const id of replaced) input.changes.set(id, draft.get(id));
|
|
5533
|
+
for (const target of plan.unreplaced) input.warn(renderUnreplacedTarget(input.stackName, target));
|
|
5534
|
+
} catch (error) {
|
|
5535
|
+
if (error instanceof CdkdError && error.code === "REPLACE_RESOURCE_REFUSED") return [error.message];
|
|
5536
|
+
throw error;
|
|
5537
|
+
}
|
|
5538
|
+
const stateful = async (check) => {
|
|
5539
|
+
try {
|
|
5540
|
+
await check();
|
|
5541
|
+
} catch (error) {
|
|
5542
|
+
if (!(error instanceof CdkdError && error.code === "STATEFUL_REPLACE_BLOCKED")) throw error;
|
|
5543
|
+
input.warn(`cdkd deploy refuses this plan unless --force-stateful-recreation is passed:\n${error.message}`);
|
|
5544
|
+
}
|
|
5545
|
+
};
|
|
5546
|
+
await stateful(() => refuseStatefulReplaceResourceTargets({
|
|
5547
|
+
targetIds: replaced,
|
|
5548
|
+
state: input.state,
|
|
5549
|
+
template: input.template,
|
|
5550
|
+
forceStatefulRecreation: false
|
|
5551
|
+
}));
|
|
5552
|
+
await stateful(() => refuseStatefulReplacedReaders({
|
|
5553
|
+
template: input.template,
|
|
5554
|
+
state: input.state,
|
|
5555
|
+
targetIds: replaced,
|
|
5556
|
+
conditions: input.conditions,
|
|
5557
|
+
forceStatefulRecreation: false,
|
|
5558
|
+
targetFlag: "--replace-resource"
|
|
5559
|
+
}));
|
|
5560
|
+
return [];
|
|
5561
|
+
}
|
|
5562
|
+
async function previewReplaceResourcePlan(input) {
|
|
5563
|
+
const { diff, settle, ...plan } = input;
|
|
5564
|
+
const changes = await diff(plan.targetIds);
|
|
5565
|
+
const settled = await settle(changes);
|
|
5566
|
+
const blocking = await previewReplaceResourceTargets({
|
|
5567
|
+
...plan,
|
|
5568
|
+
changes
|
|
5569
|
+
});
|
|
5570
|
+
if (blocking.length === 0 || plan.targetIds === void 0) return {
|
|
5571
|
+
changes,
|
|
5572
|
+
settled,
|
|
5573
|
+
blocking
|
|
5574
|
+
};
|
|
5575
|
+
const unseeded = await diff(void 0, true);
|
|
5576
|
+
return {
|
|
5577
|
+
changes: unseeded,
|
|
5578
|
+
settled: await settle(unseeded),
|
|
5579
|
+
blocking
|
|
5580
|
+
};
|
|
5581
|
+
}
|
|
5582
|
+
function withoutWarnings(calculator) {
|
|
5583
|
+
const logger = Object.create(calculator.logger, { warn: { value: () => void 0 } });
|
|
5584
|
+
return Object.create(calculator, { logger: { value: logger } });
|
|
5585
|
+
}
|
|
5586
|
+
|
|
6017
5587
|
// src/cli/commands/diff-recursive/compute-stack-diff.ts
|
|
6018
5588
|
async function computeStackDiff(loadedState, template, region, stackName, stateBackend, diffCalculator, options = {}) {
|
|
6019
|
-
const { parameters, canonicalizeProperties, ccRouteUnavailableReason, cfnFallback, producerLookup, consumerAccount, noEchoMacCache, macWriteOnlyLookups, inheritSecretBearingTemplate, inheritedSecrets, inheritedSecretTokens, inheritedDerivedNames, attributeHealer: unboundAttributeHealer, readLiveDbInstanceZone, parentUnresolvedParameters, inheritedNoEchoParameters, inheritedNoEchoParametersAnyVerdict, ssmNameHeal = "apply", crossStackPreview, recordCrossStackPreview } = options;
|
|
5589
|
+
const { parameters, canonicalizeProperties, ccRouteUnavailableReason, cfnFallback, producerLookup, consumerAccount, noEchoMacCache, macWriteOnlyLookups, inheritSecretBearingTemplate, inheritedSecrets, inheritedSecretTokens, inheritedDerivedNames, attributeHealer: unboundAttributeHealer, readLiveDbInstanceZone, parentUnresolvedParameters, inheritedNoEchoParameters, inheritedNoEchoParametersAnyVerdict, ssmNameHeal = "apply", crossStackPreview, recordCrossStackPreview, secretFedNames } = options;
|
|
6020
5590
|
const currentState = previewSsmNameHeal(loadedState, template, stackName, ssmNameHeal);
|
|
6021
5591
|
let healResources = currentState.resources ?? {};
|
|
6022
5592
|
let healNamingSecrets;
|
|
@@ -6142,48 +5712,67 @@ async function computeStackDiff(loadedState, template, region, stackName, stateB
|
|
|
6142
5712
|
unbound: unboundParameterNames
|
|
6143
5713
|
});
|
|
6144
5714
|
const resourcesForInputs = stateForDiff.resources;
|
|
6145
|
-
maskedInputs = {
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
5715
|
+
maskedInputs = {
|
|
5716
|
+
sources: {
|
|
5717
|
+
template: effectiveTemplate,
|
|
5718
|
+
parameterInput: classified.parameterInput,
|
|
5719
|
+
conditions,
|
|
5720
|
+
childTemplate: childTemplateLoader(options.nestedTemplates),
|
|
5721
|
+
resolve: async (node) => {
|
|
5722
|
+
const secrets = /* @__PURE__ */ new Map();
|
|
5723
|
+
return {
|
|
5724
|
+
value: await intrinsicResolver.resolve(structuredClone(node), {
|
|
5725
|
+
recordedSecretValues: secrets,
|
|
5726
|
+
secretNameNeedles: stateSecretNameNeedles(resourcesForInputs, liveNamingJudge(resourcesForInputs)),
|
|
5727
|
+
secretNameSink: derivedNames,
|
|
5728
|
+
template: effectiveTemplate,
|
|
5729
|
+
resources: resourcesForInputs,
|
|
5730
|
+
stateBackend,
|
|
5731
|
+
stackName,
|
|
5732
|
+
stackIdTail: () => stackIdTailOf(currentState, stackName),
|
|
5733
|
+
stackIdOverride: () => currentState?.signalReceiverStackId,
|
|
5734
|
+
bestEffort: true,
|
|
5735
|
+
...Object.keys(classified.bound).length > 0 && { parameters: classified.bound },
|
|
5736
|
+
...conditions && Object.keys(conditions).length > 0 && { conditions },
|
|
5737
|
+
skipDynamicReferences: true,
|
|
5738
|
+
...crossStackPreview && { crossStackTaint: crossStackPreview },
|
|
5739
|
+
staleAttributeHeal: { phase: "probe" }
|
|
5740
|
+
}),
|
|
5741
|
+
secrets
|
|
5742
|
+
};
|
|
5743
|
+
}
|
|
5744
|
+
},
|
|
5745
|
+
publicReferences: publicReferencesOf(diffSecrets, [
|
|
5746
|
+
diffSecrets,
|
|
5747
|
+
noEchoParameterValueSeed(effectiveTemplate.Parameters, mergedParameters, inheritedForResolver, parameters),
|
|
5748
|
+
inheritedSecrets
|
|
5749
|
+
])
|
|
5750
|
+
};
|
|
6173
5751
|
}
|
|
6174
|
-
const
|
|
5752
|
+
const diffWith = (forcedReplacements, quiet) => (quiet === true ? withoutWarnings(diffCalculator) : diffCalculator).calculateDiff(stateForDiff, effectiveTemplate, resolveFn, canonicalizeProperties, void 0, void 0, maskForLog, forcedReplacements, maskedInputs, options.refusalRecovery, noEchoComparisonForTemplate(effectiveTemplate, namingConditions, mergedParameters, stateForDiff.resources, /* @__PURE__ */ new Set([region, stackName]), inheritedNoEchoParameters), {
|
|
6175
5753
|
...options.inheritedReferenceProvenance && { inherited: options.inheritedReferenceProvenance },
|
|
6176
5754
|
crossStackOutputs: crossStackOutputProvenanceSource(crossStackReads, crossStackReads, stateBackend)
|
|
6177
5755
|
}, options.forcedNestedChildRuns, options.updatePolicy === true);
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
5756
|
+
const planned = await previewReplaceResourcePlan({
|
|
5757
|
+
diff: diffWith,
|
|
5758
|
+
settle: (rows) => settleStackTagChildRuns({
|
|
5759
|
+
changes: rows,
|
|
5760
|
+
template: effectiveTemplate,
|
|
5761
|
+
stackTags: options.stackTags,
|
|
5762
|
+
state: stateForDiff,
|
|
5763
|
+
resolve: resolveFn,
|
|
5764
|
+
secrets: diffSecrets
|
|
5765
|
+
}),
|
|
5766
|
+
targetIds: options.replaceResources,
|
|
5767
|
+
stackName,
|
|
6183
5768
|
state: stateForDiff,
|
|
6184
|
-
|
|
6185
|
-
|
|
5769
|
+
template: effectiveTemplate,
|
|
5770
|
+
conditions: namingConditions ?? {},
|
|
5771
|
+
warn: (message) => logger.warn(printing.mask(message))
|
|
6186
5772
|
});
|
|
5773
|
+
const { changes, settled: childStackTags } = planned;
|
|
5774
|
+
blocking = [...blocking, ...planned.blocking];
|
|
5775
|
+
warnLegacySpelling(changes, effectiveTemplate, stackName, logger);
|
|
6187
5776
|
const macConditions = conditions === void 0 ? void 0 : Object.fromEntries(Object.entries(conditions).filter(([name]) => !stillUnknown.includes(name)));
|
|
6188
5777
|
const macMoved = await previewNoEchoMacChanges({
|
|
6189
5778
|
changes,
|
|
@@ -6209,17 +5798,9 @@ async function computeStackDiff(loadedState, template, region, stackName, stateB
|
|
|
6209
5798
|
...conditions !== void 0 && { conditions: Object.fromEntries(Object.entries(conditions).filter(([name]) => !stillUnknown.includes(name))) }
|
|
6210
5799
|
}));
|
|
6211
5800
|
if (noEchoReaders.length > 0) logger.info(safeMsg`Stack ${displayStackName(stackName)}: ${String(noEchoReaders.length)} unchanged resource(s) read a NoEcho parameter, whose value state holds only as ***: the deploy compares it with AWS, and updates a resource whose value changed.`);
|
|
6212
|
-
const
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
});
|
|
6216
|
-
if (nestedStackTypeChanges.length > 0) blocking = [...blocking, ...nestedStackTypeChanges.map(nestedStackTypeChangeReason)];
|
|
6217
|
-
const serviceTokens = findServiceTokenRefusals({
|
|
6218
|
-
changes,
|
|
6219
|
-
stateResources: stateForDiff.resources
|
|
6220
|
-
});
|
|
6221
|
-
if (serviceTokens.refused.length > 0) blocking = [...blocking, ...serviceTokens.refused.map((refusal) => serviceTokenBlockingReason(refusal, maskForLog))];
|
|
6222
|
-
for (const row of serviceTokens.deferred) logger.warn(printing.mask(deferredServiceTokenWarning(row)));
|
|
5801
|
+
const previewed = previewTypeAndServiceTokenRefusals(changes, stateForDiff.resources, maskForLog);
|
|
5802
|
+
blocking = [...blocking, ...previewed.blocking];
|
|
5803
|
+
for (const warning of previewed.warnings) logger.warn(printing.mask(warning));
|
|
6223
5804
|
blocking = [...blocking, ...findUpdatePolicyReplacementRefusals(changes, effectiveTemplate, stateForDiff.stackInstanceId !== void 0, options.createRouteOf === void 0 ? void 0 : (logicalId, change) => replacementCreateRoutesToCloudControl(options.createRouteOf, change, stateForDiff.resources[logicalId]?.properties))];
|
|
6224
5805
|
for (const reason of findUnwrittenCreateOnlyRefusals(changes, stateForDiff.resources, ccRouteUnavailableReason)) logger.warn(printing.mask(reason));
|
|
6225
5806
|
if (ccRouteUnavailableReason !== void 0) {
|
|
@@ -6280,15 +5861,21 @@ async function computeStackDiff(loadedState, template, region, stackName, stateB
|
|
|
6280
5861
|
diffOutputsAgainst,
|
|
6281
5862
|
stackName
|
|
6282
5863
|
});
|
|
6283
|
-
|
|
5864
|
+
const readsSecretFed = producerReadsSecretFedName(secretFedNames);
|
|
5865
|
+
const producer = {
|
|
6284
5866
|
stackName,
|
|
6285
5867
|
template: effectiveTemplate,
|
|
6286
|
-
changes,
|
|
6287
5868
|
desiredOutputs: resolved.outputs,
|
|
6288
5869
|
storedOutputs: currentState.outputs,
|
|
5870
|
+
...readsSecretFed && { readsSecretFedName: readsSecretFed }
|
|
5871
|
+
};
|
|
5872
|
+
if (crossStackPreview && recordCrossStackPreview) await recordProducerPreview(crossStackPreview, region, resolveFn, {
|
|
5873
|
+
...producer,
|
|
5874
|
+
changes,
|
|
6289
5875
|
...knownConditions !== void 0 && { conditions: knownConditions },
|
|
6290
5876
|
holdsSecret: (text) => printing.mask(text) !== text
|
|
6291
5877
|
});
|
|
5878
|
+
else if (crossStackPreview && readsSecretFed) await markProducerTaint(crossStackPreview, resolveFn, producer);
|
|
6292
5879
|
const printingSecrets = printing.corpus();
|
|
6293
5880
|
let shownChanges = changes;
|
|
6294
5881
|
let shownOutputChanges = outputChanges;
|
|
@@ -6398,337 +5985,6 @@ async function loadStateOrEmpty(stackName, region, stateBackend, refusalRecovery
|
|
|
6398
5985
|
};
|
|
6399
5986
|
}
|
|
6400
5987
|
|
|
6401
|
-
// src/cli/commands/diff-recursive/passed-secret-display.ts
|
|
6402
|
-
function isRecord$2(value) {
|
|
6403
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6404
|
-
}
|
|
6405
|
-
function isIntrinsic$2(value) {
|
|
6406
|
-
const keys = Object.keys(value);
|
|
6407
|
-
return keys.length === 1 && (keys[0] === "Ref" || keys[0].startsWith("Fn::"));
|
|
6408
|
-
}
|
|
6409
|
-
const SIDES = [
|
|
6410
|
-
"oldValue",
|
|
6411
|
-
"newValue",
|
|
6412
|
-
"newValueTemplate"
|
|
6413
|
-
];
|
|
6414
|
-
function recordOf(value) {
|
|
6415
|
-
return isRecord$2(value) ? value : {};
|
|
6416
|
-
}
|
|
6417
|
-
function mixesDynamicReference(value) {
|
|
6418
|
-
return typeof value === "string" && value.includes("{{resolve:") && !isSingleDynamicReferenceToken(value);
|
|
6419
|
-
}
|
|
6420
|
-
function holdsMixedDynamicReference(value) {
|
|
6421
|
-
const pending = [value];
|
|
6422
|
-
const seen = /* @__PURE__ */ new Set();
|
|
6423
|
-
while (pending.length > 0) {
|
|
6424
|
-
const next = pending.pop();
|
|
6425
|
-
if (mixesDynamicReference(next)) return true;
|
|
6426
|
-
if (next === null || typeof next !== "object" || seen.has(next)) continue;
|
|
6427
|
-
seen.add(next);
|
|
6428
|
-
if (Array.isArray(next)) pending.push(...next);
|
|
6429
|
-
else for (const [key, leaf] of Object.entries(next)) pending.push(key, leaf);
|
|
6430
|
-
}
|
|
6431
|
-
return false;
|
|
6432
|
-
}
|
|
6433
|
-
function holdsDynamicReference(value) {
|
|
6434
|
-
const pending = [value];
|
|
6435
|
-
const seen = /* @__PURE__ */ new Set();
|
|
6436
|
-
while (pending.length > 0) {
|
|
6437
|
-
const next = pending.pop();
|
|
6438
|
-
if (typeof next === "string" && next.includes("{{resolve:")) return true;
|
|
6439
|
-
if (next === null || typeof next !== "object" || seen.has(next)) continue;
|
|
6440
|
-
seen.add(next);
|
|
6441
|
-
pending.push(...Object.values(next));
|
|
6442
|
-
}
|
|
6443
|
-
return false;
|
|
6444
|
-
}
|
|
6445
|
-
function templateMixesDynamicReference(value, depth = 0) {
|
|
6446
|
-
if (typeof value === "string") return mixesDynamicReference(value);
|
|
6447
|
-
if (!isRecord$2(value) || depth > 64) return holdsDynamicReference(value);
|
|
6448
|
-
const branches = value["Fn::If"];
|
|
6449
|
-
if (isIntrinsic$2(value) && Array.isArray(branches) && branches.length === 3) return templateMixesDynamicReference(branches[1], depth + 1) || templateMixesDynamicReference(branches[2], depth + 1);
|
|
6450
|
-
return holdsDynamicReference(value);
|
|
6451
|
-
}
|
|
6452
|
-
function rowEntries(rowProperties) {
|
|
6453
|
-
const entries = Object.entries(recordOf(rowProperties["Parameters"]));
|
|
6454
|
-
const tags = rowProperties["Tags"];
|
|
6455
|
-
if (Array.isArray(tags)) for (const tag of tags) entries.push([recordOf(tag)["Key"], recordOf(tag)["Value"]]);
|
|
6456
|
-
else entries.push(...Object.entries(recordOf(tags)));
|
|
6457
|
-
return entries;
|
|
6458
|
-
}
|
|
6459
|
-
const ANY_TAG_KEY = "*";
|
|
6460
|
-
const TAG_KEYS_TAINTED = "*key*";
|
|
6461
|
-
function readsTainted(node, tainted) {
|
|
6462
|
-
if (tainted.size === 0) return false;
|
|
6463
|
-
return readsNoEchoSource(node, {
|
|
6464
|
-
parameters: tainted,
|
|
6465
|
-
attributeIsNoEcho: (logicalId) => tainted.has(logicalId)
|
|
6466
|
-
});
|
|
6467
|
-
}
|
|
6468
|
-
function mixedSecretRowKeys(rowProperties, resolvedChildParameters, tainted) {
|
|
6469
|
-
const keys = /* @__PURE__ */ new Set();
|
|
6470
|
-
for (const [key, value] of Object.entries(recordOf(rowProperties?.["Parameters"]))) if (readsTainted(value, tainted)) keys.add(key);
|
|
6471
|
-
for (const [key, value] of Object.entries(resolvedChildParameters)) if (mixesDynamicReference(value)) keys.add(key);
|
|
6472
|
-
return keys;
|
|
6473
|
-
}
|
|
6474
|
-
function taintedNamesOf(template, passed) {
|
|
6475
|
-
const tainted = new Set(passed ?? []);
|
|
6476
|
-
const resources = recordOf(template.Resources);
|
|
6477
|
-
for (const [logicalId, raw] of Object.entries(resources)) {
|
|
6478
|
-
const resource = recordOf(raw);
|
|
6479
|
-
if (resource["Type"] !== "AWS::CloudFormation::Stack") continue;
|
|
6480
|
-
if (rowEntries(recordOf(resource["Properties"])).some(([, value]) => templateMixesDynamicReference(value))) tainted.add(logicalId);
|
|
6481
|
-
}
|
|
6482
|
-
if (tainted.size === 0) return tainted;
|
|
6483
|
-
let grew = true;
|
|
6484
|
-
while (grew) {
|
|
6485
|
-
grew = false;
|
|
6486
|
-
for (const [logicalId, resource] of Object.entries(resources)) {
|
|
6487
|
-
if (tainted.has(logicalId)) continue;
|
|
6488
|
-
if (readsTainted(recordOf(resource)["Properties"], tainted)) {
|
|
6489
|
-
tainted.add(logicalId);
|
|
6490
|
-
grew = true;
|
|
6491
|
-
}
|
|
6492
|
-
}
|
|
6493
|
-
}
|
|
6494
|
-
return tainted;
|
|
6495
|
-
}
|
|
6496
|
-
function mixedSecretTagKeys(rowProperties, resolvedTags, tainted, inherited) {
|
|
6497
|
-
const keys = new Set(inherited ?? []);
|
|
6498
|
-
const tags = rowProperties?.["Tags"];
|
|
6499
|
-
const pairs = Array.isArray(tags) ? tags.map((tag) => [recordOf(tag)["Key"], recordOf(tag)["Value"]]) : Object.entries(recordOf(tags));
|
|
6500
|
-
const derived = (node) => templateMixesDynamicReference(node) || readsTainted(node, tainted);
|
|
6501
|
-
for (const [key, value] of pairs) if (typeof key === "string" ? mixesDynamicReference(key) : derived(key)) keys.add("*").add(TAG_KEYS_TAINTED);
|
|
6502
|
-
else if (derived(value)) keys.add(typeof key === "string" ? key : "*");
|
|
6503
|
-
for (const [key, value] of Object.entries(resolvedTags ?? {})) if (mixesDynamicReference(key)) keys.add("*").add(TAG_KEYS_TAINTED);
|
|
6504
|
-
else if (mixesDynamicReference(value)) keys.add(key);
|
|
6505
|
-
return keys;
|
|
6506
|
-
}
|
|
6507
|
-
function maskTagValues(value, keys, isMap) {
|
|
6508
|
-
const named = (key) => keys.has("*") || typeof key === "string" && keys.has(key);
|
|
6509
|
-
if (Array.isArray(value)) {
|
|
6510
|
-
const shown = value.map((element) => maskTagValues(element, keys, false));
|
|
6511
|
-
return shown.every((element, index) => element === value[index]) ? value : shown;
|
|
6512
|
-
}
|
|
6513
|
-
if (!isRecord$2(value)) return value;
|
|
6514
|
-
const isEntry = Object.hasOwn(value, "Key") && Object.hasOwn(value, "Value");
|
|
6515
|
-
if (!isEntry && isMap && keys.has("*key*")) return "***";
|
|
6516
|
-
let changed = false;
|
|
6517
|
-
const shown = {};
|
|
6518
|
-
for (const [key, leaf] of Object.entries(value)) {
|
|
6519
|
-
let next;
|
|
6520
|
-
if (isEntry && key === "Key" && keys.has("*key*")) next = "***";
|
|
6521
|
-
else if (isEntry && key === "Value" && named(value["Key"])) next = "***";
|
|
6522
|
-
else if (isMap && named(key) && !isRecord$2(leaf) && !Array.isArray(leaf)) next = "***";
|
|
6523
|
-
else next = maskTagValues(leaf, keys, /tag/i.test(key));
|
|
6524
|
-
if (next !== leaf) changed = true;
|
|
6525
|
-
shown[key] = next;
|
|
6526
|
-
}
|
|
6527
|
-
return changed ? shown : value;
|
|
6528
|
-
}
|
|
6529
|
-
function maskTagProperty(change, keys) {
|
|
6530
|
-
if (keys.size === 0 || !/tag/i.test(change.path)) return change;
|
|
6531
|
-
const next = { ...change };
|
|
6532
|
-
let changed = false;
|
|
6533
|
-
for (const side of SIDES) {
|
|
6534
|
-
if (!Object.prototype.hasOwnProperty.call(change, side) || change[side] === void 0) continue;
|
|
6535
|
-
const shown = maskTagValues(change[side], keys, true);
|
|
6536
|
-
if (shown !== change[side]) {
|
|
6537
|
-
next[side] = shown;
|
|
6538
|
-
changed = true;
|
|
6539
|
-
}
|
|
6540
|
-
}
|
|
6541
|
-
return changed ? next : change;
|
|
6542
|
-
}
|
|
6543
|
-
function labelledWhenMaskedAlike(real, shown) {
|
|
6544
|
-
const alike = (change) => JSON.stringify(change.oldValue) === JSON.stringify(change.newValue);
|
|
6545
|
-
return alike(shown) && !alike(real) ? {
|
|
6546
|
-
...shown,
|
|
6547
|
-
maskedExpressionChanged: true
|
|
6548
|
-
} : shown;
|
|
6549
|
-
}
|
|
6550
|
-
function maskedSides(change) {
|
|
6551
|
-
const masked = { ...change };
|
|
6552
|
-
if (masked.oldValue !== void 0) masked.oldValue = "***";
|
|
6553
|
-
if (masked.newValue !== void 0) masked.newValue = "***";
|
|
6554
|
-
if (masked.newValueTemplate !== void 0) masked.newValueTemplate = "***";
|
|
6555
|
-
return masked;
|
|
6556
|
-
}
|
|
6557
|
-
function maskParameterKeys(side, flagged) {
|
|
6558
|
-
let changed = false;
|
|
6559
|
-
const shown = {};
|
|
6560
|
-
for (const [key, value] of Object.entries(side)) if (value !== "***" && flagged.has(key)) {
|
|
6561
|
-
shown[key] = "***";
|
|
6562
|
-
changed = true;
|
|
6563
|
-
} else shown[key] = value;
|
|
6564
|
-
return changed ? shown : side;
|
|
6565
|
-
}
|
|
6566
|
-
function maskRowParameters(change, templateValue, tainted) {
|
|
6567
|
-
const present = SIDES.filter((side) => Object.prototype.hasOwnProperty.call(change, side) && change[side] !== void 0);
|
|
6568
|
-
if ((!isRecord$2(templateValue) || isIntrinsic$2(templateValue)) && readsTainted(templateValue, tainted) || present.some((side) => !isRecord$2(change[side]) && holdsMixedDynamicReference(change[side]))) return maskedSides(change);
|
|
6569
|
-
const raw = recordOf(templateValue);
|
|
6570
|
-
const flagged = /* @__PURE__ */ new Set();
|
|
6571
|
-
for (const [key, value] of Object.entries(raw)) if (readsTainted(value, tainted)) flagged.add(key);
|
|
6572
|
-
for (const side of present) for (const [key, value] of Object.entries(recordOf(change[side]))) if (holdsMixedDynamicReference(value)) flagged.add(key);
|
|
6573
|
-
if (flagged.size === 0) return change;
|
|
6574
|
-
const next = { ...change };
|
|
6575
|
-
let changed = false;
|
|
6576
|
-
for (const side of present) {
|
|
6577
|
-
const value = change[side];
|
|
6578
|
-
if (!isRecord$2(value)) continue;
|
|
6579
|
-
const shown = maskParameterKeys(value, flagged);
|
|
6580
|
-
if (shown !== value) {
|
|
6581
|
-
next[side] = shown;
|
|
6582
|
-
changed = true;
|
|
6583
|
-
}
|
|
6584
|
-
}
|
|
6585
|
-
return changed ? next : change;
|
|
6586
|
-
}
|
|
6587
|
-
function maskPassedSecretChanges(changes, template, tainted, tagKeys = /* @__PURE__ */ new Set()) {
|
|
6588
|
-
const resources = recordOf(template.Resources);
|
|
6589
|
-
let anyChanged = false;
|
|
6590
|
-
const shown = /* @__PURE__ */ new Map();
|
|
6591
|
-
for (const [logicalId, change] of changes) {
|
|
6592
|
-
const resource = recordOf(Object.hasOwn(resources, logicalId) ? resources[logicalId] : void 0);
|
|
6593
|
-
const properties = recordOf(resource["Properties"]);
|
|
6594
|
-
const isNestedRow = change.resourceType === "AWS::CloudFormation::Stack" || resource["Type"] === "AWS::CloudFormation::Stack";
|
|
6595
|
-
let changed = false;
|
|
6596
|
-
const propertyChanges = change.propertyChanges?.map((propertyChange) => {
|
|
6597
|
-
const templateValue = Object.hasOwn(properties, propertyChange.path) ? properties[propertyChange.path] : void 0;
|
|
6598
|
-
const next = isNestedRow && propertyChange.path === "Parameters" ? maskRowParameters(propertyChange, templateValue, tainted) : readsTainted(templateValue, tainted) || isNestedRow && SIDES.some((side) => holdsMixedDynamicReference(propertyChange[side])) ? maskedSides(propertyChange) : maskTagProperty(propertyChange, tagKeys);
|
|
6599
|
-
if (next === propertyChange) return next;
|
|
6600
|
-
changed = true;
|
|
6601
|
-
return labelledWhenMaskedAlike(propertyChange, next);
|
|
6602
|
-
});
|
|
6603
|
-
if (changed && propertyChanges !== void 0) {
|
|
6604
|
-
anyChanged = true;
|
|
6605
|
-
shown.set(logicalId, {
|
|
6606
|
-
...change,
|
|
6607
|
-
propertyChanges
|
|
6608
|
-
});
|
|
6609
|
-
} else shown.set(logicalId, change);
|
|
6610
|
-
}
|
|
6611
|
-
return anyChanged ? shown : changes;
|
|
6612
|
-
}
|
|
6613
|
-
function maskPassedSecretOutputs(outputChanges, template, tainted) {
|
|
6614
|
-
if (tainted.size === 0 || outputChanges.length === 0) return outputChanges;
|
|
6615
|
-
const outputs = recordOf(template.Outputs);
|
|
6616
|
-
const taintedValues = /* @__PURE__ */ new Set();
|
|
6617
|
-
let taintedExportValue = false;
|
|
6618
|
-
let taintedExportName = false;
|
|
6619
|
-
for (const [name, rawOutput] of Object.entries(outputs)) {
|
|
6620
|
-
const output = recordOf(rawOutput);
|
|
6621
|
-
const exported = isRecord$2(output["Export"]) ? output["Export"] : void 0;
|
|
6622
|
-
if (readsTainted(output["Value"], tainted)) {
|
|
6623
|
-
taintedValues.add(name);
|
|
6624
|
-
if (exported !== void 0) taintedExportValue = true;
|
|
6625
|
-
}
|
|
6626
|
-
if (exported !== void 0 && readsTainted(exported["Name"], tainted)) taintedExportName = true;
|
|
6627
|
-
}
|
|
6628
|
-
let anyChanged = false;
|
|
6629
|
-
const shown = outputChanges.map((change) => {
|
|
6630
|
-
const maskValues = Object.hasOwn(outputs, change.name) && taintedValues.has(change.name) || change.isExport && taintedExportValue;
|
|
6631
|
-
const withholdName = change.isExport && taintedExportName;
|
|
6632
|
-
if (!maskValues && !withholdName) return change;
|
|
6633
|
-
const next = { ...change };
|
|
6634
|
-
if (maskValues) {
|
|
6635
|
-
if (next.oldValue !== void 0) next.oldValue = "***";
|
|
6636
|
-
if (next.newValue !== void 0) next.newValue = "***";
|
|
6637
|
-
}
|
|
6638
|
-
if (withholdName) next.nameDisplay = { kind: "withheld" };
|
|
6639
|
-
anyChanged = true;
|
|
6640
|
-
return next;
|
|
6641
|
-
});
|
|
6642
|
-
return anyChanged ? shown : outputChanges;
|
|
6643
|
-
}
|
|
6644
|
-
function calculatorMaskingPassedSecretLines(calculator, template, tainted) {
|
|
6645
|
-
if (tainted.size === 0) return calculator;
|
|
6646
|
-
const prefixes = [];
|
|
6647
|
-
for (const rawResource of Object.values(recordOf(template.Resources))) {
|
|
6648
|
-
const resource = recordOf(rawResource);
|
|
6649
|
-
if (typeof resource["Type"] !== "string") continue;
|
|
6650
|
-
for (const [key, value] of Object.entries(recordOf(resource["Properties"]))) if (readsTainted(value, tainted)) prefixes.push(`Property ${key} of ${resource["Type"]} requires replacement (from `);
|
|
6651
|
-
}
|
|
6652
|
-
if (prefixes.length === 0) return calculator;
|
|
6653
|
-
const inner = calculator.logger;
|
|
6654
|
-
const logger = Object.create(inner);
|
|
6655
|
-
logger.debug = (message, ...args) => {
|
|
6656
|
-
const prefix = prefixes.find((candidate) => message.startsWith(candidate));
|
|
6657
|
-
inner.debug(prefix === void 0 ? message : `${prefix}${"***"} to ${"***"})`, ...args);
|
|
6658
|
-
};
|
|
6659
|
-
const wrapped = Object.create(calculator);
|
|
6660
|
-
Object.defineProperty(wrapped, "logger", {
|
|
6661
|
-
value: logger,
|
|
6662
|
-
enumerable: true
|
|
6663
|
-
});
|
|
6664
|
-
return wrapped;
|
|
6665
|
-
}
|
|
6666
|
-
function recordedValuesOf(resources, tainted) {
|
|
6667
|
-
const needles = /* @__PURE__ */ new Map();
|
|
6668
|
-
for (const name of tainted) {
|
|
6669
|
-
const record = Object.hasOwn(resources, name) ? resources[name] : void 0;
|
|
6670
|
-
if (record === void 0) continue;
|
|
6671
|
-
const pending = [record.physicalId, record.attributes];
|
|
6672
|
-
const seen = /* @__PURE__ */ new Set();
|
|
6673
|
-
while (pending.length > 0) {
|
|
6674
|
-
const next = pending.pop();
|
|
6675
|
-
if (typeof next === "string") {
|
|
6676
|
-
if (next.length > 0 && next !== "***") recordLogOnlyValue(needles, next);
|
|
6677
|
-
} else if (next !== null && typeof next === "object" && !seen.has(next)) {
|
|
6678
|
-
seen.add(next);
|
|
6679
|
-
pending.push(...Object.values(next));
|
|
6680
|
-
}
|
|
6681
|
-
}
|
|
6682
|
-
}
|
|
6683
|
-
return needles;
|
|
6684
|
-
}
|
|
6685
|
-
function securityDiffWithPassedSecretWithheld(securityDiff, changes, template, tainted) {
|
|
6686
|
-
const resources = recordOf(template.Resources);
|
|
6687
|
-
if (![...changes.values()].some((change) => {
|
|
6688
|
-
if (change.changeType === "NO_CHANGE" || !tainted.has(change.logicalId)) return false;
|
|
6689
|
-
const properties = recordOf(recordOf(Object.hasOwn(resources, change.logicalId) ? resources[change.logicalId] : void 0)["Properties"]);
|
|
6690
|
-
return (change.propertyChanges ?? []).some((propertyChange) => isScrutinizedProperty(change.resourceType, propertyChange.path) && Object.hasOwn(properties, propertyChange.path) && readsTainted(properties[propertyChange.path], tainted));
|
|
6691
|
-
})) return securityDiff;
|
|
6692
|
-
return async () => {
|
|
6693
|
-
const shown = await securityDiff();
|
|
6694
|
-
if (shown.rendered === "") return shown;
|
|
6695
|
-
return {
|
|
6696
|
-
...shown,
|
|
6697
|
-
rendered: SECURITY_TABLE_WITHHELD
|
|
6698
|
-
};
|
|
6699
|
-
};
|
|
6700
|
-
}
|
|
6701
|
-
const SECURITY_TABLE_WITHHELD = "IAM / security-group changes found; their table is withheld because this stack reads a parameter passed with a secret dynamic reference (go-to-k/cdkd#7068).";
|
|
6702
|
-
function maskPassedSecretReasons(reasons, template, tainted, orphans) {
|
|
6703
|
-
if (tainted.size === 0 || reasons.length === 0) return reasons;
|
|
6704
|
-
const resources = recordOf(template.Resources);
|
|
6705
|
-
const tokenPrefixes = [];
|
|
6706
|
-
for (const logicalId of tainted) {
|
|
6707
|
-
if (!Object.hasOwn(resources, logicalId)) continue;
|
|
6708
|
-
if (readsTainted(recordOf(recordOf(resources[logicalId])["Properties"])["ServiceToken"], tainted)) tokenPrefixes.push(`${displayIdent(logicalId)}: ServiceToken changes to `);
|
|
6709
|
-
}
|
|
6710
|
-
const shownIds = [];
|
|
6711
|
-
for (const orphan of Array.isArray(orphans) ? orphans : []) {
|
|
6712
|
-
const entry = recordOf(orphan);
|
|
6713
|
-
const record = recordOf(entry["state"]);
|
|
6714
|
-
if (typeof entry["logicalId"] !== "string" || !tainted.has(entry["logicalId"])) continue;
|
|
6715
|
-
if (typeof record["physicalId"] !== "string" || record["physicalId"] === "") continue;
|
|
6716
|
-
shownIds.push(displaySafe(String(displayPhysicalId(record["resourceType"], record["physicalId"]))));
|
|
6717
|
-
}
|
|
6718
|
-
let changed = false;
|
|
6719
|
-
const shown = reasons.map((reason) => {
|
|
6720
|
-
let next = reason;
|
|
6721
|
-
const prefix = tokenPrefixes.find((candidate) => next.startsWith(candidate));
|
|
6722
|
-
const end = next.indexOf(SERVICE_TOKEN_REASON_TAIL);
|
|
6723
|
-
if (prefix !== void 0 && end > prefix.length) next = `${prefix}${"***"}${next.slice(end)}`;
|
|
6724
|
-
for (const id of shownIds) next = next.split(id).join("***");
|
|
6725
|
-
if (next !== reason) changed = true;
|
|
6726
|
-
return next;
|
|
6727
|
-
});
|
|
6728
|
-
return changed ? shown : reasons;
|
|
6729
|
-
}
|
|
6730
|
-
const SERVICE_TOKEN_REASON_TAIL = ", away from the handler its record names.";
|
|
6731
|
-
|
|
6732
5988
|
// src/cli/commands/diff-recursive/routes.ts
|
|
6733
5989
|
const SDK_MIGRATION_TOKEN = "returning to SDK provider";
|
|
6734
5990
|
function diffReplaces(change, record) {
|
|
@@ -6768,7 +6024,7 @@ function childRowRunsEngine(row) {
|
|
|
6768
6024
|
return row?.changeType === "UPDATE" && (row.propertyChanges?.length ?? 0) > 0;
|
|
6769
6025
|
}
|
|
6770
6026
|
async function buildDiffTree(args) {
|
|
6771
|
-
const { stackName, displayName, region, template: synthTemplate, nestedTemplates, recursive, stateBackend, diffCalculator, parentHasSecretReference, parameters, parentUnresolvedParameters, canonicalizeProperties, ccRouteUnavailableReason, assetRedirect, cfnFallback, updatePolicy, createRouteOf, producerLookup, crossStackPreview, consumerAccount, previewOrphanAdoption, attributeHealerFor, liveDbInstanceZoneReaderFor, ancestorTemplatePaths, isNestedChild, ssmNameHeal, inheritedSecrets, inheritedDerivedNames, inheritedNoEchoParameters, inheritedNoEchoParametersAnyVerdict, refusalRecovery, inheritedReferenceProvenance, inheritedSecretTokens, stackTags, inheritedMixedSecretParameters, inheritedMixedSecretTagKeys } = args;
|
|
6027
|
+
const { stackName, displayName, region, template: synthTemplate, nestedTemplates, recursive, stateBackend, diffCalculator, parentHasSecretReference, parameters, parentUnresolvedParameters, canonicalizeProperties, ccRouteUnavailableReason, assetRedirect, cfnFallback, updatePolicy, replaceResources, createRouteOf, producerLookup, crossStackPreview, consumerAccount, previewOrphanAdoption, attributeHealerFor, liveDbInstanceZoneReaderFor, ancestorTemplatePaths, isNestedChild, ssmNameHeal, inheritedSecrets, inheritedDerivedNames, inheritedNoEchoParameters, inheritedNoEchoParametersAnyVerdict, refusalRecovery, inheritedReferenceProvenance, inheritedSecretTokens, stackTags, inheritedMixedSecretParameters, inheritedMixedSecretTagKeys } = args;
|
|
6772
6028
|
const unboundHealer = attributeHealerFor?.(stackName, region);
|
|
6773
6029
|
const stackTagged = applyStackTagsToTemplate(synthTemplate, stackTags, (line) => logger.warn(line));
|
|
6774
6030
|
const { state, unreadable, unreadableContainers, deployRefusals, found } = await loadStateOrEmpty(stackName, region, stateBackend, refusalRecovery);
|
|
@@ -6786,9 +6042,13 @@ async function buildDiffTree(args) {
|
|
|
6786
6042
|
});
|
|
6787
6043
|
for (const row of nestedSsmCheck?.forcedRows ?? []) logger.info(nestedSsmNameRowNote(row));
|
|
6788
6044
|
for (const row of nestedSsmCheck?.deferredRows ?? []) logger.info(nestedSsmNameDeferredNote(row));
|
|
6789
|
-
const
|
|
6045
|
+
const ownSecretNames = taintedNamesOf(template, inheritedMixedSecretParameters);
|
|
6046
|
+
const passedSecretNames = crossStackPreview?.anyTainted() ? subtreeTaintedNames(template, nestedTemplates, inheritedMixedSecretParameters ?? [], crossStackPreview, ancestorTemplatePaths ? { ancestors: ancestorTemplatePaths } : {}) : ownSecretNames;
|
|
6047
|
+
const readsTaintedCrossStack = passedSecretNames.size > ownSecretNames.size;
|
|
6790
6048
|
const passedSecretRecordNeedles = recordedValuesOf(state.resources ?? {}, passedSecretNames);
|
|
6791
|
-
const
|
|
6049
|
+
for (const value of readsTaintedCrossStack ? crossStackPreview?.taintedValues() ?? [] : []) recordLogOnlyValue(passedSecretRecordNeedles, value);
|
|
6050
|
+
const underPassedSecretNeedles = (run) => hasMaskableValues(passedSecretRecordNeedles) ? withPrintingSecrets(passedSecretRecordNeedles, run) : run();
|
|
6051
|
+
const runComputeStackDiff = underPassedSecretNeedles;
|
|
6792
6052
|
let stackDiff;
|
|
6793
6053
|
try {
|
|
6794
6054
|
stackDiff = await runComputeStackDiff(() => computeStackDiff(state, template, region, stackName, stateBackend, calculatorMaskingPassedSecretLines(diffCalculator, template, passedSecretNames), {
|
|
@@ -6798,12 +6058,14 @@ async function buildDiffTree(args) {
|
|
|
6798
6058
|
...ccRouteUnavailableReason && { ccRouteUnavailableReason },
|
|
6799
6059
|
...cfnFallback !== void 0 && { cfnFallback },
|
|
6800
6060
|
...updatePolicy === true && { updatePolicy },
|
|
6061
|
+
...replaceResources !== void 0 && !isNestedChild && { replaceResources },
|
|
6801
6062
|
...createRouteOf && { createRouteOf },
|
|
6802
6063
|
...producerLookup && { producerLookup },
|
|
6803
6064
|
...consumerAccount && { consumerAccount },
|
|
6804
6065
|
...crossStackPreview && {
|
|
6805
6066
|
crossStackPreview,
|
|
6806
|
-
recordCrossStackPreview: !isNestedChild
|
|
6067
|
+
recordCrossStackPreview: !isNestedChild,
|
|
6068
|
+
secretFedNames: passedSecretNames
|
|
6807
6069
|
},
|
|
6808
6070
|
...previewOrphanAdoption && { previewOrphanAdoption },
|
|
6809
6071
|
...inheritedSecrets && { inheritedSecrets },
|
|
@@ -6861,7 +6123,7 @@ async function buildDiffTree(args) {
|
|
|
6861
6123
|
if (resource?.Type !== "AWS::CloudFormation::Stack") continue;
|
|
6862
6124
|
templateChildIds.add(logicalId);
|
|
6863
6125
|
const childTemplatePath = nestedTemplates[logicalId];
|
|
6864
|
-
if (!childTemplatePath) throw new Error(`Nested template file not found for ${NESTED_STACK_RESOURCE_TYPE} ${displayIdent(logicalId)} under stack ${displayStackName(stackName)}. Verify the synth output emits Metadata['aws:asset:path'] on this resource (CDK 2.x cdk.NestedStack does so by default), then re-run synth.`);
|
|
6126
|
+
if (!childTemplatePath) throw new Error(`Nested template file not found for ${NESTED_STACK_RESOURCE_TYPE$1} ${displayIdent(logicalId)} under stack ${displayStackName(stackName)}. Verify the synth output emits Metadata['aws:asset:path'] on this resource (CDK 2.x cdk.NestedStack does so by default), then re-run synth.`);
|
|
6865
6127
|
const childStackName = `${stackName}~${logicalId}`;
|
|
6866
6128
|
const resolvedChildPath = path.resolve(childTemplatePath);
|
|
6867
6129
|
const childIdentity = templateIdentity(childTemplatePath);
|
|
@@ -6879,10 +6141,10 @@ async function buildDiffTree(args) {
|
|
|
6879
6141
|
]), void 0, stateAfterAdoption.resources);
|
|
6880
6142
|
const rowDerivedNames = /* @__PURE__ */ new Map();
|
|
6881
6143
|
const childSecretTokens = /* @__PURE__ */ new Map();
|
|
6882
|
-
const childParameters = await resolveChildStackParameters(resource, effectiveTemplate, stateAfterAdoption, region, stackName, stateBackend, resolvedParameters, conditions, cfnFallback, printingSecrets, attributeHealer && healerUnderRecordPrintingBag(attributeHealer, () => stateAfterAdoption.resources ?? {}, namingSecretsFor), childUnresolvedParameters, trust, rowDerivedNames, producerLookup, consumerAccount, {
|
|
6144
|
+
const childParameters = await underPassedSecretNeedles(() => resolveChildStackParameters(resource, effectiveTemplate, stateAfterAdoption, region, stackName, stateBackend, resolvedParameters, conditions, cfnFallback, printingSecrets, attributeHealer && healerUnderRecordPrintingBag(attributeHealer, () => stateAfterAdoption.resources ?? {}, namingSecretsFor), childUnresolvedParameters, trust, rowDerivedNames, producerLookup, consumerAccount, {
|
|
6883
6145
|
inherited: inheritedSecretTokens,
|
|
6884
6146
|
child: childSecretTokens
|
|
6885
|
-
});
|
|
6147
|
+
}, crossStackPreview));
|
|
6886
6148
|
const childMixedSecretParameters = mixedSecretRowKeys(resource.Properties, childParameters, passedSecretNames);
|
|
6887
6149
|
const childMixedSecretTagKeys = mixedSecretTagKeys(resource.Properties, stackDiff.childStackTags?.get(logicalId), passedSecretNames, inheritedMixedSecretTagKeys);
|
|
6888
6150
|
const passedSecretNeedles = /* @__PURE__ */ new Map();
|
|
@@ -7369,7 +6631,19 @@ async function diffCommand(stacks, options) {
|
|
|
7369
6631
|
else throw new Error(`Multiple stacks found: ${allStacks.map(describeStack).join(", ")}. Specify stack name(s) or use --all (top-level stacks; '**' for every stack)`);
|
|
7370
6632
|
if (targetStacks.length === 0) throw new Error(renderNoStackMatch(stackPatterns, allStacks));
|
|
7371
6633
|
refuseFailedLookups(targetStacks, allStacks, result.failedLookups);
|
|
6634
|
+
const replaceTargetIds = [...new Set(options.replaceResource ?? [])];
|
|
6635
|
+
const deployStacks = replaceTargetIds.length > 0 ? withDependencyStacks(targetStacks, allStacks) : targetStacks;
|
|
7372
6636
|
await synthesizer.expandMacrosForStacks(targetStacks, synthOptions);
|
|
6637
|
+
if (replaceTargetIds.length > 0) {
|
|
6638
|
+
const dependencies = deployStacks.filter((stack) => !targetStacks.includes(stack));
|
|
6639
|
+
if (dependencies.length > 0) await synthesizer.expandMacrosForStacks(dependencies, synthOptions);
|
|
6640
|
+
checkReplaceResourceOptions(options, deployStacks);
|
|
6641
|
+
for (const id of replaceTargetIds) {
|
|
6642
|
+
if (targetStacks.some((stack) => Object.hasOwn(stack.template.Resources ?? {}, id))) continue;
|
|
6643
|
+
const owner = deployStacks.find((stack) => Object.hasOwn(stack.template.Resources ?? {}, id));
|
|
6644
|
+
if (owner !== void 0) logger.warn(safeMsg`--replace-resource ${id}: declared by ${owner.stackName}, a dependency stack the deploy includes unless -e is passed; diff that stack to preview its replacement.`);
|
|
6645
|
+
}
|
|
6646
|
+
}
|
|
7373
6647
|
const stateConfig = {
|
|
7374
6648
|
bucket: stateBucket,
|
|
7375
6649
|
prefix: options.statePrefix
|
|
@@ -7467,6 +6741,7 @@ async function diffCommand(stacks, options) {
|
|
|
7467
6741
|
const treeEnvs = [];
|
|
7468
6742
|
const producerLookup = producerLookupOver(allStacks);
|
|
7469
6743
|
const crossStackPreview = new CrossStackPreview();
|
|
6744
|
+
markAppProducerTaint(crossStackPreview, allStacks);
|
|
7470
6745
|
const inferredProducers = inferCrossStackDepsByStack(targetStacks);
|
|
7471
6746
|
targetStacks = orderProducersFirst(targetStacks, (stack) => [...stack.dependencyNames.flatMap((name) => stacksForDependency(name, stack, targetStacks)), ...inferredProducers.get(stack) ?? []]);
|
|
7472
6747
|
const sharedNames = new Set(targetStacks.map((s) => s.stackName).filter((name, i, names) => names.indexOf(name) !== i));
|
|
@@ -7485,6 +6760,7 @@ async function diffCommand(stacks, options) {
|
|
|
7485
6760
|
logger.debug(`Rewrote ${rewritten} asset reference(s) to cdkd asset storage in template of stack ${stackInfo.stackName}`);
|
|
7486
6761
|
}
|
|
7487
6762
|
const stackTags = stackTagsOverride ?? stackInfo.tags;
|
|
6763
|
+
const replaceResources = replaceResourcesForStack(options.replaceResource, stackInfo.stackName, stackInfo.template);
|
|
7488
6764
|
trees.push(await buildDiffTree({
|
|
7489
6765
|
stackName: stackInfo.stackName,
|
|
7490
6766
|
displayName: shownName,
|
|
@@ -7501,6 +6777,7 @@ async function diffCommand(stacks, options) {
|
|
|
7501
6777
|
...assetRedirect && { assetRedirect },
|
|
7502
6778
|
...options.cfnFallback === false && { cfnFallback: false },
|
|
7503
6779
|
...resolveUpdatePolicy(options.updatePolicy) === true && { updatePolicy: true },
|
|
6780
|
+
...replaceResources && { replaceResources: replaceResources.logicalIds },
|
|
7504
6781
|
producerLookup,
|
|
7505
6782
|
crossStackPreview,
|
|
7506
6783
|
...stackInfo.account && { consumerAccount: stackInfo.account },
|
|
@@ -7588,7 +6865,7 @@ async function diffCommand(stacks, options) {
|
|
|
7588
6865
|
}
|
|
7589
6866
|
}
|
|
7590
6867
|
function createDiffCommand() {
|
|
7591
|
-
const cmd = new Command("diff").description("Show difference between current state and desired state").argument("[stacks...]", "Stack name(s) to diff. Accepts CDK display paths (e.g. 'MyStage/Api') with wildcards ('MyStage/*', '**'), or exact physical CloudFormation names (e.g. 'MyStage-Api').").option("--all", "Diff every top-level stack (top-level only; Stage stacks: '**')", false).option("--recursive", "Recurse into each AWS::CloudFormation::Stack row and diff every nested-stack child against its own deployed state (DFS order). Default is non-recursive, matching cdk diff.", false).option("--fail", "Exit with code 1 when any change is detected (matches cdk diff --fail). Alias for --fail-on=any-change.").option("--no-fail", "Never exit with code 1 for a change. Alias for --fail-on=never.").addOption(new Option("--fail-on <kind>", "Exit with code 1 when the diff contains the given kind of change: \"any-change\" fails on any difference, \"broadening\" only on changes that broaden IAM permissions or security-group rules, \"destructive\" only on changes that replace, delete or orphan a resource, \"never\" does not fail (default). \"broadening\" and \"destructive\" always check nested stacks (as --recursive); \"any-change\" does with --recursive. Cannot be used with --fail / --no-fail.").choices(DIFF_FAIL_ON_VALUES).argParser(parseFailOn)).option("--security-only", "Only print the security changes (IAM and security-group) of each stack whose changes broaden permissions, and count only those stacks as differences for --fail-on (matches cdk diff --security-only). Checks nested stacks too. Cannot be used with --json.").option("--json", "Output the diff as JSON (nested tree shape when combined with --recursive)", false).addOption(useCdkBootstrapAssetsOption).addOption(noCfnFallbackOption).addOption(diffUpdatePolicyOptions[0]).addOption(diffUpdatePolicyOptions[1]).action(withErrorHandling(diffCommand));
|
|
6868
|
+
const cmd = new Command("diff").description("Show difference between current state and desired state").argument("[stacks...]", "Stack name(s) to diff. Accepts CDK display paths (e.g. 'MyStage/Api') with wildcards ('MyStage/*', '**'), or exact physical CloudFormation names (e.g. 'MyStage-Api').").option("--all", "Diff every top-level stack (top-level only; Stage stacks: '**')", false).option("--recursive", "Recurse into each AWS::CloudFormation::Stack row and diff every nested-stack child against its own deployed state (DFS order). Default is non-recursive, matching cdk diff.", false).option("--fail", "Exit with code 1 when any change is detected (matches cdk diff --fail). Alias for --fail-on=any-change.").option("--no-fail", "Never exit with code 1 for a change. Alias for --fail-on=never.").addOption(new Option("--fail-on <kind>", "Exit with code 1 when the diff contains the given kind of change: \"any-change\" fails on any difference, \"broadening\" only on changes that broaden IAM permissions or security-group rules, \"destructive\" only on changes that replace, delete or orphan a resource, \"never\" does not fail (default). \"broadening\" and \"destructive\" always check nested stacks (as --recursive); \"any-change\" does with --recursive. Cannot be used with --fail / --no-fail.").choices(DIFF_FAIL_ON_VALUES).argParser(parseFailOn)).option("--security-only", "Only print the security changes (IAM and security-group) of each stack whose changes broaden permissions, and count only those stacks as differences for --fail-on (matches cdk diff --security-only). Checks nested stacks too. Cannot be used with --json.").option("--json", "Output the diff as JSON (nested tree shape when combined with --recursive)", false).addOption(useCdkBootstrapAssetsOption).addOption(noCfnFallbackOption).addOption(diffUpdatePolicyOptions[0]).addOption(diffUpdatePolicyOptions[1]).addOption(diffReplaceResourceOption).action(withErrorHandling(diffCommand));
|
|
7592
6869
|
[
|
|
7593
6870
|
...commonOptions,
|
|
7594
6871
|
...appOptions,
|
|
@@ -15688,9 +14965,6 @@ function resolvablePrincipalLists(resource) {
|
|
|
15688
14965
|
}
|
|
15689
14966
|
|
|
15690
14967
|
// src/cli/commands/destroy-runner/superseded-schedule.ts
|
|
15691
|
-
function mustDeleteBefore(type) {
|
|
15692
|
-
return hasOwnKey(IMPLICIT_DELETE_DEPENDENCIES, type) ? IMPLICIT_DELETE_DEPENDENCIES[type] : [];
|
|
15693
|
-
}
|
|
15694
14968
|
function scheduleSupersededDeletes(state, executionLevels, retryLate) {
|
|
15695
14969
|
const rows = supersededResourcesOf(state).filter((row) => !isCustomResourceType$1(row.state.resourceType) || retryLate.has(row));
|
|
15696
14970
|
if (rows.length === 0) return [];
|
|
@@ -15713,11 +14987,11 @@ function scheduleSupersededDeletes(state, executionLevels, retryLate) {
|
|
|
15713
14987
|
const step = stepOf.get(dep);
|
|
15714
14988
|
if (step !== void 0) upper = Math.min(upper, step);
|
|
15715
14989
|
}
|
|
15716
|
-
const mustFollow =
|
|
14990
|
+
const mustFollow = typesDeletedBefore(rowType);
|
|
15717
14991
|
for (const [logicalId, step] of stepOf) {
|
|
15718
14992
|
const record = resources[logicalId];
|
|
15719
14993
|
if (typeof record !== "object" || record === null) continue;
|
|
15720
|
-
if (
|
|
14994
|
+
if (typesDeletedBefore(record.resourceType).includes(rowType)) upper = Math.min(upper, step);
|
|
15721
14995
|
if (mustFollow.includes(record.resourceType)) lower = Math.max(lower, step + 1);
|
|
15722
14996
|
const its = record.dependencies;
|
|
15723
14997
|
if (Array.isArray(its) && its.includes(row.logicalId)) lower = Math.max(lower, step + 1);
|
|
@@ -18544,7 +17818,7 @@ async function walkCdkdStateStackTree(stackName, region, state, stateBackend, re
|
|
|
18544
17818
|
const childResult = await stateBackend.getState(childStackName, region);
|
|
18545
17819
|
if (!childResult) {
|
|
18546
17820
|
const orphan = orphanCommandFor(stackName, region, recovery);
|
|
18547
|
-
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}`);
|
|
17821
|
+
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$1} 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}`);
|
|
18548
17822
|
}
|
|
18549
17823
|
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.`);
|
|
18550
17824
|
nestedChildren.set(logicalId, await walkCdkdStateStackTree(childStackName, region, childResult.state, stateBackend, recovery));
|
|
@@ -20924,7 +20198,7 @@ async function runPerStackImportPhases(ctx) {
|
|
|
20924
20198
|
phase1BTemplate["Resources"][row.logicalId] = rewrittenRow;
|
|
20925
20199
|
rewrittenNestedRows.set(row.logicalId, rewrittenRow);
|
|
20926
20200
|
phase1BResources.push({
|
|
20927
|
-
ResourceType: NESTED_STACK_RESOURCE_TYPE,
|
|
20201
|
+
ResourceType: NESTED_STACK_RESOURCE_TYPE$1,
|
|
20928
20202
|
LogicalResourceId: row.logicalId,
|
|
20929
20203
|
ResourceIdentifier: { StackId: childArn }
|
|
20930
20204
|
});
|
|
@@ -38213,4 +37487,4 @@ function collectVerbFlags(program) {
|
|
|
38213
37487
|
}
|
|
38214
37488
|
|
|
38215
37489
|
export { effectiveInventoryItem as $, withRecordedCidrSpelling as A, LIFECYCLE_DEFAULT_STATUS as B, securityGroupReadbackDelays as C, stackIngressRuleHolder as D, singleSecurityGroupRuleId as E, clearLifecycleWritesOf as F, canonicalizeItemList as G, LIFECYCLE_RULE_PATH as H, lifecycleSettleTarget as I, lifecycleUsesFilterForm as J, effectiveLifecycleConfiguration as K, recordLifecycleWrite as L, sgRemovalRuleKey as M, sgRuleListMember as N, survivingRecordOfRuleId as O, LIFECYCLE_BASELINE_REREAD_DELAYS_MS as P, effectiveIntelligentTieringItem as Q, settleLifecycleRead as R, reconcileSgRules as S, sgRuleKey as T, LIFECYCLE_TAG_FILTERS_PATH as U, LIFECYCLE_FILTER_PATH as V, canonicalizeBlock as W, EVENTBRIDGE_CONFIG_PATH as X, parseCfnTimestamp as Y, effectiveAnalyticsItem as Z, ingressRuleIdentity as _, refuseRevertRevokingSiblingRules as a, declaresBucketObjectLock as at, isResendableSocketFailure as b, buildProgram, siblingIdOwnedSgRules as c, isPlainObject as ct, authorizeDefinitelyNotApplied as d, shownLifecycleRuleId as dt, effectiveNotificationConfiguration as et, canonicalizeSgInlineRuleProtocols as f, flattenIpPermissions as g, descriptionKey as h, resolveSecretDerivedPrincipals as i, configItemId as it, markCopiesAgreed as j, tagListsMatch as k, SG_READBACK_RETRY_DELAY_MS as l, manualBucketDeletionClause as lt, comparableIngressIdentity as m, holdsUnprovenSecretPrincipalToken as n, caughtErrorName as nt, sgRuleDiffKey as o, declaresNestedObjectLock as ot, canonicalizeSgRuleProtocol as p, lifecycleRuleScope as q, isResolvableSecretPrincipalList as r, coerceCfnNumber as rt, readSgIngressById as s, describeValue as st, runDestroyForStack as t, eventBridgeEnabledOf as tt, SG_RULE_PAGE_SIZE$1 as u, mergeLegacySingular as ut, isConnectTimeout as v, securityGroupRuleMatchesCfnIngress as w, narrowIngressIpProtocol as x, isDefaultEgressRule as y, takeLifecycleWrite as z };
|
|
38216
|
-
//# sourceMappingURL=program-
|
|
37490
|
+
//# sourceMappingURL=program-avOxa_7W.js.map
|