fluent-plugin-kinesis 3.0.0 → 3.2.3

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
- SHA1:
3
- metadata.gz: d525a1183f3d3aec1209db62718f8aa412a7c0eb
4
- data.tar.gz: 3b197806fe40602e39462232cdce58ccbc3b02d6
2
+ SHA256:
3
+ metadata.gz: d1bd84d96b64e32b8aac649672adeb5333c7931cb7a7b5a4ec13cd6a8031f1be
4
+ data.tar.gz: 657ed567a713283fbc40c6ea7ed1fe7cc940f7898547e584aa4ed447fbfabdd6
5
5
  SHA512:
6
- metadata.gz: a0144ae7446308a043139383e64c2de61875163c4114e2344389a4474c9465fcdb8b5bb1bad7c45d1d1fb56be20601016776315ef8d0fe0657fa4fec1c97dc49
7
- data.tar.gz: 593f79bec197980ce5d3e9f3b1e9884575efd19166dd3d850280472b174f199ae4f486c33622d312da2d1f3b861f9c41ff50b791868e9ccbb52d5bbc487622b8
6
+ metadata.gz: 6da3c960496b64b446718ff79cd95523c3058372893e313a5049ca3fad51895a613bc06b5ce5e8dc6a71966b5c0dbe00fcfd9b0b5ff7438813f0be581efc1122
7
+ data.tar.gz: e5fff3586fd0f1519a9f686ccaca4212a45b30c9f7199fb82460bbd04d4a98c080fe1c93bf1dc33099b432dab9da4118a943c619e31069b082ce98ac366b80e2
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
  /.cache/
12
12
  /amazon-kinesis-producer-native-binarie*
13
13
  /.ruby-version
14
+ /fluent-plugin-kinesis-*.gem
@@ -4,22 +4,33 @@ sudo: false
4
4
 
5
5
  gemfile:
6
6
  - Gemfile
7
- - gemfiles/Gemfile.td-agent-3.3.0
7
+ - gemfiles/Gemfile.td-agent-3.8.0
8
8
 
9
9
  # Test with supported td-agent versions
10
- # https://support.treasuredata.com/hc/en-us/articles/360001479187-The-td-agent-ChangeLog
10
+ # https://tddocs.atlassian.net/wiki/spaces/PD/pages/6291635/The+td-agent+ChangeLog
11
11
  matrix:
12
12
  include:
13
- - rvm: 2.4.1
14
- gemfile: gemfiles/Gemfile.fluentd-0.14.10
13
+ - rvm: 2.6.6 # Latest supported Ruby / https://www.ruby-lang.org/en/downloads/
14
+ # Waiting protobuf support for Ruby 2.7 / https://github.com/protocolbuffers/protobuf/issues/7070
15
+ gemfile: gemfiles/Gemfile.fluentd-1.11.1 # Latest Fluentd / https://www.fluentd.org/download
16
+ - rvm: 2.3.0 # Oldest supported Ruby
17
+ gemfile: gemfiles/Gemfile.fluentd-0.14.22 # Oldest supported Fluentd
15
18
  - rvm: 2.4.2 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.1.1/config/projects/td-agent3.rb#L17
16
19
  gemfile: gemfiles/Gemfile.td-agent-3.1.1
17
- - rvm: 2.4.4 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.2.0/config/projects/td-agent3.rb#L22
18
- gemfile: gemfiles/Gemfile.td-agent-3.2.0
19
20
  - rvm: 2.4.4 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.2.1/config/projects/td-agent3.rb#L22
20
21
  gemfile: gemfiles/Gemfile.td-agent-3.2.1
21
22
  - rvm: 2.4.5 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.3.0/config/projects/td-agent3.rb#L22
22
23
  gemfile: gemfiles/Gemfile.td-agent-3.3.0
24
+ - rvm: 2.4.6 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.1/config/projects/td-agent3.rb#L22
25
+ gemfile: gemfiles/Gemfile.td-agent-3.4.1
26
+ - rvm: 2.4.9 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.1/config/projects/td-agent3.rb#L22
27
+ gemfile: gemfiles/Gemfile.td-agent-3.5.1
28
+ - rvm: 2.4.9 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.6.0/config/projects/td-agent3.rb#L22
29
+ gemfile: gemfiles/Gemfile.td-agent-3.6.0
30
+ - rvm: 2.4.10 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.7.1/config/projects/td-agent3.rb#L22
31
+ gemfile: gemfiles/Gemfile.td-agent-3.7.1
32
+ - rvm: 2.4.10 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.8.0/config/projects/td-agent3.rb#L22
33
+ gemfile: gemfiles/Gemfile.td-agent-3.8.0
23
34
  fast_finish: true
24
35
 
25
36
  script: bundle exec rake test
