There are three ways in which you can upload a file to amazon S3.
1. Object Instance Versioning
s3_resource.Object('bucketname', 'filename').upload_file(Filename='filename')
or
first_object.upload_file('filename')
2. Bucket Instance Versioning
s3_resource.Bucket('bucketname').upload_file(
Filename='filename', Key='filename')
3. Client Versioning
s3_resource.meta.client.upload_file(Filename='filename', Bucket='bucketname',Key='filename')