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

feat: Udpate EKS to use aws-sdk-go-v2 #34114

Merged
merged 47 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
83dbd0f
feat: Udpate EKS to use aws-sdk-go-v2
bryantbiggs Oct 16, 2023
58da046
chore: Lint corrections
bryantbiggs Oct 25, 2023
ddb72d0
Revert "chore: Lint corrections"
ewbankkit Nov 6, 2023
9a04832
Revert "feat: Udpate EKS to use aws-sdk-go-v2"
ewbankkit Nov 6, 2023
8e08fa4
Merge branch 'main' into HEAD
ewbankkit Nov 6, 2023
4be47f8
Use AWS SDK for Go v2 for eks service.
ewbankkit Nov 6, 2023
bb02894
Add 'names.EKSEndpointID'.
ewbankkit Nov 6, 2023
9723301
eks: Generate AWS SDK for Go v2 tagging code.
ewbankkit Nov 6, 2023
d7c0c4b
Run 'make gen'.
ewbankkit Nov 6, 2023
46c04f9
Run 'go get github.com/aws/aws-sdk-go-v2/service/eks@v1.32.0 && go mo…
ewbankkit Nov 6, 2023
6462c7f
d/aws_eks_addon: Migrate to AWS SDK for Go v2.
ewbankkit Nov 6, 2023
d0d21f5
d/aws_eks_addon_version: Migrate to AWS SDK for Go v2.
ewbankkit Nov 6, 2023
176c462
r/aws_eks_addon: Migrate to AWS SDK for Go v2.
ewbankkit Nov 6, 2023
5fbd3f6
Use AWS SDK for Go v2 for sts service.
ewbankkit Nov 7, 2023
b1835d7
Add 'names.STSEndpointID'.
ewbankkit Nov 7, 2023
0aebe60
Run 'make gen'.
ewbankkit Nov 7, 2023
793b112
Run 'go get github.com/aws/aws-sdk-go-v2/service/sts@v1.25.0 && go mo…
ewbankkit Nov 7, 2023
98c6eec
Add 'NewClient' for sts package.
ewbankkit Nov 7, 2023
d4407d1
d/aws_caller_identity: Migrate to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
9e18a70
acctest: sts uses AWS SDK for Go v2.
ewbankkit Nov 7, 2023
fb97974
Remove 'TestAccProvider_Region_stsRegion' as it can't be tested with …
ewbankkit Nov 7, 2023
badfc5e
dms: Remove 'testAccPreCheckEKS' -- it's not needed.
ewbankkit Nov 7, 2023
c719d86
d/aws_caller_identity: Migrate acceptance tests to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
7fb1084
Use AWS SDK for Go v1 & v2 for sts service.
ewbankkit Nov 7, 2023
36c898f
Run 'make gen'.
ewbankkit Nov 7, 2023
f8066d3
Restore 'NewConn' for sts package.
ewbankkit Nov 7, 2023
4675147
Revert "Remove 'TestAccProvider_Region_stsRegion' as it can't be test…
ewbankkit Nov 7, 2023
1ead577
d/aws_eks_cluster_auth: Migrate to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
28f927c
r/aws_eks_identity_provider_config: Migrate to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
06f4127
d/aws_eks_node_groups: Migrate to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
491792a
d/aws_eks_clusters: Migrate to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
fba818b
r/aws_eks_fargate_profile: Migrate to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
a9e5e2d
r/aws_eks_node_group: Migrate to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
6ce7e1e
d/aws_eks_node_group: Migrate to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
4df1e76
r/aws_eks_cluster: Migrate to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
8c561ce
d/aws_eks_cluster: Migrate to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
55b77a8
eks: Migrate sweepers to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
b20f095
Add 'names.ChinaPartitionID'.
ewbankkit Nov 7, 2023
dd5c928
eks: Migrate 'Canonicalize' to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
9d99201
eks: Migrate acceptance tests to AWS SDK for Go v2.
ewbankkit Nov 7, 2023
733736b
Fix 'TestAccEKSCluster_Network_ipFamily'.
ewbankkit Nov 8, 2023
d1d43ba
internal/slices: 'RemoveAll' varargs.
ewbankkit Nov 8, 2023
8386ad0
internal/enum: Add 'EnumValues' function.
ewbankkit Nov 8, 2023
e4e11d5
r/aws_eks_cluster: Correct 'expandLogging'.
ewbankkit Nov 8, 2023
f5c4cc2
r/aws_eks_cluster: Update Kubernetes versions for acceptance tests.
ewbankkit Nov 8, 2023
2f55a5c
Correct vpc-cni add-on versions in acceptance tests.
ewbankkit Nov 8, 2023
1c2ec47
Fix 'TestAccEKSNodeGroup_releaseVersion'.
ewbankkit Nov 8, 2023
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
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/directoryservice v1.21.0
github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.5.0
github.com/aws/aws-sdk-go-v2/service/ec2 v1.130.0
github.com/aws/aws-sdk-go-v2/service/eks v1.32.0
github.com/aws/aws-sdk-go-v2/service/emrserverless v1.13.0
github.com/aws/aws-sdk-go-v2/service/finspace v1.16.0
github.com/aws/aws-sdk-go-v2/service/fis v1.19.0
Expand Down Expand Up @@ -70,6 +71,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/ssm v1.42.0
github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.19.0
github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.25.0
github.com/aws/aws-sdk-go-v2/service/sts v1.25.0
github.com/aws/aws-sdk-go-v2/service/swf v1.19.0
github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.22.0
github.com/aws/aws-sdk-go-v2/service/transcribe v1.31.0
Expand Down Expand Up @@ -139,7 +141,6 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.17.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.25.0 // indirect
github.com/aws/smithy-go v1.16.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/boombuler/barcode v1.0.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ github.com/aws/aws-sdk-go-v2/service/dynamodb v1.23.0 h1:xmSAn14nM6IdHyuWO/bsrAa
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.23.0/go.mod h1:1HkLh8vaL4obF95fne7ZOu7sxomS/+vkBt3/+gqqwE4=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.130.0 h1:a7CPCX/m+owAiAqcK8W9/SoB7EA4QUE4BddYdFyEGco=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.130.0/go.mod h1:EJlGVMO5zynmSDdvwJfFa2RzAZoHI4gVJER0h82/dYk=
github.com/aws/aws-sdk-go-v2/service/eks v1.32.0 h1:w8O52S+rH0026BqntZs55OWbV8Huq8VhXL9bSixCRYc=
github.com/aws/aws-sdk-go-v2/service/eks v1.32.0/go.mod h1:l13fsSUzq27egNlyKBw4l0+mOSwa5Kt6r3JmJblYt14=
github.com/aws/aws-sdk-go-v2/service/emrserverless v1.13.0 h1:y56k/4nfqSV8iQ7Us/TnoXhTqlhWz//V5uxQdfMbMKE=
github.com/aws/aws-sdk-go-v2/service/emrserverless v1.13.0/go.mod h1:IGFmVFAav4kjHb/AjYiu677R0hvU9Knhy3MwkEcvdjw=
github.com/aws/aws-sdk-go-v2/service/finspace v1.16.0 h1:vUaANfye60JdQ6naelwbw30GO5qJzv+Ks1+R3JjcW7o=
Expand Down
4 changes: 2 additions & 2 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ func PreCheckOrganizationManagementAccount(ctx context.Context, t *testing.T) {
t.Fatalf("describing AWS Organization: %s", err)
}

