Repository: cloud-custodian/cloud-custodian

Issue:
modify_db_cluster method for rds-cluster is not working when RDS EngineMode= 'serverless'
### Describe the bug

when there are serverless v1 (EngineMode'= 'serverless') instance for RDS-cluster and we try to modify **BackupRetentionPeriod**.It throws an error saying 

botocore.exceptions.ClientError: An error occurred (InvalidParameterCombination) when calling the ModifyDBCluster operation: You currently can't modify BackupWindow with Aurora Serverless.
--------------------------------------------------------------------------------------------------------------------------- 

### What did you expect to happen?

It should modify the "BackupRetentionPeriod".

### Cloud Provider

Amazon Web Services (AWS)

### Cloud Custodian version and dependency information

_No response_

### Policy

policies:
- name: enterprise-rdscluster-backup
  resource: rds-cluster
  filters:
  - type: value
    key: DBClusterIdentifier
    value: "test5"
  actions:
  - type: retention
    days: 9

### Relevant log/traceback output

```shell
ERROR    custodian.output:output.py:336 Error while executing policy
Traceback (most recent call last):
  File "/Users/lfh512/CLOUDCUSTODIAN/cloud-custodian/c7n/policy.py", line 364, in run
    results = a.process(resources)
  File "/Users/lfh512/CLOUDCUSTODIAN/cloud-custodian/c7n/resources/rdscluster.py", line 226, in process
    self.process_snapshot_retention(client, cluster)
  File "/Users/lfh512/CLOUDCUSTODIAN/cloud-custodian/c7n/resources/rdscluster.py", line 234, in process_snapshot_retention
    self.set_retention_window(
  File "/Users/lfh512/CLOUDCUSTODIAN/cloud-custodian/c7n/resources/rdscluster.py", line 245, in set_retention_window
    _run_cluster_method(
  File "/Users/lfh512/CLOUDCUSTODIAN/cloud-custodian/c7n/resources/rdscluster.py", line 295, in _run_cluster_method
    method(**params)
  File "/Users/lfh512/custodian/0.9.13.0/rule-engine/.tox/py39/lib/python3.9/site-packages/botocore/client.py", line 386, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/Users/lfh512/custodian/0.9.13.0/rule-engine/.tox/py39/lib/python3.9/site-packages/botocore/client.py", line 705, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidParameterCombination) when calling the ModifyDBCluster operation: You currently can't modify BackupWindow with Aurora Serverless.
DEBUG    placebo.pill:pill.py:175 stopping, mode=record
```


### Extra information or context

This is happening because of this limitation 

Currently, when you are updating the stack for an Aurora Serverless DB cluster, you can't include changes to any other properties when you specify one of the following properties: PreferredBackupWindow, PreferredMaintenanceWindow, and Port. This limitation doesn't apply to provisioned DB clusters.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html.

We would need a to modify_db_cluster method based on types of EngineMode, If the engine mode is "Provisioned" the existing method would work but for **EngineMethod="serverless**" we need to remove **PreferredBackupWindow** and **PreferredMaintenanceWindow**


Discussion:

Resolving patch:
diff --git a/c7n/resources/rdscluster.py b/c7n/resources/rdscluster.py
--- a/c7n/resources/rdscluster.py
+++ b/c7n/resources/rdscluster.py
@@ -233,7 +233,6 @@ def process_snapshot_retention(self, client, cluster):
         current_retention = int(cluster.get('BackupRetentionPeriod', 0))
         new_retention = self.data['days']
         retention_type = self.data.get('enforce', 'min').lower()
-
         if retention_type == 'min':
             self.set_retention_window(
                 client, cluster, max(current_retention, new_retention))
@@ -244,14 +243,22 @@ def process_snapshot_retention(self, client, cluster):
             self.set_retention_window(client, cluster, new_retention)
 
     def set_retention_window(self, client, cluster, retention):
+        params = dict(
+            DBClusterIdentifier=cluster['DBClusterIdentifier'],
+            BackupRetentionPeriod=retention
+        )
+        if cluster.get('EngineMode') != 'serverless':
+            params.update(
+                dict(
+                    PreferredBackupWindow=cluster['PreferredBackupWindow'],
+                    PreferredMaintenanceWindow=cluster['PreferredMaintenanceWindow'])
+            )
         _run_cluster_method(
             client.modify_db_cluster,
-            dict(DBClusterIdentifier=cluster['DBClusterIdentifier'],
-                 BackupRetentionPeriod=retention,
-                 PreferredBackupWindow=cluster['PreferredBackupWindow'],
-                 PreferredMaintenanceWindow=cluster['PreferredMaintenanceWindow']),
+            params,
             (client.exceptions.DBClusterNotFoundFault, client.exceptions.ResourceNotFoundFault),
-            client.exceptions.InvalidDBClusterStateFault)
+            client.exceptions.InvalidDBClusterStateFault
+        )
 
 
 @RDSCluster.action_registry.register('stop')


