Code and Library for AWS Lambda function.
For further information, refer to: https://dev.to/saids11/aws-lambda-send-notifications-to-your-discord-server-using-sns-topics-43d2
The lambda_function.py contains the necessary code, but before copying and pasting it, create a lambda function with the blueprint "sns-message-python" and select your topic. Then you can proceed.
The python.zip contains the discord-webhook module. Upload the layer to AWS Lambda before testing the code.