fluent-plugin-opensearch 1.0.8 → 1.0.10

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: ba58a770b6f7d4aa621091bee5315988649ef54d2bb4b4c23e980d9ee8598008
4
- data.tar.gz: 5f6023c9456af019bf82141180a76b01bc322418456c191ceae72c7f794fe44f
3
+ metadata.gz: c8fec7ab831f92c422c3982f9e3986e7737138ac8c2d03c27e91248c222388e2
4
+ data.tar.gz: 7a285e493ce2248453902cab4f4b2838d5cea49362bf93f03f314dc2fdc3a373
5
5
  SHA512:
6
- metadata.gz: 98474ac3e7329082aace9f0d671c0ecf60844fa0bab91c431be8c0dc8ddd0bcfeca60ef0612d8c7e79459a4da528f266ecce0a42eea5029d28fce7483d6e87ec
7
- data.tar.gz: 5879925be1f7b7079eb7f7c44d50145aab2f1b76afb6f99d3345252d25f96ce7b8fcf3bd1a215252d6e7a1ab76cc727a02bc6b2aaa854e9f98e969c485e7df61
6
+ metadata.gz: 1c43d875fb76266ccdf2901ae25ecba1e9298263d03b0f11560936e1097a8edb306dbb70d564107ce3508f462f07ff3be0d6795e3ddfc951d3c8e764d217487c
7
+ data.tar.gz: a8733006a11d8548dd41eab5dd8a626122d9c7044f73cc3ec18b2e18d916e47a898f8780556299e07c5d541aa24aba877f4733402051610a9a77c54bf8899136
@@ -8,9 +8,9 @@ jobs:
8
8
  steps:
9
9
  - uses: actions/checkout@v2
10
10
  - name: Set up Ruby 3.0
11
- uses: actions/setup-ruby@v1
11
+ uses: ruby/setup-ruby@v1
12
12
  with:
13
- ruby-version: '3.0'
13
+ ruby-version: '3.1'
14
14
  - name: Build and test with Rake
15
15
  run: |
16
16
  gem install bundler
@@ -8,7 +8,7 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [ '2.6', '2.7', '3.0' ]
11
+ ruby: [ '2.7', '3.0', '3.1', '3.2' ]
12
12
  os:
13
13
  - ubuntu-latest
14
14
  name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
@@ -8,7 +8,7 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [ '2.6', '2.7', '3.0' ]
11
+ ruby: [ '2.7', '3.0', '3.1', '3.2' ]
12
12
  os:
13
13
  - macOS-latest
14
14
  name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
@@ -8,7 +8,7 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [ '2.6', '2.7', '3.0' ]
11
+ ruby: [ '2.7', '3.0', '3.1', '3.2' ]
12
12
  os:
13
13
  - windows-latest
14
14
  name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
