This repository contains an example implementation of a Lambda function that can handle an event webhook from Buy Me A Coffee.
Currently this function only logs the received values, but can be extended to perform any number of actions upon receipt.
Note that the function URL endpoint itself is unauthenticated, but an HMAC signature check is performed to ensure the webhook call is valid.
Install the requisite packages with pip3 install -r requirements.txt
.
Execute utilities/run-tests.bash
, which runs three items:
flake8
code quality checkbandit
security vulnerability scancdk synth
which includes acdk_nag
check defined inapp.py
pytest
unit tests defined intests/test_stack.py
- Configure AWS CLI credentials for the account where the solution will be deployed.
- Deploy the Lambda function with
cdk deploy
. Copy the function URL in the output. - Create the webhook here, pasting in URL from step 1. Copy the secret value displayed in the console.
- Run
utilities/create-secret.py SECRET
, replacingSECRET
with the copied secret from step 2.
This project is licensed under the MIT-0 License. See the LICENSE file for details.