Skip to content

Commit

Permalink
Stop using deprecated aws function
Browse files Browse the repository at this point in the history
Call NewSession (which can return an error) instead of New
  • Loading branch information
mlarraz committed Oct 29, 2022
1 parent 678ca56 commit f2be5c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sqs_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ type sdkClient struct {
// NewAWSSQSClient creates an SQS client that talks to AWS on the given queue
func NewAWSSQSClient(conf AWSConfig, queueName string) (SQSClient, error) {
creds := credentials.NewStaticCredentials(conf.AccessKey, conf.SecretKey, "")
sess := session.New(&aws.Config{Region: formatRegion(conf.Region), Credentials: creds})
sess, err := session.NewSession(&aws.Config{Region: formatRegion(conf.Region), Credentials: creds})

if err != nil {
return nil, err
}

client := new(sdkClient)
client.service = sqs.New(sess)
Expand Down

0 comments on commit f2be5c8

Please sign in to comment.