Skip to content

Commit

Permalink
Merge pull request #35187 from hashicorp/td-migrate-mq-to-aws-sdk-v2
Browse files Browse the repository at this point in the history
Tech debt: Migrate `mq` resources to AWS SDK for Go v2
  • Loading branch information
ewbankkit authored Jan 8, 2024
2 parents b3ae860 + 7f24e55 commit b6d2bb4
Show file tree
Hide file tree
Showing 23 changed files with 481 additions and 480 deletions.
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

0 comments on commit b6d2bb4

Please sign in to comment.