fluent-plugin-opensearch 1.1.2 → 1.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b8cc79e0b3618ac9af026312e4d73784ea6bc939e944f03bcae487a239a3106
4
- data.tar.gz: 67a5c76a80dc1f00bb13febd1feac5ab029393934d8f2e60b74f6af9c96e03d4
3
+ metadata.gz: 8b8b954980a5eb5fd96702cac11352951aea3f3ed18485e151b4642f415ab026
4
+ data.tar.gz: aeb250f72fa691f558471d88dfde6081c24115049ec995acbc7c58a2799cbecd
5
5
  SHA512:
6
- metadata.gz: 2dadfc649ab1f9836031963ee85cdfc739029f71f35bdbd44b55f61c35351ffe1f84b64f118d6adf16ae866ebb9bc479fdcce3d71d2d0f83baba2f4fba013e80
7
- data.tar.gz: e3a1a7df140ec59197d231b86a291dd1686d47ab2817da3983e3e9931b5e71e5994b138a6b2f10e1191a9f4deaba458c5cd221e541e66cbd534f533de85ec633
6
+ metadata.gz: 51a4428c631b285a8769e82cecc8d9c67e4f3f89cabb8b36520170a594e41ddda56729a6b9aaf6a43808063f6904624997a88fd522a7756dfc2cdea1e20a2b3f
7
+ data.tar.gz: e301856f437a3dce63d7cf3012156f5ae80234a3faa572b00c3aee2a505e50087e8dfc8f763db1f72733457225c290e102887efe46bb3ae21c0a3e849e326900
data/History.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### 1.1.3
6
+ - Revert the behavior of passing duration second (#108)
7
+
5
8
  ### 1.1.2
6
9
  - Check OS cluster for data streams and templates for index template creation (#106)
7
10
  - out\_opensearch\_data\_stream: Don't connect to opensearch on dry-run (#105)
@@ -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.1.2'
6
+ s.version = '1.1.3'
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}
@@ -83,7 +83,6 @@ module Fluent::Plugin
83
83
  attr_reader :template_names
84
84
  attr_reader :ssl_version_options
85
85
  attr_reader :compressable_connection
86
- attr_reader :duration_seconds
87
86
 
88
87
  helpers :event_emitter, :compat_parameters, :record_accessor, :timer
89
88
 
@@ -95,7 +94,6 @@ module Fluent::Plugin
95
94
  DEFAULT_RELOAD_AFTER = -1
96
95
  DEFAULT_TARGET_BULK_BYTES = -1
97
96
  DEFAULT_POLICY_ID = "logstash-policy"
98
- DEFAULT_DURATION = "5h"
99
97
 
100
98
  config_param :host, :string, :default => 'localhost'
101
99
  config_param :port, :integer, :default => 9200
@@ -197,7 +195,7 @@ module Fluent::Plugin
197
195
  config_param :assume_role_session_name, :string, :default => "fluentd"
198
196
  config_param :assume_role_web_identity_token_file, :string, :default => nil
199
197
  config_param :sts_credentials_region, :string, :default => nil
200
- config_param :refresh_credentials_interval, :time, :default => DEFAULT_DURATION
198
+ config_param :refresh_credentials_interval, :time, :default => "5h"
201
199
  config_param :aws_service_name, :enum, list: [:es, :aoss], :default => :es
202
200
  end
203
201
 
@@ -213,8 +211,6 @@ module Fluent::Plugin
213
211
 
214
212
  def initialize
215
213
  super
216
-
217
- @duration_seconds = Fluent::Config.time_value(DEFAULT_DURATION)
218
214
  end
219
215
 
220
216
  ######################################################################################################
@@ -242,15 +238,13 @@ module Fluent::Plugin
242
238
  credentials = Aws::AssumeRoleCredentials.new({
243
239
  role_arn: conf[:assume_role_arn],
244
240
  role_session_name: conf[:assume_role_session_name],
245
- region: sts_creds_region(conf),
246
- duration_seconds: @duration_seconds
241
+ region: sts_creds_region(conf)
247
242
  }).credentials
248
243
  else
249
244
  credentials = Aws::AssumeRoleWebIdentityCredentials.new({
250
245
  role_arn: conf[:assume_role_arn],
251
246
  web_identity_token_file: conf[:assume_role_web_identity_token_file],
252
- region: sts_creds_region(conf),
253
- duration_seconds: @duration_seconds
247
+ region: sts_creds_region(conf)
254
248
  }).credentials
255
249
  end
256
250
  end
@@ -351,18 +345,7 @@ module Fluent::Plugin
351
345
  @_aws_credentials = aws_credentials(@endpoint)
352
346
 
353
347
  if @endpoint.refresh_credentials_interval
354
- @duration_seconds = Fluent::Config.time_value(@endpoint.refresh_credentials_interval)
355
- # 60 * 60 * 12 = 12 hours
356
- if @duration_seconds > 43200
357
- raise Fluent::ConfigError, "Maximum duration is 12 hours."
358
- end
359
-
360
- # 60 * 15 = 15 minutes
361
- if @duration_seconds < 900
362
- raise Fluent::ConfigError, "Minimum duration is 15 minutes."
363
- end
364
-
365
- timer_execute(:out_opensearch_expire_credentials, @duration_seconds) do
348
+ timer_execute(:out_opensearch_expire_credentials, @endpoint.refresh_credentials_interval) do
366
349
  log.debug('Recreate the AWS credentials')
367
350
 
368
351
  @credential_mutex.synchronize do
@@ -300,7 +300,6 @@ class OpenSearchOutputTest < Test::Unit::TestCase
300
300
  'region' => "local",
301
301
  'access_key_id' => 'YOUR_AWESOME_KEY',
302
302
  'secret_access_key' => 'YOUR_AWESOME_SECRET',
303
- 'refresh_credentials_interval' => '10h'
304
303
  }, []),
305
304
  Fluent::Config::Element.new('buffer', 'tag', {}, [])
306
305
 
@@ -317,8 +316,6 @@ class OpenSearchOutputTest < Test::Unit::TestCase
317
316
  assert_nil instance.endpoint.assume_role_web_identity_token_file
318
317
  assert_nil instance.endpoint.sts_credentials_region
319
318
  assert_equal :es, instance.endpoint.aws_service_name
320
- assert_equal 36000, instance.endpoint.refresh_credentials_interval
321
- assert_equal 36000, instance.duration_seconds
322
319
  end
323
320
 
324
321
  data("OpenSearch Service" => [:es, 'es'],
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.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Hatake
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-28 00:00:00.000000000 Z
11
+ date: 2023-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd