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 @@ -100,6 +100,7 @@ def _validate_version_upgrade(self) -> None:
100
100
continue
101
101
current_version = u .change .before ["engine_version" ]
102
102
desired_version = u .change .after ["engine_version" ]
103
+ db_name = u .change .after ["identifier" ]
103
104
if current_version != desired_version :
104
105
valid_upgrade_targets = self .aws_api .get_rds_valid_upgrade_targets (
105
106
u .change .before ["engine" ], current_version
@@ -120,6 +121,11 @@ def _validate_version_upgrade(self) -> None:
120
121
self .errors .append (
121
122
"To enable major version upgrade, allow_major_version_upgrade attribute must be set to True"
122
123
)
124
+ # Read replica removal validation
125
+ if len (u .change .after ["replicas" ]) > 0 :
126
+ self .errors .append (
127
+ f"The primary database, { db_name } , has a read replica associated with it. Please remove the replica before upgrading the primary database"
128
+ )
123
129
124
130
def _validate_deletion_protection_not_enabled_on_destroy (self ) -> None :
125
131
for u in self .aws_db_instance_deletions :
You can’t perform that action at this time.
0 commit comments