fluent-plugin-amazon_sns 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ef75460ea04488c84f86ac2e8d786dcc3ccf535
4
- data.tar.gz: 9e2631dc421c9c10162717a1507fc2117726c2f4
3
+ metadata.gz: 2b0a087a81fc8241de26ae9801ee3edbde84528b
4
+ data.tar.gz: 51ad2e47176262ab9d79a130c12a097dabb0c8f2
5
5
  SHA512:
6
- metadata.gz: 57eba5a6a76400ea92f29516875de83978037b58b8a374281d4b949f46b66c3710c607369ba3d4b106927aba3c76a82c11fa17a0a87baa765cdaa65670dc1a65
7
- data.tar.gz: a8736122f171cf24d53c6a1f698a1ff04d611ea691cc76ebadb1ee0d29d0ce775266a5d9f8a436c37f07c27a6c865ac32a3580cade040bba43dd69cebef0c5b2
6
+ metadata.gz: 9dd19b54b682e7102c7ec2b2a7e592ee9e85f69b9e94164947224e3b346add8d1e9f83663894e0b3f52b745838827e3275619e9b6da74c1aa8be1a58e3612b62
7
+ data.tar.gz: 9593538a7f29f75967f52e906a9d62d619aa4855d8e0a285e1259c2c63898a87f50a2e99c0019d45d22692d621e97a9e5cda2b5eddebeffa7071eb4d23381a78
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 0.0.6
2
+
3
+ - Mark `aws_secret_access_key` parameter as secret (cosmo0920)
4
+ - Upgrade aws-sdk to v2 (kaorimatz)
5
+
1
6
  ### 0.0.5
2
7
 
3
8
  - relax fluentd dependency (makimoto)
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "fluentd", "~> 0.10"
22
- spec.add_dependency "aws-sdk-v1", "~> 1.12"
22
+ spec.add_dependency "aws-sdk", "~> 2"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.5"
25
25
  spec.add_development_dependency "rake"
@@ -1,7 +1,7 @@
1
1
  module Fluent
2
2
  module Plugin
3
3
  module AmazonSns
4
- VERSION = "0.0.5"
4
+ VERSION = "0.0.6"
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
- require "aws-sdk-v1"
1
+ require "aws-sdk"
2
2
 
3
3
  module Fluent
4
4
  class AmazonSNSOutput < BufferedOutput
@@ -11,8 +11,8 @@ module Fluent
11
11
  config_set_default :include_time_key, true
12
12
 
13
13
  config_param :aws_access_key_id, :string, default: nil
14
- config_param :aws_secret_access_key, :string, default: nil
15
- config_param :aws_region, :string, default: nil
14
+ config_param :aws_secret_access_key, :string, default: nil, secret: true
15
+ config_param :aws_region, :string, default: ENV['AWS_REGION'] || ENV['AWS_DEFAULT_REGION'] || 'us-east-1'
16
16
  config_param :aws_proxy_uri, :string, default: ENV['HTTP_PROXY']
17
17
 
18
18
  config_param :subject_key, :string, default: nil
@@ -36,18 +36,19 @@ module Fluent
36
36
  else
37
37
  raise Fluent::ConfigError, "no one way specified to decide target"
38
38
  end
39
+ end
40
+
41
+ def start
42
+ super
39
43
 
40
44
  options = {}
41
- [:access_key_id, :secret_access_key, :region, :proxy_uri].each do |key|
45
+ [:access_key_id, :secret_access_key, :region].each do |key|
42
46
  options[key] = instance_variable_get "@aws_#{key}"
43
47
  end
48
+ options[:http_proxy] = @aws_proxy_uri
44
49
 
45
- AWS.config(options)
46
- end
47
-
48
- def start
49
- super
50
- @sns = AWS::SNS.new
50
+ sns_client = Aws::SNS::Client.new(options)
51
+ @sns = Aws::SNS::Resource.new(client: sns_client)
51
52
  @topics = get_topics
52
53
  end
53
54
 
@@ -66,16 +67,16 @@ module Fluent
66
67
  topic = @topic_generator.call(tag, record)
67
68
  topic = topic.gsub(/\./, '-') if topic # SNS doesn't allow .
68
69
  if @topics[topic]
69
- @topics[topic].publish(record.to_json, subject: subject)
70
+ @topics[topic].publish(message: record.to_json, subject: subject)
70
71
  else
71
72
  $log.error "Could not find topic '#{topic}' on SNS"
72
73
  end
73
74
  end
74
75
  end
75
76
 
76
- def get_topics()
77
+ def get_topics
77
78
  @sns.topics.inject({}) do |product, topic|
78
- product[topic.name] = topic
79
+ product[topic.arn.split(/:/).last] = topic
79
80
  product
80
81
  end
81
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-amazon_sns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuhiko Miyagawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-12 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.10'
27
27
  - !ruby/object:Gem::Dependency
28
- name: aws-sdk-v1
28
+ name: aws-sdk
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.12'
33
+ version: '2'
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: '1.12'
40
+ version: '2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.4.6
106
+ rubygems_version: 2.6.11
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Fluent output plugin to send to Amazon SNS