@@ -1,5 +1,31 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.2.3
4
+
5
+ - Enhancement - Add placeholder support for delivery_stream_name of kinesis_firehose : [#203](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/203) [#204](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/204)
6
+
7
+ ## 3.2.2
8
+
9
+ - Enhancement - Make more strict gem pinning to deal with google-protobuf requiring Ruby 2.5+ : [#199](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/199)
10
+ - Bug - Fix MissingRegionError when http_proxy and endpoint_url are specified : [#197](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/197)
11
+
12
+ ## 3.2.1
13
+
14
+ - Enhancement - Use Fluent::MessagePackFactory class methods instead of Mixin with Fluentd >= v1.8 : [#194](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/194) [#195](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/195)
15
+ - Enhancement - Add td-agent 3.5.1 and Fluentd 1.9.1 to test cases
16
+
17
+ ## 3.2.0
18
+
19
+ - Feature - Add placeholder support for stream names to send records to multiple streams : [#165](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/165) [#174](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/174)
20
+ - Enhancement - Add sts_endpoint_url configuration parameter to support AWS STS regional endpoints : [#186](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/186)
21
+ - Enhancement - Add aws_ses_token configuration parameter to use IAM with MFA and directly provided temporary credentials : [#166](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/166)
22
+ - Dependency - Update gem dependency to Ruby 2.3.0+ and Fluentd 0.14.22+
23
+ - Bug - Fix dependency problem on AWS SDK with td-agent v3.4.1
24
+
25
+ ## 3.1.0
26
+
27
+ - Feature - Add process_credentials configuration : [#178](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/178)
28
+
3
29
  ## 3.0.0
4
30
 
5
31
  Plugin v3 is almost compatible with v2. You can use v3 with the same configuration as v2. For more details, please see [README](README.md).
data/README.md CHANGED
@@ -3,9 +3,10 @@
3
3
  [![Gitter](https://badges.gitter.im/awslabs/aws-fluent-plugin-kinesis.svg)](https://gitter.im/awslabs/aws-fluent-plugin-kinesis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
4
4
  [![Build Status](https://travis-ci.org/awslabs/aws-fluent-plugin-kinesis.svg?branch=master)](https://travis-ci.org/awslabs/aws-fluent-plugin-kinesis)
5
5
  [![Gem Version](https://badge.fury.io/rb/fluent-plugin-kinesis.svg)](https://rubygems.org/gems/fluent-plugin-kinesis)
6
+ [![Gem Downloads](https://img.shields.io/gem/dt/fluent-plugin-kinesis.svg)](https://rubygems.org/gems/fluent-plugin-kinesis)
6
7
 
7
8
  [Fluentd][fluentd] output plugin
8
- that sends events to [Amazon Kinesis Data Streams][streams] and [Amazon Kinesis Data Firehose][firehose]. Also it supports [KPL Aggregated record format][kpl]. This gem includes three output plugins respectively:
9
+ that sends events to [Amazon Kinesis Data Streams][streams] and [Amazon Kinesis Data Firehose][firehose]. Also it supports [KPL Aggregated Record Format][kpl]. This gem includes three output plugins respectively:
9
10
 
10
11
  - `kinesis_streams`
11
12
  - `kinesis_firehose`
@@ -24,7 +25,7 @@ Or you can install this plugin for [td-agent][td-agent] as:
24
25
 
25
26
  td-agent-gem install fluent-plugin-kinesis
26
27
 
27
- If you would like to build by yourself and install, please see the section below. Your need [bundler][bundler] for this.
28
+ If you would like to build by yourself and install, see the section below. Your need [bundler][bundler] for this.
28
29
 
29
30
  In case of using with Fluentd: Fluentd will be also installed via the process below.
30
31
 
@@ -50,8 +51,8 @@ Or just download specify your Ruby library path. Below is the sample for specify
50
51
  export RUBYLIB=$RUBYLIB:/path/to/aws-fluent-plugin-kinesis/lib
51
52
 
52
53
  ## Dependencies
53
- * Ruby 2.1.0+
54
- * Fluentd 0.14.10+
54
+ * Ruby 2.3.0+
55
+ * Fluentd 0.14.22+ (td-agent v3.1.0+)
55
56
 
56
57
  ## Basic Usage
57
58
  Here are general procedures for using this plugin:
@@ -82,7 +83,7 @@ Assume you use Amazon EC2 instances with Instance profile. If you want to use sp
82
83
  stream_name your_stream
83
84
  partition_key key # Otherwise, use random partition key
84
85
  </match>
85
- For more detail, see [Configuration: kinesis_streams](#configuration-kinesis_streams)
86
+ For more details, see [Configuration: kinesis_streams](#configuration-kinesis_streams).
86
87
 
87
88
  ### kinesis_firehose
88
89
  <match your_tag>
@@ -90,7 +91,7 @@ For more detail, see [Configuration: kinesis_streams](#configuration-kinesis_str
90
91
  region us-east-1
91
92
  delivery_stream_name your_stream
92
93
  </match>
93
- For more detail, see [Configuration: kinesis_firehose](#configuration-kinesis_firehose)
94
+ For more details, see [Configuration: kinesis_firehose](#configuration-kinesis_firehose).
94
95
 
95
96
  ### kinesis_streams_aggregated
96
97
  <match your_tag>
@@ -100,10 +101,10 @@ For more detail, see [Configuration: kinesis_firehose](#configuration-kinesis_fi
100
101
  # Unlike kinesis_streams, there is no way to use dynamic partition key.
101
102
  # fixed_partition_key or random.
102
103
  </match>
103
- For more detail, see [Configuration: kinesis_streams_aggregated](#configuration-kinesis_streams_aggregated)
104
+ For more details, see [Configuration: kinesis_streams_aggregated](#configuration-kinesis_streams_aggregated).
104
105
 
105
106
  ### For better throughput
106
- Add configuration like below:
107
+ Add configurations like below:
107
108
 
108
109
  flush_interval 1
109
110
  chunk_limit_size 1m
@@ -111,12 +112,14 @@ Add configuration like below:
111
112
  flush_thread_burst_interval 0.01
112
113
  flush_thread_count 15
113
114
 
115
+ When you use Fluent v1.0 (td-agent3), write these configurations in buffer section. For more details, see [Config: Buffer Section][fluentd-buffer-section].
116
+
114
117
  Note: Each value should be adjusted to your system by yourself.
115
118
 
116
119
  ## Configuration: Credentials
117
120
  To put records into Amazon Kinesis Data Streams or Firehose, you need to provide AWS security credentials somehow. Without specifying credentials in config file, this plugin automatically fetch credential just following AWS SDK for Ruby does (environment variable, shared profile, and instance profile).
118
121
 
119
- This plugin uses the same configuration in [fluent-plugin-s3][fluent-plugin-s3].
122
+ This plugin uses the same configuration in [fluent-plugin-s3][fluent-plugin-s3], but also supports aws session tokens for temporary credentials.
120
123
 
121
124
  **aws_key_id**
122
125
 
@@ -126,12 +129,16 @@ AWS access key id. This parameter is required when your agent is not running on
126
129
 
127
130
  AWS secret key. This parameter is required when your agent is not running on EC2 instance with an IAM Role.
128
131
 
132
+ **aws_ses_token**
133
+
134
+ AWS session token. This parameter is optional, but can be provided if using MFA or temporary credentials when your agent is not running on EC2 instance with an IAM Role.
135
+
129
136
  **aws_iam_retries**
130
137
 
131
138
  The number of attempts to make (with exponential backoff) when loading instance profile credentials from the EC2 metadata service using an IAM role. Defaults to 5 retries.
132
139
 
133
140
  ### assume_role_credentials
134
- Typically, you use AssumeRole for cross-account access or federation.
141
+ Typically, you can use AssumeRole for cross-account access or federation.
135
142
 
136
143
  <match *>
137
144
  @type kinesis_streams
@@ -145,9 +152,9 @@ Typically, you use AssumeRole for cross-account access or federation.
145
152
  See also:
146
153
 
147
154
  * [Using IAM Roles - AWS Identity and Access
148
- Management](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
149
- * [Aws::STS::Client](http://docs.aws.amazon.com/sdkforruby/api/Aws/STS/Client.html)
150
- * [Aws::AssumeRoleCredentials](http://docs.aws.amazon.com/sdkforruby/api/Aws/AssumeRoleCredentials.html)
155
+ Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
156
+ * [Aws::STS::Client](https://docs.aws.amazon.com/sdkforruby/api/Aws/STS/Client.html)
157
+ * [Aws::AssumeRoleCredentials](https://docs.aws.amazon.com/sdkforruby/api/Aws/AssumeRoleCredentials.html)
151
158
 
152
159
  **role_arn (required)**
153
160
 
@@ -175,6 +182,10 @@ Proxy url for proxying requests to amazon sts service api. This needs to be set
175
182
  It should be added to assume_role_credentials configuration stanza in the next format:
176
183
  sts_http_proxy http://[username:password]@hostname:port
177
184
 
185
+ **sts_endpoint_url**
186
+
187
+ STS API endpoint url. This can be used to override the default global STS API endpoint of sts.amazonaws.com. Using regional endpoints may be preferred to reduce latency, and are required if utilizing a PrivateLink VPC Endpoint for STS API calls.
188
+
178
189
  ### instance_profile_credentials
179
190
 
180
191
  Retrieve temporary security credentials via HTTP request. This is useful on EC2 instance.
@@ -190,11 +201,11 @@ Retrieve temporary security credentials via HTTP request. This is useful on EC2
190
201
 
191
202
  See also:
192
203
 
193
- * [Aws::InstanceProfileCredentials](http://docs.aws.amazon.com/sdkforruby/api/Aws/InstanceProfileCredentials.html)
204
+ * [Aws::InstanceProfileCredentials](https://docs.aws.amazon.com/sdkforruby/api/Aws/InstanceProfileCredentials.html)
194
205
  * [Temporary Security Credentials - AWS Identity and Access
195
- Management](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
206
+ Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
196
207
  * [Instance Metadata and User Data - Amazon Elastic Compute
197
- Cloud](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
208
+ Cloud](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
198
209
 
199
210
  **retries**
200
211
 
@@ -231,7 +242,7 @@ This loads AWS access credentials from local ini file. This is useful for local
231
242
 
232
243
  See also:
233
244
 
234
- * [Aws::SharedCredentials](http://docs.aws.amazon.com/sdkforruby/api/Aws/SharedCredentials.html)
245
+ * [Aws::SharedCredentials](https://docs.aws.amazon.com/sdkforruby/api/Aws/SharedCredentials.html)
235
246
 
236
247
  **path**
237
248
 
@@ -241,10 +252,31 @@ Path to the shared file. Defaults to "#{Dir.home}/.aws/credentials".
241
252
 
242
253
  Defaults to 'default' or `[ENV]('AWS_PROFILE')`.
243
254
 
255
+ ### process_credentials
256
+
257
+ This loads AWS access credentials from an external process.
258
+
259
+ <match *>
260
+ @type kinesis_streams
261
+
262
+ <process_credentials>
263
+ process CMD
264
+ </process_credentials>
265
+ </match>
266
+
267
+ See also:
268
+
269
+ * [Aws::ProcessCredentials](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/ProcessCredentials.html)
270
+ * [Sourcing Credentials From External Processes](https://docs.aws.amazon.com/cli/latest/topic/config-vars.html#sourcing-credentials-from-external-processes)
271
+
272
+ **process (required)**
273
+
274
+ Command to be executed as an external process.
275
+
244
276
  ## Configuration: Format
245
277
 
246
278
  ### format (section)
247
- This plugin use `Fluent::TextFormatter` to serialize record to string. For more detail, see [formatter.rb]. By default, it uses `json` formatter same as specific like below:
279
+ This plugin uses `Fluent::TextFormatter` to serialize record to string. See [formatter.rb] for more details. By default, it uses `json` formatter same as specific like below:
248
280
 
249
281
  <match *>
250
282
  @type kinesis_streams
@@ -254,10 +286,12 @@ This plugin use `Fluent::TextFormatter` to serialize record to string. For more
254
286
  </format>
255
287
  </match>
256
288
 
289
+ For other configurations of `json` formatter, see [json formatter plugin][fluentd-formatter-json].
290
+
257
291
  ### inject (section)
258
- This plugin use `Fluent::TimeFormatter` and other injection configurations. For more detail, see [inject.rb]. This section only works with Fluentd v0.14.
292
+ This plugin uses `Fluent::TimeFormatter` and other injection configurations. See [inject.rb] for more details.
259
293
 
260
- For example, the config below will add `time` field whose value is eventtime with nanosecond and `tag` field whose value is its tag. (Mostly same as `include_time key true` and `include_tag_key true`)
294
+ For example, the config below will add `time` field whose value is event time with nanosecond and `tag` field whose value is its tag.
261
295
 
262
296
  <match *>
263
297
  @type kinesis_streams
@@ -272,16 +306,6 @@ By default, `time_type string` and `time_format %Y-%m-%dT%H:%M:%S.%N%z` are alre
272
306
 
273
307
  Also, there are some format related options below:
274
308
 
275
- ### include_time_key
276
- **Notice** With Fluentd v0.14, you should use inject section.
277
-
278
- Defalut `false`. If you want to include `time` field in your record, set `true`.
279
-
280
- ### include_tag_key
281
- **Notice** With Fluentd v0.14, you should use inject section.
282
-
283
- Defalut `false`. If you want to include `tag` field in your record, set `true`.
284
-
285
309
  ### data_key
286
310
  If your record contains a field whose string should be sent to Amazon Kinesis directly (without formatter), use this parameter to specify the field. In that case, other fields than **data_key** are thrown away and never sent to Amazon Kinesis. Default `nil`, which means whole record will be formatted and sent.
287
311
 
@@ -347,6 +371,30 @@ Here are `kinesis_streams` specific configurations.
347
371
  ### stream_name
348
372
  Name of the stream to put data.
349
373
 
374
+ As of Fluentd v1, built-in placeholders are supported. Now, you can also use built-in placeholders for this parameter.
375
+
376
+ **NOTE:**
377
+ Built-in placeholders require target key information in your buffer section attributes.
378
+
379
+ e.g.)
380
+
381
+ When you specify the following `stream_name` configuration with built-in placeholder:
382
+
383
+ ```aconf
384
+ stream_name "${$.kubernetes.annotations.kinesis_streams}"
385
+ ```
386
+
387
+ you ought to specify the corresponding attributes in buffer section:
388
+
389
+ ```aconf
390
+ # $.kubernetes.annotations.kinesis_streams needs to be set in buffer attributes
391
+ <buffer $.kubernetes.annotations.kinesis_streams>
392
+ # ...
393
+ </buffer>
394
+ ```
395
+
396
+ For more details, refer [Placeholders section in the official Fluentd document](https://docs.fluentd.org/configuration/buffer-section#placeholders).
397
+
350
398
  ### partition_key
351
399
  A key to extract partition key from JSON object. Default `nil`, which means partition key will be generated randomly.
352
400
 
@@ -356,6 +404,30 @@ Here are `kinesis_firehose` specific configurations.
356
404
  ### delivery_stream_name
357
405
  Name of the delivery stream to put data.
358
406
 
407
+ As of Fluentd v1, built-in placeholders are supported. Now, you can also use built-in placeholders for this parameter.
408
+
409
+ **NOTE:**
410
+ Built-in placeholders require target key information in your buffer section attributes.
411
+
412
+ e.g.)
413
+
414
+ When you specify the following `delivery_stream_name` configuration with built-in placeholder:
415
+
416
+ ```aconf
417
+ delivery_stream_name "${$.kubernetes.annotations.kinesis_firehose_streams}"
418
+ ```
419
+
420
+ you ought to specify the corresponding attributes in buffer section:
421
+
422
+ ```aconf
423
+ # $.kubernetes.annotations.kinesis_firehose_streams needs to be set in buffer attributes
424
+ <buffer $.kubernetes.annotations.kinesis_firehose_streams>
425
+ # ...
426
+ </buffer>
427
+ ```
428
+
429
+ For more details, refer [Placeholders section in the official Fluentd document](https://docs.fluentd.org/configuration/buffer-section#placeholders).
430
+
359
431
  ### append_new_line
360
432
  Boolean. Default `true`. If it is enabled, the plugin adds new line character (`\n`) to each serialized record.
361
433
  Before appending `\n`, plugin calls chomp and removes separator from the end of each record as [chomp_record](#chomp_record) is `true`. Therefore, you don't need to enable [chomp_record](#chomp_record) option when you use [kinesis_firehose](#kinesis_firehose) output with default configuration ([append_new_line](#append_new_line) is `true`). If you want to set [append_new_line](#append_new_line) `false`, you can choose [chomp_record](#chomp_record) `false` (default) or `true` (compatible format with plugin v2).
@@ -366,6 +438,30 @@ Here are `kinesis_streams_aggregated` specific configurations.
366
438
  ### stream_name
367
439
  Name of the stream to put data.
368
440
 
441
+ As of Fluentd v1, built-in placeholders are supported. Now, you can also use built-in placeholders for this parameter.
442
+
443
+ **NOTE:**
444
+ Built-in placeholders require target key information in your buffer section attributes.
445
+
446
+ e.g.)
447
+
448
+ When you specify the following `stream_name` configuration with built-in placeholder:
449
+
450
+ ```aconf
451
+ stream_name "${$.kubernetes.annotations.kinesis_streams_aggregated}"
452
+ ```
453
+
454
+ you ought to specify the corresponding attributes in buffer section:
455
+
456
+ ```aconf
457
+ # $.kubernetes.annotations.kinesis_streams_aggregated needs to be set in buffer attributes
458
+ <buffer $.kubernetes.annotations.kinesis_streams_aggregated>
459
+ # ...
460
+ </buffer>
461
+ ```
462
+
463
+ For more details, refer [Placeholders section in the official Fluentd document](https://docs.fluentd.org/configuration/buffer-section#placeholders).
464
+
369
465
  ### fixed_partition_key
370
466
  A value of fixed partition key. Default `nil`, which means partition key will be generated randomly.
371
467
 
@@ -393,17 +489,18 @@ Bug reports and pull requests are welcome on [GitHub][github].
393
489
  * [Amazon Kinesis Data Streams Developer Guide](http://docs.aws.amazon.com/kinesis/latest/dev/introduction.html)
394
490
  * [Amazon Kinesis Data Firehose Developer Guide](http://docs.aws.amazon.com/firehose/latest/dev/what-is-this-service.html)
395
491
 
396
- [fluentd]: http://fluentd.org/
492
+ [fluentd]: https://www.fluentd.org/
397
493
  [streams]: https://aws.amazon.com/kinesis/streams/
398
494
  [firehose]: https://aws.amazon.com/kinesis/firehose/
399
495
  [kpl]: https://github.com/awslabs/amazon-kinesis-producer/blob/master/aggregation-format.md
400
- [td-agent]: https://github.com/treasure-data/td-agent
401
- [bundler]: http://bundler.io/
402
- [region]: http://docs.aws.amazon.com/general/latest/gr/rande.html#ak_region
403
- [fluentd_buffer]: http://docs.fluentd.org/articles/buffer-plugin-overview
496
+ [td-agent]: https://github.com/treasure-data/omnibus-td-agent
497
+ [bundler]: https://bundler.io/
498
+ [region]: https://docs.aws.amazon.com/general/latest/gr/rande.html#ak_region
499
+ [fluentd-buffer-section]: https://docs.fluentd.org/configuration/buffer-section
500
+ [fluentd-formatter-json]: https://docs.fluentd.org/formatter/json
404
501
  [github]: https://github.com/awslabs/aws-fluent-plugin-kinesis
405
502
  [formatter.rb]: https://github.com/fluent/fluentd/blob/master/lib/fluent/formatter.rb
406
503
  [inject.rb]: https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin_helper/inject.rb
407
- [fluentd-doc-kinesis]: http://docs.fluentd.org/articles/kinesis-stream
504
+ [fluentd-doc-kinesis]: https://docs.fluentd.org/how-to-guides/kinesis-stream
408
505
  [fluent-plugin-s3]: https://github.com/fluent/fluent-plugin-s3
409
506
  [v1-readme]: https://github.com/awslabs/aws-fluent-plugin-kinesis/blob/v1/README.md
@@ -28,9 +28,9 @@ Gem::Specification.new do |spec|
28
28
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
- spec.required_ruby_version = '>= 2.1'
31
+ spec.required_ruby_version = '>= 2.3'
32
32
 
33
- spec.add_dependency "fluentd", ">= 0.14.10", "< 2"
33
+ spec.add_dependency "fluentd", ">= 0.14.22", "< 2"
34
34
 
35
35
  # This plugin is sometimes used with s3 plugin, so watch out for conflicts
36
36
  # https://rubygems.org/gems/fluent-plugin-s3
@@ -40,14 +40,22 @@ Gem::Specification.new do |spec|
40
40
  # NoMethodError: undefined method `event=' for #<Seahorse::Model::Shapes::ShapeRef:*>
41
41
  # https://github.com/aws/aws-sdk-ruby/commit/03d60f9d3d821e645bd2a3efca066f37350ef906#diff-c69f15af8ea3eb9ab152659476e04608R401
42
42
  # https://github.com/aws/aws-sdk-ruby/commit/571c2d0e5ff9c24ff72893a08a74790db591fb57#diff-a55155f04aa6559460a0814e264eb0cdR43
43
- spec.add_dependency "aws-sdk-kinesis", "~> 1", "!= 1.4", "!= 1.5"
43
+ # Exclude aws-sdk-kinesis v1.14 to avoid aws-sdk-core dependency problem with td-agent v3.4.1
44
+ # LoadError: cannot load such file -- aws-sdk-core/plugins/transfer_encoding.rb
45
+ # https://github.com/aws/aws-sdk-ruby/commit/bb61ed0a2fabc6b1f90b757f13f37d5aeae48d8a#diff-b493e941d32289cd2df7eebc3fc5be2cR26
46
+ # https://github.com/aws/aws-sdk-ruby/commit/e26577d2a426a4be79cd2d9edc1a4a4176e388ba#diff-10f50e27b30c3dc522b3c25db5782e2e
47
+ spec.add_dependency "aws-sdk-kinesis", "~> 1", "!= 1.4", "!= 1.5", "!= 1.14"
44
48
  # Exclude aws-sdk-firehose v1.9 to avoid aws-sdk-core dependency problem with td-agent v3.2.1
45
49
  # LoadError: cannot load such file -- aws-sdk-core/plugins/endpoint_discovery.rb
46
50
  # https://github.com/aws/aws-sdk-ruby/commit/85d8538a62255e58d9e176ee524a9f94354b51a0#diff-d51486091a10ada65b308b7f45966af1R18
47
51
  # https://github.com/aws/aws-sdk-ruby/commit/7c9584bc6473100df9aec9333ab491ad4faeeca8#diff-be94f87e58e00329a6c0e03e43d5c292
48
- spec.add_dependency "aws-sdk-firehose", "~> 1", "!= 1.5", "!= 1.9"
52
+ # Exclude aws-sdk-firehose v1.15 to avoid aws-sdk-core dependency problem with td-agent v3.4.1
53
+ # LoadError: cannot load such file -- aws-sdk-core/plugins/transfer_encoding.rb
54
+ # https://github.com/aws/aws-sdk-ruby/commit/bb61ed0a2fabc6b1f90b757f13f37d5aeae48d8a#diff-d51486091a10ada65b308b7f45966af1R26
55
+ # https://github.com/aws/aws-sdk-ruby/commit/e26577d2a426a4be79cd2d9edc1a4a4176e388ba#diff-10f50e27b30c3dc522b3c25db5782e2e
56
+ spec.add_dependency "aws-sdk-firehose", "~> 1", "!= 1.5", "!= 1.9", "!= 1.15"
49
57
 
50
- spec.add_dependency "google-protobuf", "~> 3"
58
+ spec.add_dependency "google-protobuf", "~> 3", "< 3.12"
51
59
 
52
60
  spec.add_development_dependency "bundler", ">= 1.10"
53
61
  spec.add_development_dependency "rake", ">= 10.0"
@@ -17,4 +17,4 @@ source 'https://rubygems.org'
17
17
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
18
  gemspec path: ".."
19
19
 
20
- gem "fluentd", "0.14.10"
20
+ gem "fluentd", "0.14.22"
@@ -0,0 +1,20 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ gem "fluentd", "1.11.1"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.1.0
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.1.0/config/projects/td-agent3.rb#L25
22
+ gem "fluentd", "0.14.25"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.1.0/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.3.1"
25
+ gem "aws-partitions", "1.42.0"
26
+ gem "aws-sigv4", "1.0.2"
27
+ gem "aws-sdk-core", "3.11.0"
28
+ gem "aws-sdk-kms", "1.3.0"
29
+ gem "aws-sdk-sqs", "1.3.0"
30
+ gem "aws-sdk-s3", "1.8.0"
31
+ gem "fluent-plugin-s3", "1.1.0"
@@ -0,0 +1,34 @@
1
+ #
2
+ # Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.4.1
21
+ # td-agent v3.4.0 has the same dependencies
22
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.1/config/projects/td-agent3.rb#L27
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.0/config/projects/td-agent3.rb#L27
24
+ gem "fluentd", "1.4.2"
25
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.1/plugin_gems.rb#L16-L23
26
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.0/plugin_gems.rb#L16-L23
27
+ gem "jmespath", "1.4.0"
28
+ gem "aws-partitions", "1.149.0"
29
+ gem "aws-sigv4", "1.1.0"
30
+ gem "aws-sdk-core", "3.48.3"
31
+ gem "aws-sdk-kms", "1.16.0"
32
+ gem "aws-sdk-sqs", "1.13.0"
33
+ gem "aws-sdk-s3", "1.36.0"
34
+ gem "fluent-plugin-s3", "1.1.9"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.5.0
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.0/config/projects/td-agent3.rb#L27
22
+ gem "fluentd", "1.7.0"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.0/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.195.0"
26
+ gem "aws-sigv4", "1.1.0"
27
+ gem "aws-sdk-core", "3.61.2"
28
+ gem "aws-sdk-kms", "1.24.0"
29
+ gem "aws-sdk-sqs", "1.20.0"
30
+ gem "aws-sdk-s3", "1.46.0"
31
+ gem "fluent-plugin-s3", "1.1.11"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.5.1
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.1/config/projects/td-agent3.rb#L27
22
+ gem "fluentd", "1.7.4"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.1/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.230.0"
26
+ gem "aws-sigv4", "1.1.0"
27
+ gem "aws-sdk-core", "3.72.0"
28
+ gem "aws-sdk-kms", "1.25.0"
29
+ gem "aws-sdk-sqs", "1.23.0"
30
+ gem "aws-sdk-s3", "1.52.0"
31
+ gem "fluent-plugin-s3", "1.2.0"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.6.0
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.6.0/config/projects/td-agent3.rb#L27
22
+ gem "fluentd", "1.9.2"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.6.0/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.273.0"
26
+ gem "aws-sigv4", "1.1.0"
27
+ gem "aws-sdk-core", "3.90.0"
28
+ gem "aws-sdk-kms", "1.29.0"
29
+ gem "aws-sdk-sqs", "1.23.1"
30
+ gem "aws-sdk-s3", "1.60.2"
31
+ gem "fluent-plugin-s3", "1.3.0"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.7.1
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.7.1/config/projects/td-agent3.rb#L27
22
+ gem "fluentd", "1.10.2"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.7.1/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.297.0"
26
+ gem "aws-sigv4", "1.1.1"
27
+ gem "aws-sdk-core", "3.94.0"
28
+ gem "aws-sdk-kms", "1.30.0"
29
+ gem "aws-sdk-sqs", "1.24.0"
30
+ gem "aws-sdk-s3", "1.63.0"
31
+ gem "fluent-plugin-s3", "1.3.1"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.8.0
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.8.0/config/projects/td-agent3.rb#L27
22
+ gem "fluentd", "1.11.1"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.8.0/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.332.0"
26
+ gem "aws-sigv4", "1.2.0"
27
+ gem "aws-sdk-core", "3.100.0"
28
+ gem "aws-sdk-kms", "1.34.1"
29
+ gem "aws-sdk-sqs", "1.28.0"
30
+ gem "aws-sdk-s3", "1.69.1"
31
+ gem "fluent-plugin-s3", "1.3.2"
@@ -12,6 +12,8 @@
12
12
  # ANY KIND, either express or implied. See the License for the specific
13
13
  # language governing permissions and limitations under the License.
14
14
 
15
+ require 'fluent/version'
16
+ require 'fluent/msgpack_factory'
15
17
  require 'fluent/plugin/output'
16
18
  require 'fluent/plugin/kinesis_helper/client'
17
19
  require 'fluent/plugin/kinesis_helper/api'
@@ -20,7 +22,6 @@ require 'zlib'
20
22
  module Fluent
21
23
  module Plugin
22
24
  class KinesisOutput < Fluent::Plugin::Output
23
- include Fluent::MessagePackFactory::Mixin
24
25
  include KinesisHelper::Client
25
26
  include KinesisHelper::API
26
27
 
@@ -133,6 +134,14 @@ module Fluent
133
134
  ''
134
135
  end
135
136
 
137
+ if Gem::Version.new(Fluent::VERSION) >= Gem::Version.new('1.8.0')
138
+ def msgpack_unpacker(*args)
139
+ Fluent::MessagePackFactory.msgpack_unpacker(*args)
140
+ end
141
+ else
142
+ include Fluent::MessagePackFactory::Mixin
143
+ end
144
+
136
145
  def write_records_batch(chunk, &block)
137
146
  unique_id = chunk.dump_unique_id_hex(chunk.unique_id)
138
147
  chunk.open do |io|
@@ -79,7 +79,7 @@ module Fluent
79
79
  yield(batch, size)
80
80
  batch = []
81
81
  size = 0
82
- end
82
+ end
83
83
  batch << record
84
84
  size += record_size
85
85
  end
@@ -21,14 +21,15 @@ module Fluent
21
21
  module Client
22
22
  module ClientParams
23
23
  include Fluent::Configurable
24
- config_param :region, :string, default: nil
24
+ config_param :region, :string, default: nil
25
25
 
26
26
  config_param :http_proxy, :string, default: nil, secret: true
27
27
  config_param :endpoint, :string, default: nil
28
28
  config_param :ssl_verify_peer, :bool, default: true
29
29
 
30
- config_param :aws_key_id, :string, default: nil, secret: true
31
- config_param :aws_sec_key, :string, default: nil, secret: true
30
+ config_param :aws_key_id, :string, default: nil, secret: true
31
+ config_param :aws_sec_key, :string, default: nil, secret: true
32
+ config_param :aws_ses_token, :string, default: nil, secret: true
32
33
  config_section :assume_role_credentials, multi: false do
33
34
  desc "The Amazon Resource Name (ARN) of the role to assume"
34
35
  config_param :role_arn, :string, secret: true
@@ -42,6 +43,8 @@ module Fluent
42
43
  config_param :external_id, :string, default: nil, secret: true
43
44
  desc "A http proxy url for requests to aws sts service"
44
45
  config_param :sts_http_proxy, :string, default: nil, secret: true
46
+ desc "A URL for a regional STS API endpoint, the default is global"
47
+ config_param :sts_endpoint_url, :string, default: nil
45
48
  end
46
49
  config_section :instance_profile_credentials, multi: false do
47
50
  desc "Number of times to retry when retrieving credentials"
@@ -63,6 +66,10 @@ module Fluent
63
66
  desc "Profile name. Default to 'default' or ENV['AWS_PROFILE']"
64
67
  config_param :profile_name, :string, default: nil
65
68
  end
69
+ config_section :process_credentials, multi: false do
70
+ desc "External process to execute."
71
+ config_param :process, :string
72
+ end
66
73
  end
67
74
 
68
75
  def self.included(mod)
@@ -111,6 +118,10 @@ module Fluent
111
118
  options = {}
112
119
  credentials_options = {}
113
120
  case
121
+ when @aws_key_id && @aws_sec_key && @aws_ses_token
122
+ options[:access_key_id] = @aws_key_id
123
+ options[:secret_access_key] = @aws_sec_key
124
+ options[:session_token] = @aws_ses_token
114
125
  when @aws_key_id && @aws_sec_key
115
126
  options[:access_key_id] = @aws_key_id
116
127
  options[:secret_access_key] = @aws_sec_key
@@ -121,12 +132,21 @@ module Fluent
121
132
  credentials_options[:policy] = c.policy if c.policy
122
133
  credentials_options[:duration_seconds] = c.duration_seconds if c.duration_seconds
123
134
  credentials_options[:external_id] = c.external_id if c.external_id
124
- if c.sts_http_proxy and @region
135
+ credentials_options[:sts_endpoint_url] = c.sts_endpoint_url if c.sts_endpoint_url
136
+ if @region and c.sts_http_proxy and c.sts_endpoint_url
137
+ credentials_options[:client] = Aws::STS::Client.new(region: @region, http_proxy: c.sts_http_proxy, endpoint: c.sts_endpoint_url)
138
+ elsif c.sts_http_proxy and c.sts_endpoint_url
139
+ credentials_options[:client] = Aws::STS::Client.new(http_proxy: c.sts_http_proxy, endpoint: c.sts_endpoint_url)
140
+ elsif @region and c.sts_http_proxy
125
141
  credentials_options[:client] = Aws::STS::Client.new(region: @region, http_proxy: c.sts_http_proxy)
126
- elsif @region
127
- credentials_options[:client] = Aws::STS::Client.new(region: @region)
142
+ elsif @region and c.sts_endpoint_url
143
+ credentials_options[:client] = Aws::STS::Client.new(region: @region, endpoint: c.sts_endpoint_url)
128
144
  elsif c.sts_http_proxy
129
145
  credentials_options[:client] = Aws::STS::Client.new(http_proxy: c.sts_http_proxy)
146
+ elsif c.sts_endpoint_url
147
+ credentials_options[:client] = Aws::STS::Client.new(endpoint: c.sts_endpoint_url)
148
+ elsif @region
149
+ credentials_options[:client] = Aws::STS::Client.new(region: @region)
130
150
  end
131
151
  options[:credentials] = Aws::AssumeRoleCredentials.new(credentials_options)
132
152
  when @instance_profile_credentials
@@ -146,6 +166,13 @@ module Fluent
146
166
  credentials_options[:path] = c.path if c.path
147
167
  credentials_options[:profile_name] = c.profile_name if c.profile_name
148
168
  options[:credentials] = Aws::SharedCredentials.new(credentials_options)
169
+ when @process_credentials
170
+ if Gem::Version.new(Aws::CORE_GEM_VERSION) < Gem::Version.new('3.24.0')
171
+ raise Fluent::ConfigError, "Config process_credentials requires aws-sdk-core >= 3.24.0. Found aws-sdk-core #{Aws::CORE_GEM_VERSION} instead."
172
+ end
173
+ c = @process_credentials
174
+ process = c.process
175
+ options[:credentials] = Aws::ProcessCredentials.new(process)
149
176
  else
150
177
  # Use default credentials
151
178
  # See http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Client.html
@@ -44,12 +44,13 @@ module Fluent
44
44
  end
45
45
 
46
46
  def write(chunk)
47
+ delivery_stream_name = extract_placeholders(@delivery_stream_name, chunk)
47
48
  write_records_batch(chunk) do |batch|
48
49
  records = batch.map{|(data)|
49
50
  { data: data }
50
51
  }
51
52
  client.put_record_batch(
52
- delivery_stream_name: @delivery_stream_name,
53
+ delivery_stream_name: delivery_stream_name,
53
54
  records: records,
54
55
  )
55
56
  end
@@ -41,12 +41,13 @@ module Fluent
41
41
  end
42
42
 
43
43
  def write(chunk)
44
+ stream_name = extract_placeholders(@stream_name, chunk)
44
45
  write_records_batch(chunk) do |batch|
45
46
  records = batch.map{|(data, partition_key)|
46
47
  { data: data, partition_key: partition_key }
47
48
  }
48
49
  client.put_records(
49
- stream_name: @stream_name,
50
+ stream_name: stream_name,
50
51
  records: records,
51
52
  )
52
53
  end
@@ -43,11 +43,12 @@ module Fluent
43
43
  end
44
44
 
45
45
  def write(chunk)
46
+ stream_name = extract_placeholders(@stream_name, chunk)
46
47
  write_records_batch(chunk) do |batch|
47
48
  key = @partition_key_generator.call
48
49
  records = batch.map{|(data)|data}
49
50
  client.put_records(
50
- stream_name: @stream_name,
51
+ stream_name: stream_name,
51
52
  records: [{
52
53
  partition_key: key,
53
54
  data: aggregator.aggregate(records, key),
@@ -13,5 +13,5 @@
13
13
  # language governing permissions and limitations under the License.
14
14
 
15
15
  module FluentPluginKinesis
16
- VERSION = '3.0.0'
16
+ VERSION = '3.2.3'
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-kinesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-19 00:00:00.000000000 Z
11
+ date: 2020-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.10
19
+ version: 0.14.22
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.14.10
29
+ version: 0.14.22
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2'
@@ -43,6 +43,9 @@ dependencies:
43
43
  - - "!="
44
44
  - !ruby/object:Gem::Version
45
45
  version: '1.5'
46
+ - - "!="
47
+ - !ruby/object:Gem::Version
48
+ version: '1.14'
46
49
  type: :runtime
47
50
  prerelease: false
48
51
  version_requirements: !ruby/object:Gem::Requirement
@@ -56,6 +59,9 @@ dependencies:
56
59
  - - "!="
57
60
  - !ruby/object:Gem::Version
58
61
  version: '1.5'
62
+ - - "!="
63
+ - !ruby/object:Gem::Version
64
+ version: '1.14'
59
65
  - !ruby/object:Gem::Dependency
60
66
  name: aws-sdk-firehose
61
67
  requirement: !ruby/object:Gem::Requirement
@@ -69,6 +75,9 @@ dependencies:
69
75
  - - "!="
70
76
  - !ruby/object:Gem::Version
71
77
  version: '1.9'
78
+ - - "!="
79
+ - !ruby/object:Gem::Version
80
+ version: '1.15'
72
81
  type: :runtime
73
82
  prerelease: false
74
83
  version_requirements: !ruby/object:Gem::Requirement
@@ -82,6 +91,9 @@ dependencies:
82
91
  - - "!="
83
92
  - !ruby/object:Gem::Version
84
93
  version: '1.9'
94
+ - - "!="
95
+ - !ruby/object:Gem::Version
96
+ version: '1.15'
85
97
  - !ruby/object:Gem::Dependency
86
98
  name: google-protobuf
87
99
  requirement: !ruby/object:Gem::Requirement
@@ -89,6 +101,9 @@ dependencies:
89
101
  - - "~>"
90
102
  - !ruby/object:Gem::Version
91
103
  version: '3'
104
+ - - "<"
105
+ - !ruby/object:Gem::Version
106
+ version: '3.12'
92
107
  type: :runtime
93
108
  prerelease: false
94
109
  version_requirements: !ruby/object:Gem::Requirement
@@ -96,6 +111,9 @@ dependencies:
96
111
  - - "~>"
97
112
  - !ruby/object:Gem::Version
98
113
  version: '3'
114
+ - - "<"
115
+ - !ruby/object:Gem::Version
116
+ version: '3.12'
99
117
  - !ruby/object:Gem::Dependency
100
118
  name: bundler
101
119
  requirement: !ruby/object:Gem::Requirement
@@ -271,11 +289,19 @@ files:
271
289
  - Rakefile
272
290
  - benchmark/task.rake
273
291
  - fluent-plugin-kinesis.gemspec
274
- - gemfiles/Gemfile.fluentd-0.14.10
292
+ - gemfiles/Gemfile.fluentd-0.14.22
293
+ - gemfiles/Gemfile.fluentd-1.11.1
294
+ - gemfiles/Gemfile.td-agent-3.1.0
275
295
  - gemfiles/Gemfile.td-agent-3.1.1
276
296
  - gemfiles/Gemfile.td-agent-3.2.0
277
297
  - gemfiles/Gemfile.td-agent-3.2.1
278
298
  - gemfiles/Gemfile.td-agent-3.3.0
299
+ - gemfiles/Gemfile.td-agent-3.4.1
300
+ - gemfiles/Gemfile.td-agent-3.5.0
301
+ - gemfiles/Gemfile.td-agent-3.5.1
302
+ - gemfiles/Gemfile.td-agent-3.6.0
303
+ - gemfiles/Gemfile.td-agent-3.7.1
304
+ - gemfiles/Gemfile.td-agent-3.8.0
279
305
  - lib/fluent/plugin/kinesis.rb
280
306
  - lib/fluent/plugin/kinesis_helper/aggregator.rb
281
307
  - lib/fluent/plugin/kinesis_helper/api.rb
@@ -296,15 +322,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
296
322
  requirements:
297
323
  - - ">="
298
324
  - !ruby/object:Gem::Version
299
- version: '2.1'
325
+ version: '2.3'
300
326
  required_rubygems_version: !ruby/object:Gem::Requirement
301
327
  requirements:
302
328
  - - ">="
303
329
  - !ruby/object:Gem::Version
304
330
  version: '0'
305
331
  requirements: []
306
- rubyforge_project:
307
- rubygems_version: 2.6.14.1
332
+ rubygems_version: 3.0.3
308
333
  signing_key:
309
334
  specification_version: 4
310
335
  summary: Fluentd output plugin that sends events to Amazon Kinesis.