This repo lists sample codes to demonstrate usage of different services of AWS, Slack/Flock, google scripts for quick small projects to avoid large setups.
Collect data and trigger an AWS lambda function on receiving data. Process data and push it a Slack Channel and/or write to a google sheet.
There are various ways to trigger an AWS Lambda function, I have listed some below:
- API Gateway: Create HTTPS routes, public or protected. Lambda function can be triggered on each request received.
- SNS: If you have an already existing API or process, you can push a notifiication to SNS and trigger a Lambda function. Like sending email when the API is called.
- S3: A scenario where you have to carry out some task when a file/object is uploaded to S3.
Create a blank Lambda function and select a trigger. if you select API gateway, it will be created by default which you can modify to suit your needs
Same works for SNS. You can create a endpoint in SNS and add it to Lambda as trigger .
Webhooks can be easily created using their GUI.
Inbound webhook: Use it to post to Slack or Flock
Outbound webhook: Push data from slack to some external source.
Each Google sheet or google doc can have a script attached to it. Tools -> Script Editor.
In the script editor, there should either be a doPost
or doGet
method. Then you can Publish the script by selecting Publish -> Deploy as web App. While publishing in the section who can access the app, select : Anyone, even anonymous