0
0
GCPcloud~15 mins

Object versioning in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Enable Object Versioning on a Google Cloud Storage Bucket
📖 Scenario: You are managing files in a Google Cloud Storage bucket for a small company. To protect against accidental deletion or overwriting of files, you want to enable object versioning on the bucket. This way, older versions of files are kept automatically.
🎯 Goal: Enable object versioning on an existing Google Cloud Storage bucket using the Google Cloud SDK (gcloud) commands and configuration.
📋 What You'll Learn
Use the exact bucket name my-company-data
Enable object versioning on the bucket
Verify the versioning status in the bucket configuration
Use gcloud commands and configuration files
💡 Why This Matters
🌍 Real World
Object versioning helps protect important files from accidental deletion or overwrites by keeping older versions automatically.
💼 Career
Cloud engineers and administrators often enable versioning on storage buckets to ensure data durability and recovery options.
Progress0 / 4 steps
1
Create a Google Cloud Storage bucket named my-company-data
Use the gcloud command to create a new storage bucket called my-company-data in the us-central1 region.
GCP
Need a hint?

Use gcloud storage buckets create with the bucket name and location flags.

2
Set a variable for the bucket name
Create a shell variable called BUCKET_NAME and assign it the value my-company-data.
GCP
Need a hint?

Use BUCKET_NAME=my-company-data to set the variable.

3
Enable object versioning on the bucket
Use the gcloud command to enable object versioning on the bucket using the variable BUCKET_NAME.
GCP
Need a hint?

Use gcloud storage buckets update $BUCKET_NAME --versioning=enabled to enable versioning.

4
Verify that object versioning is enabled
Use the gcloud command to describe the bucket $BUCKET_NAME and confirm that versioning is enabled by checking the output for versioning.enabled: true.
GCP
Need a hint?

Use gcloud storage buckets describe $BUCKET_NAME and look for versioning.enabled: true in the output.