fluent-plugin-lambda 0.1.0 → 0.2.0
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/.gitignore +1 -0
- data/fluent-plugin-lambda.gemspec +2 -2
- data/fluent.conf +10 -0
- data/lib/fluent/plugin/out_lambda.rb +3 -2
- data/spec/out_lambda_spec.rb +15 -11
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a79d46bba15a5ee2e5eeed7aeb214e3d3040eb89
|
|
4
|
+
data.tar.gz: 19f67bc95dda317f6a4ece5ebc8df62beb0cb974
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee1e82399f2004d29a3298acdb528d703d8f8b0413132de671dd0a19925a01b474a30430a34a7819c444bc3f7d0eca902ed5dcdcd5f07751e58d7d925463b948
|
|
7
|
+
data.tar.gz: 61aee9a29dcae8e315b639f540df7b4d7679842895a4742b744d6c7d566b8714187b9fe6793d855a4d67ab6b2f557d6b6eb07dead83a8931300f6186fb6e7ed8
|
data/.gitignore
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
Gem::Specification.new do |spec|
|
|
3
3
|
spec.name = 'fluent-plugin-lambda'
|
|
4
|
-
spec.version = '0.
|
|
4
|
+
spec.version = '0.2.0'
|
|
5
5
|
spec.authors = ['Genki Sugawara']
|
|
6
6
|
spec.email = ['sugawara@cookpad.com']
|
|
7
7
|
spec.description = %q{Output plugin for AWS Lambda.}
|
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.require_paths = ['lib']
|
|
15
15
|
|
|
16
16
|
spec.add_dependency 'fluentd'
|
|
17
|
-
spec.add_dependency 'aws-sdk-core', '~> 2.
|
|
17
|
+
spec.add_dependency 'aws-sdk-core', '~> 2.1'
|
|
18
18
|
spec.add_development_dependency 'bundler'
|
|
19
19
|
spec.add_development_dependency 'rake'
|
|
20
20
|
spec.add_development_dependency 'rspec', '>= 3.0.0'
|
data/fluent.conf
ADDED
|
@@ -68,9 +68,10 @@ class Fluent::LambdaOutput < Fluent::BufferedOutput
|
|
|
68
68
|
}.each {|tag, time, record|
|
|
69
69
|
func_name = @function_name || record['function_name']
|
|
70
70
|
|
|
71
|
-
@client.
|
|
71
|
+
@client.invoke(
|
|
72
72
|
:function_name => func_name,
|
|
73
|
-
:
|
|
73
|
+
:payload => JSON.dump(record),
|
|
74
|
+
:invocation_type => 'Event',
|
|
74
75
|
)
|
|
75
76
|
}
|
|
76
77
|
end
|
data/spec/out_lambda_spec.rb
CHANGED
|
@@ -4,16 +4,18 @@ describe Fluent::LambdaOutput do
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
context 'when events is sent' do
|
|
7
|
-
it 'should be call
|
|
7
|
+
it 'should be call invoke' do
|
|
8
8
|
run_driver(function_name: 'my_func') do |d, client|
|
|
9
|
-
expect(client).to receive(:
|
|
9
|
+
expect(client).to receive(:invoke).with(
|
|
10
10
|
function_name: 'my_func',
|
|
11
|
-
|
|
11
|
+
payload: JSON.dump('key1' => 'foo', 'key2' => 100),
|
|
12
|
+
invocation_type: 'Event',
|
|
12
13
|
)
|
|
13
14
|
|
|
14
|
-
expect(client).to receive(:
|
|
15
|
+
expect(client).to receive(:invoke).with(
|
|
15
16
|
function_name: 'my_func',
|
|
16
|
-
|
|
17
|
+
payload: JSON.dump('key1' => 'bar', 'key2' => 200),
|
|
18
|
+
invocation_type: 'Event',
|
|
17
19
|
)
|
|
18
20
|
|
|
19
21
|
d.emit({'key1' => 'foo', 'key2' => 100}, time)
|
|
@@ -23,16 +25,18 @@ describe Fluent::LambdaOutput do
|
|
|
23
25
|
end
|
|
24
26
|
|
|
25
27
|
context 'when events is sent with function_name' do
|
|
26
|
-
it 'should be call
|
|
28
|
+
it 'should be call invoke' do
|
|
27
29
|
run_driver do |d, client|
|
|
28
|
-
expect(client).to receive(:
|
|
30
|
+
expect(client).to receive(:invoke).with(
|
|
29
31
|
function_name: 'my_func1',
|
|
30
|
-
|
|
32
|
+
payload: JSON.dump('function_name' => 'my_func1', 'key1' => 'foo' , 'key2' => 100),
|
|
33
|
+
invocation_type: 'Event',
|
|
31
34
|
)
|
|
32
35
|
|
|
33
|
-
expect(client).to receive(:
|
|
36
|
+
expect(client).to receive(:invoke).with(
|
|
34
37
|
function_name: 'my_func2',
|
|
35
|
-
|
|
38
|
+
payload: JSON.dump('function_name' => 'my_func2', 'key1' => 'bar' , 'key2' => 200),
|
|
39
|
+
invocation_type: 'Event',
|
|
36
40
|
)
|
|
37
41
|
|
|
38
42
|
d.emit({'function_name' => 'my_func1', 'key1' => 'foo', 'key2' => 100}, time)
|
|
@@ -44,7 +48,7 @@ describe Fluent::LambdaOutput do
|
|
|
44
48
|
context 'when events is sent without function_name' do
|
|
45
49
|
it 'should be warned' do
|
|
46
50
|
run_driver do |d, client|
|
|
47
|
-
expect(client).to_not receive(:
|
|
51
|
+
expect(client).to_not receive(:invoke)
|
|
48
52
|
|
|
49
53
|
d.emit({'key1' => 'foo', 'key2' => 100}, time)
|
|
50
54
|
d.emit({'key1' => 'bar', 'key2' => 200}, time)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-lambda
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Genki Sugawara
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-07-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fluentd
|
|
@@ -30,14 +30,14 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - ~>
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 2.
|
|
33
|
+
version: '2.1'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - ~>
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 2.
|
|
40
|
+
version: '2.1'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: bundler
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -95,6 +95,7 @@ files:
|
|
|
95
95
|
- README.md
|
|
96
96
|
- Rakefile
|
|
97
97
|
- fluent-plugin-lambda.gemspec
|
|
98
|
+
- fluent.conf
|
|
98
99
|
- lib/fluent/plugin/out_lambda.rb
|
|
99
100
|
- spec/out_lambda_spec.rb
|
|
100
101
|
- spec/spec_helper.rb
|