cloud-foundation-fabric/modules/bigquery/README.md

3.8 KiB

Google Cloud Bigquery Module

Simple Bigquery module offering support for multiple dataset creation and access configuration.

The module interface is designed to allow setting default values for dataset access configurations and options (eg table or partition expiration), and optionally override them for individual datasets. Common labels applied to all datasets can also be specified with a single variable, and overridden individually.

Access configuration supports specifying different identity types via the identity_type attribute in access variables. The supported identity types are: domain, group_by_email, special_group (eg projectOwners), user_by_email.

Example

module "bigquery-datasets" {
  source     = "./modules/bigquery"
  project_id = "my-project
  datasets = {
    dataset_1 = {
      name        = "Dataset 1."
      description = "Terraform managed."
      location    = "EU"
      labels      = null
    },
    dataset_2 = {
      name        = "Dataset 2."
      description = "Terraform managed."
      location    = "EU"
      labels      = null
    },
  }
  default_access = [
    {
      role = "OWNER"
      identity_type = "special_group"
      identity = "projectOwners"
    }
  ]
  default_labels = {
    eggs = "spam",
    bar = "baz
  }
}

Variables

name description type required default
datasets Map of datasets to create keyed by id. Labels and options can be null. map(object({...}))
project_id Id of the project where datasets will be created. string
dataset_access Optional map of dataset access rules by dataset id. map(list(object({...}))) {}
dataset_options Optional map of dataset option by dataset id. map(object({...})) {}
default_access Access rules applied to all dataset if no specific ones are defined. list(object({...})) []
default_labels Labels set on all datasets. map(string) {}
default_options Options used for all dataset if no specific ones are defined. object({...}) ...
kms_key Self link of the KMS key that will be used to protect destination table. string null

Outputs

name description sensitive
datasets Dataset resources.
ids Dataset ids.
names Dataset names.
self_links Dataset self links.

TODO

  • add support for tables