I'm new to AWS and DevOps. But still experimenting here on our project, and I saw this environment variables section in CodeBuild, and I was trying to console.log the ENVIRONMENT which is sgdev1, but I'm getting undefined, when I check on CloudWatch.
I console log it like this, since I saw in our codebase it's written like that to access the environment variables. Though in this way, I'm only sure that it fetches those variables stored in my local machine, in the environment variables in Windows OS.
console.log(process.env.ENVIRONMENT)
Also I'm not that really sure where to put the environment variables, I'm quite confused since we also uses was secrets manager which holds some of our variables, then there's this codebuild env variables. I'm confused where should the variable that identify if the server is a dev site or production, but anyways the original question is how can I read these variables from codebuild environment variables? Forgive me if something stupid is going on with my question.
