hands-on lab

Host a Static Website Using a Cloud Storage Bucket and Cloud CDN

Difficulty: Beginner
Duration: Up to 45 minutes
Students: 787
Rating: 4.4/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Google Cloud Storage is one of the most used GCP services. It allows users to create buckets and store objects into them. Because a static website is composed of simple HTML, CSS, and JavaScript files, you can upload them into a cloud storage bucket and serve your static website from a single storage bucket. Using a cloud storage bucket for serving your website is a good choice instead of using a server because it allows you to deep-handle the security of the objects you upload, it allows you not to have a standard monthly fee but you only pay for the storage spaces you are using, and you can distribute your content within a single region, dual-region, or multi-region. In this lab, you will create a regional cloud storage bucket and you will upload the files of your static website to it. You will then create a load balancer and a CDN distribution to be able to have an efficient caching and file serving approach.

Learning Objectives

Upon completion of this lab you will be able to:

  • Create a storage bucket and upload files to it
  • Make the objects inside the bucket publicly accessible
  • Define a load balancer to balance the traffic to your bucket
  • Create a CDN that points to the load balancer

Intended Audience

This lab is intended for:

  • Google Cloud Professional Cloud Developer (PCD) certification candidates
  • Individuals who want to improve their skills in content delivery solutions
  • Solutions architects who want to host static websites and globally delivery them

Prerequisites

This lab has no prerequisites.

Updates

April 15th, 2024 - Updated the instructions and screenshots to reflect the latest UI

February 24th, 2022 - Updated the instructions and screenshots to reflect the latest UI

Environment before

Environment after

Covered topics

Lab steps

Signing In to the Google Cloud Console
Creating a Cloud Storage Bucket from the Console
Uploading the Website Files to the Bucket
Granting Public Access to Your Website's Files
Creating a Load Balancer and Associating a CDN Distribution
Testing the Functionality of the Website