Steps to Create GCP Bucket Using CLI
Step 1: Activate Cloud Shell by clicking Cloud Shell on the GCP console.
Authorize to cloud shell by clicking the authrozie as shown image below.
Step 2: Verify the gcloud installed or not using the below command. If gcloud is not installed you can install the gcloud by following the link.
Step 3: Click on below command and authorize your project
gcloud auth login
Step 4: Aftre authorization click on below command and the bucket is created.
gsutil mb -p PROJECT_ID -c STORAGE_CLASS -l LOCATION gs://BUCKET_NAME
Enter your real values in the replacements:
- PROJECT_ID: Your GCP project Id.
- STORAGE_CLASS: The bucket’s storage class (standard, nearline, coldline, etc.).
- LOCATION: The location for the bucket (e.g., us-central1, europe-west1).
- BUCKET_NAME: The name for your bucket.
Google Cloud Platforms (GCP) provides gsutil, a command-line tool for dealing with the Google Cloud Storage (GCS). It enables you to use your terminal or command prompt to carry out a number of tasks, include upload, download, copy, and deleting the files in GCS buckets. You can efficiently handle your cloud storage resources with gsutil without utilize the GCP Console interface.
Step 5: Vrify the bucket is created. Click on Storage and click on buckets.
Step 6: Below image refers the bucket is created on GCP
How To Create GCP Bucket Using CLI ?
Users can store and manage their data in the cloud with Google Cloud Storage (GCS), the service is provided by the Google Cloud Platform (GCP). Having the big virtual hard drive to store files, documents, photos, movies, and other media is similar to that.
Within Google Cloud Storage, a bucket refers to a folder or container where you can group and store your data. The bucket can store a lot of data and has a special name. Using buckets, you may manage file access and storage. They also offer features like versioning, lifecycle management, and access control to help you manage your data efficiently.