@cdkd/cli 0.366.2 → 0.367.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/{ambient-client-defaults-BP4BAeN1.js → ambient-client-defaults-BCK5URbU.js} +7 -4
  2. package/dist/{ambient-client-defaults-BP4BAeN1.js.map → ambient-client-defaults-BCK5URbU.js.map} +1 -1
  3. package/dist/{asg-provider-Hhj0P6mp.js → asg-provider-B3z2ERTV.js} +6 -6
  4. package/dist/{asg-provider-Hhj0P6mp.js.map → asg-provider-B3z2ERTV.js.map} +1 -1
  5. package/dist/cli.js +3 -3
  6. package/dist/{custom-resource-runtime-2FunsavP.js → custom-resource-runtime-C84Dk_m9.js} +6 -6
  7. package/dist/{custom-resource-runtime-2FunsavP.js.map → custom-resource-runtime-C84Dk_m9.js.map} +1 -1
  8. package/dist/{db-associated-roles-r-PenQj1.js → db-associated-roles-BPNxy41_.js} +2 -2
  9. package/dist/{db-associated-roles-r-PenQj1.js.map → db-associated-roles-BPNxy41_.js.map} +1 -1
  10. package/dist/{delete-started-CmhbQ1Pl.js → delete-started-B4voN73N.js} +6 -6
  11. package/dist/{delete-started-CmhbQ1Pl.js.map → delete-started-B4voN73N.js.map} +1 -1
  12. package/dist/{deploy-engine-Zi4lQPww.js → deploy-engine-Ckkutmgf.js} +978 -413
  13. package/dist/deploy-engine-Ckkutmgf.js.map +1 -0
  14. package/dist/{ec2-termination-protection-DbUAhJ8k.js → ec2-termination-protection-DWE3uPU3.js} +6 -6
  15. package/dist/{ec2-termination-protection-DbUAhJ8k.js.map → ec2-termination-protection-DWE3uPU3.js.map} +1 -1
  16. package/dist/{ecr-uri-D2I7XuY2.js → ecr-uri-7yeldNkK.js} +2 -2
  17. package/dist/{ecr-uri-D2I7XuY2.js.map → ecr-uri-7yeldNkK.js.map} +1 -1
  18. package/dist/{expected-bucket-owner-Bbo88Hgr.js → expected-bucket-owner-CikFL35f.js} +2 -2
  19. package/dist/{expected-bucket-owner-Bbo88Hgr.js.map → expected-bucket-owner-CikFL35f.js.map} +1 -1
  20. package/dist/{iam-role-provider-DvWL9ZdR.js → iam-role-provider-Cya7v6M0.js} +77 -18
  21. package/dist/{iam-role-provider-DvWL9ZdR.js.map → iam-role-provider-Cya7v6M0.js.map} +1 -1
  22. package/dist/{image-plan-BwTTXuNI.js → image-plan-BCMBW3N9.js} +14 -10
  23. package/dist/image-plan-BCMBW3N9.js.map +1 -0
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +5 -5
  27. package/dist/{logger-BO4LBqgc.js → logger-CDeQnUi0.js} +2 -2
  28. package/dist/{logger-BO4LBqgc.js.map → logger-CDeQnUi0.js.map} +1 -1
  29. package/dist/{neptune-provider-IM5gyPEm.js → neptune-provider-DJmwti6E.js} +7 -7
  30. package/dist/{neptune-provider-IM5gyPEm.js.map → neptune-provider-DJmwti6E.js.map} +1 -1
  31. package/dist/{program-DakFqlnv.js → program-BqTL728g.js} +1173 -1124
  32. package/dist/program-BqTL728g.js.map +1 -0
  33. package/dist/{provider-classes-Cf4oFWZo.js → provider-classes-DkZXDD7E.js} +605 -484
  34. package/dist/provider-classes-DkZXDD7E.js.map +1 -0
  35. package/dist/{rds-provider-BO3cRR3g.js → rds-provider-BFrNNNhR.js} +10 -10
  36. package/dist/{rds-provider-BO3cRR3g.js.map → rds-provider-BFrNNNhR.js.map} +1 -1
  37. package/dist/{read-replica-BxXAoL6p.js → read-replica-Bt5-man4.js} +3 -3
  38. package/dist/{read-replica-BxXAoL6p.js.map → read-replica-Bt5-man4.js.map} +1 -1
  39. package/dist/{replacement-rules-CeVpmoXW.js → replacement-rules-CLBkCiI5.js} +3 -3
  40. package/dist/{replacement-rules-CeVpmoXW.js.map → replacement-rules-CLBkCiI5.js.map} +1 -1
  41. package/dist/{resource-deadline-C6pfimDZ.js → resource-deadline-C2PStI4s.js} +4 -4
  42. package/dist/{resource-deadline-C6pfimDZ.js.map → resource-deadline-C2PStI4s.js.map} +1 -1
  43. package/dist/{restore-source-guard-OMAaTC2f.js → restore-source-guard-Dl_sbZyl.js} +4 -4
  44. package/dist/{restore-source-guard-OMAaTC2f.js.map → restore-source-guard-Dl_sbZyl.js.map} +1 -1
  45. package/dist/{run-cli-ZM-2X79-.js → run-cli-CJBGJ3Bv.js} +2 -2
  46. package/dist/{run-cli-ZM-2X79-.js.map → run-cli-CJBGJ3Bv.js.map} +1 -1
  47. package/dist/{settle-own-write-members-Nyh6snFh.js → settle-own-write-members-C5Bz98EG.js} +18 -15
  48. package/dist/settle-own-write-members-C5Bz98EG.js.map +1 -0
  49. package/dist/{version-8glqD9vK.js → version-D9jxvvqR.js} +2 -2
  50. package/dist/{version-8glqD9vK.js.map → version-D9jxvvqR.js.map} +1 -1
  51. package/package.json +1 -1
  52. package/dist/deploy-engine-Zi4lQPww.js.map +0 -1
  53. package/dist/image-plan-BwTTXuNI.js.map +0 -1
  54. package/dist/program-DakFqlnv.js.map +0 -1
  55. package/dist/provider-classes-Cf4oFWZo.js.map +0 -1
  56. package/dist/settle-own-write-members-Nyh6snFh.js.map +0 -1
@@ -1,19 +1,19 @@
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-8glqD9vK.js";
2
- import { $ as renderStacksNoLongerSelected, $t as deployOptions, A as followContainerLogs, At as namedEnvAwsRegion, B as resolveRuntimeCodeMountPath, Bt as regionNeedsReconciliation, C as waitForRieReady, Cn as STATE_FILE_SUFFIX, Ct as resolveContainerRegion, Dn as listAllStateKeys, Dt as warnAwsEmulatorStateSourceHint, E as SENSITIVE_ENV_KEYS, En as listAllLockKeys, 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 parseStateKey, Ot as workloadGetsEmulatorKeysOnly, P as pullImage, Pt as foldRegionOption, Q as renderNotInAppWarning, Qt as contextOptions, Rt as reconcileExportIndexRegion, S as invokeRie, Sn as LOCK_FILE_SUFFIX, St as realAwsException, T as DockerRunnerError, Tn as describeStateKey, 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 commonOptions, _ as probeHostGatewaySupport, _n as parseDuration, _t as localAwsEmulatorCredentials, a as materializeLayerFromArn, an as noLocalCustomResourcesOption, at as unmatchedPatterns, b as substituteImagePlaceholders, bn as cliArgParser, bt as prepareLocalLoopbackForwarder, cn as regionOption, ct as resolveCdkPathToLogicalIds, d as resolveAssetCodeDirectory, dn as stateOptions, dt as activateLocalAwsAndRoleArn, en as destroyOptions, et as renderUnmatchedPatternsWarning, f as architectureToPlatform, fn as useCdkBootstrapAssetsOption, ft as assertAwsEmulatorValue, g as HOST_GATEWAY_MIN_VERSION, gn as allowUnsupportedTypesOption, gt as localAwsEmulatorActive, h as layerAssetDirectory, hn as parseAssumeRoleToken, ht as keepEmulatorIssuedCredentials, i as resolveInlineCodeFilePath, in as noCfnFallbackOption, it as stacksNoLongerSelected, jt as recordEmulatorDefaultRegion, k as flushStdio, kt as emulatorDefaultRegion, l as resolveLambdaLayers, ln as skipFinalSnapshotOption, lt as stackForConstructPath, m as copyLayerTreeLastWins, mn as normalizeStartApiAssumeRole, mt as getActiveWorkloadAwsWiring$1, n as resolveTmpfsForLambda, nn as exclusivelyOption, nt as stackMatchesPattern, o as resolveLambdaTarget, on as parseContextOptions, ot as buildCdkPathIndex, p as buildContainerImage$1, pn as effectiveAssumeRoleArn, pt as attachLocalLoopbackForwarder, q as refuseStackNameRegionCollisions, qt as writeProfileCredentialsFile, r as resolveZipImagePlan, rn as guardStackRegionOptions, rt as stacksForDependency, s as extractEphemeralStorageMb, sn as parseStackRegion, st as readCdkPathOrUndefined, t as resolveLocalBuildPlan$1, tn as diffUpdatePolicyOptions, tt as selectTargetStack, u as assetPathDirs, un as stackOptions, ut as stackForPathFormTarget, v as resolveHostGatewayExtraHosts, vn as resourceTimeoutOptions, vt as mixedModeActive, w as CONTAINER_LOG_DRAIN_TIMEOUT_MS, wn as STATE_KEY_MAX_CODE_POINTS, wt as setContainerRegion, x as tryResolveImageFnJoin, xn as parsePositiveIntegerOption, xt as profileCredentialsForWorkload, y as derivePseudoParametersFromRegion$1, yn as validateResourceTimeouts, yt as mixedModeEmulatorOverride, z as streamLogs, zt as reconcileMarkerRegionWithLegacyDefault } from "./image-plan-BwTTXuNI.js";
3
- import { A as assertRegionMatch, At as readRecordedPrincipals, Cn as producerCoordinateKey, Ct as IAM_PRINCIPAL_NAME, Gt as maskDeep, Lt as logicalIdShown, N as VALUE_NOT_SHOWN, O as DriftReadRefusedError, U as isMarkedNotGone, V as remedyLogicalId, _n as WAIT_CONDITION_SIGNAL_PREFIX, _t as renderDisableCommand, bn as withPasteableAwsProfile, bt as interruptWatchListenerCount, cn as buildLockContentionMessage, dn as formatLockOperation, fn as formatLockOwner, gn as DEFAULT_STATE_PREFIX, hn as CUSTOM_RESOURCE_RESPONSE_PREFIX, i as withResourceDeadline, k as RESOURCE_NOT_FOUND, ln as forceQuitRecoveryClause, mt as isAwsCliLiteral, on as UNREPRODUCIBLE_LOCK_CLAUSE, sn as buildForceUnlockCommand, st as runDeleteAttempt, un as formatLockExpiry, vn as setPasteableAwsCaBundle, vt as beginCommandInterruptScope, wn as producerRecordKey, wt as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, xn as injectiveKey, xt as isInterruptedWaitError, yn as setPasteableAwsProfile, yt as endCommandInterruptScope, zt as resourceTypeShown } from "./resource-deadline-C6pfimDZ.js";
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-D9jxvvqR.js";
2
+ import { $ as renderStacksNoLongerSelected, $t as deployOptions, A as followContainerLogs, At as namedEnvAwsRegion, B as resolveRuntimeCodeMountPath, Bt as regionNeedsReconciliation, C as waitForRieReady, Cn as STATE_FILE_SUFFIX, Ct as resolveContainerRegion, Dn as listAllStateKeys, Dt as warnAwsEmulatorStateSourceHint, E as SENSITIVE_ENV_KEYS, En as listAllLockKeys, 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 parseStateKey, Ot as workloadGetsEmulatorKeysOnly, P as pullImage, Pt as foldRegionOption, Q as renderNotInAppWarning, Qt as contextOptions, Rt as reconcileExportIndexRegion, S as invokeRie, Sn as LOCK_FILE_SUFFIX, St as realAwsException, T as DockerRunnerError, Tn as describeStateKey, 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 commonOptions, _ as probeHostGatewaySupport, _n as parseDuration, _t as localAwsEmulatorCredentials, a as materializeLayerFromArn, an as noLocalCustomResourcesOption, at as unmatchedPatterns, b as substituteImagePlaceholders, bn as cliArgParser, bt as prepareLocalLoopbackForwarder, cn as regionOption, ct as resolveCdkPathToLogicalIds, d as resolveAssetCodeDirectory, dn as stateOptions, dt as activateLocalAwsAndRoleArn, en as destroyOptions, et as renderUnmatchedPatternsWarning, f as architectureToPlatform, fn as useCdkBootstrapAssetsOption, ft as assertAwsEmulatorValue, g as HOST_GATEWAY_MIN_VERSION, gn as allowUnsupportedTypesOption, gt as localAwsEmulatorActive, h as layerAssetDirectory, hn as parseAssumeRoleToken, ht as keepEmulatorIssuedCredentials, i as resolveInlineCodeFilePath, in as noCfnFallbackOption, it as stacksNoLongerSelected, jt as recordEmulatorDefaultRegion, k as flushStdio, kt as emulatorDefaultRegion, l as resolveLambdaLayers, ln as skipFinalSnapshotOption, lt as stackForConstructPath, m as copyLayerTreeLastWins, mn as normalizeStartApiAssumeRole, mt as getActiveWorkloadAwsWiring$1, n as resolveTmpfsForLambda, nn as exclusivelyOption, nt as stackMatchesPattern, o as resolveLambdaTarget, on as parseContextOptions, ot as buildCdkPathIndex, p as buildContainerImage$1, pn as effectiveAssumeRoleArn, pt as attachLocalLoopbackForwarder, q as refuseStackNameRegionCollisions, qt as writeProfileCredentialsFile, r as resolveZipImagePlan, rn as guardStackRegionOptions, rt as stacksForDependency, s as extractEphemeralStorageMb, sn as parseStackRegion, st as readCdkPathOrUndefined, t as resolveLocalBuildPlan$1, tn as diffUpdatePolicyOptions, tt as selectTargetStack, u as assetPathDirs, un as stackOptions, ut as stackForPathFormTarget, v as resolveHostGatewayExtraHosts, vn as resourceTimeoutOptions, vt as mixedModeActive, w as CONTAINER_LOG_DRAIN_TIMEOUT_MS, wn as STATE_KEY_MAX_CODE_POINTS, wt as setContainerRegion, x as tryResolveImageFnJoin, xn as parsePositiveIntegerOption, xt as profileCredentialsForWorkload, y as derivePseudoParametersFromRegion$1, yn as validateResourceTimeouts, yt as mixedModeEmulatorOverride, z as streamLogs, zt as reconcileMarkerRegionWithLegacyDefault } from "./image-plan-BCMBW3N9.js";
3
+ import { A as assertRegionMatch, At as readRecordedPrincipals, Cn as producerCoordinateKey, Ct as IAM_PRINCIPAL_NAME, Gt as maskDeep, Lt as logicalIdShown, N as VALUE_NOT_SHOWN, O as DriftReadRefusedError, U as isMarkedNotGone, V as remedyLogicalId, _n as WAIT_CONDITION_SIGNAL_PREFIX, _t as renderDisableCommand, bn as withPasteableAwsProfile, bt as interruptWatchListenerCount, cn as buildLockContentionMessage, dn as formatLockOperation, fn as formatLockOwner, gn as DEFAULT_STATE_PREFIX, hn as CUSTOM_RESOURCE_RESPONSE_PREFIX, i as withResourceDeadline, k as RESOURCE_NOT_FOUND, ln as forceQuitRecoveryClause, mt as isAwsCliLiteral, on as UNREPRODUCIBLE_LOCK_CLAUSE, sn as buildForceUnlockCommand, st as runDeleteAttempt, un as formatLockExpiry, vn as setPasteableAwsCaBundle, vt as beginCommandInterruptScope, wn as producerRecordKey, wt as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, xn as injectiveKey, xt as isInterruptedWaitError, yn as setPasteableAwsProfile, yt as endCommandInterruptScope, zt as resourceTypeShown } from "./resource-deadline-C2PStI4s.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, 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-BO4LBqgc.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-BP4BAeN1.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-CDeQnUi0.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-BCK5URbU.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 MIGRATE_TMP_PREFIX, A as formatDockerLoginError, B as resolveApp, C as redactDockerArgvValues, D as warnFinchArgvExposure, E as partitionSensitiveEnv, F as Synthesizer, G as resolveStateBucketWithDefaultAndSource, H as resolveCaptureObservedState, I as synthesisStatusMessage, J as resolveUseCdkBootstrapAssets, K as resolveStateBucketWithSource, L as getDefaultStateBucketName, M as runDockerForeground, N as runDockerStreaming, O as isDockerClientEnvKey, P as abortInFlightMultipartUploads, Q as CFN_TEMPLATE_URL_LIMIT, R as getLegacyStateBucketName, S as redactedDockerCause, T as finchSecretArgvRefusal, U as resolveSkipPrefix, V as resolveAutoAssetStorage, W as resolveStateBucketWithDefault, X as warnDeprecatedNoPrefixCliFlag, Y as stateBucketExistenceConfirmed, Z as CFN_TEMPLATE_BODY_LIMIT, _ as resolveDockerContextDirectory, at as bindLegacyStackAssetParameters, b as describeDockerFailure, ct as predictedAutoCreatedAssetMode, d as DagBuilder, dt as processStackMessages, et as findLargeInlineResources, f as LockManager, ft as setChildProcessAwsEnv, g as buildDockerImage, h as WorkGraph, i as mergeDeclaredEntries, it as StageLoadError, j as getDockerCmd, k as isMalformedEnvKey, l as DiffCalculator, lt as prepareLegacyStackAssets, m as AssetPublisher, n as declaredStringList, nt as refuseFailedLookups, ot as createLegacyAssetParameterBinder, p as isLockInfoExpired, q as resolveUpdatePolicy, r as inlinePoliciesAreDeclared, rt as AssemblyReader, s as stringListIsDeclared, st as legacyPlanAssetCount, t as declaredInlinePolicies, tt as uploadCfnTemplate, u as LEGACY_HANDLE_HEAL_REASON, ut as CdkToolkitBucketMissingError, w as dockerSpawnEnvWithSensitive, x as redactedCause, y as describeDockerExecFailure, z as loadCdkJson } from "./settle-own-write-members-Nyh6snFh.js";
9
- import { $a as policyDocumentMatchesDeclared, $c as refuseMalformedResourceEntriesForOrphan, $i as gray, $l as PROPERTY_COVERAGE_BY_TYPE, $n as parseMappingFile, $o as applyRoleArnIfSet, $t as removeSignalReceiverNamed, A as recordedProtectionEvidence, Aa as createPreDeleteFinalSnapshot, Ac as deployRefusesOrphanRowsReason, Ai as collectDeclaredOutputNames, Al as malformedStateRefusalMessage, An as DeploymentEventsStore, Ao as setLocalCustomResourceRuntimeEnabled, Ar as undeclaredEmptyObservedKeys, Au as templateIdentity, Bc as unpreviewableOrphanRecords, Bi as supersededAfterRollback, Bl as UNREADABLE_RESOURCES_MAP_ROW, Bn as formatDestructiveChange, Br as planRollback, Bs as getAccountInfo, Bu as createAssetRedirectResolver, C as pendingMovesOutOf, Ca as PRE_DELETE_SNAPSHOT_TYPES, Cc as maskedPropertyFingerprintsOf, Cd as displayAssemblyPath, Ci as secretBearingStateKeyWarning, Cl as refuseMalformedOutputs, Cn as journaledOrphanLines, Co as withPrintingSecrets, Cr as buildReadCurrentStateContext, Cs as AWS_NO_VALUE, Cu as isSensitiveAttributeName, D as findServiceTokenRefusals, Da as isFinalSnapshotError, Di as exportNameSecretExposure, Dl as refuseDivergentRecordRegionForDestroy, Dn as makeSiblingClaimReader, Do as customResourcesRunWithoutApp, Dr as calculateResourceDrift, Ds as lacksRecordedRefArn, Du as isAbsoluteAssetPath, E as deferredServiceTokenWarning, Ea as effectiveDeletionPolicy, Ec as maskedInputProof, Ed as resolveAssemblyPath, Ei as exportNameNoEchoParameters, El as STATE_REGION_DIVERGED, En as makeForeignHolderScan, Eo as customResourcesFailedWithoutApp, Er as withUnprovenUnsettled, Es as refStateLookupFromResource, Eu as findNestedTemplateTreeDefect, F as readProtection, Fc as previewableOrphanRecords, Fi as DEFAULT_RESOURCE_WARN_AFTER_MS, Fl as repairMalformedResourcesForReadOnly, Fn as noEchoMacParametersOf, Fo as RollbackInlinePolicyWriters, Ga as LAMBDA_PERMISSION_STATEMENT_KEYS, Gc as malformedResourceEntriesWarning, Gi as withoutSuperseded, Gl as findHandledUnwrittenCreateOnly, Gn as withMovedTo, Go as isSelectOutOfBounds, Gr as planFailedOps, Gs as keepsSecretReferenceToken, Gt as readRefactorMarkerOnce, Gu as loadPublishableAssetManifest, H as readStreamPolicy, Hc as isReadableResourceEntry, Hi as supersededHeldByOtherTypeWarning, Hl as hasReadableOutputs, Hn as hintSidesOf, Ho as isWaitAbandonedError, Hr as demoteSupersededOrphans, Hs as carriesFetchableDynamicReference, Ht as keptForRetainedRecord, Ic as refuseMalformedOrphanRecords, Ii as maskingRetryLogger, Il as JSON_LISTING_HOLE_VALUE, In as noEchoMacVerdict, Io as UNSPECIFIED_SKIP_REASON, Ir as ledgerForStack, Is as recordedReferenceRegions, Iu as decodeListingKey, Ja as declaredMemberDocument, Jc as refuseMalformedResourceEntries, Ji as resolveReplacementOldType, Jn as changedReferenceReason, Jo as stackIdTailOf, Jr as replacementNeverSwapped, Js as INTRINSIC_KEYS, Jt as refuseRefactorMarker, Ju as rewriteTemplateAssetReferences, Kc as malformedScrubResourceEntriesRefusalMessage, Kn as changedReferenceInDiff, Ko as isAlwaysLiveAttribute, Kr as recheckFailedPlan, Ks as withSharedDrainBudget, Kt as refactorMarkerMovesOf, Lc as refuseMalformedOrphanRecordsForDestroy, Li as deleteSupersededEntry, Ll as accountArgs, Ln as noEchoValueMacsOf, Lo as deleteIndeterminateGuards, M as PROTECTION_PROPERTY_BY_TYPE, Mc as malformedOrphanRecordsRefusalMessage, Mi as isExportAliasCollision, Ml as refuseMalformedResourcesForDestroy, Mn as NOECHO_MAC_KEY_ALIAS, Mr as updatePartialReason, Ms as keepHeldTokenProvenance, N as isProtectionValueActive, Nc as malformedOrphanRecordsWarning, Ni as bindingSkippedOutputs, Nl as refuseMalformedResourcesForExport, Nn as createNoEchoValueMacs, No as CloudControlProvider, Nr as findUpdatePolicyReplacementRefusals, Nu as ssmResolvedValueType, O as serviceTokenBlockingReason, Oa as refusesFinalSnapshot, Oc as declaresNoEcho, Od as resolveBucketRegion, Oi as isWholeDynamicReferenceValue, Ol as malformedRenderedContainersWarning, On as planOrphanAdoption, Oo as localCustomResourceCommand, Or as equalModuloMarkedMask, Os as lacksRecordedTableArn, Ou as listNestedTemplateRows, P as perType, Pc as malformedOrphanRowsKeptWarning, Pi as DEFAULT_RESOURCE_TIMEOUT_MS, Pl as refuseMalformedState, Pn as noEchoMacBinding, Pr as replacementCreateRoutesToCloudControl, Ps as recordedOutputReferenceRegions, Pu as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Qa as memberReadFailure, Qc as refuseMalformedResourceEntriesForImportSave, Qi as cyan, Ql as hasNoCloudControlHandlers, Qn as mappingPairs, Qo as refuseUnreadableCdkCrossAccountRefs, Qr as readsRegeneratingSecret, Qt as isReceiver, Rc as refuseMalformedOrphansForOrphan, Ri as holdsSupersededResources, Rl as withheldAccountClause, Rn as constructPathOf$1, Ro as deleteLeftInPlace, Rr as withCreateTokenLedger, S as hasPendingMovesOut, Sa as ATOMIC_FINAL_SNAPSHOT_TYPES, Sd as describeFileReadFailure, Si as secretBearing, Sn as isHandledOrphan, Sr as earlyDeletedOld, Ss as parameterTypeMayLoseSecretIdentity, Su as isSecretValuedAttribute, T as refusePendingMovesOut, Ta as ccRoutedInstanceTakesNoSnapshot, Tc as parameterInputsFor, Td as renderAssemblyPathEscape, Ti as carriedExportAliasExposure, Tl as repairMalformedOutputsForReadOnly, Tn as sameJournaledOrphans, Tr as settleUnsettledPrevious, Ts as isStalePlaceholderArnAttribute, Ua as withStackRecords, Uc as malformedLocalResourceEntriesWarning, Ui as supersededHolderOf, Ul as hasReadableResources, Un as movedToHint, Ur as isJournaledOrphan, Us as isNamelessDynamicReferenceError, Ut as recordRetainedForReadoption, Va as revertStackRecordsView, Vc as unreadableOrphanRecords, Vi as supersededDependentsFirst, Vl as displayLogicalId, Vn as findRefactorHints, Vo as getReadOnlyPropertyPaths, Vr as seedsDeleteFirstGuard, Vs as isImpossibleEmptyStoredAttribute, Vu as createLazyAssetModeContext, Wc as malformedLocalResourcesWarning, Wi as supersededResourcesOf, Wl as findActionableSdkUnwired, Wn as rollbackOrphanIds, Wo as IntrinsicFunctionResolver, Wr as isReplacementOrphan, Ws as carriesDynamicReference, Wt as readRefactorMarker, Xa as efsPolicyMatchesDeclared, Xc as refuseMalformedResourceEntriesForDestroy, Xi as findNestedStackTypeChanges, Xn as isPairableType, Xo as resolveDynamicReferences, Xr as computeImplicitDeleteEdges, Xt as updateRefactorMarker, Xu as getDockerImageBySourceHash, Ya as declaredPolicyDocument, Yc as refuseMalformedResourceEntriesForDeploy, Yi as withPreviousPolicies, Yn as differingRemedy, Yr as IMPLICIT_DELETE_DEPENDENCIES, Yt as sameMove, Yu as AssetManifestLoader, Z as declaredTagsReadback, Za as lambdaPermissionMatchesDeclared, Zc as refuseMalformedResourceEntriesForImport, Zi as bold, Zl as NO_CC_HANDLERS_REASON, Zn as looselyEqual, Zo as producerLookupOver, Zr as attemptUsesCompletedCreate, Zt as deleteSignalReceiver, _ as conditionFingerprint, _a as secretNamedRecordNeedles, _c as secretSegmentsOfState, _d as hasPlainPrototype, _i as reachableDivergentParameters, _l as malformedExportNamesWarning, _n as getCurrentNestedStackContext, _o as customResourceResponseExpirationWarning, _r as replayFailedOperations, _u as crossPrefixDeniedWarning, a as scanActiveConsumers, aa as noEchoExactEchoLeavesOf, ac as isStatefulRecreateTargetForReplace, ad as assertAssetBucketRegion, ai as orphanNeedsIdentity, al as refuseMalformedResourcePropertiesForDestroy, an as resolvePendingCloudControlRequests, ar as undeclaredGrantSiblingMembers, as as sendableAssumeRoleCommand, b as readRecordedConditionVerdicts, ba as storedSecretNameNeedles, bc as getTopLevelKeysHoldingUnreadableCreateOnly, bi as displayTextOrWithheld, bl as malformedOutputsRefusalMessage, bn as dropFailedCommands, bo as readsNoEchoDeleteValues, br as PLANNED_EARLY_DELETE_CONSEQUENCE, bs as coerceParameterTypedValue, bu as stackInstanceIdOf, c as nestedSsmNameDeferredNote, ca as createReadOnlyAttributeHealerFactory, cd as parseBootstrapMarker, ci as nameScopeOf, cl as refuseMalformedResourcePropertiesForOrphan, cn as displacedPhysicalIdShown, co as ccBrokenReason, cr as sgSiblingDecidedById, cs as callerEnvCredentials, cu as splitImportedOps, d as slashedSsmNameHealAdoptedNote, da as maskEventTextWithBoundBags, dd as validateContainerRepoName, di as retiredNameGenerationsLeaving, dl as hasReadableOrphans, dn as nestedChildStackName$1, do as WaitConditionSignalStore, ds as classifyReplaySecretRegion, du as hasReasonlessBaselineRefusal, ea as green, ei as isRedactedRecordedValue, el as repairMalformedResourceEntriesForReadOnly, en as macWriteOnlyKeys, eo as reReadUntilSettled, er as propertiesChangedReason, es as assertFlagRoleArn, f as slashedSsmNameHealNote, fa as namingSecretsWithRecordedNoEcho, fd as BOOTSTRAP_MARKER_PREFIX, fi as withNameGenerationReached, fl as malformedOrphansRefusalMessage, fn as recordDisplacedSkips, fo as classifyHandleUrl, fs as producerRegionsFromState, fu as hasUnverifiableParameterRefusal, g as makeCanonicalizePropertiesFn, gc as secretPhysicalIdSegment, gd as hasOwnKey, gi as namesAnyDeclaredParameter, gl as repairMalformedOrphansForReadOnly, gn as collectNestedChildUnaddressed, go as applyCustomResourceResponseExpiration, gr as canonicalizeIpProtocolValue, gu as applyCrossPrefixScan, h as inheritedProvenanceForChildDiff, ha as secretNamePrintingBags, hd as defineOwnKey, hi as computeParameterTaint, hl as refuseMalformedOrphansForDestroy, hn as withNestedRevertRun, ho as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, hr as sgProtocolKey, hu as CrossPrefixScanCache, i as mergeNoChangeOutputs, ia as noEchoComparisonForTemplate, ic as MULTI_REGION_RECREATE_BLOCKED_TYPES, id as buildDenyExternalAccessPolicy, ii as removeProtectionTypeList, in as pendingRequestCount, ir as stripSiblingOwnedParentMembers, is as parseIamRoleArn, j as recordedProtectionNote, ja as buildFinalSnapshotIdentifier, jc as isReadableOrphanRecord, ji as collectPublishedOutputNames, jl as refuseMalformedResourcesForDeploy, jn as crossStackReadsForPartialSave, jo as withCustomResourceStack, jr as updatePartialMessage, k as diffSecurity, ka as unsupportedFinalSnapshotError, kc as maskedPropertyFingerprint, ki as noEchoParameterValueSeed, kl as malformedResourcesWarning, kn as DeploymentEventsReader, kr as equalModuloMask, ku as renderNestedTemplateTreeDefect, l as nestedSsmNameRowNote, la as completedReplayEntries, ld as readBootstrapMarkerBody, li as retiredAfterRollback, ll as repairMalformedResourcePropertiesForReadOnly, ln as dropSettledNestedJournals, lo as isCustomResource, ls as envCredentialsAreAssumedRole, m as crossStackOutputProvenanceSource, ma as secretNamePrintingBag, mc as displayPhysicalId, mi as inheritProducerRegions, ml as refuseMalformedOrphans, mn as revertedNestedRowIds, mo as isSignalKey, mr as recordedSgRuleId, ms as isUnexposedRecordedIdentity, mu as CrossPrefixReadError, n as isSecretBearingReferenceString, na as yellow, nd as AssetModeResolver, nl as malformedDriftResourcePropertiesWarning, nr as referencedLogicalIds, ns as explicitRoleArnOrThrow, o as inRunStackKey, oa as noEchoParameterNamesOf, oc as isStatefulRecreateTargetSync, od as isCrossRegionRedirect, oi as nameGenerationCarriedFrom, ol as refuseMalformedResourcePropertiesForDrift, on as NESTED_PENDING_PARENT_REASON, oo as CC_BROKEN_REASON, or as recordedRuleIdOf, os as AWS_CREDENTIAL_ENV_KEYS, ou as TemplateParser, p as slashedSsmNameHealPendingNote, pa as orphanRecordsPrintingBag, pl as malformedOrphansWarning, pr as cfnIngressPortValue, ps as regionLessSecretName, pu as rebuildClientForBucketRegion, q as streamPolicyMatchesDeclared, qc as refuseMalformedResourceAttributesForOrphan, qi as snapshotSegmentSurvivors, ql as unwrittenCreateOnlyReplacement, qn as changedReferencePath, qo as poisonRenderedSpellingsCollidingIn, qr as recordUnderIdIsNotOwn, qt as refactorMarkerRefusalMessage, r as keptWholeReasonText, ra as noEchoAttributeNamesOf, rc as shownType, rd as ensureAssetStorage, ri as segmentCleanupOptions, rl as malformedResourcePropertiesWarning, rn as formatResourceLine, ro as verbatimEchoDriftKeys, rr as siblingOwnedRevertDesired, rs as isIamRoleArn, s as checkNestedSsmNames, sa as withAttemptedItemsMasked, sc as renderStatefulReason, sd as getBootstrapMarkerKey, si as nameGenerationHighWaterOf, sl as refuseMalformedResourcePropertiesForExport, sn as displacedOpClause, so as ProviderRegistry, sr as sgRuleOwnershipIdentity, ss as applyCallerIdentityCredentials, su as S3StateBackend, t as DeployEngine, ta as red, tc as findReplacedReadersOfRecreateTargets, tl as unreadableResourceEntries, tn as readsOnlyNoEchoParameters, tr as proposeRenames, ts as assertSendableRoleArn, tt as tagsMatchDeclared, tu as providerReplacementOldDeleted, u as healSlashedSsmParameterNames, ua as journaledOrphanPrintingBag, ud as validateAssetBucketName, ui as retiredNameGenerationsAfter, ul as UNREADABLE_ORPHANS_CONTAINER_ROW, uo as wouldReturnToSdkProvider, ur as siblingRecordedSgRuleIds, us as classifyRecordedSecretRegion, uu as readOnlyStateVersionOf, v as conditionInputsFrom, va as stackSecretNamesMasker, vc as withSecretPhysicalIdsMaskedInState, vd as nullPrototypeRecord, vi as resourcesNamingDeclaredParameter, vl as malformedExportSourceWarning, vn as withNestedStackContext, vr as replayRollback, vu as isAccessDenied, w as pendingMovesRefusalMessage, wa as ccRoutedFinalSnapshotError, wi as secretSafeKeyDisplay, wl as refuseMalformedOutputsForDestroy, wn as loadJournaledOrphans, wo as NO_LOCAL_CUSTOM_RESOURCES_FLAG, wr as recordAfterRollbackUpdate, ws as cfnRefValueFromPhysicalId, x as childTemplateLoader, xa as extractDeploymentEventError, xc as tryGetTopLevelWriteOnlyProperties, xi as exportAliasCollisionScrubWarning, xl as malformedOutputsWarning, xn as dropFailedHint, xo as isCustomResourceType$1, xr as earlyDeleteWhen, xs as isUnboundTemplateParameter, xu as withStackInstanceIdWithheld, y as parentSuppliedValues, ya as stateSecretNameNeedles, yc as getSettledWriteOnlyPropertyPaths, yd as ownValue, yi as WITHHELD_NAME_DISPLAY, yl as malformedLocalOutputsWarning, yn as deleteJournaledOrphans, yo as TemplateNoEchoReresolver, yr as DELETED_RESOURCE_REMEDY, yu as isNotImplemented, za as destroyStackRecordsView, zc as repairMalformedOrphanRecordsForReadOnly, zi as isSupersededResourceRecord, zl as STATE_RESOURCES_MALFORMED, zn as findDestructiveChanges, zo as deleteSkipReason, zs as withoutVersionAttestation, zu as buildAssetRedirectMap } from "./deploy-engine-Zi4lQPww.js";
8
+ import { $ as MIGRATE_TMP_PREFIX, A as formatDockerLoginError, B as resolveApp, C as redactDockerArgvValues, D as warnFinchArgvExposure, E as partitionSensitiveEnv, F as Synthesizer, G as resolveStateBucketWithDefaultAndSource, H as resolveCaptureObservedState, I as synthesisStatusMessage, J as resolveUseCdkBootstrapAssets, K as resolveStateBucketWithSource, L as getDefaultStateBucketName, M as runDockerForeground, N as runDockerStreaming, O as isDockerClientEnvKey, P as abortInFlightMultipartUploads, Q as CFN_TEMPLATE_URL_LIMIT, R as getLegacyStateBucketName, S as redactedDockerCause, T as finchSecretArgvRefusal, U as resolveSkipPrefix, V as resolveAutoAssetStorage, W as resolveStateBucketWithDefault, X as warnDeprecatedNoPrefixCliFlag, Y as stateBucketExistenceConfirmed, Z as CFN_TEMPLATE_BODY_LIMIT, _ as resolveDockerContextDirectory, at as bindLegacyStackAssetParameters, b as describeDockerFailure, ct as predictedAutoCreatedAssetMode, d as DagBuilder, dt as processStackMessages, et as findLargeInlineResources, f as LockManager, ft as setChildProcessAwsEnv, g as buildDockerImage, h as WorkGraph, i as mergeDeclaredEntries, it as StageLoadError, j as getDockerCmd, k as isMalformedEnvKey, l as DiffCalculator, lt as prepareLegacyStackAssets, m as AssetPublisher, n as declaredStringList, nt as refuseFailedLookups, ot as createLegacyAssetParameterBinder, p as isLockInfoExpired, q as resolveUpdatePolicy, r as inlinePoliciesAreDeclared, rt as AssemblyReader, s as stringListIsDeclared, st as legacyPlanAssetCount, t as declaredInlinePolicies, tt as uploadCfnTemplate, u as LEGACY_HANDLE_HEAL_REASON, ut as CdkToolkitBucketMissingError, w as dockerSpawnEnvWithSensitive, x as redactedCause, y as describeDockerExecFailure, z as loadCdkJson } from "./settle-own-write-members-C5Bz98EG.js";
9
+ import { $a as stateSecretNameNeedles, $c as tryGetTopLevelWriteOnlyProperties, $i as WITHHELD_NAME_DISPLAY, $l as malformedOutputsWarning, $n as journaledOrphanLines, $o as TemplateNoEchoReresolver, $r as PLANNED_EARLY_DELETE_CONSEQUENCE, $u as withStackInstanceIdWithheld, A as recordedProtectionEvidence, Aa as findNestedStackTypeChanges, Ai as attemptUsesCompletedCreate, Al as refuseMalformedResourceEntriesForImportSave, An as macWriteOnlyKeys, Ao as efsPolicyMatchesDeclared, Ar as propertiesChangedReason, As as resolveDynamicReferences, Au as hasNoCloudControlHandlers, Ba as noEchoParameterNamesOf, Bc as isStatefulRecreateTargetSync, Bd as parseBootstrapMarker, Bi as nameGenerationCarriedFrom, Bl as refuseMalformedResourcePropertiesForOrphan, Bo as CC_BROKEN_REASON, Br as siblingRecordedSgRuleIds, Bs as AWS_CREDENTIAL_ENV_KEYS, Bu as splitImportedOps, C as slashedSsmNameHealPendingNote, Ca as supersededHolderOf, Cc as isNamelessDynamicReferenceError, Cd as loadPublishableAssetManifest, Ci as isReplacementOrphan, Cl as malformedResourceEntriesWarning, Cn as refactorMarkerRefusalMessage, Co as withStackRecords, Cr as changedReferencePath, Cu as findHandledUnwrittenCreateOnly, D as findServiceTokenRefusals, Da as snapshotSegmentSurvivors, Dd as AssetManifestLoader, Di as replacementNeverSwapped, Dl as refuseMalformedResourceEntriesForDeploy, Dn as deleteSignalReceiver, Dr as looselyEqual, Ds as poisonRenderedSpellingsCollidingIn, E as deferredServiceTokenWarning, Ec as withSharedDrainBudget, Ed as rewriteTemplateAssetReferences, Ei as recordUnderIdIsNotOwn, El as refuseMalformedResourceEntries, En as updateRefactorMarker, Er as isPairableType, Es as isAlwaysLiveAttribute, F as readProtection, Fa as red, Fc as findReplacedReadersOfRecreateTargets, Fd as ensureAssetStorage, Fl as malformedResourcePropertiesWarning, Fn as resolvePendingCloudControlRequests, Fr as undeclaredGrantSiblingMembers, Fs as assertSendableRoleArn, Ga as maskEventTextWithBoundBags, Gi as retiredNameGenerationsLeaving, Gl as malformedOrphansWarning, Gn as withNestedRevertRun, Go as WaitConditionSignalStore, Gr as sgCidrKey, Gs as classifyReplaySecretRegion, Gu as rebuildClientForBucketRegion, H as readStreamPolicy, Ha as createReadOnlyAttributeHealerFactory, Hd as validateAssetBucketName, Hi as nameScopeOf, Hl as UNREADABLE_ORPHANS_CONTAINER_ROW, Hn as recordDisplacedSkips, Ho as ccBrokenReason, Hs as callerEnvCredentials, Hu as readOnlyStateVersionOf, Ia as yellow, Id as buildDenyExternalAccessPolicy, Ii as segmentCleanupOptions, In as NESTED_PENDING_PARENT_REASON, Ir as recordedRuleIdOf, Is as explicitRoleArnOrThrow, Ja as secretNamePrintingBag, Jc as secretPhysicalIdSegment, Jd as hasOwnKey, Ji as inheritProducerRegions, Jl as repairMalformedOrphansForReadOnly, Jn as withNestedStackContext, Jo as isSignalKey, Jr as canonicalizeIpv4Cidr, Js as isUnexposedRecordedIdentity, Ju as applyCrossPrefixScan, Ka as namingSecretsWithRecordedNoEcho, Kc as displayPhysicalId, Ki as withNameGenerationReached, Kl as refuseMalformedOrphans, Kn as collectNestedChildUnaddressed, Ko as classifyHandleUrl, Kr as sgProtocolKey, Ks as producerRegionsFromState, Ku as CrossPrefixReadError, La as noEchoAttributeNamesOf, Lc as shownType, Ld as assertAssetBucketRegion, Li as removeProtectionTypeList, Ll as refuseMalformedResourcePropertiesForDestroy, Ln as displacedOpClause, Lo as verbatimEchoDriftKeys, Lr as sgRuleOwnershipIdentity, Ls as isIamRoleArn, M as PROTECTION_PROPERTY_BY_TYPE, Ma as cyan, Ml as repairMalformedResourceEntriesForReadOnly, Mo as memberReadFailure, Mr as referencedLogicalIds, Ms as refuseUnreadableCdkCrossAccountRefs, Mt as tagsMatchDeclared, N as isProtectionValueActive, Na as gray, Ni as isRedactedRecordedValue, Nl as unreadableResourceEntries, Nn as formatResourceLine, No as policyDocumentMatchesDeclared, Nr as siblingOwnedRevertDesired, Ns as applyRoleArnIfSet, Nu as providerReplacementOldDeleted, O as serviceTokenBlockingReason, Oa as resolveReplacementOldType, Oc as INTRINSIC_KEYS, Od as getDockerImageBySourceHash, Oi as IMPLICIT_DELETE_DEPENDENCIES, Ol as refuseMalformedResourceEntriesForDestroy, On as isReceiver, Oo as declaredMemberDocument, Or as mappingPairs, Os as stackIdTailOf, Ot as declaredTagsReadback, P as perType, Pa as green, Pd as AssetModeResolver, Pl as malformedDriftResourcePropertiesWarning, Pn as pendingRequestCount, Po as reReadUntilSettled, Pr as stripSiblingOwnedParentMembers, Ps as assertFlagRoleArn, Qa as stackSecretNamesMasker, Qc as getTopLevelKeysHoldingUnreadableCreateOnly, Qi as resourcesNamingDeclaredParameter, Ql as malformedOutputsRefusalMessage, Qn as isHandledOrphan, Qr as DELETED_RESOURCE_REMEDY, Qu as stackInstanceIdOf, Ra as noEchoComparisonForTemplate, Rc as MULTI_REGION_RECREATE_BLOCKED_TYPES, Rd as isCrossRegionRedirect, Ri as removeProtectionTypes, Rl as refuseMalformedResourcePropertiesForDrift, Rn as displacedPhysicalIdShown, Rr as sgSiblingDecidedById, Rs as parseIamRoleArn, Ru as TemplateParser, S as slashedSsmNameHealNote, Sa as supersededHeldByOtherTypeWarning, Sc as carriesFetchableDynamicReference, Si as isJournaledOrphan, Sl as malformedLocalResourcesWarning, Sn as refactorMarkerMovesOf, Sr as changedReferenceInDiff, Ss as isWaitAbandonedError, Su as findActionableSdkUnwired, T as inRunStackKey, Ta as withoutSuperseded, Tc as keepsSecretReferenceToken, Ti as recheckFailedPlan, Tl as refuseMalformedResourceAttributesForOrphan, Tn as sameMove, To as LAMBDA_PERMISSION_STATEMENT_KEYS, Tr as differingRemedy, Ts as isSelectOutOfBounds, Tu as unwrittenCreateOnlyReplacement, Ua as completedReplayEntries, Ud as validateContainerRepoName, Ui as retiredAfterRollback, Ul as hasReadableOrphans, Uo as isCustomResource, Ur as cfnIngressPortValue, Us as envCredentialsAreAssumedRole, Uu as hasReasonlessBaselineRefusal, Va as withAttemptedItemsMasked, Vc as renderStatefulReason, Vd as readBootstrapMarkerBody, Vi as nameGenerationHighWaterOf, Vl as repairMalformedResourcePropertiesForReadOnly, Vn as nestedChildStackName$1, Vo as ProviderRegistry, Vs as applyCallerIdentityCredentials, Wa as journaledOrphanPrintingBag, Wd as BOOTSTRAP_MARKER_PREFIX, Wi as retiredNameGenerationsAfter, Wl as malformedOrphansRefusalMessage, Wn as revertedNestedRowIds, Wo as wouldReturnToSdkProvider, Wr as recordedSgRuleId, Ws as classifyRecordedSecretRegion, Wu as hasUnverifiableParameterRefusal, Xc as withSecretPhysicalIdsMaskedInState, Xd as nullPrototypeRecord, Xi as namesAnyDeclaredParameter, Xl as malformedExportSourceWarning, Xn as dropFailedCommands, Xo as applyCustomResourceResponseExpiration, Xr as replayFailedOperations, Xu as isAccessDenied, Ya as secretNamePrintingBags, Yc as secretSegmentsOfState, Yd as hasPlainPrototype, Yi as computeParameterTaint, Yl as malformedExportNamesWarning, Yn as deleteJournaledOrphans, Yo as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, Yr as canonicalizeIpProtocolValue, Yu as crossPrefixDeniedWarning, Za as secretNamedRecordNeedles, Zc as getSettledWriteOnlyPropertyPaths, Zd as ownValue, Zi as reachableDivergentParameters, Zl as malformedLocalOutputsWarning, Zn as dropFailedHint, Zo as customResourceResponseExpirationWarning, Zr as replayRollback, Zu as isNotImplemented, _ as pendingMovesOutOf, _a as deleteSupersededEntry, _d as buildAssetRedirectMap, _i as withCreateTokenLedger, _l as repairMalformedOrphanRecordsForReadOnly, _r as findRefactorHints, _s as deleteIndeterminateGuards, _u as STATE_RESOURCES_MALFORMED, a as checkNestedSsmNames, aa as carriedExportAliasExposure, ac as isStalePlaceholderArnAttribute, ad as isAbsoluteAssetPath, ai as withUnprovenUnsettled, ao as ccRoutedInstanceTakesNoSnapshot, ar as DeploymentEventsReader, au as refuseDivergentRecordRegionForDestroy, b as healSlashedSsmParameterNames, ba as supersededAfterRollback, bc as getAccountInfo, bi as seedsDeleteFirstGuard, bl as isReadableResourceEntry, bn as readRefactorMarker, br as rollbackOrphanIds, bu as hasReadableOutputs, c as crossStackOutputProvenanceSource, ca as isWholeDynamicReferenceValue, cc as lacksRecordedTableArn, cd as templateIdentity, ci as equalModuloMask, cl as deployRefusesOrphanRowsReason, co as refusesFinalSnapshot, cr as NOECHO_MAC_KEY_ALIAS, cs as localCustomResourceCommand, cu as malformedStateRefusalMessage, d as conditionFingerprint, da as collectPublishedOutputNames, dd as ssmResolvedValueType, di as updatePartialReason, dl as malformedOrphanRecordsWarning, do as buildFinalSnapshotIdentifier, dr as noEchoMacParametersOf, ds as withCustomResourceStack, du as refuseMalformedResourcesForExport, ea as displayTextOrWithheld, ec as coerceParameterTypedValue, ed as isSecretValuedAttribute, ef as describeFileReadFailure, ei as earlyDeleteWhen, eo as storedSecretNameNeedles, er as loadJournaledOrphans, es as readsNoEchoDeleteValues, f as conditionInputsFrom, fa as isExportAliasCollision, fc as keepHeldTokenProvenance, fd as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, fi as findUpdatePolicyReplacementRefusals, fl as malformedOrphanRowsKeptWarning, fr as noEchoMacVerdict, fu as refuseMalformedState, g as hasPendingMovesOut, ga as maskingRetryLogger, gc as recordedReferenceRegions, gl as refuseMalformedOrphansForOrphan, gr as formatDestructiveChange, gs as UNSPECIFIED_SKIP_REASON, gu as withheldAccountClause, h as childTemplateLoader, ha as DEFAULT_RESOURCE_WARN_AFTER_MS, hi as ledgerForStack, hl as refuseMalformedOrphanRecordsForDestroy, hr as findDestructiveChanges, hs as RollbackInlinePolicyWriters, hu as accountArgs, i as mergeNoChangeOutputs, ia as secretSafeKeyDisplay, ic as cfnRefValueFromPhysicalId, id as findNestedTemplateTreeDefect, if as resolveAssemblyPath, ii as settleUnsettledPrevious, il as maskedInputProof, io as ccRoutedFinalSnapshotError, ir as planOrphanAdoption, is as NO_LOCAL_CUSTOM_RESOURCES_FLAG, iu as STATE_REGION_DIVERGED, j as recordedProtectionNote, ja as bold, ji as readsRegeneratingSecret, jl as refuseMalformedResourceEntriesForOrphan, jn as readsOnlyNoEchoParameters, jo as lambdaPermissionMatchesDeclared, jr as proposeRenames, js as producerLookupOver, ju as PROPERTY_COVERAGE_BY_TYPE, k as diffSecurity, ka as withPreviousPolicies, ki as computeImplicitDeleteEdges, kl as refuseMalformedResourceEntriesForImport, kn as removeSignalReceiverNamed, ko as declaredPolicyDocument, kr as parseMappingFile, ku as NO_CC_HANDLERS_REASON, l as inheritedProvenanceForChildDiff, la as noEchoParameterValueSeed, li as undeclaredEmptyObservedKeys, ll as isReadableOrphanRecord, lo as unsupportedFinalSnapshotError, lr as createNoEchoValueMacs, lu as refuseMalformedResourcesForDeploy, m as readRecordedConditionVerdicts, ma as DEFAULT_RESOURCE_TIMEOUT_MS, mc as recordedOutputReferenceRegions, md as decodeListingKey, ml as refuseMalformedOrphanRecords, mr as constructPathOf$1, mu as JSON_LISTING_HOLE_VALUE, n as isSecretBearingReferenceString, na as secretBearing, nc as parameterTypeMayLoseSecretIdentity, ni as buildReadCurrentStateContext, no as ATOMIC_FINAL_SNAPSHOT_TYPES, nr as makeForeignHolderScan, nu as refuseMalformedOutputsForDestroy, o as nestedSsmNameDeferredNote, oa as exportNameNoEchoParameters, oc as refStateLookupFromResource, od as listNestedTemplateRows, of as resolveBucketRegion, oi as calculateResourceDrift, ol as declaresNoEcho, oo as effectiveDeletionPolicy, or as DeploymentEventsStore, os as customResourcesFailedWithoutApp, ou as malformedRenderedContainersWarning, p as parentSuppliedValues, pa as bindingSkippedOutputs, pi as replacementCreateRoutesToCloudControl, pl as previewableOrphanRecords, pr as noEchoValueMacsOf, ps as CloudControlProvider, pu as repairMalformedResourcesForReadOnly, q as streamPolicyMatchesDeclared, qa as orphanRecordsPrintingBag, qd as defineOwnKey, ql as refuseMalformedOrphansForDestroy, qn as getCurrentNestedStackContext, qs as regionLessSecretName, qu as CrossPrefixScanCache, r as keptWholeReasonText, ra as secretBearingStateKeyWarning, rc as AWS_NO_VALUE, rf as renderAssemblyPathEscape, ri as recordAfterRollbackUpdate, rl as parameterInputsFor, ro as PRE_DELETE_SNAPSHOT_TYPES, rr as makeSiblingClaimReader, rs as withPrintingSecrets, ru as repairMalformedOutputsForReadOnly, s as nestedSsmNameRowNote, sa as exportNameSecretExposure, sc as lacksRecordedRefArn, sd as renderNestedTemplateTreeDefect, si as equalModuloMarkedMask, sl as maskedPropertyFingerprint, so as isFinalSnapshotError, sr as crossStackReadsForPartialSave, ss as customResourcesRunWithoutApp, su as malformedResourcesWarning, t as DeployEngine, ta as exportAliasCollisionScrubWarning, tc as isUnboundTemplateParameter, td as isSensitiveAttributeName, tf as displayAssemblyPath, ti as earlyDeletedOld, tl as maskedPropertyFingerprintsOf, to as extractDeploymentEventError, tr as sameJournaledOrphans, ts as isCustomResourceType$1, tu as refuseMalformedOutputs, u as makeCanonicalizePropertiesFn, ua as collectDeclaredOutputNames, ui as updatePartialMessage, ul as malformedOrphanRecordsRefusalMessage, uo as createPreDeleteFinalSnapshot, ur as noEchoMacBinding, us as setLocalCustomResourceRuntimeEnabled, uu as refuseMalformedResourcesForDestroy, v as pendingMovesRefusalMessage, va as holdsSupersededResources, vd as createAssetRedirectResolver, vl as unpreviewableOrphanRecords, vn as keptForRetainedRecord, vr as hintSidesOf, vs as deleteLeftInPlace, vu as UNREADABLE_RESOURCES_MAP_ROW, w as scanActiveConsumers, wa as supersededResourcesOf, wc as carriesDynamicReference, wi as planFailedOps, wl as malformedScrubResourceEntriesRefusalMessage, wn as refuseRefactorMarker, wr as changedReferenceReason, ws as IntrinsicFunctionResolver, x as slashedSsmNameHealAdoptedNote, xa as supersededDependentsFirst, xc as isImpossibleEmptyStoredAttribute, xi as demoteSupersededOrphans, xl as malformedLocalResourceEntriesWarning, xn as readRefactorMarkerOnce, xo as revertStackRecordsView, xr as withMovedTo, xs as getReadOnlyPropertyPaths, xu as hasReadableResources, y as refusePendingMovesOut, ya as isSupersededResourceRecord, yc as withoutVersionAttestation, yd as createLazyAssetModeContext, yi as planRollback, yl as unreadableOrphanRecords, yn as recordRetainedForReadoption, yo as destroyStackRecordsView, yr as movedToHint, ys as deleteSkipReason, yu as displayLogicalId, za as noEchoExactEchoLeavesOf, zc as isStatefulRecreateTargetForReplace, zd as getBootstrapMarkerKey, zi as orphanNeedsIdentity, zl as refuseMalformedResourcePropertiesForExport, zn as dropSettledNestedJournals, zs as sendableAssumeRoleCommand, zu as S3StateBackend } from "./deploy-engine-Ckkutmgf.js";
10
10
  import { n as canonicalizeRegion, r as derivePartitionAndUrlSuffix, t as PARTITION_TABLE } from "./aws-partition-DA0r2sr-.js";
