cdk-real-drift 0.12.4 → 0.12.5

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
@@ -5120,7 +5120,8 @@ function guardDutyFeaturesAllAtDefault(features) {
5120
5120
  }
5121
5121
  const DEFAULT_SG_LIST_PATHS = {
5122
5122
  "AWS::ElasticLoadBalancingV2::LoadBalancer": "SecurityGroups",
5123
- "AWS::EC2::NetworkInterface": "GroupSet"
5123
+ "AWS::EC2::NetworkInterface": "GroupSet",
5124
+ "AWS::Neptune::DBCluster": "VpcSecurityGroupIds"
5124
5125
  };
5125
5126
  /** #889 fold decision for an UNDECLARED default-SG list (ALB SecurityGroups / ENI GroupSet).
5126
5127
  * Returns whether the value-independent fold should still apply for this live value:
@@ -5152,6 +5153,7 @@ const IDENTITY_KEYED_SUBSET_ARRAYS = {
5152
5153
  foldHuskExtras: true
5153
5154
  } }
5154
5155
  };
5156
+ const VALUE_INDEPENDENT_KEYED_ELEMENTS = { "AWS::Cognito::UserPoolUser": { UserAttributes: new Set(["sub"]) } };
5155
5157
  const NESTED_ARRAY_IDENTITY = {
5156
5158
  "AWS::ApiGateway::Method": {
5157
5159
  "Integration.IntegrationResponses": "StatusCode",
@@ -6195,7 +6197,9 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6195
6197
  for (const lEl of live[k]) {
6196
6198
  const id = idOf(lEl);
6197
6199
  if (id !== void 0 && !declaredIds.has(id)) {
6198
- const atDefault = subsetSpec.foldHuskExtras === true && isNestedObject(lEl) && Object.entries(lEl).every(([ek, ev]) => ek === idField || isTrivialEmpty(ev)) || defaultEls && id in defaultEls && deepEqual(lEl, defaultEls[id]);
6200
+ const isHuskExtra = subsetSpec.foldHuskExtras === true && isNestedObject(lEl) && Object.entries(lEl).every(([ek, ev]) => ek === idField || isTrivialEmpty(ev));
6201
+ const isValueIndependentId = VALUE_INDEPENDENT_KEYED_ELEMENTS[resourceType]?.[k]?.has(id) ?? false;
6202
+ const atDefault = isHuskExtra || isValueIndependentId || defaultEls && id in defaultEls && deepEqual(lEl, defaultEls[id]);
6199
6203
  findings.push({
6200
6204
  tier: atDefault ? "atDefault" : "undeclared",
6201
6205
  logicalId,
@@ -6527,7 +6531,8 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6527
6531
  }
6528
6532
  const subsetSpecU = IDENTITY_KEYED_SUBSET_ARRAYS[resourceType]?.[k];
6529
6533
  const defaultElsU = IDENTITY_KEYED_DEFAULT_ELEMENTS[resourceType]?.[k];
6530
- if (subsetSpecU !== void 0 && defaultElsU !== void 0 && Array.isArray(v)) {
6534
+ const viIdsU = VALUE_INDEPENDENT_KEYED_ELEMENTS[resourceType]?.[k];
6535
+ if (subsetSpecU !== void 0 && (defaultElsU !== void 0 || viIdsU !== void 0) && Array.isArray(v)) {
6531
6536
  const { idField, normalizeId } = subsetSpecU;
6532
6537
  for (const lEl of v) {
6533
6538
  if (!isNestedObject(lEl) || typeof lEl[idField] !== "string") {
@@ -6542,7 +6547,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6542
6547
  }
6543
6548
  const raw = lEl[idField];
6544
6549
  const id = normalizeId ? normalizeId(raw) : raw;
6545
- const atDefault = id in defaultElsU && deepEqual(lEl, defaultElsU[id]);
6550
+ const atDefault = (viIdsU?.has(id) ?? false) || defaultElsU !== void 0 && id in defaultElsU && deepEqual(lEl, defaultElsU[id]);
6546
6551
  findings.push({
6547
6552
  tier: atDefault ? "atDefault" : "undeclared",
6548
6553
  logicalId,
@@ -11039,7 +11044,11 @@ function liveModelMap(reads) {
11039
11044
  for (const [logicalId, read] of reads) if (read.live) out.set(logicalId, read.live);
11040
11045
  return out;
11041
11046
  }
11042
- const DEFAULT_SG_LIST_TYPES = new Set(["AWS::ElasticLoadBalancingV2::LoadBalancer", "AWS::EC2::NetworkInterface"]);
11047
+ const DEFAULT_SG_LIST_TYPES = new Set([
11048
+ "AWS::ElasticLoadBalancingV2::LoadBalancer",
11049
+ "AWS::EC2::NetworkInterface",
11050
+ "AWS::Neptune::DBCluster"
11051
+ ]);
11043
11052
  const defaultSgIdsCache = /* @__PURE__ */ new Map();
11044
11053
  async function fetchDefaultSgIds(region) {
11045
11054
  const cached = defaultSgIdsCache.get(region);