callerIdentity, err := tfsts.FindCallerIdentity(ctx, Provider.Meta().(*conns.AWSClient).STSConn(ctx))
callerIdentity, err := tfsts.FindCallerIdentity(ctx, Provider.Meta().(*conns.AWSClient).STSClient(ctx))

if err != nil {
t.Fatalf("getting current identity: %s", err)
Expand All @@ -997,7 +997,7 @@ func PreCheckOrganizationMemberAccount(ctx context.Context, t *testing.T) {
t.Fatalf("describing AWS Organization: %s", err)
}

callerIdentity, err := tfsts.FindCallerIdentity(ctx, Provider.Meta().(*conns.AWSClient).STSConn(ctx))
callerIdentity, err := tfsts.FindCallerIdentity(ctx, Provider.Meta().(*conns.AWSClient).STSClient(ctx))

if err != nil {
t.Fatalf("getting current identity: %s", err)
Expand Down
11 changes: 8 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.

8 changes: 5 additions & 3 deletions internal/enum/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ type Valueser[T ~string] interface {
Values() []T
}

func Values[T Valueser[T]]() []string {
l := T("").Values()
func EnumValues[T Valueser[T]]() []T {
return T("").Values()
}

return Slice(l...)
func Values[T Valueser[T]]() []string {
return Slice(EnumValues[T]()...)
}

func Slice[T Valueser[T]](l ...T) []string {
Expand Down
28 changes: 28 additions & 0 deletions internal/enum/values_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package enum

import (
"testing"

"github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types"
"github.com/google/go-cmp/cmp"
)

func TestValues(t *testing.T) {
t.Parallel()

want := []string{
"READ",
"WRITE",
"READ_ACP",
"WRITE_ACP",
"FULL_CONTROL",
}
got := Values[types.AclPermission]()

if diff := cmp.Diff(got, want); diff != "" {
t.Errorf("unexpected diff (+wanted, -got): %s", diff)
}
}
19 changes: 1 addition & 18 deletions internal/service/dms/event_subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/aws/aws-sdk-go/aws"
dms "github.com/aws/aws-sdk-go/service/databasemigrationservice"
"github.com/aws/aws-sdk-go/service/eks"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
Expand Down Expand Up @@ -168,7 +167,7 @@ func TestAccDMSEventSubscription_tags(t *testing.T) {
resourceName := "aws_dms_event_subscription.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckEKS(ctx, t) },
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx),
Expand Down Expand Up @@ -387,19 +386,3 @@ resource "aws_dms_event_subscription" "test" {
}
`, rName, tagKey1, tagValue1, tagKey2, tagValue2))
}

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

input := &eks.ListClustersInput{}

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

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

if err != nil {
t.Fatalf("unexpected PreCheck error: %s", err)
}
}
Loading
Loading