title: How to check only specific s3 bucket exists using boto3
body: <p>I am trying to list a specific bucket in my <code>aws</code> account. But I have used <code>list_buckets()</code> method which returns all the buckets. Purpose is to check if this <strong>bucket exists or not</strong></p>
  
  <p>I could have used <code>head_bucket()</code> method, but it doesn't return anything in return (according to <code>boto3</code> documentation)</p>
  
  <p>I am using <strong>mistral</strong> workflows to get this bucket (still calling <code>boto3</code> methtods) not <code>python</code></p>
  
  <p>But somehow, <strong>is there a <code>boto3</code> method to check if the <code>s3</code> bucket exists or not?</strong> </p>
  
  <p>I need to get the return and compare it accordingly to check if the bucket exists. So if that condition satisfies, it only triggers the next task in <code>mistral</code> stackstorm workflow.</p>
  
  <p>In case you need I will put the workflow as well.</p>
  
  <pre><code>check_if_exists:
          action: aws_boto3.boto3action
          input:
            action_name: "list_buckets"
            region: &lt;% $.bucket_region %&gt;
            service: "s3"
          publish:
            return_code: &lt;% task(check_if_exists).result.result.Buckets.select($.Name) %&gt;
          on-success:
             - task_one
          on-error:
            - fail
  </code></pre>