title: List out auto scaling group names with a specific application tag using boto3
body: <p>I was trying to fetch auto scaling groups with Application tag value as 'CCC'. </p>
  
  <p>The list is as below,</p>
  
  <pre><code>gweb
  prd-dcc-eap-w2
  gweb
  prd-dcc-emc
  gweb
  prd-dcc-ems
  CCC
  dev-ccc-wer
  CCC
  dev-ccc-gbg
  CCC
  dev-ccc-wer
  </code></pre>
  
  <p>The script I coded below gives output which includes one ASG without CCC tag.</p>
  
  <pre><code>#!/usr/bin/python
  import boto3
  
  client = boto3.client('autoscaling',region_name='us-west-2')
  
  response = client.describe_auto_scaling_groups()
  
  ccc_asg = []
  
  all_asg = response['AutoScalingGroups']
  for i in range(len(all_asg)):
      all_tags = all_asg[i]['Tags']
      for j in range(len(all_tags)):
          if all_tags[j]['Key'] == 'Name':
                  asg_name = all_tags[j]['Value']
          #        print asg_name
          if all_tags[j]['Key'] == 'Application':
                  app = all_tags[j]['Value']
          #        print app
          if all_tags[j]['Value'] == 'CCC':
                  ccc_asg.append(asg_name)
  
  print ccc_asg
  </code></pre>
  
  <p>The output which I am getting is as below,</p>
  
  <pre><code>['prd-dcc-ein-w2', 'dev-ccc-hap', 'dev-ccc-wfd', 'dev-ccc-sdf']
  </code></pre>
  
  <p>Where as <code>'prd-dcc-ein-w2'</code> is an asg with a different tag <code>'gweb'</code>. And the last one <code>(dev-ccc-msp-agt-asg)</code> in the CCC ASG list is missing. I need output as below,</p>
  
  <pre><code>dev-ccc-hap-sdf
  dev-ccc-hap-gfh
  dev-ccc-hap-tyu
  dev-ccc-mso-hjk
  </code></pre>
  
  <p>Am I missing something ?.</p>