# Using AWS Lambda as a runner The following env variable must be set on a lambda function: `RUNNER_SECRET=` Supports two endpoints: * `/challenge` - returns a challenge response, for configuration ```console $ curl https://cspdflxovjct7x6d6r2yzc7bsi0qskbg.lambda-url.us-east-2.on.aws/challenge 401 Incorrect runner secret $ curl -H "Authorization: Bearer YOUR_APP_KEY_CONTENTS" https://cspdflxovjct7x6d6r2yzc7bsi0qskbg.lambda-url.us-east-2.on.aws/challenge 200 OK ``` * `/execute` - executes a Grafana script test.py script: ```python def run_my_stuff(): print("my event:", grafana_event["name"]) run_my_stuff() ``` call to the runner: ```console julienduchesne@Juliens-MacBook-Pro grafana % curl -H 'content-type: multipart/form-data' \ -H "Authorization: Bearer MY_SECRET_CONTENT" \ -F 'file1=@test.py' \ -F 'metadata={"entrypoint": "file1"};type=application/json' \ -F 'event={"name": "AlertTriggered", "payload": {"alert": "KubernetesDown", "time": "blabla"}};type=application/json' \ https://cspdflxovjct7x6d6r2yzc7bsi0qskbg.lambda-url.us-east-2.on.aws/execut 200 Output: my event: AlertTriggered ```