cdk-real-drift 0.2.20 → 0.2.21
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 +17 -0
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3931,6 +3931,13 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
3931
3931
|
...freeFormKey && { freeFormKey: true }
|
|
3932
3932
|
});
|
|
3933
3933
|
};
|
|
3934
|
+
const allLeavesAtSchemaDefault = (value, basePath) => {
|
|
3935
|
+
if (isTrivialEmpty(value)) return true;
|
|
3936
|
+
if (Array.isArray(value)) return false;
|
|
3937
|
+
if (isNestedObject(value)) return Object.entries(value).every(([sk, sv]) => allLeavesAtSchemaDefault(sv, `${basePath}.${sk}`));
|
|
3938
|
+
const schemaPath = basePath.replace(/\[[^\]]*\]/g, ".*");
|
|
3939
|
+
return schemaPath in schema.defaultPaths && matchesKnownDefault(value, schema.defaultPaths[schemaPath]) || schemaPath in knownDefPaths && matchesKnownDefault(value, knownDefPaths[schemaPath]);
|
|
3940
|
+
};
|
|
3934
3941
|
for (const [k, v] of Object.entries(declared)) {
|
|
3935
3942
|
if (v === UNRESOLVED || hasUnresolved(v)) {
|
|
3936
3943
|
findings.push({
|
|
@@ -4405,6 +4412,16 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4405
4412
|
}
|
|
4406
4413
|
continue;
|
|
4407
4414
|
}
|
|
4415
|
+
if (isNestedObject(v) && Object.keys(v).length > 0 && allLeavesAtSchemaDefault(v, k)) {
|
|
4416
|
+
findings.push({
|
|
4417
|
+
tier: "atDefault",
|
|
4418
|
+
logicalId,
|
|
4419
|
+
resourceType,
|
|
4420
|
+
path: k,
|
|
4421
|
+
actual: v
|
|
4422
|
+
});
|
|
4423
|
+
continue;
|
|
4424
|
+
}
|
|
4408
4425
|
findings.push({
|
|
4409
4426
|
tier: "undeclared",
|
|
4410
4427
|
logicalId,
|