-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add queue_aws_account_id option #38
base: main
Are you sure you want to change the base?
Conversation
Hello, Will this commit be merged to master any time soon? Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We learn every day, this shared queue thing is really interesting!
I haven't tested it with a real shared queues, but I've looked up the AWS SDK and this should just work.
The changes are only naming related and documentation related so we should be able to merge this really quickly.
Thanks for adding a unit test for it.
@@ -83,6 +83,9 @@ class LogStash::Inputs::SQS < LogStash::Inputs::Threadable | |||
# Name of the SQS Queue name to pull messages from. Note that this is just the name of the queue, not the URL or ARN. | |||
config :queue, :validate => :string, :required => true | |||
|
|||
# Account ID of the AWS account which owns the queue. | |||
config :queue_aws_account_id, :validate => :string, :required => false | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use the same naming as the AWS' official documentation and call it queue_owner_aws_account_id, we will need to change the other reference in the code.
Interesting links:
http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueUrl.html
http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will also need to add new user documentation in the static asciidoc file at https://github.com/logstash-plugins/logstash-input-sqs/blob/master/docs/index.asciidoc
queue_url = aws_sqs_client.get_queue_url({:queue_name => @queue, :queue_owner_aws_account_id => @queue_aws_account_id})[:queue_url] | ||
else | ||
queue_url = aws_sqs_client.get_queue_url(:queue_name => @queue)[:queue_url] | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move that logic block into his own method maybe call it queue_url
?
Add
queue_aws_account_id
option to allow for polling from different accounts. It just passes the value toaws_sqs_client.get_queue_url
asqueue_owner_aws_account_id
parameter to generatequeue_url
for different account.