data/History.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### 1.0.10
6
+ - Replace File.exists? with File.exist? to work with Ruby 3.2 (#93)
7
+ - Add a constraint for dependent gem to stay on Faraday v1 (#90)
8
+ - README.md: Fix a link to opensearch-ruby (#85)
9
+
10
+ ### 1.0.9
11
+ - Adjust GitHub workflows (#89)
12
+ - out\_opensearch: Provide service_name choices for handling serverless (#88)
13
+
5
14
  ### 1.0.8
6
15
  - Use faraday 1.x explicitly (#71)
7
16
 
@@ -68,7 +68,7 @@ hosts host1:port1,host2:port2,host3:port3
68
68
 
69
69
  You can specify multiple OpenSearch hosts with separator ",".
70
70
 
71
- If you specify multiple hosts, this plugin will load balance updates to OpenSearch. This is an [opensearch-ruby](https://github.com/opensearch/opensearch-ruby) feature, the default strategy is round-robin.
71
+ If you specify multiple hosts, this plugin will load balance updates to OpenSearch. This is an [opensearch-ruby](https://github.com/opensearch-project/opensearch-ruby) feature, the default strategy is round-robin.
72
72
 
73
73
  If you specify `hosts` option, `host` and `port` options are ignored.
74
74
 
data/README.md CHANGED
@@ -1577,6 +1577,19 @@ If you want to expire AWS credentials in certain interval, you should specify `r
1577
1577
  </endpoint>
1578
1578
  ```
1579
1579
 
1580
+ ### Use OpenSearch Serverless
1581
+
1582
+ If you want to use Serverless version of OpenSearch service, you have to specify `aoss` in `aws_service_name` under `endpoint` section:
1583
+
1584
+ ```aconf
1585
+ <endpoint>
1586
+ url https://CLUSTER_ENDPOINT_URL
1587
+ region us-east-2
1588
+ # ...
1589
+ aws_service_name aoss # default is es that is for AWS OpenSearch Service not Serverless.
1590
+ </endpoint>
1591
+ ```
1592
+
1580
1593
  ## Troubleshooting
1581
1594
 
1582
1595
  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.8'
6
+ s.version = '1.0.10'
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}
@@ -27,8 +27,7 @@ Gem::Specification.new do |s|
27
27
  s.add_runtime_dependency 'opensearch-ruby'
28
28
  s.add_runtime_dependency "aws-sdk-core", "~> 3"
29
29
  s.add_runtime_dependency "faraday", "~> 1.10"
30
- s.add_runtime_dependency "faraday_middleware-aws-sigv4"
31
-
30
+ s.add_runtime_dependency "faraday_middleware-aws-sigv4", "~> 0.6.1"
32
31
 
33
32
  s.add_development_dependency 'rake', '>= 0'
34
33
  s.add_development_dependency 'webrick', '~> 1.7.0'
@@ -29,7 +29,7 @@ require_relative './opensearch_error'
29
29
 
30
30
  module Fluent::OpenSearchIndexTemplate
31
31
  def get_template(template_file)
32
- if !File.exists?(template_file)
32
+ if !File.exist?(template_file)
33
33
  raise "If you specify a template_name you must specify a valid template file (checked '#{template_file}')!"
34
34
  end
35
35
  file_contents = IO.read(template_file).gsub(/\n/,'')
@@ -37,7 +37,7 @@ module Fluent::OpenSearchIndexTemplate
37
37
  end
38
38
 
39
39
  def get_custom_template(template_file, customize_template)
40
- if !File.exists?(template_file)
40
+ if !File.exist?(template_file)
41
41
  raise "If you specify a template_name you must specify a valid template file (checked '#{template_file}')!"
42
42
  end
43
43
  file_contents = IO.read(template_file).gsub(/\n/,'')
@@ -195,6 +195,7 @@ module Fluent::Plugin
195
195
  config_param :assume_role_web_identity_token_file, :string, :default => nil
196
196
  config_param :sts_credentials_region, :string, :default => nil
197
197
  config_param :refresh_credentials_interval, :time, :default => "5h"
198
+ config_param :aws_service_name, :enum, list: [:es, :aoss], :default => :es
198
199
  end
199
200
 
200
201
  config_section :buffer do
@@ -622,7 +623,7 @@ module Fluent::Plugin
622
623
  lambda do |f|
623
624
  f.request(
624
625
  :aws_sigv4,
625
- service: 'es',
626
+ service: @endpoint.aws_service_name.to_s,
626
627
  region: @endpoint.region,
627
628
  credentials: @_aws_credentials,
628
629
  )
@@ -315,6 +315,39 @@ class OpenSearchOutputTest < Test::Unit::TestCase
315
315
  assert_equal "fluentd", instance.endpoint.assume_role_session_name
316
316
  assert_nil instance.endpoint.assume_role_web_identity_token_file
317
317
  assert_nil instance.endpoint.sts_credentials_region
318
+ assert_equal :es, instance.endpoint.aws_service_name
319
+ end
320
+
321
+ data("OpenSearch Service" => [:es, 'es'],
322
+ "OpenSearch Serverless" => [:aoss, 'aoss'])
323
+ test 'configure endpoint section w/ aws_service_name' do |data|
324
+ expected, conf = data
325
+ config = Fluent::Config::Element.new(
326
+ 'ROOT', '', {
327
+ '@type' => 'opensearch',
328
+ }, [
329
+ Fluent::Config::Element.new('endpoint', '', {
330
+ 'url' => "https://search-opensearch.aws.example.com/",
331
+ 'region' => "local",
332
+ 'access_key_id' => 'YOUR_AWESOME_KEY',
333
+ 'secret_access_key' => 'YOUR_AWESOME_SECRET',
334
+ 'aws_service_name' => conf,
335
+ }, []),
336
+ Fluent::Config::Element.new('buffer', 'tag', {}, [])
337
+
338
+ ])
339
+ instance = driver(config).instance
340
+
341
+ assert_equal "https://search-opensearch.aws.example.com", instance.endpoint.url
342
+ assert_equal "local", instance.endpoint.region
343
+ assert_equal "YOUR_AWESOME_KEY", instance.endpoint.access_key_id
344
+ assert_equal "YOUR_AWESOME_SECRET", instance.endpoint.secret_access_key
345
+ assert_nil instance.endpoint.assume_role_arn
346
+ assert_nil instance.endpoint.ecs_container_credentials_relative_uri
347
+ assert_equal "fluentd", instance.endpoint.assume_role_session_name
348
+ assert_nil instance.endpoint.assume_role_web_identity_token_file
349
+ assert_nil instance.endpoint.sts_credentials_region
350
+ assert_equal expected, instance.endpoint.aws_service_name
318
351
  end
319
352
 
320
353
  test 'configure compression' do
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.8
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Hatake
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-09 00:00:00.000000000 Z
11
+ date: 2023-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: faraday_middleware-aws-sigv4
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 0.6.1
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 0.6.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -241,7 +241,7 @@ licenses:
241
241
  - Apache-2.0
242
242
  metadata:
243
243
  changelog_uri: https://github.com/fluent/fluent-plugin-opensearch/blob/master/History.md
244
- post_install_message:
244
+ post_install_message:
245
245
  rdoc_options: []
246
246
  require_paths:
247
247
  - lib
@@ -256,8 +256,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.2.32
260
- signing_key:
259
+ rubygems_version: 3.3.5
260
+ signing_key:
261
261
  specification_version: 4
262
262
  summary: Opensearch output plugin for Fluent event collector
263
263
  test_files: