Connecting Snowflake to GCP

Snowflake Wiki
4 min readFeb 20, 2022

Here is the step by step guide for beginners to connect Snowflake with GCS bucket using storage integration. The snowflake documentation currently is not updated with the new GCP screens and if you are confused there, you are at a right place here.

Snowflake — GCP Integration

1)Login to GCP account

2) Select the project you need to work on

3) Create a bucket and upload the files

3a) Go to Cloud Cloud Storage » Browser

3b) Create a bucket by using either of the highlighted option

3c) Pick a name that is unique globally following the naming guidelines and continue with the default options following it and create a bucket.

3d) Create a folder in the bucket that is created and upload the files in it.

4) Create a custom role and grant the permissions required to access the bucket.

4a) From the home dashboard, choose IAM & admin » Roles

4b) Click Create Role

4c) Enter a Title and ID for the custom role.

4d) C lick Add Permissions and filter permissions by role using key word ‘storage’ and select Storage Admin & Storage Object Admin

4e) Select the permissions based on the use case and add them and create

5) Configuring a Storage Integration

5a) Create a Storage Integration in Snowflake using the bucket and folder created in GCP — snowflaketraining/sftraining

5b) Execute the DESCRIBE INTEGRATION command to retrieve the ID for the Cloud Storage service account that was created automatically for your Snowflake account and note STORAGE_GCP_SERVICE_ACCOUNT value.

6) Connecting Snowflake and GCP

6a) Log into the Google Cloud Platform Console back from the home dashboard, choose Storage » Browser. Select the bucket created in GCP and click SHOW INFO PANEL in the upper-right corner.

6b) Click on ADD PRINCIPAL and

6c) Provide the STORAGE_GCP_SERVICE_ACCOUNT value noted in the step 5b) and select the custom role created in 4e) and save it.

6d) Snowflake and GCP are connected

7) Create a stage in Snowflake using the storage integration and list the stage to validate a successful connection. We can observe the same files uploaded into the bucket.

References: https://docs.snowflake.com/en/user-guide/data-load-gcs-config.html

Clap if you like the content and feel free to ask if you have any questions in the comments. I will be more than happy to assist and guide you.

--

--

Snowflake Wiki

Snowflake Basics | Features | New releases | Tricks & Tips | SnowPro Certifications | Solutions | Knowledge Sharing | ~~~ By satitiru (Snowflake DataSuperHero)