@@ -20,7 +20,6 @@ import (
2020
2121 "github.com/aws/aws-sdk-go-v2/aws"
2222 awsv2config "github.com/aws/aws-sdk-go-v2/config"
23- v2creds "github.com/aws/aws-sdk-go-v2/credentials"
2423 "github.com/aws/aws-sdk-go/aws/credentials"
2524 "github.com/aws/aws-sdk-go/aws/session"
2625 "github.com/aws/aws-sdk-go/service/dynamodb"
@@ -194,13 +193,12 @@ func (c *KinesisClients) Stream(ctx context.Context, streamName string) (*string
194193
195194func (c * KinesisClients ) WorkerCfg (ctx context.Context , stream , region , mode , applicationName string ) * config.KinesisClientLibConfiguration {
196195 const sharedMode = "shared"
197- if c . Kinesis != nil && mode == sharedMode {
198- v1Creds , err := c . Credentials . Get ( )
196+ if mode == sharedMode {
197+ v2Config , err := awsv2config . LoadDefaultConfig ( ctx , awsv2config . WithRegion ( region ) )
199198 if err != nil {
200199 return nil
201200 }
202- v2Creds := v2creds .NewStaticCredentialsProvider (v1Creds .AccessKeyID , v1Creds .SecretAccessKey , v1Creds .SessionToken )
203- return config .NewKinesisClientLibConfigWithCredential (applicationName , stream , region , "" , v2Creds )
201+ return config .NewKinesisClientLibConfigWithCredential (applicationName , stream , region , "" , v2Config .Credentials )
204202 }
205203 return nil
206204}
0 commit comments