lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-1.6.0 vs lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-1.6.1

- old
+ new

@@ -171,17 +171,22 @@ attr_reader :bucket MAX_HEX_RANDOM_LENGTH = 16 + def reject_s3_endpoint? + @s3_endpoint && !@s3_endpoint.end_with?('vpce.amazonaws.com') && + @s3_endpoint.end_with?('amazonaws.com') && !['fips', 'gov'].any? { |e| @s3_endpoint.include?(e) } + end + def configure(conf) compat_parameters_convert(conf, :buffer, :formatter, :inject) super Aws.use_bundled_cert! if @use_bundled_cert - if @s3_endpoint && (@s3_endpoint.end_with?('amazonaws.com') && !['fips', 'gov'].any? { |e| @s3_endpoint.include?(e) }) + if reject_s3_endpoint? raise Fluent::ConfigError, "s3_endpoint parameter is not supported for S3, use s3_region instead. This parameter is for S3 compatible services" end begin buffer_type = @buffer_config[:@type]