cdk-real-drift 0.7.2 → 0.7.4

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.
package/dist/cli.js CHANGED
@@ -4011,7 +4011,7 @@ function partitionForRegion(region) {
4011
4011
  urlSuffix: "amazonaws.com"
4012
4012
  };
4013
4013
  }
4014
- function buildResolverContext(template, stackParams, physIds, region, accountId, stackName, stackId) {
4014
+ function buildResolverContext(template, stackParams, physIds, region, accountId, stackName, stackId, preDeploy = false) {
4015
4015
  const paramDefs = template.Parameters ?? {};
4016
4016
  const isList = (k) => {
4017
4017
  const t = paramDefs[k]?.Type ?? "";
@@ -4024,7 +4024,9 @@ function buildResolverContext(template, stackParams, physIds, region, accountId,
4024
4024
  if ((def?.Type ?? "").includes("::Parameter::Value<")) continue;
4025
4025
  if (def && "Default" in def) params[k] = toParam(k, String(def.Default));
4026
4026
  }
4027
- for (const [k, v] of Object.entries(stackParams)) params[k] = toParam(k, v);
4027
+ if (preDeploy) {
4028
+ for (const [k, v] of Object.entries(stackParams)) if (!(k in params)) params[k] = toParam(k, v);
4029
+ } else for (const [k, v] of Object.entries(stackParams)) params[k] = toParam(k, v);
4028
4030
  const templateResources = template.Resources ?? {};
4029
4031
  const typeOf = {};
4030
4032
  const declaredRawProps = {};
@@ -4120,7 +4122,7 @@ async function loadDesired(client, stackName, region, templateOverride, recovery
4120
4122
  const replaceInfo = typeChangeReplaceInfo([...typeChanged].sort(), templateResourcesForTypeCheck, deployedTypeOf, stackName);
4121
4123
  if (replaceInfo) console.error(replaceInfo);
4122
4124
  }
4123
- const ctx = buildResolverContext(template, stackParams, physIds, region, accountId, stackName, stackId);
4125
+ const ctx = buildResolverContext(template, stackParams, physIds, region, accountId, stackName, stackId, !!templateOverride);
4124
4126
  const notificationArns = stack?.NotificationARNs ?? [];
4125
4127
  if (notificationArns.length > 0) ctx.params["AWS::NotificationARNs"] = notificationArns;
4126
4128
  if (JSON.stringify(template).includes("Fn::ImportValue")) try {
@@ -14586,8 +14588,8 @@ async function revertStack(p) {
14586
14588
  const failedUpdateIds = /* @__PURE__ */ new Set();
14587
14589
  const applied = [];
14588
14590
  const clock = waitNow ?? Date.now;
14589
- const buildRetryOpts = (displayId) => ({
14590
- ...waitMs !== void 0 && { deadlineMs: clock() + waitMs },
14591
+ const buildRetryOpts = (displayId, deadlineMsOverride) => ({
14592
+ ...waitMs !== void 0 && { deadlineMs: deadlineMsOverride ?? clock() + waitMs },
14591
14593
  ...waitNow && { now: waitNow },
14592
14594
  ...waitSleep && { sleep: waitSleep },
14593
14595
  onRetry: ({ attempt, delayMs, hint }) => {
@@ -14649,7 +14651,8 @@ async function revertStack(p) {
14649
14651
  if (!r.ok) worst = Math.max(worst, 2);
14650
14652
  if (!r.ok) failedUpdateIds.add(item.logicalId);
14651
14653
  }
14652
- const deleteOutcomes = await applyRevertDeletes(deleteItems, (item) => applyRevertDelete(cc, item, item.physicalId, buildRetryOpts(item.displayId)));
14654
+ const deleteDeadlineMs = waitMs !== void 0 ? clock() + waitMs : void 0;
14655
+ const deleteOutcomes = await applyRevertDeletes(deleteItems, (item) => applyRevertDelete(cc, item, item.physicalId, buildRetryOpts(item.displayId, deleteDeadlineMs)));
14653
14656
  for (const { item, result: r } of deleteOutcomes) {
14654
14657
  if (!r.ok) failedDeleteIds.add(item.logicalId);
14655
14658
  applied.push({