From dec3fedc3ce3d7f935da49de9b82bebdb89ba579 Mon Sep 17 00:00:00 2001 From: Philippe Weber Date: Thu, 26 May 2016 11:27:31 +0200 Subject: [PATCH 1/2] remove deprecated config endpoint_region --- CHANGELOG.md | 25 ++++++++++++++++++------- lib/logstash/outputs/s3.rb | 18 ++---------------- logstash-output-s3.gemspec | 2 +- spec/integration/s3_spec.rb | 1 + spec/outputs/s3_spec.rb | 12 +----------- 5 files changed, 23 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dec9835..6964b424 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,25 +1,36 @@ +## 4.0.0 + - breaking,config: Remove deprecated config `endpoint_region`. Please use `region` instead. + ## 3.0.1 - - Republish all the gems under jruby. + - Republish all the gems under jruby. + ## 3.0.0 - - Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141 -# 2.0.7 - - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash -# 2.0.6 - - New dependency requirements for logstash-core for the 5.0 release + - Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141 + +## 2.0.7 + - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash + +## 2.0.6 + - New dependency requirements for logstash-core for the 5.0 release + ## 2.0.5 - Support signature_version option for v4 S3 keys + ## 2.0.4 - Remove the `Time.now` stub in the spec, it was conflicting with other test when running inside the default plugins test #63 - Make the spec run faster by adjusting the values of time rotation test. + ## 2.0.3 - Update deps for logstash 2.0 + ## 2.0.2 - Fixes an issue when tags were defined #39 + ## 2.0.0 - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully, instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895 - Dependency on logstash-core update to 2.0 -# 1.0.1 +## 1.0.1 - Fix a synchronization issue when doing file rotation and checking the size of the current file - Fix an issue with synchronization when shutting down the plugin and closing the current temp file diff --git a/lib/logstash/outputs/s3.rb b/lib/logstash/outputs/s3.rb index a8adc262..21eaeafe 100644 --- a/lib/logstash/outputs/s3.rb +++ b/lib/logstash/outputs/s3.rb @@ -62,7 +62,7 @@ # s3{ # access_key_id => "crazy_key" (required) # secret_access_key => "monkey_access_key" (required) -# endpoint_region => "eu-west-1" (required) - Deprecated +# region => "eu-west-1" (optional, default = "us-east-1") # bucket => "boss_please_open_your_bucket" (required) # size_file => 2048 (optional) - Bytes # time_file => 5 (optional) - Minutes @@ -82,11 +82,6 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base # S3 bucket config :bucket, :validate => :string - # AWS endpoint_region - config :endpoint_region, :validate => ["us-east-1", "us-west-1", "us-west-2", - "eu-west-1", "ap-southeast-1", "ap-southeast-2", - "ap-northeast-1", "sa-east-1", "us-gov-west-1"], :deprecated => 'Deprecated, use region instead.' - # Set the size of file in bytes, this means that files on bucket when have dimension > file_size, they are stored in two or more file. # If you have tags then it will generate a specific size file for every tags ##NOTE: define size of file is the better thing, because generate a local temporary file on disk and then put it in bucket. @@ -161,17 +156,8 @@ def signature_options end def aws_service_endpoint(region) - # Make the deprecated endpoint_region work - # TODO: (ph) Remove this after deprecation. - - if @endpoint_region - region_to_use = @endpoint_region - else - region_to_use = @region - end - return { - :s3_endpoint => region_to_use == 'us-east-1' ? 's3.amazonaws.com' : "s3-#{region_to_use}.amazonaws.com" + :s3_endpoint => region == 'us-east-1' ? 's3.amazonaws.com' : "s3-#{region}.amazonaws.com" } end diff --git a/logstash-output-s3.gemspec b/logstash-output-s3.gemspec index effc0fcb..7ef4ed43 100644 --- a/logstash-output-s3.gemspec +++ b/logstash-output-s3.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'logstash-output-s3' - s.version = '3.0.1' + s.version = '4.0.0' s.licenses = ['Apache License (2.0)'] s.summary = "This plugin was created for store the logstash's events into Amazon Simple Storage Service (Amazon S3)" s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" diff --git a/spec/integration/s3_spec.rb b/spec/integration/s3_spec.rb index cb2f574e..1fe208ba 100644 --- a/spec/integration/s3_spec.rb +++ b/spec/integration/s3_spec.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 require "logstash/devutils/rspec/spec_helper" require "logstash/outputs/s3" require 'socket' diff --git a/spec/outputs/s3_spec.rb b/spec/outputs/s3_spec.rb index a34ae821..0b5d0e74 100644 --- a/spec/outputs/s3_spec.rb +++ b/spec/outputs/s3_spec.rb @@ -20,17 +20,7 @@ "bucket" => "my-bucket" } } describe "configuration" do - let!(:config) { { "endpoint_region" => "sa-east-1" } } - - it "should support the deprecated endpoint_region as a configuration option" do - s3 = LogStash::Outputs::S3.new(config) - expect(s3.aws_options_hash[:s3_endpoint]).to eq("s3-sa-east-1.amazonaws.com") - end - - it "should fallback to region if endpoint_region isnt defined" do - s3 = LogStash::Outputs::S3.new(config.merge({ "region" => 'sa-east-1' })) - expect(s3.aws_options_hash).to include(:s3_endpoint => "s3-sa-east-1.amazonaws.com") - end + let!(:config) { { "region" => "sa-east-1" } } describe "signature version" do it "should set the signature version if specified" do From bc5f80ca01f5233285065118c038d4acd78d0a55 Mon Sep 17 00:00:00 2001 From: Philippe Weber Date: Fri, 27 May 2016 06:27:01 +0200 Subject: [PATCH 2/2] raise only minor version --- CHANGELOG.md | 2 +- logstash-output-s3.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6964b424..de00bbd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 4.0.0 +## 3.1.0 - breaking,config: Remove deprecated config `endpoint_region`. Please use `region` instead. ## 3.0.1 diff --git a/logstash-output-s3.gemspec b/logstash-output-s3.gemspec index 7ef4ed43..848aac36 100644 --- a/logstash-output-s3.gemspec +++ b/logstash-output-s3.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'logstash-output-s3' - s.version = '4.0.0' + s.version = '3.1.0' s.licenses = ['Apache License (2.0)'] s.summary = "This plugin was created for store the logstash's events into Amazon Simple Storage Service (Amazon S3)" s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"