Skip to content

Instantly share code, notes, and snippets.

@BenRomberg
BenRomberg / dynamodb_backup_lambda.py
Created January 15, 2018 16:48
DynamoDB table backup using AWS Lambda (including cleanup of obsolete backups after a specified time)
import datetime
import os
import boto3
import logging
DAYS_UNTIL_OBSOLETE = 90
BACKUP_NAME_PREFIX = 'auto_'
BACKUP_TABLE_TAG_KEY = 'backup'
BACKUP_TABLE_TAG_VALUE = 'true'