#!/bin/bash # This bash script is used to bootstrap the lambda layer. It should be included in the layer zip archive and can then # be used by a user by adding this environment variable to their lambda configuration: # AWS_LAMBDA_EXEC_WRAPPER = /opt/codeguru_profiler_lambda_exec # This replaces the environment variables so that a codeguru profiler function is called by lambda framework # instead of the customer's function, then our function will call the customer's function. # Note that after loading the original handler we will reset the _HANDLER variable to its original value. export HANDLER_ENV_NAME_FOR_CODEGURU=$_HANDLER export _HANDLER="codeguru_profiler_agent.aws_lambda.lambda_handler.call_handler" exec "$@"