I have an EB env with Docker web app (rails) properly deployed. I set several EB env variables and they are properly visible in the container. Now - I\'d like these EB env varia
King of the one liners.
eval $(sudo ruby -e 'require "json"; container_config = JSON.parse(File.read("/opt/elasticbeanstalk/deploy/configuration/containerconfiguration")); raw_vars = container_config["optionsettings"]["aws:elasticbeanstalk:application:environment"]; envs = ""; raw_vars.each do |raw_var| envs << "export #{raw_var};\n" end; print envs;')
This will automatically export all the variables. You cannot use puts
to output environment variables with Ruby.