Using the aws-cli client (https://github.com/aws/aws-cli), is there a way to find instances using a date range filter? Or using an "earlier than X date" or "last X days" filter?
It seems that the only date-related filter is to specify an exact date, or a partial date with string wildcards. For example, I've found that specifying a date as follows works:
aws ec2 describe-instances --filters "Name=launch-time,Values=2015-03\*"
For example, that gets all instances launched in March, 2015.
What I want is equivalent to this POSIX "find" command, "find all things from last 30 days":
find . -mtime -30
Found on Use filter "launch-time" to find all instances newer than X date? using JMESPath query:
You cant, but to do it in python using the boto library do like this, for example, to list the instances in aws region "eu-west-1" launched more than 30 days ago.