lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-0.5.4 vs lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-0.5.5
- old
+ new
@@ -19,10 +19,11 @@
config_param :use_server_side_encryption, :string, :default => nil
config_param :aws_key_id, :string, :default => nil
config_param :aws_sec_key, :string, :default => nil
config_param :s3_bucket, :string
config_param :s3_region, :string, :default => nil
+ config_param :s3_endpoint, :string, :default => nil
config_param :s3_object_key_format, :string, :default => "%{path}%{time_slice}_%{index}.%{file_extension}"
config_param :store_as, :string, :default => "gzip"
config_param :auto_create_bucket, :bool, :default => true
config_param :check_apikey_on_start, :bool, :default => true
config_param :proxy_uri, :string, :default => nil
@@ -38,12 +39,12 @@
end
def configure(conf)
super
- if conf.has_key?('s3_endpoint')
- raise ConfigError, "s3_endpoint parameter is removed. Use s3_region instead"
+ if @s3_endpoint && @s3_endpoint.end_with?('amazonaws.com')
+ raise ConfigError, "s3_endpoint parameter is not supported for S3, use s3_region instead. This parameter is for S3 compatible services"
end
begin
@compressor = COMPRESSOR_REGISTRY.lookup(@store_as).new(:buffer_type => @buffer_type, :log => log)
rescue => e
@@ -73,9 +74,10 @@
if @aws_key_id && @aws_sec_key
options[:access_key_id] = @aws_key_id
options[:secret_access_key] = @aws_sec_key
end
options[:region] = @s3_region if @s3_region
+ options[: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
@s3 = AWS::S3.new(options)