- Incoming webhook URL, from Slack API Settings, to pass as argument to the shell script
- AWS CLI permissions
- AWS CLI profile
-
index.js in `S3_BUCKET_URL` location
./SCRIPT.sh "https://hooks.slack.com/services/FOO/BAR/a1b2c3d4" S3_BUCKET_URL AWS_PROFILE AWS_REGION
- Create a webhook for slack from HERE
- Take note of the webhook URL as it is required in the script.
- When you run the script, it will:
- Download the NodeJS script from the bucket specified.
- Edit the script with the webhook URL.
- zip the script to be uploaded to AWS Lambda.
- Create the Lambda Function with the zip.
- You have to add Lambda Trigger manually. For example, SNS trigger for lambda.
- The script should work in single run. If not, run it again as it is safe to do.
S3_BUCKET_URL
Example = https://s3.ap-south-1.amazonaws.com/<BUCKET_NAME>
Test First, Execute Second.
P.S.: index.js
code credit to Akshay Apte