cdk-real-drift 0.12.101 → 0.12.102

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
@@ -5648,6 +5648,23 @@ function accountDerivedDefault(resourceType, key, ad) {
5648
5648
  if (resourceType === "AWS::EC2::Volume" && key === "Encrypted" && ad.ebsEncryptionByDefault !== void 0) return { value: ad.ebsEncryptionByDefault };
5649
5649
  if ((resourceType === "AWS::RDS::DBInstance" || resourceType === "AWS::DocDB::DBInstance") && key === "CACertificateIdentifier" && ad.rdsDefaultCaIdentifier !== void 0) return { value: ad.rdsDefaultCaIdentifier };
5650
5650
  }
5651
+ function elastiCacheReplicationGroupDerivedDefault(key, declared) {
5652
+ const numNodeGroups = typeof declared["NumNodeGroups"] === "number" ? declared["NumNodeGroups"] : void 0;
5653
+ const nodeGroupConfig = Array.isArray(declared["NodeGroupConfiguration"]) ? declared["NodeGroupConfiguration"] : void 0;
5654
+ const replicasPerNodeGroup = typeof declared["ReplicasPerNodeGroup"] === "number" ? declared["ReplicasPerNodeGroup"] : void 0;
5655
+ const engine = typeof declared["Engine"] === "string" ? declared["Engine"].toLowerCase() : void 0;
5656
+ const clusterModeEnabled = numNodeGroups !== void 0 && numNodeGroups > 1 || nodeGroupConfig !== void 0 && nodeGroupConfig.length > 0 || declared["ClusterMode"] === "enabled";
5657
+ if (key === "ClusterMode") return clusterModeEnabled ? { value: "enabled" } : void 0;
5658
+ if (key === "AutomaticFailoverEnabled") return clusterModeEnabled || engine === "valkey" ? { value: true } : void 0;
5659
+ if (key === "NumCacheClusters") {
5660
+ if (numNodeGroups !== void 0) return { value: numNodeGroups * (1 + (replicasPerNodeGroup ?? 0)) };
5661
+ if (nodeGroupConfig !== void 0 && nodeGroupConfig.length > 0) return { value: nodeGroupConfig.reduce((sum, g) => {
5662
+ const rc = typeof g["ReplicaCount"] === "number" ? g["ReplicaCount"] : replicasPerNodeGroup ?? 0;
5663
+ return sum + 1 + rc;
5664
+ }, 0) };
5665
+ return;
5666
+ }
5667
+ }
5651
5668
  const stripCognitoAttrPrefix = (id) => id.replace(/^(custom|dev):/, "");
5652
5669
  const IDENTITY_KEYED_SUBSET_ARRAYS = {
5653
5670
  "AWS::Cognito::UserPool": { Schema: {
@@ -7228,6 +7245,19 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
7228
7245
  });
7229
7246
  continue;
7230
7247
  }
7248
+ if (resourceType === "AWS::ElastiCache::ReplicationGroup") {
7249
+ const rgDerived = elastiCacheReplicationGroupDerivedDefault(k, declared);
7250
+ if (rgDerived !== void 0) {
7251
+ findings.push({
7252
+ tier: matchesKnownDefault(v, rgDerived.value) ? "atDefault" : "undeclared",
7253
+ logicalId,
7254
+ resourceType,
7255
+ path: k,
7256
+ actual: v
7257
+ });
7258
+ continue;
7259
+ }
7260
+ }
7231
7261
  if (k in schema.defaults && matchesKnownDefault(v, schema.defaults[k]) || k in schema.defaultPaths && matchesKnownDefault(v, schema.defaultPaths[k]) || k in knownDef && matchesKnownDefault(v, knownDef[k]) || KNOWN_DEFAULT_ONE_OF[resourceType]?.[k]?.some((d) => matchesKnownDefault(v, d)) || VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS[resourceType]?.has(k) && !isTrivialEmpty(v) && !(k in knownDef) || clbDefaultSslPoliciesAtDefault(resourceType, k, v)) {
7232
7262
  findings.push({
7233
7263
  tier: "atDefault",