An environment variable is a named key-value setting passed to a running process. In AWS Lambda, it lets function code read configuration without embedding each setting directly in the code. section 6.2.1
Configure a Lambda function with settings that the function reads during execution:
- Set site to the URL that the health check should monitor. section 6.2.1
- Set expected to the text snippet that must appear on the website. section 6.2.1
- Read the variables from the function code while Lambda executes the health check. section 6.2.1
Changing a health-check setting
A website health check can use expected=cloudonaut when the website contains that word. Changing the value to FAILURE makes the check fail when the website does not contain FAILURE, allowing the failure to reach CloudWatch monitoring and email notification. section 6.2.1 section 6.2.3
SITE = os.environment['site'] EXPECTED = os.environment['expected']
The code listing shows the function retrieving the SITE and EXPECTED settings from its environment. section 6.2.1


















