在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):terraform-google-modules/terraform-google-bigquery开源软件地址(OpenSource Url):https://github.com/terraform-google-modules/terraform-google-bigquery开源编程语言(OpenSource Language):HCL 73.8%开源软件介绍(OpenSource Introduction):terraform-google-bigqueryThis 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). CompatibilityThis module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+. If you find incompatibilities using Terraform >=0.13, please open an issue. If you haven't upgraded and need a Terraform 0.12.x-compatible version of this module, the last released version intended for Terraform 0.12.x is v4.5.0. UpgradingThe current version is 4.X. The following guides are available to assist with upgrades: UsageBasic usage of this module is as follows: module "bigquery" {
source = "terraform-google-modules/bigquery/google"
version = "~> 4.4"
dataset_id = "foo"
dataset_name = "foo"
description = "some description"
project_id = "<PROJECT ID>"
location = "US"
default_table_expiration_ms = 3600000
tables = [
{
table_id = "foo",
schema = "<SCHEMA JSON DATA>",
time_partitioning = {
type = "DAY",
field = null,
require_partition_filter = false,
expiration_ms = null,
},
range_partitioning = null,
expiration_time = null,
clustering = ["fullVisitorId", "visitId"],
labels = {
env = "dev"
billable = "true"
owner = "joedoe"
},
},
{
table_id = "bar",
schema = "<SCHEMA JSON DATA>",
time_partitioning = null,
range_partitioning = {
field = "customer_id",
range = {
start = "1"
end = "100",
interval = "10",
},
},
expiration_time = 2524604400000, # 2050/01/01
clustering = [],
labels = {
env = "devops"
billable = "true"
owner = "joedoe"
}
}
],
views = [
{
view_id = "barview",
use_legacy_sql = false,
query = <<EOF
SELECT
column_a,
column_b,
FROM
`project_id.dataset_id.table_id`
WHERE
approved_user = SESSION_USER
EOF,
labels = {
env = "devops"
billable = "true"
owner = "joedoe"
}
}
]
dataset_labels = {
env = "dev"
billable = "true"
}
} Functional examples are included in the examples directory.
Variable |
Name | Description | Type | Default | Required |
---|---|---|---|---|
access | An array of objects that define dataset access for one or more entities. | any |
[ |
no |
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) |
{} |
no |
dataset_name | Friendly name for the dataset being provisioned. | string |
null |
no |
default_table_expiration_ms | TTL of tables using the dataset in MS | number |
null |
no |
delete_contents_on_destroy | (Optional) If set to true, delete all the tables in the dataset when destroying the resource; otherwise, destroying the resource will fail if tables are present. | bool |
null |
no |
deletion_protection | Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the instance will fail | bool |
false |
no |
description | Dataset description. | string |
null |
no |
encryption_key | Default encryption key to apply to the dataset. Defaults to null (Google-managed). | string |
null |
no |
external_tables | A list of objects which include table_id, expiration_time, external_data_configuration, and labels. | list(object({ |
[] |
no |
location | The regional location for the dataset only US and EU are allowed in module | string |
"US" |
no |
materialized_views | A list of objects which includes view_id, view_query, clustering, time_partitioning, range_partitioning, expiration_time and labels | list(object({ |
[] |
no |
project_id | Project where the dataset and table are created | string |
n/a | yes |
routines | A list of objects which include routine_id, routine_type, routine_language, definition_body, return_type, routine_description and arguments. | list(object({ |
[] |
no |
tables | A list of objects which include table_id, schema, clustering, time_partitioning, range_partitioning, expiration_time and labels. | list(object({ |
[] |
no |
views | A list of objects which include view_id and view query | list(object({ |
[] |
no |
Name | Description |
---|---|
bigquery_dataset | Bigquery dataset resource. |
bigquery_external_tables | Map of BigQuery external table resources being provisioned. |
bigquery_tables | Map of bigquery table resources being provisioned. |
bigquery_views | Map of bigquery view resources being provisioned. |
external_table_ids | Unique IDs for any external tables being provisioned |
external_table_names | Friendly names for any external tables being provisioned |
project | Project where the dataset and tables are created |
routine_ids | Unique IDs for any routine being provisioned |
table_ids | Unique id for the table being provisioned |
table_names | Friendly name for the table being provisioned |
view_ids | Unique id for the view being provisioned |
view_names | friendlyname for the view being provisioned |
These sections describe requirements for using this module.
The following dependencies must be available:
A service account with the following roles must be used to provision the resources of this module:
roles/bigquery.dataOwner
The Project Factory module and the IAM module may be used in combination to provision a service account with the necessary roles applied.
A helper script for configuring a Service Account is located at (./helpers/setup-sa.sh).
A project with the following APIs enabled must be used to host the resources of this module:
bigquery-json.googleapis.com
The Project Factory module can be used to provision a project with the necessary APIs enabled.
Refer to the contribution guidelines for information on contributing to this module.
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论