I am sure this question has been asked many times in many different formats, but for the life of me I don't see a clear answer, just bits and pieces and conflicting comments.
I want my AWS CentOS 7 EC2 server to boot up with a certain set of variable=values to be used by my application(s) (specifically, a Node.js app).
How can I craft a file that can be executed automatically at startup (and later, at will during CodeDeploy for example) that will make these variables available to any processes and profiles? What is the full procedure?
MY_ENV=production
MY_OTHER_VAR=something with spaces for example
My app.js:
function(){
console.log('Hey, this is my variable: ', process.env.MY_ENV);
}