cdk-real-drift 0.2.0 → 0.2.1

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
@@ -2666,7 +2666,8 @@ const UNORDERED_OBJECT_ARRAY_PROPS = {
2666
2666
  "AWS::SecretsManager::Secret": new Set(["ReplicaRegions"]),
2667
2667
  "AWS::ElastiCache::CacheCluster": new Set(["LogDeliveryConfigurations"]),
2668
2668
  "AWS::ElastiCache::ReplicationGroup": new Set(["LogDeliveryConfigurations"]),
2669
- "AWS::WAFv2::LoggingConfiguration": new Set(["RedactedFields"])
2669
+ "AWS::WAFv2::LoggingConfiguration": new Set(["RedactedFields"]),
2670
+ "AWS::EC2::PrefixList": new Set(["Entries"])
2670
2671
  };
2671
2672
  const UNORDERED_NESTED_OBJECT_ARRAY_PATHS = {
2672
2673
  "AWS::CloudFront::CachePolicy": new Set(["CachePolicyConfig.ParametersInCacheKeyAndForwardedToOrigin.HeadersConfig.Headers"]),
@@ -4077,7 +4078,11 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
4077
4078
  resourceType,
4078
4079
  path: d.path,
4079
4080
  desired: d.stateValue,
4080
- actual: d.awsValue
4081
+ actual: d.awsValue,
4082
+ ...unorderedObjArray ? { wholeArrayRevert: {
4083
+ path: k,
4084
+ value: v
4085
+ } } : {}
4081
4086
  });
4082
4087
  }
4083
4088
  }
@@ -10091,8 +10096,19 @@ function buildRevertPlan(findings, baseline, opts = {}) {
10091
10096
  const itemsByLogical = /* @__PURE__ */ new Map();
10092
10097
  const notRevertable = [];
10093
10098
  const recorded = baseline?.recorded ?? [];
10094
- for (const f of findings) {
10099
+ const wholeArrayEmitted = /* @__PURE__ */ new Set();
10100
+ for (let f of findings) {
10095
10101
  const displayId = f.constructPath ? withinStackPath(f.constructPath, opts.stackName ?? "") : f.logicalId;
10102
+ if (f.tier === "declared" && f.wholeArrayRevert && f.path !== f.wholeArrayRevert.path) {
10103
+ const waKey = `${f.logicalId}\0${f.wholeArrayRevert.path}`;
10104
+ if (wholeArrayEmitted.has(waKey)) continue;
10105
+ wholeArrayEmitted.add(waKey);
10106
+ f = {
10107
+ ...f,
10108
+ path: f.wholeArrayRevert.path,
10109
+ desired: f.wholeArrayRevert.value
10110
+ };
10111
+ }
10096
10112
  if (f.tier === "deleted") {
10097
10113
  notRevertable.push({
10098
10114
  displayId,