AWS Lambda Environment Variable

When I add an environment variable to a aws-lambda through the aws-lambda console, I am able to reference these variables using:

_import os


print("environment variable: " + os.environ['variable'])

How would I use an environment variable in aws-lambda within a cloudformation template? I don't want to declare the environment variable in the aws-lambda console.