lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-0.2.5 vs lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-0.2.6
- old
+ new
@@ -8,10 +8,12 @@
super
require 'aws-sdk'
require 'zlib'
require 'time'
require 'tempfile'
+
+ @use_ssl = true
end
config_param :path, :string, :default => ""
config_param :time_format, :string, :default => nil
@@ -33,10 +35,21 @@
@format_json = true
else
@format_json = false
end
+ if use_ssl = conf['use_ssl']
+ if use_ssl.empty?
+ @use_ssl = true
+ else
+ @use_ssl = Config.bool_value(use_ssl)
+ if @use_ssl.nil?
+ raise ConfigError, "'true' or 'false' is required for use_ssl option on s3 output"
+ end
+ end
+ end
+
@timef = TimeFormatter.new(@time_format, @localtime)
end
def start
super
@@ -44,9 +57,11 @@
if @aws_key_id && @aws_sec_key
options[:access_key_id] = @aws_key_id
options[:secret_access_key] = @aws_sec_key
end
options[:s3_endpoint] = @s3_endpoint if @s3_endpoint
+ options[:use_ssl] = @use_ssl
+
@s3 = AWS::S3.new(options)
@bucket = @s3.buckets[@s3_bucket]
end
def format(tag, time, record)