#! /bin/python # This script will download a file from a URL and stream it directly # into AWS S3 without persisting the file to local disk. # File is streamed as it arrives, so memory usage is low (typically <100MB) import boto3, urllib2 source_url = 'http://' target_bucket = '' target_key = '' S3 = boto3.client('s3') file_data = urllib2.urlopen( source ) S3.upload_fileobj(file_data, target_bucket, target_key)