title: An exception occurred : 's3.ServiceResource' object has no attribute 'head_object'
body: <p>I am checking if an object exist in S3 bucket. 
  Following is the code snippet that I am using. 
  <code>obj</code> is the filename.</p>
  
  <pre><code>    s3 = boto3.resource('s3')
      try:
          s3.head_object(Bucket=bucket_name, Key=obj)
      except ClientError as e:
          return False
  </code></pre>
  
  <p>But it is throwing me exception :</p>
  
  <p><code>An exception occurred in python_code : 's3.ServiceResource' object has no attribute 'head_object'</code></p>
  
  <p>Reference I used for this API - <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.head_object" rel="noreferrer">https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.head_object</a></p>
  
  <p>Could anyone help me fix this? </p>