logstash-input-kinesis 2.0.4-java → 2.0.5-java

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
- SHA1:
3
- metadata.gz: b5c3090597b24ebd6da06abbbf85c0df32ea4ea0
4
- data.tar.gz: 8ff2630b18a77e3ea6dcf24edcc431e795dbfaec
2
+ SHA256:
3
+ metadata.gz: f3e4d9614e4481f001a52c155e113fa7597462bd6d23961e3ae925895b5c800f
4
+ data.tar.gz: 35e2f182b3c99631a5dc8585b161239b3d25881654869423d84cad7cff3394ae
5
5
  SHA512:
6
- metadata.gz: 7ee4c392e8632b9ba9585be1ea6559352242d2d9b6fcde2039f38219844d4290b59c4f25b3f3ed8fbf9074a5c201b7ef6dcd96c57c6000ffaf1e3bc9b882c57e
7
- data.tar.gz: dba756ebc37f517ea69528abd87a9ce8df261165cb48c8d2ccdcc4d27721d54541b00e4b9d8a3e32626053a3ce1bf65ea6d067a23d7ff81375659981e5622db3
6
+ metadata.gz: 0aa496b90b0bc671323218b4a1d057857c518745a9e5b2eff66272598f37507a7ea4fc049f48e405c480ad56beafd1f69bad6cd22fdc8e230d429f28a9de1295
7
+ data.tar.gz: e6461c17ea75489281a20cb216494d864559bb6ea59a3f5dc69b0a2f997038a8d97f9b27ac2c980f2c53a6e8ed4357a339dc31c66e84963546c49aaf618e6079
data/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ ## 2.0.5
2
+ - Docs: Add CHANGELOG.md
3
+ - Support for specifying an AWS credentials profile with the `profile` config parameter
4
+ - Docs: Remove extraneous text added during doc extract
5
+
6
+ ## 2.0.4
7
+ - Docs: Bump version for automated doc build
8
+
9
+ ## 2.0.3
10
+ - Fix error about failed to coerce java.util.logging.Level to org.apache.log4j.Level with logstash 5.1.1
11
+
12
+ ## 2.0.2
13
+ - Fix error with Logstash 5.0
14
+
15
+ ## 2.0.1
16
+ - Add partition_key, approximate_arrival_timestamp and sequence_number fields in the @metadata sub-has
data/README.md CHANGED
@@ -46,10 +46,13 @@ This are the properties you can configure and what are the default values:
46
46
  * `metrics`: Worker metric tracking. By default this is disabled, set it to "cloudwatch" to enable the cloudwatch integration in the Kinesis Client Library.
47
47
  * **required**: false
48
48
  * **default value**: `nil`
49
+ * `profile`: The AWS profile name for authentication. This ensures that the `~/.aws/credentials` AWS auth provider is used. By default this is empty and the default chain will be used.
50
+ * **required**: false
51
+ * **default value**: `""`
49
52
 
50
53
  ## Authentication
51
54
 
52
- This plugin uses the default AWS SDK auth chain, [DefaultAWSCredentialsProviderChain](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html), to determine which credentials the client will use.
55
+ This plugin uses the default AWS SDK auth chain, [DefaultAWSCredentialsProviderChain](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html), to determine which credentials the client will use, unless `profile` is set, in which case [ProfileCredentialsProvider](http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/profile/ProfileCredentialsProvider.html) is used.
53
56
 
54
57
  The default chain follows this order trying to read the credentials:
55
58
  * `AWS_ACCESS_KEY_ID` / `AWS_SECRET_KEY` environment variables
@@ -61,7 +64,7 @@ The credentials will need access to the following services:
61
64
  * AWS DynamoDB: the client library stores information for worker coordination in DynamoDB (offsets and active worker per partition)
62
65
  * AWS CloudWatch: if the metrics are enabled the credentials need CloudWatch update permisions granted.
63
66
 
64
- Look at the [documentation](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html) for deeper information.
67
+ Look at the [documentation](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html) for deeper information on the default chain.
65
68
 
66
69
  ## Contributing
67
70
 
@@ -50,6 +50,9 @@ class LogStash::Inputs::Kinesis < LogStash::Inputs::Base
50
50
  # to enable the cloudwatch integration in the Kinesis Client Library.
51
51
  config :metrics, :validate => [nil, "cloudwatch"], :default => nil
52
52
 
53
+ # Select AWS profile for input
54
+ config :profile, :validate => :string
55
+
53
56
  def initialize(params = {})
54
57
  super(params)
