fluent-plugin-kinesis 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d0cf5075ce9585dd683ff3b5fe9fc2e26bcd3794
4
+ data.tar.gz: 59fd9d0ee641c986fcadf152a16d575d7b63ea8d
5
+ SHA512:
6
+ metadata.gz: c7a95d98983572dc8818c97cfe3f0556ac441e95d7e7258d976b64aa46df5d0e3ed6d4c5c921aee73c2b4db9e5ee2b93a6ad8b413af4bc883e943d3fbbd74fc7
7
+ data.tar.gz: f3c6c7ee1f9163f23383b15240d8c84552a6d505aed304a49ed785c96e891a1ce1398ba9de98f0e96a351ba9e3b9485e0755c7548da6c3f7e3daf83cde35d28d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.3.6
4
+
5
+ - **Cross account access support**: Added support for cross account access for Amazon Kinesis stream. With this update, you can put reocrds to streams those are owned by other AWS account. This feature is achieved by [AssumeRole](http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html).
6
+
3
7
  ## 0.3.5
4
8
 
5
9
  - **1MB record size limit**: Increased record size limit from 50KB to 1MB due to [Amazon Kinesis improvement.](http://aws.amazon.com/jp/about-aws/whats-new/2015/06/amazon-kinesis-announces-put-pricing-change-1mb-record-support-and-the-kinesis-producer-library/)
data/README.md CHANGED
@@ -100,6 +100,18 @@ AWS access key id.
100
100
 
101
101
  AWS secret key.
102
102
 
103
+ ### role_arn
104
+
105
+ IAM Role to be assumed with [AssumeRole](http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html).
106
+ Use this option for cross account access.
107
+
108
+ ### external_id
109
+
110
+ A unique identifier that is used by third parties when
111
+ [assuming roles](http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) in their customers' accounts.
112
+ Use this option with `role_arn` for third party cross account access.
113
+ For detail, please see [How to Use an External ID When Granting Access to Your AWS Resources to a Third Party](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html).
114
+
103
115
  ### region
104
116
 
105
117
  AWS region of your stream.
@@ -44,6 +44,8 @@ module FluentPluginKinesis
44
44
 
45
45
  config_param :profile, :string, :default => nil
46
46
  config_param :credentials_path, :string, :default => nil
47
+ config_param :role_arn, :string, :default => nil
48
+ config_param :external_id, :string, :default => nil
47
49
 
48
50
  config_param :stream_name, :string
49
51
  config_param :random_partition_key, :bool, default: false
@@ -168,6 +170,15 @@ module FluentPluginKinesis
168
170
  credentials_opts[:path] = @credentials_path if @credentials_path
169
171
  credentials = Aws::SharedCredentials.new(credentials_opts)
170
172
  options[:credentials] = credentials
173
+ elsif @role_arn
174
+ credentials = Aws::AssumeRoleCredentials.new(
175
+ client: Aws::STS::Client.new(options),
176
+ role_arn: @role_arn,
177
+ role_session_name: "aws-fluent-plugin-kinesis",
178
+ external_id: @external_id,
179
+ duration_seconds: 60 * 60
180
+ )
181
+ options[:credentials] = credentials
171
182
  end
172
183
 
173
184
  if @debug
@@ -12,5 +12,5 @@
12
12
  # language governing permissions and limitations under the License.
13
13
 
14
14
  module FluentPluginKinesis
15
- VERSION = '0.3.5'
15
+ VERSION = '0.3.6'
16
16
  end
@@ -110,6 +110,34 @@ class KinesisOutputTest < Test::Unit::TestCase
110
110
  d.run
111
111
  end
112
112
 
113
+ def test_load_client_with_role_arn
114
+ client = stub(Object.new)
115
+ client.describe_stream
116
+ client.put_records { {} }
117
+
118
+ stub(Aws::AssumeRoleCredentials).new do |options|
119
+ assert_equal("arn:aws:iam::001234567890:role/my-role", options[:role_arn])
120
+ assert_equal("aws-fluent-plugin-kinesis", options[:role_session_name])
121
+ assert_equal("my_external_id", options[:external_id])
122
+ assert_equal(3600, options[:duration_seconds])
123
+ "sts_credentials"
124
+ end
125
+
126
+ stub(Aws::Kinesis::Client).new do |options|
127
+ assert_equal("sts_credentials", options[:credentials])
128
+ client
129
+ end
130
+
131
+ d = create_driver(<<-EOS)
132
+ role_arn arn:aws:iam::001234567890:role/my-role
133
+ external_id my_external_id
134
+ stream_name test_stream
135
+ region us-east-1
136
+ partition_key test_partition_key
137
+ EOS
138
+ d.run
139
+ end
140
+
113
141
  def test_configure_with_more_options
114
142
 
115
143
  conf = %[
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-kinesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
5
- prerelease:
4
+ version: 0.3.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Amazon Web Services
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-08-03 00:00:00.000000000 Z
11
+ date: 2015-09-08 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: test-unit-rr
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,9 +55,8 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: fluentd
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: 0.10.53
70
62
  - - <
@@ -73,9 +65,8 @@ dependencies:
73
65
  type: :runtime
74
66
  prerelease: false
75
67
  version_requirements: !ruby/object:Gem::Requirement
76
- none: false
77
68
  requirements:
78
- - - ! '>='
69
+ - - '>='
79
70
  - !ruby/object:Gem::Version
80
71
  version: 0.10.53
81
72
  - - <
@@ -84,9 +75,8 @@ dependencies:
84
75
  - !ruby/object:Gem::Dependency
85
76
  name: aws-sdk-core
86
77
  requirement: !ruby/object:Gem::Requirement
87
- none: false
88
78
  requirements:
89
- - - ! '>='
79
+ - - '>='
90
80
  - !ruby/object:Gem::Version
91
81
  version: 2.0.12
92
82
  - - <
@@ -95,9 +85,8 @@ dependencies:
95
85
  type: :runtime
96
86
  prerelease: false
97
87
  version_requirements: !ruby/object:Gem::Requirement
98
- none: false
99
88
  requirements:
100
- - - ! '>='
89
+ - - '>='
101
90
  - !ruby/object:Gem::Version
102
91
  version: 2.0.12
103
92
  - - <
@@ -106,7 +95,6 @@ dependencies:
106
95
  - !ruby/object:Gem::Dependency
107
96
  name: multi_json
108
97
  requirement: !ruby/object:Gem::Requirement
109
- none: false
110
98
  requirements:
111
99
  - - ~>
112
100
  - !ruby/object:Gem::Version
@@ -114,7 +102,6 @@ dependencies:
114
102
  type: :runtime
115
103
  prerelease: false
116
104
  version_requirements: !ruby/object:Gem::Requirement
117
- none: false
118
105
  requirements:
119
106
  - - ~>
120
107
  - !ruby/object:Gem::Version
@@ -122,17 +109,15 @@ dependencies:
122
109
  - !ruby/object:Gem::Dependency
123
110
  name: msgpack
124
111
  requirement: !ruby/object:Gem::Requirement
125
- none: false
126
112
  requirements:
127
- - - ! '>='
113
+ - - '>='
128
114
  - !ruby/object:Gem::Version
129
115
  version: 0.5.8
130
116
  type: :runtime
131
117
  prerelease: false
132
118
  version_requirements: !ruby/object:Gem::Requirement
133
- none: false
134
119
  requirements:
135
- - - ! '>='
120
+ - - '>='
136
121
  - !ruby/object:Gem::Version
137
122
  version: 0.5.8
138
123
  description:
@@ -158,27 +143,26 @@ files:
158
143
  homepage: https://github.com/awslabs/aws-fluent-plugin-kinesis
159
144
  licenses:
160
145
  - Apache License, Version 2.0
146
+ metadata: {}
161
147
  post_install_message:
162
148
  rdoc_options: []
163
149
  require_paths:
164
150
  - lib
165
151
  required_ruby_version: !ruby/object:Gem::Requirement
166
- none: false
167
152
  requirements:
168
- - - ! '>='
153
+ - - '>='
169
154
  - !ruby/object:Gem::Version
170
155
  version: 1.9.3
171
156
  required_rubygems_version: !ruby/object:Gem::Requirement
172
- none: false
173
157
  requirements:
174
- - - ! '>='
158
+ - - '>='
175
159
  - !ruby/object:Gem::Version
176
160
  version: '0'
177
161
  requirements: []
178
162
  rubyforge_project:
179
- rubygems_version: 1.8.23
163
+ rubygems_version: 2.0.14
180
164
  signing_key:
181
- specification_version: 3
165
+ specification_version: 4
182
166
  summary: Fluentd output plugin that sends events to Amazon Kinesis.
183
167
  test_files:
184
168
  - test/helper.rb