11
- import { C as prefetchCreateOnlyPropertyPaths, E as describeTypeWithThrottleRetry, J as parseFailureDebugDetail, K as describeJsonParseFailure, U as renderPhaseTimings, W as timePhase, X as utf8ByteLength, j as withRetry, l as setResolvedResourceTimeouts, w as templateResourceTypes, x as getCreateOnlyPropertyPaths, z as PhaseClock } from "./ec2-termination-protection-DbUAhJ8k.js";
12
- import { t as expectedOwnerParam } from "./expected-bucket-owner-Bbo88Hgr.js";
13
- import { Bt as describeRegionValueKind, Gt as isReadableBag, Ht as hasReadableExportSet, Jt as shouldRetainResource, Kt as orphansAfterRollback, Tt as differingIdentityWarning, Ut as importableOutputKeys, Vt as exportNamesCarriedFrom, Wt as importableOutputs, Xt as stackInstanceIdCarriedFrom, kt as slowCcOperationTimeoutMs, qt as orphansCarriedFrom, zt as acceptedCreateOnlyDropsOf } from "./delete-started-CmhbQ1Pl.js";
14
- import { An as recordNoEchoAttributeValues, Bt as identityKeyFor, D as recordedNoEchoValuesOf, Fn as WHOLE_DYNAMIC_REFERENCE_PATTERN, Ft as keepTemplateLiteralLeaves, Ln as isSingleDynamicReferenceToken, Lt as spelledKeysOf, Mn as recordProvenPublicExpression, Mt as DYNAMIC_REFERENCE_TOKEN_SCAN, Nn as wholeStringLeavesOf, Nt as dynamicReferenceTokens, On as recordMaskOnlyValue, Ot as scrubResourceRecord, Pt as isUncertifiedBaselineMaskPosition, Rt as pathCrossesDottedKey, T as readsNoEchoSource, Tn as provenPublicValue, W as redactForState, Yt as inheritNestedStackParameterAssociations, _t as maskSecretsInText, at as literalSplitDelimitersOf, b as noEchoOutputsComparison, ct as recordLogOnlyParameterValue, dt as shareLogOnlyValues, et as carryLogOnlyValues, f as isMarkedCoordinate, ft as unionOfSecretBags, g as maskedLeafCoordinatesOf, gt as maskSecretsInError, h as maskWholeValue, it as hasMaskableValues, j as liveMatchesUnresolvedTokenFrame, jn as recordNoEchoParameterFreshValue, k as valueAtCoordinate, kn as recordMaskOnlyValuesIn, kt as withPhysicalNameCopies, ln as recordPhysicalNameCopy, m as maskReadbackAtCoordinates, mn as carriesSecretMask, mt as errorCauseChain, nt as createUnionSecretMasker, ot as logOnlyValueCount, p as maskAtCoordinates, pn as splitGetAttStringForm, pt as createSecretMasker, sn as physicalNameCopiesOf, st as printingCorpusOf, u as canonicalCoordinates, un as recordNestedStackParameterExpressions, ut as recordLogOnlyValue, v as noEchoCoordinatesOf, y as noEchoLeavesOf } from "./replacement-rules-CeVpmoXW.js";
15
- import { S as unsettledPropertiesOf, T as withoutUnsettledProperties, b as unsettledItemsOf, w as withUnsettledProperties, y as unsettledItemsField } from "./restore-source-guard-OMAaTC2f.js";
16
- import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-D2I7XuY2.js";
11
+ import { C as prefetchCreateOnlyPropertyPaths, E as describeTypeWithThrottleRetry, J as parseFailureDebugDetail, K as describeJsonParseFailure, U as renderPhaseTimings, W as timePhase, X as utf8ByteLength, j as withRetry, l as setResolvedResourceTimeouts, w as templateResourceTypes, x as getCreateOnlyPropertyPaths, z as PhaseClock } from "./ec2-termination-protection-DWE3uPU3.js";
12
+ import { t as expectedOwnerParam } from "./expected-bucket-owner-CikFL35f.js";
13
+ import { Bt as describeRegionValueKind, Gt as isReadableBag, Ht as hasReadableExportSet, Jt as shouldRetainResource, Kt as orphansAfterRollback, Tt as differingIdentityWarning, Ut as importableOutputKeys, Vt as exportNamesCarriedFrom, Wt as importableOutputs, Xt as stackInstanceIdCarriedFrom, kt as slowCcOperationTimeoutMs, qt as orphansCarriedFrom, zt as acceptedCreateOnlyDropsOf } from "./delete-started-B4voN73N.js";
14
+ import { An as recordNoEchoAttributeValues, Bt as identityKeyFor, D as recordedNoEchoValuesOf, Fn as WHOLE_DYNAMIC_REFERENCE_PATTERN, Ft as keepTemplateLiteralLeaves, Ln as isSingleDynamicReferenceToken, Lt as spelledKeysOf, Mn as recordProvenPublicExpression, Mt as DYNAMIC_REFERENCE_TOKEN_SCAN, Nn as wholeStringLeavesOf, Nt as dynamicReferenceTokens, On as recordMaskOnlyValue, Ot as scrubResourceRecord, Pt as isUncertifiedBaselineMaskPosition, Rt as pathCrossesDottedKey, T as readsNoEchoSource, Tn as provenPublicValue, W as redactForState, Yt as inheritNestedStackParameterAssociations, _t as maskSecretsInText, at as literalSplitDelimitersOf, b as noEchoOutputsComparison, ct as recordLogOnlyParameterValue, dt as shareLogOnlyValues, et as carryLogOnlyValues, f as isMarkedCoordinate, ft as unionOfSecretBags, g as maskedLeafCoordinatesOf, gt as maskSecretsInError, h as maskWholeValue, it as hasMaskableValues, j as liveMatchesUnresolvedTokenFrame, jn as recordNoEchoParameterFreshValue, k as valueAtCoordinate, kn as recordMaskOnlyValuesIn, kt as withPhysicalNameCopies, ln as recordPhysicalNameCopy, m as maskReadbackAtCoordinates, mn as carriesSecretMask, mt as errorCauseChain, nt as createUnionSecretMasker, ot as logOnlyValueCount, p as maskAtCoordinates, pn as splitGetAttStringForm, pt as createSecretMasker, sn as physicalNameCopiesOf, st as printingCorpusOf, u as canonicalCoordinates, un as recordNestedStackParameterExpressions, ut as recordLogOnlyValue, v as noEchoCoordinatesOf, y as noEchoLeavesOf } from "./replacement-rules-CLBkCiI5.js";
15
+ import { S as unsettledPropertiesOf, T as withoutUnsettledProperties, b as unsettledItemsOf, w as withUnsettledProperties, y as unsettledItemsField } from "./restore-source-guard-Dl_sbZyl.js";
16
+ import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-7yeldNkK.js";
17
17
  import { t as cdkdCacheHome } from "./cache-home-BVYKj3de.js";
18
18
  import { randomBytes, randomUUID } from "node:crypto";
19
19
  import { CopyObjectCommand, CreateBucketCommand, DeleteBucketCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetObjectCommand, HeadBucketCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, NotFound, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutBucketVersioningCommand, PutObjectCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
@@ -1029,6 +1029,7 @@ async function synthCommand(stackPatterns, options) {
1029
1029
  ...options.region && { region: options.region },
1030
1030
  ...options.profile && { profile: options.profile },
1031
1031
  ...Object.keys(context).length > 0 && { context },
1032
+ ...options.lookups !== void 0 && { lookups: options.lookups },
1032
1033
  failedLookupsCheckedByCaller: true
1033
1034
  };
1034
1035
  const result = await synthesizer.synthesize(synthOptions);
@@ -1127,6 +1128,7 @@ async function listCommand(patterns, options) {
1127
1128
  ...options.region && { region: options.region },
1128
1129
  ...options.profile && { profile: options.profile },
1129
1130
  ...Object.keys(context).length > 0 && { context },
1131
+ ...options.lookups !== void 0 && { lookups: options.lookups },
1130
1132
  deferMacroExpansion: true,
1131
1133
  failedLookupsCheckedByCaller: true
1132
1134
  };
@@ -1541,7 +1543,7 @@ function collectCrossStackRefs(node, onRef, unconditional) {
1541
1543
  // src/provisioning/register-providers.ts
1542
1544
  let providerClasses;
1543
1545
  function loadProviderClasses() {
1544
- providerClasses ??= import("./provider-classes-Cf4oFWZo.js");
1546
+ providerClasses ??= import("./provider-classes-DkZXDD7E.js");
1545
1547
  return providerClasses;
1546
1548
  }
1547
1549
  function registerAllProviders(registry, classes) {
@@ -3464,6 +3466,7 @@ async function deployCommand(stacks, options) {
3464
3466
  ...options.region && { region: options.region },
3465
3467
  ...options.profile && { profile: options.profile },
3466
3468
  ...Object.keys(context).length > 0 && { context },
3469
+ ...options.lookups !== void 0 && { lookups: options.lookups },
3467
3470
  ...options.profile && { macroExpandS3ClientOpts: { profile: options.profile } },
3468
3471
  deferMacroExpansion: true,
3469
3472
  failedLookupsCheckedByCaller: true
@@ -6723,6 +6726,7 @@ async function diffCommand(stacks, options) {
6723
6726
  ...options.region && { region: options.region },
6724
6727
  ...options.profile && { profile: options.profile },
6725
6728
  ...Object.keys(context).length > 0 && { context },
6729
+ ...options.lookups !== void 0 && { lookups: options.lookups },
6726
6730
  stateBucket,
6727
6731
  ...options.profile && { macroExpandS3ClientOpts: { profile: options.profile } },
6728
6732
  deferMacroExpansion: true,
@@ -9574,6 +9578,7 @@ async function scrubCommand(stacks, options) {
9574
9578
  ...options.region && { region: options.region },
9575
9579
  ...options.profile && { profile: options.profile },
9576
9580
  ...Object.keys(context).length > 0 && { context },
9581
+ ...options.lookups !== void 0 && { lookups: options.lookups },
9577
9582
  stateBucket,
9578
9583
  deferMacroExpansion: true,
9579
9584
  failedLookupsCheckedByCaller: true
@@ -9951,789 +9956,259 @@ const ALWAYS_STRIPPED_FIELDS = /* @__PURE__ */ new Set([
9951
9956
  function stripCcApiAwsManagedFields(resourceType, awsProps) {
9952
9957
  return stripWalk(awsProps);
9953
9958
  }
9954
- function stripWalk(value) {
9959
+ const FREE_FORM_MAP_PARENTS = /* @__PURE__ */ new Set([
9960
+ "Variables",
9961
+ "Parameters",
9962
+ "DefaultArguments",
9963
+ "DockerLabels",
9964
+ "Labels",
9965
+ "Tags",
9966
+ "UserPoolTags",
9967
+ "BackupPlanTags",
9968
+ "BackupVaultTags",
9969
+ "RecoveryPointTags",
9970
+ "TieringConfigurationTags",
9971
+ "TestAliasTags"
9972
+ ]);
9973
+ function stripWalk(value, freeForm = false) {
9955
9974
  if (value === null || value === void 0) return value;
9956
- if (Array.isArray(value)) return value.map(stripWalk);
9975
+ if (Array.isArray(value)) return value.map((element) => stripWalk(element, freeForm));
9957
9976
  if (typeof value === "object") {
9958
9977
  if (!hasPlainPrototype(value)) return value;
9959
9978
  const out = nullPrototypeRecord();
9960
9979
  for (const [key, child] of Object.entries(value)) {
9961
- if (ALWAYS_STRIPPED_FIELDS.has(key)) continue;
9962
- out[key] = stripWalk(child);
9980
+ if (!freeForm && ALWAYS_STRIPPED_FIELDS.has(key)) continue;
9981
+ out[key] = stripWalk(child, freeForm || FREE_FORM_MAP_PARENTS.has(key));
9963
9982
  }
9964
9983
  return out;
9965
9984
  }
9966
9985
  return value;
9967
9986
  }
9968
9987
 
9969
- // src/cli/commands/drift/secret-resolution.ts
9970
- function containsDynamicReference$1(value) {
9971
- if (typeof value === "string") return value.includes("{{resolve:");
9972
- if (Array.isArray(value)) return value.some(containsDynamicReference$1);
9973
- if (value !== null && typeof value === "object") return Object.values(value).some(containsDynamicReference$1);
9974
- return false;
9975
- }
9976
- const MIN_SECRET_NEEDLE_LENGTH = 4;
9977
- function carriesRecordedSecret(value, secrets) {
9978
- if (value === "") return false;
9979
- if (secrets.has(value)) return true;
9980
- for (const plaintext of secrets.keys()) if (plaintext.length >= MIN_SECRET_NEEDLE_LENGTH && value.includes(plaintext)) return true;
9981
- return false;
9982
- }
9983
- function survivingDynamicReferences(value) {
9984
- return dynamicReferenceTokens(value);
9988
+ // src/provisioning/providers/s3-bucket/shared.ts
9989
+ function manualBucketDeletionClause(bucketName, maskSecrets, journaled) {
9990
+ const command = renderDisableCommand({
9991
+ before: "aws s3api delete-bucket --bucket",
9992
+ identifier: bucketName,
9993
+ maskSecrets
9994
+ });
9995
+ const lead = journaled ? `Outside a rollback's re-create, the failed deploy's rollback journal records the bucket for ${proseQuoted(cdkdRemedy("cdkd rollback", "--revert-failed"), "`")}; otherwise delete it yourself before the next deploy` : "Manual deletion may be required before the next deploy";
9996
+ return command ? `${lead}: ${command}` : `${lead}, via the console: the bucket name cannot be reproduced safely on a command line, so any command shown here could act on a different bucket or run part of the name as shell.`;
9985
9997
  }
9986
- function collectDynamicReferencePaths(value, into, path = "") {
9987
- if (typeof value === "string") {
9988
- if (value.includes("{{resolve:")) into.add(path);
9989
- return;
9990
- }
9991
- if (Array.isArray(value)) {
9992
- value.forEach((item, i) => collectDynamicReferencePaths(item, into, path === "" ? String(i) : `${path}.${i}`));
9993
- return;
9994
- }
9995
- if (value !== null && typeof value === "object") for (const [k, v] of Object.entries(value)) collectDynamicReferencePaths(v, into, path === "" ? k : `${path}.${k}`);
9998
+ function configItemId(item) {
9999
+ if (!isPlainObject(item)) return void 0;
10000
+ const id = item["Id"];
10001
+ if (typeof id === "string") return id;
10002
+ if (typeof id === "number" && Number.isFinite(id)) return String(id);
9996
10003
  }
9997
- function collectSecretMaskPaths(value, into, path = "") {
9998
- if (typeof value === "string") {
9999
- if (value === "***") into.add(path);
10000
- return;
10001
- }
10002
- if (Array.isArray(value)) {
10003
- value.forEach((item, i) => collectSecretMaskPaths(item, into, path === "" ? String(i) : `${path}.${i}`));
10004
- return;
10005
- }
10006
- if (value !== null && typeof value === "object") for (const [k, v] of Object.entries(value)) collectSecretMaskPaths(v, into, path === "" ? k : `${path}.${k}`);
10004
+ function declaresBucketObjectLock(properties) {
10005
+ return properties["ObjectLockEnabled"] === true || properties["ObjectLockEnabled"] === "true";
10007
10006
  }
10008
- var DriftSecretResolvers = class {
10009
- primary;
10010
- pinned = /* @__PURE__ */ new Map();
10011
- stackRegion;
10012
- constructor(stackRegion) {
10013
- this.stackRegion = stackRegion;
10014
- this.primary = new IntrinsicFunctionResolver(stackRegion);
10015
- }
10016
- forRegion(region) {
10017
- const target = canonicalizeRegion(region);
10018
- if (target === canonicalizeRegion(this.stackRegion)) return this.primary;
10019
- const cached = this.pinned.get(target);
10020
- if (cached) return cached;
10021
- const scoped = new IntrinsicFunctionResolver(target);
10022
- this.pinned.set(target, scoped);
10023
- return scoped;
10024
- }
10025
- forRecordedRegion(region) {
10026
- return this.primary.resolverForRecordedRegion(region);
10027
- }
10028
- };
10029
- var DriftSecretRefusalError = class DriftSecretRefusalError extends CdkdError {
10030
- driftSecretRefusal = true;
10031
- constructor(message, code) {
10032
- super(message, code);
10033
- this.name = "DriftSecretRefusalError";
10034
- Object.setPrototypeOf(this, DriftSecretRefusalError.prototype);
10035
- }
10036
- };
10037
- function isDriftSecretRefusal(err) {
10038
- return err instanceof DriftSecretRefusalError || err instanceof IntrinsicResolutionRefusalError;
10007
+ function declaresNestedObjectLock(properties) {
10008
+ return properties["ObjectLockConfiguration"]?.["ObjectLockEnabled"] === "Enabled";
10039
10009
  }
10040
- function regionAmbiguousDriftSecretError(logicalId, propertyPath, secretName, foreignProducerRegions, consumerRegion) {
10041
- const where = propertyPath === "" ? "" : ` property '${propertyPath}'`;
10042
- return new DriftSecretRefusalError(`${logicalId}${where}: the secret reference '${secretName}' carries no region of its own, and this stack read across a region boundary (producer region(s) on record: ${foreignProducerRegions.join(", ")}), so it may have been resolved in one of those rather than in '${consumerRegion}'. A secret of the same name in two regions is two independent values, so cdkd would compare against — and with --revert WRITE — the WRONG secret. Refusing instead. Spell the reference as a full ARN, which names its region and is resolved there, then re-run ${proseQuoted(cdkdRemedy("cdkd drift"))}.`, "DRIFT_SECRET_REGION_AMBIGUOUS");
10010
+ function caughtErrorName(error) {
10011
+ const name = error?.name;
10012
+ return typeof name === "string" && name !== "" ? name : "unknown error";
10043
10013
  }
10044
- function refuseUnprovenDriftSecret(leaf, propertyPath, logicalId, consumerRegion, evidence, recordedRegions) {
10045
- if (evidence.complete) return;
10046
- for (const token of dynamicReferenceTokens(leaf)) {
10047
- if (recordedRegions?.has(token) === true) continue;
10048
- const name = classifyReplaySecretRegion(token, consumerRegion, evidence.regions).kind === "local" ? regionLessSecretName(token) : void 0;
10049
- if (name === void 0) continue;
10050
- const where = propertyPath === "" ? "" : ` property '${propertyPath}'`;
10051
- throw new DriftSecretRefusalError(`${logicalId}${where}: the secret reference '${name}' carries no region of its own, and this is a nested stack whose parent stacks' cross-region reads could not be established, so a parent may have resolved it in another region than '${consumerRegion}'. A secret of the same name in two regions is two independent values, so cdkd would compare against — and with --revert WRITE — the WRONG secret. Refusing instead. Make the parent stacks' state readable (or repair a record whose parent link disagrees with its key), or spell the reference as a full ARN, then re-run ${proseQuoted(cdkdRemedy("cdkd drift"))}.`, "DRIFT_SECRET_REGION_UNKNOWN");
10052
- }
10014
+ function isPlainObject(value) {
10015
+ return typeof value === "object" && value !== null && !Array.isArray(value);
10053
10016
  }
10054
- function noteUnreadableAncestor(stackName, region, why) {
10055
- getLogger().debug(safeMsg`Producer regions above a nested stack are incomplete: ${displayIdent(stackName)} (${region}): ${why}`);
10017
+ function describeValue(value, maskSecrets = (text) => text) {
10018
+ if (value === null) return "null";
10019
+ if (Array.isArray(value)) return "an array";
10020
+ if (typeof value === "string") return `a string ${displaySafe(JSON.stringify(maskDeep(value, maskSecrets)))}`;
10021
+ if (isPlainObject(value)) return `an object with keys [${Object.keys(value).map((key) => displaySafe(maskSecrets(key))).join(", ")}]`;
10022
+ return `a ${typeof value} (${maskSecrets(String(value))})`;
10056
10023
  }
10057
- const MAX_ANCESTOR_DEPTH = 32;
10058
- async function driftProducerRegionEvidence(state, stackName, region, stateBackend, depth = 0) {
10059
- let own;
10060
- if (depth === 0) own = producerRegionsFromState(state);
10061
- else try {
10062
- own = producerRegionsFromState(state);
10063
- } catch {
10064
- noteUnreadableAncestor(stackName, region, "its cross-stack read records are malformed");
10065
- return {
10066
- regions: [],
10067
- complete: false
10068
- };
10069
- }
10070
- const cut = stackName.lastIndexOf("~");
10071
- const keyParent = cut >= 0 ? stackName.slice(0, cut) : void 0;
10072
- const recordParent = state.parentStack;
10073
- if (keyParent === void 0 && recordParent === void 0) return {
10074
- regions: own,
10075
- complete: true
10076
- };
10077
- if (keyParent === "" || recordParent !== void 0 && typeof recordParent !== "string" || state.parentRegion !== void 0 && typeof state.parentRegion !== "string" || keyParent !== void 0 && typeof recordParent === "string" && recordParent !== keyParent) {
10078
- noteUnreadableAncestor(stackName, region, "its key and its parent link disagree, or the link is malformed");
10079
- return inheritProducerRegions(own, void 0);
10080
- }
10081
- const parentName = keyParent ?? recordParent;
10082
- if (depth >= MAX_ANCESTOR_DEPTH) {
10083
- noteUnreadableAncestor(stackName, region, `the nesting is deeper than ${MAX_ANCESTOR_DEPTH} levels`);
10084
- return inheritProducerRegions(own, void 0);
10085
- }
10086
- const parentRegion = typeof state.parentRegion === "string" ? state.parentRegion : region;
10087
- let parent;
10088
- try {
10089
- parent = await stateBackend.getState(parentName, parentRegion, { readOnly: true });
10090
- } catch (error) {
10091
- noteUnreadableAncestor(parentName, parentRegion, `it could not be read (${describeAwsFailure(error).detail})`);
10092
- return inheritProducerRegions(own, void 0);
10093
- }
10094
- if (!parent || parent.divergentBodyRegion !== void 0 || typeof parent.state !== "object" || parent.state === null) {
10095
- noteUnreadableAncestor(parentName, parentRegion, "it has no usable state record");
10096
- return inheritProducerRegions(own, void 0);
10097
- }
10098
- const inherited = await driftProducerRegionEvidence(parent.state, parentName, parentRegion, stateBackend, depth + 1);
10099
- return inheritProducerRegions(own, inherited);
10024
+ function coerceCfnNumber(value) {
10025
+ if (typeof value !== "number" && typeof value !== "string") return void 0;
10026
+ if (value === "") return void 0;
10027
+ const n = Number(value);
10028
+ return Number.isFinite(n) ? n : void 0;
10100
10029
  }
10101
- async function resolveDriftLeafByRegion(leaf, propertyPath, logicalId, consumerRegion, producerRegions, resolvers, ctx, recordedRegions) {
10102
- const verdicts = dynamicReferenceTokens(leaf).map((token) => [token, classifyRecordedSecretRegion(token, consumerRegion, producerRegions, recordedRegions)]);
10103
- for (const [, verdict] of verdicts) if (verdict.kind === "ambiguous") throw regionAmbiguousDriftSecretError(logicalId, propertyPath, verdict.secretName, verdict.foreignProducerRegions, consumerRegion);
10104
- if (!verdicts.some(([, verdict]) => verdict.kind === "named-region" || verdict.kind === "recorded-region")) return await resolveDynamicReferences(resolvers.primary, leaf, ctx);
10105
- let out = "";
10106
- let cursor = 0;
10107
- for (const [token, verdict] of verdicts) {
10108
- const at = leaf.indexOf(token, cursor);
10109
- if (at < 0) throw new DriftSecretRefusalError(`${logicalId}${propertyPath === "" ? "" : ` property '${propertyPath}'`}: could not locate a scanned dynamic reference in the value it was scanned from. Refusing rather than resolving it in '${consumerRegion}', which would be the wrong region for a reference that names another one. This is an internal invariant failure — please report it with the resource type and property path.`, "DRIFT_SECRET_TOKEN_SCAN_MISMATCH");
10110
- out += leaf.slice(cursor, at);
10111
- const resolver = verdict.kind === "named-region" ? resolvers.forRegion(verdict.region) : verdict.kind === "recorded-region" ? resolvers.forRecordedRegion(verdict.region) : resolvers.primary;
10112
- out += await resolveDynamicReferences(resolver, token, ctx);
10113
- cursor = at + token.length;
10030
+ function mergeLegacySingular(plural, singular, onCollision) {
10031
+ const out = (Array.isArray(plural) ? plural : []).filter(isPlainObject);
10032
+ if (!isPlainObject(singular)) return out;
10033
+ const sc = singular["StorageClass"];
10034
+ if (typeof sc === "string" && out.some((e) => e["StorageClass"] === sc)) {
10035
+ onCollision(sc);
10036
+ return out;
10114
10037
  }
10115
- return out + leaf.slice(cursor);
10038
+ return [...out, singular];
10116
10039
  }
10117
- async function resolveStateSecretExpressions(props, resolvers, secrets, options) {
10118
- if (!containsDynamicReference$1(props)) return props;
10119
- const { secretPaths, onUnresolved, producerRegions, logicalId, consumerRegion } = options;
10120
- const recordedRegions = recordedReferenceRegions(options.record);
10121
- const ctx = {
10122
- template: { Resources: {} },
10123
- resources: {},
10124
- recordedSecretValues: secrets
10125
- };
10126
- const walk = async (v, path) => {
10127
- if (typeof v === "string") {
10128
- if (!v.includes("{{resolve:")) return v;
10129
- refuseUnprovenDriftSecret(v, path, logicalId, consumerRegion, producerRegions, recordedRegions);
10130
- const resolved = await resolveDriftLeafByRegion(v, path, logicalId, consumerRegion, producerRegions.regions, resolvers, ctx, recordedRegions);
10131
- const survivors = survivingDynamicReferences(resolved).filter((t) => v.includes(t));
10132
- if (survivors.length > 0) onUnresolved?.(survivors, path);
10133
- if (carriesRecordedSecret(resolved, secrets)) secretPaths?.add(path);
10134
- return resolved;
10135
- }
10136
- if (Array.isArray(v)) {
10137
- const out = new Array(v.length);
10138
- for (let i = 0; i < v.length; i++) out[i] = await walk(v[i], path === "" ? String(i) : `${path}.${i}`);
10139
- return out;
10140
- }
10141
- if (v !== null && typeof v === "object") {
10142
- const out = Object.create(null);
10143
- for (const [k, val] of Object.entries(v)) out[k] = await walk(val, path === "" ? k : `${path}.${k}`);
10144
- return out;
10145
- }
10146
- return v;
10147
- };
10148
- return await walk(props, "");
10040
+ function shownLifecycleRuleId(id) {
10041
+ return id === void 0 || id === null || id === "" ? "(no Id)" : displayIdent(id);
10149
10042
  }
10150
10043
 
10151
- // src/cli/commands/refused-baseline-remedy.ts
10152
- function acceptRefusedRemedy() {
10153
- return `Once the deployed template no longer reads a parameter at this resource, ${pasteableCommand("cdkd state refresh-observed", [
10154
- { hole: "stack" },
10155
- {
10156
- flag: "--accept-refused",
10157
- hole: "logicalId"
10158
- },
10159
- {
10160
- flag: "--template",
10161
- hole: "file"
10162
- }
10163
- ]).command} records a baseline on your assertion that AWS holds no secret the template does not spell as a dynamic reference.`;
10044
+ // src/provisioning/providers/s3-bucket/effective-items.ts
10045
+ function effectiveS3BucketDestination(declared, sentFormat) {
10046
+ if (!isPlainObject(declared)) return declared;
10047
+ if (!declared["BucketArn"]) return declared;
10048
+ const out = { BucketArn: declared["BucketArn"] };
10049
+ if (declared["BucketAccountId"] !== void 0) out["BucketAccountId"] = declared["BucketAccountId"];
10050
+ out["Format"] = sentFormat ?? declaredOrDefault(declared, "Format", "CSV");
10051
+ if (declared["Prefix"] !== void 0) out["Prefix"] = declared["Prefix"];
10052
+ return sameScalarRecord(out, declared) ? declared : out;
10164
10053
  }
10165
- function refusedBaselineRemedy(record) {
10166
- if (hasUnverifiableParameterRefusal(record)) return "Deploying a change does NOT clear this refusal: the resource reads a template parameter whose deployed value cdkd could not prove, so only a deploy that replaces the resource, or a re-import while a CloudFormation stack can prove that value, restores a baseline. " + acceptRefusedRemedy();
10167
- if (hasReasonlessBaselineRefusal(record)) return "This refusal was recorded without a reason this cdkd recognizes: a deploy that actually CHANGES this resource restores a baseline unless the resource reads a template parameter, and then only a deploy that replaces the resource, or a re-import while a CloudFormation stack can prove the parameter's deployed value, does. " + acceptRefusedRemedy();
10054
+ function declaredOrDefault(container, key, fallback) {
10055
+ return key in container ? container[key] : fallback;
10168
10056
  }
10169
-
10170
- // src/cli/commands/drift/redaction.ts
10171
- function noEchoPathsClause(record) {
10172
- const marked = record === void 0 ? void 0 : noEchoLeavesOf(record);
10173
- if (marked === void 0 || marked.length === 0) return "";
10174
- return ` at ${marked.map((coordinate) => coordinate.map((segment, i) => typeof segment === "number" ? `[${segment}]` : i === 0 ? segment : `.${segment}`).join("")).map((path) => displaySafe(path)).join(", ")}`;
10057
+ const INVENTORY_DESTINATION_DEFAULT_FORMAT = "CSV";
10058
+ const INVENTORY_DEFAULT_ENABLED = true;
10059
+ const INVENTORY_DEFAULT_INCLUDED_OBJECT_VERSIONS = "All";
10060
+ const ANALYTICS_DEFAULT_OUTPUT_SCHEMA_VERSION = "V_1";
10061
+ function sameScalarRecord(a, b) {
10062
+ const aKeys = Object.keys(a);
10063
+ if (aKeys.length !== Object.keys(b).length) return false;
10064
+ return aKeys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && Object.is(a[k], b[k]));
10175
10065
  }
10176
- function revertPathSegments(path) {
10177
- const segments = [];
10178
- for (const part of path.split(".")) {
10179
- const match = /^([^[]*)((?:\[\d+\])*)$/.exec(part);
10180
- if (match === null) {
10181
- segments.push(part);
10182
- continue;
10183
- }
10184
- if (match[1] !== "") segments.push(match[1]);
10185
- for (const index of match[2].matchAll(/\[(\d+)\]/g)) segments.push(Number(index[1]));
10066
+ const INVENTORY_DEFAULT_SCHEDULE_FREQUENCY = "Weekly";
10067
+ function effectiveInventoryItem(item, sent) {
10068
+ const patch = {};
10069
+ const declaredEnabled = item["Enabled"];
10070
+ if (declaredEnabled === void 0) patch["Enabled"] = true;
10071
+ else {
10072
+ const coercedEnabled = coerceCfnBoolean(declaredEnabled);
10073
+ if (coercedEnabled !== void 0 && !Object.is(declaredEnabled, coercedEnabled)) patch["Enabled"] = coercedEnabled;
10186
10074
  }
10187
- return segments;
10188
- }
10189
- function partitionNoEchoParameterChanges(changes, record, baseline) {
10190
- const marked = noEchoLeavesOf(record);
10191
- if (marked === void 0 || marked.length === 0) return {
10192
- kept: changes,
10193
- noEchoParameterPaths: []
10194
- };
10195
- const properties = record.properties ?? {};
10196
- const isMarked = (coordinate) => isMarkedCoordinate(coordinate, marked) || marked.some((leaf) => leaf.length > coordinate.length && coordinate.every((segment, i) => String(segment) === String(leaf[i])));
10197
- const isWithinMarked = (coordinate) => marked.some((leaf) => leaf.length <= coordinate.length && leaf.every((segment, i) => String(segment) === String(coordinate[i])));
10198
- const kept = [];
10199
- const noEchoParameterPaths = [];
10200
- for (const change of changes) {
10201
- const coordinate = change.path.split(".");
10202
- if (marked.some((leaf) => {
10203
- const n = Math.min(leaf.length, coordinate.length);
10204
- for (let i = 0; i < n; i++) if (leaf[i] !== coordinate[i]) return false;
10205
- return true;
10206
- }) && carriesSecretMask(change.stateValue) && !pathCrossesDottedKey(properties, change.path) && !pathCrossesDottedKey(baseline, change.path) && equalModuloMarkedMask(change.stateValue, change.awsValue, "***", coordinate, isMarked, isWithinMarked)) {
10207
- noEchoParameterPaths.push(change.path);
10208
- continue;
10209
- }
10210
- kept.push(change);
10075
+ if (item["IncludedObjectVersions"] === void 0) patch["IncludedObjectVersions"] = "All";
10076
+ const declaredSchedule = item["Schedule"];
10077
+ const declaresScheduleFrequency = item["ScheduleFrequency"] !== void 0;
10078
+ const scheduleFrequencyUsable = declaresScheduleFrequency && configStringRefusal(item, "ScheduleFrequency", "Weekly", "AWS::S3::Bucket InventoryConfigurations[]") === void 0;
10079
+ const scheduleContainerUsable = configStringRefusal(declaredSchedule, "Frequency", INVENTORY_DEFAULT_SCHEDULE_FREQUENCY, "AWS::S3::Bucket InventoryConfigurations[].Schedule") === void 0;
10080
+ const canFoldSchedule = sent?.frequency !== void 0 || scheduleFrequencyUsable || !declaresScheduleFrequency && scheduleContainerUsable;
10081
+ if (canFoldSchedule) {
10082
+ const declaredFrequency = declaresScheduleFrequency ? item["ScheduleFrequency"] : isPlainObject(declaredSchedule) && declaredSchedule["Frequency"] !== void 0 ? declaredSchedule["Frequency"] : INVENTORY_DEFAULT_SCHEDULE_FREQUENCY;
10083
+ const frequency = sent?.frequency ?? declaredFrequency;
10084
+ if (!Object.is(item["ScheduleFrequency"], frequency)) patch["ScheduleFrequency"] = frequency;
10211
10085
  }
10212
- return {
10213
- kept,
10214
- noEchoParameterPaths
10086
+ const destination = effectiveS3BucketDestination(item["Destination"], sent?.format);
10087
+ if (destination !== item["Destination"]) patch["Destination"] = destination;
10088
+ const dropsSchedule = declaredSchedule !== void 0 && canFoldSchedule;
10089
+ if (!dropsSchedule && Object.keys(patch).length === 0) return item;
10090
+ const out = {
10091
+ ...item,
10092
+ ...patch
10215
10093
  };
10094
+ if (dropsSchedule) delete out["Schedule"];
10095
+ return out;
10216
10096
  }
10217
- function partitionUncertifiedBaselineChanges(changes, properties, baseline) {
10218
- const kept = [];
10219
- const uncertifiedPaths = [];
10220
- for (const change of changes) {
10221
- if (carriesSecretMask(change.stateValue) && isUncertifiedBaselineMaskPosition(properties, change.path) && !pathCrossesDottedKey(baseline, change.path) && equalModuloMask(change.stateValue, change.awsValue, "***")) {
10222
- uncertifiedPaths.push(change.path);
10223
- continue;
10097
+ function effectiveAnalyticsItem(item, sent) {
10098
+ const storageClassAnalysis = item["StorageClassAnalysis"];
10099
+ if (!isPlainObject(storageClassAnalysis)) return item;
10100
+ const dataExport = storageClassAnalysis["DataExport"];
10101
+ if (!isPlainObject(dataExport)) return item;
10102
+ const patch = {};
10103
+ const outputSchemaVersion = sent?.outputSchemaVersion ?? declaredOrDefault(dataExport, "OutputSchemaVersion", "V_1");
10104
+ if (!Object.is(dataExport["OutputSchemaVersion"], outputSchemaVersion)) patch["OutputSchemaVersion"] = outputSchemaVersion;
10105
+ const destination = effectiveS3BucketDestination(dataExport["Destination"], sent?.format);
10106
+ if (destination !== dataExport["Destination"]) patch["Destination"] = destination;
10107
+ if (Object.keys(patch).length === 0) return item;
10108
+ return {
10109
+ ...item,
10110
+ StorageClassAnalysis: {
10111
+ ...storageClassAnalysis,
10112
+ DataExport: {
10113
+ ...dataExport,
10114
+ ...patch
10115
+ }
10224
10116
  }
10225
- kept.push(change);
10226
- }
10117
+ };
10118
+ }
10119
+ const INTELLIGENT_TIERING_DEFAULT_STATUS = "Enabled";
10120
+ function effectiveIntelligentTieringItem(item) {
10121
+ if (item["Status"] !== void 0) return item;
10227
10122
  return {
10228
- kept,
10229
- uncertifiedPaths
10123
+ ...item,
10124
+ Status: INTELLIGENT_TIERING_DEFAULT_STATUS
10230
10125
  };
10231
10126
  }
10232
- function isSecretBearingPath(path, secretPaths) {
10233
- if (secretPaths.size === 0) return false;
10234
- for (const secretPath of secretPaths) if (secretPath === path || secretPath.startsWith(`${path}.`) || path.startsWith(`${secretPath}.`)) return true;
10235
- return false;
10127
+ function foldToleratedAliases(bag, aliases) {
10128
+ let out;
10129
+ for (const [emitted, tolerated] of aliases) {
10130
+ if (bag[tolerated] === void 0) continue;
10131
+ out ??= { ...bag };
10132
+ out[emitted] = bag[emitted] ?? bag[tolerated];
10133
+ delete out[tolerated];
10134
+ }
10135
+ return out ?? bag;
10236
10136
  }
10237
- function redactDriftValue(value, secrets, secretBearing) {
10238
- const redacted = redactForState(value, {
10239
- provenance: "value-scan",
10240
- secrets
10241
- });
10242
- if (!secretBearing) return redacted;
10243
- if (redacted === void 0 || redacted === null) return redacted;
10244
- if (typeof redacted === "string" && isSingleDynamicReferenceToken(redacted)) return redacted;
10245
- return "***";
10137
+ const TRANSITION_DATE_KEY = "TransitionDate";
10138
+ const TRANSITION_ALIASES = [["TransitionInDays", "Days"], ["TransitionDate", "Date"]];
10139
+ const EVENTBRIDGE_CONFIG_PATH = "AWS::S3::Bucket NotificationConfiguration.EventBridgeConfiguration";
10140
+ const EVENTBRIDGE_CONFIG_KEY = "EventBridgeConfiguration";
10141
+ const EVENTBRIDGE_DEFAULT_ENABLED = true;
10142
+ function eventBridgeEnabledOf(eb) {
10143
+ const declared = isPlainObject(eb) ? eb["EventBridgeEnabled"] : void 0;
10144
+ return coerceCfnBoolean(declared) ?? true;
10246
10145
  }
10247
- function acceptRefusalReason(change, maskedPaths) {
10248
- if (!maskedPaths.has(change.path)) return void 0;
10249
- if (change.path.includes("***")) return "its property NAME came back carrying a secret value, so cdkd cannot name the key to write — and no redaction pass can clear it either, since they all walk values and never keys. ROTATE the secret; that is the only remedy";
10250
- if (change.awsValue === void 0) return "AWS no longer reports it, and accepting an absence DELETES the key — which at or above a secret dynamic reference would erase the reference out of cdkd state. Use --revert to push it back, or re-deploy";
10251
- if (change.stateValue === "***") return "the value that belongs at this position is unknown to cdkd — the baseline holds only the redaction mask, so accepting would write AWS-held plaintext over a deliberate redaction. Where cdkd wrote that mask because it could not pair the readback with a secret reference, a deploy that CHANGES this resource re-captures the baseline, and a deploy that changes nothing replaces the mask only when the resource still reads back as its baseline records, the resource's own secret reference resolves to the value AWS holds there, and nothing in the resource's recorded properties is masked. Where the mask stands for a NoEcho custom-resource value or for the Fn::Base64 encoding of a secret value, cdkd never records the value, so no deploy replaces the mask";
10252
- return "it carries a secret dynamic reference and the value AWS currently holds is not the one the reference resolves to";
10146
+ const NOTIFICATION_LIST_KEYS = [
10147
+ "TopicConfigurations",
10148
+ "QueueConfigurations",
10149
+ "LambdaConfigurations"
10150
+ ];
10151
+ function dropEmptyNotificationFamilies(config) {
10152
+ let out;
10153
+ for (const listKey of NOTIFICATION_LIST_KEYS) {
10154
+ const list = config[listKey];
10155
+ if (!Array.isArray(list) || list.length > 0) continue;
10156
+ out ??= { ...config };
10157
+ delete out[listKey];
10158
+ }
10159
+ return out ?? config;
10253
10160
  }
10254
- function redactDriftChanges(changes, secrets, secretPaths, maskPaths) {
10255
- if (!hasMaskableValues(secrets) && secretPaths.size === 0 && maskPaths.size === 0 && !changes.some((change) => carriesSecretMask(change.stateValue))) return {
10256
- changes,
10257
- maskedPaths: /* @__PURE__ */ new Set()
10258
- };
10259
- const maskedPaths = /* @__PURE__ */ new Set();
10260
- const redacted = [];
10261
- for (const change of changes) {
10262
- const maskedPath = maskSecretsInText(change.path, secrets);
10263
- const positionIsSecret = isSecretBearingPath(change.path, secretPaths) || isSecretBearingPath(change.path, maskPaths);
10264
- const nameCarriesSecret = maskedPath !== change.path;
10265
- const stateValueIsMask = carriesSecretMask(change.stateValue);
10266
- const secretBearing = positionIsSecret || nameCarriesSecret || stateValueIsMask;
10267
- if (secretPaths.has(change.path) && change.awsValue === void 0) continue;
10268
- const stateValue = redactDriftValue(change.stateValue, secrets, secretBearing);
10269
- const awsValue = redactDriftValue(change.awsValue, secrets, secretBearing);
10270
- if (maskedPath !== change.path || secretBearing && awsValue === "***" || secretBearing && change.awsValue === void 0) maskedPaths.add(maskedPath);
10271
- redacted.push({
10272
- path: maskedPath,
10273
- stateValue,
10274
- awsValue
10275
- });
10161
+ function foldNotificationEvents(item) {
10162
+ const events = item["Events"];
10163
+ if (events === void 0) return item;
10164
+ const out = { ...item };
10165
+ if (item["Event"] === void 0) {
10166
+ if (!Array.isArray(events) || events.length !== 1) return item;
10167
+ out["Event"] = events[0];
10276
10168
  }
10169
+ delete out["Events"];
10170
+ return out;
10171
+ }
10172
+ function effectiveNotificationConfiguration(config) {
10173
+ if (!isPlainObject(config)) return config;
10174
+ let out = config;
10175
+ for (const listKey of NOTIFICATION_LIST_KEYS) out = canonicalizeItemList(out, listKey, foldNotificationEvents);
10176
+ out = dropEmptyNotificationFamilies(out);
10177
+ return foldEventBridgeConfiguration(out);
10178
+ }
10179
+ function foldEventBridgeConfiguration(config) {
10180
+ const eb = config[EVENTBRIDGE_CONFIG_KEY];
10181
+ if (eb === void 0) return config;
10182
+ if (eb !== null && configBooleanRefusal(eb, "EventBridgeEnabled", "AWS::S3::Bucket NotificationConfiguration.EventBridgeConfiguration")) return config;
10183
+ const enabled = eb === null ? false : eventBridgeEnabledOf(eb);
10184
+ const declared = isPlainObject(eb) ? eb["EventBridgeEnabled"] : void 0;
10185
+ if (isPlainObject(eb) && Object.keys(eb).length === 1 && Object.is(declared, enabled)) return config;
10277
10186
  return {
10278
- changes: redacted,
10279
- maskedPaths
10187
+ ...config,
10188
+ [EVENTBRIDGE_CONFIG_KEY]: { EventBridgeEnabled: enabled }
10280
10189
  };
10281
10190
  }
10282
- function maskMarkedNoEchoBaseline(baseline, record, observed) {
10283
- const marked = noEchoLeavesOf(record) ?? [];
10284
- if (observed) {
10285
- const coordinates = [...marked, ...maskedLeafCoordinatesOf(record.properties ?? {})];
10286
- return coordinates.length === 0 ? baseline : maskReadbackAtCoordinates(baseline, record.properties ?? {}, coordinates);
10287
- }
10288
- if (marked.length === 0) return baseline;
10289
- const recorded = record.properties ?? {};
10290
- const listPathOf = (coordinate) => {
10291
- const list = coordinate.findIndex((segment) => typeof segment === "number");
10292
- return list < 0 ? void 0 : coordinate.slice(0, list);
10293
- };
10294
- const replaced = marked.filter((coordinate) => {
10295
- const path = listPathOf(coordinate);
10296
- if (path === void 0) return false;
10297
- const underList = marked.filter((other) => other.length > path.length && path.every((segment, i) => segment === other[i]));
10298
- return JSON.stringify(valueAtCoordinate(maskAtCoordinates(baseline, underList), path)) !== JSON.stringify(valueAtCoordinate(maskAtCoordinates(recorded, underList), path));
10299
- });
10300
- const byIndex = maskAtCoordinates(baseline, marked.filter((coordinate) => !replaced.includes(coordinate)));
10301
- if (replaced.length === 0) return byIndex;
10302
- return maskReadbackAtCoordinates(byIndex, recorded, replaced);
10191
+
10192
+ // src/utils/cfn-timestamp.ts
10193
+ const OFFSETLESS_DATE_TIME = /^\d{4}-\d{2}-\d{2}[Tt ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/;
10194
+ function parseCfnTimestamp(value) {
10195
+ return new Date(OFFSETLESS_DATE_TIME.test(value) ? `${value}Z` : value);
10303
10196
  }
10304
10197
 
10305
- // src/cli/commands/drift/read-failure.ts
10306
- function notComparedReason(cause, record) {
10307
- const refusedRemedy = cause === "baselineRefused" ? refusedBaselineRemedy(record) : void 0;
10198
+ // src/provisioning/providers/s3-bucket/lifecycle-fold.ts
10199
+ const LIFECYCLE_RULE_PATH = "AWS::S3::Bucket LifecycleConfiguration.Rules[]";
10200
+ const LIFECYCLE_FILTER_PATH = `${LIFECYCLE_RULE_PATH}.Filter`;
10201
+ const LIFECYCLE_TAG_FILTERS_PATH = `${LIFECYCLE_RULE_PATH}.TagFilters`;
10202
+ const LIFECYCLE_DEFAULT_STATUS = "Enabled";
10203
+ const LIFECYCLE_STATUS_KEY = "Status";
10204
+ function lifecycleRuleScope(rule) {
10205
+ const filter = rule["Filter"];
10308
10206
  return {
10309
- refused: "cdkd refused to resolve a dynamic reference its state records (spell the reference as a full ARN, which names its region)",
10310
- unresolvedToken: "its state records a `{{resolve:...}}` spelling cdkd resolves for nobody (permanent; a re-run cannot clear it)",
10311
- readFailed: "the read or comparison threw, so NONE of its properties were compared",
10312
- readAborted: `cdkd never read it: ${5} reads in a row earlier in this stack, the same way it would have been read, failed — expired credentials, a revoked role, a permission all of them need, or a burst of throttling — so cdkd stopped reading that way (fix the cause, or re-run if it was throttling)`,
10313
- unreadableRecord: "its state record is not readable as a resource — not an object, carrying no resource type, or holding a 'properties' map that is not an object — so there was nothing to compare (repair or re-import the record)",
10314
- unreadableMap: "the record's whole 'resources' map is not a JSON object, so no resource in it could be read or compared (repair or re-import the record)",
10315
- baselineRefused: "a `cdkd import` run refused to capture its observed baseline, so the only baseline available is the recorded properties that refusal already found untrustworthy" + (refusedRemedy === void 0 ? " (deploy a change to this resource to restore one)" : `. ${refusedRemedy}`),
10316
- noEchoParameter: `its state holds a NoEcho parameter's value only as the redaction mask${noEchoPathsClause(record)}, so that value was not compared — every other property was (permanent by design; a deploy compares it with AWS)`,
10317
- uncertifiedBaseline: "its recorded baseline holds the redaction mask at a position cdkd could not pair with the secret reference there, so that position was not compared — every other property was (deploy a change to this resource to re-capture the baseline)"
10318
- }[cause];
10319
- }
10320
- const DRIFT_READ_FAILURE_BREAKER_THRESHOLD = 5;
10321
- const DRIFT_READ_PATH_LABELS = {
10322
- provider: "through cdkd's own (SDK) resource providers",
10323
- ccApi: "through the Cloud Control API"
10324
- };
10325
- const NO_READ_HANDLER_NAMES = /* @__PURE__ */ new Set(["UnsupportedActionException", "TypeNotFoundException"]);
10326
- const NO_READ_HANDLER_MESSAGE = /does not support READ action/i;
10327
- function isNoReadHandlerError(err) {
10328
- try {
10329
- let current = err;
10330
- for (let depth = 0; depth < 10 && current !== null && current !== void 0; depth += 1) {
10331
- const candidate = current;
10332
- if (typeof candidate.name === "string" && NO_READ_HANDLER_NAMES.has(candidate.name)) return true;
10333
- if (typeof candidate.message === "string" && NO_READ_HANDLER_MESSAGE.test(candidate.message)) return true;
10334
- current = candidate.cause;
10335
- }
10336
- } catch {
10337
- return false;
10338
- }
10339
- return false;
10340
- }
10341
-
10342
- // src/analyzer/drift-protocol-normalize.ts
10343
- const IP_PROTOCOL_PATHS = /* @__PURE__ */ new Map([
10344
- ["AWS::EC2::SecurityGroupIngress", ["IpProtocol"]],
10345
- ["AWS::EC2::SecurityGroupEgress", ["IpProtocol"]],
10346
- ["AWS::EC2::SecurityGroup", ["SecurityGroupIngress[].IpProtocol", "SecurityGroupEgress[].IpProtocol"]]
10347
- ]);
10348
- function rewriteAtPath(properties, path) {
10349
- if (properties === null || typeof properties !== "object" || Array.isArray(properties)) return properties;
10350
- const bag = properties;
10351
- const arrayMarker = path.indexOf("[].");
10352
- if (arrayMarker === -1) {
10353
- if (!(path in bag)) return properties;
10354
- const next = canonicalizeIpProtocolValue(bag[path]);
10355
- if (next === bag[path]) return properties;
10356
- return {
10357
- ...bag,
10358
- [path]: next
10359
- };
10360
- }
10361
- const arrayKey = path.slice(0, arrayMarker);
10362
- const elementKey = path.slice(arrayMarker + 3);
10363
- const list = bag[arrayKey];
10364
- if (!Array.isArray(list)) return properties;
10365
- let changed = false;
10366
- const mapped = list.map((element) => {
10367
- if (element === null || typeof element !== "object" || Array.isArray(element)) return element;
10368
- const rule = element;
10369
- if (!(elementKey in rule)) return element;
10370
- const next = canonicalizeIpProtocolValue(rule[elementKey]);
10371
- if (next === rule[elementKey]) return element;
10372
- changed = true;
10373
- return {
10374
- ...rule,
10375
- [elementKey]: next
10376
- };
10377
- });
10378
- if (!changed) return properties;
10379
- return {
10380
- ...bag,
10381
- [arrayKey]: mapped
10382
- };
10383
- }
10384
- function canonicalizeIpProtocols(baseline, aws, resourceType) {
10385
- const paths = IP_PROTOCOL_PATHS.get(resourceType);
10386
- if (paths === void 0) return {
10387
- baseline,
10388
- aws
10389
- };
10390
- let nextBaseline = baseline;
10391
- let nextAws = aws;
10392
- for (const path of paths) {
10393
- nextBaseline = rewriteAtPath(nextBaseline, path);
10394
- nextAws = rewriteAtPath(nextAws, path);
10395
- }
10396
- return {
10397
- baseline: nextBaseline,
10398
- aws: nextAws
10399
- };
10400
- }
10401
-
10402
- // src/analyzer/drift-undeclared-grants.ts
10403
- const UNDECLARED_GRANT_KEYS = {
10404
- "AWS::IAM::Role": [
10405
- "ManagedPolicyArns",
10406
- "PermissionsBoundary",
10407
- "Policies"
10408
- ],
10409
- "AWS::IAM::User": [
10410
- "Groups",
10411
- "ManagedPolicyArns",
10412
- "PermissionsBoundary",
10413
- "Policies"
10414
- ],
10415
- "AWS::IAM::Group": ["ManagedPolicyArns", "Policies"]
10416
- };
10417
- const BOUNDARY_KEY = "PermissionsBoundary";
10418
- const NONE = [];
10419
- function isPlainRecord$3(value) {
10420
- return typeof value === "object" && value !== null && !Array.isArray(value);
10421
- }
10422
- function undeclaredGrantDriftKeys(resourceType, properties) {
10423
- if (!hasOwnKey(UNDECLARED_GRANT_KEYS, resourceType)) return NONE;
10424
- if (!isPlainRecord$3(properties)) return NONE;
10425
- return UNDECLARED_GRANT_KEYS[resourceType].filter((key) => !hasOwnKey(properties, key));
10426
- }
10427
- function isUndeclaredGrantScalarKey(key) {
10428
- return key === BOUNDARY_KEY;
10429
- }
10430
- function grantMemberIdentity(key, member) {
10431
- if (key === "Policies") {
10432
- const name = isPlainRecord$3(member) ? member["PolicyName"] : void 0;
10433
- return typeof name === "string" ? name : void 0;
10434
- }
10435
- if (typeof member !== "string") return void 0;
10436
- return key === "Groups" ? member.toLowerCase() : member;
10437
- }
10438
- function isNoBoundary(value) {
10439
- return value === void 0 || value === null || value === "";
10440
- }
10441
- function withUndeclaredGrantBaseline(baseline, aws, keys, siblingRecorded = {}) {
10442
- let out = baseline;
10443
- const set = (key, value) => {
10444
- if (out === baseline) out = { ...baseline };
10445
- defineOwnKey(out, key, value);
10446
- };
10447
- for (const key of keys) {
10448
- if (!hasOwnKey(aws, key)) continue;
10449
- if (isUndeclaredGrantScalarKey(key)) {
10450
- if (!hasOwnKey(baseline, key)) set(key, "");
10451
- continue;
10452
- }
10453
- const live = aws[key];
10454
- if (!Array.isArray(live)) continue;
10455
- const recorded = hasOwnKey(baseline, key) ? baseline[key] : [];
10456
- if (!Array.isArray(recorded)) continue;
10457
- const byId = /* @__PURE__ */ new Map();
10458
- for (const member of [...siblingRecorded[key] ?? [], ...recorded]) {
10459
- const id = grantMemberIdentity(key, member);
10460
- if (id !== void 0 && !byId.has(id)) byId.set(id, member);
10461
- }
10462
- const projected = [];
10463
- for (const member of live) {
10464
- const id = grantMemberIdentity(key, member);
10465
- if (id === void 0 || !byId.has(id)) continue;
10466
- projected.push(typeof member === "string" ? member : byId.get(id));
10467
- byId.delete(id);
10468
- }
10469
- if (!(hasOwnKey(baseline, key) && projected.length === recorded.length && projected.every((m, i) => m === recorded[i]))) set(key, projected);
10470
- }
10471
- return out;
10472
- }
10473
- function undeclaredGrantIgnorePaths(baseline, aws, keys) {
10474
- return keys.filter((key) => {
10475
- if (hasOwnKey(aws, key)) return false;
10476
- if (isUndeclaredGrantScalarKey(key)) return !hasOwnKey(baseline, key) || isNoBoundary(baseline[key]);
10477
- return true;
10478
- });
10479
- }
10480
- function withoutUndeclaredNoBoundary(desired, keys) {
10481
- const absent = keys.filter((key) => isUndeclaredGrantScalarKey(key) && isNoBoundary(desired[key]));
10482
- if (absent.length === 0) return {
10483
- desired,
10484
- absent
10485
- };
10486
- const out = { ...desired };
10487
- for (const key of absent) delete out[key];
10488
- return {
10489
- desired: out,
10490
- absent
10491
- };
10492
- }
10493
- function removedGrantMembers(key, awsValue, stateValue) {
10494
- if (isUndeclaredGrantScalarKey(key)) return !isNoBoundary(awsValue) && isNoBoundary(stateValue) ? [{
10495
- key,
10496
- member: awsValue
10497
- }] : [];
10498
- if (!Array.isArray(awsValue)) return [];
10499
- const kept = new Set((Array.isArray(stateValue) ? stateValue : []).map((m) => grantMemberIdentity(key, m)));
10500
- const out = [];
10501
- for (const m of awsValue) {
10502
- const id = grantMemberIdentity(key, m);
10503
- if (id !== void 0 && kept.has(id)) continue;
10504
- const name = key === "Policies" && isPlainRecord$3(m) ? m["PolicyName"] : void 0;
10505
- out.push({
10506
- key,
10507
- member: typeof name === "string" ? name : m
10508
- });
10509
- }
10510
- return out;
10511
- }
10512
-
10513
- // src/provisioning/providers/s3-bucket/shared.ts
10514
- function manualBucketDeletionClause(bucketName, maskSecrets, journaled) {
10515
- const command = renderDisableCommand({
10516
- before: "aws s3api delete-bucket --bucket",
10517
- identifier: bucketName,
10518
- maskSecrets
10519
- });
10520
- const lead = journaled ? `Outside a rollback's re-create, the failed deploy's rollback journal records the bucket for ${proseQuoted(cdkdRemedy("cdkd rollback", "--revert-failed"), "`")}; otherwise delete it yourself before the next deploy` : "Manual deletion may be required before the next deploy";
10521
- return command ? `${lead}: ${command}` : `${lead}, via the console: the bucket name cannot be reproduced safely on a command line, so any command shown here could act on a different bucket or run part of the name as shell.`;
10522
- }
10523
- function configItemId(item) {
10524
- if (!isPlainObject(item)) return void 0;
10525
- const id = item["Id"];
10526
- if (typeof id === "string") return id;
10527
- if (typeof id === "number" && Number.isFinite(id)) return String(id);
10528
- }
10529
- function declaresBucketObjectLock(properties) {
10530
- return properties["ObjectLockEnabled"] === true || properties["ObjectLockEnabled"] === "true";
10531
- }
10532
- function declaresNestedObjectLock(properties) {
10533
- return properties["ObjectLockConfiguration"]?.["ObjectLockEnabled"] === "Enabled";
10534
- }
10535
- function caughtErrorName(error) {
10536
- const name = error?.name;
10537
- return typeof name === "string" && name !== "" ? name : "unknown error";
10538
- }
10539
- function isPlainObject(value) {
10540
- return typeof value === "object" && value !== null && !Array.isArray(value);
10541
- }
10542
- function describeValue(value, maskSecrets = (text) => text) {
10543
- if (value === null) return "null";
10544
- if (Array.isArray(value)) return "an array";
10545
- if (typeof value === "string") return `a string ${displaySafe(JSON.stringify(maskDeep(value, maskSecrets)))}`;
10546
- if (isPlainObject(value)) return `an object with keys [${Object.keys(value).map((key) => displaySafe(maskSecrets(key))).join(", ")}]`;
10547
- return `a ${typeof value} (${maskSecrets(String(value))})`;
10548
- }
10549
- function coerceCfnNumber(value) {
10550
- if (typeof value !== "number" && typeof value !== "string") return void 0;
10551
- if (value === "") return void 0;
10552
- const n = Number(value);
10553
- return Number.isFinite(n) ? n : void 0;
10554
- }
10555
- function mergeLegacySingular(plural, singular, onCollision) {
10556
- const out = (Array.isArray(plural) ? plural : []).filter(isPlainObject);
10557
- if (!isPlainObject(singular)) return out;
10558
- const sc = singular["StorageClass"];
10559
- if (typeof sc === "string" && out.some((e) => e["StorageClass"] === sc)) {
10560
- onCollision(sc);
10561
- return out;
10562
- }
10563
- return [...out, singular];
10564
- }
10565
- function shownLifecycleRuleId(id) {
10566
- return id === void 0 || id === null || id === "" ? "(no Id)" : displayIdent(id);
10567
- }
10568
-
10569
- // src/provisioning/providers/s3-bucket/effective-items.ts
10570
- function effectiveS3BucketDestination(declared, sentFormat) {
10571
- if (!isPlainObject(declared)) return declared;
10572
- if (!declared["BucketArn"]) return declared;
10573
- const out = { BucketArn: declared["BucketArn"] };
10574
- if (declared["BucketAccountId"] !== void 0) out["BucketAccountId"] = declared["BucketAccountId"];
10575
- out["Format"] = sentFormat ?? declaredOrDefault(declared, "Format", "CSV");
10576
- if (declared["Prefix"] !== void 0) out["Prefix"] = declared["Prefix"];
10577
- return sameScalarRecord(out, declared) ? declared : out;
10578
- }
10579
- function declaredOrDefault(container, key, fallback) {
10580
- return key in container ? container[key] : fallback;
10581
- }
10582
- const INVENTORY_DESTINATION_DEFAULT_FORMAT = "CSV";
10583
- const INVENTORY_DEFAULT_ENABLED = true;
10584
- const INVENTORY_DEFAULT_INCLUDED_OBJECT_VERSIONS = "All";
10585
- const ANALYTICS_DEFAULT_OUTPUT_SCHEMA_VERSION = "V_1";
10586
- function sameScalarRecord(a, b) {
10587
- const aKeys = Object.keys(a);
10588
- if (aKeys.length !== Object.keys(b).length) return false;
10589
- return aKeys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && Object.is(a[k], b[k]));
10590
- }
10591
- const INVENTORY_DEFAULT_SCHEDULE_FREQUENCY = "Weekly";
10592
- function effectiveInventoryItem(item, sent) {
10593
- const patch = {};
10594
- const declaredEnabled = item["Enabled"];
10595
- if (declaredEnabled === void 0) patch["Enabled"] = true;
10596
- else {
10597
- const coercedEnabled = coerceCfnBoolean(declaredEnabled);
10598
- if (coercedEnabled !== void 0 && !Object.is(declaredEnabled, coercedEnabled)) patch["Enabled"] = coercedEnabled;
10599
- }
10600
- if (item["IncludedObjectVersions"] === void 0) patch["IncludedObjectVersions"] = "All";
10601
- const declaredSchedule = item["Schedule"];
10602
- const declaresScheduleFrequency = item["ScheduleFrequency"] !== void 0;
10603
- const scheduleFrequencyUsable = declaresScheduleFrequency && configStringRefusal(item, "ScheduleFrequency", "Weekly", "AWS::S3::Bucket InventoryConfigurations[]") === void 0;
10604
- const scheduleContainerUsable = configStringRefusal(declaredSchedule, "Frequency", INVENTORY_DEFAULT_SCHEDULE_FREQUENCY, "AWS::S3::Bucket InventoryConfigurations[].Schedule") === void 0;
10605
- const canFoldSchedule = sent?.frequency !== void 0 || scheduleFrequencyUsable || !declaresScheduleFrequency && scheduleContainerUsable;
10606
- if (canFoldSchedule) {
10607
- const declaredFrequency = declaresScheduleFrequency ? item["ScheduleFrequency"] : isPlainObject(declaredSchedule) && declaredSchedule["Frequency"] !== void 0 ? declaredSchedule["Frequency"] : INVENTORY_DEFAULT_SCHEDULE_FREQUENCY;
10608
- const frequency = sent?.frequency ?? declaredFrequency;
10609
- if (!Object.is(item["ScheduleFrequency"], frequency)) patch["ScheduleFrequency"] = frequency;
10610
- }
10611
- const destination = effectiveS3BucketDestination(item["Destination"], sent?.format);
10612
- if (destination !== item["Destination"]) patch["Destination"] = destination;
10613
- const dropsSchedule = declaredSchedule !== void 0 && canFoldSchedule;
10614
- if (!dropsSchedule && Object.keys(patch).length === 0) return item;
10615
- const out = {
10616
- ...item,
10617
- ...patch
10618
- };
10619
- if (dropsSchedule) delete out["Schedule"];
10620
- return out;
10621
- }
10622
- function effectiveAnalyticsItem(item, sent) {
10623
- const storageClassAnalysis = item["StorageClassAnalysis"];
10624
- if (!isPlainObject(storageClassAnalysis)) return item;
10625
- const dataExport = storageClassAnalysis["DataExport"];
10626
- if (!isPlainObject(dataExport)) return item;
10627
- const patch = {};
10628
- const outputSchemaVersion = sent?.outputSchemaVersion ?? declaredOrDefault(dataExport, "OutputSchemaVersion", "V_1");
10629
- if (!Object.is(dataExport["OutputSchemaVersion"], outputSchemaVersion)) patch["OutputSchemaVersion"] = outputSchemaVersion;
10630
- const destination = effectiveS3BucketDestination(dataExport["Destination"], sent?.format);
10631
- if (destination !== dataExport["Destination"]) patch["Destination"] = destination;
10632
- if (Object.keys(patch).length === 0) return item;
10633
- return {
10634
- ...item,
10635
- StorageClassAnalysis: {
10636
- ...storageClassAnalysis,
10637
- DataExport: {
10638
- ...dataExport,
10639
- ...patch
10640
- }
10641
- }
10642
- };
10643
- }
10644
- const INTELLIGENT_TIERING_DEFAULT_STATUS = "Enabled";
10645
- function effectiveIntelligentTieringItem(item) {
10646
- if (item["Status"] !== void 0) return item;
10647
- return {
10648
- ...item,
10649
- Status: INTELLIGENT_TIERING_DEFAULT_STATUS
10650
- };
10651
- }
10652
- function foldToleratedAliases(bag, aliases) {
10653
- let out;
10654
- for (const [emitted, tolerated] of aliases) {
10655
- if (bag[tolerated] === void 0) continue;
10656
- out ??= { ...bag };
10657
- out[emitted] = bag[emitted] ?? bag[tolerated];
10658
- delete out[tolerated];
10659
- }
10660
- return out ?? bag;
10661
- }
10662
- const TRANSITION_DATE_KEY = "TransitionDate";
10663
- const TRANSITION_ALIASES = [["TransitionInDays", "Days"], ["TransitionDate", "Date"]];
10664
- const EVENTBRIDGE_CONFIG_PATH = "AWS::S3::Bucket NotificationConfiguration.EventBridgeConfiguration";
10665
- const EVENTBRIDGE_CONFIG_KEY = "EventBridgeConfiguration";
10666
- const EVENTBRIDGE_DEFAULT_ENABLED = true;
10667
- function eventBridgeEnabledOf(eb) {
10668
- const declared = isPlainObject(eb) ? eb["EventBridgeEnabled"] : void 0;
10669
- return coerceCfnBoolean(declared) ?? true;
10670
- }
10671
- const NOTIFICATION_LIST_KEYS = [
10672
- "TopicConfigurations",
10673
- "QueueConfigurations",
10674
- "LambdaConfigurations"
10675
- ];
10676
- function dropEmptyNotificationFamilies(config) {
10677
- let out;
10678
- for (const listKey of NOTIFICATION_LIST_KEYS) {
10679
- const list = config[listKey];
10680
- if (!Array.isArray(list) || list.length > 0) continue;
10681
- out ??= { ...config };
10682
- delete out[listKey];
10683
- }
10684
- return out ?? config;
10685
- }
10686
- function foldNotificationEvents(item) {
10687
- const events = item["Events"];
10688
- if (events === void 0) return item;
10689
- const out = { ...item };
10690
- if (item["Event"] === void 0) {
10691
- if (!Array.isArray(events) || events.length !== 1) return item;
10692
- out["Event"] = events[0];
10693
- }
10694
- delete out["Events"];
10695
- return out;
10696
- }
10697
- function effectiveNotificationConfiguration(config) {
10698
- if (!isPlainObject(config)) return config;
10699
- let out = config;
10700
- for (const listKey of NOTIFICATION_LIST_KEYS) out = canonicalizeItemList(out, listKey, foldNotificationEvents);
10701
- out = dropEmptyNotificationFamilies(out);
10702
- return foldEventBridgeConfiguration(out);
10703
- }
10704
- function foldEventBridgeConfiguration(config) {
10705
- const eb = config[EVENTBRIDGE_CONFIG_KEY];
10706
- if (eb === void 0) return config;
10707
- if (eb !== null && configBooleanRefusal(eb, "EventBridgeEnabled", "AWS::S3::Bucket NotificationConfiguration.EventBridgeConfiguration")) return config;
10708
- const enabled = eb === null ? false : eventBridgeEnabledOf(eb);
10709
- const declared = isPlainObject(eb) ? eb["EventBridgeEnabled"] : void 0;
10710
- if (isPlainObject(eb) && Object.keys(eb).length === 1 && Object.is(declared, enabled)) return config;
10711
- return {
10712
- ...config,
10713
- [EVENTBRIDGE_CONFIG_KEY]: { EventBridgeEnabled: enabled }
10714
- };
10715
- }
10716
-
10717
- // src/utils/cfn-timestamp.ts
10718
- const OFFSETLESS_DATE_TIME = /^\d{4}-\d{2}-\d{2}[Tt ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/;
10719
- function parseCfnTimestamp(value) {
10720
- return new Date(OFFSETLESS_DATE_TIME.test(value) ? `${value}Z` : value);
10721
- }
10722
-
10723
- // src/provisioning/providers/s3-bucket/lifecycle-fold.ts
10724
- const LIFECYCLE_RULE_PATH = "AWS::S3::Bucket LifecycleConfiguration.Rules[]";
10725
- const LIFECYCLE_FILTER_PATH = `${LIFECYCLE_RULE_PATH}.Filter`;
10726
- const LIFECYCLE_TAG_FILTERS_PATH = `${LIFECYCLE_RULE_PATH}.TagFilters`;
10727
- const LIFECYCLE_DEFAULT_STATUS = "Enabled";
10728
- const LIFECYCLE_STATUS_KEY = "Status";
10729
- function lifecycleRuleScope(rule) {
10730
- const filter = rule["Filter"];
10731
- return {
10732
- prefix: filter?.["Prefix"] ?? rule["Prefix"],
10733
- tagFilters: filter?.["TagFilters"] ?? rule["TagFilters"],
10734
- sizeGt: filter?.["ObjectSizeGreaterThan"] ?? rule["ObjectSizeGreaterThan"],
10735
- sizeLt: filter?.["ObjectSizeLessThan"] ?? rule["ObjectSizeLessThan"]
10736
- };
10207
+ prefix: filter?.["Prefix"] ?? rule["Prefix"],
10208
+ tagFilters: filter?.["TagFilters"] ?? rule["TagFilters"],
10209
+ sizeGt: filter?.["ObjectSizeGreaterThan"] ?? rule["ObjectSizeGreaterThan"],
10210
+ sizeLt: filter?.["ObjectSizeLessThan"] ?? rule["ObjectSizeLessThan"]
10211
+ };
10737
10212
  }
10738
10213
  function lifecycleRuleIsPlainPrefixOnly(rule) {
10739
10214
  if (rule["Filter"] != null) return false;
@@ -11158,8 +10633,8 @@ function sgSettleRuleKey(rule, direction) {
11158
10633
  p: protocol,
11159
10634
  f: port(rule["FromPort"]),
11160
10635
  t: port(rule["ToPort"]),
11161
- c4: present(rule["CidrIp"]),
11162
- c6: present(rule["CidrIpv6"]),
10636
+ c4: sgCidrKey(present(rule["CidrIp"])),
10637
+ c6: sgCidrKey(present(rule["CidrIpv6"])),
11163
10638
  peer: present(peer),
11164
10639
  pl: present(direction === "egress" ? rule["DestinationPrefixListId"] : rule["SourcePrefixListId"]),
11165
10640
  d: present(rule["Description"])
@@ -11199,341 +10674,905 @@ function sgRemovedNotDeclared(removed, declared, direction) {
11199
10674
  return !(parsed.peer !== null && namedPeerPorts.has(protocolAndPorts(key) ?? ""));
11200
10675
  }));
11201
10676
  }
11202
- function protocolAndPorts(key) {
10677
+ function protocolAndPorts(key) {
10678
+ try {
10679
+ const { p, f, t } = JSON.parse(key);
10680
+ return JSON.stringify([
10681
+ p,
10682
+ f,
10683
+ t
10684
+ ]);
10685
+ } catch {
10686
+ return;
10687
+ }
10688
+ }
10689
+ function sgRuleIsRemoved(rule, gone, direction) {
10690
+ if (gone.size === 0 || typeof rule !== "object" || rule === null) return false;
10691
+ const key = sgRemovalRuleKey(rule, direction);
10692
+ return key !== void 0 && gone.has(key);
10693
+ }
10694
+ function declaredSgRulesRead(value, declared, direction) {
10695
+ if (!Array.isArray(value)) return false;
10696
+ const have = value.map((rule) => typeof rule === "object" && rule !== null ? sgSettleRuleKey(rule, direction) : void 0);
10697
+ for (const rule of declared) {
10698
+ if (typeof rule !== "object" || rule === null) continue;
10699
+ const key = sgSettleRuleKey(rule, direction);
10700
+ if (key === void 0) continue;
10701
+ const index = have.indexOf(key);
10702
+ if (index < 0) return false;
10703
+ have.splice(index, 1);
10704
+ }
10705
+ return true;
10706
+ }
10707
+ function sgRulesAreDeclared(live, declared, direction) {
10708
+ if (!Array.isArray(live) || !Array.isArray(declared)) return false;
10709
+ const keys = (rules) => {
10710
+ const out = /* @__PURE__ */ new Set();
10711
+ for (const rule of rules) {
10712
+ const key = typeof rule === "object" && rule !== null ? sgSettleRuleKey(rule, direction) : void 0;
10713
+ if (key === void 0) return void 0;
10714
+ out.add(key);
10715
+ }
10716
+ return out;
10717
+ };
10718
+ const have = keys(live);
10719
+ const want = keys(declared);
10720
+ return have !== void 0 && want !== void 0 && have.size === want.size && [...want].every((key) => have.has(key));
10721
+ }
10722
+ function sgRuleReadbackShape(rule, direction) {
10723
+ if (rule["IpProtocol"] === void 0 || rule["IpProtocol"] === null || rule["IpProtocol"] === "") return;
10724
+ if (sgSettleRuleKey(rule, direction) === void 0) return void 0;
10725
+ const out = {};
10726
+ for (const [key, value] of Object.entries(rule)) {
10727
+ if (value === void 0 || value === null || value === "") continue;
10728
+ out[key] = value;
10729
+ }
10730
+ const protocol = sgProtocolKey(rule["IpProtocol"]);
10731
+ out["IpProtocol"] = protocol;
10732
+ if (protocol === "-1") {
10733
+ delete out["FromPort"];
10734
+ delete out["ToPort"];
10735
+ } else for (const key of ["FromPort", "ToPort"]) if (out[key] !== void 0) out[key] = cfnIngressPortValue(out[key]);
10736
+ return out;
10737
+ }
10738
+ function mergeDeclaredSgRules(read, declared, direction) {
10739
+ const keyOf = (rule) => typeof rule === "object" && rule !== null ? sgSettleRuleKey(rule, direction) : void 0;
10740
+ return mergeDeclaredEntries(read, declared, (entry, want) => {
10741
+ const key = keyOf(want);
10742
+ return key !== void 0 && keyOf(entry) === key;
10743
+ }, (want) => typeof want === "object" && want !== null ? sgRuleReadbackShape(want, direction) : void 0);
10744
+ }
10745
+ function sgRuleListMember(key, direction, declared, revoked, reorder, read) {
10746
+ const gone = sgRemovedNotDeclared(revoked, declared, direction);
10747
+ return {
10748
+ key,
10749
+ declared,
10750
+ matches: (value) => declaredSgRulesRead(value, declared, direction) && !value.some((rule) => sgRuleIsRemoved(rule, gone, direction)),
10751
+ whenUnsettled: (newest) => reorder(mergeDeclaredSgRules(newest, declared, direction).filter((rule) => !sgRuleIsRemoved(rule, gone, direction))),
10752
+ read
10753
+ };
10754
+ }
10755
+
10756
+ // src/provisioning/providers/iam-policy/agreeing-copies.ts
10757
+ const readsWithAgreeingCopies = /* @__PURE__ */ new WeakSet();
10758
+ function markCopiesAgreed(read) {
10759
+ readsWithAgreeingCopies.add(read);
10760
+ }
10761
+ function readHadAgreeingCopies(read) {
10762
+ return readsWithAgreeingCopies.has(read);
10763
+ }
10764
+
10765
+ // src/cli/commands/drift/baseline-keys.ts
10766
+ const UNDECLARED_UNCOMPARED_KEYS = {
10767
+ "AWS::S3::Bucket": ["NotificationConfiguration"],
10768
+ "AWS::Events::EventBus": ["Policy"],
10769
+ "AWS::IAM::ManagedPolicy": [
10770
+ "Groups",
10771
+ "Roles",
10772
+ "Users"
10773
+ ],
10774
+ "AWS::EC2::Instance": ["BlockDeviceMappings"]
10775
+ };
10776
+ const UNDECLARED_EMPTY_COMPARED_KEYS = {
10777
+ "AWS::BedrockAgentCore::Runtime": [
10778
+ "FilesystemConfigurations",
10779
+ "HooksConfiguration",
10780
+ "RequestHeaderConfiguration",
10781
+ "ResourceConfigurations"
10782
+ ],
10783
+ "AWS::CodeCommit::Repository": ["Triggers"],
10784
+ "AWS::IAM::User": ["LoginProfile"]
10785
+ };
10786
+ function undeclaredEmptyComparedDriftKeys(resourceType) {
10787
+ return hasOwnKey(UNDECLARED_EMPTY_COMPARED_KEYS, resourceType) ? UNDECLARED_EMPTY_COMPARED_KEYS[resourceType] : [];
10788
+ }
10789
+ function undeclaredUncomparedDriftKeys(resourceType, properties) {
10790
+ const keys = hasOwnKey(UNDECLARED_UNCOMPARED_KEYS, resourceType) ? UNDECLARED_UNCOMPARED_KEYS[resourceType] : [];
10791
+ if (keys.length === 0) return [];
10792
+ if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return [];
10793
+ return keys.filter((key) => !hasOwnKey(properties, key));
10794
+ }
10795
+ function preFixBaselineUncomparedDriftKeys(resourceType, observed, properties, aws) {
10796
+ if (observed === void 0) return [];
10797
+ return preFixBaselineKeys(resourceType, observed, properties, aws).filter((key) => !(holdsPrincipalForm({ [key]: observed[key] }, "uniqueIds") && holdsPrincipalForm({ [key]: aws[key] }, "arns")));
10798
+ }
10799
+ function preFixBaselineKeys(resourceType, observed, properties, aws) {
10800
+ if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return [];
10801
+ if (resourceType === "AWS::DynamoDB::Table") {
10802
+ const bag = properties;
10803
+ return [...staleTablePolicyBaseline(observed, bag, aws) ? ["ResourcePolicy"] : [], ...tagsHeal.liveIsDeclared(bag, aws) ? [tagsHeal.key] : []];
10804
+ }
10805
+ if (resourceType === "AWS::SQS::QueuePolicy" || resourceType === "AWS::SNS::TopicPolicy") {
10806
+ const declared = declaredPolicyDocument(properties);
10807
+ return declared !== void 0 && policyDocumentMatchesDeclared(aws["PolicyDocument"], declared) && !policyDocumentMatchesDeclared(observed["PolicyDocument"], declared) ? ["PolicyDocument"] : [];
10808
+ }
10809
+ if (resourceType === "AWS::Lambda::Permission") {
10810
+ const declared = properties;
10811
+ return lambdaPermissionMatchesDeclared(aws, declared) && !lambdaPermissionMatchesDeclared(observed, declared) ? [...LAMBDA_PERMISSION_STATEMENT_KEYS] : [];
10812
+ }
10813
+ const members = OWN_WRITE_MEMBERS.get(resourceType);
10814
+ if (members !== void 0) return members.filter((member) => member.liveIsDeclared(properties, aws)).map((member) => member.key);
10815
+ if (resourceType !== "AWS::Lambda::EventSourceMapping") return [];
10816
+ const declared = hasOwnKey(properties, "Enabled") ? coerceCfnBoolean(properties["Enabled"]) : void 0;
10817
+ const recorded = hasOwnKey(observed, "Enabled") ? coerceCfnBoolean(observed["Enabled"]) : void 0;
10818
+ const live = hasOwnKey(aws, "Enabled") ? aws["Enabled"] : void 0;
10819
+ return recorded === false && declared !== false && live === true ? ["Enabled"] : [];
10820
+ }
10821
+ const documentHeal = (key) => ({
10822
+ key,
10823
+ liveIsDeclared: (properties, aws) => {
10824
+ const declared = declaredMemberDocument(properties[key]);
10825
+ return declared !== void 0 && policyDocumentMatchesDeclared(aws[key], declared);
10826
+ }
10827
+ });
10828
+ const stringListHeal = (key) => ({
10829
+ key,
10830
+ liveIsDeclared: (properties, aws) => {
10831
+ const declared = declaredStringList(properties[key]);
10832
+ return declared !== void 0 && stringListIsDeclared(aws[key], declared);
10833
+ }
10834
+ });
10835
+ const boundaryHeal = {
10836
+ key: "PermissionsBoundary",
10837
+ liveIsDeclared: (properties, aws) => typeof properties["PermissionsBoundary"] === "string" && properties["PermissionsBoundary"] !== "" && aws["PermissionsBoundary"] === properties["PermissionsBoundary"]
10838
+ };
10839
+ const inlinePoliciesHeal = {
10840
+ key: "Policies",
10841
+ liveIsDeclared: (properties, aws) => {
10842
+ const declared = declaredInlinePolicies(properties["Policies"]);
10843
+ return declared !== void 0 && inlinePoliciesAreDeclared(aws["Policies"], declared);
10844
+ }
10845
+ };
10846
+ const sgRulesHeal = (key, direction) => ({
10847
+ key,
10848
+ liveIsDeclared: (properties, aws) => sgRulesAreDeclared(aws[key], properties[key], direction)
10849
+ });
10850
+ const tagsHeal = {
10851
+ key: "Tags",
10852
+ liveIsDeclared: (properties, aws) => {
10853
+ const declared = declaredTagsReadback(properties["Tags"]);
10854
+ return declared !== void 0 && tagsMatchDeclared(aws["Tags"], declared);
10855
+ }
10856
+ };
10857
+ const OWN_WRITE_MEMBERS = new Map(Object.entries({
10858
+ "AWS::KMS::Key": [documentHeal("KeyPolicy")],
10859
+ "AWS::Logs::DeliveryDestination": [{
10860
+ key: "DeliveryDestinationPolicy",
10861
+ liveIsDeclared: (properties, aws) => {
10862
+ const inner = (block) => {
10863
+ const document = typeof block === "object" && block !== null && !Array.isArray(block) ? block["DeliveryDestinationPolicy"] : void 0;
10864
+ return typeof document === "object" && document !== null && !Array.isArray(document) ? document : void 0;
10865
+ };
10866
+ const declared = inner(properties["DeliveryDestinationPolicy"]);
10867
+ if (declared === void 0) return properties["DeliveryDestinationPolicy"] === void 0 && aws["DeliveryDestinationPolicy"] === void 0;
10868
+ return policyDocumentMatchesDeclared(inner(aws["DeliveryDestinationPolicy"]), declared);
10869
+ }
10870
+ }],
10871
+ "AWS::Logs::LogGroup": [{
10872
+ key: "DataProtectionPolicy",
10873
+ liveIsDeclared: (properties, aws) => {
10874
+ const declared = declaredMemberDocument(properties["DataProtectionPolicy"]);
10875
+ if (declared === void 0) return (properties["DataProtectionPolicy"] === void 0 || properties["DataProtectionPolicy"] === "") && aws["DataProtectionPolicy"] === "";
10876
+ return policyDocumentMatchesDeclared(aws["DataProtectionPolicy"], declared);
10877
+ }
10878
+ }],
10879
+ "AWS::ApiGateway::RestApi": [documentHeal("Policy")],
10880
+ "AWS::EFS::FileSystem": [{
10881
+ key: "FileSystemPolicy",
10882
+ liveIsDeclared: (properties, aws) => {
10883
+ const declared = declaredMemberDocument(properties["FileSystemPolicy"]);
10884
+ if (declared === void 0) return properties["FileSystemPolicy"] === void 0 && aws["FileSystemPolicy"] === void 0;
10885
+ return efsPolicyMatchesDeclared(aws["FileSystemPolicy"], declared);
10886
+ }
10887
+ }],
10888
+ "AWS::S3::Bucket": [{
10889
+ key: "LifecycleConfiguration",
10890
+ liveIsDeclared: (properties, aws) => {
10891
+ const declared = declaredLifecycle(properties);
10892
+ const live = aws["LifecycleConfiguration"];
10893
+ if (declared === void 0 || typeof live !== "object" || live === null) return false;
10894
+ const liveBag = live;
10895
+ return declared.kind === "absent" ? lifecycleReadIsAbsent(liveBag) : lifecycleMatchesDeclared(liveBag, declared.expected);
10896
+ }
10897
+ }],
10898
+ "AWS::SecretsManager::Secret": [tagsHeal],
10899
+ "AWS::CodeBuild::Project": [{
10900
+ key: "Visibility",
10901
+ liveIsDeclared: (properties, aws) => typeof properties["Visibility"] === "string" && properties["Visibility"] !== "" && aws["Visibility"] === properties["Visibility"]
10902
+ }],
10903
+ "AWS::IAM::Role": [
10904
+ documentHeal("AssumeRolePolicyDocument"),
10905
+ boundaryHeal,
10906
+ stringListHeal("ManagedPolicyArns"),
10907
+ inlinePoliciesHeal
10908
+ ],
10909
+ "AWS::IAM::User": [
10910
+ boundaryHeal,
10911
+ stringListHeal("ManagedPolicyArns"),
10912
+ stringListHeal("Groups"),
10913
+ inlinePoliciesHeal
10914
+ ],
10915
+ "AWS::IAM::Group": [stringListHeal("ManagedPolicyArns"), inlinePoliciesHeal],
10916
+ "AWS::IAM::ManagedPolicy": [
10917
+ documentHeal("PolicyDocument"),
10918
+ stringListHeal("Roles"),
10919
+ stringListHeal("Users"),
10920
+ stringListHeal("Groups")
10921
+ ],
10922
+ "AWS::IAM::InstanceProfile": [stringListHeal("Roles")],
10923
+ "AWS::IAM::Policy": [
10924
+ {
10925
+ key: "PolicyDocument",
10926
+ liveIsDeclared: (properties, aws) => readHadAgreeingCopies(aws) && documentHeal("PolicyDocument").liveIsDeclared(properties, aws)
10927
+ },
10928
+ {
10929
+ key: "PolicyName",
10930
+ liveIsDeclared: (properties, aws) => typeof properties["PolicyName"] === "string" && properties["PolicyName"] !== "" && aws["PolicyName"] === properties["PolicyName"]
10931
+ },
10932
+ stringListHeal("Roles"),
10933
+ stringListHeal("Users"),
10934
+ stringListHeal("Groups")
10935
+ ],
10936
+ "AWS::S3::BucketPolicy": [{
10937
+ key: "PolicyDocument",
10938
+ liveIsDeclared: (properties, aws) => {
10939
+ const declared = declaredPolicyDocument(properties);
10940
+ return declared !== void 0 && policyDocumentMatchesDeclared(aws["PolicyDocument"], declared);
10941
+ }
10942
+ }],
10943
+ "AWS::Events::EventBus": [documentHeal("Policy")],
10944
+ "AWS::EC2::SecurityGroup": [sgRulesHeal("SecurityGroupIngress", "ingress"), sgRulesHeal("SecurityGroupEgress", "egress")]
10945
+ }));
10946
+ function staleTablePolicyBaseline(observed, properties, aws) {
10947
+ const recorded = readStreamPolicy(observed);
10948
+ const declared = readStreamPolicy(properties);
10949
+ const live = readStreamPolicy(aws);
10950
+ if (recorded.kind === "usable" && declared.kind === "absent" && live.kind === "absent") return true;
10951
+ return declared.kind === "usable" && live.kind === "usable" && streamPolicyMatchesDeclared(live.document, properties);
10952
+ }
10953
+ function readOnlyUncomparedDriftPaths(readOnlyPaths, properties) {
10954
+ if (!readOnlyPaths || readOnlyPaths.length === 0) return [];
10955
+ const declared = (path) => {
10956
+ let node = properties;
10957
+ for (const segment of path.split(".")) {
10958
+ if (typeof node !== "object" || node === null || Array.isArray(node)) return false;
10959
+ if (!hasOwnKey(node, segment)) return false;
10960
+ node = node[segment];
10961
+ }
10962
+ return true;
10963
+ };
10964
+ return readOnlyPaths.filter((path) => !declared(path));
10965
+ }
10966
+ function writeOnlyDriftPaths(resourceType) {
10967
+ let entry = writeOnlyDriftPathsCache.get(resourceType);
10968
+ if (entry === void 0) {
10969
+ entry = lookUpWriteOnlyDriftPaths(resourceType);
10970
+ writeOnlyDriftPathsCache.set(resourceType, entry);
10971
+ }
10972
+ return entry;
10973
+ }
10974
+ const writeOnlyDriftPathsCache = /* @__PURE__ */ new Map();
10975
+ async function lookUpWriteOnlyDriftPaths(resourceType) {
10976
+ try {
10977
+ if (await tryGetTopLevelWriteOnlyProperties(resourceType) === void 0) return void 0;
10978
+ const paths = [];
10979
+ for (const segments of getSettledWriteOnlyPropertyPaths(resourceType)) if (segments.length > 0 && segments.every((segment) => segment !== "" && segment !== "*" && !segment.includes(".") && !segment.endsWith("[]"))) paths.push(segments.join("."));
10980
+ return paths;
10981
+ } catch {
10982
+ return;
10983
+ }
10984
+ }
10985
+ const DERIVED_ECHO_MEMBERS = { "AWS::SecretsManager::RotationSchedule": [{
10986
+ parent: "RotationRules",
10987
+ source: "ScheduleExpression",
10988
+ echo: "AutomaticallyAfterDays"
10989
+ }] };
10990
+ function stripDerivedEchoMembers(resourceType, bag) {
10991
+ const rules = DERIVED_ECHO_MEMBERS[resourceType];
10992
+ if (!rules) return bag;
10993
+ let out = bag;
10994
+ for (const { parent, source, echo } of rules) {
10995
+ const node = hasOwnKey(out, parent) ? out[parent] : void 0;
10996
+ if (typeof node !== "object" || node === null || Array.isArray(node)) continue;
10997
+ const members = node;
10998
+ if (!hasOwnKey(members, echo) || !hasOwnKey(members, source)) continue;
10999
+ if (members[source] === void 0 || members[source] === null) continue;
11000
+ const { [echo]: _echo, ...rest } = members;
11001
+ out = {
11002
+ ...out,
11003
+ [parent]: rest
11004
+ };
11005
+ }
11006
+ return out;
11007
+ }
11008
+ function otherPhysicalIds(resources, logicalId) {
11009
+ const ids = [];
11010
+ for (const [id, record] of Object.entries(resources ?? {})) if (id !== logicalId && typeof record?.physicalId === "string") ids.push(record.physicalId);
11011
+ return ids;
11012
+ }
11013
+ function declaredEmptyProperties(properties) {
11014
+ const out = /* @__PURE__ */ new Set();
11015
+ if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return out;
11016
+ const isEmpty = (v) => Array.isArray(v) && v.length === 0 || typeof v === "object" && v !== null && !Array.isArray(v) && Object.keys(v).length === 0;
11017
+ for (const [key, value] of Object.entries(properties)) if (typeof value === "string") {
11018
+ if (value.trim() === "") {
11019
+ out.add(key);
11020
+ continue;
11021
+ }
11022
+ try {
11023
+ if (isEmpty(JSON.parse(value))) out.add(key);
11024
+ } catch {}
11025
+ } else if (isEmpty(value)) out.add(key);
11026
+ return out;
11027
+ }
11028
+ function declaredTrueProperties(properties) {
11029
+ const out = /* @__PURE__ */ new Set();
11030
+ if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return out;
11031
+ for (const [key, value] of Object.entries(properties)) if (value === true || value === "true") out.add(key);
11032
+ return out;
11033
+ }
11034
+
11035
+ // src/cli/commands/drift/secret-resolution.ts
11036
+ function containsDynamicReference$1(value) {
11037
+ if (typeof value === "string") return value.includes("{{resolve:");
11038
+ if (Array.isArray(value)) return value.some(containsDynamicReference$1);
11039
+ if (value !== null && typeof value === "object") return Object.values(value).some(containsDynamicReference$1);
11040
+ return false;
11041
+ }
11042
+ const MIN_SECRET_NEEDLE_LENGTH = 4;
11043
+ function carriesRecordedSecret(value, secrets) {
11044
+ if (value === "") return false;
11045
+ if (secrets.has(value)) return true;
11046
+ for (const plaintext of secrets.keys()) if (plaintext.length >= MIN_SECRET_NEEDLE_LENGTH && value.includes(plaintext)) return true;
11047
+ return false;
11048
+ }
11049
+ function survivingDynamicReferences(value) {
11050
+ return dynamicReferenceTokens(value);
11051
+ }
11052
+ function collectDynamicReferencePaths(value, into, path = "") {
11053
+ if (typeof value === "string") {
11054
+ if (value.includes("{{resolve:")) into.add(path);
11055
+ return;
11056
+ }
11057
+ if (Array.isArray(value)) {
11058
+ value.forEach((item, i) => collectDynamicReferencePaths(item, into, path === "" ? String(i) : `${path}.${i}`));
11059
+ return;
11060
+ }
11061
+ if (value !== null && typeof value === "object") for (const [k, v] of Object.entries(value)) collectDynamicReferencePaths(v, into, path === "" ? k : `${path}.${k}`);
11062
+ }
11063
+ function collectSecretMaskPaths(value, into, path = "") {
11064
+ if (typeof value === "string") {
11065
+ if (value === "***") into.add(path);
11066
+ return;
11067
+ }
11068
+ if (Array.isArray(value)) {
11069
+ value.forEach((item, i) => collectSecretMaskPaths(item, into, path === "" ? String(i) : `${path}.${i}`));
11070
+ return;
11071
+ }
11072
+ if (value !== null && typeof value === "object") for (const [k, v] of Object.entries(value)) collectSecretMaskPaths(v, into, path === "" ? k : `${path}.${k}`);
11073
+ }
11074
+ var DriftSecretResolvers = class {
11075
+ primary;
11076
+ pinned = /* @__PURE__ */ new Map();
11077
+ stackRegion;
11078
+ constructor(stackRegion) {
11079
+ this.stackRegion = stackRegion;
11080
+ this.primary = new IntrinsicFunctionResolver(stackRegion);
11081
+ }
11082
+ forRegion(region) {
11083
+ const target = canonicalizeRegion(region);
11084
+ if (target === canonicalizeRegion(this.stackRegion)) return this.primary;
11085
+ const cached = this.pinned.get(target);
11086
+ if (cached) return cached;
11087
+ const scoped = new IntrinsicFunctionResolver(target);
11088
+ this.pinned.set(target, scoped);
11089
+ return scoped;
11090
+ }
11091
+ forRecordedRegion(region) {
11092
+ return this.primary.resolverForRecordedRegion(region);
11093
+ }
11094
+ };
11095
+ var DriftSecretRefusalError = class DriftSecretRefusalError extends CdkdError {
11096
+ driftSecretRefusal = true;
11097
+ constructor(message, code) {
11098
+ super(message, code);
11099
+ this.name = "DriftSecretRefusalError";
11100
+ Object.setPrototypeOf(this, DriftSecretRefusalError.prototype);
11101
+ }
11102
+ };
11103
+ function isDriftSecretRefusal(err) {
11104
+ return err instanceof DriftSecretRefusalError || err instanceof IntrinsicResolutionRefusalError;
11105
+ }
11106
+ function regionAmbiguousDriftSecretError(logicalId, propertyPath, secretName, foreignProducerRegions, consumerRegion) {
11107
+ const where = propertyPath === "" ? "" : ` property '${propertyPath}'`;
11108
+ return new DriftSecretRefusalError(`${logicalId}${where}: the secret reference '${secretName}' carries no region of its own, and this stack read across a region boundary (producer region(s) on record: ${foreignProducerRegions.join(", ")}), so it may have been resolved in one of those rather than in '${consumerRegion}'. A secret of the same name in two regions is two independent values, so cdkd would compare against — and with --revert WRITE — the WRONG secret. Refusing instead. Spell the reference as a full ARN, which names its region and is resolved there, then re-run ${proseQuoted(cdkdRemedy("cdkd drift"))}.`, "DRIFT_SECRET_REGION_AMBIGUOUS");
11109
+ }
11110
+ function refuseUnprovenDriftSecret(leaf, propertyPath, logicalId, consumerRegion, evidence, recordedRegions) {
11111
+ if (evidence.complete) return;
11112
+ for (const token of dynamicReferenceTokens(leaf)) {
11113
+ if (recordedRegions?.has(token) === true) continue;
11114
+ const name = classifyReplaySecretRegion(token, consumerRegion, evidence.regions).kind === "local" ? regionLessSecretName(token) : void 0;
11115
+ if (name === void 0) continue;
11116
+ const where = propertyPath === "" ? "" : ` property '${propertyPath}'`;
11117
+ throw new DriftSecretRefusalError(`${logicalId}${where}: the secret reference '${name}' carries no region of its own, and this is a nested stack whose parent stacks' cross-region reads could not be established, so a parent may have resolved it in another region than '${consumerRegion}'. A secret of the same name in two regions is two independent values, so cdkd would compare against — and with --revert WRITE — the WRONG secret. Refusing instead. Make the parent stacks' state readable (or repair a record whose parent link disagrees with its key), or spell the reference as a full ARN, then re-run ${proseQuoted(cdkdRemedy("cdkd drift"))}.`, "DRIFT_SECRET_REGION_UNKNOWN");
11118
+ }
11119
+ }
11120
+ function noteUnreadableAncestor(stackName, region, why) {
11121
+ getLogger().debug(safeMsg`Producer regions above a nested stack are incomplete: ${displayIdent(stackName)} (${region}): ${why}`);
11122
+ }
11123
+ const MAX_ANCESTOR_DEPTH = 32;
11124
+ async function driftProducerRegionEvidence(state, stackName, region, stateBackend, depth = 0) {
11125
+ let own;
11126
+ if (depth === 0) own = producerRegionsFromState(state);
11127
+ else try {
11128
+ own = producerRegionsFromState(state);
11129
+ } catch {
11130
+ noteUnreadableAncestor(stackName, region, "its cross-stack read records are malformed");
11131
+ return {
11132
+ regions: [],
11133
+ complete: false
11134
+ };
11135
+ }
11136
+ const cut = stackName.lastIndexOf("~");
11137
+ const keyParent = cut >= 0 ? stackName.slice(0, cut) : void 0;
11138
+ const recordParent = state.parentStack;
11139
+ if (keyParent === void 0 && recordParent === void 0) return {
11140
+ regions: own,
11141
+ complete: true
11142
+ };
11143
+ if (keyParent === "" || recordParent !== void 0 && typeof recordParent !== "string" || state.parentRegion !== void 0 && typeof state.parentRegion !== "string" || keyParent !== void 0 && typeof recordParent === "string" && recordParent !== keyParent) {
11144
+ noteUnreadableAncestor(stackName, region, "its key and its parent link disagree, or the link is malformed");
11145
+ return inheritProducerRegions(own, void 0);
11146
+ }
11147
+ const parentName = keyParent ?? recordParent;
11148
+ if (depth >= MAX_ANCESTOR_DEPTH) {
11149
+ noteUnreadableAncestor(stackName, region, `the nesting is deeper than ${MAX_ANCESTOR_DEPTH} levels`);
11150
+ return inheritProducerRegions(own, void 0);
11151
+ }
11152
+ const parentRegion = typeof state.parentRegion === "string" ? state.parentRegion : region;
11153
+ let parent;
11154
+ try {
11155
+ parent = await stateBackend.getState(parentName, parentRegion, { readOnly: true });
11156
+ } catch (error) {
11157
+ noteUnreadableAncestor(parentName, parentRegion, `it could not be read (${describeAwsFailure(error).detail})`);
11158
+ return inheritProducerRegions(own, void 0);
11159
+ }
11160
+ if (!parent || parent.divergentBodyRegion !== void 0 || typeof parent.state !== "object" || parent.state === null) {
11161
+ noteUnreadableAncestor(parentName, parentRegion, "it has no usable state record");
11162
+ return inheritProducerRegions(own, void 0);
11163
+ }
11164
+ const inherited = await driftProducerRegionEvidence(parent.state, parentName, parentRegion, stateBackend, depth + 1);
11165
+ return inheritProducerRegions(own, inherited);
11166
+ }
11167
+ async function resolveDriftLeafByRegion(leaf, propertyPath, logicalId, consumerRegion, producerRegions, resolvers, ctx, recordedRegions) {
11168
+ const verdicts = dynamicReferenceTokens(leaf).map((token) => [token, classifyRecordedSecretRegion(token, consumerRegion, producerRegions, recordedRegions)]);
11169
+ for (const [, verdict] of verdicts) if (verdict.kind === "ambiguous") throw regionAmbiguousDriftSecretError(logicalId, propertyPath, verdict.secretName, verdict.foreignProducerRegions, consumerRegion);
11170
+ if (!verdicts.some(([, verdict]) => verdict.kind === "named-region" || verdict.kind === "recorded-region")) return await resolveDynamicReferences(resolvers.primary, leaf, ctx);
11171
+ let out = "";
11172
+ let cursor = 0;
11173
+ for (const [token, verdict] of verdicts) {
11174
+ const at = leaf.indexOf(token, cursor);
11175
+ if (at < 0) throw new DriftSecretRefusalError(`${logicalId}${propertyPath === "" ? "" : ` property '${propertyPath}'`}: could not locate a scanned dynamic reference in the value it was scanned from. Refusing rather than resolving it in '${consumerRegion}', which would be the wrong region for a reference that names another one. This is an internal invariant failure — please report it with the resource type and property path.`, "DRIFT_SECRET_TOKEN_SCAN_MISMATCH");
11176
+ out += leaf.slice(cursor, at);
11177
+ const resolver = verdict.kind === "named-region" ? resolvers.forRegion(verdict.region) : verdict.kind === "recorded-region" ? resolvers.forRecordedRegion(verdict.region) : resolvers.primary;
11178
+ out += await resolveDynamicReferences(resolver, token, ctx);
11179
+ cursor = at + token.length;
11180
+ }
11181
+ return out + leaf.slice(cursor);
11182
+ }
11183
+ async function resolveStateSecretExpressions(props, resolvers, secrets, options) {
11184
+ if (!containsDynamicReference$1(props)) return props;
11185
+ const { secretPaths, onUnresolved, producerRegions, logicalId, consumerRegion } = options;
11186
+ const recordedRegions = recordedReferenceRegions(options.record);
11187
+ const ctx = {
11188
+ template: { Resources: {} },
11189
+ resources: {},
11190
+ recordedSecretValues: secrets
11191
+ };
11192
+ const walk = async (v, path) => {
11193
+ if (typeof v === "string") {
11194
+ if (!v.includes("{{resolve:")) return v;
11195
+ refuseUnprovenDriftSecret(v, path, logicalId, consumerRegion, producerRegions, recordedRegions);
11196
+ const resolved = await resolveDriftLeafByRegion(v, path, logicalId, consumerRegion, producerRegions.regions, resolvers, ctx, recordedRegions);
11197
+ const survivors = survivingDynamicReferences(resolved).filter((t) => v.includes(t));
11198
+ if (survivors.length > 0) onUnresolved?.(survivors, path);
11199
+ if (carriesRecordedSecret(resolved, secrets)) secretPaths?.add(path);
11200
+ return resolved;
11201
+ }
11202
+ if (Array.isArray(v)) {
11203
+ const out = new Array(v.length);
11204
+ for (let i = 0; i < v.length; i++) out[i] = await walk(v[i], path === "" ? String(i) : `${path}.${i}`);
11205
+ return out;
11206
+ }
11207
+ if (v !== null && typeof v === "object") {
11208
+ const out = Object.create(null);
11209
+ for (const [k, val] of Object.entries(v)) out[k] = await walk(val, path === "" ? k : `${path}.${k}`);
11210
+ return out;
11211
+ }
11212
+ return v;
11213
+ };
11214
+ return await walk(props, "");
11215
+ }
11216
+
11217
+ // src/cli/commands/refused-baseline-remedy.ts
11218
+ function acceptRefusedRemedy() {
11219
+ return `Once the deployed template no longer reads a parameter at this resource, ${pasteableCommand("cdkd state refresh-observed", [
11220
+ { hole: "stack" },
11221
+ {
11222
+ flag: "--accept-refused",
11223
+ hole: "logicalId"
11224
+ },
11225
+ {
11226
+ flag: "--template",
11227
+ hole: "file"
11228
+ }
11229
+ ]).command} records a baseline on your assertion that AWS holds no secret the template does not spell as a dynamic reference.`;
11230
+ }
11231
+ function refusedBaselineRemedy(record) {
11232
+ if (hasUnverifiableParameterRefusal(record)) return "Deploying a change does NOT clear this refusal: the resource reads a template parameter whose deployed value cdkd could not prove, so only a deploy that replaces the resource, or a re-import while a CloudFormation stack can prove that value, restores a baseline. " + acceptRefusedRemedy();
11233
+ if (hasReasonlessBaselineRefusal(record)) return "This refusal was recorded without a reason this cdkd recognizes: a deploy that actually CHANGES this resource restores a baseline unless the resource reads a template parameter, and then only a deploy that replaces the resource, or a re-import while a CloudFormation stack can prove the parameter's deployed value, does. " + acceptRefusedRemedy();
11234
+ }
11235
+
11236
+ // src/cli/commands/drift/redaction.ts
11237
+ function noEchoPathsClause(record) {
11238
+ const marked = record === void 0 ? void 0 : noEchoLeavesOf(record);
11239
+ if (marked === void 0 || marked.length === 0) return "";
11240
+ return ` at ${marked.map((coordinate) => coordinate.map((segment, i) => typeof segment === "number" ? `[${segment}]` : i === 0 ? segment : `.${segment}`).join("")).map((path) => displaySafe(path)).join(", ")}`;
11241
+ }
11242
+ function revertPathSegments(path) {
11243
+ const segments = [];
11244
+ for (const part of path.split(".")) {
11245
+ const match = /^([^[]*)((?:\[\d+\])*)$/.exec(part);
11246
+ if (match === null) {
11247
+ segments.push(part);
11248
+ continue;
11249
+ }
11250
+ if (match[1] !== "") segments.push(match[1]);
11251
+ for (const index of match[2].matchAll(/\[(\d+)\]/g)) segments.push(Number(index[1]));
11252
+ }
11253
+ return segments;
11254
+ }
11255
+ function partitionNoEchoParameterChanges(changes, record, baseline) {
11256
+ const marked = noEchoLeavesOf(record);
11257
+ if (marked === void 0 || marked.length === 0) return {
11258
+ kept: changes,
11259
+ noEchoParameterPaths: []
11260
+ };
11261
+ const properties = record.properties ?? {};
11262
+ const isMarked = (coordinate) => isMarkedCoordinate(coordinate, marked) || marked.some((leaf) => leaf.length > coordinate.length && coordinate.every((segment, i) => String(segment) === String(leaf[i])));
11263
+ const isWithinMarked = (coordinate) => marked.some((leaf) => leaf.length <= coordinate.length && leaf.every((segment, i) => String(segment) === String(coordinate[i])));
11264
+ const kept = [];
11265
+ const noEchoParameterPaths = [];
11266
+ for (const change of changes) {
11267
+ const coordinate = change.path.split(".");
11268
+ if (marked.some((leaf) => {
11269
+ const n = Math.min(leaf.length, coordinate.length);
11270
+ for (let i = 0; i < n; i++) if (leaf[i] !== coordinate[i]) return false;
11271
+ return true;
11272
+ }) && carriesSecretMask(change.stateValue) && !pathCrossesDottedKey(properties, change.path) && !pathCrossesDottedKey(baseline, change.path) && equalModuloMarkedMask(change.stateValue, change.awsValue, "***", coordinate, isMarked, isWithinMarked)) {
11273
+ noEchoParameterPaths.push(change.path);
11274
+ continue;
11275
+ }
11276
+ kept.push(change);
11277
+ }
11278
+ return {
11279
+ kept,
11280
+ noEchoParameterPaths
11281
+ };
11282
+ }
11283
+ function partitionUncertifiedBaselineChanges(changes, properties, baseline) {
11284
+ const kept = [];
11285
+ const uncertifiedPaths = [];
11286
+ for (const change of changes) {
11287
+ if (carriesSecretMask(change.stateValue) && isUncertifiedBaselineMaskPosition(properties, change.path) && !pathCrossesDottedKey(baseline, change.path) && equalModuloMask(change.stateValue, change.awsValue, "***")) {
11288
+ uncertifiedPaths.push(change.path);
11289
+ continue;
11290
+ }
11291
+ kept.push(change);
11292
+ }
11293
+ return {
11294
+ kept,
11295
+ uncertifiedPaths
11296
+ };
11297
+ }
11298
+ function isSecretBearingPath(path, secretPaths) {
11299
+ if (secretPaths.size === 0) return false;
11300
+ for (const secretPath of secretPaths) if (secretPath === path || secretPath.startsWith(`${path}.`) || path.startsWith(`${secretPath}.`)) return true;
11301
+ return false;
11302
+ }
11303
+ function redactDriftValue(value, secrets, secretBearing) {
11304
+ const redacted = redactForState(value, {
11305
+ provenance: "value-scan",
11306
+ secrets
11307
+ });
11308
+ if (!secretBearing) return redacted;
11309
+ if (redacted === void 0 || redacted === null) return redacted;
11310
+ if (typeof redacted === "string" && isSingleDynamicReferenceToken(redacted)) return redacted;
11311
+ return "***";
11312
+ }
11313
+ function acceptRefusalReason(change, maskedPaths) {
11314
+ if (!maskedPaths.has(change.path)) return void 0;
11315
+ if (change.path.includes("***")) return "its property NAME came back carrying a secret value, so cdkd cannot name the key to write — and no redaction pass can clear it either, since they all walk values and never keys. ROTATE the secret; that is the only remedy";
11316
+ if (change.awsValue === void 0) return "AWS no longer reports it, and accepting an absence DELETES the key — which at or above a secret dynamic reference would erase the reference out of cdkd state. Use --revert to push it back, or re-deploy";
11317
+ if (change.stateValue === "***") return "the value that belongs at this position is unknown to cdkd — the baseline holds only the redaction mask, so accepting would write AWS-held plaintext over a deliberate redaction. Where cdkd wrote that mask because it could not pair the readback with a secret reference, a deploy that CHANGES this resource re-captures the baseline, and a deploy that changes nothing replaces the mask only when the resource still reads back as its baseline records, the resource's own secret reference resolves to the value AWS holds there, and nothing in the resource's recorded properties is masked. Where the mask stands for a NoEcho custom-resource value or for the Fn::Base64 encoding of a secret value, cdkd never records the value, so no deploy replaces the mask";
11318
+ return "it carries a secret dynamic reference and the value AWS currently holds is not the one the reference resolves to";
11319
+ }
11320
+ function redactDriftChanges(changes, secrets, secretPaths, maskPaths) {
11321
+ if (!hasMaskableValues(secrets) && secretPaths.size === 0 && maskPaths.size === 0 && !changes.some((change) => carriesSecretMask(change.stateValue))) return {
11322
+ changes,
11323
+ maskedPaths: /* @__PURE__ */ new Set()
11324
+ };
11325
+ const maskedPaths = /* @__PURE__ */ new Set();
11326
+ const redacted = [];
11327
+ for (const change of changes) {
11328
+ const maskedPath = maskSecretsInText(change.path, secrets);
11329
+ const positionIsSecret = isSecretBearingPath(change.path, secretPaths) || isSecretBearingPath(change.path, maskPaths);
11330
+ const nameCarriesSecret = maskedPath !== change.path;
11331
+ const stateValueIsMask = carriesSecretMask(change.stateValue);
11332
+ const secretBearing = positionIsSecret || nameCarriesSecret || stateValueIsMask;
11333
+ if (secretPaths.has(change.path) && change.awsValue === void 0) continue;
11334
+ const stateValue = redactDriftValue(change.stateValue, secrets, secretBearing);
11335
+ const awsValue = redactDriftValue(change.awsValue, secrets, secretBearing);
11336
+ if (maskedPath !== change.path || secretBearing && awsValue === "***" || secretBearing && change.awsValue === void 0) maskedPaths.add(maskedPath);
11337
+ redacted.push({
11338
+ path: maskedPath,
11339
+ stateValue,
11340
+ awsValue
11341
+ });
11342
+ }
11343
+ return {
11344
+ changes: redacted,
11345
+ maskedPaths
11346
+ };
11347
+ }
11348
+ function maskMarkedNoEchoBaseline(baseline, record, observed) {
11349
+ const marked = noEchoLeavesOf(record) ?? [];
11350
+ if (observed) {
11351
+ const coordinates = [...marked, ...maskedLeafCoordinatesOf(record.properties ?? {})];
11352
+ return coordinates.length === 0 ? baseline : maskReadbackAtCoordinates(baseline, record.properties ?? {}, coordinates);
11353
+ }
11354
+ if (marked.length === 0) return baseline;
11355
+ const recorded = record.properties ?? {};
11356
+ const listPathOf = (coordinate) => {
11357
+ const list = coordinate.findIndex((segment) => typeof segment === "number");
11358
+ return list < 0 ? void 0 : coordinate.slice(0, list);
11359
+ };
11360
+ const replaced = marked.filter((coordinate) => {
11361
+ const path = listPathOf(coordinate);
11362
+ if (path === void 0) return false;
11363
+ const underList = marked.filter((other) => other.length > path.length && path.every((segment, i) => segment === other[i]));
11364
+ return JSON.stringify(valueAtCoordinate(maskAtCoordinates(baseline, underList), path)) !== JSON.stringify(valueAtCoordinate(maskAtCoordinates(recorded, underList), path));
11365
+ });
11366
+ const byIndex = maskAtCoordinates(baseline, marked.filter((coordinate) => !replaced.includes(coordinate)));
11367
+ if (replaced.length === 0) return byIndex;
11368
+ return maskReadbackAtCoordinates(byIndex, recorded, replaced);
11369
+ }
11370
+
11371
+ // src/cli/commands/drift/read-failure.ts
11372
+ function notComparedReason(cause, record) {
11373
+ const refusedRemedy = cause === "baselineRefused" ? refusedBaselineRemedy(record) : void 0;
11374
+ return {
11375
+ refused: "cdkd refused to resolve a dynamic reference its state records (spell the reference as a full ARN, which names its region)",
11376
+ unresolvedToken: "its state records a `{{resolve:...}}` spelling cdkd resolves for nobody (permanent; a re-run cannot clear it)",
11377
+ readFailed: "the read or comparison threw, so NONE of its properties were compared",
11378
+ readAborted: `cdkd never read it: ${5} reads in a row earlier in this stack, the same way it would have been read, failed — expired credentials, a revoked role, a permission all of them need, or a burst of throttling — so cdkd stopped reading that way (fix the cause, or re-run if it was throttling)`,
11379
+ unreadableRecord: "its state record is not readable as a resource — not an object, carrying no resource type, or holding a 'properties' map that is not an object — so there was nothing to compare (repair or re-import the record)",
11380
+ unreadableMap: "the record's whole 'resources' map is not a JSON object, so no resource in it could be read or compared (repair or re-import the record)",
11381
+ baselineRefused: "a `cdkd import` run refused to capture its observed baseline, so the only baseline available is the recorded properties that refusal already found untrustworthy" + (refusedRemedy === void 0 ? " (deploy a change to this resource to restore one)" : `. ${refusedRemedy}`),
11382
+ noEchoParameter: `its state holds a NoEcho parameter's value only as the redaction mask${noEchoPathsClause(record)}, so that value was not compared — every other property was (permanent by design; a deploy compares it with AWS)`,
11383
+ uncertifiedBaseline: "its recorded baseline holds the redaction mask at a position cdkd could not pair with the secret reference there, so that position was not compared — every other property was (deploy a change to this resource to re-capture the baseline)"
11384
+ }[cause];
11385
+ }
11386
+ const DRIFT_READ_FAILURE_BREAKER_THRESHOLD = 5;
11387
+ const DRIFT_READ_PATH_LABELS = {
11388
+ provider: "through cdkd's own (SDK) resource providers",
11389
+ ccApi: "through the Cloud Control API"
11390
+ };
11391
+ const NO_READ_HANDLER_NAMES = /* @__PURE__ */ new Set(["UnsupportedActionException", "TypeNotFoundException"]);
11392
+ const NO_READ_HANDLER_MESSAGE = /does not support READ action/i;
11393
+ function isNoReadHandlerError(err) {
11203
11394
  try {
11204
- const { p, f, t } = JSON.parse(key);
11205
- return JSON.stringify([
11206
- p,
11207
- f,
11208
- t
11209
- ]);
11395
+ let current = err;
11396
+ for (let depth = 0; depth < 10 && current !== null && current !== void 0; depth += 1) {
11397
+ const candidate = current;
11398
+ if (typeof candidate.name === "string" && NO_READ_HANDLER_NAMES.has(candidate.name)) return true;
11399
+ if (typeof candidate.message === "string" && NO_READ_HANDLER_MESSAGE.test(candidate.message)) return true;
11400
+ current = candidate.cause;
11401
+ }
11210
11402
  } catch {
11211
- return;
11403
+ return false;
11212
11404
  }
11405
+ return false;
11213
11406
  }
11214
- function sgRuleIsRemoved(rule, gone, direction) {
11215
- if (gone.size === 0 || typeof rule !== "object" || rule === null) return false;
11216
- const key = sgRemovalRuleKey(rule, direction);
11217
- return key !== void 0 && gone.has(key);
11218
- }
11219
- function declaredSgRulesRead(value, declared, direction) {
11220
- if (!Array.isArray(value)) return false;
11221
- const have = value.map((rule) => typeof rule === "object" && rule !== null ? sgSettleRuleKey(rule, direction) : void 0);
11222
- for (const rule of declared) {
11223
- if (typeof rule !== "object" || rule === null) continue;
11224
- const key = sgSettleRuleKey(rule, direction);
11225
- if (key === void 0) continue;
11226
- const index = have.indexOf(key);
11227
- if (index < 0) return false;
11228
- have.splice(index, 1);
11407
+
11408
+ // src/analyzer/drift-protocol-normalize.ts
11409
+ const IP_PROTOCOL_PATHS = /* @__PURE__ */ new Map([
11410
+ ["AWS::EC2::SecurityGroupIngress", ["IpProtocol"]],
11411
+ ["AWS::EC2::SecurityGroupEgress", ["IpProtocol"]],
11412
+ ["AWS::EC2::SecurityGroup", ["SecurityGroupIngress[].IpProtocol", "SecurityGroupEgress[].IpProtocol"]]
11413
+ ]);
11414
+ function rewriteAtPath(properties, path) {
11415
+ if (properties === null || typeof properties !== "object" || Array.isArray(properties)) return properties;
11416
+ const bag = properties;
11417
+ const arrayMarker = path.indexOf("[].");
11418
+ if (arrayMarker === -1) {
11419
+ if (!(path in bag)) return properties;
11420
+ const next = canonicalizeIpProtocolValue(bag[path]);
11421
+ if (next === bag[path]) return properties;
11422
+ return {
11423
+ ...bag,
11424
+ [path]: next
11425
+ };
11229
11426
  }
11230
- return true;
11231
- }
11232
- function sgRulesAreDeclared(live, declared, direction) {
11233
- if (!Array.isArray(live) || !Array.isArray(declared)) return false;
11234
- const keys = (rules) => {
11235
- const out = /* @__PURE__ */ new Set();
11236
- for (const rule of rules) {
11237
- const key = typeof rule === "object" && rule !== null ? sgSettleRuleKey(rule, direction) : void 0;
11238
- if (key === void 0) return void 0;
11239
- out.add(key);
11240
- }
11241
- return out;
11427
+ const arrayKey = path.slice(0, arrayMarker);
11428
+ const elementKey = path.slice(arrayMarker + 3);
11429
+ const list = bag[arrayKey];
11430
+ if (!Array.isArray(list)) return properties;
11431
+ let changed = false;
11432
+ const mapped = list.map((element) => {
11433
+ if (element === null || typeof element !== "object" || Array.isArray(element)) return element;
11434
+ const rule = element;
11435
+ if (!(elementKey in rule)) return element;
11436
+ const next = canonicalizeIpProtocolValue(rule[elementKey]);
11437
+ if (next === rule[elementKey]) return element;
11438
+ changed = true;
11439
+ return {
11440
+ ...rule,
11441
+ [elementKey]: next
11442
+ };
11443
+ });
11444
+ if (!changed) return properties;
11445
+ return {
11446
+ ...bag,
11447
+ [arrayKey]: mapped
11242
11448
  };
11243
- const have = keys(live);
11244
- const want = keys(declared);
11245
- return have !== void 0 && want !== void 0 && have.size === want.size && [...want].every((key) => have.has(key));
11246
11449
  }
11247
- function sgRuleReadbackShape(rule, direction) {
11248
- if (rule["IpProtocol"] === void 0 || rule["IpProtocol"] === null || rule["IpProtocol"] === "") return;
11249
- if (sgSettleRuleKey(rule, direction) === void 0) return void 0;
11250
- const out = {};
11251
- for (const [key, value] of Object.entries(rule)) {
11252
- if (value === void 0 || value === null || value === "") continue;
11253
- out[key] = value;
11450
+ function canonicalizeIpProtocols(baseline, aws, resourceType) {
11451
+ const paths = IP_PROTOCOL_PATHS.get(resourceType);
11452
+ if (paths === void 0) return {
11453
+ baseline,
11454
+ aws
11455
+ };
11456
+ let nextBaseline = baseline;
11457
+ let nextAws = aws;
11458
+ for (const path of paths) {
11459
+ nextBaseline = rewriteAtPath(nextBaseline, path);
11460
+ nextAws = rewriteAtPath(nextAws, path);
11254
11461
  }
11255
- const protocol = sgProtocolKey(rule["IpProtocol"]);
11256
- out["IpProtocol"] = protocol;
11257
- if (protocol === "-1") {
11258
- delete out["FromPort"];
11259
- delete out["ToPort"];
11260
- } else for (const key of ["FromPort", "ToPort"]) if (out[key] !== void 0) out[key] = cfnIngressPortValue(out[key]);
11261
- return out;
11262
- }
11263
- function mergeDeclaredSgRules(read, declared, direction) {
11264
- const keyOf = (rule) => typeof rule === "object" && rule !== null ? sgSettleRuleKey(rule, direction) : void 0;
11265
- return mergeDeclaredEntries(read, declared, (entry, want) => {
11266
- const key = keyOf(want);
11267
- return key !== void 0 && keyOf(entry) === key;
11268
- }, (want) => typeof want === "object" && want !== null ? sgRuleReadbackShape(want, direction) : void 0);
11269
- }
11270
- function sgRuleListMember(key, direction, declared, revoked, reorder, read) {
11271
- const gone = sgRemovedNotDeclared(revoked, declared, direction);
11272
11462
  return {
11273
- key,
11274
- declared,
11275
- matches: (value) => declaredSgRulesRead(value, declared, direction) && !value.some((rule) => sgRuleIsRemoved(rule, gone, direction)),
11276
- whenUnsettled: (newest) => reorder(mergeDeclaredSgRules(newest, declared, direction).filter((rule) => !sgRuleIsRemoved(rule, gone, direction))),
11277
- read
11463
+ baseline: nextBaseline,
11464
+ aws: nextAws
11278
11465
  };
11279
11466
  }
11280
11467
 
11281
- // src/provisioning/providers/iam-policy/agreeing-copies.ts
11282
- const readsWithAgreeingCopies = /* @__PURE__ */ new WeakSet();
11283
- function markCopiesAgreed(read) {
11284
- readsWithAgreeingCopies.add(read);
11285
- }
11286
- function readHadAgreeingCopies(read) {
11287
- return readsWithAgreeingCopies.has(read);
11288
- }
11289
-
11290
- // src/cli/commands/drift/baseline-keys.ts
11291
- const UNDECLARED_UNCOMPARED_KEYS = {
11292
- "AWS::S3::Bucket": ["NotificationConfiguration"],
11293
- "AWS::Events::EventBus": ["Policy"],
11294
- "AWS::IAM::ManagedPolicy": [
11295
- "Groups",
11296
- "Roles",
11297
- "Users"
11468
+ // src/analyzer/drift-undeclared-grants.ts
11469
+ const UNDECLARED_GRANT_KEYS = {
11470
+ "AWS::IAM::Role": [
11471
+ "ManagedPolicyArns",
11472
+ "PermissionsBoundary",
11473
+ "Policies"
11298
11474
  ],
11299
- "AWS::EC2::Instance": ["BlockDeviceMappings"]
11300
- };
11301
- const UNDECLARED_EMPTY_COMPARED_KEYS = {
11302
- "AWS::BedrockAgentCore::Runtime": [
11303
- "FilesystemConfigurations",
11304
- "HooksConfiguration",
11305
- "RequestHeaderConfiguration",
11306
- "ResourceConfigurations"
11475
+ "AWS::IAM::User": [
11476
+ "Groups",
11477
+ "ManagedPolicyArns",
11478
+ "PermissionsBoundary",
11479
+ "Policies"
11307
11480
  ],
11308
- "AWS::IAM::User": ["LoginProfile"]
11481
+ "AWS::IAM::Group": ["ManagedPolicyArns", "Policies"]
11309
11482
  };
11310
- function undeclaredEmptyComparedDriftKeys(resourceType) {
11311
- return hasOwnKey(UNDECLARED_EMPTY_COMPARED_KEYS, resourceType) ? UNDECLARED_EMPTY_COMPARED_KEYS[resourceType] : [];
11483
+ const BOUNDARY_KEY = "PermissionsBoundary";
11484
+ const NONE = [];
11485
+ function isPlainRecord$3(value) {
11486
+ return typeof value === "object" && value !== null && !Array.isArray(value);
11312
11487
  }
11313
- function undeclaredUncomparedDriftKeys(resourceType, properties) {
11314
- const keys = hasOwnKey(UNDECLARED_UNCOMPARED_KEYS, resourceType) ? UNDECLARED_UNCOMPARED_KEYS[resourceType] : [];
11315
- if (keys.length === 0) return [];
11316
- if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return [];
11317
- return keys.filter((key) => !hasOwnKey(properties, key));
11488
+ function undeclaredGrantDriftKeys(resourceType, properties) {
11489
+ if (!hasOwnKey(UNDECLARED_GRANT_KEYS, resourceType)) return NONE;
11490
+ if (!isPlainRecord$3(properties)) return NONE;
11491
+ return UNDECLARED_GRANT_KEYS[resourceType].filter((key) => !hasOwnKey(properties, key));
11318
11492
  }
11319
- function preFixBaselineUncomparedDriftKeys(resourceType, observed, properties, aws) {
11320
- if (observed === void 0) return [];
11321
- return preFixBaselineKeys(resourceType, observed, properties, aws).filter((key) => !(holdsPrincipalForm({ [key]: observed[key] }, "uniqueIds") && holdsPrincipalForm({ [key]: aws[key] }, "arns")));
11493
+ function isUndeclaredGrantScalarKey(key) {
11494
+ return key === BOUNDARY_KEY;
11322
11495
  }
11323
- function preFixBaselineKeys(resourceType, observed, properties, aws) {
11324
- if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return [];
11325
- if (resourceType === "AWS::DynamoDB::Table") {
11326
- const bag = properties;
11327
- return [...staleTablePolicyBaseline(observed, bag, aws) ? ["ResourcePolicy"] : [], ...tagsHeal.liveIsDeclared(bag, aws) ? [tagsHeal.key] : []];
11328
- }
11329
- if (resourceType === "AWS::SQS::QueuePolicy" || resourceType === "AWS::SNS::TopicPolicy") {
11330
- const declared = declaredPolicyDocument(properties);
11331
- return declared !== void 0 && policyDocumentMatchesDeclared(aws["PolicyDocument"], declared) && !policyDocumentMatchesDeclared(observed["PolicyDocument"], declared) ? ["PolicyDocument"] : [];
11332
- }
11333
- if (resourceType === "AWS::Lambda::Permission") {
11334
- const declared = properties;
11335
- return lambdaPermissionMatchesDeclared(aws, declared) && !lambdaPermissionMatchesDeclared(observed, declared) ? [...LAMBDA_PERMISSION_STATEMENT_KEYS] : [];
11496
+ function grantMemberIdentity(key, member) {
11497
+ if (key === "Policies") {
11498
+ const name = isPlainRecord$3(member) ? member["PolicyName"] : void 0;
11499
+ return typeof name === "string" ? name : void 0;
11336
11500
  }
11337
- const members = OWN_WRITE_MEMBERS.get(resourceType);
11338
- if (members !== void 0) return members.filter((member) => member.liveIsDeclared(properties, aws)).map((member) => member.key);
11339
- if (resourceType !== "AWS::Lambda::EventSourceMapping") return [];
11340
- const declared = hasOwnKey(properties, "Enabled") ? coerceCfnBoolean(properties["Enabled"]) : void 0;
11341
- const recorded = hasOwnKey(observed, "Enabled") ? coerceCfnBoolean(observed["Enabled"]) : void 0;
11342
- const live = hasOwnKey(aws, "Enabled") ? aws["Enabled"] : void 0;
11343
- return recorded === false && declared !== false && live === true ? ["Enabled"] : [];
11501
+ if (typeof member !== "string") return void 0;
11502
+ return key === "Groups" ? member.toLowerCase() : member;
11344
11503
  }
11345
- const documentHeal = (key) => ({
11346
- key,
11347
- liveIsDeclared: (properties, aws) => {
11348
- const declared = declaredMemberDocument(properties[key]);
11349
- return declared !== void 0 && policyDocumentMatchesDeclared(aws[key], declared);
11350
- }
11351
- });
11352
- const stringListHeal = (key) => ({
11353
- key,
11354
- liveIsDeclared: (properties, aws) => {
11355
- const declared = declaredStringList(properties[key]);
11356
- return declared !== void 0 && stringListIsDeclared(aws[key], declared);
11357
- }
11358
- });
11359
- const boundaryHeal = {
11360
- key: "PermissionsBoundary",
11361
- liveIsDeclared: (properties, aws) => typeof properties["PermissionsBoundary"] === "string" && properties["PermissionsBoundary"] !== "" && aws["PermissionsBoundary"] === properties["PermissionsBoundary"]
11362
- };
11363
- const inlinePoliciesHeal = {
11364
- key: "Policies",
11365
- liveIsDeclared: (properties, aws) => {
11366
- const declared = declaredInlinePolicies(properties["Policies"]);
11367
- return declared !== void 0 && inlinePoliciesAreDeclared(aws["Policies"], declared);
11368
- }
11369
- };
11370
- const sgRulesHeal = (key, direction) => ({
11371
- key,
11372
- liveIsDeclared: (properties, aws) => sgRulesAreDeclared(aws[key], properties[key], direction)
11373
- });
11374
- const tagsHeal = {
11375
- key: "Tags",
11376
- liveIsDeclared: (properties, aws) => {
11377
- const declared = declaredTagsReadback(properties["Tags"]);
11378
- return declared !== void 0 && tagsMatchDeclared(aws["Tags"], declared);
11379
- }
11380
- };
11381
- const OWN_WRITE_MEMBERS = new Map(Object.entries({
11382
- "AWS::KMS::Key": [documentHeal("KeyPolicy")],
11383
- "AWS::Logs::DeliveryDestination": [{
11384
- key: "DeliveryDestinationPolicy",
11385
- liveIsDeclared: (properties, aws) => {
11386
- const inner = (block) => {
11387
- const document = typeof block === "object" && block !== null && !Array.isArray(block) ? block["DeliveryDestinationPolicy"] : void 0;
11388
- return typeof document === "object" && document !== null && !Array.isArray(document) ? document : void 0;
11389
- };
11390
- const declared = inner(properties["DeliveryDestinationPolicy"]);
11391
- if (declared === void 0) return properties["DeliveryDestinationPolicy"] === void 0 && aws["DeliveryDestinationPolicy"] === void 0;
11392
- return policyDocumentMatchesDeclared(inner(aws["DeliveryDestinationPolicy"]), declared);
11393
- }
11394
- }],
11395
- "AWS::Logs::LogGroup": [{
11396
- key: "DataProtectionPolicy",
11397
- liveIsDeclared: (properties, aws) => {
11398
- const declared = declaredMemberDocument(properties["DataProtectionPolicy"]);
11399
- if (declared === void 0) return (properties["DataProtectionPolicy"] === void 0 || properties["DataProtectionPolicy"] === "") && aws["DataProtectionPolicy"] === "";
11400
- return policyDocumentMatchesDeclared(aws["DataProtectionPolicy"], declared);
11401
- }
11402
- }],
11403
- "AWS::ApiGateway::RestApi": [documentHeal("Policy")],
11404
- "AWS::EFS::FileSystem": [{
11405
- key: "FileSystemPolicy",
11406
- liveIsDeclared: (properties, aws) => {
11407
- const declared = declaredMemberDocument(properties["FileSystemPolicy"]);
11408
- if (declared === void 0) return properties["FileSystemPolicy"] === void 0 && aws["FileSystemPolicy"] === void 0;
11409
- return efsPolicyMatchesDeclared(aws["FileSystemPolicy"], declared);
11410
- }
11411
- }],
11412
- "AWS::S3::Bucket": [{
11413
- key: "LifecycleConfiguration",
11414
- liveIsDeclared: (properties, aws) => {
11415
- const declared = declaredLifecycle(properties);
11416
- const live = aws["LifecycleConfiguration"];
11417
- if (declared === void 0 || typeof live !== "object" || live === null) return false;
11418
- const liveBag = live;
11419
- return declared.kind === "absent" ? lifecycleReadIsAbsent(liveBag) : lifecycleMatchesDeclared(liveBag, declared.expected);
11504
+ function isNoBoundary(value) {
11505
+ return value === void 0 || value === null || value === "";
11506
+ }
11507
+ function withUndeclaredGrantBaseline(baseline, aws, keys, siblingRecorded = {}) {
11508
+ let out = baseline;
11509
+ const set = (key, value) => {
11510
+ if (out === baseline) out = { ...baseline };
11511
+ defineOwnKey(out, key, value);
11512
+ };
11513
+ for (const key of keys) {
11514
+ if (!hasOwnKey(aws, key)) continue;
11515
+ if (isUndeclaredGrantScalarKey(key)) {
11516
+ if (!hasOwnKey(baseline, key)) set(key, "");
11517
+ continue;
11420
11518
  }
11421
- }],
11422
- "AWS::SecretsManager::Secret": [tagsHeal],
11423
- "AWS::CodeBuild::Project": [{
11424
- key: "Visibility",
11425
- liveIsDeclared: (properties, aws) => typeof properties["Visibility"] === "string" && properties["Visibility"] !== "" && aws["Visibility"] === properties["Visibility"]
11426
- }],
11427
- "AWS::IAM::Role": [
11428
- documentHeal("AssumeRolePolicyDocument"),
11429
- boundaryHeal,
11430
- stringListHeal("ManagedPolicyArns"),
11431
- inlinePoliciesHeal
11432
- ],
11433
- "AWS::IAM::User": [
11434
- boundaryHeal,
11435
- stringListHeal("ManagedPolicyArns"),
11436
- stringListHeal("Groups"),
11437
- inlinePoliciesHeal
11438
- ],
11439
- "AWS::IAM::Group": [stringListHeal("ManagedPolicyArns"), inlinePoliciesHeal],
11440
- "AWS::IAM::ManagedPolicy": [
11441
- documentHeal("PolicyDocument"),
11442
- stringListHeal("Roles"),
11443
- stringListHeal("Users"),
11444
- stringListHeal("Groups")
11445
- ],
11446
- "AWS::IAM::InstanceProfile": [stringListHeal("Roles")],
11447
- "AWS::IAM::Policy": [
11448
- {
11449
- key: "PolicyDocument",
11450
- liveIsDeclared: (properties, aws) => readHadAgreeingCopies(aws) && documentHeal("PolicyDocument").liveIsDeclared(properties, aws)
11451
- },
11452
- {
11453
- key: "PolicyName",
11454
- liveIsDeclared: (properties, aws) => typeof properties["PolicyName"] === "string" && properties["PolicyName"] !== "" && aws["PolicyName"] === properties["PolicyName"]
11455
- },
11456
- stringListHeal("Roles"),
11457
- stringListHeal("Users"),
11458
- stringListHeal("Groups")
11459
- ],
11460
- "AWS::S3::BucketPolicy": [{
11461
- key: "PolicyDocument",
11462
- liveIsDeclared: (properties, aws) => {
11463
- const declared = declaredPolicyDocument(properties);
11464
- return declared !== void 0 && policyDocumentMatchesDeclared(aws["PolicyDocument"], declared);
11519
+ const live = aws[key];
11520
+ if (!Array.isArray(live)) continue;
11521
+ const recorded = hasOwnKey(baseline, key) ? baseline[key] : [];
11522
+ if (!Array.isArray(recorded)) continue;
11523
+ const byId = /* @__PURE__ */ new Map();
11524
+ for (const member of [...siblingRecorded[key] ?? [], ...recorded]) {
11525
+ const id = grantMemberIdentity(key, member);
11526
+ if (id !== void 0 && !byId.has(id)) byId.set(id, member);
11465
11527
  }
11466
- }],
11467
- "AWS::Events::EventBus": [documentHeal("Policy")],
11468
- "AWS::EC2::SecurityGroup": [sgRulesHeal("SecurityGroupIngress", "ingress"), sgRulesHeal("SecurityGroupEgress", "egress")]
11469
- }));
11470
- function staleTablePolicyBaseline(observed, properties, aws) {
11471
- const recorded = readStreamPolicy(observed);
11472
- const declared = readStreamPolicy(properties);
11473
- const live = readStreamPolicy(aws);
11474
- if (recorded.kind === "usable" && declared.kind === "absent" && live.kind === "absent") return true;
11475
- return declared.kind === "usable" && live.kind === "usable" && streamPolicyMatchesDeclared(live.document, properties);
11476
- }
11477
- function readOnlyUncomparedDriftPaths(readOnlyPaths, properties) {
11478
- if (!readOnlyPaths || readOnlyPaths.length === 0) return [];
11479
- const declared = (path) => {
11480
- let node = properties;
11481
- for (const segment of path.split(".")) {
11482
- if (typeof node !== "object" || node === null || Array.isArray(node)) return false;
11483
- if (!hasOwnKey(node, segment)) return false;
11484
- node = node[segment];
11528
+ const projected = [];
11529
+ for (const member of live) {
11530
+ const id = grantMemberIdentity(key, member);
11531
+ if (id === void 0 || !byId.has(id)) continue;
11532
+ projected.push(typeof member === "string" ? member : byId.get(id));
11533
+ byId.delete(id);
11485
11534
  }
11486
- return true;
11487
- };
11488
- return readOnlyPaths.filter((path) => !declared(path));
11489
- }
11490
- const DERIVED_ECHO_MEMBERS = { "AWS::SecretsManager::RotationSchedule": [{
11491
- parent: "RotationRules",
11492
- source: "ScheduleExpression",
11493
- echo: "AutomaticallyAfterDays"
11494
- }] };
11495
- function stripDerivedEchoMembers(resourceType, bag) {
11496
- const rules = DERIVED_ECHO_MEMBERS[resourceType];
11497
- if (!rules) return bag;
11498
- let out = bag;
11499
- for (const { parent, source, echo } of rules) {
11500
- const node = hasOwnKey(out, parent) ? out[parent] : void 0;
11501
- if (typeof node !== "object" || node === null || Array.isArray(node)) continue;
11502
- const members = node;
11503
- if (!hasOwnKey(members, echo) || !hasOwnKey(members, source)) continue;
11504
- if (members[source] === void 0 || members[source] === null) continue;
11505
- const { [echo]: _echo, ...rest } = members;
11506
- out = {
11507
- ...out,
11508
- [parent]: rest
11509
- };
11535
+ if (!(hasOwnKey(baseline, key) && projected.length === recorded.length && projected.every((m, i) => m === recorded[i]))) set(key, projected);
11510
11536
  }
11511
11537
  return out;
11512
11538
  }
11513
- function otherPhysicalIds(resources, logicalId) {
11514
- const ids = [];
11515
- for (const [id, record] of Object.entries(resources ?? {})) if (id !== logicalId && typeof record?.physicalId === "string") ids.push(record.physicalId);
11516
- return ids;
11539
+ function undeclaredGrantIgnorePaths(baseline, aws, keys) {
11540
+ return keys.filter((key) => {
11541
+ if (hasOwnKey(aws, key)) return false;
11542
+ if (isUndeclaredGrantScalarKey(key)) return !hasOwnKey(baseline, key) || isNoBoundary(baseline[key]);
11543
+ return true;
11544
+ });
11517
11545
  }
11518
- function declaredEmptyProperties(properties) {
11519
- const out = /* @__PURE__ */ new Set();
11520
- if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return out;
11521
- const isEmpty = (v) => Array.isArray(v) && v.length === 0 || typeof v === "object" && v !== null && !Array.isArray(v) && Object.keys(v).length === 0;
11522
- for (const [key, value] of Object.entries(properties)) if (typeof value === "string") {
11523
- if (value.trim() === "") {
11524
- out.add(key);
11525
- continue;
11526
- }
11527
- try {
11528
- if (isEmpty(JSON.parse(value))) out.add(key);
11529
- } catch {}
11530
- } else if (isEmpty(value)) out.add(key);
11531
- return out;
11546
+ function withoutUndeclaredNoBoundary(desired, keys) {
11547
+ const absent = keys.filter((key) => isUndeclaredGrantScalarKey(key) && isNoBoundary(desired[key]));
11548
+ if (absent.length === 0) return {
11549
+ desired,
11550
+ absent
11551
+ };
11552
+ const out = { ...desired };
11553
+ for (const key of absent) delete out[key];
11554
+ return {
11555
+ desired: out,
11556
+ absent
11557
+ };
11532
11558
  }
11533
- function declaredTrueProperties(properties) {
11534
- const out = /* @__PURE__ */ new Set();
11535
- if (typeof properties !== "object" || properties === null || Array.isArray(properties)) return out;
11536
- for (const [key, value] of Object.entries(properties)) if (value === true || value === "true") out.add(key);
11559
+ function removedGrantMembers(key, awsValue, stateValue) {
11560
+ if (isUndeclaredGrantScalarKey(key)) return !isNoBoundary(awsValue) && isNoBoundary(stateValue) ? [{
11561
+ key,
11562
+ member: awsValue
11563
+ }] : [];
11564
+ if (!Array.isArray(awsValue)) return [];
11565
+ const kept = new Set((Array.isArray(stateValue) ? stateValue : []).map((m) => grantMemberIdentity(key, m)));
11566
+ const out = [];
11567
+ for (const m of awsValue) {
11568
+ const id = grantMemberIdentity(key, m);
11569
+ if (id !== void 0 && kept.has(id)) continue;
11570
+ const name = key === "Policies" && isPlainRecord$3(m) ? m["PolicyName"] : void 0;
11571
+ out.push({
11572
+ key,
11573
+ member: typeof name === "string" ? name : m
11574
+ });
11575
+ }
11537
11576
  return out;
11538
11577
  }
11539
11578
 
@@ -12563,7 +12602,7 @@ function sameRecordedJson(candidate, recorded) {
12563
12602
 
12564
12603
  // src/cli/commands/drift/compare.ts
12565
12604
  async function compareDriftReadback(args) {
12566
- const { region, resolvePrincipalUniqueId, outcomes, logger, secretResolvers, producerRegions, stackSecretNames, resource, logicalId, provider, secrets, printing, aws, readContext, readOnlyPathsLookup, notComparedPolicyArns } = args;
12605
+ const { region, resolvePrincipalUniqueId, outcomes, logger, secretResolvers, producerRegions, stackSecretNames, resource, logicalId, provider, secrets, printing, aws, readContext, readOnlyPathsLookup, writeOnlyPathsLookup, notComparedPolicyArns } = args;
12567
12606
  const ignorePaths = provider.getDriftUnknownPaths ? provider.getDriftUnknownPaths(resource.resourceType, resource.properties ?? {}) : [];
12568
12607
  const unorderedPaths = provider.getDriftUnorderedPaths ? provider.getDriftUnorderedPaths(resource.resourceType) : [];
12569
12608
  const useObserved = resource.observedProperties !== void 0;
@@ -12627,11 +12666,13 @@ async function compareDriftReadback(args) {
12627
12666
  const ownedIgnorePaths = [...undeclaredUncomparedDriftKeys(resource.resourceType, resource.properties), ...undeclaredGrantIgnorePaths(comparedBaseline, paired.aws, grantKeys)];
12628
12667
  const preFixIgnorePaths = preFixBaselineUncomparedDriftKeys(resource.resourceType, resource.observedProperties, resource.properties, aws);
12629
12668
  const readOnlyIgnorePaths = readOnlyUncomparedDriftPaths(readOnlyPathsLookup ? await readOnlyPathsLookup : void 0, resource.properties);
12669
+ const writeOnlyIgnorePaths = !useObserved && writeOnlyPathsLookup ? await writeOnlyPathsLookup ?? [] : [];
12630
12670
  const extraIgnorePaths = [
12631
12671
  ...observedIgnorePaths,
12632
12672
  ...ownedIgnorePaths,
12633
12673
  ...preFixIgnorePaths,
12634
- ...readOnlyIgnorePaths
12674
+ ...readOnlyIgnorePaths,
12675
+ ...writeOnlyIgnorePaths
12635
12676
  ];
12636
12677
  const changes = calculateResourceDrift(comparedBaseline, paired.aws, {
12637
12678
  ignorePaths: extraIgnorePaths.length ? [...ignorePaths, ...extraIgnorePaths] : ignorePaths,
@@ -12897,6 +12938,7 @@ async function runDriftForStack(stackName, region, stateBackend, providerRegistr
12897
12938
  let readReturned = false;
12898
12939
  const printing = printingBagOf(logicalId);
12899
12940
  const readOnlyPathsLookup = readPath === "ccApi" && (provider.readCurrentState !== void 0 || !CC_API_FALLBACK_DENY_LIST[resource.resourceType]) ? getReadOnlyPropertyPaths(resource.resourceType) : void 0;
12941
+ const writeOnlyPathsLookup = readOnlyPathsLookup !== void 0 && resource.observedProperties === void 0 ? writeOnlyDriftPaths(resource.resourceType) : void 0;
12900
12942
  await withPrintingSecrets(printing, async () => {
12901
12943
  try {
12902
12944
  let aws;
@@ -12960,6 +13002,7 @@ async function runDriftForStack(stackName, region, stateBackend, providerRegistr
12960
13002
  aws,
12961
13003
  readContext,
12962
13004
  ...readOnlyPathsLookup && { readOnlyPathsLookup },
13005
+ ...writeOnlyPathsLookup && { writeOnlyPathsLookup },
12963
13006
  ...notComparedPolicyArns && { notComparedPolicyArns }
12964
13007
  });
12965
13008
  } catch (err) {
@@ -13287,8 +13330,8 @@ function ingressRuleIdentity(groupId, properties) {
13287
13330
  p: sgProtocolKey(properties["IpProtocol"]),
13288
13331
  f: cfnIngressPortValue(properties["FromPort"]),
13289
13332
  t: cfnIngressPortValue(properties["ToPort"]),
13290
- c4: source("CidrIp"),
13291
- c6: source("CidrIpv6"),
13333
+ c4: sgCidrKey(source("CidrIp")),
13334
+ c6: sgCidrKey(source("CidrIpv6")),
13292
13335
  sg: source("SourceSecurityGroupId"),
13293
13336
  sgName: source("SourceSecurityGroupName"),
13294
13337
  sgOwner: source("SourceSecurityGroupOwnerId"),
@@ -13402,14 +13445,25 @@ function securityGroupRuleMatchesCfnIngress(rule, properties) {
13402
13445
  if ((rule.FromPort ?? -1) !== cfnIngressPortValue(properties["FromPort"])) return false;
13403
13446
  if ((rule.ToPort ?? -1) !== cfnIngressPortValue(properties["ToPort"])) return false;
13404
13447
  const sources = [
13405
- [properties["CidrIp"], rule.CidrIpv4],
13406
- [properties["CidrIpv6"], rule.CidrIpv6],
13448
+ [sgCidrKey(properties["CidrIp"]), sgCidrKey(rule.CidrIpv4)],
13449
+ [sgCidrKey(properties["CidrIpv6"]), sgCidrKey(rule.CidrIpv6)],
13407
13450
  [properties["SourceSecurityGroupId"], rule.ReferencedGroupInfo?.GroupId],
13408
13451
  [properties["SourcePrefixListId"], rule.PrefixListId]
13409
13452
  ];
13410
13453
  for (const [declared, actual] of sources) if (declared !== void 0 && declared !== null && declared !== actual) return false;
13411
13454
  return true;
13412
13455
  }
13456
+ function withRecordedCidrSpelling(live, recorded) {
13457
+ let out = live;
13458
+ for (const key of ["CidrIp", "CidrIpv6"]) {
13459
+ const spelled = recorded[key];
13460
+ if (typeof spelled === "string" && spelled !== out[key]) out = {
13461
+ ...out,
13462
+ [key]: spelled
13463
+ };
13464
+ }
13465
+ return out;
13466
+ }
13413
13467
  function sgRuleKey(rule, direction) {
13414
13468
  const peerKey = direction === "egress" ? rule["DestinationSecurityGroupId"] : rule["SourceSecurityGroupId"];
13415
13469
  const prefixKey = direction === "egress" ? rule["DestinationPrefixListId"] : rule["SourcePrefixListId"];
@@ -13418,8 +13472,8 @@ function sgRuleKey(rule, direction) {
13418
13472
  p: sgProtocolKey(rule["IpProtocol"]),
13419
13473
  f: rule["FromPort"] ?? null,
13420
13474
  t: rule["ToPort"] ?? null,
13421
- c4: rule["CidrIp"] ?? null,
13422
- c6: rule["CidrIpv6"] ?? null,
13475
+ c4: sgCidrKey(rule["CidrIp"]) ?? null,
13476
+ c6: sgCidrKey(rule["CidrIpv6"]) ?? null,
13423
13477
  peer: peerKey ?? null,
13424
13478
  peerOwner: peerOwner ?? null,
13425
13479
  pl: prefixKey ?? null,
@@ -13433,7 +13487,7 @@ function reconcileSgRules(awsRules, stateRules, direction) {
13433
13487
  for (const sr of stateRules) {
13434
13488
  const key = sgRuleKey(sr, direction);
13435
13489
  const idx = remaining.findIndex((ar) => sgRuleKey(ar, direction) === key);
13436
- if (idx >= 0) reordered.push(remaining.splice(idx, 1)[0]);
13490
+ if (idx >= 0) reordered.push(withRecordedCidrSpelling(remaining.splice(idx, 1)[0], sr));
13437
13491
  }
13438
13492
  return [...reordered, ...remaining];
13439
13493
  }
@@ -13557,31 +13611,6 @@ function sgRevokesHeldBySiblings(rules, groupId, toRevoke, direction, siblingIds
13557
13611
  }
13558
13612
  return held;
13559
13613
  }
13560
- function cidrKey(value) {
13561
- if (typeof value !== "string") return value;
13562
- const [address, prefix, ...rest] = value.trim().split("/");
13563
- if (address === void 0 || prefix === void 0 || rest.length > 0) return value;
13564
- const length = Number(prefix);
13565
- if (!Number.isInteger(length)) return value;
13566
- const octets = address.split(".");
13567
- if (octets.length === 4 && length >= 0 && length <= 32) {
13568
- const parts = octets.map(Number);
13569
- if (parts.some((p) => !Number.isInteger(p) || p < 0 || p > 255)) return value;
13570
- const n = parts.reduce((acc, p) => acc * 256 + p, 0);
13571
- const network = length === 0 ? 0 : n - n % 2 ** (32 - length);
13572
- return `${[
13573
- 24,
13574
- 16,
13575
- 8,
13576
- 0
13577
- ].map((shift) => Math.floor(network / 2 ** shift) % 256).join(".")}/${length}`;
13578
- }
13579
- try {
13580
- return `${new URL(`http://[${address}]`).hostname}/${length}`;
13581
- } catch {
13582
- return value;
13583
- }
13584
- }
13585
13614
  const INGRESS_IDENTITY_KEYS = [
13586
13615
  "IpProtocol",
13587
13616
  "FromPort",
@@ -13598,8 +13627,8 @@ function describedRuleMatchesRecord(rule, properties) {
13598
13627
  if ((rule.FromPort ?? -1) !== cfnIngressPortValue(properties["FromPort"])) return false;
13599
13628
  if ((rule.ToPort ?? -1) !== cfnIngressPortValue(properties["ToPort"])) return false;
13600
13629
  if ([
13601
- [cidrKey(properties["CidrIp"] ?? void 0), cidrKey(rule.CidrIpv4)],
13602
- [cidrKey(properties["CidrIpv6"] ?? void 0), cidrKey(rule.CidrIpv6)],
13630
+ [sgCidrKey(properties["CidrIp"] ?? void 0), sgCidrKey(rule.CidrIpv4)],
13631
+ [sgCidrKey(properties["CidrIpv6"] ?? void 0), sgCidrKey(rule.CidrIpv6)],
13603
13632
  [properties["SourceSecurityGroupId"] ?? void 0, rule.ReferencedGroupInfo?.GroupId],
13604
13633
  [properties["SourcePrefixListId"] ?? void 0, rule.PrefixListId]
13605
13634
  ].some(([declared, live]) => declared !== live)) return false;
@@ -14399,13 +14428,13 @@ function createIamPrincipalUniqueIdResolver(awsClients) {
14399
14428
  entityArn = user?.Arn;
14400
14429
  entityId = user?.UserId;
14401
14430
  }
14402
- if (entityArn !== void 0 && entityArn.toLowerCase() === arn.toLowerCase()) uniqueId = entityId;
14431
+ if (entityArn !== void 0 && entityArn === arn) uniqueId = entityId;
14403
14432
  else {
14404
14433
  if (!warnedOnOtherEntity) {
14405
14434
  warnedOnOtherEntity = true;
14406
- getLogger().warn("A resource policy principal ARN names another account or IAM path, so its unique id (AROA…/AIDA…) cannot be matched to it; a difference between the two spellings may be reported as drift. If the principal is the intended one, drift with --accept records the ARN form and clears " + safeMsg`it${verboseAwareText("; re-run with --verbose to see which principal", " (the principal is named in the debug output)")}.`);
14435
+ getLogger().warn("A resource policy principal ARN names another account or IAM path, or spells the name or path in another case, so its unique id (AROA…/AIDA…) cannot be matched to it; a difference between the two spellings may be reported as drift. If the principal is the intended one, drift with --accept records the ARN form and clears " + safeMsg`it${verboseAwareText("; re-run with --verbose to see which principal", " (the principal is named in the debug output)")}.`);
14407
14436
  }
14408
- getLogger().debug(`Principal ${displayIdent(arn, { maxCodePoints: 613 })} resolved to ${entityArn === void 0 ? "no entity" : displayIdent(entityArn, { maxCodePoints: 613 })} — same name in this account or under another IAM path; leaving the policy principal comparison untouched.`);
14437
+ getLogger().debug(`Principal ${displayIdent(arn, { maxCodePoints: 613 })} resolved to ${entityArn === void 0 ? "no entity" : displayIdent(entityArn, { maxCodePoints: 613 })} — same name in this account, under another IAM path or in another case; leaving the policy principal comparison untouched.`);
14409
14438
  }
14410
14439
  } catch (error) {
14411
14440
  const message = describeAwsFailure(error).detail;
@@ -15098,6 +15127,35 @@ function printDestroySummary({ result, ctx, stackName, logger, preserveState, gu
15098
15127
  }
15099
15128
  }
15100
15129
 
15130
+ // src/cli/commands/destroy-runner/protection-refusal-hint.ts
15131
+ const PROTECTION_REFUSAL_TEXT = /(?<![a-z])(?:delet(?:e|ion)[ _-]protection|termination[ _-]protect(?:ion|ed))(?![a-z])|\bprotected against deletion\b|\bdisableApiTermination\b|\bprevent-all-deletion\b/i;
15132
+ const ARN_TEXT = /\barn:\S+/g;
15133
+ const MAX_CAUSE_DEPTH = 8;
15134
+ function isAwsWrittenLink(link) {
15135
+ return isAwsAuthoredFailure(link) || link.name === "CloudControlOperationFailedError";
15136
+ }
15137
+ function isProtectionRefusal(error, physicalId) {
15138
+ let link = error;
15139
+ for (let depth = 0; depth < MAX_CAUSE_DEPTH && link instanceof Error; depth++) {
15140
+ if (isAwsWrittenLink(link)) {
15141
+ let text = link.message.replace(ARN_TEXT, " ");
15142
+ if (physicalId) {
15143
+ const own = new RegExp(`(?<![A-Za-z0-9])${escapeRegExp(physicalId)}(?![A-Za-z0-9])`, "g");
15144
+ text = text.replace(own, " ");
15145
+ }
15146
+ if (PROTECTION_REFUSAL_TEXT.test(text)) return true;
15147
+ }
15148
+ link = link.cause;
15149
+ }
15150
+ return false;
15151
+ }
15152
+ function protectionRefusalHint(error, resourceType, removeProtection, physicalId) {
15153
+ if (removeProtection === true) return void 0;
15154
+ if (!removeProtectionTypes().includes(resourceType)) return void 0;
15155
+ if (!isProtectionRefusal(error, physicalId)) return void 0;
15156
+ return "AWS refused the delete because deletion protection is on for this resource. Re-run the destroy with --remove-protection to turn it off and delete it.";
15157
+ }
15158
+
15101
15159
  // src/cli/commands/destroy-runner/delete-resource.ts
15102
15160
  async function deleteStackResource({ lock, state, ctx, stackName, logger, result, renderer, blockedBy, blockedIds, blockDependenciesOf, retainedForReadoption, startRetainedEarlierRead, skippedStateTargets, failedStateTargets, stateTargetFor, guardIndeterminateTargets, remainingResources, persistStateAfterDelete, printingBagOf, destroyProviderRegistry, destroyAwsClients, secretPrincipalRegions, secretPrincipalRegionsIncomplete }, logicalId, stackRegion) {
15103
15161
  if (lock.interrupted) return;
@@ -15353,6 +15411,8 @@ async function deleteStackResource({ lock, state, ctx, stackName, logger, result
15353
15411
  });
15354
15412
  } else {
15355
15413
  logger.error(` ✗ Failed to delete ${displaySafe(logicalId)}:`, safeStringify(error));
15414
+ const protectionHint = protectionRefusalHint(error, resource.resourceType, ctx.removeProtection, resource.physicalId);
15415
+ if (protectionHint) logger.error(safeMsg` ${protectionHint}`);
15356
15416
  result.errorCount++;
15357
15417
  failedStateTargets.add(stateTargetFor(logicalId, resource.resourceType));
15358
15418
  blockDependenciesOf(logicalId);
@@ -15958,6 +16018,7 @@ async function selectDestroyTargets(stackArgs, options, stateBackend, logger) {
15958
16018
  app: appCmd,
15959
16019
  output: options.output || "cdk.out",
15960
16020
  ...Object.keys(context).length > 0 && { context },
16021
+ ...options.lookups !== void 0 && { lookups: options.lookups },
15961
16022
  deferMacroExpansion: true,
15962
16023
  failedLookupsCheckedByCaller: true
15963
16024
  });
@@ -18085,27 +18146,6 @@ function recordedArnIdentifier(options) {
18085
18146
  }
18086
18147
  const COMPOSITE_PHYSICAL_ID_IDENTIFIER_TYPES = Object.keys(COMPOSITE_PHYSICAL_ID_IDENTIFIERS);
18087
18148
 
18088
- // src/utils/ipv4-cidr.ts
18089
- function canonicalizeIpv4Cidr(value) {
18090
- const match = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,2})$/.exec(value);
18091
- if (!match) return void 0;
18092
- const octets = [
18093
- match[1],
18094
- match[2],
18095
- match[3],
18096
- match[4]
18097
- ].map(Number);
18098
- const prefixLength = Number(match[5]);
18099
- if (prefixLength > 32 || octets.some((octet) => octet > 255)) return void 0;
18100
- const network = ((octets[0] << 24 | octets[1] << 16 | octets[2] << 8 | octets[3]) >>> 0 & (prefixLength === 0 ? 0 : 4294967295 << 32 - prefixLength >>> 0)) >>> 0;
18101
- return `${[
18102
- network >>> 24,
18103
- network >>> 16 & 255,
18104
- network >>> 8 & 255,
18105
- network & 255
18106
- ].join(".")}/${prefixLength}`;
18107
- }
18108
-
18109
18149
  // src/cli/commands/export/composite-id-shapes.ts
18110
18150
  const EIP_ALLOCATION_ID_PREFIX = "eipalloc-";
18111
18151
  const EIP_PUBLIC_IP_PATTERN = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
@@ -20368,6 +20408,7 @@ async function exportCommand(stackArg, options) {
20368
20408
  app: appCmd,
20369
20409
  output: options.output || "cdk.out",
20370
20410
  ...Object.keys(context).length > 0 && { context },
20411
+ ...options.lookups !== void 0 && { lookups: options.lookups },
20371
20412
  stateBucket,
20372
20413
  ...options.profile && { macroExpandS3ClientOpts: { profile: options.profile } },
20373
20414
  failedLookupsCheckedByCaller: true
@@ -21281,6 +21322,7 @@ async function orphanCommand(pathArgs, options) {
21281
21322
  app: appCmd,
21282
21323
  output: options.output || "cdk.out",
21283
21324
  ...Object.keys(context).length > 0 && { context },
21325
+ ...options.lookups !== void 0 && { lookups: options.lookups },
21284
21326
  stateBucket,
21285
21327
  ...options.profile && { macroExpandS3ClientOpts: { profile: options.profile } },
21286
21328
  failedLookupsCheckedByCaller: true
@@ -25853,6 +25895,7 @@ async function refactorCommand(stacks, options) {
25853
25895
  ...options.region && { region: options.region },
25854
25896
  ...options.profile && { profile: options.profile },
25855
25897
  ...Object.keys(context).length > 0 && { context },
25898
+ ...options.lookups !== void 0 && { lookups: options.lookups },
25856
25899
  stateBucket,
25857
25900
  ...options.profile && { macroExpandS3ClientOpts: { profile: options.profile } },
25858
25901
  deferMacroExpansion: true,
@@ -26130,6 +26173,7 @@ async function publishAssetsCommand(stacks, options) {
26130
26173
  ...options.region && { region: options.region },
26131
26174
  ...options.profile && { profile: options.profile },
26132
26175
  ...Object.keys(context).length > 0 && { context },
26176
+ ...options.lookups !== void 0 && { lookups: options.lookups },
26133
26177
  failedLookupsCheckedByCaller: true
26134
26178
  };
26135
26179
  const result = await synthesizer.synthesize(synthOptions);
@@ -28186,6 +28230,7 @@ async function importCommand(stackArg, options) {
28186
28230
  app: appCmd,
28187
28231
  output: options.output || "cdk.out",
28188
28232
  ...Object.keys(context).length > 0 && { context },
28233
+ ...options.lookups !== void 0 && { lookups: options.lookups },
28189
28234
  stateBucket,
28190
28235
  ...options.profile && { macroExpandS3ClientOpts: { profile: options.profile } },
28191
28236
  failedLookupsCheckedByCaller: true
@@ -33077,6 +33122,7 @@ async function localStartApiCommand(target, options) {
33077
33122
  ...options.region && { region: options.region },
33078
33123
  ...options.profile && { profile: options.profile },
33079
33124
  ...Object.keys(context).length > 0 && { context },
33125
+ ...options.lookups !== void 0 && { lookups: options.lookups },
33080
33126
  ...options.stateBucket && { stateBucket: options.stateBucket },
33081
33127
  ...options.profile && { macroExpandS3ClientOpts: { profile: options.profile } },
33082
33128
  failedLookupsCheckedByCaller: true
@@ -34957,6 +35003,7 @@ async function localRunTaskCommand(target, options) {
34957
35003
  ...options.region && { region: options.region },
34958
35004
  ...options.profile && { profile: options.profile },
34959
35005
  ...Object.keys(context).length > 0 && { context },
35006
+ ...options.lookups !== void 0 && { lookups: options.lookups },
34960
35007
  ...options.stateBucket && { stateBucket: options.stateBucket },
34961
35008
  ...options.profile && { macroExpandS3ClientOpts: { profile: options.profile } },
34962
35009
  failedLookupsCheckedByCaller: true
@@ -36241,6 +36288,7 @@ async function localInvokeAgentCoreCommand(target, options) {
36241
36288
  ...options.region && { region: options.region },
36242
36289
  ...options.profile && { profile: options.profile },
36243
36290
  ...Object.keys(context).length > 0 && { context },
36291
+ ...options.lookups !== void 0 && { lookups: options.lookups },
36244
36292
  failedLookupsCheckedByCaller: true
36245
36293
  };
36246
36294
  const { stacks, assemblyDir, failedLookups } = await synthesizer.synthesize(synthOpts);
@@ -36836,6 +36884,7 @@ async function localInvokeCommand(target, options) {
36836
36884
  ...options.region && { region: options.region },
36837
36885
  ...options.profile && { profile: options.profile },
36838
36886
  ...Object.keys(context).length > 0 && { context },
36887
+ ...options.lookups !== void 0 && { lookups: options.lookups },
36839
36888
  ...options.stateBucket && { stateBucket: options.stateBucket },
36840
36889
  ...options.profile && { macroExpandS3ClientOpts: { profile: options.profile } },
36841
36890
  failedLookupsCheckedByCaller: true
@@ -37198,5 +37247,5 @@ function collectVerbFlags(program) {
37198
37247
  return map;
37199
37248
  }
37200
37249
 
37201
- export { effectiveInventoryItem as $, tagListsMatch as A, LIFECYCLE_DEFAULT_STATUS as B, reconcileSgRules as C, singleSecurityGroupRuleId as D, sgRuleKey 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, stackIngressRuleHolder as O, LIFECYCLE_BASELINE_REREAD_DELAYS_MS as P, effectiveIntelligentTieringItem as Q, settleLifecycleRead as R, narrowIngressIpProtocol as S, securityGroupRuleMatchesCfnIngress 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, flattenIpPermissions as _, resolveSecretDerivedPrincipals as a, declaresBucketObjectLock as at, isDefaultEgressRule as b, buildProgram, readSgIngressById as c, isPlainObject as ct, SG_RULE_PAGE_SIZE$1 as d, shownLifecycleRuleId as dt, effectiveNotificationConfiguration as et, authorizeDefinitelyNotApplied as f, descriptionKey as g, comparableIngressIdentity as h, isResolvableSecretPrincipalList as i, configItemId as it, markCopiesAgreed as j, survivingRecordOfRuleId as k, siblingIdOwnedSgRules as l, manualBucketDeletionClause as lt, canonicalizeSgRuleProtocol as m, runDestroyForStack as n, caughtErrorName as nt, refuseRevertRevokingSiblingRules as o, declaresNestedObjectLock as ot, canonicalizeSgInlineRuleProtocols as p, lifecycleRuleScope as q, holdsUnprovenSecretPrincipalToken as r, coerceCfnNumber as rt, sgRuleDiffKey as s, describeValue as st, canonicalizeIpv4Cidr as t, eventBridgeEnabledOf as tt, SG_READBACK_RETRY_DELAY_MS as u, mergeLegacySingular as ut, ingressRuleIdentity as v, securityGroupReadbackDelays as w, isResendableSocketFailure as x, isConnectTimeout as y, takeLifecycleWrite as z };
37202
- //# sourceMappingURL=program-DakFqlnv.js.map
37250
+ 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 };
37251
+ //# sourceMappingURL=program-BqTL728g.js.map