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

r/aws_db_proxy: Change auth from TypeList to TypeSet #35819

Merged
merged 39 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
11a07a4
r/aws_db_proxy: Move functions around.
ewbankkit Feb 13, 2024
ecf3237
'FindDBProxyByName' -> 'findDBProxyByName'.
ewbankkit Feb 13, 2024
2678293
'ResourceProxy' -> 'resourceProxy'.
ewbankkit Feb 13, 2024
faace01
r/aws_db_proxy: Rename flatteners and expanders.
ewbankkit Feb 13, 2024
b63418a
rds: Generate AWS SDK for Go v2 tagging code.
ewbankkit Feb 13, 2024
2a7053f
Add 'names.RDSEndpointID'.
ewbankkit Feb 13, 2024
341f851
r/aws_db_proxy: Migrate to AWS SDK for Go v2.
ewbankkit Feb 13, 2024
37799eb
d/aws_db_proxy: Migrate to AWS SDK for Go v2.
ewbankkit Feb 13, 2024
82eeac5
aws_db_proxy: Migrate acceptance tests to AWS SDK for Go v2.
ewbankkit Feb 13, 2024
4bba388
Acceptance test output:
ewbankkit Feb 14, 2024
ee8c01d
r/aws_db_proxy_endpoint: Migrate to AWS SDK for Go v2.
ewbankkit Feb 14, 2024
9793f8f
r/aws_db_proxy_endpoint: Migrate acceptance tests to AWS SDK for Go v2.
ewbankkit Feb 14, 2024
95fda63
Acceptance test output:
ewbankkit Feb 14, 2024
9ab59a5
r/aws_db_proxy_target: Migrate to AWS SDK for Go v2.
ewbankkit Feb 14, 2024
2fa5361
r/aws_db_proxy_target: Migrate acceptance tests to AWS SDK for Go v2.
ewbankkit Feb 14, 2024
a19c38b
Acceptance test output:
ewbankkit Feb 14, 2024
d7a56e2
r/aws_db_proxy_default_target_group: Alphabetize attributes.
ewbankkit Feb 14, 2024
fcdf46b
r/aws_db_proxy_default_target_group: Migrate to AWS SDK for Go v2.
ewbankkit Feb 14, 2024
0c9a926
r/aws_db_proxy_default_target_group: Migrate acceptance tests to AWS …
ewbankkit Feb 14, 2024
7d2136e
Acceptance test output:
ewbankkit Feb 14, 2024
0de8832
Add CHANGELOG entry.
ewbankkit Feb 14, 2024
2db643f
r/aws_db_proxy: Change `auth` from `TypeList` to `TypeSet` as order i…
ewbankkit Feb 14, 2024
f391060
Fix golangci-lint 'unused'.
ewbankkit Feb 14, 2024
1a8bd5d
Fix golangci-lint 'nolintlint'.
ewbankkit Feb 14, 2024
e1b8c77
d/aws_db_proxy: Tidy up acceptance tests.
ewbankkit Feb 14, 2024
221c50c
r/aws_db_proxy.auth: Add custom set hash function.
ewbankkit Feb 14, 2024
1315362
r/aws_db_proxy.auth: Fix some acceptance tests.
ewbankkit Feb 15, 2024
f209842
Add 'sdkv2.SimpleSchemaSetFunc'.
ewbankkit Feb 15, 2024
8ad0df2
r/aws_db_subnet_group: Migrate to AWS SDK for Go v2.
ewbankkit Feb 15, 2024
f8e6241
d/aws_db_subnet_group: Migrate to AWS SDK for Go v2.
ewbankkit Feb 15, 2024
4bae096
r/aws_db_subnet_group: Migrate acceptance tests to AWS SDK for Go v2.
ewbankkit Feb 15, 2024
423bfff
Acceptance test output:
ewbankkit Feb 15, 2024
5744aaa
Fix 'TestAccRDSProxy_authSecretARN'.
ewbankkit Feb 15, 2024
417fe91
r/aws_db_event_subscription: Migrate to AWS SDK for Go v2.
ewbankkit Feb 15, 2024
39b7f58
r/aws_db_event_subscription: Migrate acceptance tests to AWS SDK for …
ewbankkit Feb 15, 2024
b69e7ee
Acceptance test output:
ewbankkit Feb 15, 2024
6836c5c
'internal/sdktypes' -> 'internal/sdkv2/types'.
ewbankkit Feb 15, 2024
b744361
Merge branch 'main' into b-aws_db_proxy.auth-TypeSet
ewbankkit Feb 15, 2024
3182278
Run 'go generate ./internal/generate/teamcity'.
ewbankkit Feb 15, 2024
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: 3 additions & 0 deletions .changelog/35819.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_db_proxy: Change `auth` from `TypeList` to `TypeSet` as order is not significant
```
2 changes: 1 addition & 1 deletion .teamcity/scripts/provider_tests/acceptance_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TF_ACC=1 go test \
./internal/maps/... \
./internal/provider/... \
./internal/retry/... \
./internal/sdktypes/... \
./internal/sdkv2/... \
./internal/slices/... \
./internal/sweep/... \
./internal/tags/... \
Expand Down
2 changes: 1 addition & 1 deletion .teamcity/scripts/provider_tests/unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ go test \
./internal/maps/... \
./internal/provider/... \
./internal/retry/... \
./internal/sdktypes/... \
./internal/sdkv2/... \
./internal/slices/... \
./internal/sweep/... \
./internal/tags/... \
Expand Down
3 changes: 3 additions & 0 deletions internal/sdkv2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Terraform Plugin SDK v2

This package and its subpackages contain [Terraform Plugin SDK v2](https://developer.hashicorp.com/terraform/plugin/sdkv2) functionality.
38 changes: 38 additions & 0 deletions internal/sdkv2/set.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package sdkv2

import (
"strconv"
"strings"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-aws/internal/create"
)

// SimpleSchemaSetFunc returns a schema.SchemaSetFunc that hashes the given keys values.
func SimpleSchemaSetFunc(keys ...string) schema.SchemaSetFunc {
return func(v interface{}) int {
var str strings.Builder

m := v.(map[string]interface{})
for _, key := range keys {
if v, ok := m[key]; ok {
switch v := v.(type) {
case bool:
str.WriteRune('-')
str.WriteString(strconv.FormatBool(v))
case int:
str.WriteRune('-')
str.WriteString(strconv.Itoa(v))
case string:
str.WriteRune('-')
str.WriteString(v)
}
}
}

return create.StringHashcode(str.String())
}
}
39 changes: 39 additions & 0 deletions internal/sdkv2/set_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package sdkv2

import (
"testing"
)

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

v1 := map[string]interface{}{
"key1": "value1",
"key2": "value2",
"key3": 3,
"key4": true,
}
v2 := map[string]interface{}{
"key1": "value1",
"key2": "value2-new",
"key3": 3,
"key4": true,
}
v3 := map[string]interface{}{
"key1": "value1",
"key2": "value2",
"key3": 4,
"key4": true,
}
f := SimpleSchemaSetFunc("key1", "key3", "key4")

if f(v1) != f(v2) {
t.Errorf("expected equal")
}
if f(v1) == f(v3) {
t.Errorf("expected not equal")
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Terraform Plugin SDK Provider-Defined Types
# Terraform Plugin SDK v2 Provider-Defined Types

This package contains provider-defined types for Terraform Plugin SDK.
This package contains provider-defined types for Terraform Plugin SDK v2.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package sdktypes
package types

import (
"time"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package sdktypes
package types

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package sdktypes
package types

import (
"github.com/hashicorp/go-cty/cty"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package sdktypes
package types

import (
"regexp"
Expand Down
2 changes: 1 addition & 1 deletion internal/service/acm/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/errs"
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
"github.com/hashicorp/terraform-provider-aws/internal/flex"
"github.com/hashicorp/terraform-provider-aws/internal/sdktypes"
sdktypes "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types"
tftags "github.com/hashicorp/terraform-provider-aws/internal/tags"
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
"github.com/hashicorp/terraform-provider-aws/internal/types/duration"
Expand Down
2 changes: 1 addition & 1 deletion internal/service/elasticbeanstalk/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import ( // nosemgrep:ci.semgrep.aws.multiple-service-imports
"github.com/hashicorp/terraform-provider-aws/internal/conns"
"github.com/hashicorp/terraform-provider-aws/internal/create"
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
"github.com/hashicorp/terraform-provider-aws/internal/sdktypes"
sdktypes "github.com/hashicorp/terraform-provider-aws/internal/sdkv2/types"
tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2"
tftags "github.com/hashicorp/terraform-provider-aws/internal/tags"
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
Expand Down
8 changes: 4 additions & 4 deletions internal/service/rds/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ const (
)

const (
EventSubscriptionStatusActive = "active"
EventSubscriptionStatusCreating = "creating"
EventSubscriptionStatusDeleting = "deleting"
EventSubscriptionStatusModifying = "modifying"
eventSubscriptionStatusActive = "active"
eventSubscriptionStatusCreating = "creating"
eventSubscriptionStatusDeleting = "deleting"
eventSubscriptionStatusModifying = "modifying"
)

const (
Expand Down
1 change: 1 addition & 0 deletions internal/service/rds/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package rds

const (
errCodeInvalidAction = "InvalidAction"
errCodeInvalidParameterCombination = "InvalidParameterCombination"
errCodeInvalidParameterValue = "InvalidParameterValue"
errCodeValidationError = "ValidationError"
Expand Down
Loading
Loading