This module allows you to create opinionated Google Cloud Platform BigQuery datasets and tables. This will allow the user to programmatically create an empty table schema inside of a dataset, ready for loading. Additional user accounts and permissions are necessary to begin querying the newly created table(s).
The current version is 1.X. The following guide is available to assist with upgrades:
Examples of how to use this module are located in the examples directory
This module provisions a dataset and a table with an associated JSON schema.
Name | Description | Type | Default | Required |
---|---|---|---|---|
dataset_id | Unique ID for the dataset being provisioned | string | n/a | yes |
dataset_labels | Key value pairs in a map for dataset labels | map(string) | n/a | yes |
dataset_name | Friendly name for the dataset being provisioned | string | n/a | yes |
description | Dataset description | string | n/a | yes |
expiration | TTL of tables using the dataset in MS | string | "3600000" |
no |
location | The regional location for the dataset only US and EU are allowed in module | string | "US" |
no |
project_id | Project wheree the dataset and table are created | string | n/a | yes |
tables | A list of objects which include table_id, schema, and labels. | object | <list> |
no |
time_partitioning | Configures time-based partitioning for this table | string | n/a | yes |
Name | Description |
---|---|
dataset_id | Unique id for the dataset being provisioned |
dataset_labels | Key value pairs in a map for dataset labels |
dataset_name | Friendly name for the dataset being provisioned |
dataset_project | Project wheree the dataset and table are created |
table_id | Unique id for the table being provisioned |
table_labels | Key value pairs in a map for table labels |
table_name | Friendly name for the table being provisioned |
- Terraform 0.12.x
- terraform-provider-google plugin v2.5.0
In order to execute this module you must have a Service Account with the following roles:
- roles/bigquery.dataOwner
A helper script for configuring a Service Account is located at (./helpers/setup-sa.sh).
Be sure you have the current Terraform version (0.12.x), you can choose the binary from Terraform releases.
To set this up on your machine, follow the official Kitchen installation instructions.
- Kitchen tests are located: test/integration/full.
- Terraform fixtures are located: test/fixtures/full.
cd /path/to/terraform-google-bigquery
The following command will run all tests for the module:
make
To run kitchen tests on macOS > 10.14.4 xcode will need to be reset
xcode-select --install