logstash-integration-aws 7.3.1-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 +4 -4
- data/CHANGELOG.md +6 -0
- data/VERSION +1 -1
- data/lib/logstash/inputs/s3.rb +2 -2
- data/lib/logstash/outputs/s3/uploader.rb +3 -3
- data/lib/logstash/outputs/s3/write_bucket_permission_validator.rb +4 -3
- data/lib/logstash/plugin_mixins/aws_config/v2.rb +1 -1
- data/lib/logstash-integration-aws_jars.rb +1 -1
- data/spec/inputs/s3_spec.rb +1 -1
- data/spec/outputs/s3/uploader_spec.rb +5 -9
- data/spec/outputs/s3/write_bucket_permission_validator_spec.rb +8 -5
- data/vendor/jar-dependencies/org/logstash/plugins/integration/aws/logstash-integration-aws/{7.3.1/logstash-integration-aws-7.3.1.jar → 7.3.3/logstash-integration-aws-7.3.3.jar} +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5de807b604a7c7b513a947ecfe3b1e2ff664a11e790d9d0c8fba44936dba93ca
|
|
4
|
+
data.tar.gz: 2de325079a6b11b8b0ffcc86109b9021949678219b317e2b62de341e54d8184e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 37e64051e6c1e813f9ca17f6f069a295edba6f1c9f8515d7c1efbf1196e3d5d2fa28055e1cd694d014951fd668e35c9c334caf4ebdf4bee3513c1caa265d47e3
|
|
7
|
+
data.tar.gz: '068c47c3e715e38cb694a5a862cce34754305679a8bdca7d2c51fb4023d31240c8bcded1cf3ea70eabb00b7c925db6d9bfeea1a27afd17a0e6ed35a3cddf3e98'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
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
|
+
|
|
4
|
+
## 7.3.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)
|
|
6
|
+
|
|
1
7
|
## 7.3.1
|
|
2
8
|
- Re-packaging the plugin [#63](https://github.com/logstash-plugins/logstash-integration-aws/pull/63)
|
|
3
9
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
7.3.
|
|
1
|
+
7.3.3
|
data/lib/logstash/inputs/s3.rb
CHANGED
|
@@ -117,7 +117,7 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
|
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
unless @backup_to_dir.nil?
|
|
120
|
-
Dir.mkdir(@backup_to_dir, 0700) unless File.
|
|
120
|
+
Dir.mkdir(@backup_to_dir, 0700) unless File.exist?(@backup_to_dir)
|
|
121
121
|
end
|
|
122
122
|
|
|
123
123
|
FileUtils.mkdir_p(@temporary_directory) unless Dir.exist?(@temporary_directory)
|
|
@@ -451,7 +451,7 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
|
|
|
451
451
|
|
|
452
452
|
# @return [Time]
|
|
453
453
|
def read
|
|
454
|
-
if ::File.
|
|
454
|
+
if ::File.exist?(@sincedb_path)
|
|
455
455
|
content = ::File.read(@sincedb_path).chomp.strip
|
|
456
456
|
# If the file was created but we didn't have the time to write to it
|
|
457
457
|
return content.empty? ? Time.new(0) : Time.parse(content)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
require "logstash/util"
|
|
3
|
-
require "aws-sdk-
|
|
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
|
-
|
|
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
|
-
|
|
43
|
-
|
|
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
|
-
|
|
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.
|
|
@@ -47,7 +47,7 @@ module LogStash::PluginMixins::AwsConfig::V2
|
|
|
47
47
|
if @use_aws_bundled_ca
|
|
48
48
|
aws_core_library = Gem.loaded_specs['aws-sdk-core']&.full_gem_path or fail("AWS Core library not available")
|
|
49
49
|
opts[:ssl_ca_bundle] = File.expand_path('ca-bundle.crt', aws_core_library).tap do |aws_core_ca_bundle|
|
|
50
|
-
fail("AWS Core CA bundle not found") unless File.
|
|
50
|
+
fail("AWS Core CA bundle not found") unless File.exist?(aws_core_ca_bundle)
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
data/spec/inputs/s3_spec.rb
CHANGED
|
@@ -43,26 +43,22 @@ describe LogStash::Outputs::S3::Uploader do
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
it "retries errors indefinitely" do
|
|
46
|
-
|
|
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(
|
|
52
|
-
expect(
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
Binary file
|
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.
|
|
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-
|
|
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.
|
|
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
|