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

KMS: migrate to AWS SDK v2 #37092

Merged
merged 40 commits into from
May 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
076b89b
`kms`: migrate to AWS SDK v2
aristosvo Apr 25, 2024
0cbae59
Revert "`kms`: migrate to AWS SDK v2"
ewbankkit May 1, 2024
53d15b7
Merge branch 'main' into HEAD
ewbankkit May 1, 2024
8a2d87d
kms: Use AWS SDK for Go v2.
ewbankkit May 1, 2024
d472dc7
kms: Generate AWS SDK for Go v2 tagging code.
ewbankkit May 1, 2024
e7c5cf2
Run 'make gen'.
ewbankkit May 1, 2024
91f8de1
run 'go get github.com/aws/aws-sdk-go-v2/service/kms@v1.31.0 && go mo…
ewbankkit May 1, 2024
2011fb4
r/aws_kms_alias: Migrate to AWS SDK for Go v2.
ewbankkit May 2, 2024
db9d519
d/aws_kms_alias: Migrate to AWS SDK for Go v2.
ewbankkit May 2, 2024
4d15fcf
r/aws_kms_ciphertext: Migrate to AWS SDK for Go v2.
ewbankkit May 2, 2024
1f61787
d/aws_kms_ciphertext: Migrate to AWS SDK for Go v2.
ewbankkit May 2, 2024
e4ee69e
r/aws_kms_custom_key_store: Migrate to AWS SDK for Go v2.
ewbankkit May 2, 2024
52303fc
d/aws_kms_custom_key_store: Migrate to AWS SDK for Go v2.
ewbankkit May 2, 2024
2f4cfe0
r/aws_kms_key: Start to migrate to AWS SDK for Go v2.
ewbankkit May 2, 2024
c1dd31f
Merge branch 'main' into HEAD
ewbankkit May 2, 2024
9f1664e
r/aws_kms_key: Migrate to AWS SDK for Go v2.
ewbankkit May 2, 2024
726e903
'findDefaultKey' -> 'findDefaultKeyARNForService'.
ewbankkit May 3, 2024
9fbe469
kms: Reduce visibility of some timeouts.
ewbankkit May 3, 2024
84a435b
'findKey' -> 'findKeyInfo'.
ewbankkit May 3, 2024
a50b9ea
d/aws_kms_key: Migrate to AWS SDK for Go v2.
ewbankkit May 3, 2024
d4992a9
kms: Reduce visibility of diff suppress.
ewbankkit May 3, 2024
f4f41b0
Fix d/aws_kms_alias.
ewbankkit May 3, 2024
2844555
kms: Reduce visibility of validators.
ewbankkit May 3, 2024
1897d4f
r/aws_kms_external_key: Migrate to AWS SDK for Go v2.
ewbankkit May 3, 2024
c837f55
r/aws_kms_grant: Migrate to AWS SDK for Go v2.
ewbankkit May 3, 2024
b5a6926
r/aws_kms_policy: Migrate to AWS SDK for Go v2.
ewbankkit May 3, 2024
6ee058c
d/aws_kms_public_key: Migrate to AWS SDK for Go v2.
ewbankkit May 3, 2024
6939249
r/aws_kms_replica_key: Migrate to AWS SDK for Go v2.
ewbankkit May 3, 2024
05a1e29
r/aws_kms_replica_external_key: Migrate to AWS SDK for Go v2.
ewbankkit May 3, 2024
80b77a8
d/aws_kms_secrets: Migrate to AWS SDK for Go v2.
ewbankkit May 3, 2024
3a4a255
kms: Migrate sweepers to AWS SDK for Go v2.
ewbankkit May 3, 2024
4e3317c
kms: Migrate cross service package calls to AWS SDK for Go v2.
ewbankkit May 3, 2024
4995bf5
kms: More visibility reduction.
ewbankkit May 3, 2024
0e15fe9
kms: Even more visibility reduction.
ewbankkit May 3, 2024
8706873
Fix semgrep 'ci.kms-in-var-name'.
ewbankkit May 3, 2024
92653bc
Merge branch 'main' into HEAD
ewbankkit May 3, 2024
21aebcb
r/aws_kms_key_policy: Fix "NotFoundException: Invalid keyId 'KMS Key …
ewbankkit May 3, 2024
0299e64
Fix 'TestAccKMSKeyPolicy_iamRole' and 'TestAccKMSKeyPolicy_iamService…
ewbankkit May 3, 2024
7af39dd
Fix golangci-lint 'unparam'.
ewbankkit May 3, 2024
1e07b5e
Fix golangci-lint 'gomnd'.
ewbankkit May 3, 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
Prev Previous commit
Next Next commit
kms: Reduce visibility of validators.
ewbankkit committed May 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2844555d72714dfba5f0650e7e57fe6da1ef4298
2 changes: 2 additions & 0 deletions internal/service/kms/exports.go
Original file line number Diff line number Diff line change
@@ -7,4 +7,6 @@ package kms
var (
DiffSuppressKey = diffSuppressKey
FindDefaultKeyARNForService = findDefaultKeyARNForService
ValidateKey = validateKey
ValidateKeyOrAlias = validateKeyOrAlias
)
2 changes: 1 addition & 1 deletion internal/service/kms/key_data_source.go
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ func dataSourceKey() *schema.Resource {
"key_id": {
Type: schema.TypeString,
Required: true,
ValidateFunc: ValidateKeyOrAlias,
ValidateFunc: validateKeyOrAlias,
},
"key_manager": {
Type: schema.TypeString,
2 changes: 1 addition & 1 deletion internal/service/kms/public_key_data_source.go
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ func DataSourcePublicKey() *schema.Resource {
"key_id": {
Type: schema.TypeString,
Required: true,
ValidateFunc: ValidateKeyOrAlias,
ValidateFunc: validateKeyOrAlias,
},
"key_usage": {
Type: schema.TypeString,
10 changes: 5 additions & 5 deletions internal/service/kms/validate.go
Original file line number Diff line number Diff line change
@@ -61,19 +61,19 @@ func validNameForResource(v interface{}, k string) (ws []string, es []error) {
return
}

var ValidateKey = validation.Any(
validateKeyId,
var validateKey = validation.Any(
validateKeyID,
validateKeyARN,
)

var ValidateKeyOrAlias = validation.Any(
validateKeyId,
var validateKeyOrAlias = validation.Any(
validateKeyID,
validateKeyARN,
validateKeyAliasName,
validateKeyAliasARN,
)

var validateKeyId = validation.StringMatch(keyIDRegex, "must be a KMS Key ID")
var validateKeyID = validation.StringMatch(keyIDRegex, "must be a KMS Key ID")

func validateKeyARN(v any, k string) (ws []string, errors []error) {
value, ok := v.(string)