Here is what I tried:
#!/usr/bin/env python3
import boto3
import jmespath
from datetime import datetime, timedelta
now = datetime.utcnow()
yesterday = now - timedelta(days=1)
boto3.setup_default_session(profile_name='profilename')
rds_client = boto3.client('rds')
response = rds_client.describe_db_snapshots(DBInstanceIdentifier='instanseid')
snaplist=jmespath.search("DBSnapshots[?SnapshotCreateTime >`2016-10-24 06:11:30`].[DBSnapshotIdentifier]", response)
print(snaplist)
What I get is:
TypeError: unorderable types: datetime.datetime() < str()
I tried creating date (yesterday in the script) and passing it to jmepath search but I couldn't figure out how to pass that date object to the search. "+" doesn't work on datetime objects and if I convert it to sting with str() I return to the error posted above.