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?
            Asked
            
        
        
            Active
            
        
            Viewed 1,644 times
        
    0
            
            
        - 
                    How are you deploying on AWS? On EC2? – Karan Shah Jan 29 '17 at 02:59
2 Answers
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):
- Store the keys in variables and then export them from the file: - ~/.bash_profile
- 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
