Skip to content

Commit

Permalink
Use NewCredentialsConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
bdwyertech committed Jul 18, 2023
1 parent c173afe commit 0b76b18
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions wrappers/awskms/awskms.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,10 @@ func (k *Wrapper) Client() kmsiface.KMSAPI {

// GetAwsKmsClient returns an instance of the KMS client.
func (k *Wrapper) GetAwsKmsClient() (*kms.KMS, error) {
credsConfig := &awsutil.CredentialsConfig{}

credsConfig, err := awsutil.NewCredentialsConfig(awsutil.WithLogger(logger))
if err != nil {
return nil, err
}
credsConfig.AccessKey = k.accessKey
credsConfig.SecretKey = k.secretKey
credsConfig.SessionToken = k.sessionToken
Expand All @@ -294,7 +296,6 @@ func (k *Wrapper) GetAwsKmsClient() (*kms.KMS, error) {
credsConfig.RoleSessionName = k.roleSessionName
credsConfig.WebIdentityTokenFile = k.webIdentityTokenFile
credsConfig.Region = k.region
credsConfig.Logger = k.logger

credsConfig.HTTPClient = cleanhttp.DefaultClient()

Expand Down

0 comments on commit 0b76b18

Please sign in to comment.