简体   繁体   中英

AWS - Environment Variables

I would think this would be a very common question, but apparently it's not. I have a React app hosted on S3. Obviously, the React app has some variables I would like to not share with everyone. Like the location of the backend. Normally, I would store that information in an environment variable on something like Heroku or Netlify.

How to you hide sensitive information for apps on S3? I've heard something about using Lambda? Is that the easiest way to do it?

If you need to protect sensitive information you cannot put them inside the static assets in S3 inside react frontend.

  • But it is still possible to use a different private bucket to store these variables.
  • Create an API with API Gateway (Optionally Lambda) and store the variables in DynamoDB.
  • Directly store in DynamoDB from frontend with DynamoDB finegrained access control .

Either of the above with access control having a login page, using AWS Cognito.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM