logstash-output-sqs 5.1.1 → 5.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcdfe82a1d2d81bc632030a13b943f71587f7ac2fb0a37bb21d80f01e80e6858
4
- data.tar.gz: a54467a3f76425d955cf117d32dd3e454199cf19e8d91dd4a64b5f0fc0630430
3
+ metadata.gz: 365f17a24fe817b8800e38e10114d9c86a9d458c67e6ade37feb97c2f0d0c3d7
4
+ data.tar.gz: b4ccb7477ccf35f1f17e726918d215ecbc0d9bbc2127cc59c9f4f343eb9b0751
5
5
  SHA512:
6
- metadata.gz: 5da55f9eae212aaf7ec318074a1421a2be49c68114b4828d52d91c7b4a3d9c1923d58c9794761dd83e4c983f7d1dca4594336bb2232d019a1eed95eff280c2a5
7
- data.tar.gz: '04991647e900934a6f22675151c47117b127c72e5050a6c678f592fe06d6beff3a86583248484f9ca8bd7707e2ccbda8f0141e2679fc19d20e880e5fbd8843f3'
6
+ metadata.gz: 33611f4a29e91d5b9f5e237c75a2dcd7e1b0e8eea6050a2f5082ad910a669a10fbc73ace0f8a644531ecd4116f481850c520ddbd6526c07094187e308316f7bc
7
+ data.tar.gz: 6a4ce01cc01910008d1377801373d2dd19c4959b947430a1002e2f31d5f42e1f51eebbe64492d9131d80110a8fbba3894fcdb665ca9f8346ef2d69caeb93979b
@@ -1,3 +1,6 @@
1
+ ## 5.1.2
2
+ - Added the ability to send to a different account id's queue. [#30](https://github.com/logstash-plugins/logstash-output-sqs/pull/30)
3
+
1
4
  ## 5.1.1
2
5
  - Docs: Set the default_codec doc attribute.
3
6
 
@@ -181,6 +181,15 @@ URI to proxy server if required
181
181
  The name of the target SQS queue. Note that this is just the name of the
182
182
  queue, not the URL or ARN.
183
183
 
184
+ [id="plugins-{type}s-{plugin}-queue_owner_aws_account_id"]
185
+ ===== `queue_owner_aws_account_id`
186
+
187
+ * Value type is <<string,string>>
188
+ * There is no default value for this setting.
189
+
190
+ The owning account id of the target SQS queue. IAM permissions need to be
191
+ configured on both accounts to function.
192
+
184
193
  [id="plugins-{type}s-{plugin}-region"]
185
194
  ===== `region`
186
195
 
@@ -228,4 +237,4 @@ The AWS Session token for temporary credential
228
237
  [id="plugins-{type}s-{plugin}-common-options"]
229
238
  include::{include_path}/{type}.asciidoc[]
230
239
 
231
- :default_codec!:
240
+ :default_codec!:
@@ -87,6 +87,10 @@ class LogStash::Outputs::SQS < LogStash::Outputs::Base
87
87
  # queue, not the URL or ARN.
88
88
  config :queue, :validate => :string, :required => true
89
89
 
90
+ # Account ID of the AWS account which owns the queue. Note IAM permissions
91
+ # need to be configured on both accounts to function.
92
+ config :queue_owner_aws_account_id, :validate => :string, :required => false
93
+
90
94
  public
91
95
  def register
92
96
  @sqs = Aws::SQS::Client.new(aws_options_hash)
@@ -98,9 +102,12 @@ class LogStash::Outputs::SQS < LogStash::Outputs::Base
98
102
  end
99
103
 
100
104
  begin
101
- @logger.debug('Connecting to SQS queue', :queue => @queue, :region => region)
102
- @queue_url = @sqs.get_queue_url(:queue_name => @queue)[:queue_url]
103
- @logger.info('Connected to SQS queue successfully', :queue => @queue, :region => region)
105
+ params = { queue_name: @queue }
106
+ params[:queue_owner_aws_account_id] = @queue_owner_aws_account_id if @queue_owner_aws_account_id
107
+
108
+ @logger.debug('Connecting to SQS queue', params.merge(region: region))
109
+ @queue_url = @sqs.get_queue_url(params)[:queue_url]
110
+ @logger.info('Connected to SQS queue successfully', params.merge(region: region))
104
111
  rescue Aws::SQS::Errors::ServiceError => e
105
112
  @logger.error('Failed to connect to SQS', :error => e)
106
113
  raise LogStash::ConfigurationError, 'Verify the SQS queue name and your credentials'
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-sqs'
4
- s.version = '5.1.1'
4
+ s.version = '5.1.2'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Pushes events to an Amazon Web Services Simple Queue Service queue"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -47,6 +47,14 @@ describe LogStash::Outputs::SQS, :integration => true do
47
47
  end
48
48
  end
49
49
 
50
+ context 'with a nonpermissive account id' do
51
+ let(:config) { super.merge('queue_owner_aws_account_id' => '123456789012')}
52
+
53
+ it 'raises a configuration error' do
54
+ expect { subject.register }.to raise_error(LogStash::ConfigurationError)
55
+ end
56
+ end
57
+
50
58
  context 'with valid configuration' do
51
59
  it 'does not raise an error' do
52
60
  expect { subject.register }.not_to raise_error
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-sqs
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.1
4
+ version: 5.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-06 00:00:00.000000000 Z
11
+ date: 2018-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  requirements: []
118
118
  rubyforge_project:
119
- rubygems_version: 2.6.11
119
+ rubygems_version: 2.6.13
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: Pushes events to an Amazon Web Services Simple Queue Service queue