Skip to content

Commit

Permalink
Revert "Replace 'tfslices.Chunks' with 'slices.Chunk' - neptune."
Browse files Browse the repository at this point in the history
This reverts commit d42525b.
  • Loading branch information
jar-b committed Sep 10, 2024
1 parent 0c6c637 commit 8ec8670
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/service/neptune/cluster_parameter_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func modifyClusterParameterGroupParameters(ctx context.Context, conn *neptune.Cl
clusterParameterGroupMaxParamsBulkEdit = 20
)
// We can only modify 20 parameters at a time, so chunk them until we've got them all.
for chunk := range slices.Chunk(parameters, clusterParameterGroupMaxParamsBulkEdit) {
for _, chunk := range tfslices.Chunks(parameters, clusterParameterGroupMaxParamsBulkEdit) {
input := &neptune.ModifyDBClusterParameterGroupInput{
DBClusterParameterGroupName: aws.String(name),
Parameters: chunk,
Expand Down
6 changes: 3 additions & 3 deletions internal/service/neptune/parameter_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"context"
"fmt"
"log"
"slices"
"time"

"github.com/aws/aws-sdk-go-v2/aws"
Expand All @@ -21,6 +20,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/enum"
"github.com/hashicorp/terraform-provider-aws/internal/errs"
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices"
tftags "github.com/hashicorp/terraform-provider-aws/internal/tags"
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
"github.com/hashicorp/terraform-provider-aws/internal/verify"
Expand Down Expand Up @@ -226,7 +226,7 @@ func resourceParameterGroupDelete(ctx context.Context, d *schema.ResourceData, m
}

func addDBParameterGroupParameters(ctx context.Context, conn *neptune.Client, name string, parameters []awstypes.Parameter) error { // We can only modify 20 parameters at a time, so chunk them until we've got them all.
for chunk := range slices.Chunk(parameters, dbParameterGroupMaxParamsBulkEdit) {
for _, chunk := range tfslices.Chunks(parameters, dbParameterGroupMaxParamsBulkEdit) {
input := &neptune.ModifyDBParameterGroupInput{
DBParameterGroupName: aws.String(name),
Parameters: chunk,
Expand All @@ -243,7 +243,7 @@ func addDBParameterGroupParameters(ctx context.Context, conn *neptune.Client, na
}

func delDBParameterGroupParameters(ctx context.Context, conn *neptune.Client, name string, parameters []awstypes.Parameter) error { // We can only modify 20 parameters at a time, so chunk them until we've got them all.
for chunk := range slices.Chunk(parameters, dbParameterGroupMaxParamsBulkEdit) {
for _, chunk := range tfslices.Chunks(parameters, dbParameterGroupMaxParamsBulkEdit) {
input := &neptune.ResetDBParameterGroupInput{
DBParameterGroupName: aws.String(name),
Parameters: chunk,
Expand Down

0 comments on commit 8ec8670

Please sign in to comment.