This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
from datetime import datetime, timedelta | |
region = 'us-east-1' | |
cloudwatch = boto3.client( 'cloudwatch', region_name=region ) | |
def lambda_handler( event, context ): | |
today = datetime.now() + timedelta( days=1 ) # today + 1 because we want all of today | |
two_weeks_ago = today - timedelta( days=14 ) | |
NewerOlder