@@ -247,12 +247,12 @@ func (d dynamoTableClient) UpdateTable(ctx context.Context, current, expected Ta
247
247
enableAutoScaling := ! current .WriteScaleEnabled && expected .WriteScaleEnabled
248
248
updateAutoScaling := current .WriteScaleEnabled && expected .WriteScaleEnabled && ! current .AutoScalingEquals (expected )
249
249
if disableAutoScaling {
250
- err := d .disableAutoScaling (ctx , current )
250
+ err := d .disableAutoScaling (ctx , expected )
251
251
if err != nil {
252
252
return err
253
253
}
254
254
} else if enableAutoScaling || updateAutoScaling {
255
- err := d .enableAutoScaling (ctx , current )
255
+ err := d .enableAutoScaling (ctx , expected )
256
256
if err != nil {
257
257
return err
258
258
}
@@ -306,7 +306,7 @@ func (d dynamoTableClient) UpdateTable(ctx context.Context, current, expected Ta
306
306
}
307
307
308
308
func (d dynamoTableClient ) enableAutoScaling (ctx context.Context , desc TableDesc ) error {
309
- // Register scallable target
309
+ // Registers or updates a scallable target
310
310
if err := d .backoffAndRetry (ctx , func (ctx context.Context ) error {
311
311
return instrument .TimeRequestHistogram (ctx , "ApplicationAutoScaling.RegisterScalableTarget" , applicationAutoScalingRequestDuration , func (ctx context.Context ) error {
312
312
input := & applicationautoscaling.RegisterScalableTargetInput {
@@ -327,7 +327,7 @@ func (d dynamoTableClient) enableAutoScaling(ctx context.Context, desc TableDesc
327
327
return err
328
328
}
329
329
330
- // Put scaling policy
330
+ // Puts or updates a scaling policy
331
331
if err := d .backoffAndRetry (ctx , func (ctx context.Context ) error {
332
332
return instrument .TimeRequestHistogram (ctx , "ApplicationAutoScaling.PutScalingPolicy" , applicationAutoScalingRequestDuration , func (ctx context.Context ) error {
333
333
input := & applicationautoscaling.PutScalingPolicyInput {
0 commit comments