Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hybrid Cloud for Developers

You're reading from   Hybrid Cloud for Developers Develop and deploy cost-effective applications on the AWS and OpenStack platforms with ease

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788830874
Length 280 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Manoj Hirway Manoj Hirway
Author Profile Icon Manoj Hirway
Manoj Hirway
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Introducing Hybrid Clouds FREE CHAPTER 2. Exploring AWS Cloud 3. Exploring OpenStack Private Cloud 4. Developing AWS Cloud Applications 5. Developing OpenStack Applications 6. Cloud Migration 7. Hybrid Cloud Best Practices 8. Monitoring and Troubleshooting Hybrid Cloud 9. Hybrid Cloud Security 10. Other Books You May Enjoy

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime