Complete the code to define an environment variable named 'STAGE' with value 'prod' in the Lambda function configuration.
Environment: {
Variables: {
"STAGE": [1]
}
}The environment variable value must be a string enclosed in double quotes in JSON.
Complete the AWS CLI command to update the Lambda function 'MyFunction' to set an environment variable 'MODE' to 'test'.
aws lambda update-function-configuration --function-name MyFunction --environment Variables=[1]The environment variables must be passed as a JSON object string with keys and values in double quotes.
Fix the error in the Lambda function environment variable configuration to correctly set 'API_KEY' to '12345'.
Environment: {
Variables: {
API_KEY: [1]
}
}In JSON, string values must be enclosed in double quotes to be valid.
Fill both blanks to create a Python Lambda handler that reads environment variables 'DB_HOST' and 'DB_PORT'.
import os def lambda_handler(event, context): host = os.environ.get([1]) port = os.environ.get([2]) return f"Connecting to {host} on port {port}"
Environment variable names must be passed as strings to os.environ.get().
Fill all three blanks to define a CloudFormation snippet that sets environment variables 'ENV', 'VERSION', and 'DEBUG' for a Lambda function.
Environment:
Variables:
ENV: [1]
VERSION: [2]
DEBUG: [3]All environment variable values must be strings in CloudFormation, so use double quotes around each value.