Creating S3 bucket and uploding files to it by using boto3 module with the help of Python....
AWS Configure :
( enter your aws access key id,
aws secret access key,
region name(ap-south-1),
output format(json) )
import boto3 #import boto3
resource = boto3.resource('s3') #select resource (s3)
bucket = resource.Bucket("new-bucket-name") #giving name to the bucket.
bucket_properties = bucket.create(
ACL='private',
CreateBucketConfiguration={'LocationConstraint':'eu-central-1'}
)
print(bucket_properties)
print("Bucket created successfully......!")
import boto3
resource = boto3.client('s3')
resource.upload_file(
Filename='file_1.png',
Bucket='Bucket_Name',
key='save_1.png'
)
print("File Uploaded to your S3 Bucket Successfully")