This guide will walk you through integrating Common Fate with BigQuery. At the end of this guide you’ll have a functioning integration with Common Fate reading your dataset inventory and provisioning access to BigQuery data.
Prerequisites
If you’re running a BYOC (“Bring-Your-Own-Cloud”) deployment of Common Fate in your own AWS account, you’ll need to be on v1.38.0 or later of the common-fate/common-fate-deployment/aws Terraform module.
To provision access to BigQuery, the Common Fate provisioner role needs the following additional permissions:
bigquery.tables.getIamPolicy
bigquery.tables.setIamPolicy
bigquery.datasets.getIamPolicy
bigquery.datasets.setIamPolicy
If you used our reference integration Terraform module to deploy the GCP roles, you can add these permissions by providing the permit_bigquery_provisioning variable:
Configuring Common Fate
To grant and revoke access to BigQuery, add the following Provisioner registration inside your Application Configuration repository:
Just-In-Time access to BigQuery Datasets
To make BigQuery datasets available for Just-In-Time (JIT) access you can add a commonfate_gcp_bigquery_dataset_selectorSelector resource to your Common Fate application Terraform code. As shown below, the when clause in the resource is a Cedar expression. You can use any Cedar operator in the when clause, such as && and || to combine conditions.
You’ll need to use the commonfate_bigquery_dataset_selector in conjunction with a commonfate_bigquery_dataset_availabilities and commonfate_access_workflow resources.
We’ve included some examples below.
Select a dataset by ID
Select multiple datasets by ID
Select datasets based on a naming pattern
Select datasets with a name ending in -prod:
Select datasets with a name beginning with develop:
Select datasets in a particular project
Select datasets in a particular folder
Just-In-Time access to BigQuery Tables
To make BigQuery tables available for Just-In-Time (JIT) access you can add a commonfate_gcp_bigquery_table_selectorSelector resource to your Common Fate application Terraform code. As shown below, the when clause in the resource is a Cedar expression. You can use any Cedar operator in the when clause, such as && and || to combine conditions.
You’ll need to use the commonfate_gcp_bigquery_table_selector in conjunction with a commonfate_bigquery_table_availabilities and commonfate_access_workflow resources.