0

Working on deploying a Flask application using AWS, but the Flask app relies on API secret keys that I have saved in a config.ini file on my computer. Should I be uploading that file with the keys to AWS? How should my Flask app access those keys once deployed to AWS?

cpage
  • 119
  • 6
  • 27

2 Answers2

2

I have not used Flask yet but as a good practice for deployment, you should never save your API keys/credentials in plain text anywhere.

For AWS related deployments which require API keys, I would suggest you use the IAM instance roles which have the required access that your application needs.

Manish Joshi
  • 3,550
  • 2
  • 21
  • 29
0

You can possibly do one of the following (Assuming that you're deploying on a Linux Based OS):

  1. Store the keys in variables and then export them from the file: ~/.bash_profile

  2. Save them as environment variables

    You can checkout this answer to see how to access them : Access environment variables from Python

Community
  • 1
  • 1
Karan Shah
  • 1,304
  • 11
  • 15