cdk-real-drift 0.4.40 → 0.4.42
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 +20 -13
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1276,12 +1276,12 @@ async function resolveStacks(a) {
|
|
|
1276
1276
|
//#region src/normalize/intrinsic-resolver.ts
|
|
1277
1277
|
const UNRESOLVED = Symbol("unresolved");
|
|
1278
1278
|
const NOVALUE = Symbol("novalue");
|
|
1279
|
-
const
|
|
1280
|
-
function
|
|
1281
|
-
return
|
|
1279
|
+
const CONTAINS_DYNAMIC_REFERENCE_RE = /\{\{resolve:(ssm|ssm-secure|secretsmanager):[\s\S]*?\}\}/;
|
|
1280
|
+
function containsDynamicReference(v) {
|
|
1281
|
+
return CONTAINS_DYNAMIC_REFERENCE_RE.test(v);
|
|
1282
1282
|
}
|
|
1283
1283
|
function checkResolvedDynamicRef(r) {
|
|
1284
|
-
return typeof r === "string" &&
|
|
1284
|
+
return typeof r === "string" && containsDynamicReference(r) ? UNRESOLVED : r;
|
|
1285
1285
|
}
|
|
1286
1286
|
function isScalarInterpolant(v) {
|
|
1287
1287
|
const t = typeof v;
|
|
@@ -1289,7 +1289,7 @@ function isScalarInterpolant(v) {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
function resolve$1(node, ctx, inCondition = false) {
|
|
1291
1291
|
if (Array.isArray(node)) return node.map((n) => resolve$1(n, ctx, inCondition));
|
|
1292
|
-
if (typeof node === "string" &&
|
|
1292
|
+
if (typeof node === "string" && containsDynamicReference(node)) return UNRESOLVED;
|
|
1293
1293
|
if (node === null || typeof node !== "object") return node;
|
|
1294
1294
|
const obj = node;
|
|
1295
1295
|
const keys = Object.keys(obj);
|
|
@@ -1320,7 +1320,7 @@ function resolve$1(node, ctx, inCondition = false) {
|
|
|
1320
1320
|
const parts = resolved.filter((p) => p !== NOVALUE);
|
|
1321
1321
|
if (parts.some((p) => !isScalarInterpolant(p))) return UNRESOLVED;
|
|
1322
1322
|
const joined = parts.join(delim);
|
|
1323
|
-
return
|
|
1323
|
+
return containsDynamicReference(joined) ? UNRESOLVED : joined;
|
|
1324
1324
|
}
|
|
1325
1325
|
case "Fn::Select": {
|
|
1326
1326
|
if (!Array.isArray(v)) return UNRESOLVED;
|
|
@@ -1565,7 +1565,7 @@ function resolveSub(v, ctx) {
|
|
|
1565
1565
|
return String(r);
|
|
1566
1566
|
});
|
|
1567
1567
|
if (unresolved) return UNRESOLVED;
|
|
1568
|
-
return
|
|
1568
|
+
return containsDynamicReference(out) ? UNRESOLVED : out;
|
|
1569
1569
|
}
|
|
1570
1570
|
function hasUnresolved(v) {
|
|
1571
1571
|
if (v === UNRESOLVED) return true;
|
|
@@ -10050,13 +10050,20 @@ async function classifyRead(cfn, r, read, schemas, classifyOpts) {
|
|
|
10050
10050
|
path: "",
|
|
10051
10051
|
note: read?.skippedReason ?? "not readable"
|
|
10052
10052
|
}];
|
|
10053
|
-
|
|
10054
|
-
if (!
|
|
10053
|
+
const cachedSchema = schemas.get(r.resourceType);
|
|
10054
|
+
if (!cachedSchema) {
|
|
10055
10055
|
const res = await getSchemaInfoResult(cfn, r.resourceType);
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10056
|
+
if (res.failed) return [{
|
|
10057
|
+
tier: "skipped",
|
|
10058
|
+
logicalId: r.logicalId,
|
|
10059
|
+
resourceType: r.resourceType,
|
|
10060
|
+
path: "",
|
|
10061
|
+
note: "schema unavailable (DescribeType failed) — coverage incomplete"
|
|
10062
|
+
}];
|
|
10063
|
+
schemas.set(r.resourceType, res.info);
|
|
10064
|
+
return classifyResource(r, read.live, res.info, classifyOpts);
|
|
10065
|
+
}
|
|
10066
|
+
return classifyResource(r, read.live, cachedSchema, classifyOpts);
|
|
10060
10067
|
}
|
|
10061
10068
|
async function gatherFindings(stackName, region, templateOverride, recoveryTemplate) {
|
|
10062
10069
|
const cfn = new CloudFormationClient({
|