Where To Store API Keys For React/Node App In Aws Ec2 Instance?
I have a react/node application in an ec2 ubuntu instance(sitting at /home/ubuntu/app-name). It's consistently deployed using AWS Cloud deploy and Bitbucket pipelines. I have some API KEYS that I need to use in the application, but I do not want to store them in my repo. Where can I keep these keys and fetch when I need them?
Answer
For your use case I would recommend the AWS EC2 Parameter Store. Launch the EC2 instance with an instance profile that permits access to the credentials in the Parameter Store and fetch the keys using the AWS SDK of the language of your choice, or using the AWS CLI (e.g. when bootstrapping the instance in the instance user data).
See https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html for more information.
Related Questions
- → Maximum call stack exceeded when instantiating class inside of a module
- → Browserify api: how to pass advanced option to script
- → Node.js Passing object from server.js to external modules?
- → gulp-rename makes copies, but does not replace
- → requiring RX.js in node.js
- → Remove an ObjectId from an array of objectId
- → Can not connect to Redis
- → React: How to publish page on server using React-starter-kit
- → Express - better pattern for passing data between middleware functions
- → Can't get plotly + node.js to stream data coming through POST requests
- → IsGenerator implementation
- → Async/Await not waiting
- → (Socket.io on nodejs) Updating div with mysql data stops without showing error