@@ -196,7 +196,6 @@ func createReplicaUpdate(replica *v1alpha1.CreateReplicationGroupMemberAction) s
196
196
func updateReplicaUpdate (replica * v1alpha1.CreateReplicationGroupMemberAction ) svcsdktypes.ReplicationGroupUpdate {
197
197
replicaUpdate := svcsdktypes.ReplicationGroupUpdate {}
198
198
updateAction := & svcsdktypes.UpdateReplicationGroupMemberAction {}
199
- isValidUpdate := false // updates to gsi without ProvisionedThroughputOverride are invalid
200
199
201
200
if replica .RegionName != nil {
202
201
updateAction .RegionName = aws .String (* replica .RegionName )
@@ -205,20 +204,17 @@ func updateReplicaUpdate(replica *v1alpha1.CreateReplicationGroupMemberAction) s
205
204
206
205
if replica .KMSMasterKeyID != nil {
207
206
updateAction .KMSMasterKeyId = aws .String (* replica .KMSMasterKeyID )
208
- isValidUpdate = true
209
207
}
210
208
211
209
if replica .TableClassOverride != nil {
212
210
updateAction .TableClassOverride = svcsdktypes .TableClass (* replica .TableClassOverride )
213
- isValidUpdate = true
214
211
}
215
212
216
213
if replica .ProvisionedThroughputOverride != nil &&
217
214
replica .ProvisionedThroughputOverride .ReadCapacityUnits != nil {
218
215
updateAction .ProvisionedThroughputOverride = & svcsdktypes.ProvisionedThroughputOverride {
219
216
ReadCapacityUnits : replica .ProvisionedThroughputOverride .ReadCapacityUnits ,
220
217
}
221
- isValidUpdate = true
222
218
}
223
219
224
220
// Only include GSIs that have provisioned throughput overrides
@@ -232,16 +228,21 @@ func updateReplicaUpdate(replica *v1alpha1.CreateReplicationGroupMemberAction) s
232
228
ReadCapacityUnits : gsi .ProvisionedThroughputOverride .ReadCapacityUnits ,
233
229
},
234
230
})
235
- isValidUpdate = true
236
231
}
237
232
}
238
233
239
- // Only set GlobalSecondaryIndexes if we have GSIs with throughput overrides
240
234
if len (gsisWithOverrides ) > 0 {
241
235
updateAction .GlobalSecondaryIndexes = gsisWithOverrides
242
236
}
243
237
244
- if isValidUpdate {
238
+ // Check if there are any actual updates to perform
239
+ // replica GSI updates are invalid updates since the GSI already exists on the source table
240
+ hasUpdates := updateAction .KMSMasterKeyId != nil ||
241
+ updateAction .TableClassOverride != "" ||
242
+ updateAction .ProvisionedThroughputOverride != nil ||
243
+ len (updateAction .GlobalSecondaryIndexes ) > 0
244
+
245
+ if hasUpdates {
245
246
replicaUpdate .Update = updateAction
246
247
return replicaUpdate
247
248
}
0 commit comments