Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tech debt: Migrate mq resources to AWS SDK for Go v2 #35187

Merged
merged 14 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ci/.golangci2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ linters-settings:
- argument
ignored-functions:
# AWS Go SDK
- aws.Int32
- aws.Int64
- request.ConstantWaiterDelay
- request.WithWaiterMaxAttempts
Expand Down
5 changes: 0 additions & 5 deletions internal/conns/awsclient_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion internal/enum/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ import (
)

func Validate[T Valueser[T]]() schema.SchemaValidateDiagFunc {
return validation.ToDiagFunc(validation.StringInSlice(Values[T](), false))
return validate[T](false)
}

func ValidateIgnoreCase[T Valueser[T]]() schema.SchemaValidateDiagFunc {
return validate[T](true)
}

func validate[T Valueser[T]](ignoreCase bool) schema.SchemaValidateDiagFunc {
return validation.ToDiagFunc(validation.StringInSlice(Values[T](), ignoreCase))
}

// TODO Move to internal/framework/validators or replace with custom types.
Expand Down
12 changes: 6 additions & 6 deletions internal/service/lambda/event_source_mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"testing"
"time"

"github.com/aws/aws-sdk-go-v2/service/kafka"
"github.com/aws/aws-sdk-go-v2/service/mq"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/kafka"
"github.com/aws/aws-sdk-go/service/lambda"
"github.com/aws/aws-sdk-go/service/mq"
"github.com/aws/aws-sdk-go/service/secretsmanager"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
Expand Down Expand Up @@ -1210,11 +1210,11 @@ func TestAccLambdaEventSourceMapping_documentDB(t *testing.T) {
}

func testAccPreCheckMQ(ctx context.Context, t *testing.T) {
conn := acctest.Provider.Meta().(*conns.AWSClient).MQConn(ctx)
conn := acctest.Provider.Meta().(*conns.AWSClient).MQClient(ctx)

input := &mq.ListBrokersInput{}

_, err := conn.ListBrokersWithContext(ctx, input)
_, err := conn.ListBrokers(ctx, input)

if acctest.PreCheckSkipError(err) {
t.Skipf("skipping acceptance testing: %s", err)
Expand All @@ -1226,11 +1226,11 @@ func testAccPreCheckMQ(ctx context.Context, t *testing.T) {
}

func testAccPreCheckMSK(ctx context.Context, t *testing.T) {
conn := acctest.Provider.Meta().(*conns.AWSClient).KafkaConn(ctx)
conn := acctest.Provider.Meta().(*conns.AWSClient).KafkaClient(ctx)

input := &kafka.ListClustersInput{}

_, err := conn.ListClustersWithContext(ctx, input)
_, err := conn.ListClusters(ctx, input)

if acctest.PreCheckSkipError(err) {
t.Skipf("skipping acceptance testing: %s", err)
Expand Down
Loading
Loading