@go-to-k/cdkd 0.267.7 → 0.267.9

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.
@@ -11609,7 +11609,7 @@ var CloudControlProvider = class {
11609
11609
  this.logger.debug(`Deleting resource ${logicalId} (${resourceType}), physical ID: ${physicalId}`);
11610
11610
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
11611
11611
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
11612
- const { ASGProvider } = await import("./asg-provider-D6491unb.js").then((n) => n.n);
11612
+ const { ASGProvider } = await import("./asg-provider-CyAnaKvt.js").then((n) => n.n);
11613
11613
  await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
11614
11614
  return;
11615
11615
  }
@@ -17040,6 +17040,11 @@ async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds
17040
17040
  throw new Error(`Failed to re-create the old ${op.logicalId} after the new resource (${current.physicalId}) was already deleted: ${recreateError instanceof Error ? recreateError.message : String(recreateError)}. The resource is now absent — fix forward with 'cdkd deploy'.`);
17041
17041
  }
17042
17042
  }
17043
+ const adoptedLiveNewResource = !deletedNewFirst && createResult.physicalId === current.physicalId;
17044
+ if (adoptedLiveNewResource) {
17045
+ logger.warn(` ⚠ ${op.logicalId} (${op.resourceType}): the re-create returned the LIVE new resource (${current.physicalId}) instead of re-creating the old one — its Create API is name-idempotent and the new resource still holds the same user-supplied name. Skipping the delete-new step (it would delete that very resource). The old resource's ORIGINAL properties may NOT have been re-applied; state now records the pre-replacement properties, so run 'cdkd drift ${stackName}' to inspect and 'cdkd deploy' to reconcile, or rename the resource to make the replacement reversible.`);
17046
+ result.warnings++;
17047
+ }
17043
17048
  const { observedProperties: _staleObserved, ...prevRecord } = prev;
17044
17049
  stateResources[op.logicalId] = {
17045
17050
  ...prevRecord,
@@ -17047,13 +17052,13 @@ async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds
17047
17052
  attributes: createResult.attributes ?? {}
17048
17053
  };
17049
17054
  await afterOp?.(op.logicalId);
