Skip to content

Instantly share code, notes, and snippets.

@borja-munoz
Last active May 2, 2021 13:17
Show Gist options
  • Save borja-munoz/dcf0df93f5a22a072724ab7e16f0ad29 to your computer and use it in GitHub Desktop.
Save borja-munoz/dcf0df93f5a22a072724ab7e16f0ad29 to your computer and use it in GitHub Desktop.
Upload file to AWS S3 bucket
import logging
import boto3
from botocore.exceptions import ClientError
s3_client = boto3.client('s3')
try:
response = s3_client.upload_file(file_name, bucket, file_name)
except ClientError as e:
logging.error(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment