Skip to content
Open
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
9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
)

require (
github.com/aws/aws-sdk-go-v2 v1.36.3
github.com/aws/aws-sdk-go-v2 v1.41.5
github.com/aws/aws-sdk-go-v2/credentials v1.17.46
github.com/aws/aws-sdk-go-v2/service/amplify v1.28.8
github.com/aws/aws-sdk-go-v2/service/backup v1.40.10
Expand All @@ -27,6 +27,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/ec2 v1.202.4
github.com/aws/aws-sdk-go-v2/service/efs v1.34.11
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0
github.com/aws/aws-sdk-go-v2/service/elasticache v1.52.0
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.12
github.com/aws/aws-sdk-go-v2/service/iam v1.38.1
github.com/aws/aws-sdk-go-v2/service/kafka v1.38.16
Expand Down Expand Up @@ -54,8 +55,8 @@ require (
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.41 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.32 // indirect
github.com/aws/aws-sdk-go-v2/service/acm v1.30.6 // indirect
Expand All @@ -78,7 +79,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/ssm v1.56.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 // indirect
github.com/aws/smithy-go v1.22.3 // indirect
github.com/aws/smithy-go v1.24.2 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
Expand Down
18 changes: 10 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aws/aws-sdk-go v1.55.7 h1:UJrkFq7es5CShfBwlWAC8DA077vp8PyVbQd3lqLiztE=
github.com/aws/aws-sdk-go v1.55.7/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM=
github.com/aws/aws-sdk-go-v2 v1.36.3/go.mod h1:LLXuLpgzEbD766Z5ECcRmi8AzSwfZItDtmABVkRLGzg=
github.com/aws/aws-sdk-go-v2 v1.41.5 h1:dj5kopbwUsVUVFgO4Fi5BIT3t4WyqIDjGKCangnV/yY=
github.com/aws/aws-sdk-go-v2 v1.41.5/go.mod h1:mwsPRE8ceUUpiTgF7QmQIJ7lgsKUPQOUl3o72QBrE1o=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc=
github.com/aws/aws-sdk-go-v2/config v1.28.5 h1:Za41twdCXbuyyWv9LndXxZZv3QhTG1DinqlFsSuvtI0=
Expand All @@ -28,10 +28,10 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 h1:sDSXIrlsFSFJtWKLQS4PUW
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20/go.mod h1:WZ/c+w0ofps+/OUqMwWgnfrgzZH1DZO1RIkktICsqnY=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.41 h1:hqcxMc2g/MwwnRMod9n6Bd+t+9Nf7d5qRg7RaXKPd6o=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.41/go.mod h1:d1eH0VrttvPmrCraU68LOyNdu26zFxQFjrVSb5vdhog=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 h1:ZK5jHhnrioRkUNOc+hOgQKlUL5JeC3S6JgLxtQ+Rm0Q=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34/go.mod h1:p4VfIceZokChbA9FzMbRGz5OV+lekcVtHlPKEO0gSZY=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 h1:SZwFm17ZUNNg5Np0ioo/gq8Mn6u9w19Mri8DnJ15Jf0=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34/go.mod h1:dFZsC0BLo346mvKQLWmoJxT+Sjp+qcVR1tRVHQGOH9Q=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 h1:Rgg6wvjjtX8bNHcvi9OnXWwcE0a2vGpbwmtICOsvcf4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21/go.mod h1:A/kJFst/nm//cyqonihbdpQZwiUhhzpqTsdbhDdRF9c=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 h1:PEgGVtPoB6NTpPrBgqSE5hE/o47Ij9qk/SEZFbUOe9A=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21/go.mod h1:p+hz+PRAYlY3zcpJhPwXlLC4C+kqn70WIHwnzAfs6ps=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.32 h1:OIHj/nAhVzIXGzbAE+4XmZ8FPvro3THr6NlqErJc3wY=
Expand Down Expand Up @@ -62,6 +62,8 @@ github.com/aws/aws-sdk-go-v2/service/efs v1.34.11 h1:PgeGNM3l3fg7UlFpIFEogySDrYs
github.com/aws/aws-sdk-go-v2/service/efs v1.34.11/go.mod h1:pH1iibM/aigOyMTkB9RFdGDXbofNRaLzh1qoh2fIp6E=
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0 h1:EYeOThTRysemFtC6J6h6b7dNg3jN03QuO5cg92ojIQE=
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0/go.mod h1:v1xXy6ea0PHtWkjFUvAUh6B/5wv7UF909Nru0dOIJDk=
github.com/aws/aws-sdk-go-v2/service/elasticache v1.52.0 h1:inluxH5ArTlQNGrFxP7RN5o5DEfP8bRbkPC/408Esgs=
github.com/aws/aws-sdk-go-v2/service/elasticache v1.52.0/go.mod h1:DxywiXnEB21757xcql9xCqgt8vyTxSB7tVEIOdfKIY8=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.12 h1:PLoBTtHl376mmxe5NSMUx1UD8yiM+BgIi9yJ1SgibHk=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.12/go.mod h1:h7JSZfD6QGeaAWpTk0+e1hQw2Venf5gh7UlUTEAiZL8=
github.com/aws/aws-sdk-go-v2/service/iam v1.38.1 h1:hfkzDZHBp9jAT4zcd5mtqckpU4E3Ax0LQaEWWk1VgN8=
Expand Down Expand Up @@ -106,8 +108,8 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.33.1 h1:6SZUVRQNvExYlMLbHdlKB48x0fLb
github.com/aws/aws-sdk-go-v2/service/sts v1.33.1/go.mod h1:GqWyYCwLXnlUB1lOAXQyNSPqPLQJvmo8J0DWBzp9mtg=
github.com/aws/aws-sdk-go-v2/service/wafv2 v1.58.0 h1:vJfgEyoSRn0E7Z3SwnXgA04xbp6/MiTFOE5Ypw/lbXw=
github.com/aws/aws-sdk-go-v2/service/wafv2 v1.58.0/go.mod h1:Zai6/lANvFn0uX9OKqPGy4C9a7TIcbnlzzM1EHTd3kE=
github.com/aws/smithy-go v1.22.3 h1:Z//5NuZCSW6R4PhQ93hShNbyBbn8BWCmCVCt+Q8Io5k=
github.com/aws/smithy-go v1.22.3/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=
github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng=
github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down
1 change: 0 additions & 1 deletion pkg/aws/amplify.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@ func StartDeploymentJob(t *testing.T, ctx context.Context, client *amplify.Clien
require.NoError(t, err)
return jobStart.JobSummary.JobId
}

2 changes: 1 addition & 1 deletion pkg/aws/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"

"github.com/aws/aws-sdk-go-v2/service/backup"
"github.com/stretchr/testify/require"
"github.com/gruntwork-io/terratest/modules/aws"
"github.com/stretchr/testify/require"
)

func NewBackupClient(t *testing.T, region string) *backup.Client {
Expand Down
3 changes: 2 additions & 1 deletion pkg/aws/documentdb.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package aws

import (
"testing"

"github.com/aws/aws-sdk-go-v2/service/docdb"
"github.com/gruntwork-io/terratest/modules/aws"
"github.com/stretchr/testify/require"
"testing"
)

func NewDocDBClient(t *testing.T, region string) *docdb.Client {
Expand Down
2 changes: 1 addition & 1 deletion pkg/aws/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
awstypes "github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/gruntwork-io/terratest/modules/aws"
"github.com/gruntwork-io/terratest/modules/aws"
"github.com/stretchr/testify/assert"
)

Expand Down
1 change: 0 additions & 1 deletion pkg/aws/efs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/stretchr/testify/require"
)


func NewEFSClient(t *testing.T, region string) *efs.Client {
client, err := NewEFSClientE(t, region)
require.NoError(t, err)
Expand Down
5 changes: 1 addition & 4 deletions pkg/aws/eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/eks"
"github.com/aws/aws-sdk-go-v2/service/eks/types"
terratestAWS "github.com/gruntwork-io/terratest/modules/aws"
"github.com/gruntwork-io/terratest/modules/testing"
terratestAWS "github.com/gruntwork-io/terratest/modules/aws"
"github.com/stretchr/testify/require"

"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -53,7 +53,6 @@ func CreateEksClusterE(t testing.TestingT, ctx context.Context, region string, n
},
RoleArn: aws.String(roleArn),
})

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -98,7 +97,6 @@ func NewEksClientE(t testing.TestingT, region string) (*eks.Client, error) {
return eks.NewFromConfig(*sess), nil
}


func NewK8SClientConfig(cluster *types.Cluster) (*rest.Config, error) {
gen, err := token.NewGenerator(true, false)
if err != nil {
Expand All @@ -125,7 +123,6 @@ func NewK8SClientConfig(cluster *types.Cluster) (*rest.Config, error) {
}, nil
}


func NewK8SClientset(cluster *types.Cluster) (*kubernetes.Clientset, error) {
config, err := NewK8SClientConfig(cluster)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/aws/eks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"time"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/eks/types"
"github.com/aws/aws-sdk-go-v2/service/iam"
"github.com/aws/aws-sdk-go-v2/service/eks/types"
"github.com/gruntwork-io/terratest/modules/retry"
terratestAWS "github.com/gruntwork-io/terratest/modules/aws"
"github.com/gruntwork-io/terratest/modules/retry"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -67,4 +67,4 @@ func TestEksCluster(t *testing.T) {

assert.Nil(t, err)
assert.Equal(t, "terratest", *c2.Name)
}
}
25 changes: 25 additions & 0 deletions pkg/aws/elasticache.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package aws

import (
"testing"

"github.com/aws/aws-sdk-go-v2/service/elasticache"
"github.com/gruntwork-io/terratest/modules/aws"
"github.com/stretchr/testify/require"
)

func NewElasticacheClient(t *testing.T, region string) *elasticache.Client {
client, err := NewElasticacheClientE(t, region)
require.NoError(t, err)

return client
}

func NewElasticacheClientE(t *testing.T, region string) (*elasticache.Client, error) {
sess, err := aws.NewAuthenticatedSession(region)
if err != nil {
return nil, err
}

return elasticache.NewFromConfig(*sess), nil
}
1 change: 0 additions & 1 deletion pkg/aws/elb.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/stretchr/testify/require"
)


func NewElbV2Client(t *testing.T, region string) *elasticloadbalancingv2.Client {
client, err := NewElbV2ClientE(t, region)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/aws/msk.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"

"github.com/aws/aws-sdk-go-v2/service/kafka"
"github.com/stretchr/testify/require"
"github.com/gruntwork-io/terratest/modules/aws"
"github.com/stretchr/testify/require"
)

func NewMSKClient(t *testing.T, region string) *kafka.Client {
Expand Down
10 changes: 2 additions & 8 deletions pkg/aws/rds.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

package aws

import (
Expand All @@ -9,7 +8,6 @@ import (
"github.com/stretchr/testify/require"
)


func AssertPotgresqlDatabaseExists(t *testing.T, dbUrl string, dbPort int32, dbUsername string, dbPassword string, databaseName string) bool {
output, err := AssertPotgresqlDatabaseExistsE(t, dbUrl, dbPort, dbUsername, dbPassword, databaseName)
require.NoError(t, err)
Expand Down Expand Up @@ -43,9 +41,7 @@ func AssertPotgresqlSchemaExistsE(t *testing.T, dbUrl string, dbPort int32, dbUs
return false, connErr
}
defer db.Close()
var (
schemaName string
)
var schemaName string
sqlStatement := `SELECT "schema_name" FROM "information_schema"."schemata" where schema_name=$1`
row := db.QueryRow(sqlStatement, expectedSchemaName)
scanErr := row.Scan(&schemaName)
Expand All @@ -71,9 +67,7 @@ func AssertPotgresqlGrantsExistsE(t *testing.T, dbUrl string, dbPort int32, dbUs
return false, connErr
}
defer db.Close()
var (
schemaName string
)
var schemaName string
sqlStatement := `SELECT grantee AS user, CONCAT(table_schema, '.', table_name) AS table,
CASE
WHEN COUNT(privilege_type) = 7 THEN 'ALL'
Expand Down
6 changes: 2 additions & 4 deletions pkg/aws/route53.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
)



func GetDNSZoneByNameE(t *testing.T, ctx context.Context, hostName string, awsRegion string) (*types.HostedZone, error) {
if hostName == "" {
return nil, fmt.Errorf("hostName cannot be empty")
Expand Down Expand Up @@ -49,8 +47,8 @@ func CleanDNSZoneID(t *testing.T, ctx context.Context, zoneID string, awsRegion
}

o, err := route53Client.ListResourceRecordSets(ctx, &route53.ListResourceRecordSetsInput{
HostedZoneId: &zoneID,
MaxItems: aws.Int32(100),
HostedZoneId: &zoneID,
MaxItems: aws.Int32(100),
})
if err != nil {
return err
Expand Down
2 changes: 0 additions & 2 deletions pkg/aws/ses.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"github.com/stretchr/testify/require"
)



// NewElbV2Client creates en ELB client.
func NewSESV2Client(t *testing.T, region string) *sesv2.Client {
client, err := NewSESV2ClientE(t, region)
Expand Down
2 changes: 0 additions & 2 deletions pkg/aws/waf.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/stretchr/testify/require"
)


func NewWAFClient(t *testing.T, region string) *wafv2.Client {
client, err := NewWAFClientE(t, region)
require.NoError(t, err)
Expand Down Expand Up @@ -83,4 +82,3 @@ func WafGetIPSetByARN(t *testing.T, client *wafv2.Client, arn string) *wafv2.Get
require.NotNil(t, ipSet.IPSet)
return ipSet
}

Loading