cdk-real-drift 0.2.45 → 0.2.46

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
@@ -645,7 +645,7 @@ var QuietIoHost = class extends NonInteractiveIoHost {
645
645
 
646
646
  //#endregion
647
647
  //#region src/synth/synth.ts
648
- const CONCRETE_REGION = /^[a-z]{2}-[a-z]+-\d+$/;
648
+ const CONCRETE_REGION = /^[a-z]{2}(-[a-z]+)+-\d+$/;
649
649
  async function synthApp(app, opts = {}) {
650
650
  const { region, profile, context = {} } = opts;
651
651
  const toolkit = new Toolkit({
@@ -8585,7 +8585,7 @@ async function readAddedModel(cc, cfn, c, schemas, oaiCanonicalIds) {
8585
8585
  }
8586
8586
  async function isManagedBySiblingStack(cfn, c, cache) {
8587
8587
  const physicalId = c.identifier;
8588
- if (physicalId.includes("|")) return false;
8588
+ if (physicalId.includes("|")) return "notManaged";
8589
8589
  const cached = cache.get(physicalId);
8590
8590
  if (cached !== void 0) return cached;
8591
8591
  let managed = false;
@@ -8611,11 +8611,16 @@ async function isManagedBySiblingStack(cfn, c, cache) {
8611
8611
  } while (next);
8612
8612
  }
8613
8613
  }
8614
- } catch {
8615
- managed = false;
8614
+ } catch (e) {
8615
+ if (e.name === "ValidationError") {
8616
+ cache.set(physicalId, "notManaged");
8617
+ return "notManaged";
8618
+ }
8619
+ return "unverified";
8616
8620
  }
8617
- cache.set(physicalId, managed);
8618
- return managed;
8621
+ const result = managed ? "managed" : "notManaged";
8622
+ cache.set(physicalId, result);
8623
+ return result;
8619
8624
  }
8620
8625
  const SG_RULE_RESOURCE_SIDE = {
8621
8626
  "AWS::EC2::SecurityGroupIngress": "ingress",
@@ -8751,7 +8756,18 @@ async function gatherFindings(stackName, region, templateOverride, recoveryTempl
8751
8756
  region
8752
8757
  });
8753
8758
  for (const c of children) {
8754
- if (await isManagedBySiblingStack(cfn, c, siblingStackCache)) continue;
8759
+ const sibling = await isManagedBySiblingStack(cfn, c, siblingStackCache);
8760
+ if (sibling === "managed") continue;
8761
+ if (sibling === "unverified") {
8762
+ findings.push({
8763
+ tier: "skipped",
8764
+ logicalId: r.logicalId,
8765
+ resourceType: r.resourceType,
8766
+ path: "",
8767
+ note: `sibling-stack membership unverifiable for ${c.label} (${c.resourceType})`
8768
+ });
8769
+ continue;
8770
+ }
8755
8771
  const read = await readAddedModel(cc, cfn, c, schemas, oaiCanonicalIds);
8756
8772
  findings.push(addedFinding(r, c, read));
8757
8773
  }
@@ -11081,8 +11097,23 @@ function nullHuskRemovalOps(model) {
11081
11097
  walk(model, "");
11082
11098
  return ops;
11083
11099
  }
11100
+ function splitTopLevelDots(dotted) {
11101
+ const out = [];
11102
+ let cur = "";
11103
+ let depth = 0;
11104
+ for (const ch of dotted) {
11105
+ if (ch === "[") depth++;
11106
+ else if (ch === "]") depth = Math.max(0, depth - 1);
11107
+ if (ch === "." && depth === 0) {
11108
+ out.push(cur);
11109
+ cur = "";
11110
+ } else cur += ch;
11111
+ }
11112
+ out.push(cur);
11113
+ return out;
11114
+ }
11084
11115
  function toPointer(dotted) {
11085
- return "/" + dotted.split(".").map((s) => s.replace(/~/g, "~0").replace(/\//g, "~1")).join("/");
11116
+ return "/" + splitTopLevelDots(dotted).map((s) => s.replace(/~/g, "~0").replace(/\//g, "~1")).join("/");
11086
11117
  }
11087
11118
  const DRIFT_TIERS$1 = new Set(["declared", "undeclared"]);
11088
11119
  const SG_REVERT_SIDE = {