@go-to-k/cdkd 0.147.0 → 0.147.2

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.
@@ -287,6 +287,51 @@ var StackTerminationProtectionError = class StackTerminationProtectionError exte
287
287
  }
288
288
  };
289
289
  /**
290
+ * `cdkd destroy <child>` refused because the named stack is a nested
291
+ * child of another stack. Mirrors CloudFormation's `you can't directly
292
+ * destroy a nested stack` semantic — destroying the child without
293
+ * touching the parent would leave the parent's `AWS::CloudFormation::Stack`
294
+ * record pointing at non-existent resources, and the parent's next
295
+ * deploy would silently try to re-create them.
296
+ *
297
+ * Detected by reading the loaded state's v6 `parentStack` field — only
298
+ * state files written by `NestedStackProvider.create` (or by the
299
+ * recursive `cdkd import --migrate-from-cloudformation` walk) carry
300
+ * this field; top-level stacks have `parentStack: undefined` and pass
301
+ * the guard unchanged.
302
+ *
303
+ * Fires from `cdkd destroy` AFTER state load but BEFORE lock
304
+ * acquisition or any per-resource delete, so the refusal is cheap.
305
+ * Surfaced as a per-stack failure (wrapped in {@link PartialFailureError},
306
+ * exit code 2) in multi-stack runs — siblings continue.
307
+ *
308
+ * Bypass paths (both intentional escape hatches):
309
+ *
310
+ * 1. `cdkd destroy <parent>` — the normal cascading-destroy path; the
311
+ * parent's reverse-DAG walks into the child via
312
+ * `NestedStackProvider.delete` and removes both layers atomically.
313
+ * 2. `cdkd state destroy <child>` — state-only destroy with no parent
314
+ * coupling check. The state-driven entry point intentionally
315
+ * bypasses this guard for the same reason `cdkd state destroy`
316
+ * bypasses `terminationProtection`: it's the "I know what I'm
317
+ * doing" path for cleaning up state when synth is unavailable or
318
+ * the user accepts leaving the parent's reference dangling.
319
+ */
320
+ var NestedStackChildDirectDestroyError = class NestedStackChildDirectDestroyError extends CdkdError {
321
+ stackName;
322
+ parentStack;
323
+ parentLogicalId;
324
+ constructor(stackName, parentStack, parentLogicalId, cause) {
325
+ const logicalIdSuffix = parentLogicalId ? ` (parent's logical id: ${parentLogicalId})` : "";
326
+ super(`Stack '${stackName}' is a nested child of '${parentStack}'${logicalIdSuffix}; directly destroying a nested stack is not supported. Either run 'cdkd destroy ${parentStack}' to cascade-delete this child along with its parent, or run 'cdkd state destroy ${stackName}' if you intentionally want to leave the parent's reference dangling (the state-only escape hatch).`, "NESTED_STACK_CHILD_DIRECT_DESTROY", cause);
327
+ this.stackName = stackName;
328
+ this.parentStack = parentStack;
329
+ if (parentLogicalId !== void 0) this.parentLogicalId = parentLogicalId;
330
+ this.name = "NestedStackChildDirectDestroyError";
331
+ Object.setPrototypeOf(this, NestedStackChildDirectDestroyError.prototype);
332
+ }
333
+ };
334
+ /**
290
335
  * `cdkd destroy <producer>` refused because at least one consumer stack
291
336
  * still records an `Fn::ImportValue` reference to one of the producer's
292
337
  * outputs. This matches CloudFormation's strong-reference semantics —
@@ -9924,5 +9969,5 @@ var DeployEngine = class {
9924
9969
  };
9925
9970
 
9926
9971
  //#endregion
9927
- export { ConfigError as $, AssetPublisher as A, resolveStateBucketWithDefault as B, applyRoleArnIfSet as C, LockManager as D, TemplateParser as E, getDefaultStateBucketName as F, MIGRATE_TMP_PREFIX as G, warnDeprecatedNoPrefixCliFlag as H, getLegacyStateBucketName as I, AssemblyReader as J, findLargeInlineResources as K, resolveApp as L, WorkGraph as M, buildDockerImage as N, S3StateBackend as O, Synthesizer as P, CdkdError as Q, resolveCaptureObservedState as R, IntrinsicFunctionResolver as S, DagBuilder as T, CFN_TEMPLATE_BODY_LIMIT as U, resolveStateBucketWithDefaultAndSource as V, CFN_TEMPLATE_URL_LIMIT as W, resolveBucketRegion as X, clearBucketRegionCache as Y, AssetError as Z, normalizeAwsTagsToCfn as _, normalizeAwsError as _t, withRetry as a, MissingCdkCliError as at, CloudControlProvider as b, cyan as c, ResourceTimeoutError as ct, red as d, StackHasActiveImportsError as dt, DependencyError as et, yellow as f, StackTerminationProtectionError as ft, matchesCdkPath as g, isCdkdError as gt, CDK_PATH_TAG as h, formatError as ht, withResourceDeadline as i, LockError as it, stringifyValue as j, shouldRetainResource as k, gray as l, ResourceUpdateNotSupportedError as lt, collectInlinePolicyNamesManagedBySiblings as m, SynthesisError as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, LocalMigrateError as nt, IMPLICIT_DELETE_DEPENDENCIES as o, PartialFailureError as ot, IAMRoleProvider as p, StateError as pt, uploadCfnTemplate as q, DeployEngine as r, LocalStartServiceError as rt, bold as s, ProvisioningError as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, LocalInvokeBuildError as tt, green as u, RouteDiscoveryError as ut, resolveExplicitPhysicalId as v, withErrorHandling as vt, DiffCalculator as w, assertRegionMatch as x, ProviderRegistry as y, resolveSkipPrefix as z };
9928
- //# sourceMappingURL=deploy-engine-DjnWyAAc.js.map
9972
+ export { ConfigError as $, AssetPublisher as A, resolveStateBucketWithDefault as B, applyRoleArnIfSet as C, LockManager as D, TemplateParser as E, getDefaultStateBucketName as F, MIGRATE_TMP_PREFIX as G, warnDeprecatedNoPrefixCliFlag as H, getLegacyStateBucketName as I, AssemblyReader as J, findLargeInlineResources as K, resolveApp as L, WorkGraph as M, buildDockerImage as N, S3StateBackend as O, Synthesizer as P, CdkdError as Q, resolveCaptureObservedState as R, IntrinsicFunctionResolver as S, DagBuilder as T, CFN_TEMPLATE_BODY_LIMIT as U, resolveStateBucketWithDefaultAndSource as V, CFN_TEMPLATE_URL_LIMIT as W, resolveBucketRegion as X, clearBucketRegionCache as Y, AssetError as Z, normalizeAwsTagsToCfn as _, isCdkdError as _t, withRetry as a, MissingCdkCliError as at, CloudControlProvider as b, cyan as c, ProvisioningError as ct, red as d, RouteDiscoveryError as dt, DependencyError as et, yellow as f, StackHasActiveImportsError as ft, matchesCdkPath as g, formatError as gt, CDK_PATH_TAG as h, SynthesisError as ht, withResourceDeadline as i, LockError as it, stringifyValue as j, shouldRetainResource as k, gray as l, ResourceTimeoutError as lt, collectInlinePolicyNamesManagedBySiblings as m, StateError as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, LocalMigrateError as nt, IMPLICIT_DELETE_DEPENDENCIES as o, NestedStackChildDirectDestroyError as ot, IAMRoleProvider as p, StackTerminationProtectionError as pt, uploadCfnTemplate as q, DeployEngine as r, LocalStartServiceError as rt, bold as s, PartialFailureError as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, LocalInvokeBuildError as tt, green as u, ResourceUpdateNotSupportedError as ut, resolveExplicitPhysicalId as v, normalizeAwsError as vt, DiffCalculator as w, assertRegionMatch as x, ProviderRegistry as y, withErrorHandling as yt, resolveSkipPrefix as z };
9973
+ //# sourceMappingURL=deploy-engine-CRxNgcqJ.js.map