logstash-input-s3 3.2.0 → 3.3.0

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: e1328e9b8c79b50ccbd386fa6f304bafffffbb4a2dfe6921311d9cae022d47c1
4
- data.tar.gz: 261262cb55fed216fbcc1799925ccbaf1d75799289b9fa3b298cdb21fd8364a8
3
+ metadata.gz: f7b3da5d60d7cc955dc088b8373efb14fa0d4b8318ba689b102726f92b8f947c
4
+ data.tar.gz: 3ed4bb7fc75bb4ef6f173a90eb9a6ff2788ef517c72c88b814dd70ae72879ab3
5
5
  SHA512:
6
- metadata.gz: 5a68a70f262ec1d005e122ba4498119a6649aefb430b8d970ba48c3b358691cd76d301f52004e326455edfcc0e2503419264c87b48b2fcdb8e25601370f8fadc
7
- data.tar.gz: d9ade73b5c471199fbe37dcbbf92bfff6f86839294d7641bc07666822c994c16c51229bebed7e6221f45d9bb45e33eae6dde580c990bce3054e841959516002f
6
+ metadata.gz: b18302b15ea951230da913422c462a8ac70d61e17030c8f8273145d618ad41317b8b4c87f12d986dc979ea02fed8780594511bbe3669c4d8de0982b8f722fc76
7
+ data.tar.gz: e82da29add08a72dc8ba4ed2d0a32c551d85b57fadb8fbb7e929a5e8028b8f821ec5a358535a89882d33cedd16c308cf9a9137938c1cf11bbe9e176a92e34823
@@ -1,3 +1,7 @@
1
+ ## 3.3.0
2
+ - Add documentation for endpoint, role_arn and role_session_name #142
3
+ - Add support for additional_settings option #141
4
+
1
5
  ## 3.2.0
2
6
  - Add support for auto-detecting gzip files with `.gzip` extension, in addition to existing support for `*.gz`
3
7
  - Improve performance of gzip decoding by 10x by using Java's Zlib
@@ -34,17 +34,21 @@ This plugin supports the following configuration options plus the <<plugins-{typ
34
34
  |=======================================================================
35
35
  |Setting |Input type|Required
36
36
  | <<plugins-{type}s-{plugin}-access_key_id>> |<<string,string>>|No
37
+ | <<plugins-{type}s-{plugin}-additional_settings>> |<<hash,hash>>|No
37
38
  | <<plugins-{type}s-{plugin}-aws_credentials_file>> |<<string,string>>|No
38
39
  | <<plugins-{type}s-{plugin}-backup_add_prefix>> |<<string,string>>|No
39
40
  | <<plugins-{type}s-{plugin}-backup_to_bucket>> |<<string,string>>|No
40
41
  | <<plugins-{type}s-{plugin}-backup_to_dir>> |<<string,string>>|No
41
42
  | <<plugins-{type}s-{plugin}-bucket>> |<<string,string>>|Yes
42
43
  | <<plugins-{type}s-{plugin}-delete>> |<<boolean,boolean>>|No
44
+ | <<plugins-{type}s-{plugin}-endpoint>> |<<string,string>>|No
43
45
  | <<plugins-{type}s-{plugin}-exclude_pattern>> |<<string,string>>|No
44
46
  | <<plugins-{type}s-{plugin}-interval>> |<<number,number>>|No
45
47
  | <<plugins-{type}s-{plugin}-prefix>> |<<string,string>>|No
46
48
  | <<plugins-{type}s-{plugin}-proxy_uri>> |<<string,string>>|No
47
- | <<plugins-{type}s-{plugin}-region>> |<<string,string>>, one of `["us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-central-1", "eu-west-1", "eu-west-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2", "sa-east-1", "us-gov-west-1", "cn-north-1", "ap-south-1", "ca-central-1"]`|No
49
+ | <<plugins-{type}s-{plugin}-region>> |<<string,string>>|No
50
+ | <<plugins-{type}s-{plugin}-role_arn>> |<<string,string>>|No
51
+ | <<plugins-{type}s-{plugin}-role_session_name>> |<<string,string>>|No
48
52
  | <<plugins-{type}s-{plugin}-secret_access_key>> |<<string,string>>|No
49
53
  | <<plugins-{type}s-{plugin}-session_token>> |<<string,string>>|No
50
54
  | <<plugins-{type}s-{plugin}-sincedb_path>> |<<string,string>>|No
@@ -131,6 +135,16 @@ The name of the S3 bucket.
131
135
 
132
136
  Whether to delete processed files from the original bucket.
133
137
 
138
+ [id="plugins-{type}s-{plugin}-endpoint"]
139
+ ===== `endpoint`
140
+
141
+ * Value type is <<string,string>>
142
+ * There is no default value for this setting.
143
+
144
+ The endpoint to connect to. By default it is constructed using the value of `region`.
145
+ This is useful when connecting to S3 compatible services, but beware that these aren't
146
+ guaranteed to work correctly with the AWS SDK.
147
+
134
148
  [id="plugins-{type}s-{plugin}-exclude_pattern"]
135
149
  ===== `exclude_pattern`
136
150
 
@@ -139,6 +153,28 @@ Whether to delete processed files from the original bucket.
139
153
 
140
154
  Ruby style regexp of keys to exclude from the bucket
141
155
 
156
+ [id="plugins-{type}s-{plugin}-additional_settings"]
157
+ ===== `additional_settings`
158
+
159
+ * Value type is <<hash,hash>>
160
+ * Default value is `{}`
161
+
162
+ Key-value pairs of settings and corresponding values used to parametrize
163
+ the connection to s3. See full list in https://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Client.html[the AWS SDK documentation]. Example:
164
+
165
+ [source,ruby]
166
+ input {
167
+ s3 {
168
+ "access_key_id" => "1234",
169
+ "secret_access_key" => "secret",
170
+ "bucket" => "logstash-test",
171
+ "additional_settings" => {
172
+ "force_path_style => true,
173
+ "follow_redirects" => false
174
+ }
175
+ }
176
+ }
177
+
142
178
  [id="plugins-{type}s-{plugin}-interval"]
143
179
  ===== `interval`
144
180
 
@@ -167,11 +203,29 @@ URI to proxy server if required
167
203
  [id="plugins-{type}s-{plugin}-region"]
168
204
  ===== `region`
169
205
 
170
- * Value can be any of: `us-east-1`, `us-east-2`, `us-west-1`, `us-west-2`, `eu-central-1`, `eu-west-1`, `eu-west-2`, `ap-southeast-1`, `ap-southeast-2`, `ap-northeast-1`, `ap-northeast-2`, `sa-east-1`, `us-gov-west-1`, `cn-north-1`, `ap-south-1`, `ca-central-1`
206
+ * Value type is <<string,string>>
171
207
  * Default value is `"us-east-1"`
172
208
 
173
209
  The AWS Region
174
210
 
211
+ [id="plugins-{type}s-{plugin}-role_arn"]
212
+ ===== `role_arn`
213
+
214
+ * Value type is <<string,string>>
215
+ * There is no default value for this setting.
216
+
217
+ The AWS IAM Role to assume, if any.
218
+ This is used to generate temporary credentials, typically for cross-account access.
219
+ See the https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html[AssumeRole API documentation] for more information.
220
+
221
+ [id="plugins-{type}s-{plugin}-role_session_name"]
222
+ ===== `role_session_name`
223
+
224
+ * Value type is <<string,string>>
225
+ * Default value is `"logstash"`
226
+
227
+ Session name to use when assuming an IAM role.
228
+
175
229
  [id="plugins-{type}s-{plugin}-secret_access_key"]
176
230
  ===== `secret_access_key`
177
231
 
@@ -207,7 +261,6 @@ If specified, this setting must be a filename path and not just a directory.
207
261
  * Default value is `"/tmp/logstash"`
208
262
 
209
263
  Set the directory where logstash will store the tmp files before processing them.
210
- default to the current OS temporary directory in linux /tmp/logstash
211
264
 
212
265
 
213
266
 
@@ -35,6 +35,8 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
35
35
  # If specified, the prefix of filenames in the bucket must match (not a regexp)
36
36
  config :prefix, :validate => :string, :default => nil
37
37
 
38
+ config :additional_settings, :validate => :hash, :default => {}
39
+
38
40
  # The path to use for writing state. The state stored by this plugin is
39
41
  # a memory of files already processed by this plugin.
40
42
  #
@@ -386,7 +388,8 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
386
388
 
387
389
  private
388
390
  def get_s3object
389
- s3 = Aws::S3::Resource.new(aws_options_hash)
391
+ options = @additional_settings.merge(aws_options_hash || {})
392
+ s3 = Aws::S3::Resource.new(options)
390
393
  end
391
394
 
392
395
  private
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-s3'
4
- s.version = '3.2.0'
4
+ s.version = '3.3.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Streams events from files in a S3 bucket"
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"
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
 
22
22
  # Gem dependencies
23
23
  s.add_runtime_dependency "logstash-core-plugin-api", ">= 2.1.12", "<= 2.99"
24
- s.add_runtime_dependency 'logstash-mixin-aws'
24
+ s.add_runtime_dependency 'logstash-mixin-aws', '>= 4.3.0'
25
25
  s.add_runtime_dependency 'stud', '~> 0.0.18'
26
26
  # s.add_runtime_dependency 'aws-sdk-resources', '>= 2.0.33'
27
27
  s.add_development_dependency 'logstash-devutils'
@@ -76,6 +76,39 @@ describe LogStash::Inputs::S3 do
76
76
  subject.send(:get_s3object)
77
77
  end
78
78
  end
79
+
80
+ describe "additional_settings" do
81
+ context 'when force_path_style is set' do
82
+ let(:settings) {
83
+ {
84
+ "additional_settings" => { "force_path_style" => true },
85
+ "bucket" => "logstash-test",
86
+ }
87
+ }
88
+
89
+ it 'should instantiate AWS::S3 clients with force_path_style set' do
90
+ expect(Aws::S3::Resource).to receive(:new).with({
91
+ :region => subject.region,
92
+ "force_path_style" => true
93
+ }).and_call_original
94
+
95
+ subject.send(:get_s3object)
96
+ end
97
+ end
98
+
99
+ context 'when an unknown setting is given' do
100
+ let(:settings) {
101
+ {
102
+ "additional_settings" => { "this_setting_doesnt_exist" => true },
103
+ "bucket" => "logstash-test",
104
+ }
105
+ }
106
+
107
+ it 'should raise an error' do
108
+ expect { subject.send(:get_s3object) }.to raise_error(ArgumentError)
109
+ end
110
+ end
111
+ end
79
112
  end
80
113
 
81
114
  describe "#list_new_files" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-09 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -35,7 +35,7 @@ dependencies:
35
35
  requirements:
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
- version: '0'
38
+ version: 4.3.0
39
39
  name: logstash-mixin-aws
40
40
  prerelease: false
41
41
  type: :runtime
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: '0'
46
+ version: 4.3.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements: