Skip to content

Commit ec76f76

Browse files
mattlesko-workMatthew Lesko
authored andcommitted
fips s3_endpoint override is valid
Covers #331 - if we have an endpoint with `fips`, this is acceptable, but otherwise we should not use `s3_endpoint` or `sqs_endpoint` with the `amazonaws.com` domain Signed-off-by: Matthew Lesko <[email protected]>
1 parent bd225ea commit ec76f76

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/fluent/plugin/in_s3.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ def initialize
118118
def configure(conf)
119119
super
120120

121-
if @s3_endpoint && @s3_endpoint.end_with?('amazonaws.com')
121+
if @s3_endpoint && (@s3_endpoint.end_with?('amazonaws.com') && !['fips', 'gov'].any? { |e| @s3_endpoint.include?(e) })
122122
raise Fluent::ConfigError, "s3_endpoint parameter is not supported for S3, use s3_region instead. This parameter is for S3 compatible services"
123123
end
124124

125-
if @sqs.endpoint && @sqs.endpoint.end_with?('amazonaws.com')
125+
if @sqs_endpoint && (@sqs_endpoint.end_with?('amazonaws.com') && !['fips', 'gov'].any? { |e| @sqs_endpoint.include?(e) })
126126
raise Fluent::ConfigError, "sqs/endpoint parameter is not supported for SQS, use s3_region instead. This parameter is for SQS compatible services"
127127
end
128128

lib/fluent/plugin/out_s3.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def configure(conf)
171171

172172
Aws.use_bundled_cert! if @use_bundled_cert
173173

174-
if @s3_endpoint && @s3_endpoint.end_with?('amazonaws.com')
174+
if @s3_endpoint && (@s3_endpoint.end_with?('amazonaws.com') && !['fips', 'gov'].any? { |e| @s3_endpoint.include?(e) })
175175
raise Fluent::ConfigError, "s3_endpoint parameter is not supported for S3, use s3_region instead. This parameter is for S3 compatible services"
176176
end
177177

0 commit comments

Comments
 (0)