Skip to content
Draft
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
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/YakDriver/go-version v0.1.0
github.com/YakDriver/regexache v0.25.0
github.com/YakDriver/smarterr v0.8.0
github.com/aws/aws-sdk-go v1.55.8
github.com/aws/aws-sdk-go-v2 v1.40.1
github.com/aws/aws-sdk-go-v2/config v1.32.3
github.com/aws/aws-sdk-go-v2/credentials v1.19.3
Expand Down Expand Up @@ -285,6 +286,7 @@ require (
github.com/google/go-cmp v0.7.0
github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.23.0
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.68
github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 v2.0.0-beta.69
github.com/hashicorp/awspolicyequivalence v1.7.0
github.com/hashicorp/cli v1.1.7
github.com/hashicorp/go-cleanhttp v0.5.2
Expand Down
7 changes: 6 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ=
github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk=
github.com/aws/aws-sdk-go-v2 v1.40.1 h1:difXb4maDZkRH0x//Qkwcfpdg1XQVXEAEs2DdXldFFc=
github.com/aws/aws-sdk-go-v2 v1.40.1/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 h1:489krEF9xIGkOaaX3CE/Be2uWjiXrkCH6gUX+bZA/BU=
Expand Down Expand Up @@ -639,6 +641,8 @@ github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.23.0 h1:l16/Vr
github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.23.0/go.mod h1:HAmscHyzSOfB1Dr16KLc177KNbn83wscnZC+N7WyaM8=
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.68 h1:az84QLx3MwAMrOMjRpGjKQFY9/JkXveoc5TPbr8XHDQ=
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.68/go.mod h1:naAMUZYs95/rPa/UchEe9VR/wa3RdTO5mQC5lKUWTmM=
github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 v2.0.0-beta.69 h1:jIeLQWz27dBB/zbh6NXlnKUY82TZfVtOkZFNXB9+olc=
github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 v2.0.0-beta.69/go.mod h1:OSQssuqo5JkYi9jwA/bNwnx8oG3HPRVe5Co9+8IZdmU=
github.com/hashicorp/awspolicyequivalence v1.7.0 h1:HxwPEw2/31BqQa73PinGciTfG2uJ/ATelvDG8X1gScU=
github.com/hashicorp/awspolicyequivalence v1.7.0/go.mod h1:+oCTxQEYt+GcRalqrqTCBcJf100SQYiWQ4aENNYxYe0=
github.com/hashicorp/cli v1.1.7 h1:/fZJ+hNdwfTSfsxMBa9WWMlfjUZbX8/LnUxgAd7lCVU=
Expand Down Expand Up @@ -902,7 +906,8 @@ gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 2 additions & 0 deletions internal/service/redshift/exports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var (
ResourceHSMClientCertificate = resourceHSMClientCertificate
ResourceHSMConfiguration = resourceHSMConfiguration
ResourceIntegration = newIntegrationResource
ResourceIdcApplication = resourceIdcApplication
ResourceLogging = newLoggingResource
ResourceParameterGroup = resourceParameterGroup
ResourcePartner = resourcePartner
Expand All @@ -40,6 +41,7 @@ var (
FindHSMClientCertificateByID = findHSMClientCertificateByID
FindHSMConfigurationByID = findHSMConfigurationByID
FindIntegrationByARN = findIntegrationByARN
FindIDCApplicationByARN = findIDCApplicationByARN
FindLoggingByID = findLoggingByID
FindParameterGroupByName = findParameterGroupByName
FindPartnerByID = findPartnerByID
Expand Down
29 changes: 29 additions & 0 deletions internal/service/redshift/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,3 +480,32 @@

return findIntegration(ctx, conn, &input)
}

func findIDCApplicationByARN(ctx context.Context, conn *redshift.Redshift, arn string) (*redshift.RedshiftIdcApplication, error) {

Check failure on line 484 in internal/service/redshift/find.go

View workflow job for this annotation

GitHub Actions / Check for modern Go code

undefined: redshift.RedshiftIdcApplication

Check failure on line 484 in internal/service/redshift/find.go

View workflow job for this annotation

GitHub Actions / Check for modern Go code

undefined: redshift.Redshift

Check failure on line 484 in internal/service/redshift/find.go

View workflow job for this annotation

GitHub Actions / providerlint

undefined: redshift.RedshiftIdcApplication

Check failure on line 484 in internal/service/redshift/find.go

View workflow job for this annotation

GitHub Actions / providerlint

undefined: redshift.Redshift
input := &redshift.DescribeRedshiftIdcApplicationsInput{
RedshiftIdcApplicationArn: aws.String(arn),
}

output, err := conn.DescribeRedshiftIdcApplicationsWithContext(ctx, input)

if tfawserr.ErrCodeEquals(err, redshift.ErrCodeRedshiftIdcApplicationNotExistsFault) {
return nil, &retry.NotFoundError{
LastError: err,
LastRequest: input,
}
}

if err != nil {
return nil, err
}

if output == nil || len(output.RedshiftIdcApplications) == 0 || output.RedshiftIdcApplications[0] == nil {
return nil, tfresource.NewEmptyResultError(input)
}

if count := len(output.RedshiftIdcApplications); count > 1 {
return nil, tfresource.NewTooManyResultsError(count, input)
}

return output.RedshiftIdcApplications[0], nil
}
Loading
Loading