@go-to-k/cdkd 0.278.21 → 0.278.23

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.
@@ -12429,7 +12429,7 @@ var CloudControlProvider = class {
12429
12429
  if (context?.finalSnapshotIdentifier !== void 0) throw new ProvisioningError(`${logicalId} (${resourceType}) requires a final snapshot (DeletionPolicy: Snapshot), but the Cloud Control API delete route has no final-snapshot parameter. Re-run with --skip-final-snapshot after snapshotting manually, or retain the resource.`, resourceType, logicalId, physicalId);
12430
12430
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
12431
12431
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
12432
- const { ASGProvider } = await import("./asg-provider-BN1QMZlz.js").then((n) => n.n);
12432
+ const { ASGProvider } = await import("./asg-provider-ir7DmsIU.js").then((n) => n.n);
12433
12433
  await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
12434
12434
  return;
12435
12435
  }
@@ -18368,6 +18368,39 @@ async function replayRollback(operations, stateResources, stackName, ctx, option
18368
18368
  });
18369
18369
  return result;
18370
18370
  }
18371
+ /**
18372
+ * `provider.update()` for a rollback arm, retried unless the provider opts out.
18373
+ *
18374
+ * Both rollback UPDATE arms need the same three things, and getting any of
18375
+ * them wrong is only visible on a recovery path (issue #1461):
18376
+ *
18377
+ * - **Retry.** A provider `update()` can issue reads as well as writes (Glue
18378
+ * does a pre-update `GetTable`), and the callers' best-effort catch counts
18379
+ * a transient failure as a real one and moves on, leaving state unreverted.
18380
+ * `deploy-engine.ts` and `drift.ts` have always wrapped their calls; these
18381
+ * arms did not.
18382
+ * - **`disableOuterRetry`.** `CustomResourceProvider` and
18383
+ * `NestedStackProvider` set it AND implement `update()`. Re-invoking a
18384
+ * Custom Resource derives a FRESH RequestId + pre-signed response URL, so
18385
+ * the first attempt's response lands at an S3 key nobody polls — the exact
18386
+ * hang the flag exists to prevent. Those providers retry internally.
18387
+ * - **Interrupt.** `replayRollback` polls interrupts only BETWEEN ops, so an
18388
+ * un-threaded `isInterrupted` leaves Ctrl-C dead for the length of the
18389
+ * backoff schedule (~47s) per op.
18390
+ */
18391
+ async function updateWithRollbackRetry(provider, args, logicalId, logger, isInterrupted) {
18392
+ if (provider.disableOuterRetry) {
18393
+ await provider.update(...args);
18394
+ return;
18395
+ }
18396
+ await withRetry(() => provider.update(...args), logicalId, {
18397
+ logger,
18398
+ ...isInterrupted && {
18399
+ isInterrupted,
18400
+ onInterrupted: () => /* @__PURE__ */ new Error("Rollback interrupted while retrying a resource update")
18401
+ }
18402
+ });
18403
+ }
18371
18404
  async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds, result, afterOp, isInterrupted) {
18372
18405
  const action = classifyRollbackOp(op, stateResources, orphanLogicalIds);
18373
18406
  const { logger } = ctx;
@@ -18583,6 +18616,7 @@ async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds
18583
18616
  result.warnings++;
18584
18617
  return;
18585
18618
  }
18619
+ const previousState = op.previousState;
18586
18620
  const current = stateResources[op.logicalId];
18587
18621
  if (!current) {
18588
18622
  logger.warn(` Rollback: Cannot restore ${op.logicalId} — resource not found in current state`);
@@ -18594,8 +18628,14 @@ async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds
18594
18628
  resourceType: op.resourceType,
18595
18629
  provisionedBy: op.provisionedBy
18596
18630
  });
18597
- await provider.update(op.logicalId, current.physicalId, op.resourceType, op.previousState.properties, current.properties);
18598
- stateResources[op.logicalId] = op.previousState;
18631
+ await updateWithRollbackRetry(provider, [
18632
+ op.logicalId,
18633
+ current.physicalId,
18634
+ op.resourceType,
18635
+ previousState.properties,
18636
+ current.properties
18637
+ ], op.logicalId, logger, isInterrupted);
18638
+ stateResources[op.logicalId] = previousState;
18599
18639
  logger.info(` Rollback: ${op.logicalId} restored successfully`);
18600
18640
  await afterOp?.(op.logicalId);
