cdk-real-drift 0.9.9 → 0.9.11

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
@@ -5508,6 +5508,40 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
5508
5508
  StorageType: storageDefault
5509
5509
  };
5510
5510
  }
5511
+ if (resourceType === "AWS::CE::AnomalySubscription") {
5512
+ const threshold = declared["Threshold"];
5513
+ if (typeof threshold === "number" && Number.isFinite(threshold)) {
5514
+ const decimal = Number.isInteger(threshold) ? `${threshold}.0` : String(threshold);
5515
+ knownDef = {
5516
+ ...knownDef,
5517
+ ThresholdExpression: JSON.stringify({ Dimensions: {
5518
+ Key: "ANOMALY_TOTAL_IMPACT_ABSOLUTE",
5519
+ MatchOptions: ["GREATER_THAN_OR_EQUAL"],
5520
+ Values: [decimal]
5521
+ } })
5522
+ };
5523
+ }
5524
+ }
5525
+ if (resourceType === "AWS::ElastiCache::ReplicationGroup" && declared["TransitEncryptionEnabled"] === true) knownDef = {
5526
+ ...knownDef,
5527
+ TransitEncryptionMode: "required"
5528
+ };
5529
+ if (resourceType === "AWS::EC2::TransitGatewayRoute") {
5530
+ const rtb = declared["TransitGatewayRouteTableId"];
5531
+ const cidr = declared["DestinationCidrBlock"];
5532
+ if (typeof rtb === "string" && typeof cidr === "string") knownDef = {
5533
+ ...knownDef,
5534
+ Id: `${rtb}_${cidr}`
5535
+ };
5536
+ }
5537
+ if (resourceType === "AWS::EC2::TransitGatewayRouteTableAssociation") {
5538
+ const attach = declared["TransitGatewayAttachmentId"];
5539
+ const rtb = declared["TransitGatewayRouteTableId"];
5540
+ if (typeof attach === "string" && typeof rtb === "string") knownDef = {
5541
+ ...knownDef,
5542
+ Id: `${attach}_${rtb}`
5543
+ };
5544
+ }
5511
5545
  if (resourceType === "AWS::Lambda::EventSourceMapping") {
5512
5546
  const arn = declared["EventSourceArn"];
5513
5547
  const service = typeof arn === "string" ? arn.split(":")[2] : void 0;
@@ -6088,6 +6122,19 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6088
6122
  });
6089
6123
  continue;
6090
6124
  }
6125
+ if (resourceType === "AWS::ElastiCache::ReplicationGroup" && k === "SnapshottingClusterId" && typeof v === "string") {
6126
+ const rgId = declared["ReplicationGroupId"] ?? physicalId;
6127
+ if (typeof rgId === "string" && new RegExp(`^${rgId.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}-\\d{3}$`).test(v)) {
6128
+ findings.push({
6129
+ tier: "atDefault",
6130
+ logicalId,
6131
+ resourceType,
6132
+ path: k,
6133
+ actual: v
6134
+ });
6135
+ continue;
6136
+ }
6137
+ }
6091
6138
  if (k in genDef && deepEqual(v, genDef[k])) {
6092
6139
  findings.push({
6093
6140
  tier: "generated",
@@ -15266,6 +15313,26 @@ async function revertStack(p) {
15266
15313
  out(style.note(` ↻ ${displayId}: ${reason} — retry ${attempt} (next in ${secs}s)…`));
15267
15314
  }
15268
15315
  });
15316
+ const itemsPerLogical = /* @__PURE__ */ new Map();
15317
+ for (const item of plan.items) itemsPerLogical.set(item.logicalId, (itemsPerLogical.get(item.logicalId) ?? 0) + 1);
15318
+ const streamedLogical = /* @__PURE__ */ new Set();
15319
+ const streamResultLine = (logicalId) => {
15320
+ if (streamedLogical.has(logicalId)) return;
15321
+ const forResource = applied.filter((a) => a.logicalId === logicalId);
15322
+ if (forResource.length < (itemsPerLogical.get(logicalId) ?? 0)) return;
15323
+ streamedLogical.add(logicalId);
15324
+ for (const s of summarizeRevertResults(forResource)) printRevertResultLine(s);
15325
+ };
15326
+ const printRevertResultLine = (s) => {
15327
+ if (s.ok) out(style.ok(` reverted: ${s.displayId}`));
15328
+ else {
15329
+ out(style.fail(` FAILED: ${s.displayId} — ${s.error}`));
15330
+ if (s.hint) {
15331
+ const suffix = waitMs === void 0 ? " (or re-run with --wait to block until it settles)" : "";
15332
+ out(style.note(` ↳ ${s.hint}${suffix}`));
15333
+ }
15334
+ }
15335
+ };
15269
15336
  const deleteItems = plan.items.filter((i) => i.kind === "delete");
15270
15337
  for (const item of plan.items) {
15271
15338
  if (item.kind === "delete") continue;
@@ -15306,6 +15373,7 @@ async function revertStack(p) {
15306
15373
  });
15307
15374
  if (!r.ok) worst = Math.max(worst, 2);
15308
15375
  if (!r.ok) failedUpdateIds.add(item.logicalId);
15376
+ streamResultLine(item.logicalId);
15309
15377
  }
15310
15378
  const deleteDeadlineMs = waitMs !== void 0 ? clock() + waitMs : void 0;
15311
15379
  const deleteOutcomes = await applyRevertDeletes(deleteItems, (item) => applyRevertDelete(cc, item, item.physicalId, buildRetryOpts(item.displayId, deleteDeadlineMs)));
@@ -15319,17 +15387,14 @@ async function revertStack(p) {
15319
15387
  ...r.hint !== void 0 && { hint: r.hint }
15320
15388
  });
15321
15389
  if (!r.ok) worst = Math.max(worst, 2);
15390
+ streamResultLine(item.logicalId);
15322
15391
  }
15323
15392
  const summarized = summarizeRevertResults(applied);
15324
15393
  const revertedCount = summarized.filter((s) => s.ok).length;
15325
15394
  const failedCount = summarized.filter((s) => !s.ok).length;
15326
- for (const s of summarized) if (s.ok) out(style.ok(` reverted: ${s.displayId}`));
15327
- else {
15328
- out(style.fail(` FAILED: ${s.displayId} — ${s.error}`));
15329
- if (s.hint) {
15330
- const suffix = waitMs === void 0 ? " (or re-run with --wait to block until it settles)" : "";
15331
- out(style.note(` ↳ ${s.hint}${suffix}`));
15332
- }
15395
+ for (const item of plan.items) {
15396
+ if (streamedLogical.has(item.logicalId)) continue;
15397
+ streamResultLine(item.logicalId);
15333
15398
  }
15334
15399
  const touched = new Set(plan.items.map((i) => i.logicalId));
15335
15400
  out("\n" + style.note(`verifying convergence (re-reading ${touched.size} resource(s))...`));