1. Learn
  2. /
  3. Courses
  4. /
  5. Streaming Data with AWS Kinesis and Lambda

Exercise

Using environment variables

Environment variables are useful for storing variables that you may want to change without modifying code.

Cody is going on vacation. While she would normally be the main person to receive messages, for a week it will be have to go to Jeff.

Let's tweak the Lambda function a bit to send a personalized SMS to Jeff!

KWuRb.png

I have assigned Jeff's phone number and name to the relevant environment variables.

Instructions

100 XP
  • Import the os module.
  • Get the environment variables for PHONE_NUMBER and RECEIVER.
  • Get the environment variable for DEPARTMENT, and if it's not set, fall back to 'Fleet Department'.