...
Log into Snowflake using this URL: https://snaplogic.snowflakecomputing.com/console
Create a Snowflake Storage Integration Object. For example,
create storage integration JOHN_GCS_STORAGE_INTEGRATION1
type = external_stage
storage_provider = gcs
enabled = true
storage_allowed_locations = ('gcs://johnsnowflake1/', 'gcs://johnsnowflake2/');
Describe the Snowflake storage integration object to get the GCP Service Account.
desc integration JOHN_GCS_STORAGE_INTEGRATION;
Create a Custom Role.
Navigate to IAM & Admin > Roles > CREATE ROLE
Create a role with the an appropriate name and add the following permissions:
firebase.projects.get
resourcemanager.projects.get
storage.buckets.create
storage.buckets.delete
storage.buckets.get
storage.buckets.getIamPolicy
storage.buckets.list
storage.buckets.setIamPolicy
storage.buckets.update
storage.objects.create
storage.objects.delete
storage.objects.get
storage.objects.getIamPolicy
storage.objects.list
storage.objects.setIamPolicy
storage.objects.update
Provide permission on the Google Cloud Storage bucket to the Snowflake GCP Service Account.
Add the GCP service user and the custom role you have just created.
Bulk load the data to Snowflake.
COPY INTO "PUBLIC".JOHN_EMP2
FROM 'gcs://johnsnowflake1/data/'
FILES = ( 'john_emp1.csv' )
FILE_FORMAT = (TYPE = CSV SKIP_HEADER = 1)
STORAGE_INTEGRATION = JOHN_GCS_STORAGE_INTEGRATION;
Unload the data from Snowflake table to a GCS location:
copy into 'gcs://johnsnowflake1/unload/'
from "PUBLIC".JOHN_EMP2
storage_integration = JOHN_GCS_STORAGE_INTEGRATION
file_format = (format_name = snap_csv_format);
...
https://docs.snowflake.com/en/sql-reference/sql/create-storage-integration.html https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438252/Configuring%2BSnowflake%2BAccounts#SnowflakeAccount
...