Skip to content
Daily notification on the absence of an object on AWS S3 Prefix
Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore major cleanup Oct 9, 2019
Makefile major cleanup Oct 9, 2019
README.md major cleanup Oct 9, 2019
handlers.py major cleanup Oct 9, 2019
requirements.txt major cleanup Oct 9, 2019
sam.yml major cleanup Oct 9, 2019
setup.cfg major cleanup Oct 9, 2019

README.md

S3 Backup Notifier ✉️

s3 backup notifier intends to daily check the last object date in an AWS S3 bucket, and if it's older than today, send alerting email via AWS Simple Email Service (SES).

I'm using this to monitor the effectiveness of backup of my home automation systems and be alerted on any backup related issue.

Technical details

Fully serverless.

  • Uses AWS Lambda function (Python)
  • Rely on AWS Lambda layer for boto3 and botocore
  • Scheduled Lambda (daily) using CloudWatch Events
  • Uses AWS Simple Email Service (SES) for Emails Notifications

Installation

Requirements

  • Configure AWS Credentials (prefer aws-vault)
  • Create a bucket called: <project_name>-artifacts (Prefer versioned and encrypted)

Its using AWS Serverless Application Model (SAM)

Build

Build layer, and AWS Lambda function package.

$ make layer
$ make package

Deploy

Deploy CloudFormation stack.

RECIPIENTS var is space separated

$ make deploy \
    PROJECT=<your_project_name> \
    ENV=<your_env> \
    MONITORING_BUCKET=<bucket_to_monitor> \
    S3_PREFIX=<s3_prefix> \
    SENDER=<sender_email> \
    RECIPIENTS='<recipient_email1> <recipient_email2>' \
    AWS_REGION='<your_aws_region>'

Cleaning

Remove unused folders and files after the deployment of your the stack.

$ make cleaning

Destroy

$ make tear-down
You can’t perform that action at this time.