Cloud Storage Basics

You need an All Access Membership on GCP Study Hub to access labs. Click here to purchase if you don't have one.

Lab Introduction

In this lab, you'll learn how to create a Cloud Storage bucket in Google Cloud Platform and upload files to it. Cloud Storage buckets are containers for storing objects (files) in the cloud with high durability and availability.

Requirements to Pass This Lab

Before You Begin

Step 0: Authentication

How this works: You need a Google account that uses the same email address as your GCP Study Hub account. When you sign into that Google account, the system will be able to grant you temporary access to a GCP project when you start the lab.

Click the button below to start your lab:

Start Lab

Instructions

Step 1: Open Google Cloud Console

Once your lab starts, use the "Open Lab in GCP Console" button from the lab portal to open the Google Cloud Console with your temporary lab project already selected.

Step 2: Navigate to Cloud Storage

  1. In the left navigation menu, click on the hamburger menu (three horizontal lines)
  2. Scroll down and find Cloud Storage
  3. Click on Buckets

Alternatively, you can search for "Cloud Storage" in the search bar at the top.

Step 3: Download Sample File

First, download the sample text file to your computer that you'll upload to your bucket.

  1. Click the button below to download the sample file (1 KB):
Download Sample File

Note: The file will be saved to your Downloads folder. Remember where it's located - you'll need it in Step 8!

Step 4: Create a New Bucket

  1. Click the CREATE button at the top of the page
  2. You'll see a form with several configuration options

Step 5: Configure Your Bucket Name

  1. Enter a name that starts with: gcp-lab-bucket
  2. You can add a unique suffix, for example: gcp-lab-bucket-12345
  3. Bucket names must be globally unique across all of Google Cloud
  4. If you get an error that the name is taken, add more unique characters to the end

Step 6: Choose Location Settings

  1. Select Region for location type
  2. Choose us-central1 (Iowa) from the dropdown

This lab requires us-central1 specifically, and the checker will verify it. Location cannot be changed after a bucket is created, so if you pick the wrong one you will need to delete the bucket and start again.

Your lab project also sits under an organization policy that limits which regions can be used at all. Real companies do this for cost and data residency reasons, and it is why some regions you might expect to see are unavailable.

Step 7: Complete Bucket Creation

  1. For storage class, leave as Standard (default)

    Before you move on, click Nearline, Coldline and Archive one at a time and watch the price change in the "Good to know" panel on the right. Archive stores data for a fraction of what Standard costs, but colder classes charge more to read your data back, and bill a minimum storage duration whether you keep the file that long or not. That's why Standard is the right default for data you're actively using. Set it back to Standard before continuing.

  2. For access control, leave the default settings
  3. Skip the optional protection tools for now
  4. Review your settings:
    • Name starts with gcp-lab-bucket
    • Location is us-central1
  5. Click CREATE at the bottom of the form
  6. A dialog appears titled "Public access will be prevented". This is expected. It confirms that your bucket won't be reachable from the internet, which is what you want
  7. Leave "Enforce public access prevention on this bucket" checked and click CONFIRM
  8. Wait a few seconds for the bucket to be created

Your bucket is not created until you click CONFIRM. If you clicked CREATE and nothing seems to be happening, look for this dialog. It's the most common place people get stuck.

Step 8: Upload the Sample File to Your Bucket

  1. After your bucket is created, click on the bucket name to open it
  2. Click the UPLOAD FILES button
  3. Navigate to your Downloads folder and select the sample_upload_file.txt file you downloaded in Step 3
  4. Wait for the upload to complete
  5. You should see sample_upload_file.txt listed in the bucket

Tip: You can also drag and drop the file directly into the browser window to upload it.

Step 9: Organize Objects with Folders

Real projects put thousands of objects in one bucket, so you need a way to organize them. Cloud Storage lets you create folders, but they don't work the way folders on your computer do.

  1. In the Objects tab of your bucket, click Create folder
  2. Read the note in the dialog before you do anything else. It says: "Cloud Storage uses a flat namespace, so uploading objects to a folder simply appends a path prefix to object names."
  3. Enter folder1 for the name and click Create
  4. Look at how it appears in the list. The name is folder1/ with a trailing slash, the Type column says Folder, and Size, Created and Last modified are all blank
  5. Click folder1/ to open it, then click UPLOAD FILES and upload sample_upload_file.txt again
  6. Click the uploaded file to open its Object details page
  7. Find the Cloud Storage URI row. It reads gs://your-bucket-name/folder1/sample_upload_file.txt

What just happened: there are no folders in Cloud Storage. Every bucket is one flat list of objects. What you created was a placeholder, and the file you uploaded is a single object whose name is folder1/sample_upload_file.txt. The slash is just a character in the name. The console reads those slashes and draws a folder tree so it feels familiar, but nothing underneath is nested.

This matters when you start scripting against Cloud Storage. Tools filter objects by name prefix, not by directory, which is why the object list has a Filter by name prefix only option rather than a folder picker.

Validate Your Work

Get Your Completion Token

Click the button below to open the lab checker in a new window. Sign in with Google to verify your work and get your completion token.

Open Lab Checker

Submit Your Token

Paste your token below and click Validate. If valid, a button will appear to mark the lesson complete.


            
            
        

What You Learned

Troubleshooting

Validation Fails

If your validation fails, check that: