Skip to content

Commit

Permalink
dynamodb: Original order
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Jul 2, 2022
1 parent c732d70 commit 28e1d4d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions internal/service/dynamodb/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -890,31 +890,31 @@ func resourceTableUpdate(d *schema.ResourceData, meta interface{}) error {
}
}

if d.HasChange("ttl") {
if err := updateTimeToLive(conn, d.Id(), d.Get("ttl").([]interface{}), d.Timeout(schema.TimeoutUpdate)); err != nil {
return fmt.Errorf("error updating DynamoDB Table (%s) time to live: %w", d.Id(), err)
}
}

if d.HasChange("tags_all") {
o, n := d.GetChange("tags_all")
if err := UpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating DynamoDB Table (%s) tags: %w", d.Id(), err)
}
}

if d.HasChange("replica") {
if err := updateReplica(d, conn, meta.(*conns.AWSClient).TerraformVersion); err != nil {
return fmt.Errorf("error updating DynamoDB Table (%s) replica: %w", d.Id(), err)
}
}

if d.HasChange("ttl") {
if err := updateTimeToLive(conn, d.Id(), d.Get("ttl").([]interface{}), d.Timeout(schema.TimeoutUpdate)); err != nil {
return fmt.Errorf("error updating DynamoDB Table (%s) time to live: %w", d.Id(), err)
}
}

if d.HasChange("point_in_time_recovery") {
if err := updatePITR(conn, d.Id(), d.Get("point_in_time_recovery.0.enabled").(bool), aws.StringValue(conn.Config.Region), meta.(*conns.AWSClient).TerraformVersion, d.Timeout(schema.TimeoutUpdate)); err != nil {
return fmt.Errorf("error updating DynamoDB Table (%s) point in time recovery: %w", d.Id(), err)
}
}

if d.HasChange("replica") {
if err := updateReplica(d, conn, meta.(*conns.AWSClient).TerraformVersion); err != nil {
return fmt.Errorf("error updating DynamoDB Table (%s) replica: %w", d.Id(), err)
}
}

return resourceTableRead(d, meta)
}

Expand Down

0 comments on commit 28e1d4d

Please sign in to comment.