What’s Google Cloud Storage?

Google Cloud Storage is an online file storage service. It allows storing and accessing data on the Google Cloud Platform infrastructure.

This service stores objects which are organized into buckets. Here, an object means a document and can be anything like an image, zip, PDF, spreadsheet, etc.

Storing your important files in the cloud is always recommended. On the cloud, your documents will remain safe and up 99.99% of the time.

When it comes to integration, you’ll have to upload your files programmatically on Cloud Storage. Google Cloud Storage provides a RESTful service through which you can upload files on the Cloud. To establish a bridge between your application and the Cloud service you’ll require to create a service account. This account is used for authentication purposes.

Creating a Service Account

Below are the steps to create your service account on the Google Cloud. At the end of the steps, you will get the JSON file containing the credentials required for authentication.

Create a service account:

In the Cloud Console, go to the Create service account page.

Select/Create a project.
In the Service account name field, enter a name. The Cloud Console fills in the Service account ID field based on this name. To the Service account description field, provide a description.
Click Create.
Click the Select a role field. Under Quick access, choose Basic and then the Owner.
Click Continue.
Click Done to finish creating the service account.
Create a service account key:
In the Cloud Console, click the email address for the service account that you created.
Click Keys.
Click Add key and then Create a new key.
Click Create which will download a JSON key to your computer.
Click Close.
The next important step is – on your Google project enable the Cloud Storage API from the API library section.

Create a Bucket on Google Cloud Storage

Google Cloud Storage keeps all documents inside the bucket. While creating a bucket on Google Cloud, you have to follow certain naming guidelines. The below points should be considered when you create a bucket.

  • Bucket names must contain only lowercase letters, numbers, dashes, underscores, and dots. Spaces are not allowed.
  • Bucket names must start and end with a number or letter.
  • Bucket names must contain 3-63 characters. Names containing dots can contain up to 222 characters, but each dot-separated component can be no longer than 63 characters.
  • Bucket names cannot be represented as an IP Address in dotted-decimal notation.
  • Bucket names cannot begin with the “goog” prefix.
  • Bucket names cannot contain “google” or close misspellings, such as “g00gle”.