Skip to content

Commit 4c51616

Browse files
feat!: add support to max_staleness field (#278)
Co-authored-by: Bharath KKB <bharathkrishnakb@gmail.com>
1 parent 85b9d22 commit 4c51616

File tree

16 files changed

+382
-362
lines changed

16 files changed

+382
-362
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ This module provisions a dataset and a list of tables with associated JSON schem
193193
| 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 |
194194
| description | Dataset description. | `string` | `null` | no |
195195
| encryption\_key | Default encryption key to apply to the dataset. Defaults to null (Google-managed). | `string` | `null` | no |
196-
| external\_tables | A list of objects which include table\_id, expiration\_time, external\_data\_configuration, and labels. | <pre>list(object({<br> table_id = string,<br> description = optional(string),<br> autodetect = bool,<br> compression = string,<br> ignore_unknown_values = bool,<br> max_bad_records = number,<br> schema = string,<br> source_format = string,<br> source_uris = list(string),<br> csv_options = object({<br> quote = string,<br> allow_jagged_rows = bool,<br> allow_quoted_newlines = bool,<br> encoding = string,<br> field_delimiter = string,<br> skip_leading_rows = number,<br> }),<br> google_sheets_options = object({<br> range = string,<br> skip_leading_rows = number,<br> }),<br> hive_partitioning_options = object({<br> mode = string,<br> source_uri_prefix = string,<br> }),<br> expiration_time = string,<br> labels = map(string),<br> }))</pre> | `[]` | no |
196+
| external\_tables | A list of objects which include table\_id, expiration\_time, external\_data\_configuration, and labels. | <pre>list(object({<br> table_id = string,<br> description = optional(string),<br> autodetect = bool,<br> compression = string,<br> ignore_unknown_values = bool,<br> max_bad_records = number,<br> schema = string,<br> source_format = string,<br> source_uris = list(string),<br> csv_options = object({<br> quote = string,<br> allow_jagged_rows = bool,<br> allow_quoted_newlines = bool,<br> encoding = string,<br> field_delimiter = string,<br> skip_leading_rows = number,<br> }),<br> google_sheets_options = object({<br> range = string,<br> skip_leading_rows = number,<br> }),<br> hive_partitioning_options = object({<br> mode = string,<br> source_uri_prefix = string,<br> }),<br> expiration_time = string,<br> max_staleness = optional(string),<br> labels = map(string),<br> }))</pre> | `[]` | no |
197197
| location | The regional location for the dataset only US and EU are allowed in module | `string` | `"US"` | no |
198-
| materialized\_views | A list of objects which includes view\_id, view\_query, clustering, time\_partitioning, range\_partitioning, expiration\_time and labels | <pre>list(object({<br> view_id = string,<br> description = optional(string),<br> query = string,<br> enable_refresh = bool,<br> refresh_interval_ms = string,<br> clustering = list(string),<br> time_partitioning = object({<br> expiration_ms = string,<br> field = string,<br> type = string,<br> require_partition_filter = bool,<br> }),<br> range_partitioning = object({<br> field = string,<br> range = object({<br> start = string,<br> end = string,<br> interval = string,<br> }),<br> }),<br> expiration_time = string,<br> labels = map(string),<br> }))</pre> | `[]` | no |
198+
| materialized\_views | A list of objects which includes view\_id, view\_query, clustering, time\_partitioning, range\_partitioning, expiration\_time and labels | <pre>list(object({<br> view_id = string,<br> description = optional(string),<br> query = string,<br> enable_refresh = bool,<br> refresh_interval_ms = string,<br> clustering = list(string),<br> time_partitioning = object({<br> expiration_ms = string,<br> field = string,<br> type = string,<br> require_partition_filter = bool,<br> }),<br> range_partitioning = object({<br> field = string,<br> range = object({<br> start = string,<br> end = string,<br> interval = string,<br> }),<br> }),<br> expiration_time = string,<br> max_staleness = optional(string),<br> labels = map(string),<br> }))</pre> | `[]` | no |
199199
| max\_time\_travel\_hours | Defines the time travel window in hours | `number` | `null` | no |
200200
| project\_id | Project where the dataset and table are created | `string` | n/a | yes |
201201
| routines | A list of objects which include routine\_id, routine\_type, routine\_language, definition\_body, return\_type, routine\_description and arguments. | <pre>list(object({<br> routine_id = string,<br> routine_type = string,<br> language = string,<br> definition_body = string,<br> return_type = string,<br> description = string,<br> arguments = list(object({<br> name = string,<br> data_type = string,<br> argument_kind = string,<br> mode = string,<br> })),<br> }))</pre> | `[]` | no |

examples/basic_bq/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ terraform {
2020
source = "hashicorp/google"
2121
}
2222
}
23-
required_version = ">= 0.13"
23+
required_version = ">= 1.3"
2424
}

examples/basic_view/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ terraform {
2020
source = "hashicorp/google"
2121
}
2222
}
23-
required_version = ">= 0.13"
23+
required_version = ">= 1.3"
2424
}

examples/multiple_tables/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ terraform {
2020
source = "hashicorp/google"
2121
}
2222
}
23-
required_version = ">= 0.13"
23+
required_version = ">= 1.3"
2424
}

examples/scheduled_queries/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
terraform {
17-
required_version = ">= 0.13"
17+
required_version = ">= 1.3"
1818
required_providers {
1919

2020
google = {

main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ resource "google_bigquery_table" "materialized_view" {
137137
labels = each.value["labels"]
138138
clustering = each.value["clustering"]
139139
expiration_time = each.value["expiration_time"] != null ? each.value["expiration_time"] : 0
140+
max_staleness = each.value["max_staleness"]
140141
project = var.project_id
141142
deletion_protection = false
142143

@@ -183,6 +184,7 @@ resource "google_bigquery_table" "external_table" {
183184
description = each.value["description"]
184185
labels = each.value["labels"]
185186
expiration_time = each.value["expiration_time"] != null ? each.value["expiration_time"] : 0
187+
max_staleness = each.value["max_staleness"]
186188
project = var.project_id
187189
deletion_protection = var.deletion_protection
188190

0 commit comments

Comments
 (0)