While I found a number of examples for generating signed upload S3 URLs, there didn’t seem to be examples with the basics.
After substituting the name for your bucket, file name and expiry desired, run below code to generate the URL:
import boto3 if __name__ == "__main__": s3_client = boto3.client('s3') response = s3_client.generate_presigned_url( ClientMethod='put_object', Params={"Bucket": "mybucket", "Key": "file.pdf"}, ExpiresIn=48*60*60, HttpMethod="PUT") print(response) To upload from command line run below (substituting URL from previous section):