@go-to-k/cdkd 0.100.3 → 0.101.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3314,6 +3314,20 @@ const STATE_SCHEMA_VERSIONS_READABLE = [
3314
3314
  4,
3315
3315
  5
3316
3316
  ];
3317
+ /**
3318
+ * Returns true when a recorded `DeletionPolicy` should prevent cdkd from
3319
+ * deleting the underlying AWS resource. `Retain` and `RetainExceptOnCreate`
3320
+ * both keep the resource around; `Delete` / `Snapshot` / undefined all
3321
+ * fall through to the normal delete path. Shared between
3322
+ * `runDestroyForStack` (state-only, no template) and `DeployEngine`'s
3323
+ * DELETE branch (state-preferred, template-fallback) so the two paths
3324
+ * cannot drift on the policy semantics. Lives here (not in
3325
+ * deploy-engine or destroy-runner) because both consumers already
3326
+ * depend on this module — placing it in either would create a cycle.
3327
+ */
3328
+ function shouldRetainResource(deletionPolicy) {
3329
+ return deletionPolicy === "Retain" || deletionPolicy === "RetainExceptOnCreate";
3330
+ }
3317
3331
 
3318
3332
  //#endregion
3319
3333
  //#region src/state/s3-state-backend.ts
@@ -9292,8 +9306,9 @@ var DeployEngine = class {
9292
9306
  case "DELETE": {
9293
9307
  const currentResource = stateResources[logicalId];
9294
9308
  if (!currentResource) throw new Error(`Cannot delete ${logicalId}: resource not found in state`);
9295
- if (template?.Resources?.[logicalId]?.DeletionPolicy === "Retain") {
9296
- this.logger.info(`Retaining ${logicalId} (${resourceType}) - DeletionPolicy: Retain`);
9309
+ const deletionPolicy = currentResource.deletionPolicy ?? template?.Resources?.[logicalId]?.DeletionPolicy;
9310
+ if (shouldRetainResource(deletionPolicy)) {
9311
+ this.logger.info(`Retaining ${logicalId} (${resourceType}) - DeletionPolicy: ${deletionPolicy}`);
9297
9312
  delete stateResources[logicalId];
9298
9313
  break;
9299
9314
  }
@@ -9507,5 +9522,5 @@ var DeployEngine = class {
9507
9522
  };
9508
9523
 
9509
9524
  //#endregion
9510
- export { formatError as $, resolveCaptureObservedState as A, ConfigError as B, stringifyValue as C, getDefaultStateBucketName as D, Synthesizer as E, AssemblyReader as F, ProvisioningError as G, LocalInvokeBuildError as H, clearBucketRegionCache as I, RouteDiscoveryError as J, ResourceTimeoutError as K, resolveBucketRegion as L, resolveStateBucketWithDefault as M, resolveStateBucketWithDefaultAndSource as N, getLegacyStateBucketName as O, warnDeprecatedNoPrefixCliFlag as P, SynthesisError as Q, AssetError as R, AssetPublisher as S, buildDockerImage as T, LockError as U, DependencyError as V, PartialFailureError as W, StackTerminationProtectionError as X, StackHasActiveImportsError as Y, StateError as Z, DiffCalculator as _, withRetry as a, setLogger as at, LockManager as b, collectInlinePolicyNamesManagedBySiblings as c, PATTERN_B_NAME_PROPERTIES as ct, normalizeAwsTagsToCfn as d, generateResourceNameWithFallback as dt, isCdkdError as et, resolveExplicitPhysicalId as f, withSkipPrefix as ft, IntrinsicFunctionResolver as g, assertRegionMatch as h, withResourceDeadline as i, getLogger as it, resolveSkipPrefix as j, resolveApp as k, CDK_PATH_TAG as l, PATTERN_B_RESOURCE_TYPES as lt, CloudControlProvider as m, DEFAULT_RESOURCE_WARN_AFTER_MS as n, withErrorHandling as nt, IMPLICIT_DELETE_DEPENDENCIES as o, runStackBuffered as ot, ProviderRegistry as p, withStackName as pt, ResourceUpdateNotSupportedError as q, DeployEngine as r, ConsoleLogger as rt, IAMRoleProvider as s, getLiveRenderer as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, normalizeAwsError as tt, matchesCdkPath as u, generateResourceName as ut, DagBuilder as v, WorkGraph as w, S3StateBackend as x, TemplateParser as y, CdkdError as z };
9511
- //# sourceMappingURL=deploy-engine-H3Nughua.js.map
9525
+ export { SynthesisError as $, resolveApp as A, CdkdError as B, AssetPublisher as C, Synthesizer as D, buildDockerImage as E, warnDeprecatedNoPrefixCliFlag as F, PartialFailureError as G, DependencyError as H, AssemblyReader as I, ResourceUpdateNotSupportedError as J, ProvisioningError as K, clearBucketRegionCache as L, resolveSkipPrefix as M, resolveStateBucketWithDefault as N, getDefaultStateBucketName as O, resolveStateBucketWithDefaultAndSource as P, StateError as Q, resolveBucketRegion as R, shouldRetainResource as S, WorkGraph as T, LocalInvokeBuildError as U, ConfigError as V, LockError as W, StackHasActiveImportsError as X, RouteDiscoveryError as Y, StackTerminationProtectionError as Z, DiffCalculator as _, withRetry as a, getLogger as at, LockManager as b, collectInlinePolicyNamesManagedBySiblings as c, getLiveRenderer as ct, normalizeAwsTagsToCfn as d, generateResourceName as dt, formatError as et, resolveExplicitPhysicalId as f, generateResourceNameWithFallback as ft, IntrinsicFunctionResolver as g, assertRegionMatch as h, withResourceDeadline as i, ConsoleLogger as it, resolveCaptureObservedState as j, getLegacyStateBucketName as k, CDK_PATH_TAG as l, PATTERN_B_NAME_PROPERTIES as lt, CloudControlProvider as m, withStackName as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, normalizeAwsError as nt, IMPLICIT_DELETE_DEPENDENCIES as o, setLogger as ot, ProviderRegistry as p, withSkipPrefix as pt, ResourceTimeoutError as q, DeployEngine as r, withErrorHandling as rt, IAMRoleProvider as s, runStackBuffered as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, isCdkdError as tt, matchesCdkPath as u, PATTERN_B_RESOURCE_TYPES as ut, DagBuilder as v, stringifyValue as w, S3StateBackend as x, TemplateParser as y, AssetError as z };
9526
+ //# sourceMappingURL=deploy-engine-BzsWm3DG.js.map