I have built a MERN stack app that I am now attempting to launch on an EC2 instance. I initially had environment variables stored in a .env file for dev. I have transferred these values to AWS parameter store for added security in production. How do I import these values to code?
I have looked for resources online to guide me through the process. So far I have came across lots of posts and videos referring to lambda. Currently, my project does not use lambda. Is this something I should dig deeper into?
2
Answers
The link was very useful.
Adding the following policy to AWS IAM was needed as well.
I am able to print the values stored in the parameter store to the console via server code running on the backend. I can't figure out how to store the values in variables to be used throughout the code. Any suggestions here?
Looks like you can import your stored variables using the
aws-sdk
as shown in this article: https://notificare.com/blog/2021/02/12/Using-Parameter-Store-With-Node/.