cdk-real-drift 0.12.32 → 0.12.34

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
@@ -1823,8 +1823,8 @@ const TAG_PROPERTY_NAMES = new Set([
1823
1823
  "TestBotAliasTags",
1824
1824
  "TestAliasTags"
1825
1825
  ]);
1826
- function stripCcApiAwsManagedFields(awsProps) {
1827
- return stripWalk(awsProps, false);
1826
+ function stripCcApiAwsManagedFields(awsProps, freeFormSeed = false) {
1827
+ return stripWalk(awsProps, freeFormSeed);
1828
1828
  }
1829
1829
  const MANAGED_TIMESTAMP_NAME = /^(creation|created|create|lastmodified|lastupdated|lastupdate|modification|modified|updated|update)(date|time|timestamp|at)$/;
1830
1830
  function isManagedTimestampName(key) {
@@ -5091,8 +5091,12 @@ function sortObjectArraysDeep(v) {
5091
5091
  }
5092
5092
  return v;
5093
5093
  }
5094
- function canonicalizeBaselineForCompare(v, resourceType) {
5095
- return sortObjectArraysDeep(canonicalizeForCompare(stripAwsTagsDeep(stripCcApiAwsManagedFields(v)), resourceType));
5094
+ function seedFreeFormFromPath(path) {
5095
+ if (!path) return false;
5096
+ return path.replace(/\[([^\]]*)\]/g, ".$1").split(".").filter((s) => s.length > 0).some((s) => FREE_FORM_MAP_PARENTS.has(s));
5097
+ }
5098
+ function canonicalizeBaselineForCompare(v, resourceType, path) {
5099
+ return sortObjectArraysDeep(canonicalizeForCompare(stripAwsTagsDeep(stripCcApiAwsManagedFields(v, seedFreeFormFromPath(path))), resourceType));
5096
5100
  }
5097
5101
 
5098
5102
  //#endregion
@@ -5818,7 +5822,10 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
5818
5822
  if (sibHooks) subtractSiblingLifecycleHooks(live, sibHooks);
5819
5823
  }
5820
5824
  if (resourceType === "AWS::EC2::EIP" && "NetworkInterfaceId" in live) {
5821
- if (physicalId !== void 0 && opts.siblingEipAssociations?.has(physicalId) || opts.siblingEipAssociations?.has(logicalId)) delete live.NetworkInterfaceId;
5825
+ const explained = physicalId !== void 0 && opts.siblingEipAssociations?.has(physicalId) || opts.siblingEipAssociations?.has(logicalId);
5826
+ const declaresTarget = (v) => v !== void 0 && v !== null && v !== "";
5827
+ const selfDeclared = declaresTarget(declared.InstanceId) || declaresTarget(declared.NetworkInterfaceId);
5828
+ if (explained || selfDeclared) delete live.NetworkInterfaceId;
5822
5829
  }
5823
5830
  if (resourceType === "AWS::S3::Bucket" && physicalId && opts.bucketNotificationManaged?.has(physicalId) && !("NotificationConfiguration" in declared)) delete live.NotificationConfiguration;
5824
5831
  const echoSpec = CLUSTER_ECHO_CHILD[resourceType];
@@ -12728,12 +12735,12 @@ function carryForwardIgnored(recorded, existing, findings) {
12728
12735
  * type-agnostic over UNDECLARED snapshot fragments, which never carry an
12729
12736
  * order-significant declared array, so an order-insensitive sort is safe here.
12730
12737
  */
12731
- function baselineValueMatches(baselineValue, currentCanonicalValue, resourceType) {
12738
+ function baselineValueMatches(baselineValue, currentCanonicalValue, resourceType, path) {
12732
12739
  if (isRedactedHashSentinel(baselineValue) || isRedactedHashSentinel(currentCanonicalValue)) {
12733
- const asHash = (v) => redactedHashOf(isRedactedHashSentinel(v) ? v : canonicalizeBaselineForCompare(v, resourceType));
12740
+ const asHash = (v) => redactedHashOf(isRedactedHashSentinel(v) ? v : canonicalizeBaselineForCompare(v, resourceType, path));
12734
12741
  return asHash(baselineValue) === asHash(currentCanonicalValue);
12735
12742
  }
12736
- return deepEqual(canonicalizeBaselineForCompare(baselineValue, resourceType), canonicalizeBaselineForCompare(currentCanonicalValue, resourceType));
12743
+ return deepEqual(canonicalizeBaselineForCompare(baselineValue, resourceType, path), canonicalizeBaselineForCompare(currentCanonicalValue, resourceType, path));
12737
12744
  }
12738
12745
  const DELTA_IDENTITY_FIELDS = [
12739
12746
  "Key",
@@ -12815,7 +12822,7 @@ function splitRecordedByBaseline(recorded, baseline) {
12815
12822
  const changed = [];
12816
12823
  for (const entry of recorded) {
12817
12824
  const baselineEntry = baseline.recorded.find((a) => a.logicalId === entry.logicalId && a.path === entry.path && a.resourceType === entry.resourceType);
12818
- if (baselineEntry && baselineValueMatches(baselineEntry.value, entry.value, entry.resourceType)) unchanged.push(entry);
12825
+ if (baselineEntry && baselineValueMatches(baselineEntry.value, entry.value, entry.resourceType, entry.path)) unchanged.push(entry);
12819
12826
  else changed.push(entry);
12820
12827
  }
12821
12828
  return {
@@ -12976,7 +12983,7 @@ function applyBaseline(findings, baseline, opts = {}) {
12976
12983
  });
12977
12984
  continue;
12978
12985
  }
12979
- if (entry && baselineValueMatches(entry.value, f.actual, f.resourceType)) continue;
12986
+ if (entry && baselineValueMatches(entry.value, f.actual, f.resourceType, f.path)) continue;
12980
12987
  if (entry) {
12981
12988
  kept.push({
12982
12989
  ...f,
@@ -12996,7 +13003,7 @@ function applyBaseline(findings, baseline, opts = {}) {
12996
13003
  continue;
12997
13004
  }
12998
13005
  const entry = replacedLogical.has(f.logicalId) ? void 0 : recorded.find((a) => entryMatches(a, f));
12999
- if (entry && baselineValueMatches(entry.value, f.actual, f.resourceType)) continue;
13006
+ if (entry && baselineValueMatches(entry.value, f.actual, f.resourceType, f.path)) continue;
13000
13007
  if (entry) {
13001
13008
  const delta = identityArrayDelta(canonicalizeForCompare(entry.value, f.resourceType), f.actual);
13002
13009
  kept.push({