fluent-plugin-opensearch 1.0.6 → 1.0.7

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: 988e07d44cf92e9f0a09dfa57191ac4acdfd3a3fb1cd9598f12cb3e196ea88ac
4
- data.tar.gz: 786b826f8fdb04d2c16804c42efaa4c40042deb43f71bcb6bed31de13742b413
3
+ metadata.gz: c44bf1e420cb64daf8b5a2f21f38c47e692ed31feb0bd400189e737c19e819df
4
+ data.tar.gz: 896882755f7394472a8a4874a7a48786c50aee729b283e7be32818edcacc3e0c
5
5
  SHA512:
6
- metadata.gz: 9a6c39ce68b3d8616d490cd04006c85397ccf0fc4bb768f5f8182dad3f63abf5d29f721928ee7f074b361ba44d529e7080f99814300949ea5464ce4279ee1ba8
7
- data.tar.gz: 8eb1f4a48740d1d85dfeb0d25de3877c2e4dcf4f228d0bc3f4907c952aad17327ee4f157972338dad21ce38a0b5b44571553b918aa096191444772c18ef6f2d9
6
+ metadata.gz: a0718cd172d5549040faad8698a09eeeb9f5aadb00e19ab994d406143fa8789f20ce18e5b7526d9697822036c39f99aa96bdeeaace50b0b412f209d4057a3f5b
7
+ data.tar.gz: 59f7c8c735f4df3f69d4bc618df0653f00db191bd7c85f1a498509486f3fd7040073763436b0833279e24bdc52cf57b0a61322e896257a0e6ba6f19af9bc49e1
data/History.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### 1.0.7
6
+ - Expire AWS credentials with a certain interval (#52)
7
+
5
8
  ### 1.0.6
6
9
  - out\_opensearch: Handle suppress\_type\_name operation correctly (#61)
7
10
 
data/README.md CHANGED
@@ -1564,6 +1564,19 @@ In this case, the endpoint configuration looks like:
1564
1564
  </endpoint>
1565
1565
  ```
1566
1566
 
1567
+ ### Expiring AWS credentials
1568
+
1569
+ If you want to expire AWS credentials in certain interval, you should specify `refresh_credentials_interval` parameter under `endpoint` section:
1570
+
1571
+ ```aconf
1572
+ <endpoint>
1573
+ url https://CLUSTER_ENDPOINT_URL
1574
+ region eu-west-1
1575
+ # ...
1576
+ refresh_credentials_interval 3h # default is 5h (five hours).
1577
+ </endpoint>
1578
+ ```
1579
+
1567
1580
  ## Troubleshooting
1568
1581
 
1569
1582
  See [Troubleshooting document](README.Troubleshooting.md)
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'fluent-plugin-opensearch'
6
- s.version = '1.0.6'
6
+ s.version = '1.0.7'
7
7
  s.authors = ['Hiroshi Hatake']
8
8
  s.email = ['cosmo0920.wp@gmail.com']
9
9
  s.description = %q{Opensearch output plugin for Fluent event collector}
@@ -194,6 +194,7 @@ module Fluent::Plugin
194
194
  config_param :assume_role_session_name, :string, :default => "fluentd"
195
195
  config_param :assume_role_web_identity_token_file, :string, :default => nil
196
196
  config_param :sts_credentials_region, :string, :default => nil
197
+ config_param :refresh_credentials_interval, :time, :default => "5h"
197
198
  end
198
199
 
199
200
  config_section :buffer do
@@ -336,6 +337,22 @@ module Fluent::Plugin
336
337
  }
337
338
  end
338
339
  end
340
+ # If AWS credentials is set, consider to expire credentials information forcibly before expired.
341
+ @credential_mutex = Mutex.new
342
+ if @endpoint
343
+ @_aws_credentials = aws_credentials(@endpoint)
344
+
345
+ if @endpoint.refresh_credentials_interval
346
+ timer_execute(:out_opensearch_expire_credentials, @endpoint.refresh_credentials_interval) do
347
+ log.debug('Recreate the AWS credentials')
348
+
349
+ @credential_mutex.synchronize do
350
+ @_os = nil
351
+ @_aws_credentials = aws_credentials(@endpoint)
352
+ end
353
+ end
354
+ end
355
+ end
339
356
 
340
357
  @serializer_class = nil
341
358
  begin
@@ -607,7 +624,7 @@ module Fluent::Plugin
607
624
  :aws_sigv4,
608
625
  service: 'es',
609
626
  region: @endpoint.region,
610
- credentials: aws_credentials(@endpoint),
627
+ credentials: @_aws_credentials,
611
628
  )
612
629
 
613
630
  f.adapter @http_backend, @backend_options
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-opensearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Hatake
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-30 00:00:00.000000000 Z
11
+ date: 2022-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd