GCP (Google Cloud Platform)

Integrating Google Cloud Platform (GCP) with Suite

Below is a step-by-step guide on how to integrate your GCP account with Suite.

Why should I Integrate GCP to Suite?

1. Easier, Faster Data Upload

Once GCP is integrated with Suite, you can access your data stored on a GCP bucket on Suite, without having to manually download and upload them.

2. Enhanced Data Security

You may add another layer of data security by only allowing read-only access to your buckets and data assets. When you turn this option on, the data remains within your storage and we don't create any copy of your data.

  • Google Storage integration is currently limited to image data only. Support for video data is coming soon.

Pre-requisites

Before getting started with GCP Integration, you must go through the following tasks on your GCP account.

  1. Create or have access to an Administrator account for Google Cloud Platform.

  2. Install or have access to the gsutil tool, so you can configure CORS settings.

Table of Contents

This tutorial will proceed in the following steps:

Configuring the Google Cloud Platform

  1. Creating a GCP Service Account

  2. Creating a GCP Service Account Key

  3. Adding authority/permission to your bucket

  4. Attaching a CORS policy to the bucket

Integrating GCP with Suite

  1. Where to find the GCP Integration setting page

  2. Configuring the GCP Integration

Now, let's get started! Please follow the step-by-step tutorial below.

Tutorial

Configuring the Google Cloud Platform

1. Creating a GCP Service Account

1.1. Go to IAM & Admin → Service Accounts menu on the GCP console.

1.2. Click on the Create Service Account button and fill in the required fields to create an account.

  • ① Service account details

    • Service account name (required)

    • Service account ID (auto-generated / configurable)

    • Service account description (optional)

  • ② Grant this service account access to project (optional)

  • ③ Grant users access to this service account (optional)

2. Creating a GCP Service Account Key

2.1. Click on the Service Account you just created and go to the Keys tab. 2.2. Click on the ADD KEY button → Click on the Create new key button. 2.3. Choose JSON as the key type and click on the Create button to download the private key certificate.   Make sure you know where you save this key file as it'll be used in the steps below.

3. Adding permission to bucket

3.1. Copy Service Account Email you created.

3.2. Go to Browser menu, and select your GCP bucket that you want to integrate with Suite.

3.3. Go to the Permission tab and click on the ADD button to add Permissions.

  • Paste the Service Account Email address you copied above into the "New members" field.

  • Select these two roles below from the "Select a Role" dropdown menu.

    • Storage Legacy Bucket Reader

    • Storage Legacy Object Reader

    ❗ To use GCP Integration as read-only for enhanced data security, only the "Reader" roles must be selected.

4. Attaching a CORS policy to the bucket

You need to attach a CORS Policy to your bucket so that data can be displayed on Suite when accessing the bucket with read-only permission. This is probably the most technical step of the tutorial!

There are multiple ways to attach a CORS policy to the bucket. - gsutil command-line tool - XML API - JSON API - Client libraries for Cloud Storage In this tutorial, we'll cover how you can use the gsutil command-line tool. You can refer to this official document from GCP for more information about the other methods.

4.1. Creating a JSON file that contains the CORS configuration (Follow the instructions for your operating system)

4.1.1. Mac OS

  • Option 1) Create a JSON file using the following command on Terminal.

echo '[{"method": ["GET", "HEAD"], "origin": ["*"], "responseHeader": ["Content-Type"]}]' > cors.json
  • Option 2) You can also choose to create a file named "cors.json", paste the following code block and save it.

[
{
"origin": [
"*"
],
"method": [
"GET",
"HEAD"
],
"responseHeader": [
"Content-Type"
],
"MaxAgeSeconds": 3000
}
]

4.1.2. Windows OS

  • Open up a new Windows notepad, paste in the following code block and save it as "cors.json".

[
{
"origin": [
"*"
],
"method": [
"GET",
"HEAD"
],
"responseHeader": [
"Content-Type"
],
"MaxAgeSeconds": 3000
}
]

4.2. Running gsutil

4.3. Updating the CORS settings for your bucket

  • Run the following command on your terminal.

gsutil cors set JSON_FILE_NAME gs://BUCKET_NAME
  • JSON_FILE_NAME : The directory of the CORS configuration JSON file you just created above.

    ex. C:\Users\pc\Downloads\cors.json

  • BUCKET_NAME : The name of your GCP bucket you'll integrate

    ex. bucket-hello-superbai

4.4. Checking the CORS setting

  • This is the last step of the CORS configuration. Enter the following command to complete the process.

gsutil cors get gs://BUCKET_NAME
  • BUCKET_NAME : This is the name of your GCP bucket that will be used for your integration. ex. bucket-hello-superbai

Congrats! You're almost there — just a few more easy steps to finish the GCP integration.

Integrating GCP with Suite

1. Where to find the GCP Integration settings page

1.1. After logging into Suite, go to My Account → Integrations menu, and click on Google Cloud Storage.

1.2. Click on the Add button.

2. Configuring the GCP Integration

2.1. Integration Name

  • Enter a name for this Integration. Later when you upload data from your GCP bucket, you will select this name from the list of integrations.

2.2. Google Storage Bucket Settings

  • GCP Bucket Name

    You must enter in the correct name of the GCP bucket that you would like to integrate. Clicking on the bucket button will direct you to see the list of buckets within your account.

  • Folder (Optional)

    If you wish to integrate with a specific folder within your bucket, enter the name of the folder.

    • Only the files within the particular folder will be accessible via integration.

    • You can skip this step to access every folder in the bucket.

2.3. Configuring the Service Account JSON

  • Copy and paste the GCP Service Account Key that you have downloaded in JSON format.

  • Click on the Save Integration button and now, your GCP integration is complete!

WOW! You've completed the GCP Integration! You can now quickly upload and access data on your GCP via Superb AI Suite.