Test patch:
diff --git a/tests/data/placebo/test_modify_rds_cluster_provisoned/rds.DescribeDBClusters_1.json b/tests/data/placebo/test_modify_rds_cluster_provisoned/rds.DescribeDBClusters_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_modify_rds_cluster_provisoned/rds.DescribeDBClusters_1.json
@@ -0,0 +1,178 @@
+{
+    "status_code": 200,
+    "data": {
+        "DBClusters": [
+            {
+                "AllocatedStorage": 1,
+                "AvailabilityZones": [
+                    "us-east-1b",
+                    "us-east-1e",
+                    "us-east-1a"
+                ],
+                "BackupRetentionPeriod": 1,
+                "DBClusterIdentifier": "database-1",
+                "DBClusterParameterGroup": "default.aurora-mysql8.0",
+                "DBSubnetGroup": "default",
+                "Status": "available",
+                "EarliestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 50,
+                    "second": 15,
+                    "microsecond": 736000
+                },
+                "Endpoint": "database-1.cluster-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+                "ReaderEndpoint": "database-1.cluster-ro-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+                "MultiAZ": true,
+                "Engine": "aurora-mysql",
+                "EngineVersion": "8.0.mysql_aurora.3.04.0",
+                "LatestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 15,
+                    "minute": 18,
+                    "second": 54,
+                    "microsecond": 671000
+                },
+                "Port": 3306,
+                "MasterUsername": "admin",
+                "PreferredBackupWindow": "06:48-07:18",
+                "PreferredMaintenanceWindow": "sat:08:03-sat:08:33",
+                "ReadReplicaIdentifiers": [],
+                "DBClusterMembers": [
+                    {
+                        "DBInstanceIdentifier": "database-1-instance-1",
+                        "IsClusterWriter": true,
+                        "DBClusterParameterGroupStatus": "in-sync",
+                        "PromotionTier": 1
+                    },
+                    {
+                        "DBInstanceIdentifier": "database-1-instance-1-us-east-1a",
+                        "IsClusterWriter": false,
+                        "DBClusterParameterGroupStatus": "in-sync",
+                        "PromotionTier": 1
+                    }
+                ],
+                "VpcSecurityGroups": [
+                    {
+                        "VpcSecurityGroupId": "sg-6c7fa917",
+                        "Status": "active"
+                    }
+                ],
+                "HostedZoneId": "Z2R2ITUGPM61AM",
+                "StorageEncrypted": true,
+                "KmsKeyId": "arn:aws:kms:us-east-1:644160558196:key/b10f842a-feb7-4318-92d5-0640a75b7688",
+                "DbClusterResourceId": "cluster-UYIOM4PXNB44AVSBBYXLEUWL7U",
+                "DBClusterArn": "arn:aws:rds:us-east-1:644160558196:cluster:database-1",
+                "AssociatedRoles": [],
+                "IAMDatabaseAuthenticationEnabled": false,
+                "ClusterCreateTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 49,
+                    "second": 8,
+                    "microsecond": 87000
+                },
+                "EngineMode": "provisioned",
+                "DeletionProtection": true,
+                "HttpEndpointEnabled": false,
+                "ActivityStreamStatus": "stopped",
+                "CopyTagsToSnapshot": true,
+                "CrossAccountClone": false,
+                "DomainMemberships": [],
+                "TagList": []
+            },
+            {
+                "AllocatedStorage": 1,
+                "AvailabilityZones": [
+                    "us-east-1b",
+                    "us-east-1e",
+                    "us-east-1a"
+                ],
+                "BackupRetentionPeriod": 7,
+                "DBClusterIdentifier": "database-2",
+                "DBClusterParameterGroup": "default.aurora-postgresql11",
+                "DBSubnetGroup": "default",
+                "Status": "available",
+                "EarliestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 58,
+                    "second": 29,
+                    "microsecond": 347000
+                },
+                "Endpoint": "database-2.cluster-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+                "MultiAZ": false,
+                "Engine": "aurora-postgresql",
+                "EngineVersion": "11.16",
+                "LatestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 15,
+                    "minute": 13,
+                    "second": 55,
+                    "microsecond": 930000
+                },
+                "Port": 5432,
+                "MasterUsername": "postgres",
+                "PreferredBackupWindow": "10:02-10:32",
+                "PreferredMaintenanceWindow": "fri:07:40-fri:08:10",
+                "ReadReplicaIdentifiers": [],
+                "DBClusterMembers": [],
+                "VpcSecurityGroups": [
+                    {
+                        "VpcSecurityGroupId": "sg-6c7fa917",
+                        "Status": "active"
+                    }
+                ],
+                "HostedZoneId": "Z2R2ITUGPM61AM",
+                "StorageEncrypted": true,
+                "KmsKeyId": "arn:aws:kms:us-east-1:644160558196:key/b10f842a-feb7-4318-92d5-0640a75b7688",
+                "DbClusterResourceId": "cluster-4RPUNJNPDOJZ2BWCMBMNMBA7LE",
+                "DBClusterArn": "arn:aws:rds:us-east-1:644160558196:cluster:database-2",
+                "AssociatedRoles": [],
+                "IAMDatabaseAuthenticationEnabled": false,
+                "ClusterCreateTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 57,
+                    "second": 20,
+                    "microsecond": 403000
+                },
+                "Capacity": 4,
+                "EngineMode": "serverless",
+                "ScalingConfigurationInfo": {
+                    "MinCapacity": 2,
+                    "MaxCapacity": 384,
+                    "AutoPause": false,
+                    "SecondsUntilAutoPause": 300,
+                    "TimeoutAction": "RollbackCapacityChange"
+                },
+                "DeletionProtection": false,
+                "HttpEndpointEnabled": false,
+                "ActivityStreamStatus": "stopped",
+                "CopyTagsToSnapshot": true,
+                "CrossAccountClone": false,
+                "DomainMemberships": [],
+                "TagList": []
+            }
+        ],
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_modify_rds_cluster_provisoned/rds.DescribeDBClusters_2.json b/tests/data/placebo/test_modify_rds_cluster_provisoned/rds.DescribeDBClusters_2.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_modify_rds_cluster_provisoned/rds.DescribeDBClusters_2.json
@@ -0,0 +1,96 @@
+{
+    "status_code": 200,
+    "data": {
+        "DBClusters": [
+            {
+                "AllocatedStorage": 1,
+                "AvailabilityZones": [
+                    "us-east-1b",
+                    "us-east-1e",
+                    "us-east-1a"
+                ],
+                "BackupRetentionPeriod": 7,
+                "DBClusterIdentifier": "database-1",
+                "DBClusterParameterGroup": "default.aurora-mysql8.0",
+                "DBSubnetGroup": "default",
+                "Status": "available",
+                "EarliestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 50,
+                    "second": 15,
+                    "microsecond": 736000
+                },
+                "Endpoint": "database-1.cluster-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+                "ReaderEndpoint": "database-1.cluster-ro-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+                "MultiAZ": true,
+                "Engine": "aurora-mysql",
+                "EngineVersion": "8.0.mysql_aurora.3.04.0",
+                "LatestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 15,
+                    "minute": 18,
+                    "second": 54,
+                    "microsecond": 671000
+                },
+                "Port": 3306,
+                "MasterUsername": "admin",
+                "PreferredBackupWindow": "06:48-07:18",
+                "PreferredMaintenanceWindow": "sat:08:03-sat:08:33",
+                "ReadReplicaIdentifiers": [],
+                "DBClusterMembers": [
+                    {
+                        "DBInstanceIdentifier": "database-1-instance-1",
+                        "IsClusterWriter": true,
+                        "DBClusterParameterGroupStatus": "in-sync",
+                        "PromotionTier": 1
+                    },
+                    {
+                        "DBInstanceIdentifier": "database-1-instance-1-us-east-1a",
+                        "IsClusterWriter": false,
+                        "DBClusterParameterGroupStatus": "in-sync",
+                        "PromotionTier": 1
+                    }
+                ],
+                "VpcSecurityGroups": [
+                    {
+                        "VpcSecurityGroupId": "sg-6c7fa917",
+                        "Status": "active"
+                    }
+                ],
+                "HostedZoneId": "Z2R2ITUGPM61AM",
+                "StorageEncrypted": true,
+                "KmsKeyId": "arn:aws:kms:us-east-1:644160558196:key/b10f842a-feb7-4318-92d5-0640a75b7688",
+                "DbClusterResourceId": "cluster-UYIOM4PXNB44AVSBBYXLEUWL7U",
+                "DBClusterArn": "arn:aws:rds:us-east-1:644160558196:cluster:database-1",
+                "AssociatedRoles": [],
+                "IAMDatabaseAuthenticationEnabled": false,
+                "ClusterCreateTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 49,
+                    "second": 8,
+                    "microsecond": 87000
+                },
+                "EngineMode": "provisioned",
+                "DeletionProtection": true,
+                "HttpEndpointEnabled": false,
+                "ActivityStreamStatus": "stopped",
+                "CopyTagsToSnapshot": true,
+                "CrossAccountClone": false,
+                "DomainMemberships": [],
+                "TagList": []
+            }
+        ],
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_modify_rds_cluster_provisoned/rds.ModifyDBCluster_1.json b/tests/data/placebo/test_modify_rds_cluster_provisoned/rds.ModifyDBCluster_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_modify_rds_cluster_provisoned/rds.ModifyDBCluster_1.json
@@ -0,0 +1,93 @@
+{
+    "status_code": 200,
+    "data": {
+        "DBCluster": {
+            "AllocatedStorage": 1,
+            "AvailabilityZones": [
+                "us-east-1b",
+                "us-east-1e",
+                "us-east-1a"
+            ],
+            "BackupRetentionPeriod": 7,
+            "DBClusterIdentifier": "database-1",
+            "DBClusterParameterGroup": "default.aurora-mysql8.0",
+            "DBSubnetGroup": "default",
+            "Status": "available",
+            "EarliestRestorableTime": {
+                "__class__": "datetime",
+                "year": 2023,
+                "month": 8,
+                "day": 7,
+                "hour": 14,
+                "minute": 50,
+                "second": 15,
+                "microsecond": 736000
+            },
+            "Endpoint": "database-1.cluster-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+            "ReaderEndpoint": "database-1.cluster-ro-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+            "MultiAZ": true,
+            "Engine": "aurora-mysql",
+            "EngineVersion": "8.0.mysql_aurora.3.04.0",
+            "LatestRestorableTime": {
+                "__class__": "datetime",
+                "year": 2023,
+                "month": 8,
+                "day": 7,
+                "hour": 15,
+                "minute": 18,
+                "second": 54,
+                "microsecond": 671000
+            },
+            "Port": 3306,
+            "MasterUsername": "admin",
+            "PreferredBackupWindow": "06:48-07:18",
+            "PreferredMaintenanceWindow": "sat:08:03-sat:08:33",
+            "ReadReplicaIdentifiers": [],
+            "DBClusterMembers": [
+                {
+                    "DBInstanceIdentifier": "database-1-instance-1",
+                    "IsClusterWriter": true,
+                    "DBClusterParameterGroupStatus": "in-sync",
+                    "PromotionTier": 1
+                },
+                {
+                    "DBInstanceIdentifier": "database-1-instance-1-us-east-1a",
+                    "IsClusterWriter": false,
+                    "DBClusterParameterGroupStatus": "in-sync",
+                    "PromotionTier": 1
+                }
+            ],
+            "VpcSecurityGroups": [
+                {
+                    "VpcSecurityGroupId": "sg-6c7fa917",
+                    "Status": "active"
+                }
+            ],
+            "HostedZoneId": "Z2R2ITUGPM61AM",
+            "StorageEncrypted": true,
+            "KmsKeyId": "arn:aws:kms:us-east-1:644160558196:key/b10f842a-feb7-4318-92d5-0640a75b7688",
+            "DbClusterResourceId": "cluster-UYIOM4PXNB44AVSBBYXLEUWL7U",
+            "DBClusterArn": "arn:aws:rds:us-east-1:644160558196:cluster:database-1",
+            "AssociatedRoles": [],
+            "IAMDatabaseAuthenticationEnabled": false,
+            "ClusterCreateTime": {
+                "__class__": "datetime",
+                "year": 2023,
+                "month": 8,
+                "day": 7,
+                "hour": 14,
+                "minute": 49,
+                "second": 8,
+                "microsecond": 87000
+            },
+            "EngineMode": "provisioned",
+            "DeletionProtection": true,
+            "HttpEndpointEnabled": false,
+            "CopyTagsToSnapshot": true,
+            "CrossAccountClone": false,
+            "DomainMemberships": [],
+            "TagList": []
+        },
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_modify_rds_cluster_serverless_v2/rds.DescribeDBClusters_1.json b/tests/data/placebo/test_modify_rds_cluster_serverless_v2/rds.DescribeDBClusters_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_modify_rds_cluster_serverless_v2/rds.DescribeDBClusters_1.json
@@ -0,0 +1,178 @@
+{
+    "status_code": 200,
+    "data": {
+        "DBClusters": [
+            {
+                "AllocatedStorage": 1,
+                "AvailabilityZones": [
+                    "us-east-1b",
+                    "us-east-1e",
+                    "us-east-1a"
+                ],
+                "BackupRetentionPeriod": 7,
+                "DBClusterIdentifier": "database-1",
+                "DBClusterParameterGroup": "default.aurora-mysql8.0",
+                "DBSubnetGroup": "default",
+                "Status": "available",
+                "EarliestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 50,
+                    "second": 15,
+                    "microsecond": 736000
+                },
+                "Endpoint": "database-1.cluster-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+                "ReaderEndpoint": "database-1.cluster-ro-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+                "MultiAZ": true,
+                "Engine": "aurora-mysql",
+                "EngineVersion": "8.0.mysql_aurora.3.04.0",
+                "LatestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 15,
+                    "minute": 18,
+                    "second": 54,
+                    "microsecond": 671000
+                },
+                "Port": 3306,
+                "MasterUsername": "admin",
+                "PreferredBackupWindow": "06:48-07:18",
+                "PreferredMaintenanceWindow": "sat:08:03-sat:08:33",
+                "ReadReplicaIdentifiers": [],
+                "DBClusterMembers": [
+                    {
+                        "DBInstanceIdentifier": "database-1-instance-1",
+                        "IsClusterWriter": true,
+                        "DBClusterParameterGroupStatus": "in-sync",
+                        "PromotionTier": 1
+                    },
+                    {
+                        "DBInstanceIdentifier": "database-1-instance-1-us-east-1a",
+                        "IsClusterWriter": false,
+                        "DBClusterParameterGroupStatus": "in-sync",
+                        "PromotionTier": 1
+                    }
+                ],
+                "VpcSecurityGroups": [
+                    {
+                        "VpcSecurityGroupId": "sg-6c7fa917",
+                        "Status": "active"
+                    }
+                ],
+                "HostedZoneId": "Z2R2ITUGPM61AM",
+                "StorageEncrypted": true,
+                "KmsKeyId": "arn:aws:kms:us-east-1:644160558196:key/b10f842a-feb7-4318-92d5-0640a75b7688",
+                "DbClusterResourceId": "cluster-UYIOM4PXNB44AVSBBYXLEUWL7U",
+                "DBClusterArn": "arn:aws:rds:us-east-1:644160558196:cluster:database-1",
+                "AssociatedRoles": [],
+                "IAMDatabaseAuthenticationEnabled": false,
+                "ClusterCreateTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 49,
+                    "second": 8,
+                    "microsecond": 87000
+                },
+                "EngineMode": "provisioned",
+                "DeletionProtection": true,
+                "HttpEndpointEnabled": false,
+                "ActivityStreamStatus": "stopped",
+                "CopyTagsToSnapshot": true,
+                "CrossAccountClone": false,
+                "DomainMemberships": [],
+                "TagList": []
+            },
+            {
+                "AllocatedStorage": 1,
+                "AvailabilityZones": [
+                    "us-east-1b",
+                    "us-east-1e",
+                    "us-east-1a"
+                ],
+                "BackupRetentionPeriod": 7,
+                "DBClusterIdentifier": "database-2",
+                "DBClusterParameterGroup": "default.aurora-postgresql11",
+                "DBSubnetGroup": "default",
+                "Status": "available",
+                "EarliestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 58,
+                    "second": 29,
+                    "microsecond": 347000
+                },
+                "Endpoint": "database-2.cluster-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+                "MultiAZ": false,
+                "Engine": "aurora-postgresql",
+                "EngineVersion": "11.16",
+                "LatestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 15,
+                    "minute": 13,
+                    "second": 55,
+                    "microsecond": 930000
+                },
+                "Port": 5432,
+                "MasterUsername": "postgres",
+                "PreferredBackupWindow": "10:02-10:32",
+                "PreferredMaintenanceWindow": "fri:07:40-fri:08:10",
+                "ReadReplicaIdentifiers": [],
+                "DBClusterMembers": [],
+                "VpcSecurityGroups": [
+                    {
+                        "VpcSecurityGroupId": "sg-6c7fa917",
+                        "Status": "active"
+                    }
+                ],
+                "HostedZoneId": "Z2R2ITUGPM61AM",
+                "StorageEncrypted": true,
+                "KmsKeyId": "arn:aws:kms:us-east-1:644160558196:key/b10f842a-feb7-4318-92d5-0640a75b7688",
+                "DbClusterResourceId": "cluster-4RPUNJNPDOJZ2BWCMBMNMBA7LE",
+                "DBClusterArn": "arn:aws:rds:us-east-1:644160558196:cluster:database-2",
+                "AssociatedRoles": [],
+                "IAMDatabaseAuthenticationEnabled": false,
+                "ClusterCreateTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 57,
+                    "second": 20,
+                    "microsecond": 403000
+                },
+                "Capacity": 2,
+                "EngineMode": "serverless",
+                "ScalingConfigurationInfo": {
+                    "MinCapacity": 2,
+                    "MaxCapacity": 384,
+                    "AutoPause": false,
+                    "SecondsUntilAutoPause": 300,
+                    "TimeoutAction": "RollbackCapacityChange"
+                },
+                "DeletionProtection": false,
+                "HttpEndpointEnabled": false,
+                "ActivityStreamStatus": "stopped",
+                "CopyTagsToSnapshot": true,
+                "CrossAccountClone": false,
+                "DomainMemberships": [],
+                "TagList": []
+            }
+        ],
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_modify_rds_cluster_serverless_v2/rds.DescribeDBClusters_2.json b/tests/data/placebo/test_modify_rds_cluster_serverless_v2/rds.DescribeDBClusters_2.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_modify_rds_cluster_serverless_v2/rds.DescribeDBClusters_2.json
@@ -0,0 +1,90 @@
+{
+    "status_code": 200,
+    "data": {
+        "DBClusters": [
+            {
+                "AllocatedStorage": 1,
+                "AvailabilityZones": [
+                    "us-east-1b",
+                    "us-east-1e",
+                    "us-east-1a"
+                ],
+                "BackupRetentionPeriod": 8,
+                "DBClusterIdentifier": "database-2",
+                "DBClusterParameterGroup": "default.aurora-postgresql11",
+                "DBSubnetGroup": "default",
+                "Status": "available",
+                "EarliestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 58,
+                    "second": 29,
+                    "microsecond": 347000
+                },
+                "Endpoint": "database-2.cluster-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+                "MultiAZ": false,
+                "Engine": "aurora-postgresql",
+                "EngineVersion": "11.16",
+                "LatestRestorableTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 15,
+                    "minute": 13,
+                    "second": 55,
+                    "microsecond": 930000
+                },
+                "Port": 5432,
+                "MasterUsername": "postgres",
+                "PreferredBackupWindow": "10:02-10:32",
+                "PreferredMaintenanceWindow": "fri:07:40-fri:08:10",
+                "ReadReplicaIdentifiers": [],
+                "DBClusterMembers": [],
+                "VpcSecurityGroups": [
+                    {
+                        "VpcSecurityGroupId": "sg-6c7fa917",
+                        "Status": "active"
+                    }
+                ],
+                "HostedZoneId": "Z2R2ITUGPM61AM",
+                "StorageEncrypted": true,
+                "KmsKeyId": "arn:aws:kms:us-east-1:644160558196:key/b10f842a-feb7-4318-92d5-0640a75b7688",
+                "DbClusterResourceId": "cluster-4RPUNJNPDOJZ2BWCMBMNMBA7LE",
+                "DBClusterArn": "arn:aws:rds:us-east-1:644160558196:cluster:database-2",
+                "AssociatedRoles": [],
+                "IAMDatabaseAuthenticationEnabled": false,
+                "ClusterCreateTime": {
+                    "__class__": "datetime",
+                    "year": 2023,
+                    "month": 8,
+                    "day": 7,
+                    "hour": 14,
+                    "minute": 57,
+                    "second": 20,
+                    "microsecond": 403000
+                },
+                "Capacity": 2,
+                "EngineMode": "serverless",
+                "ScalingConfigurationInfo": {
+                    "MinCapacity": 2,
+                    "MaxCapacity": 384,
+                    "AutoPause": false,
+                    "SecondsUntilAutoPause": 300,
+                    "TimeoutAction": "RollbackCapacityChange"
+                },
+                "DeletionProtection": false,
+                "HttpEndpointEnabled": false,
+                "ActivityStreamStatus": "stopped",
+                "CopyTagsToSnapshot": true,
+                "CrossAccountClone": false,
+                "DomainMemberships": [],
+                "TagList": []
+            }
+        ],
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_modify_rds_cluster_serverless_v2/rds.ModifyDBCluster_1.json b/tests/data/placebo/test_modify_rds_cluster_serverless_v2/rds.ModifyDBCluster_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_modify_rds_cluster_serverless_v2/rds.ModifyDBCluster_1.json
@@ -0,0 +1,87 @@
+{
+    "status_code": 200,
+    "data": {
+        "DBCluster": {
+            "AllocatedStorage": 1,
+            "AvailabilityZones": [
+                "us-east-1b",
+                "us-east-1e",
+                "us-east-1a"
+            ],
+            "BackupRetentionPeriod": 8,
+            "DBClusterIdentifier": "database-2",
+            "DBClusterParameterGroup": "default.aurora-postgresql11",
+            "DBSubnetGroup": "default",
+            "Status": "available",
+            "EarliestRestorableTime": {
+                "__class__": "datetime",
+                "year": 2023,
+                "month": 8,
+                "day": 7,
+                "hour": 14,
+                "minute": 58,
+                "second": 29,
+                "microsecond": 347000
+            },
+            "Endpoint": "database-2.cluster-cz6wy8cci3uf.us-east-1.rds.amazonaws.com",
+            "MultiAZ": false,
+            "Engine": "aurora-postgresql",
+            "EngineVersion": "11.16",
+            "LatestRestorableTime": {
+                "__class__": "datetime",
+                "year": 2023,
+                "month": 8,
+                "day": 7,
+                "hour": 15,
+                "minute": 13,
+                "second": 55,
+                "microsecond": 930000
+            },
+            "Port": 5432,
+            "MasterUsername": "postgres",
+            "PreferredBackupWindow": "10:02-10:32",
+            "PreferredMaintenanceWindow": "fri:07:40-fri:08:10",
+            "ReadReplicaIdentifiers": [],
+            "DBClusterMembers": [],
+            "VpcSecurityGroups": [
+                {
+                    "VpcSecurityGroupId": "sg-6c7fa917",
+                    "Status": "active"
+                }
+            ],
+            "HostedZoneId": "Z2R2ITUGPM61AM",
+            "StorageEncrypted": true,
+            "KmsKeyId": "arn:aws:kms:us-east-1:644160558196:key/b10f842a-feb7-4318-92d5-0640a75b7688",
+            "DbClusterResourceId": "cluster-4RPUNJNPDOJZ2BWCMBMNMBA7LE",
+            "DBClusterArn": "arn:aws:rds:us-east-1:644160558196:cluster:database-2",
+            "AssociatedRoles": [],
+            "IAMDatabaseAuthenticationEnabled": false,
+            "ClusterCreateTime": {
+                "__class__": "datetime",
+                "year": 2023,
+                "month": 8,
+                "day": 7,
+                "hour": 14,
+                "minute": 57,
+                "second": 20,
+                "microsecond": 403000
+            },
+            "Capacity": 2,
+            "EngineMode": "serverless",
+            "ScalingConfigurationInfo": {
+                "MinCapacity": 2,
+                "MaxCapacity": 384,
+                "AutoPause": false,
+                "SecondsUntilAutoPause": 300,
+                "TimeoutAction": "RollbackCapacityChange"
+            },
+            "DeletionProtection": false,
+            "HttpEndpointEnabled": false,
+            "CopyTagsToSnapshot": true,
+            "CrossAccountClone": false,
+            "DomainMemberships": [],
+            "TagList": []
+        },
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/test_rdscluster.py b/tests/test_rdscluster.py
--- a/tests/test_rdscluster.py
+++ b/tests/test_rdscluster.py
@@ -239,6 +239,49 @@ def test_modify_rds_cluster(self):
             DBClusterIdentifier='mytest')
         self.assertFalse(cluster['DBClusters'][0]['DeletionProtection'])
 
+
+    def test_modify_rds_cluster_provisoned(self):
+        session_factory = self.replay_flight_data("test_modify_rds_cluster_provisoned")
+        p = self.load_policy(
+            {
+                "name": "modify-db-cluster",
+                "resource": "rds-cluster",
+                "filters": [
+                    {"type": "value", "key": "DBClusterIdentifier", "value": "database-1"}
+                ],
+                "actions": [{"type": "retention", "days": 7}],
+            },
+            session_factory=session_factory, config={'account_id': '644160558196'}
+        )
+        resources = p.run()
+        self.assertEqual(len(resources), 1)
+        self.assertEqual(resources[0].get("DBClusterIdentifier", 0), "database-1")
+        client = session_factory().client("rds")
+        cluster = client.describe_db_clusters(
+            DBClusterIdentifier="database-1")
+        self.assertEqual(cluster['DBClusters'][0]['BackupRetentionPeriod'], 7)
+
+    def test_modify_rds_cluster_serverless_v2(self):
+        session_factory = self.replay_flight_data("test_modify_rds_cluster_serverless_v2")
+        p = self.load_policy(
+            {
+                "name": "modify-db-cluster",
+                "resource": "rds-cluster",
+                "filters": [
+                    {"type": "value", "key": "DBClusterIdentifier", "value": "database-2"}
+                ],
+                "actions": [{"type": "retention", "days": 8}],
+            },
+            session_factory=session_factory, config={'account_id': '644160558196'}
+        )
+        resources = p.run()
+        self.assertEqual(len(resources), 1)
+        self.assertEqual(resources[0].get("DBClusterIdentifier", 0), "database-2")
+        client = session_factory().client("rds")
+        cluster = client.describe_db_clusters(
+            DBClusterIdentifier="database-2")
+        self.assertEqual(cluster['DBClusters'][0]['BackupRetentionPeriod'],8)
+
     def test_rdscluster_tag_augment(self):
         session_factory = self.replay_flight_data("test_rdscluster_tag_augment")
         p = self.load_policy(