@@ -14,8 +14,6 @@ import (
1414 "strings"
1515
1616 "github.com/aws/aws-sdk-go-v2/aws"
17- awsconfig "github.com/aws/aws-sdk-go-v2/config"
18- "github.com/aws/aws-sdk-go-v2/credentials"
1917 awskms "github.com/aws/aws-sdk-go-v2/service/kms"
2018 "github.com/aws/aws-sdk-go-v2/service/kms/types"
2119 "github.com/aws/aws-sdk-go-v2/service/secretsmanager"
@@ -149,7 +147,7 @@ func main() {
149147 }
150148
151149 if issuerKMSETHProviderToUse == config .AWSSM {
152- cfg , err := LoadAWSConfig (ctx )
150+ cfg , err := kms . LoadAWSConfig (ctx )
153151
154152 if err != nil {
155153 log .Error (ctx , "error loading AWSSM config" , "err" , err )
@@ -233,33 +231,10 @@ func validate(issuerKMSETHProviderToUse string, fPrivateKey *string, ctx context
233231 return nil
234232}
235233
236- func LoadAWSConfig (ctx context.Context ) (aws.Config , error ) {
237- // Backward-compatible behaviour for AWS SDK configuration
238- // env variables (DEPRECATED)
239- // "ISSUER_KMS_AWS_ACCESS_KEY"
240- // "ISSUER_KMS_AWS_SECRET_KEY"
241- // "ISSUER_KMS_AWS_REGION"
242- accessKey := strings .TrimSpace (os .Getenv ("ISSUER_KMS_AWS_ACCESS_KEY" ))
243- secretKey := strings .TrimSpace (os .Getenv ("ISSUER_KMS_AWS_SECRET_KEY" ))
244- region := strings .TrimSpace (os .Getenv ("ISSUER_KMS_AWS_REGION" ))
245-
246- if accessKey != "" && secretKey != "" && region != "" {
247- return awsconfig .LoadDefaultConfig (
248- ctx ,
249- awsconfig .WithCredentialsProvider (
250- credentials .NewStaticCredentialsProvider (accessKey , secretKey , "" ),
251- ),
252- awsconfig .WithRegion (region ),
253- )
254- }
255-
256- return awsconfig .LoadDefaultConfig (ctx )
257- }
258-
259234//
260235//nolint:unused
261236func createEmptyKey (ctx context.Context , privateKeyAlias string ) (* string , error ) {
262- cfg , err := LoadAWSConfig (ctx )
237+ cfg , err := kms . LoadAWSConfig (ctx )
263238
264239 if err != nil {
265240 log .Error (ctx , "error loading AWSKMS config" , "err" , err )
0 commit comments