aws-sdk-go-v2
aws-sdk-go-v2 copied to clipboard
MIGRATION ISSUE: Missing presigned request functionality for SQS service
Pre-Migration Checklist
- [X] I've read the Migration Guide.
- [X] I've checked AWS Forums and StackOverflow for similar migration issues.
Go Version Used
Go 1.21
Describe the Migration Issue
Back in v1 I was able to obtain presign URL for SQS service ReceiveMessage operation, by calling ReceiveMessageRequest.
I couldn't find a way to do it SDK v2, the only way is to call ReceiveMessage and get the messages directly.
Code Comparison
In V1:
func (s *Service) getSignedRequestsURL(queueURL string, maxNumOfMessages, visibilityTimeout, waitTimeSeconds int64) (string, error) {
req, _ := s.sqsService.ReceiveMessageRequest(&sqs.ReceiveMessageInput{
QueueUrl: aws.String(queueURL),
MaxNumberOfMessages: aws.Int64(maxNumOfMessages),
VisibilityTimeout: aws.Int64(visibilityTimeout),
WaitTimeSeconds: aws.Int64(waitTimeSeconds),
})
exp := 20 * time.Minute
signedURL, err := req.Presign(exp)
if err != nil {
return "", err
}
return signedURL, nil
}
Observed Differences/Errors
Similar functionality not exist in V2.
Additional Context
No response
Hi @avishay28,
We are going to do some work that would impact presigning in Go v2 so this will likely be covered by it. I don't think that the presigning behavior would mirror the v1 behavior, but we will consider this to maintain feature parity gaps between v1 and v2.
I'm adding this to our backlog.
Thanks for taking the time and reaching out. Ran~