fluent-plugin-s3 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/VERSION +1 -1
- data/lib/fluent/plugin/in_s3.rb +17 -0
- data/test/test_in_s3.rb +34 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0263bee7f101a3d938fb85697b7acf0473b9f3ed
|
4
|
+
data.tar.gz: 1f7b330dc029d10f50f9eee56a1f2310ebcca839
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fafe6a2e4c311f4850afa2f241332292f31849c167010bd187f9a3cddcce03308bd41a8fb01a9447e3c86ae181d67857a28f8a26b441da4b2203019443ef95a
|
7
|
+
data.tar.gz: ad7e122c740eb2dbeaf17d39927b2ecb4474e60bc81e2d9592647568565fb453821607a4e8ebc62f940186fc68c7d4e3c5fd47a853123e56ec17235fc4f6003b
|
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.6
|
data/lib/fluent/plugin/in_s3.rb
CHANGED
@@ -64,6 +64,10 @@ module Fluent::Plugin
|
|
64
64
|
config_param :s3_bucket, :string
|
65
65
|
desc "S3 region name"
|
66
66
|
config_param :s3_region, :string, default: ENV["AWS_REGION"] || "us-east-1"
|
67
|
+
desc "Use 's3_region' instead"
|
68
|
+
config_param :s3_endpoint, :string, default: nil
|
69
|
+
desc "If true, the bucket name is always left in the request URI and never moved to the host as a sub-domain"
|
70
|
+
config_param :force_path_style, :bool, default: false
|
67
71
|
desc "Archive format on S3"
|
68
72
|
config_param :store_as, :string, default: "gzip"
|
69
73
|
desc "Check AWS key on start"
|
@@ -74,6 +78,8 @@ module Fluent::Plugin
|
|
74
78
|
config_section :sqs, required: true, multi: false do
|
75
79
|
desc "SQS queue name"
|
76
80
|
config_param :queue_name, :string, default: nil
|
81
|
+
desc "Use 's3_region' instead"
|
82
|
+
config_param :endpoint, :string, default: nil
|
77
83
|
desc "Skip message deletion"
|
78
84
|
config_param :skip_delete, :bool, default: false
|
79
85
|
desc "The long polling interval."
|
@@ -92,6 +98,14 @@ module Fluent::Plugin
|
|
92
98
|
def configure(conf)
|
93
99
|
super
|
94
100
|
|
101
|
+
if @s3_endpoint && @s3_endpoint.end_with?('amazonaws.com')
|
102
|
+
raise Fluent::ConfigError, "s3_endpoint parameter is not supported for S3, use s3_region instead. This parameter is for S3 compatible services"
|
103
|
+
end
|
104
|
+
|
105
|
+
if @sqs.endpoint && @sqs.endpoint.end_with?('amazonaws.com')
|
106
|
+
raise Fluent::ConfigError, "sqs/endpoint parameter is not supported for SQS, use s3_region instead. This parameter is for SQS compatible services"
|
107
|
+
end
|
108
|
+
|
95
109
|
parser_config = conf.elements("parse").first
|
96
110
|
unless @sqs.queue_name
|
97
111
|
raise Fluent::ConfigError, "sqs/queue_name is required"
|
@@ -196,6 +210,8 @@ module Fluent::Plugin
|
|
196
210
|
def create_s3_client
|
197
211
|
options = setup_credentials
|
198
212
|
options[:region] = @s3_region if @s3_region
|
213
|
+
options[:endpoint] = @s3_endpoint if @s3_endpoint
|
214
|
+
options[:force_path_style] = @force_path_style
|
199
215
|
options[:proxy_uri] = @proxy_uri if @proxy_uri
|
200
216
|
log.on_trace do
|
201
217
|
options[:http_wire_trace] = true
|
@@ -208,6 +224,7 @@ module Fluent::Plugin
|
|
208
224
|
def create_sqs_client
|
209
225
|
options = setup_credentials
|
210
226
|
options[:region] = @s3_region if @s3_region
|
227
|
+
options[:endpoint] = @sqs.endpoint if @sqs.endpoint
|
211
228
|
log.on_trace do
|
212
229
|
options[:http_wire_trace] = true
|
213
230
|
options[:logger] = log
|
data/test/test_in_s3.rb
CHANGED
@@ -112,6 +112,40 @@ class S3InputTest < Test::Unit::TestCase
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
+
|
116
|
+
def test_s3_endpoint_with_valid_endpoint
|
117
|
+
d = create_driver(CONFIG + 's3_endpoint riak-cs.example.com')
|
118
|
+
assert_equal 'riak-cs.example.com', d.instance.s3_endpoint
|
119
|
+
end
|
120
|
+
|
121
|
+
data('US West (Oregon)' => 's3-us-west-2.amazonaws.com',
|
122
|
+
'EU (Frankfurt)' => 's3.eu-central-1.amazonaws.com',
|
123
|
+
'Asia Pacific (Tokyo)' => 's3-ap-northeast-1.amazonaws.com')
|
124
|
+
def test_s3_endpoint_with_invalid_endpoint(endpoint)
|
125
|
+
assert_raise(Fluent::ConfigError, "s3_endpoint parameter is not supported, use s3_region instead. This parameter is for S3 compatible services") {
|
126
|
+
create_driver(CONFIG + "s3_endpoint #{endpoint}")
|
127
|
+
}
|
128
|
+
end
|
129
|
+
|
130
|
+
data('US West (Oregon)' => 's3-us-west-2.amazonaws.com',
|
131
|
+
'EU (Frankfurt)' => 's3.eu-central-1.amazonaws.com',
|
132
|
+
'Asia Pacific (Tokyo)' => 's3-ap-northeast-1.amazonaws.com')
|
133
|
+
def test_sqs_endpoint_with_invalid_endpoint(endpoint)
|
134
|
+
assert_raise(Fluent::ConfigError, "sqs.endpoint parameter is not supported, use s3_region instead. This parameter is for SQS compatible services") {
|
135
|
+
conf = <<"EOS"
|
136
|
+
aws_key_id test_key_id
|
137
|
+
aws_sec_key test_sec_key
|
138
|
+
s3_bucket test_bucket
|
139
|
+
buffer_type memory
|
140
|
+
<sqs>
|
141
|
+
queue_name test_queue
|
142
|
+
endpoint #{endpoint}
|
143
|
+
</sqs>
|
144
|
+
EOS
|
145
|
+
create_driver(conf)
|
146
|
+
}
|
147
|
+
end
|
148
|
+
|
115
149
|
Struct.new("StubResponse", :queue_url)
|
116
150
|
Struct.new("StubMessage", :message_id, :receipt_handle, :body)
|
117
151
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-09-
|
12
|
+
date: 2018-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|