Create GCS Bucket



Creating bucket using gsutil



Let us see how to create the bucket using command-line utility as we already know how to create the bucket using the web console. Please refer to this link to have look at the bucket creation through web console if you not covered the previous post.

Set the project if not already configured.

gcloud config set project <project-id>

gsutil mb -c nearline -l asia gs://datacloudies-bkt-gsutil

mb stands for make bucket
-c class type
-l location 
-p project ID. If the project ID field is skipped, it chooses the default project. 


gsutil ls - will list down the created bucket. 


Changing the storage class of the existing bucket


Well, Next we will see how to change the storage class of the existing bucket. The below essential directives are very important to keep in mind, and also the changes will only affect the new objects in the bucket. Existing objects would still use the older class type. 

Multi-Regional buckets can not be changed to Regional and vice versa. 

Coldline buckets can be changed to Regional or Multi-Regional. 

Nearline buckets can be changed to Regional or Multi-Regional

Coldline buckets can be changed to Nearline and vice versa. 

Changing the class through the web console


Go to the selected bucket, select the default storage class from the Edit bucket. Change the storage class to the desired type and save the changes.


Changing the class through command-line


Let us change the standard class to nearline for the below object,





gsutil rewrite -s nearline gs://datacloudies-bucket1/utlu112i.sql


Verify the changes in the console






That is it. We have successfully changed the class type in the GCS bucket. Let us move on to the next posts for learning more services. 




Recent Posts

  • Cloud SQL
    What is Cloud SQL  It is a fully managed relational database service for PostgreSQL and MySQL database in the GCP. MySQL instance can be...
    May 17 2020 | Read more
  • Deploy an application to Google Kubernetes Engine
    Welcome back, this is the continuation post of the previous article, where we have discussed the Kubernetes and its concepts in detail. In this...
    May 13 2020 | Read more
  • Google Kubernetes Engine
    What is GKE? GKE is a managed, production-ready environment for deploying containerized applications. It is like a managed cargo container in...
    May 13 2020 | Read more
  • Google App Engine – Flexible
    In the previous article, we have discussed what is google app engine and how to deploy the application in the Google app engine – Standard. In...
    May 10 2020 | Read more