lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-0.5.10 vs lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-0.5.11
- old
+ new
@@ -28,10 +28,11 @@
config_param :auto_create_bucket, :bool, :default => true
config_param :check_apikey_on_start, :bool, :default => true
config_param :proxy_uri, :string, :default => nil
config_param :reduced_redundancy, :bool, :default => false
config_param :format, :string, :default => 'out_file'
+ config_param :acl, :string, :default => :private
attr_reader :bucket
include Fluent::Mixin::ConfigPlaceholders
@@ -82,11 +83,11 @@
end
options[:region] = @s3_region if @s3_region
options[:s3_endpoint] = @s3_endpoint if @s3_endpoint
options[:proxy_uri] = @proxy_uri if @proxy_uri
options[:use_ssl] = @use_ssl
- options[:s3_server_side_encryption] = @use_server_side_encryption
+ options[:s3_server_side_encryption] = @use_server_side_encryption.to_sym if @use_server_side_encryption
@s3 = AWS::S3.new(options)
@bucket = @s3.buckets[@s3_bucket]
check_apikeys if @check_apikey_on_start
@@ -123,10 +124,11 @@
tmp = Tempfile.new("s3-")
begin
@compressor.compress(chunk, tmp)
@bucket.objects[s3path].write(Pathname.new(tmp.path), {:content_type => @compressor.content_type,
- :reduced_redundancy => @reduced_redundancy})
+ :reduced_redundancy => @reduced_redundancy,
+ :acl => @acl})
ensure
tmp.close(true) rescue nil
end
end