Replace the contents serverless.yml with the below then update your profile name and region.
This will define the NodeJS version, memory allocation, AWS profile, region, along with the lambda function name and SQS queue.
The name of the queue is passed into the environment variable AWS_SQS_QUEUE_URL.
Webhook receiver to SQS function
Replace the contents of handler.js with the below.
The function will:
Log the event to CloudWatch.
Create a list of HTTP headers we can safely ignore.
Add the remaining HTTP headers to the SQS message attributes. Only ten attributes are supported so adjust the ignore list if nessecary.
Push the webhook event to SQS.
Log the result to CloudWatch.
Return a successful HTTP 200 response
The SQS message will now contain the HTTP headers and body from the original request.
Deploy to Lambda
The output will show your webhook URL, the SQS queue name can be found in the AWS console.