I am new to and have recently been learning how to build/deploy a MEAN stack application and now wish to deploy to AWS (Using EC2). Currently my node.js API utilises environment variables (process.env) for values such as:
- MongoDB URL (for process running on port 27017)
- JWT authentication secret
- Email and passwords for emailing service
- Port to run node
What is the best way to handle these dynamic values when deploying this app to production? I have read that environment variables, whilst more secure than plaintext values, are still insecure in some regard. I am aware of services such as the AWS parameter store for secure storage of these values but wanted to know if there is some general best practice advice to follow for storing such configuration variables when deploying an app into production for any given deployment option.
Thanks