cdk-real-drift 0.12.11 → 0.12.13

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
@@ -5643,6 +5643,24 @@ function resolveParentObject(root, dottedPath) {
5643
5643
  }
5644
5644
  return node;
5645
5645
  }
5646
+ const GETTEMPLATE_MASK_NOTE = "declared value unverifiable — CloudFormation GetTemplate masks non-ASCII characters as \"?\"";
5647
+ function pushDeclaredFinding(findings, finding) {
5648
+ if (!deepEqual(finding.desired, finding.actual) && deepEqualModuloNonAsciiMask(finding.desired, finding.actual)) {
5649
+ findings.push({
5650
+ tier: "readGap",
5651
+ logicalId: finding.logicalId,
5652
+ resourceType: finding.resourceType,
5653
+ path: finding.path,
5654
+ ...finding.attributeKey !== void 0 ? { attributeKey: finding.attributeKey } : {},
5655
+ note: GETTEMPLATE_MASK_NOTE
5656
+ });
5657
+ return;
5658
+ }
5659
+ findings.push({
5660
+ tier: "declared",
5661
+ ...finding
5662
+ });
5663
+ }
5646
5664
  function classifyResource(resource, liveRaw, schema, opts = {}) {
5647
5665
  const { logicalId, resourceType, physicalId, declared: declaredIn } = resource;
5648
5666
  const findings = [];
@@ -6018,8 +6036,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6018
6036
  }
6019
6037
  const isNonEmptyCollection = Array.isArray(v) && v.length > 0 || v !== null && typeof v === "object" && Object.keys(v).length > 0;
6020
6038
  const isClearedAllowlistedScalar = SCALAR_RETURNED_WHEN_SET[resourceType]?.has(k) === true && (typeof v === "string" && v.length > 0 || typeof v === "number" || typeof v === "boolean");
6021
- if (isNonEmptyCollection && !READGAP_COLLECTION_PATHS[resourceType]?.has(k) || isClearedAllowlistedScalar) findings.push({
6022
- tier: "declared",
6039
+ if (isNonEmptyCollection && !READGAP_COLLECTION_PATHS[resourceType]?.has(k) || isClearedAllowlistedScalar) pushDeclaredFinding(findings, {
6023
6040
  logicalId,
6024
6041
  resourceType,
6025
6042
  path: k,
@@ -6051,12 +6068,11 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6051
6068
  logicalId,
6052
6069
  resourceType,
6053
6070
  path: k,
6054
- note: "declared value unverifiable — CloudFormation GetTemplate masks non-ASCII characters as \"?\""
6071
+ note: GETTEMPLATE_MASK_NOTE
6055
6072
  });
6056
6073
  continue;
6057
6074
  }
6058
- findings.push({
6059
- tier: "declared",
6075
+ pushDeclaredFinding(findings, {
6060
6076
  logicalId,
6061
6077
  resourceType,
6062
6078
  path: k,
@@ -6089,12 +6105,11 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6089
6105
  logicalId,
6090
6106
  resourceType,
6091
6107
  path: k,
6092
- note: "declared value unverifiable — CloudFormation GetTemplate masks non-ASCII characters as \"?\""
6108
+ note: GETTEMPLATE_MASK_NOTE
6093
6109
  });
6094
6110
  continue;
6095
6111
  }
6096
- findings.push({
6097
- tier: "declared",
6112
+ pushDeclaredFinding(findings, {
6098
6113
  logicalId,
6099
6114
  resourceType,
6100
6115
  path: k,
@@ -6113,8 +6128,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6113
6128
  if (typeof member !== "string" && typeof member !== "number") continue;
6114
6129
  declaredSet.add(String(member));
6115
6130
  if (liveSet.has(String(member))) continue;
6116
- findings.push({
6117
- tier: "declared",
6131
+ pushDeclaredFinding(findings, {
6118
6132
  logicalId,
6119
6133
  resourceType,
6120
6134
  path: k,
@@ -6147,8 +6161,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6147
6161
  const liveValue = lEl ? lEl.Value : void 0;
6148
6162
  if (deepEqual(dEl.Value, liveValue)) continue;
6149
6163
  if (isStringlyEqualScalar(dEl.Value, liveValue)) continue;
6150
- findings.push({
6151
- tier: "declared",
6164
+ pushDeclaredFinding(findings, {
6152
6165
  logicalId,
6153
6166
  resourceType,
6154
6167
  path: k,
@@ -6314,7 +6327,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6314
6327
  logicalId,
6315
6328
  resourceType,
6316
6329
  path: d.path,
6317
- note: "declared value unverifiable — CloudFormation GetTemplate masks non-ASCII characters as \"?\""
6330
+ note: GETTEMPLATE_MASK_NOTE
6318
6331
  });
6319
6332
  continue;
6320
6333
  }
@@ -6346,8 +6359,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6346
6359
  path: k,
6347
6360
  value: v
6348
6361
  } } : {};
6349
- findings.push({
6350
- tier: "declared",
6362
+ pushDeclaredFinding(findings, {
6351
6363
  logicalId,
6352
6364
  resourceType,
6353
6365
  path: d.path,