Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

majjacz
Copy link

@majjacz majjacz commented May 25, 2017

Add queue_aws_account_id option to allow for polling from different accounts. It just passes the value to aws_sqs_client.get_queue_url as queue_owner_aws_account_id parameter to generate queue_url for different account.

@jorgensoares
Copy link

Hello,

Will this commit be merged to master any time soon?

Thank you.

@ph ph self-requested a review August 24, 2017 12:12
Copy link
Contributor

@ph ph left a 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

Copy link
Contributor

@ph ph Aug 24, 2017

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

Copy link
Contributor

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
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants