fluent-plugin-s3 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +6 -0
- data/VERSION +1 -1
- data/lib/fluent/plugin/out_s3.rb +6 -3
- data/test/test_out_s3.rb +24 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 898dacde8e05065481eb052b7ceccd83990ca271
|
4
|
+
data.tar.gz: 800463c09bd87c561a2b376ef4471e9d1d53065e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52a258b0df126e20e63f0e760ca38d3e33e4bbf6d22ee76e086ae083ae51b8c019cd4df18c4c6b5bf8cc45f227b961f9fc306a83fd1747094c1599b0655d2e0f
|
7
|
+
data.tar.gz: f98a116cfb1fb4092fdd612312baa44ac3d3ffc7651abc43c2b81eb193d674e5118ea1b571a2c0af6d2780469fcb401e98a5be0452f831df9907cc622667d94b
|
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.4
|
data/lib/fluent/plugin/out_s3.rb
CHANGED
@@ -20,11 +20,11 @@ module Fluent
|
|
20
20
|
config_param :aws_key_id, :string, :default => nil, :secret => true
|
21
21
|
config_param :aws_sec_key, :string, :default => nil, :secret => true
|
22
22
|
config_section :assume_role_credentials, :multi => false do
|
23
|
-
config_param :role_arn, :string
|
23
|
+
config_param :role_arn, :string, :secret => true
|
24
24
|
config_param :role_session_name, :string
|
25
25
|
config_param :policy, :string, :default => nil
|
26
26
|
config_param :duration_seconds, :integer, :default => nil
|
27
|
-
config_param :external_id, :string, :default => nil
|
27
|
+
config_param :external_id, :string, :default => nil, :secret => true
|
28
28
|
end
|
29
29
|
config_section :instance_profile_credentials, :multi => false do
|
30
30
|
config_param :retries, :integer, :default => nil
|
@@ -55,7 +55,7 @@ module Fluent
|
|
55
55
|
config_param :acl, :string, :default => :private
|
56
56
|
config_param :hex_random_length, :integer, :default => 4
|
57
57
|
config_param :overwrite, :bool, :default => false
|
58
|
-
config_param :ssekms_key_id, :string, :default => nil
|
58
|
+
config_param :ssekms_key_id, :string, :default => nil, :secret => true
|
59
59
|
config_param :compute_checksums, :bool, :default => nil # use nil to follow SDK default configuration
|
60
60
|
|
61
61
|
attr_reader :bucket
|
@@ -235,6 +235,9 @@ module Fluent
|
|
235
235
|
credentials_options[:policy] = c.policy if c.policy
|
236
236
|
credentials_options[:duration_seconds] = c.duration_seconds if c.duration_seconds
|
237
237
|
credentials_options[:external_id] = c.external_id if c.external_id
|
238
|
+
if @s3_region
|
239
|
+
credentials_options[:client] = Aws::STS::Client.new(:region => @s3_region)
|
240
|
+
end
|
238
241
|
options[:credentials] = Aws::AssumeRoleCredentials.new(credentials_options)
|
239
242
|
when @instance_profile_credentials
|
240
243
|
c = @instance_profile_credentials
|
data/test/test_out_s3.rb
CHANGED
@@ -467,6 +467,30 @@ class S3OutputTest < Test::Unit::TestCase
|
|
467
467
|
assert_equal(expected_credentials, credentials)
|
468
468
|
end
|
469
469
|
|
470
|
+
def test_assume_role_credentials_with_region
|
471
|
+
expected_credentials = Aws::Credentials.new("test_key", "test_secret")
|
472
|
+
sts_client = Aws::STS::Client.new(:region => 'ap-northeast-1')
|
473
|
+
mock(Aws::STS::Client).new(:region => 'ap-northeast-1'){ sts_client }
|
474
|
+
mock(Aws::AssumeRoleCredentials).new(:role_arn => "test_arn",
|
475
|
+
:role_session_name => "test_session",
|
476
|
+
:client => sts_client){
|
477
|
+
expected_credentials
|
478
|
+
}
|
479
|
+
config = CONFIG_TIME_SLICE.split("\n").reject{|x| x =~ /.+aws_.+/}.join("\n")
|
480
|
+
config += %[
|
481
|
+
s3_region ap-northeast-1
|
482
|
+
<assume_role_credentials>
|
483
|
+
role_arn test_arn
|
484
|
+
role_session_name test_session
|
485
|
+
</assume_role_credentials>
|
486
|
+
]
|
487
|
+
d = create_time_sliced_driver(config)
|
488
|
+
assert_nothing_raised{ d.run }
|
489
|
+
client = d.instance.instance_variable_get(:@s3).client
|
490
|
+
credentials = client.config.credentials
|
491
|
+
assert_equal(expected_credentials, credentials)
|
492
|
+
end
|
493
|
+
|
470
494
|
def test_instance_profile_credentials
|
471
495
|
expected_credentials = Aws::Credentials.new("test_key", "test_secret")
|
472
496
|
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.6.
|
4
|
+
version: 0.6.4
|
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: 2015-
|
12
|
+
date: 2015-12-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|