Closed XerTheSquirrel closed 5 years ago
Environment variables of interest, that we can use to recover information that should be in the context:
AWS_ACCESS_KEY_ID
AWS_DEFAULT_REGION
AWS_EXECUTION_ENV
AWS_LAMBDA_FUNCTION_MEMORY_SIZE
AWS_LAMBDA_FUNCTION_NAME
AWS_LAMBDA_FUNCTION_VERSION
AWS_LAMBDA_LOG_GROUP_NAME
AWS_LAMBDA_LOG_STREAM_NAME
AWS_REGION
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
AWS_XRAY_CONTEXT_MISSING
_AWS_XRAY_DAEMON_ADDRESS
AWS_XRAY_DAEMON_ADDRESS
_AWS_XRAY_DAEMON_PORT
_HANDLER
LAMBDA_RUNTIME_DIR
LAMBDA_TASK_ROOT
_X_AMZN_TRACE_ID
Okay, not sure about these:
String getAwsRequestId()
String getInvokedFunctionArn()
int getRemainingTimeInMillis()
From my list of variables, these are not exposed.
For String getAwsRequestId()
I just derived this from the hashCode(), it is only 32-bits but it is better than a constant.
If a
Context
was not passed to the method it will use one which is derived from environment variables.