Skip to content

Instantly share code, notes, and snippets.

@TristanV12
TristanV12 / disasterRecoveryEC2LambdaFunction.py
Created April 15, 2019 14:49
AWS Lambda Function that backs up ec2 images and volumes from one primary region to a disaster recovery region
import boto3
from datetime import date, timedelta
import datetime
###################
# Global Constants
###################
TESTING = False # true if we are ignoring the time interval
START_HOUR = 4 # start at 4 am
HOURS_IN_DAY = 24 # unlikely to change