Python boto: filter on tag and value
<p>Filtering by tag key works just fine:</p>

<pre><code>ec2.get_all_instances(filters={'tag-key': 'MachineType'})
</code></pre>

<p>How can I filter by key and value?</p>

<pre><code>"MachineType=DB"
</code></pre>

<p><strong>Boto</strong></p>

<pre><code>ec2.get_all_instances(filters={"tag:MachineType" : "DB"})
</code></pre>

<p><strong>Boto3</strong></p>

<pre><code>import boto3

ec2 = boto3.resource('ec2')
inst_filter = [{'Name':'tag: MachineType', 'Values':['DB']}]
insts = list(ec2.instances.filter(Filters=inst_filter))
for inst in insts:
  print inst.id
</code></pre>

python amazon-web-services boto