Add AWS Queue Owner Account ID for SQS
erifili117 opened this issue · 1 comments
erifili117 commented
Is your feature request related to a problem? Please describe
When creating a new SQS consumer component, Patron currently does not allow to set the QueueOwnerAWSAccountId
attribute on the GetQueueUrlWithContext
call.
Is this a bug? Please provide steps to reproduce, a failing test etc.
This becomes an issue, when trying to connect to SQS, with a role that belongs to a different account than the one SQS belongs to, since Amazon needs the owner in order to connect.
Steps to reproduce:
- Set up
Role A
onAmazon Account A
- Set up
SQS
onAmazon Account B
- Set up a Patron service which has the
Role A
- Give permissions for
Role A
to be able to accessSQS
- Try to create a new SQS component with patron
GetQueueUrlWithContext
returns error
Describe the solution
Instead of only supporting:
patron/component/sqs/component.go
Lines 131 to 133 in 7e9f17b
we should also allow for:
out, err := sqsAPI.GetQueueUrlWithContext(context.Background(), &sqs.GetQueueUrlInput{
QueueName: aws.String(queueName),
QueueOwnerAWSAccountId: aws.String(queueOwner),
})
mantzas commented
We need to find a way to add an optional argument in the component function.