17050
- if (!deletedNewFirst) try {
17055
+ if (!deletedNewFirst && !adoptedLiveNewResource) try {
17051
17056
  await newDeleteProvider.delete(op.logicalId, current.physicalId, op.resourceType, current.properties, { expectedRegion: ctx.region });
17052
17057
  } catch (deleteError) {
17053
17058
  logger.warn(` Rollback: old ${op.logicalId} re-created, but deleting the new resource (${current.physicalId}) failed: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}. Delete it manually — it is no longer tracked in state.`);
17054
17059
  result.warnings++;
17055
17060
  }
17056
- logger.info(` Rollback: ${op.logicalId} replacement reversed (old resource re-created as ${createResult.physicalId})`);
17061
+ logger.info(adoptedLiveNewResource ? ` Rollback: ${op.logicalId} adopted the live resource (${createResult.physicalId}) — replacement NOT fully reversed (name-idempotent Create API)` : ` Rollback: ${op.logicalId} replacement reversed (old resource re-created as ${createResult.physicalId})`);
17057
17062
  ctx.recordEvent?.({
17058
17063
  eventType: "ROLLBACK_RESOURCE_SUCCEEDED",
17059
17064
  stackName,
@@ -17312,7 +17317,7 @@ const FLUSH_INTERVAL_MS = 2e3;
17312
17317
  const FLUSH_EVENT_THRESHOLD = 50;
17313
17318
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
17314
17319
  function getCdkdVersion() {
17315
- return "0.267.7";
17320
+ return "0.267.9";
17316
17321
  }
17317
17322
  /**
17318
17323
  * Generate a time-sortable unique run id, e.g.
@@ -19318,4 +19323,4 @@ var DeployEngine = class {
19318
19323
 
19319
19324
  //#endregion
19320
19325
  export { WorkGraph as $, NestedStackChildDirectDestroyError as $t, slowCcOperationTimeoutMs as A, CFN_TEMPLATE_BODY_LIMIT as At, applyRoleArnIfSet as B, AwsClients as Bt, yellow as C, resolveAutoAssetStorage as Ct, ProviderRegistry as D, resolveStateBucketWithDefaultAndSource as Dt, clearOnUpdateRemoval as E, resolveStateBucketWithDefault as Et, refStateLookupFromResource as F, expectedOwnerParam as Ft, DagBuilder as G, CdkdError as Gt, describeTypeWithThrottleRetry as H, resetAwsClients as Ht, WAFv2WebACLProvider as I, AssemblyReader as It, S3StateBackend as J, LocalInvokeBuildError as Jt, TemplateParser as K, ConfigError as Kt, normalizeAwsTagsToCfn as L, processStackMessages as Lt, isTerminationProtectionPropagationError as M, MIGRATE_TMP_PREFIX as Mt, IntrinsicFunctionResolver as N, findLargeInlineResources as Nt, findActionableSilentDrops as O, resolveUseCdkBootstrapAssets as Ot, cfnRefValueFromPhysicalId as P, uploadCfnTemplate as Pt, stringifyValue as Q, MissingCdkCliError as Qt, resolveExplicitPhysicalId as R, clearBucketRegionCache as Rt, red as S, resolveApp as St, collectInlinePolicyNamesManagedBySiblings as T, resolveSkipPrefix as Tt, withRetry as U, setAwsClients as Ut, DiffCalculator as V, getAwsClients as Vt, isRetryableTransientError as W, AssetError as Wt, shouldRetainResource as X, LocalStartServiceError as Xt, rebuildClientForBucketRegion as Y, LocalMigrateError as Yt, AssetPublisher as Z, LockError as Zt, formatResourceLine as _, getDockerImageBySourceHash as _t, DeploymentEventsStore as a, StackTerminationProtectionError as an, BOOTSTRAP_MARKER_PREFIX as at, gray as b, getDefaultStateBucketName as bt, replayFailedOperations as c, formatError as cn, parseBootstrapMarker as ct, IMPLICIT_DELETE_DEPENDENCIES as d, withErrorHandling as dn, buildDockerImage as dt, PartialFailureError as en, buildAssetRedirectMap as et, computeImplicitDeleteEdges as f, __exportAll as fn, formatDockerLoginError as ft, renderStatefulReason as g, AssetManifestLoader as gt, isStatefulRecreateTargetSync as h, runDockerStreaming as ht, DeploymentEventsReader as i, StackHasActiveImportsError as in, AssetModeResolver as it, disableInstanceApiTermination as j, CFN_TEMPLATE_URL_LIMIT as jt, CloudControlProvider as k, warnDeprecatedNoPrefixCliFlag as kt, replayRollback as l, isCdkdError as ln, validateAssetBucketName as lt, MULTI_REGION_RECREATE_BLOCKED_TYPES as m, runDockerForeground as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, ResourceTimeoutError as nn, loadPublishableAssetManifest as nt, planFailedOps as o, StateError as on, ensureAssetStorage as ot, extractDeploymentEventError as p, getDockerCmd as pt, LockManager as q, DependencyError as qt, DeployEngine as r, ResourceUpdateNotSupportedError as rn, rewriteTemplateAssetReferences as rt, planRollback as s, SynthesisError as sn, getBootstrapMarkerKey as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, ProvisioningError as tn, createAssetRedirectResolver as tt, withResourceDeadline as u, normalizeAwsError as un, validateContainerRepoName as ut, bold as v, Synthesizer as vt, IAMRoleProvider as w, resolveCaptureObservedState as wt, green as x, getLegacyStateBucketName as xt, cyan as y, synthesisStatusMessage as yt, assertRegionMatch as z, resolveBucketRegion as zt };
19321
- //# sourceMappingURL=deploy-engine-C5ZBU7Ci.js.map
19326
+ //# sourceMappingURL=deploy-engine-CXy0AHwo.js.map