In my case that using gitlab backup to S3 automatic and notify to slack after upload successfully or delete backups.
According this doc.
You will not receive event notifications from automatic deletes from lifecycle policies or from failed operations.
We can't receive the delete event from lifecycle operations.
This is main steps:
If using gitlab to upload backups that need IAM
account to access bucket that will generate id and key to access S3.
Slack message formatting reference
If require exteral node modules that will need upload .zip to lambda function first.
NOTE:Only select main files inside the project. Don't zip whole project.
You can use buildin test json to test out your lambda function.
Using environment variables to store variables or secrets.
var options = {
uri: process.env.SLACK_WEBHOOK_URI,
method: 'POST',
json: attachments
};
S3 delete by maker created event example