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

ssoadmin: upgrade client to aws sdk v2 #34646

Merged
merged 12 commits into from
Nov 30, 2023
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 go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/ssm v1.44.1
github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.20.1
github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.27.1
github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.23.1
github.com/aws/aws-sdk-go-v2/service/sts v1.26.1
github.com/aws/aws-sdk-go-v2/service/swf v1.20.1
github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.23.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.27.1 h1:1eP1sAN5FDkKwgM7B/0
github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.27.1/go.mod h1:3dHBotx1TNQmPzo0H62Kl2rJF21cBDUQHtQ3ajDK0H8=
github.com/aws/aws-sdk-go-v2/service/sso v1.18.1 h1:V40g2daNO3l1J94JYwqfkyvQMYXi5I25fs3fNQW8iDs=
github.com/aws/aws-sdk-go-v2/service/sso v1.18.1/go.mod h1:0ZWQJP/mBOUxkCvZKybZNz1XmdUKSBxoF0dzgfxtvDs=
github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.23.1 h1:m5TwU4+qNT3G7LfjOyAcscY+Td0L2jVZus8hd+gU7g0=
github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.23.1/go.mod h1:e8g8LmmUKSu5dtDpsVu1cypJzqQNkeqdgfm4n2wOnVw=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.1 h1:uQrj7SpUNC3r55vc1CDh3qV9wJC66lz546xM9dhSo5s=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.1/go.mod h1:oyaTk5xEAOuPXX1kCD7HmIeuLqdj3Bk5yGkqGXtGi14=
github.com/aws/aws-sdk-go-v2/service/sts v1.26.1 h1:K33V7L0XDdb23FMOZySr8bon1jou5SHn1fiv7NJ1SUg=
Expand Down
32 changes: 15 additions & 17 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/aws/aws-sdk-go-v2/service/inspector2"
inspector2types "github.com/aws/aws-sdk-go-v2/service/inspector2/types"
"github.com/aws/aws-sdk-go-v2/service/ssoadmin"
ssoadmintypes "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/arn"
"github.com/aws/aws-sdk-go/aws/endpoints"
Expand All @@ -29,7 +31,6 @@ import (
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/aws/aws-sdk-go/service/outposts"
"github.com/aws/aws-sdk-go/service/ssoadmin"
"github.com/aws/aws-sdk-go/service/wafv2"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
"github.com/hashicorp/terraform-plugin-go/tfprotov5"
Expand Down Expand Up @@ -1029,31 +1030,28 @@ func PreCheckOrganizationMemberAccount(ctx context.Context, t *testing.T) {
}

func PreCheckSSOAdminInstances(ctx context.Context, t *testing.T) {
conn := Provider.Meta().(*conns.AWSClient).SSOAdminConn(ctx)
conn := Provider.Meta().(*conns.AWSClient).SSOAdminClient(ctx)
input := &ssoadmin.ListInstancesInput{}
var instances []*ssoadmin.InstanceMetadata
var instances []ssoadmintypes.InstanceMetadata

err := conn.ListInstancesPagesWithContext(ctx, input, func(page *ssoadmin.ListInstancesOutput, lastPage bool) bool {
if page == nil {
return !lastPage
paginator := ssoadmin.NewListInstancesPaginator(conn, input)
for paginator.HasMorePages() {
page, err := paginator.NextPage(ctx)
if PreCheckSkipError(err) {
t.Skipf("skipping tests: %s", err)
}
if err != nil {
t.Fatalf("listing SSO Instances: %s", err)
}

instances = append(instances, page.Instances...)

return !lastPage
})

if PreCheckSkipError(err) {
t.Skipf("skipping tests: %s", err)
if page != nil {
instances = append(instances, page.Instances...)
}
}

if len(instances) == 0 {
t.Skip("skipping tests; no SSO Instances found.")
}

if err != nil {
t.Fatalf("listing SSO Instances: %s", err)
}
}

func PreCheckHasIAMRole(ctx context.Context, t *testing.T, roleName string) {
Expand Down
6 changes: 3 additions & 3 deletions internal/conns/awsclient_gen.go

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

Loading
Loading