Google Cloud Storage
This page describes how to use Census with Google Cloud Storage.

Prerequisites

Step 1: Create a Google Cloud Storage Connection

Our Google Cloud connector behaves a little differently than other Census connectors. Instead of going through an OAuth connection flow, we provide you a Google Identity address to which you grant Storage Object permissions.
  • In Census, navigate to Connections​
  • Click the Add Service button, and select Google Cloud Storage
  • Paste the name of the GCS bucket, name the connection, and click the Save Connection button
  • Don't be discouraged by this initial "Test Connection" failing! This is expected.
  • Your new Google Cloud Storage connection will include a GCP service account for that specific Census connection. Click the copy button (
    ) to save it to your clipboard.

Step 2: Grant Access to GCS

  • Now head to the Google Cloud Storage bucket that you want to sync to, and click into that bucket's details.
  • Click the Permissions tab on the Bucket, then click "Add Permissions".
  • Paste the credentials in the New Principals portion and select "Storage Object Admin."
You will be able to send a successful sync if the file path variables are unique per sync run by only granting this service account "Storage Object Creator", but the Test Connection in the next step will fail.
  • Click save to save the permission.
  • Then navigate back to the Connections page and click "Test" on the service.
You are good to go!
πŸŽ‰
​

Step 3: Create your first sync

The sync will move data from your warehouse to your GCS bucket. In this step, you'll define how that will work.
  1. 1.
    From inside your Census account, navigate to the Syncs page and click Add Sync.
  2. 2.
    Under What data do you want to sync?, choose your data warehouse as the Connection and your source: either a Model from the Census Models tab or a database table.
  3. 3.
    Under Where do you want to sync data to?, choose the name you assigned in Step 1 (we used GCS) as the Connection. Enter the File Path for the CSV file where data will sync. The path can accept variables that will populate when the sync runs. See File Path Variables. Confirm the file path in the Template Preview field.
    ​
    πŸ’‘
    If the service account only has "Storage Object Creator" permissions, this file path needs to be unique per sync run
  4. 4.
    Under How should changes to the source be synced?, Mirror will be automatically selected. This is the only supported sync behavior for GCS.
  5. 5.
    Under Which properties should be updated?, choose whether to sync only Selected Properties or Sync All Properties. Syncing all properties will automatically add new properties to the sync if the model or database table changes.
  6. 6.
    To test your sync without actually syncing data, click Run Test and verify the results.
  7. 7.
    Click the Next button to see the final preview which will have a recap of what will happen when you start the sync. If you're happy, check the Sync Now checkbox and save the sync.
  8. 8.
    Confirm the data arrives in the GCS bucket!
If you need any help configuring GCS, contact the Census support team to get some help.

File path variables

When defining the File Path for an GCS sync, you can use variables that will be set when the sync runs. This allows you to create and sync to new CSV files in the GCS bucket that reflect the date and time of the sync.
Variable
Description
Example Values
%Y
4-digit year
1997
%y
2-digit year
97
%m
month with zero padding
07, 12
%-m
month without zero padding
7, 12
%d
day with zero padding
03, 23
%-d
day without zero padding
3, 23
%H
24 hour with zero padding
08, 18
%k
24 hour without zero padding
8, 18
%I
12 hour with zero padding
08, 12
%l
12 hour without zero padding
8, 12
%M
minute with zero padding
04, 56
%S
second with zero padding
06, 54

πŸ”„ Supported sync behaviors

Behavior
Supported
Objects
Mirror
βœ…
All
Learn about all of our sync behaviors in Core Concepts.
​Let us know if you want Census to support additional sync behaviors for Google Cloud Storage.

πŸ’‘ Things to know

  • Currently, the connector only supports syncing for files up to 5GB.
  • Data arrives in one file to the designated bucket and file path.
  • Files are written as a CSV with headers.
​Contact us if your use cases don't work with these limitations. We plan on addressing at least a few of these in the future!

πŸš‘ Need help connecting to Google Cloud Storage?

You can send our support team an email at [email protected] or start a conversation from the in-app chat.
Last modified 26d ago