cdk-real-drift 0.2.19 → 0.2.21

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
@@ -3573,7 +3573,11 @@ const IDENTITY_KEYED_SUBSET_ARRAYS = {
3573
3573
  Volumes: { idField: "Device" }
3574
3574
  },
3575
3575
  "AWS::Cognito::UserPoolUser": { UserAttributes: { idField: "Name" } },
3576
- "AWS::Route53Resolver::ResolverEndpoint": { IpAddresses: { idField: "SubnetId" } }
3576
+ "AWS::Route53Resolver::ResolverEndpoint": { IpAddresses: { idField: "SubnetId" } },
3577
+ "AWS::EC2::VPNConnection": { VpnTunnelOptionsSpecifications: {
3578
+ idField: "TunnelInsideCidr",
3579
+ foldHuskExtras: true
3580
+ } }
3577
3581
  };
3578
3582
  const NESTED_ARRAY_IDENTITY = {
3579
3583
  "AWS::ApiGateway::Method": {
@@ -3927,6 +3931,13 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
3927
3931
  ...freeFormKey && { freeFormKey: true }
3928
3932
  });
3929
3933
  };
3934
+ const allLeavesAtSchemaDefault = (value, basePath) => {
3935
+ if (isTrivialEmpty(value)) return true;
3936
+ if (Array.isArray(value)) return false;
3937
+ if (isNestedObject(value)) return Object.entries(value).every(([sk, sv]) => allLeavesAtSchemaDefault(sv, `${basePath}.${sk}`));
3938
+ const schemaPath = basePath.replace(/\[[^\]]*\]/g, ".*");
3939
+ return schemaPath in schema.defaultPaths && matchesKnownDefault(value, schema.defaultPaths[schemaPath]) || schemaPath in knownDefPaths && matchesKnownDefault(value, knownDefPaths[schemaPath]);
3940
+ };
3930
3941
  for (const [k, v] of Object.entries(declared)) {
3931
3942
  if (v === UNRESOLVED || hasUnresolved(v)) {
3932
3943
  findings.push({
@@ -4100,7 +4111,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
4100
4111
  for (const lEl of live[k]) {
4101
4112
  const id = idOf(lEl);
4102
4113
  if (id !== void 0 && !declaredIds.has(id)) {
4103
- const atDefault = defaultEls && id in defaultEls && deepEqual(lEl, defaultEls[id]);
4114
+ 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]);
4104
4115
  findings.push({
4105
4116
  tier: atDefault ? "atDefault" : "undeclared",
4106
4117
  logicalId,
@@ -4401,6 +4412,16 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
4401
4412
  }
4402
4413
  continue;
4403
4414
  }
4415
+ if (isNestedObject(v) && Object.keys(v).length > 0 && allLeavesAtSchemaDefault(v, k)) {
4416
+ findings.push({
4417
+ tier: "atDefault",
4418
+ logicalId,
4419
+ resourceType,
4420
+ path: k,
4421
+ actual: v
4422
+ });
4423
+ continue;
4424
+ }
4404
4425
  findings.push({
4405
4426
  tier: "undeclared",
4406
4427
  logicalId,