lib/logstash/outputs/s3.rb in logstash-output-s3-2.0.4 vs lib/logstash/outputs/s3.rb in logstash-output-s3-2.0.7

- old
+ new

@@ -107,10 +107,14 @@ config :prefix, :validate => :string, :default => '' # Specify how many workers to use to upload the files to S3 config :upload_workers_count, :validate => :number, :default => 1 + # The version of the S3 signature hash to use. Normally uses the internal client default, can be explicitly + # specified here + config :signature_version, :validate => ['v2', 'v4'] + # Define tags to be appended to the file on the S3 bucket. # # Example: # tags => ["elasticsearch", "logstash", "kibana"] # @@ -124,10 +128,22 @@ attr_reader :page_counter attr_reader :s3 def aws_s3_config @logger.info("Registering s3 output", :bucket => @bucket, :endpoint_region => @region) - @s3 = AWS::S3.new(aws_options_hash) + @s3 = AWS::S3.new(full_options) + end + + def full_options + aws_options_hash.merge(signature_options) + end + + def signature_options + if @signature_version + {:s3_signature_version => @signature_version} + else + {} + end end def aws_service_endpoint(region) # Make the deprecated endpoint_region work # TODO: (ph) Remove this after deprecation.