Create a Bucket & Upload Objects: GUI
— Login to GCP Console:
— Go to Cloud Storage
— Bucket
— Create Bucket
- Name your bucket
Labels (optional)
- Choose where to store your data
Multi-region
Dual-region
Region
- Choose a default storage class for your data
— Standard
— Nearline
— Coldline
— Archive
- Choose how to Control access to Object
— Uniform
— Fine-grained
- Choose how to protect object data Protection Tools
— None
— Object Versioning
— Retention policy
- Data Encryption:
— Google Managed Encryption Key
— Customer Managed Encryption Key (CMEK)
— Create
Cloud Storage using Cloud shell:
— Open Cloudshell
— Select your Projects
$ ls -l $HOME
$ sudo rm -rf $HOME — Restart Cloudshell
- Create a Bucket
$ gcloud mb -b on -l us-east1 gs://gcp-buckets149/
$ gcloud
- Upload an object into your Bucket:
— Cloudshell
— Click on Tripple dot
— File
— Upload FIle
$ gsutil cp Raghav.png gs://gcp-buckets149
- Download the object from your bucket:
$ gsutil cp gs://gcp-buckets149/Raghav.png /home/gcpdec/download.png
- Copy the object to a folder in the bucket:
$ gsutil cp gs://gcp-bucket149/Raghav.png gs://gcp-bucket149/myfolder/New.png
- List Contents of a Bucket or Folders:
$ gsutil ls gs://gcp-bucket149
- List details for an object:
$ gsutil ls -l gs://gcp-bucket149/Raghav.png
- Make the Object Publicly Accessible:
$ gsutil iam ch allUsers:objectViewer gs://gcp-bucket149
$ gsutil iam ch -d allUsers:objectViewer gs://gcp-bucket149 (-d means not accessible in the internet, not to public)
- Delete an Object or Bucket:
$ gsutil rm gs://gcp-bucket149/Raghav.png
- Delete entire Bucket and it’s objects:
$ gsutil rm -r gs://gcp-bucket149
🙏 thanks
ConversionConversion EmoticonEmoticon