Editing configuration values inside the code is a high risk for error since there is a high chance that not only the values that you are changing you will change, you might even delete a letter or edit a line. In order to avoid this risk, you want your code to be able to accept configuration values at run time. This is extremely useful when developing codes on different environments like development, testing and production.
With AWS Lambda you can reuse your code on different environments using the Environment Variables.
Below is the way to use Environment Variables on AWS Lambda Console using Python 3.6.
Note: This is the same way to use Environment Variables on Python 2.7 and Python 3.7.
The Environment Variables section can be found under the Function Code section.
Environment Variables are Key/Value Pairs. The Key is what you will use on your Lambda Code, to access its Value. Continue reading AWS Lambda Console: Accessing Environment Variables via Python