Repository: getmoto/moto (python)

Issue:
Aurora Postgres Does Not Support Mock ServerlessV2
From what I can tell, Aurora Postgres does not support ServerlessV2ScalingConfiguration like Neptune does. Support for this would be great!

Pull request description:
RDS: Clusters now support the ServerlessV2ScalingConfiguration parameter
Fixes #6671 

Patch:
diff --git a/moto/rds/models.py b/moto/rds/models.py
index 10020677b..8405171e7 100644
--- a/moto/rds/models.py
+++ b/moto/rds/models.py
@@ -208,6 +208,9 @@ class Cluster:
                 "timeout_action": "RollbackCapacityChange",
                 "seconds_before_timeout": 300,
             }
+        self.serverless_v2_scaling_configuration = kwargs.get(
+            "serverless_v2_scaling_configuration"
+        )
         self.cluster_members: List[str] = list()
         self.replication_source_identifier = kwargs.get("replication_source_identifier")
         self.read_replica_identifiers: List[str] = list()
@@ -378,6 +381,12 @@ class Cluster:
                 {% if "seconds_before_timeout" in cluster.scaling_configuration %}<SecondsBeforeTimeout>{{ cluster.scaling_configuration["seconds_before_timeout"] }}</SecondsBeforeTimeout>{% endif %}
               </ScalingConfigurationInfo>
               {% endif %}
+              {% if cluster.serverless_v2_scaling_configuration %}
+              <ServerlessV2ScalingConfiguration>
+                {% if "MinCapacity" in cluster.serverless_v2_scaling_configuration %}<MinCapacity>{{ cluster.serverless_v2_scaling_configuration["MinCapacity"] }}</MinCapacity>{% endif %}
+                {% if "MaxCapacity" in cluster.serverless_v2_scaling_configuration %}<MaxCapacity>{{ cluster.serverless_v2_scaling_configuration["MaxCapacity"] }}</MaxCapacity>{% endif %}
+              </ServerlessV2ScalingConfiguration>
+              {% endif %}
               {%- if cluster.global_cluster_identifier -%}
               <GlobalClusterIdentifier>{{ cluster.global_cluster_identifier }}</GlobalClusterIdentifier>
               {%- endif -%}
diff --git a/moto/rds/responses.py b/moto/rds/responses.py
index 1ef2bb3f5..001734ef9 100644
--- a/moto/rds/responses.py
+++ b/moto/rds/responses.py
@@ -178,13 +178,12 @@ class RDSResponse(BaseResponse):
         }
 
     def _get_db_cluster_kwargs(self) -> Dict[str, Any]:
+        params = self._get_params()
         return {
             "availability_zones": self._get_multi_param(
                 "AvailabilityZones.AvailabilityZone"
             ),
-            "enable_cloudwatch_logs_exports": self._get_params().get(
-                "EnableCloudwatchLogsExports"
-            ),
+            "enable_cloudwatch_logs_exports": params.get("EnableCloudwatchLogsExports"),
             "db_name": self._get_param("DatabaseName"),
             "db_cluster_identifier": self._get_param("DBClusterIdentifier"),
             "db_subnet_group_name": self._get_param("DBSubnetGroupName"),
@@ -208,6 +207,9 @@ class RDSResponse(BaseResponse):
             "copy_tags_to_snapshot": self._get_param("CopyTagsToSnapshot"),
             "tags": self.unpack_list_params("Tags", "Tag"),
             "scaling_configuration": self._get_dict_param("ScalingConfiguration."),
+            "serverless_v2_scaling_configuration": params.get(
+                "ServerlessV2ScalingConfiguration"
+            ),
             "replication_source_identifier": self._get_param(
                 "ReplicationSourceIdentifier"
             ),


Test patch:
diff --git a/tests/test_rds/test_rds_clusters.py b/tests/test_rds/test_rds_clusters.py
index c047e276e..3190bc8ae 100644
--- a/tests/test_rds/test_rds_clusters.py
+++ b/tests/test_rds/test_rds_clusters.py
@@ -219,6 +219,10 @@ def test_create_db_cluster_additional_parameters():
             "MinCapacity": 5,
             "AutoPause": True,
         },
+        ServerlessV2ScalingConfiguration={
+            "MinCapacity": 2,
+            "MaxCapacity": 4,
+        },
         VpcSecurityGroupIds=["sg1", "sg2"],
     )
 
@@ -236,6 +240,10 @@ def test_create_db_cluster_additional_parameters():
     assert cluster["NetworkType"] == "IPV4"
     assert cluster["DBSubnetGroup"] == "subnetgroupname"
     assert cluster["ScalingConfigurationInfo"] == {"MinCapacity": 5, "AutoPause": True}
+    assert cluster["ServerlessV2ScalingConfiguration"] == {
+        "MaxCapacity": 4.0,
+        "MinCapacity": 2.0,
+    }
 
     security_groups = cluster["VpcSecurityGroups"]
     assert len(security_groups) == 2