code: def _upload_code(s3_conn, bucket, prefix, name, contents, content_hash,
                   payload_acl):
      
  
      logger.debug('lambda: ZIP hash: %s', content_hash)
      key = '{}lambda-{}-{}.zip'.format(prefix, name, content_hash)
  
      if _head_object(s3_conn, bucket, key):
          logger.info('lambda: object %s already exists, not uploading', key)
      else:
          logger.info('lambda: uploading object %s', key)
          s3_conn.put_object(Bucket=bucket, Key=key, Body=contents,
                             ContentType='application/zip',
                             ACL=payload_acl)
  
      return Code(S3Bucket=bucket, S3Key=key)
docs: Upload a ZIP file to S3 for use by Lambda.
  
      The key used for the upload will be unique based on the checksum of the
      contents. No changes will be made if the contents in S3 already match the
      expected contents.
  
      Args:
          s3_conn (botocore.client.S3): S3 connection to use for operations.
          bucket (str): name of the bucket to create.
          prefix (str): S3 prefix to prepend to the constructed key name for
              the uploaded file
          name (str): desired name of the Lambda function. Will be used to
              construct a key name for the uploaded file.
          contents (str): byte string with the content of the file upload.
          content_hash (str): md5 hash of the contents to be uploaded.
          payload_acl (str): The canned S3 object ACL to be applied to the
              uploaded payload
  
      Returns:
          troposphere.awslambda.Code: CloudFormation Lambda Code object,
          pointing to the uploaded payload in S3.
  
      Raises:
          botocore.exceptions.ClientError: any error from boto3 is passed
              through.