logstash-integration-aws 7.3.2-java → 7.3.3-java

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: e1b8a5b5a5fc9020b5c91a867bf8608cc465ca404bcab2e8fbde85e36768aa63
4
- data.tar.gz: 0a5a55593fab48534744b17df0c6ba14b2b63b5d63ea2437a85b40d7421bf9d8
3
+ metadata.gz: 5de807b604a7c7b513a947ecfe3b1e2ff664a11e790d9d0c8fba44936dba93ca
4
+ data.tar.gz: 2de325079a6b11b8b0ffcc86109b9021949678219b317e2b62de341e54d8184e
5
5
  SHA512:
6
- metadata.gz: 43bfee142660e88a973349580daae1d933ff17721225e2fe6fd3592ec02306498f359d4497d34f677c17be903c4e521bdd2095ed0ab36da9c7ff5ebce74bba4f
7
- data.tar.gz: d692f03255dd68b9e0d0b6f6d42ef7db17d11e49d116d00ebc761702ad5f36a65e6e1648f8f25c27f58b82576bc57af9b54f2aa8ff7ef9b5359028d260cf8dd2
6
+ metadata.gz: 37e64051e6c1e813f9ca17f6f069a295edba6f1c9f8515d7c1efbf1196e3d5d2fa28055e1cd694d014951fd668e35c9c334caf4ebdf4bee3513c1caa265d47e3
7
+ data.tar.gz: '068c47c3e715e38cb694a5a862cce34754305679a8bdca7d2c51fb4023d31240c8bcded1cf3ea70eabb00b7c925db6d9bfeea1a27afd17a0e6ed35a3cddf3e98'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 7.3.3
2
+ - Replace deprecated `Aws::S3::Object#upload_file` in favor of `Aws::S3::TransferManager#upload_file` [#67](https://github.com/logstash-plugins/logstash-integration-aws/pull/67)
3
+
1
4
  ## 7.3.2
2
5
  - Fix: replace deprecated `File.exists?` with `File.exist?` for Ruby 3.4 (JRuby 10) compatibility [#65](https://github.com/logstash-plugins/logstash-integration-aws/pull/65)
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.3.2
1
+ 7.3.3
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require "logstash/util"
3
- require "aws-sdk-core"
3
+ require "aws-sdk-s3"
4
4
 
5
5
  module LogStash
6
6
  module Outputs
@@ -18,6 +18,7 @@ module LogStash
18
18
 
19
19
  def initialize(bucket, logger, threadpool = DEFAULT_THREADPOOL, retry_count: Float::INFINITY, retry_delay: 1)
20
20
  @bucket = bucket
21
+ @transfer_manager = Aws::S3::TransferManager.new(client: bucket.client)
21
22
  @workers_pool = threadpool
22
23
  @logger = logger
23
24
  @retry_count = retry_count
@@ -37,8 +38,7 @@ module LogStash
37
38
 
38
39
  tries = 0
39
40
  begin
40
- obj = bucket.object(file.key)
41
- obj.upload_file(file.path, upload_options)
41
+ @transfer_manager.upload_file(file.path, bucket: bucket.name, key: file.key, **upload_options)
42
42
  rescue Errno::ENOENT => e
43
43
  logger.error("File doesn't exist! Unrecoverable error.", :exception => e.class, :message => e.message, :path => file.path, :backtrace => e.backtrace)
44
44
  rescue => e
@@ -2,6 +2,7 @@
2
2
  require "stud/temporary"
3
3
  require "socket"
4
4
  require "fileutils"
5
+ require "aws-sdk-s3"
5
6
 
6
7
  module LogStash
7
8
  module Outputs
@@ -39,11 +40,11 @@ module LogStash
39
40
  f.write(content)
40
41
  f.fsync
41
42
 
42
- obj = bucket_resource.object(key)
43
- obj.upload_file(f, upload_options)
43
+ transfer_manager = Aws::S3::TransferManager.new(client: bucket_resource.client)
44
+ transfer_manager.upload_file(f.path, bucket: bucket_resource.name, key: key, **upload_options)
44
45
 
45
46
  begin
46
- obj.delete
47
+ bucket_resource.object(key).delete
47
48
  rescue
48
49
  # Try to remove the files on the remote bucket,
49
50
  # but don't raise any errors if that doesn't work.
@@ -1,4 +1,4 @@
1
1
  # AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.
2
2
 
3
3
  require 'jar_dependencies'
4
- require_jar('org.logstash.plugins.integration.aws', 'logstash-integration-aws', '7.3.2')
4
+ require_jar('org.logstash.plugins.integration.aws', 'logstash-integration-aws', '7.3.3')
@@ -43,26 +43,22 @@ describe LogStash::Outputs::S3::Uploader do
43
43
  end
44
44
 
45
45
  it "retries errors indefinitely" do
46
- s3 = double("s3").as_null_object
47
-
48
- allow(bucket).to receive(:object).with(file.key).and_return(s3)
46
+ tm = subject.instance_variable_get(:@transfer_manager)
49
47
 
50
48
  expect(logger).to receive(:warn).with(any_args)
51
- expect(s3).to receive(:upload_file).with(any_args).and_raise(RuntimeError.new('UPLOAD FAILED')).exactly(5).times
52
- expect(s3).to receive(:upload_file).with(any_args).and_return(true)
49
+ expect(tm).to receive(:upload_file).with(file.path, hash_including(bucket: bucket_name, key: file.key)).and_raise(RuntimeError.new('UPLOAD FAILED')).exactly(5).times
50
+ expect(tm).to receive(:upload_file).with(file.path, hash_including(bucket: bucket_name, key: file.key)).and_return(true)
53
51
 
54
52
  subject.upload(file)
55
53
  end
56
54
 
57
55
  it "retries errors specified times" do
58
56
  subject = described_class.new(bucket, logger, threadpool, retry_count: 3, retry_delay: 0.01)
59
- s3 = double("s3").as_null_object
60
-
61
- allow(bucket).to receive(:object).with(file.key).and_return(s3)
57
+ tm = subject.instance_variable_get(:@transfer_manager)
62
58
 
63
59
  expect(logger).to receive(:warn).with(any_args).exactly(3).times
64
60
  expect(logger).to receive(:error).with(any_args).once
65
- expect(s3).to receive(:upload_file).with(file.path, {}).and_raise(RuntimeError).at_least(1).times
61
+ expect(tm).to receive(:upload_file).with(file.path, hash_including(bucket: bucket_name, key: file.key)).and_raise(RuntimeError).at_least(1).times
66
62
 
67
63
  subject.upload(file)
68
64
  end
@@ -1,11 +1,13 @@
1
1
  # encoding: utf-8
2
2
  require "logstash/devutils/rspec/spec_helper"
3
+ require "aws-sdk-s3"
3
4
  require "logstash/outputs/s3/write_bucket_permission_validator"
4
5
 
5
6
  describe LogStash::Outputs::S3::WriteBucketPermissionValidator do
6
7
  let(:logger) { spy(:logger ) }
7
8
  let(:bucket_name) { "foobar" }
8
9
  let(:obj) { double("s3_object") }
10
+ let(:tm) { double("transfer_manager") }
9
11
  let(:client) { Aws::S3::Client.new(stub_responses: true) }
10
12
  let(:bucket) { Aws::S3::Bucket.new(bucket_name, :client => client) }
11
13
  let(:upload_options) { {} }
@@ -13,13 +15,14 @@ describe LogStash::Outputs::S3::WriteBucketPermissionValidator do
13
15
  subject { described_class.new(logger) }
14
16
 
15
17
  before do
16
- expect(bucket).to receive(:object).with(any_args).and_return(obj)
18
+ allow(Aws::S3::TransferManager).to receive(:new).with(client: client).and_return(tm)
19
+ allow(bucket).to receive(:object).with(any_args).and_return(obj)
17
20
  end
18
21
 
19
22
  context 'when using upload_options' do
20
23
  let(:upload_options) {{ :server_side_encryption => true }}
21
24
  it 'they are passed through to upload_file' do
22
- expect(obj).to receive(:upload_file).with(anything, upload_options)
25
+ expect(tm).to receive(:upload_file).with(anything, hash_including(upload_options))
23
26
  expect(obj).to receive(:delete).and_return(true)
24
27
  expect(subject.valid?(bucket, upload_options)).to be_truthy
25
28
  end
@@ -28,13 +31,13 @@ describe LogStash::Outputs::S3::WriteBucketPermissionValidator do
28
31
 
29
32
  context "when permissions are sufficient" do
30
33
  it "returns true" do
31
- expect(obj).to receive(:upload_file).with(any_args).and_return(true)
34
+ expect(tm).to receive(:upload_file).with(any_args).and_return(true)
32
35
  expect(obj).to receive(:delete).and_return(true)
33
36
  expect(subject.valid?(bucket, upload_options)).to be_truthy
34
37
  end
35
38
 
36
39
  it "hides delete errors" do
37
- expect(obj).to receive(:upload_file).with(any_args).and_return(true)
40
+ expect(tm).to receive(:upload_file).with(any_args).and_return(true)
38
41
  expect(obj).to receive(:delete).and_raise(StandardError)
39
42
  expect(subject.valid?(bucket, upload_options)).to be_truthy
40
43
  end
@@ -42,7 +45,7 @@ describe LogStash::Outputs::S3::WriteBucketPermissionValidator do
42
45
 
43
46
  context "when permission aren't sufficient" do
44
47
  it "returns false" do
45
- expect(obj).to receive(:upload_file).with(any_args).and_raise(StandardError)
48
+ expect(tm).to receive(:upload_file).with(any_args).and_raise(StandardError)
46
49
  expect(subject.valid?(bucket, upload_options)).to be_falsey
47
50
  end
48
51
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-integration-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.2
4
+ version: 7.3.3
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-02-11 00:00:00.000000000 Z
10
+ date: 2026-03-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: logstash-core-plugin-api
@@ -407,7 +407,7 @@ files:
407
407
  - spec/spec_helper.rb
408
408
  - spec/support/helpers.rb
409
409
  - spec/unit/outputs/sqs_spec.rb
410
- - vendor/jar-dependencies/org/logstash/plugins/integration/aws/logstash-integration-aws/7.3.2/logstash-integration-aws-7.3.2.jar
410
+ - vendor/jar-dependencies/org/logstash/plugins/integration/aws/logstash-integration-aws/7.3.3/logstash-integration-aws-7.3.3.jar
411
411
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
412
412
  licenses:
413
413
  - Apache-2.0