Skip to content

Commit

Permalink
r/gamelift_script: Migrate to AWS SDK v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mattburgess committed Jul 16, 2024
1 parent 2b6ec3e commit 4927ab2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion internal/service/gamelift/gamelift_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/gamelift"
awstypes "github.com/aws/aws-sdk-go-v2/service/gamelift/types"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
Expand Down
7 changes: 3 additions & 4 deletions internal/service/gamelift/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/gamelift"
awstypes "github.com/aws/aws-sdk-go-v2/service/gamelift/types"
"github.com/hashicorp/aws-sdk-go-base/v2/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down Expand Up @@ -125,14 +124,14 @@ func resourceScriptCreate(ctx context.Context, d *schema.ResourceData, meta inte
input.ZipFile = file
}

log.Printf("[INFO] Creating GameLift Script: %s", input)
log.Printf("[INFO] Creating GameLift Script: %+v", input)
var out *gamelift.CreateScriptOutput
err := retry.RetryContext(ctx, propagationTimeout, func() *retry.RetryError {
var err error
out, err = conn.CreateScript(ctx, &input)
if err != nil {
if tfawserr.ErrMessageContains(err, awstypes.ErrCodeInvalidRequestException, "GameLift cannot assume the role") ||
tfawserr.ErrMessageContains(err, awstypes.ErrCodeInvalidRequestException, "Provided resource is not accessible") {
if errs.IsAErrorMessageContains[*awstypes.InvalidRequestException](err, "GameLift cannot assume the role") ||
errs.IsAErrorMessageContains[*awstypes.InvalidRequestException](err, "Provided resource is not accessible") {
return retry.RetryableError(err)
}
return retry.NonRetryableError(err)
Expand Down
1 change: 0 additions & 1 deletion internal/service/gamelift/script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/YakDriver/regexache"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/gamelift"
awstypes "github.com/aws/aws-sdk-go-v2/service/gamelift/types"
sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
Expand Down

0 comments on commit 4927ab2

Please sign in to comment.