AWS Lambda Environment Variable Not Available in Python 3.8 Runtime
I'm integrating two systems and I'm having trouble with I've searched everywhere and can't find a clear answer. I'm writing unit tests and I'm working with an scenario where the environment variable I set in my AWS Lambda function is not accessible during execution. I've configured the Lambda function with the following environment variable settings in the AWS Console: - `ENV_MODE` = `production` However, when I try to access this variable in my Lambda function written in Python 3.8, it returns `None`. Here's the relevant portion of my code: ```python import os def lambda_handler(event, context): mode = os.getenv('ENV_MODE') if mode is None: return {"statusCode": 500, "body": "Environment variable not set."} return {"statusCode": 200, "body": f"Running in {mode} mode."} ``` I've checked the following: 1. The permission settings for the Lambda role are correct, allowing access to environment variables. 2. I have redeployed the function after setting the environment variable. 3. There are no typos in the environment variable name. Yet, I keep getting the response that the environment variable is not set. I also tried logging the entire `os.environ` dictionary to see if it includes `ENV_MODE`, but it does not. Is there something I might be overlooking in the configuration or environment variable setup? I'd love to hear your thoughts on this. For context: I'm using Python on Debian. What's the best practice here? Thanks for taking the time to read this!