March 2019
Beginner
490 pages
12h 40m
English
In this section, we are going to write a script that will enable us to interact with the service and create a bucket with the S3 API. To create a bucket, you'll need to use the requests_aws4auth package and the aws4auth method with your AWS credentials, <ACCESS_ID> and <ACCESS_KEY>. Also, you need to specify the <REGION> with the AWS region of your choice:
>>> import requests>>> import requests_aws4auth>>> auth = requests_aws4auth.AWS4Auth('<ACCESS_ID>', '<ACCESS_KEY>', 'eu-west-2', 's3')
Whenever we write a client for an API, our main point of reference is the API documentation. The documentation tells us how to construct the HTTP Requests for performing operations.
http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUT.html ...
Read now
Unlock full access