amazon-kinesis-client-ruby icon indicating copy to clipboard operation
amazon-kinesis-client-ruby copied to clipboard

Allow properties from the .properties file to be set via environment variables.

Open digitalfiz opened this issue 8 years ago • 6 comments

Having to generate this properties file for each environment is not at all 12 factor app. It would be nice if setting STREAM_NAME and others via environment variables overrode properties file values. Kind of like auth works for the sdk.

digitalfiz avatar Jun 07 '17 20:06 digitalfiz

Yeah I ended up making a script to generate the properties file dynamically using a template so we could have 4 apps all use the same one. I don't have access to that code any more but IIRC you could have it read from STDIN instead of writing to the filesystem.

jqr avatar Jun 07 '17 20:06 jqr

Agree. I'm even overwhelmed with the fact that it doesn't take those properties as env variables.

lancedikson avatar Apr 24 '19 20:04 lancedikson

Thank you for reporting this feature request. If you or other customers can leave more details on how this impacts your workflows and +1 this issue to help us plan and prioritize this work.

Cory-Bradshaw avatar Mar 20 '20 14:03 Cory-Bradshaw

+1

akshaypinto avatar Mar 08 '21 20:03 akshaypinto

+1

skcc321 avatar Apr 05 '21 15:04 skcc321

You can use ERB to achieve this. Example:

properties_body = ERB.new(IO.read(Rails.root.join('config/consumer.properties.erb'))).result
properties_file = Rails.root.join('tmp/consumer.properties')
IO.write(properties_file, properties_body)

Then in the consumer.properties.erb file

streamName = <%= ENV['KCL_STREAM_NAME'] %>

cbatson avatar Jun 21 '21 18:06 cbatson