Skip to Content
Google Cloud Platform for Developers
book

Google Cloud Platform for Developers

by Ted Hunter, Steven Porter
July 2018
Intermediate to advanced
506 pages
16h 2m
English
Packt Publishing
Content preview from Google Cloud Platform for Developers

Creating and using a bucket

Let's go ahead and create our first bucket using gsutil. Because all bucket names must be unique in a global namespace, we need to first generate a bucket name that doesn't exist in any other project. As we covered earlier, for complex systems that generate many bucket names, a preferred mechanism is to incorporate a random component into the bucket's name. For our purposes, a small amount of randomization should suffice.

When interacting with Cloud Storage from most tools, the protocol prefix gs:// is used to denote that a given path resides in Cloud Storage. From within the Cloud Shell, execute the following command to generate a unique bucket name:

export BUCKET_NAME=gs://hello-cloud-storage-$RANDOM

With a unique ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google Cloud Platform in Action

Google Cloud Platform in Action

John J. (JJ) Geewax
Google Cloud Platform for Architects

Google Cloud Platform for Architects

Vitthal Srinivasan, Loonycorn Ravi, Judy Raj

Publisher Resources

ISBN: 9781788837675Supplemental Content