Skip to content

Commit

Permalink
aws region config parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
codekitchen committed Mar 4, 2015
1 parent 083c987 commit 2f56837
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/logstash/inputs/kinesis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class LogStash::Inputs::Kinesis < LogStash::Inputs::Base
# The kinesis stream name.
config :kinesis_stream_name, :validate => :string, :required => true

# The AWS region for Kinesis, DynamoDB, and CloudWatch (if enabled)
config :region, :validate => :string, :default => "us-east-1"

# How many seconds between worker checkpoints to dynamodb.
config :checkpoint_interval_seconds, :validate => :number, :default => 60

Expand All @@ -62,7 +65,9 @@ def register
@application_name,
@kinesis_stream_name,
creds,
worker_id).withInitialPositionInStream(KCL::InitialPositionInStream::TRIM_HORIZON)
worker_id).
withInitialPositionInStream(KCL::InitialPositionInStream::TRIM_HORIZON).
withRegionName(@region)
end

def run(output_queue)
Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/inputs/kinesis/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Logstash
module Input
module Kinesis
VERSION = "1.2.1"
VERSION = "1.2.2"
end
end
end
2 changes: 2 additions & 0 deletions spec/inputs/kinesis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def run
"codec" => codec,
"metrics" => metrics,
"checkpoint_interval_seconds" => 120,
"region" => "ap-southeast-1",
}}

subject!(:kinesis) { LogStash::Inputs::Kinesis.new(config, kcl_class) }
Expand All @@ -35,6 +36,7 @@ def run
kinesis.register
expect(kinesis.kcl_config.applicationName).to eq("my-processor")
expect(kinesis.kcl_config.streamName).to eq("run-specs")
expect(kinesis.kcl_config.regionName).to eq("ap-southeast-1")
expect(kinesis.kcl_config.initialPositionInStream).to eq(KCL::InitialPositionInStream::TRIM_HORIZON)
end

Expand Down

0 comments on commit 2f56837

Please sign in to comment.