擅长:python、mysql、java
<p>对于<code>launch-time</code>,您可以提供一个通配符来匹配给定日期内的任何时间。如果今天是<code>Dec 13th 2017</code>,则可以指定<code>2017-12-13*</code></p>
<pre><code>import boto3
from datetime import date
date_filter = date.isoformat(date.today()) + '*'
ec2 = boto3.resource('ec2')
instances = ec2.instances.filter(Filters=[{'Name':'launch-time', 'Values':[date_filter]}])
for instance in instances:
print instance.instance_id
</code></pre>