cdk-real-drift 0.2.45 → 0.2.47

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
@@ -100,9 +100,17 @@ const NOT_FOUND_ERROR_NAMES = new Set([
100
100
  "NoSuchEntityException",
101
101
  "InvalidAllocationID.NotFound",
102
102
  "InvalidAddress.NotFound",
103
+ "InvalidLaunchTemplateId.NotFound",
104
+ "InvalidNetworkAclID.NotFound",
103
105
  "EntityNotFoundException",
104
106
  "DBClusterNotFoundFault",
105
107
  "DBInstanceNotFoundFault",
108
+ "ResourceNotFoundFault",
109
+ "ClusterNotFoundFault",
110
+ "ParameterGroupNotFoundFault",
111
+ "SubnetGroupNotFoundFault",
112
+ "CacheParameterGroupNotFoundFault",
113
+ "NoSuchHostedZone",
106
114
  "NamespaceNotFound",
107
115
  "ServiceNotFound",
108
116
  "RuleSetDoesNotExistException",
@@ -645,7 +653,7 @@ var QuietIoHost = class extends NonInteractiveIoHost {
645
653
 
646
654
  //#endregion
647
655
  //#region src/synth/synth.ts
648
- const CONCRETE_REGION = /^[a-z]{2}-[a-z]+-\d+$/;
656
+ const CONCRETE_REGION = /^[a-z]{2}(-[a-z]+)+-\d+$/;
649
657
  async function synthApp(app, opts = {}) {
650
658
  const { region, profile, context = {} } = opts;
651
659
  const toolkit = new Toolkit({
@@ -3202,11 +3210,14 @@ function buildResolverContext(template, stackParams, physIds, region, accountId,
3202
3210
  const paramDefs = template.Parameters ?? {};
3203
3211
  const isList = (k) => {
3204
3212
  const t = paramDefs[k]?.Type ?? "";
3205
- return t === "CommaDelimitedList" || t.startsWith("List<");
3213
+ return t === "CommaDelimitedList" || t.startsWith("List<") || t.includes("::Parameter::Value<List<") || t.includes("::Parameter::Value<CommaDelimitedList");
3206
3214
  };
3207
3215
  const toParam = (k, raw) => isList(k) ? raw === "" ? [] : raw.split(",").map((s) => s.trim()) : raw;
3208
3216
  const params = {};
3209
- for (const [k, def] of Object.entries(paramDefs)) if (def && "Default" in def) params[k] = toParam(k, String(def.Default));
3217
+ for (const [k, def] of Object.entries(paramDefs)) {
3218
+ if (def?.NoEcho === true || def?.NoEcho === "true") continue;
3219
+ if (def && "Default" in def) params[k] = toParam(k, String(def.Default));
3220
+ }
3210
3221
  for (const [k, v] of Object.entries(stackParams)) params[k] = toParam(k, v);
3211
3222
  const templateResources = template.Resources ?? {};
3212
3223
  const typeOf = {};
@@ -3296,6 +3307,8 @@ async function loadDesired(client, stackName, region, templateOverride, recovery
3296
3307
  stackParams[p.ParameterKey] = value;
3297
3308
  }
3298
3309
  const ctx = buildResolverContext(template, stackParams, physIds, region, accountId, stackName, stackId);
3310
+ const notificationArns = stack?.NotificationARNs ?? [];
3311
+ if (notificationArns.length > 0) ctx.params["AWS::NotificationARNs"] = notificationArns;
3299
3312
  if (JSON.stringify(template).includes("Fn::ImportValue")) ctx.exports = await listExports(client, region);
3300
3313
  const resources = [];
3301
3314
  const principalsWithSiblingPolicy = collectPrincipalsWithSiblingPolicies(template.Resources ?? {}, ctx);
@@ -8585,7 +8598,7 @@ async function readAddedModel(cc, cfn, c, schemas, oaiCanonicalIds) {
8585
8598
  }
8586
8599
  async function isManagedBySiblingStack(cfn, c, cache) {
8587
8600
  const physicalId = c.identifier;
8588
- if (physicalId.includes("|")) return false;
8601
+ if (physicalId.includes("|")) return "notManaged";
8589
8602
  const cached = cache.get(physicalId);
8590
8603
  if (cached !== void 0) return cached;
8591
8604
  let managed = false;
@@ -8611,11 +8624,16 @@ async function isManagedBySiblingStack(cfn, c, cache) {
8611
8624
  } while (next);
8612
8625
  }
8613
8626
  }
8614
- } catch {
8615
- managed = false;
8627
+ } catch (e) {
8628
+ if (e.name === "ValidationError") {
8629
+ cache.set(physicalId, "notManaged");
8630
+ return "notManaged";
8631
+ }
8632
+ return "unverified";
8616
8633
  }
8617
- cache.set(physicalId, managed);
8618
- return managed;
8634
+ const result = managed ? "managed" : "notManaged";
8635
+ cache.set(physicalId, result);
8636
+ return result;
8619
8637
  }
8620
8638
  const SG_RULE_RESOURCE_SIDE = {
8621
8639
  "AWS::EC2::SecurityGroupIngress": "ingress",
@@ -8751,7 +8769,18 @@ async function gatherFindings(stackName, region, templateOverride, recoveryTempl
8751
8769
  region
8752
8770
  });
8753
8771
  for (const c of children) {
8754
- if (await isManagedBySiblingStack(cfn, c, siblingStackCache)) continue;
8772
+ const sibling = await isManagedBySiblingStack(cfn, c, siblingStackCache);
8773
+ if (sibling === "managed") continue;
8774
+ if (sibling === "unverified") {
8775
+ findings.push({
8776
+ tier: "skipped",
8777
+ logicalId: r.logicalId,
8778
+ resourceType: r.resourceType,
8779
+ path: "",
8780
+ note: `sibling-stack membership unverifiable for ${c.label} (${c.resourceType})`
8781
+ });
8782
+ continue;
8783
+ }
8755
8784
  const read = await readAddedModel(cc, cfn, c, schemas, oaiCanonicalIds);
8756
8785
  findings.push(addedFinding(r, c, read));
8757
8786
  }
@@ -11081,8 +11110,23 @@ function nullHuskRemovalOps(model) {
11081
11110
  walk(model, "");
11082
11111
  return ops;
11083
11112
  }
11113
+ function splitTopLevelDots(dotted) {
11114
+ const out = [];
11115
+ let cur = "";
11116
+ let depth = 0;
11117
+ for (const ch of dotted) {
11118
+ if (ch === "[") depth++;
11119
+ else if (ch === "]") depth = Math.max(0, depth - 1);
11120
+ if (ch === "." && depth === 0) {
11121
+ out.push(cur);
11122
+ cur = "";
11123
+ } else cur += ch;
11124
+ }
11125
+ out.push(cur);
11126
+ return out;
11127
+ }
11084
11128
  function toPointer(dotted) {
11085
- return "/" + dotted.split(".").map((s) => s.replace(/~/g, "~0").replace(/\//g, "~1")).join("/");
11129
+ return "/" + splitTopLevelDots(dotted).map((s) => s.replace(/~/g, "~0").replace(/\//g, "~1")).join("/");
11086
11130
  }
11087
11131
  const DRIFT_TIERS$1 = new Set(["declared", "undeclared"]);
11088
11132
  const SG_REVERT_SIDE = {