cdk-real-drift 0.4.41 → 0.4.43

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
@@ -1227,17 +1227,14 @@ async function resolveStacks(a) {
1227
1227
  const app = resolveApp(a.app);
1228
1228
  if (!app) throw new Error("cdkrd needs a CDK app: run in a directory with cdk.json, pass --app \"<cmd>\" or --app <cdk.out> (a pre-synthesized assembly), or set $CDKRD_APP");
1229
1229
  const scopePatterns = !a.all && a.stackNames.length > 0 ? a.stackNames : void 0;
1230
+ if (!a.region) a.region = await resolveProfileRegion(a.profile);
1231
+ const fallbackRegion = a.region;
1230
1232
  const discovered = await discoverStacks(app, {
1231
1233
  region: a.region,
1232
1234
  profile: a.profile,
1233
1235
  context: a.context,
1234
1236
  stackPatterns: scopePatterns
1235
1237
  });
1236
- let fallbackRegion = a.region;
1237
- if (!fallbackRegion && discovered.some((s) => !s.region)) {
1238
- fallbackRegion = await resolveProfileRegion(a.profile);
1239
- a.region = fallbackRegion;
1240
- }
1241
1238
  if (a.all || a.stackNames.length === 0) return discovered.map((s) => ({
1242
1239
  stackName: s.stackName,
1243
1240
  region: s.region ?? fallbackRegion,
@@ -1276,12 +1273,12 @@ async function resolveStacks(a) {
1276
1273
  //#region src/normalize/intrinsic-resolver.ts
1277
1274
  const UNRESOLVED = Symbol("unresolved");
1278
1275
  const NOVALUE = Symbol("novalue");
1279
- const DYNAMIC_REFERENCE_RE = /^\{\{resolve:(ssm|ssm-secure|secretsmanager):[\s\S]+\}\}$/;
1280
- function isDynamicReference(v) {
1281
- return DYNAMIC_REFERENCE_RE.test(v);
1276
+ const CONTAINS_DYNAMIC_REFERENCE_RE = /\{\{resolve:(ssm|ssm-secure|secretsmanager):[\s\S]*?\}\}/;
1277
+ function containsDynamicReference(v) {
1278
+ return CONTAINS_DYNAMIC_REFERENCE_RE.test(v);
1282
1279
  }
1283
1280
  function checkResolvedDynamicRef(r) {
1284
- return typeof r === "string" && isDynamicReference(r) ? UNRESOLVED : r;
1281
+ return typeof r === "string" && containsDynamicReference(r) ? UNRESOLVED : r;
1285
1282
  }
1286
1283
  function isScalarInterpolant(v) {
1287
1284
  const t = typeof v;
@@ -1289,7 +1286,7 @@ function isScalarInterpolant(v) {
1289
1286
  }
1290
1287
  function resolve$1(node, ctx, inCondition = false) {
1291
1288
  if (Array.isArray(node)) return node.map((n) => resolve$1(n, ctx, inCondition));
1292
- if (typeof node === "string" && isDynamicReference(node)) return UNRESOLVED;
1289
+ if (typeof node === "string" && containsDynamicReference(node)) return UNRESOLVED;
1293
1290
  if (node === null || typeof node !== "object") return node;
1294
1291
  const obj = node;
1295
1292
  const keys = Object.keys(obj);
@@ -1320,7 +1317,7 @@ function resolve$1(node, ctx, inCondition = false) {
1320
1317
  const parts = resolved.filter((p) => p !== NOVALUE);
1321
1318
  if (parts.some((p) => !isScalarInterpolant(p))) return UNRESOLVED;
1322
1319
  const joined = parts.join(delim);
1323
- return isDynamicReference(joined) ? UNRESOLVED : joined;
1320
+ return containsDynamicReference(joined) ? UNRESOLVED : joined;
1324
1321
  }
1325
1322
  case "Fn::Select": {
1326
1323
  if (!Array.isArray(v)) return UNRESOLVED;
@@ -1565,7 +1562,7 @@ function resolveSub(v, ctx) {
1565
1562
  return String(r);
1566
1563
  });
1567
1564
  if (unresolved) return UNRESOLVED;
1568
- return isDynamicReference(out) ? UNRESOLVED : out;
1565
+ return containsDynamicReference(out) ? UNRESOLVED : out;
1569
1566
  }
1570
1567
  function hasUnresolved(v) {
1571
1568
  if (v === UNRESOLVED) return true;