Bird
0
0

A developer sets an environment variable DB_PASSWORD in Lambda console but the function code returns None when accessing it. What is the most likely cause?

medium📝 Debug Q14 of 15
AWS - Lambda
A developer sets an environment variable DB_PASSWORD in Lambda console but the function code returns None when accessing it. What is the most likely cause?
ALambda function memory is too low
BThe environment variable key is misspelled in the code
CThe environment variable value is encrypted and inaccessible
DThe Lambda function timeout is too short
Step-by-Step Solution
Solution:
  1. Step 1: Check environment variable access

    If code returns None, likely the key used in code does not match the set key.
  2. Step 2: Exclude unrelated causes

    Memory size, encryption, or timeout do not cause None return for env var access.
  3. Final Answer:

    The environment variable key is misspelled in the code -> Option B
  4. Quick Check:

    Misspelled env var key returns None [OK]
Quick Trick: Check spelling of env var keys in code vs console [OK]
Common Mistakes:
MISTAKES
  • Blaming memory or timeout for env var issues
  • Assuming encryption blocks access without decryption
  • Not verifying exact key names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes