From d4e923de22cd9a25972ebc9ff819cd30e3a1099d Mon Sep 17 00:00:00 2001 From: "Philippe M. Chiasson" Date: Wed, 31 Jan 2018 14:47:17 -0500 Subject: [PATCH 1/2] Pass credentials directly to the Client classes and leave Aws.config alone Fixes #39 --- fluent-plugin-sqs.gemspec | 2 +- lib/fluent/plugin/in_sqs.rb | 13 ++++++------- lib/fluent/plugin/out_sqs.rb | 11 +++++------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/fluent-plugin-sqs.gemspec b/fluent-plugin-sqs.gemspec index bf297ed..2ffbbff 100644 --- a/fluent-plugin-sqs.gemspec +++ b/fluent-plugin-sqs.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = 'fluent-plugin-sqs' - s.version = '2.1.0' + s.version = '2.1.1' s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version= s.authors = ['Yuri Odagiri'] diff --git a/lib/fluent/plugin/in_sqs.rb b/lib/fluent/plugin/in_sqs.rb index f808316..81609bc 100644 --- a/lib/fluent/plugin/in_sqs.rb +++ b/lib/fluent/plugin/in_sqs.rb @@ -21,12 +21,6 @@ class SQSInput < Input def configure(conf) super - - Aws.config = { - access_key_id: @aws_key_id, - secret_access_key: @aws_sec_key, - region: @region - } end def start @@ -36,7 +30,12 @@ def start end def client - @client ||= Aws::SQS::Client.new(stub_responses: @stub_responses) + @client ||= Aws::SQS::Client.new( + access_key_id: @aws_key_id, + secret_access_key: @aws_sec_key, + region: @region, + stub_responses: @stub_responses, + ) end def queue diff --git a/lib/fluent/plugin/out_sqs.rb b/lib/fluent/plugin/out_sqs.rb index dcd2bcc..4501277 100644 --- a/lib/fluent/plugin/out_sqs.rb +++ b/lib/fluent/plugin/out_sqs.rb @@ -33,15 +33,14 @@ def configure(conf) compat_parameters_convert(conf, :buffer, :inject) super - Aws.config = { - access_key_id: @aws_key_id, - secret_access_key: @aws_sec_key, - region: @region - } end def client - @client ||= Aws::SQS::Client.new + @client ||= Aws::SQS::Client.new( + access_key_id: @aws_key_id, + secret_access_key: @aws_sec_key, + region: @region + ) end def resource From 2e174346432350c8e8932e81003ca54395ea1323 Mon Sep 17 00:00:00 2001 From: "Philippe M. Chiasson" Date: Thu, 1 Feb 2018 10:52:47 -0500 Subject: [PATCH 2/2] leave version alone --- fluent-plugin-sqs.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluent-plugin-sqs.gemspec b/fluent-plugin-sqs.gemspec index 2ffbbff..bf297ed 100644 --- a/fluent-plugin-sqs.gemspec +++ b/fluent-plugin-sqs.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = 'fluent-plugin-sqs' - s.version = '2.1.1' + s.version = '2.1.0' s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version= s.authors = ['Yuri Odagiri']