To start off, you need an S3 bucket. To create one programmatically, you must first choose a name for your bucket. Remember that this name must be unique throughout the whole AWS platform, as bucket names are DNS compliant.
If you try to create a bucket, but another user has already claimed your desired bucket name, your code will fail. Instead of success, you will see the following error: botocore.errorfactory.BucketAlreadyExists. You can increase your chance of success when creating your bucket by picking a random name. You can generate your own function that does that for you.
pksccbt on March 4, 2020
Yes I had set my region. It is region = us-east-2