55
58
  end
@@ -64,7 +67,14 @@ class LogStash::Inputs::Kinesis < LogStash::Inputs::Base
64
67
  end
65
68
 
66
69
  worker_id = java.util::UUID.randomUUID.to_s
67
- creds = com.amazonaws.auth::DefaultAWSCredentialsProviderChain.new
70
+
71
+ # If the AWS profile is set, use the profile credentials provider.
72
+ # Otherwise fall back to the default chain.
73
+ unless @profile.nil?
74
+ creds = com.amazonaws.auth.profile::ProfileCredentialsProvider.new(@profile)
75
+ else
76
+ creds = com.amazonaws.auth::DefaultAWSCredentialsProviderChain.new
77
+ end
68
78
  @kcl_config = KCL::KinesisClientLibConfiguration.new(
69
79
  @application_name,
70
80
  @kinesis_stream_name,
@@ -2,7 +2,7 @@
2
2
  module Logstash
3
3
  module Input
4
4
  module Kinesis
5
- VERSION = "2.0.4"
5
+ VERSION = "2.0.5"
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,6 @@ require "logstash/plugin"
2
2
  require "logstash/inputs/kinesis"
3
3
  require "logstash/codecs/json"
4
4
 
5
-
6
5
  RSpec.describe "inputs/kinesis" do
7
6
  KCL = com.amazonaws.services.kinesis.clientlibrary.lib.worker
8
7
 
@@ -13,6 +12,18 @@ RSpec.describe "inputs/kinesis" do
13
12
  "metrics" => metrics,
14
13
  "checkpoint_interval_seconds" => 120,
15
14
  "region" => "ap-southeast-1",
15
+ "profile" => nil
16
+ }}
17
+
18
+ # Config hash to test credentials provider to be used if profile is specified
19
+ let(:config_with_profile) {{
20
+ "application_name" => "my-processor",
21
+ "kinesis_stream_name" => "run-specs",
22
+ "codec" => codec,
23
+ "metrics" => metrics,
24
+ "checkpoint_interval_seconds" => 120,
25
+ "region" => "ap-southeast-1",
26
+ "profile" => "my-aws-profile"
16
27
  }}
17
28
 
18
29
  subject!(:kinesis) { LogStash::Inputs::Kinesis.new(config) }
@@ -33,6 +44,14 @@ RSpec.describe "inputs/kinesis" do
33
44
  expect(kinesis.kcl_config.streamName).to eq("run-specs")
34
45
  expect(kinesis.kcl_config.regionName).to eq("ap-southeast-1")
35
46
  expect(kinesis.kcl_config.initialPositionInStream).to eq(KCL::InitialPositionInStream::TRIM_HORIZON)
47
+ expect(kinesis.kcl_config.get_kinesis_credentials_provider.getClass.to_s).to eq("com.amazonaws.auth.DefaultAWSCredentialsProviderChain")
48
+ end
49
+
50
+ subject!(:kinesis_with_profile) { LogStash::Inputs::Kinesis.new(config_with_profile) }
51
+
52
+ it "uses ProfileCredentialsProvider if profile is specified" do
53
+ kinesis_with_profile.register
54
+ expect(kinesis_with_profile.kcl_config.get_kinesis_credentials_provider.getClass.to_s).to eq("com.amazonaws.auth.profile.ProfileCredentialsProvider")
36
55
  end
37
56
 
38
57
  context "#run" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-kinesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: java
6
6
  authors:
7
7
  - Brian Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-27 00:00:00.000000000 Z
11
+ date: 2017-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -72,13 +72,16 @@ dependencies:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
- description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
75
+ description: This gem is a logstash plugin required to be installed on top of the
76
+ Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not
77
+ a stand-alone program
76
78
  email:
77
79
  - brian@codekitchen.net
78
80
  executables: []
79
81
  extensions: []
80
82
  extra_rdoc_files: []
81
83
  files:
84
+ - CHANGELOG.md
82
85
  - CONTRIBUTORS
83
86
  - Gemfile
84
87
  - README.md
@@ -134,7 +137,7 @@ requirements:
134
137
  - jar 'com.amazonaws:amazon-kinesis-client', '1.7.0'
135
138
  - jar 'com.amazonaws:aws-java-sdk-core', '1.11.16'
136
139
  rubyforge_project:
137
- rubygems_version: 2.4.8
140
+ rubygems_version: 2.6.11
138
141
  signing_key:
139
142
  specification_version: 4
140
143
  summary: Logstash plugin for Kinesis input