I am deploying a Ruby on Rails application to AWS using Elastic Beanstalk and have to set a private key as an environment variable
E.g
-----BEGIN RSA
You could set it in EB using \n
and then convert the '\n' to newlines before you pass it to config.key
- something like this (note the single and double quotes in the call to gsub
):
single_line_key = ENV.fetch('CLOUDFRONT_KEY')
multi_line_key = single_line_key.gsub('\n', "\n")
config.key = multi_line_key