title: global name 's3' not defined using boto?
body: <p>Boto3 is installed but when I try to use the below function to upload an image to an S3 bucket I get global name 's3' is not defined error.</p>
  <p>Is there something I'm missing?</p>
  <pre><code>import logging
  import boto3
  from botocore.exceptions import ClientError
  import os
  
  def upload_file(file_name, bucket, object_name=None):
  
  if object_name is None:
      object_name = os.path.basename(file_name)
  
  s3_client = boto3.resource('s3')
  
  try:
      response = s3.client.upload_file(file_name, bucket, 
      object_name)
  except ClientError as e:
      logging.error(e)
      return False
  return True
  
  upload = upload_file('test1.jpg','mybucket', 'test1.jpg')
  </code></pre>