RDS instance restore to point in time - fix failing to copy DB subnet group (#7243)

This commit is contained in:
SoenkeD 2024-01-25 23:37:11 +01:00 committed by GitHub
parent 33024619eb
commit 876cfeaa9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1818,7 +1818,13 @@ class RDSBackend(BaseBackend):
db_instance = self.describe_db_instances(
db_instance_identifier=source_db_identifier
)[0]
new_instance_props = copy.deepcopy(db_instance.__dict__)
# remove the db subnet group as it cannot be copied
# and is not used in the restored instance
source_dict = db_instance.__dict__
del source_dict["db_subnet_group"]
new_instance_props = copy.deepcopy(source_dict)
if not db_instance.option_group_supplied:
# If the option group is not supplied originally, the 'option_group_name' will receive a default value
# Force this reconstruction, and prevent any validation on the default value