logstash-output-kinesis-iot 0.1.12-java → 0.1.13-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e76a026d37a14d108cc8f158ac2b74dac29385457734e2faadd77229e9115ff
4
- data.tar.gz: 64b1d735212f6ecc4a63a375e7bc4a7fcdc1d939e0577baf29fa976ba587f99c
3
+ metadata.gz: 2aefc1330b417c621491795797fc727f8e256b0798f0e691697fee98edbf0e73
4
+ data.tar.gz: f20a83ff2d06521eb365c114db765b93467fbcfef0b3e1da3ea0293b8c52d1af
5
5
  SHA512:
6
- metadata.gz: 6fd0cb0d7bde124326b11c4157e4f429b37e59852a09b190043098823844f6c2e172f3e77a3f766f05360aa2be271adfe65096d3e89f59f76e17a7295ea5b34a
7
- data.tar.gz: 2aa08b0deeed5c64fbe1569cbc2ee6ca74ebe89ec9a587895ad30fca55668243c73194c62345b9c55bb568d5a14859b2ae006c451281aa24175a498787664573
6
+ metadata.gz: 73e4e56e2cc8c4ce0c24302361d3812e7ce3204fbdd555329d553cff1cc04aa87d93d88ca8b54592f9f6409a3571e8b8038a1160ceaaf2a359be76217cff3565
7
+ data.tar.gz: 5c0a085a2dde0149294197251393837be20810b293892620eec12451822fd12b50fea5da10db23f77c5f1fdeec2c5e64e2e6d81bbdfd3e13b70a7308d440b15e
@@ -105,12 +105,6 @@ class LogStash::Outputs::KinesisIOT < LogStash::Outputs::Base
105
105
  @kinesis = Aws::Kinesis::Client.new
106
106
  # send data to kinesis
107
107
  end
108
- def renew_aws
109
- @logger.info("Renewing AWS Credentials")
110
- @creds = getIotAccess()
111
- Aws.config.update({ credentials: Aws::Credentials.new(@creds.accessKeyId, @creds.secretAccessKey, @creds.sessionToken)})
112
-
113
- end
114
108
 
115
109
 
116
110
  public
@@ -151,8 +145,15 @@ class LogStash::Outputs::KinesisIOT < LogStash::Outputs::Base
151
145
  end
152
146
  end
153
147
  def send_record(event, payload)
148
+ if @creds.expiration >= Time.now() + 1
149
+ @logger.debug("Token still valid at " + (Time.now() +1 ).to_s)
150
+ else
151
+ @logger.debug("Invalid token, renewing")
152
+ @creds = getIotAccess()
153
+ init_aws()
154
+ end
154
155
  begin
155
- renew_aws() unless @creds.expiration >= Time.now() + 1
156
+ init_aws() unless @creds.expiration >= Time.now() + 1
156
157
  response = @kinesis.put_record({
157
158
  stream_name: @stream_name,
158
159
  data: payload,
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-kinesis-iot'
3
- s.version = '0.1.12'
3
+ s.version = '0.1.13'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = "Sends data to a AWS kinesis, "
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-kinesis-iot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: java
6
6
  authors:
7
7
  - Jeremy Frandon