cdk-real-drift 0.12.12 → 0.12.14

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
@@ -4507,16 +4507,17 @@ async function loadDesired(client, stackName, region, templateOverride, recovery
4507
4507
  hasSiblingCapacityProviders: res.Type === "AWS::ECS::Cluster" ? clustersWithSiblingCapacityProviders.has(logicalId) : void 0
4508
4508
  });
4509
4509
  }
4510
- return {
4510
+ const desired = {
4511
4511
  stackName,
4512
4512
  region,
4513
4513
  accountId,
4514
4514
  resources,
4515
- stackTags,
4516
4515
  rawTemplate,
4517
4516
  ctx,
4518
4517
  stackStatusWarning
4519
4518
  };
4519
+ desired.stackTags = stackTags;
4520
+ return desired;
4520
4521
  }
4521
4522
  const IAM_PRINCIPAL_TYPES = new Set([
4522
4523
  "AWS::IAM::Role",
@@ -5676,6 +5677,24 @@ function resolveParentObject(root, dottedPath) {
5676
5677
  }
5677
5678
  return node;
5678
5679
  }
5680
+ const GETTEMPLATE_MASK_NOTE = "declared value unverifiable — CloudFormation GetTemplate masks non-ASCII characters as \"?\"";
5681
+ function pushDeclaredFinding(findings, finding) {
5682
+ if (!deepEqual(finding.desired, finding.actual) && deepEqualModuloNonAsciiMask(finding.desired, finding.actual)) {
5683
+ findings.push({
5684
+ tier: "readGap",
5685
+ logicalId: finding.logicalId,
5686
+ resourceType: finding.resourceType,
5687
+ path: finding.path,
5688
+ ...finding.attributeKey !== void 0 ? { attributeKey: finding.attributeKey } : {},
5689
+ note: GETTEMPLATE_MASK_NOTE
5690
+ });
5691
+ return;
5692
+ }
5693
+ findings.push({
5694
+ tier: "declared",
5695
+ ...finding
5696
+ });
5697
+ }
5679
5698
  function classifyResource(resource, liveRaw, schema, opts = {}) {
5680
5699
  const { logicalId, resourceType, physicalId, declared: declaredIn } = resource;
5681
5700
  const findings = [];
@@ -6051,8 +6070,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6051
6070
  }
6052
6071
  const isNonEmptyCollection = Array.isArray(v) && v.length > 0 || v !== null && typeof v === "object" && Object.keys(v).length > 0;
6053
6072
  const isClearedAllowlistedScalar = SCALAR_RETURNED_WHEN_SET[resourceType]?.has(k) === true && (typeof v === "string" && v.length > 0 || typeof v === "number" || typeof v === "boolean");
6054
- if (isNonEmptyCollection && !READGAP_COLLECTION_PATHS[resourceType]?.has(k) || isClearedAllowlistedScalar) findings.push({
6055
- tier: "declared",
6073
+ if (isNonEmptyCollection && !READGAP_COLLECTION_PATHS[resourceType]?.has(k) || isClearedAllowlistedScalar) pushDeclaredFinding(findings, {
6056
6074
  logicalId,
6057
6075
  resourceType,
6058
6076
  path: k,
@@ -6084,12 +6102,11 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6084
6102
  logicalId,
6085
6103
  resourceType,
6086
6104
  path: k,
6087
- note: "declared value unverifiable — CloudFormation GetTemplate masks non-ASCII characters as \"?\""
6105
+ note: GETTEMPLATE_MASK_NOTE
6088
6106
  });
6089
6107
  continue;
6090
6108
  }
6091
- findings.push({
6092
- tier: "declared",
6109
+ pushDeclaredFinding(findings, {
6093
6110
  logicalId,
6094
6111
  resourceType,
6095
6112
  path: k,
@@ -6122,12 +6139,11 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6122
6139
  logicalId,
6123
6140
  resourceType,
6124
6141
  path: k,
6125
- note: "declared value unverifiable — CloudFormation GetTemplate masks non-ASCII characters as \"?\""
6142
+ note: GETTEMPLATE_MASK_NOTE
6126
6143
  });
6127
6144
  continue;
6128
6145
  }
6129
- findings.push({
6130
- tier: "declared",
6146
+ pushDeclaredFinding(findings, {
6131
6147
  logicalId,
6132
6148
  resourceType,
6133
6149
  path: k,
@@ -6146,8 +6162,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6146
6162
  if (typeof member !== "string" && typeof member !== "number") continue;
6147
6163
  declaredSet.add(String(member));
6148
6164
  if (liveSet.has(String(member))) continue;
6149
- findings.push({
6150
- tier: "declared",
6165
+ pushDeclaredFinding(findings, {
6151
6166
  logicalId,
6152
6167
  resourceType,
6153
6168
  path: k,
@@ -6180,8 +6195,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6180
6195
  const liveValue = lEl ? lEl.Value : void 0;
6181
6196
  if (deepEqual(dEl.Value, liveValue)) continue;
6182
6197
  if (isStringlyEqualScalar(dEl.Value, liveValue)) continue;
6183
- findings.push({
6184
- tier: "declared",
6198
+ pushDeclaredFinding(findings, {
6185
6199
  logicalId,
6186
6200
  resourceType,
6187
6201
  path: k,
@@ -6347,7 +6361,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6347
6361
  logicalId,
6348
6362
  resourceType,
6349
6363
  path: d.path,
6350
- note: "declared value unverifiable — CloudFormation GetTemplate masks non-ASCII characters as \"?\""
6364
+ note: GETTEMPLATE_MASK_NOTE
6351
6365
  });
6352
6366
  continue;
6353
6367
  }
@@ -6379,8 +6393,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6379
6393
  path: k,
6380
6394
  value: v
6381
6395
  } } : {};
6382
- findings.push({
6383
- tier: "declared",
6396
+ pushDeclaredFinding(findings, {
6384
6397
  logicalId,
6385
6398
  resourceType,
6386
6399
  path: d.path,
@@ -11718,8 +11731,8 @@ async function gatherFindings(stackName, region, templateOverride, recoveryTempl
11718
11731
  accountId: desired.accountId,
11719
11732
  region,
11720
11733
  kmsAliasTargets,
11734
+ stackTags: desired.stackTags ?? {},
11721
11735
  defaultSgIds,
11722
- stackTags: desired.stackTags,
11723
11736
  oaiCanonicalIds,
11724
11737
  siblingSgRules: buildSiblingSgRules(desired),
11725
11738
  siblingEventBusPolicies: buildSiblingEventBusPolicies(desired),
@@ -11788,8 +11801,8 @@ async function regatherTouched(gathered, touched, region) {
11788
11801
  accountId: desired.accountId,
11789
11802
  region,
11790
11803
  kmsAliasTargets,
11804
+ stackTags: desired.stackTags ?? {},
11791
11805
  defaultSgIds,
11792
- stackTags: desired.stackTags,
11793
11806
  oaiCanonicalIds,
11794
11807
  siblingSgRules: buildSiblingSgRules(desired),
11795
11808
  siblingEventBusPolicies: buildSiblingEventBusPolicies(desired),