Developing AWS S3 applications – UnixÂ
Python provides a package called boto3 that can be used to access the AWS services. We will perform the same operations on the S3 service as we did using the Windows C3 SDK. Let's begin by creating an S3 bucket using Python.Â
Creating a bucket
A simple example of creating an S3 bucket using Python is as follows. We first import the boto3 Python library in our application and then create an object of type S3. Then, using this object, we simply invoke the create_bucket()
function and pass the name of the bucket to be created. The Bucket
parameter of the create_bucket()
function is mandatory. There are other parameters that are used to set the properties of the bucket such as permissions, region, and so on.Â
The following is the simplest implementation of the boto3
library, which will create a bucket named packt-pub-bucket
:Â
import boto3 s3 = boto3.resource('s3') s3.create_bucket(Bucket='packt-pub')
Notice that we created an S3 bucket by writing only three...