fluent-plugin-s3 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +5 -0
- data/VERSION +1 -1
- data/fluent-plugin-s3.gemspec +1 -1
- data/lib/fluent/plugin/out_s3.rb +10 -2
- data/test/test_in_s3.rb +8 -2
- data/test/test_out_s3.rb +19 -0
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5f479caba1c3280aa3d9cb83186473afb3c192c
|
4
|
+
data.tar.gz: b1d0ed15c3cee9e9fa3f3b39668f2676f6471870
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a37ef95d2298ca9f64fbc72fb5facec926862d0dedc40420f6f19baae4af32d16fb44be0122c2788355b29244ba804e9fdfd9b6263615860c7796a32b32a3870
|
7
|
+
data.tar.gz: 3286ceedbd344873fd79987f2f413096e579b2164c932200943fefd1e6cff467a3aa78abd6991d10a15cc3d9d16c965efdc915da20ffc5f713daca9fc9b31fbf
|
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.1
|
data/fluent-plugin-s3.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.require_paths = ['lib']
|
19
19
|
|
20
20
|
gem.add_dependency "fluentd", [">= 0.10.58", "< 2"]
|
21
|
-
gem.add_dependency "aws-sdk", "
|
21
|
+
gem.add_dependency "aws-sdk", [">= 2.3.22", "< 3"]
|
22
22
|
gem.add_dependency "yajl-ruby", "~> 1.0"
|
23
23
|
gem.add_dependency "fluent-mixin-config-placeholders", ">= 0.3.0"
|
24
24
|
gem.add_development_dependency "rake", ">= 0.9.2"
|
data/lib/fluent/plugin/out_s3.rb
CHANGED
@@ -312,7 +312,11 @@ module Fluent
|
|
312
312
|
credentials_options[:port] = c.port if c.port
|
313
313
|
credentials_options[:http_open_timeout] = c.http_open_timeout if c.http_open_timeout
|
314
314
|
credentials_options[:http_read_timeout] = c.http_read_timeout if c.http_read_timeout
|
315
|
-
|
315
|
+
if ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
|
316
|
+
options[:credentials] = Aws::ECSCredentials.new(credentials_options)
|
317
|
+
else
|
318
|
+
options[:credentials] = Aws::InstanceProfileCredentials.new(credentials_options)
|
319
|
+
end
|
316
320
|
when @shared_credentials
|
317
321
|
c = @shared_credentials
|
318
322
|
credentials_options[:path] = c.path if c.path
|
@@ -321,7 +325,11 @@ module Fluent
|
|
321
325
|
when @aws_iam_retries
|
322
326
|
$log.warn("'aws_iam_retries' parameter is deprecated. Use 'instance_profile_credentials' instead")
|
323
327
|
credentials_options[:retries] = @aws_iam_retries
|
324
|
-
|
328
|
+
if ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
|
329
|
+
options[:credentials] = Aws::ECSCredentials.new(credentials_options)
|
330
|
+
else
|
331
|
+
options[:credentials] = Aws::InstanceProfileCredentials.new(credentials_options)
|
332
|
+
end
|
325
333
|
else
|
326
334
|
# Use default credentials
|
327
335
|
# See http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Client.html
|
data/test/test_in_s3.rb
CHANGED
@@ -178,7 +178,9 @@ class S3InputTest < Test::Unit::TestCase
|
|
178
178
|
[message]
|
179
179
|
}
|
180
180
|
assert_nothing_raised do
|
181
|
-
d.run
|
181
|
+
d.run do
|
182
|
+
d.instance.router.emit("input.s3", @time, { "message" => "aaa" })
|
183
|
+
end
|
182
184
|
end
|
183
185
|
end
|
184
186
|
|
@@ -216,7 +218,11 @@ class S3InputTest < Test::Unit::TestCase
|
|
216
218
|
[message]
|
217
219
|
}
|
218
220
|
assert_nothing_raised do
|
219
|
-
d.run
|
221
|
+
d.run do
|
222
|
+
d.instance.router.emit("input.s3", @time, { "message" => "aaa\n" })
|
223
|
+
d.instance.router.emit("input.s3", @time, { "message" => "bbb\n" })
|
224
|
+
d.instance.router.emit("input.s3", @time, { "message" => "ccc\n" })
|
225
|
+
end
|
220
226
|
end
|
221
227
|
end
|
222
228
|
end
|
data/test/test_out_s3.rb
CHANGED
@@ -484,6 +484,25 @@ class S3OutputTest < Test::Unit::TestCase
|
|
484
484
|
assert_equal(expected_credentials, credentials)
|
485
485
|
end
|
486
486
|
|
487
|
+
def test_ecs_credentials
|
488
|
+
ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"] = "/credential_provider_version/credentials?id=task_UUID"
|
489
|
+
|
490
|
+
expected_credentials = Aws::Credentials.new("test_key", "test_secret")
|
491
|
+
mock(Aws::ECSCredentials).new({}).returns(expected_credentials)
|
492
|
+
config = CONFIG_TIME_SLICE.split("\n").reject{|x| x =~ /.+aws_.+/}.join("\n")
|
493
|
+
config += %[
|
494
|
+
<instance_profile_credentials>
|
495
|
+
</instance_profile_credentials>
|
496
|
+
]
|
497
|
+
d = create_time_sliced_driver(config)
|
498
|
+
assert_nothing_raised{ d.run }
|
499
|
+
client = d.instance.instance_variable_get(:@s3).client
|
500
|
+
credentials = client.config.credentials
|
501
|
+
assert_equal(expected_credentials, credentials)
|
502
|
+
|
503
|
+
ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"] = nil
|
504
|
+
end
|
505
|
+
|
487
506
|
def test_instance_profile_credentials_aws_iam_retries
|
488
507
|
expected_credentials = Aws::Credentials.new("test_key", "test_secret")
|
489
508
|
mock(Aws::InstanceProfileCredentials).new({}).returns(expected_credentials)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|
@@ -35,16 +35,22 @@ dependencies:
|
|
35
35
|
name: aws-sdk
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.3.22
|
41
|
+
- - "<"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3'
|
41
44
|
type: :runtime
|
42
45
|
prerelease: false
|
43
46
|
version_requirements: !ruby/object:Gem::Requirement
|
44
47
|
requirements:
|
45
|
-
- - "
|
48
|
+
- - ">="
|
46
49
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
50
|
+
version: 2.3.22
|
51
|
+
- - "<"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3'
|
48
54
|
- !ruby/object:Gem::Dependency
|
49
55
|
name: yajl-ruby
|
50
56
|
requirement: !ruby/object:Gem::Requirement
|