File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ def _validate_version_upgrade(self) -> None:
102
102
continue
103
103
current_version = u .change .before ["engine_version" ]
104
104
desired_version = u .change .after ["engine_version" ]
105
+ db_name = u .change .after ["identifier" ]
105
106
if current_version != desired_version :
106
107
valid_update_versions = self .aws_api .get_rds_valid_update_versions (
107
108
u .change .before ["engine" ], current_version
@@ -128,6 +129,11 @@ def _validate_version_upgrade(self) -> None:
128
129
self .errors .append (
129
130
"To enable major version ugprades, allow_major_version_upgrade attribute must be set to True"
130
131
)
132
+ # Read replica removal validation
133
+ if len (u .change .after ["replicas" ]) > 0 :
134
+ self .errors .append (
135
+ f"The primary database, { db_name } , has a read replica associated with it. Please remove the replica before upgrading the primary database"
136
+ )
131
137
132
138
def _validate_deletion_protection_not_enabled_on_destroy (self ) -> None :
133
139
for u in self .aws_db_instance_deletions :
You can’t perform that action at this time.
0 commit comments