18601
18641
  ctx.recordEvent?.({
@@ -18724,7 +18764,13 @@ async function replayFailedOperations(failedOps, stateResources, stackName, ctx,
18724
18764
  resourceType: op.resourceType,
18725
18765
  provisionedBy: op.provisionedBy ?? current.provisionedBy
18726
18766
  });
18727
- await provider.update(op.logicalId, current.physicalId, op.resourceType, prev.properties, op.attemptedProperties ?? current.properties);
18767
+ await updateWithRollbackRetry(provider, [
18768
+ op.logicalId,
18769
+ current.physicalId,
18770
+ op.resourceType,
18771
+ prev.properties,
18772
+ op.attemptedProperties ?? current.properties
18773
+ ], op.logicalId, logger, options.isInterrupted);
18728
18774
  stateResources[op.logicalId] = prev;
18729
18775
  logger.info(` Rollback: ${op.logicalId} reverted successfully`);
18730
18776
  await options.afterOp?.(op.logicalId);
@@ -18851,7 +18897,7 @@ const FLUSH_INTERVAL_MS = 2e3;
18851
18897
  const FLUSH_EVENT_THRESHOLD = 50;
18852
18898
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
18853
18899
  function getCdkdVersion() {
18854
- return "0.278.21";
18900
+ return "0.278.23";
18855
18901
  }
18856
18902
  /**
18857
18903
  * Generate a time-sortable unique run id, e.g.
@@ -20963,4 +21009,4 @@ var DeployEngine = class {
20963
21009
 
20964
21010
  //#endregion
20965
21011
  export { isThrottlingError as $, setAwsClients as $t, red as A, getLegacyStateBucketName as At, isTerminationProtectionPropagationError as B, CFN_TEMPLATE_BODY_LIMIT as Bt, isStatefulRecreateTargetSync as C, __exportAll as Cn, runDockerForeground as Ct, cyan as D, Synthesizer as Dt, bold as E, getDockerImageBySourceHash as Et, ProviderRegistry as F, resolveStateBucketWithDefault as Ft, normalizeAwsTagsToCfn as G, expectedOwnerParam as Gt, cfnRefValueFromPhysicalId as H, MIGRATE_TMP_PREFIX as Ht, findActionableSilentDrops as I, resolveStateBucketWithDefaultAndSource as It, applyRoleArnIfSet as J, clearBucketRegionCache as Jt, resolveExplicitPhysicalId as K, AssemblyReader as Kt, CloudControlProvider as L, resolveUseCdkBootstrapAssets as Lt, IAMRoleProvider as M, resolveAutoAssetStorage as Mt, collectInlinePolicyNamesManagedBySiblings as N, resolveCaptureObservedState as Nt, gray as O, synthesisStatusMessage as Ot, clearOnUpdateRemoval as P, resolveSkipPrefix as Pt, isRetryableTransientError as Q, resetAwsClients as Qt, slowCcOperationTimeoutMs as R, stateBucketExistenceConfirmed as Rt, MULTI_REGION_RECREATE_BLOCKED_TYPES as S, withErrorHandling as Sn, getDockerCmd as St, formatResourceLine as T, AssetManifestLoader as Tt, refStateLookupFromResource as U, findLargeInlineResources as Ut, IntrinsicFunctionResolver as V, CFN_TEMPLATE_URL_LIMIT as Vt, WAFv2WebACLProvider as W, uploadCfnTemplate as Wt, describeTypeWithThrottleRetry as X, AwsClients as Xt, DiffCalculator as Y, resolveBucketRegion as Yt, withRetry as Z, getAwsClients as Zt, createPreDeleteFinalSnapshot as _, StateError as _n, parseBootstrapMarker as _t, DeploymentEventsStore as a, LocalInvokeBuildError as an, shouldRetainResource as at, unsupportedFinalSnapshotError as b, isCdkdError as bn, buildDockerImage as bt, replayFailedOperations as c, LockError as cn, WorkGraph as ct, IMPLICIT_DELETE_DEPENDENCIES as d, PartialFailureError as dn, loadPublishableAssetManifest as dt, AssetError as en, DagBuilder as et, computeImplicitDeleteEdges as f, ProvisioningError as fn, rewriteTemplateAssetReferences as ft, ccRoutedFinalSnapshotError as g, StackTerminationProtectionError as gn, getBootstrapMarkerKey as gt, buildFinalSnapshotIdentifier as h, StackHasActiveImportsError as hn, ensureAssetStorage as ht, DeploymentEventsReader as i, DeployCancelledError as in, rebuildClientForBucketRegion as it, yellow as j, resolveApp as jt, green as k, getDefaultStateBucketName as kt, replayRollback as l, MissingCdkCliError as ln, buildAssetRedirectMap as lt, PRE_DELETE_SNAPSHOT_TYPES as m, ResourceUpdateNotSupportedError as mn, BOOTSTRAP_MARKER_PREFIX as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, ConfigError as nn, LockManager as nt, planFailedOps as o, LocalMigrateError as on, AssetPublisher as ot, ATOMIC_FINAL_SNAPSHOT_TYPES as p, ResourceTimeoutError as pn, AssetModeResolver as pt, assertRegionMatch as q, processStackMessages as qt, DeployEngine as r, DependencyError as rn, S3StateBackend as rt, planRollback as s, LocalStartServiceError as sn, stringifyValue as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, CdkdError as tn, TemplateParser as tt, withResourceDeadline as u, NestedStackChildDirectDestroyError as un, createAssetRedirectResolver as ut, isFinalSnapshotError as v, SynthesisError as vn, validateAssetBucketName as vt, renderStatefulReason as w, runDockerStreaming as wt, extractDeploymentEventError as x, normalizeAwsError as xn, formatDockerLoginError as xt, refusesFinalSnapshot as y, formatError as yn, validateContainerRepoName as yt, disableInstanceApiTermination as z, warnDeprecatedNoPrefixCliFlag as zt };
20966
- //# sourceMappingURL=deploy-engine-dvS1K_ET.js.map
21012
+ //# sourceMappingURL=deploy-engine-D7KckQ5N.js.map