From 4c51616f65a5994886917b1f09d4ba9d336f593b Mon Sep 17 00:00:00 2001 From: Marcel Gongora <2498591+msgongora@users.noreply.github.com> Date: Fri, 10 Nov 2023 00:43:37 -0500 Subject: [PATCH] feat!: add support to max_staleness field (#278) Co-authored-by: Bharath KKB --- README.md | 4 +- examples/basic_bq/versions.tf | 2 +- examples/basic_view/versions.tf | 2 +- examples/multiple_tables/versions.tf | 2 +- examples/scheduled_queries/versions.tf | 2 +- main.tf | 2 + metadata.yaml | 438 ++++++++++++------------ modules/authorization/metadata.yaml | 136 ++++---- modules/authorization/versions.tf | 2 +- modules/scheduled_queries/metadata.yaml | 68 ++-- modules/scheduled_queries/versions.tf | 2 +- modules/udf/metadata.yaml | 76 ++-- modules/udf/versions.tf | 2 +- test/setup/versions.tf | 2 +- variables.tf | 2 + versions.tf | 2 +- 16 files changed, 382 insertions(+), 362 deletions(-) diff --git a/README.md b/README.md index 4637bab8..a179e13f 100644 --- a/README.md +++ b/README.md @@ -193,9 +193,9 @@ This module provisions a dataset and a list of tables with associated JSON schem | 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({
table_id = string,
description = optional(string),
autodetect = bool,
compression = string,
ignore_unknown_values = bool,
max_bad_records = number,
schema = string,
source_format = string,
source_uris = list(string),
csv_options = object({
quote = string,
allow_jagged_rows = bool,
allow_quoted_newlines = bool,
encoding = string,
field_delimiter = string,
skip_leading_rows = number,
}),
google_sheets_options = object({
range = string,
skip_leading_rows = number,
}),
hive_partitioning_options = object({
mode = string,
source_uri_prefix = string,
}),
expiration_time = string,
labels = map(string),
}))
| `[]` | no | +| external\_tables | A list of objects which include table\_id, expiration\_time, external\_data\_configuration, and labels. |
list(object({
table_id = string,
description = optional(string),
autodetect = bool,
compression = string,
ignore_unknown_values = bool,
max_bad_records = number,
schema = string,
source_format = string,
source_uris = list(string),
csv_options = object({
quote = string,
allow_jagged_rows = bool,
allow_quoted_newlines = bool,
encoding = string,
field_delimiter = string,
skip_leading_rows = number,
}),
google_sheets_options = object({
range = string,
skip_leading_rows = number,
}),
hive_partitioning_options = object({
mode = string,
source_uri_prefix = string,
}),
expiration_time = string,
max_staleness = optional(string),
labels = map(string),
}))
| `[]` | 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({
view_id = string,
description = optional(string),
query = string,
enable_refresh = bool,
refresh_interval_ms = string,
clustering = list(string),
time_partitioning = object({
expiration_ms = string,
field = string,
type = string,
require_partition_filter = bool,
}),
range_partitioning = object({
field = string,
range = object({
start = string,
end = string,
interval = string,
}),
}),
expiration_time = string,
labels = map(string),
}))
| `[]` | no | +| materialized\_views | A list of objects which includes view\_id, view\_query, clustering, time\_partitioning, range\_partitioning, expiration\_time and labels |
list(object({
view_id = string,
description = optional(string),
query = string,
enable_refresh = bool,
refresh_interval_ms = string,
clustering = list(string),
time_partitioning = object({
expiration_ms = string,
field = string,
type = string,
require_partition_filter = bool,
}),
range_partitioning = object({
field = string,
range = object({
start = string,
end = string,
interval = string,
}),
}),
expiration_time = string,
max_staleness = optional(string),
labels = map(string),
}))
| `[]` | no | | max\_time\_travel\_hours | Defines the time travel window in hours | `number` | `null` | 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({
routine_id = string,
routine_type = string,
language = string,
definition_body = string,
return_type = string,
description = string,
arguments = list(object({
name = string,
data_type = string,
argument_kind = string,
mode = string,
})),
}))
| `[]` | no | diff --git a/examples/basic_bq/versions.tf b/examples/basic_bq/versions.tf index 6a252892..dd90e731 100644 --- a/examples/basic_bq/versions.tf +++ b/examples/basic_bq/versions.tf @@ -20,5 +20,5 @@ terraform { source = "hashicorp/google" } } - required_version = ">= 0.13" + required_version = ">= 1.3" } diff --git a/examples/basic_view/versions.tf b/examples/basic_view/versions.tf index 6a252892..dd90e731 100644 --- a/examples/basic_view/versions.tf +++ b/examples/basic_view/versions.tf @@ -20,5 +20,5 @@ terraform { source = "hashicorp/google" } } - required_version = ">= 0.13" + required_version = ">= 1.3" } diff --git a/examples/multiple_tables/versions.tf b/examples/multiple_tables/versions.tf index 6a252892..dd90e731 100644 --- a/examples/multiple_tables/versions.tf +++ b/examples/multiple_tables/versions.tf @@ -20,5 +20,5 @@ terraform { source = "hashicorp/google" } } - required_version = ">= 0.13" + required_version = ">= 1.3" } diff --git a/examples/scheduled_queries/versions.tf b/examples/scheduled_queries/versions.tf index 51e20bd0..c586a36e 100644 --- a/examples/scheduled_queries/versions.tf +++ b/examples/scheduled_queries/versions.tf @@ -14,7 +14,7 @@ * limitations under the License. */ terraform { - required_version = ">= 0.13" + required_version = ">= 1.3" required_providers { google = { diff --git a/main.tf b/main.tf index fc8ab311..644ec460 100644 --- a/main.tf +++ b/main.tf @@ -137,6 +137,7 @@ resource "google_bigquery_table" "materialized_view" { labels = each.value["labels"] clustering = each.value["clustering"] expiration_time = each.value["expiration_time"] != null ? each.value["expiration_time"] : 0 + max_staleness = each.value["max_staleness"] project = var.project_id deletion_protection = false @@ -183,6 +184,7 @@ resource "google_bigquery_table" "external_table" { description = each.value["description"] labels = each.value["labels"] expiration_time = each.value["expiration_time"] != null ? each.value["expiration_time"] : 0 + max_staleness = each.value["max_staleness"] project = var.project_id deletion_protection = var.deletion_protection diff --git a/metadata.yaml b/metadata.yaml index a5399c26..fb491821 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -27,229 +27,239 @@ spec: version: 7.0.0 actuationTool: flavor: Terraform - version: '>= 0.13' + version: ">= 0.13" description: {} content: subBlueprints: - - name: authorization - location: modules/authorization - - name: data_warehouse - location: modules/data_warehouse - - name: scheduled_queries - location: modules/scheduled_queries - - name: udf - location: modules/udf + - name: authorization + location: modules/authorization + - name: data_warehouse + location: modules/data_warehouse + - name: scheduled_queries + location: modules/scheduled_queries + - name: udf + location: modules/udf examples: - - name: basic_bq - location: examples/basic_bq - - name: basic_view - location: examples/basic_view - - name: data_warehouse - location: examples/data_warehouse - - name: multiple_tables - location: examples/multiple_tables - - name: scheduled_queries - location: examples/scheduled_queries + - name: basic_bq + location: examples/basic_bq + - name: basic_view + location: examples/basic_view + - name: data_warehouse + location: examples/data_warehouse + - name: multiple_tables + location: examples/multiple_tables + - name: scheduled_queries + location: examples/scheduled_queries interfaces: variables: - - name: access - description: An array of objects that define dataset access for one or more entities. - varType: any - defaultValue: - - role: roles/bigquery.dataOwner - special_group: projectOwners - - name: dataset_id - description: Unique ID for the dataset being provisioned. - varType: string - required: true - - name: dataset_labels - description: Key value pairs in a map for dataset labels - varType: map(string) - defaultValue: {} - - name: dataset_name - description: Friendly name for the dataset being provisioned. - varType: string - - name: default_table_expiration_ms - description: TTL of tables using the dataset in MS - varType: number - - name: delete_contents_on_destroy - description: (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. - varType: bool - - name: deletion_protection - description: 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 - varType: bool - defaultValue: false - - name: description - description: Dataset description. - varType: string - - name: encryption_key - description: Default encryption key to apply to the dataset. Defaults to null (Google-managed). - varType: string - - name: external_tables - description: A list of objects which include table_id, expiration_time, external_data_configuration, and labels. - varType: |- - list(object({ - table_id = string, - description = optional(string), - autodetect = bool, - compression = string, - ignore_unknown_values = bool, - max_bad_records = number, - schema = string, - source_format = string, - source_uris = list(string), - csv_options = object({ - quote = string, - allow_jagged_rows = bool, - allow_quoted_newlines = bool, - encoding = string, - field_delimiter = string, - skip_leading_rows = number, - }), - google_sheets_options = object({ - range = string, - skip_leading_rows = number, - }), - hive_partitioning_options = object({ - mode = string, - source_uri_prefix = string, - }), - expiration_time = string, - labels = map(string), - })) - defaultValue: [] - - name: location - description: The regional location for the dataset only US and EU are allowed in module - varType: string - defaultValue: US - - name: materialized_views - description: A list of objects which includes view_id, view_query, clustering, time_partitioning, range_partitioning, expiration_time and labels - varType: |- - list(object({ - view_id = string, - description = optional(string), - query = string, - enable_refresh = bool, - refresh_interval_ms = string, - clustering = list(string), - time_partitioning = object({ - expiration_ms = string, - field = string, - type = string, - require_partition_filter = bool, - }), - range_partitioning = object({ - field = string, - range = object({ - start = string, - end = string, - interval = string, + - name: access + description: An array of objects that define dataset access for one or more entities. + varType: any + defaultValue: + - role: roles/bigquery.dataOwner + special_group: projectOwners + - name: dataset_id + description: Unique ID for the dataset being provisioned. + varType: string + defaultValue: null + required: true + - name: dataset_labels + description: Key value pairs in a map for dataset labels + varType: map(string) + defaultValue: {} + - name: dataset_name + description: Friendly name for the dataset being provisioned. + varType: string + defaultValue: null + - name: default_table_expiration_ms + description: TTL of tables using the dataset in MS + varType: number + defaultValue: null + - name: delete_contents_on_destroy + description: (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. + varType: bool + defaultValue: null + - name: deletion_protection + description: 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 + varType: bool + defaultValue: false + - name: description + description: Dataset description. + varType: string + defaultValue: null + - name: encryption_key + description: Default encryption key to apply to the dataset. Defaults to null (Google-managed). + varType: string + defaultValue: null + - name: external_tables + description: A list of objects which include table_id, expiration_time, external_data_configuration, and labels. + varType: |- + list(object({ + table_id = string, + description = optional(string), + autodetect = bool, + compression = string, + ignore_unknown_values = bool, + max_bad_records = number, + schema = string, + source_format = string, + source_uris = list(string), + csv_options = object({ + quote = string, + allow_jagged_rows = bool, + allow_quoted_newlines = bool, + encoding = string, + field_delimiter = string, + skip_leading_rows = number, }), - }), - expiration_time = string, - labels = map(string), - })) - defaultValue: [] - - name: max_time_travel_hours - description: Defines the time travel window in hours - varType: number - - name: project_id - description: Project where the dataset and table are created - varType: string - required: true - - name: routines - description: A list of objects which include routine_id, routine_type, routine_language, definition_body, return_type, routine_description and arguments. - varType: |- - list(object({ - routine_id = string, - routine_type = string, - language = string, - definition_body = string, - return_type = string, - description = string, - arguments = list(object({ - name = string, - data_type = string, - argument_kind = string, - mode = string, - })), - })) - defaultValue: [] - - name: tables - description: A list of objects which include table_id, table_name, schema, clustering, time_partitioning, range_partitioning, expiration_time and labels. - varType: |- - list(object({ - table_id = string, - description = optional(string), - table_name = optional(string), - schema = string, - clustering = list(string), - time_partitioning = object({ - expiration_ms = string, - field = string, - type = string, - require_partition_filter = bool, - }), - range_partitioning = object({ - field = string, - range = object({ - start = string, - end = string, - interval = string, + google_sheets_options = object({ + range = string, + skip_leading_rows = number, }), - }), - expiration_time = string, - labels = map(string), - })) - defaultValue: [] - - name: views - description: A list of objects which include view_id and view query - varType: |- - list(object({ - view_id = string, - description = optional(string), - query = string, - use_legacy_sql = bool, - labels = map(string), - })) - defaultValue: [] + hive_partitioning_options = object({ + mode = string, + source_uri_prefix = string, + }), + expiration_time = string, + max_staleness = optional(string), + labels = map(string), + })) + defaultValue: [] + - name: location + description: The regional location for the dataset only US and EU are allowed in module + varType: string + defaultValue: US + - name: materialized_views + description: A list of objects which includes view_id, view_query, clustering, time_partitioning, range_partitioning, expiration_time and labels + varType: |- + list(object({ + view_id = string, + description = optional(string), + query = string, + enable_refresh = bool, + refresh_interval_ms = string, + clustering = list(string), + time_partitioning = object({ + expiration_ms = string, + field = string, + type = string, + require_partition_filter = bool, + }), + range_partitioning = object({ + field = string, + range = object({ + start = string, + end = string, + interval = string, + }), + }), + expiration_time = string, + max_staleness = optional(string), + labels = map(string), + })) + defaultValue: [] + - name: max_time_travel_hours + description: Defines the time travel window in hours + varType: number + defaultValue: null + - name: project_id + description: Project where the dataset and table are created + varType: string + defaultValue: null + required: true + - name: routines + description: A list of objects which include routine_id, routine_type, routine_language, definition_body, return_type, routine_description and arguments. + varType: |- + list(object({ + routine_id = string, + routine_type = string, + language = string, + definition_body = string, + return_type = string, + description = string, + arguments = list(object({ + name = string, + data_type = string, + argument_kind = string, + mode = string, + })), + })) + defaultValue: [] + - name: tables + description: A list of objects which include table_id, table_name, schema, clustering, time_partitioning, range_partitioning, expiration_time and labels. + varType: |- + list(object({ + table_id = string, + description = optional(string), + table_name = optional(string), + schema = string, + clustering = list(string), + time_partitioning = object({ + expiration_ms = string, + field = string, + type = string, + require_partition_filter = bool, + }), + range_partitioning = object({ + field = string, + range = object({ + start = string, + end = string, + interval = string, + }), + }), + expiration_time = string, + labels = map(string), + })) + defaultValue: [] + - name: views + description: A list of objects which include view_id and view query + varType: |- + list(object({ + view_id = string, + description = optional(string), + query = string, + use_legacy_sql = bool, + labels = map(string), + })) + defaultValue: [] outputs: - - name: bigquery_dataset - description: Bigquery dataset resource. - - name: bigquery_external_tables - description: Map of BigQuery external table resources being provisioned. - - name: bigquery_tables - description: Map of bigquery table resources being provisioned. - - name: bigquery_views - description: Map of bigquery view resources being provisioned. - - name: external_table_ids - description: Unique IDs for any external tables being provisioned - - name: external_table_names - description: Friendly names for any external tables being provisioned - - name: project - description: Project where the dataset and tables are created - - name: routine_ids - description: Unique IDs for any routine being provisioned - - name: table_ids - description: Unique id for the table being provisioned - - name: table_names - description: Friendly name for the table being provisioned - - name: view_ids - description: Unique id for the view being provisioned - - name: view_names - description: friendlyname for the view being provisioned + - name: bigquery_dataset + description: Bigquery dataset resource. + - name: bigquery_external_tables + description: Map of BigQuery external table resources being provisioned. + - name: bigquery_tables + description: Map of bigquery table resources being provisioned. + - name: bigquery_views + description: Map of bigquery view resources being provisioned. + - name: external_table_ids + description: Unique IDs for any external tables being provisioned + - name: external_table_names + description: Friendly names for any external tables being provisioned + - name: project + description: Project where the dataset and tables are created + - name: routine_ids + description: Unique IDs for any routine being provisioned + - name: table_ids + description: Unique id for the table being provisioned + - name: table_names + description: Friendly name for the table being provisioned + - name: view_ids + description: Unique id for the view being provisioned + - name: view_names + description: friendlyname for the view being provisioned requirements: roles: - - level: Project - roles: - - roles/bigquery.admin - - roles/cloudkms.cryptoKeyEncrypterDecrypter - - roles/owner + - level: Project + roles: + - roles/bigquery.admin + - roles/cloudkms.cryptoKeyEncrypterDecrypter + - roles/owner services: - - cloudkms.googleapis.com - - cloudresourcemanager.googleapis.com - - bigquery.googleapis.com - - bigquerystorage.googleapis.com - - bigqueryconnection.googleapis.com - - serviceusage.googleapis.com - - iam.googleapis.com + - cloudkms.googleapis.com + - cloudresourcemanager.googleapis.com + - bigquery.googleapis.com + - bigquerystorage.googleapis.com + - bigqueryconnection.googleapis.com + - serviceusage.googleapis.com + - iam.googleapis.com diff --git a/modules/authorization/metadata.yaml b/modules/authorization/metadata.yaml index 820510b9..2a6a3507 100644 --- a/modules/authorization/metadata.yaml +++ b/modules/authorization/metadata.yaml @@ -28,79 +28,81 @@ spec: version: 7.0.0 actuationTool: flavor: Terraform - version: '>= 0.13' + version: ">= 0.13" description: {} content: examples: - - name: basic_bq - location: examples/basic_bq - - name: basic_view - location: examples/basic_view - - name: data_warehouse - location: examples/data_warehouse - - name: multiple_tables - location: examples/multiple_tables - - name: scheduled_queries - location: examples/scheduled_queries + - name: basic_bq + location: examples/basic_bq + - name: basic_view + location: examples/basic_view + - name: data_warehouse + location: examples/data_warehouse + - name: multiple_tables + location: examples/multiple_tables + - name: scheduled_queries + location: examples/scheduled_queries interfaces: variables: - - name: authorized_datasets - description: An array of datasets to be authorized on the dataset - varType: |- - list(object({ - dataset_id = string, - project_id = string, - })) - defaultValue: [] - - name: authorized_routines - description: An array of authorized routine to be authorized on the dataset - varType: |- - list(object({ - project_id = string, - dataset_id = string, - routine_id = string - })) - defaultValue: [] - - name: authorized_views - description: An array of views to give authorize for the dataset - varType: |- - list(object({ - dataset_id = string, - project_id = string, - table_id = string # this is the view id, but we keep table_id to stay consistent as the resource - })) - defaultValue: [] - - name: dataset_id - description: Unique ID for the dataset being provisioned. - varType: string - required: true - - name: project_id - description: Project where the dataset and table are created - varType: string - required: true - - name: roles - description: An array of objects that define dataset access for one or more entities. - varType: any - defaultValue: [] + - name: authorized_datasets + description: An array of datasets to be authorized on the dataset + varType: |- + list(object({ + dataset_id = string, + project_id = string, + })) + defaultValue: [] + - name: authorized_routines + description: An array of authorized routine to be authorized on the dataset + varType: |- + list(object({ + project_id = string, + dataset_id = string, + routine_id = string + })) + defaultValue: [] + - name: authorized_views + description: An array of views to give authorize for the dataset + varType: |- + list(object({ + dataset_id = string, + project_id = string, + table_id = string # this is the view id, but we keep table_id to stay consistent as the resource + })) + defaultValue: [] + - name: dataset_id + description: Unique ID for the dataset being provisioned. + varType: string + defaultValue: null + required: true + - name: project_id + description: Project where the dataset and table are created + varType: string + defaultValue: null + required: true + - name: roles + description: An array of objects that define dataset access for one or more entities. + varType: any + defaultValue: [] outputs: - - name: authorized_dataset - description: Authorized datasets for the BQ dataset - - name: authorized_roles - description: Authorized roles for the dataset - - name: authorized_views - description: Authorized views for the dataset + - name: authorized_dataset + description: Authorized datasets for the BQ dataset + - name: authorized_roles + description: Authorized roles for the dataset + - name: authorized_views + description: Authorized views for the dataset requirements: roles: - - level: Project - roles: - - roles/bigquery.admin - - roles/cloudkms.cryptoKeyEncrypterDecrypter - - roles/owner + - level: Project + roles: + - roles/bigquery.admin + - roles/cloudkms.cryptoKeyEncrypterDecrypter + - roles/owner services: - - cloudkms.googleapis.com - - cloudresourcemanager.googleapis.com - - bigquery.googleapis.com - - bigquerystorage.googleapis.com - - bigqueryconnection.googleapis.com - - serviceusage.googleapis.com - - iam.googleapis.com + - cloudkms.googleapis.com + - cloudresourcemanager.googleapis.com + - bigquery.googleapis.com + - bigquerystorage.googleapis.com + - bigqueryconnection.googleapis.com + - serviceusage.googleapis.com + - iam.googleapis.com diff --git a/modules/authorization/versions.tf b/modules/authorization/versions.tf index f494a773..6fcc3b6f 100644 --- a/modules/authorization/versions.tf +++ b/modules/authorization/versions.tf @@ -15,7 +15,7 @@ */ terraform { - required_version = ">= 0.13" + required_version = ">= 1.3" required_providers { google = { diff --git a/modules/scheduled_queries/metadata.yaml b/modules/scheduled_queries/metadata.yaml index 1edd83d8..f601dc76 100644 --- a/modules/scheduled_queries/metadata.yaml +++ b/modules/scheduled_queries/metadata.yaml @@ -28,45 +28,47 @@ spec: version: 7.0.0 actuationTool: flavor: Terraform - version: '>= 0.13' + version: ">= 0.13" description: {} content: examples: - - name: basic_bq - location: examples/basic_bq - - name: basic_view - location: examples/basic_view - - name: data_warehouse - location: examples/data_warehouse - - name: multiple_tables - location: examples/multiple_tables - - name: scheduled_queries - location: examples/scheduled_queries + - name: basic_bq + location: examples/basic_bq + - name: basic_view + location: examples/basic_view + - name: data_warehouse + location: examples/data_warehouse + - name: multiple_tables + location: examples/multiple_tables + - name: scheduled_queries + location: examples/scheduled_queries interfaces: variables: - - name: project_id - description: The project where scheduled queries are created - varType: string - required: true - - name: queries - description: Data transfer configuration for creating scheduled queries - varType: list(any) - required: true + - name: project_id + description: The project where scheduled queries are created + varType: string + defaultValue: null + required: true + - name: queries + description: Data transfer configuration for creating scheduled queries + varType: list(any) + defaultValue: null + required: true outputs: - - name: query_names - description: The resource names of the transfer config + - name: query_names + description: The resource names of the transfer config requirements: roles: - - level: Project - roles: - - roles/bigquery.admin - - roles/cloudkms.cryptoKeyEncrypterDecrypter - - roles/owner + - level: Project + roles: + - roles/bigquery.admin + - roles/cloudkms.cryptoKeyEncrypterDecrypter + - roles/owner services: - - cloudkms.googleapis.com - - cloudresourcemanager.googleapis.com - - bigquery.googleapis.com - - bigquerystorage.googleapis.com - - bigqueryconnection.googleapis.com - - serviceusage.googleapis.com - - iam.googleapis.com + - cloudkms.googleapis.com + - cloudresourcemanager.googleapis.com + - bigquery.googleapis.com + - bigquerystorage.googleapis.com + - bigqueryconnection.googleapis.com + - serviceusage.googleapis.com + - iam.googleapis.com diff --git a/modules/scheduled_queries/versions.tf b/modules/scheduled_queries/versions.tf index 07b70238..cde6bbd6 100644 --- a/modules/scheduled_queries/versions.tf +++ b/modules/scheduled_queries/versions.tf @@ -15,7 +15,7 @@ */ terraform { - required_version = ">= 0.13" + required_version = ">= 1.3" required_providers { google = { diff --git a/modules/udf/metadata.yaml b/modules/udf/metadata.yaml index 4c791c7e..7a32bbba 100644 --- a/modules/udf/metadata.yaml +++ b/modules/udf/metadata.yaml @@ -28,49 +28,51 @@ spec: version: 7.0.0 actuationTool: flavor: Terraform - version: '>= 0.13' + version: ">= 0.13" description: {} content: examples: - - name: basic_bq - location: examples/basic_bq - - name: basic_view - location: examples/basic_view - - name: data_warehouse - location: examples/data_warehouse - - name: multiple_tables - location: examples/multiple_tables - - name: scheduled_queries - location: examples/scheduled_queries + - name: basic_bq + location: examples/basic_bq + - name: basic_view + location: examples/basic_view + - name: data_warehouse + location: examples/data_warehouse + - name: multiple_tables + location: examples/multiple_tables + - name: scheduled_queries + location: examples/scheduled_queries interfaces: variables: - - name: add_udfs - description: Whether or not this module should be enabled. - varType: string - defaultValue: false - - name: dataset_id - description: Dataset id - varType: string - required: true - - name: project_id - description: Project ID that contains the dataset - varType: string - required: true + - name: add_udfs + description: Whether or not this module should be enabled. + varType: string + defaultValue: false + - name: dataset_id + description: Dataset id + varType: string + defaultValue: null + required: true + - name: project_id + description: Project ID that contains the dataset + varType: string + defaultValue: null + required: true outputs: - - name: added_udfs - description: List of UDFs utility functions added. + - name: added_udfs + description: List of UDFs utility functions added. requirements: roles: - - level: Project - roles: - - roles/bigquery.admin - - roles/cloudkms.cryptoKeyEncrypterDecrypter - - roles/owner + - level: Project + roles: + - roles/bigquery.admin + - roles/cloudkms.cryptoKeyEncrypterDecrypter + - roles/owner services: - - cloudkms.googleapis.com - - cloudresourcemanager.googleapis.com - - bigquery.googleapis.com - - bigquerystorage.googleapis.com - - bigqueryconnection.googleapis.com - - serviceusage.googleapis.com - - iam.googleapis.com + - cloudkms.googleapis.com + - cloudresourcemanager.googleapis.com + - bigquery.googleapis.com + - bigquerystorage.googleapis.com + - bigqueryconnection.googleapis.com + - serviceusage.googleapis.com + - iam.googleapis.com diff --git a/modules/udf/versions.tf b/modules/udf/versions.tf index 37ecb836..3a13b430 100644 --- a/modules/udf/versions.tf +++ b/modules/udf/versions.tf @@ -15,7 +15,7 @@ */ terraform { - required_version = ">= 0.13" + required_version = ">= 1.3" required_providers { google = { diff --git a/test/setup/versions.tf b/test/setup/versions.tf index e3c89fc3..c51b9d83 100644 --- a/test/setup/versions.tf +++ b/test/setup/versions.tf @@ -15,7 +15,7 @@ */ terraform { - required_version = ">= 0.13" + required_version = ">= 1.3" required_providers { google = { source = "hashicorp/google" diff --git a/variables.tf b/variables.tf index 9846c3f9..53e1ded2 100644 --- a/variables.tf +++ b/variables.tf @@ -159,6 +159,7 @@ variable "materialized_views" { }), }), expiration_time = string, + max_staleness = optional(string), labels = map(string), })) } @@ -193,6 +194,7 @@ variable "external_tables" { source_uri_prefix = string, }), expiration_time = string, + max_staleness = optional(string), labels = map(string), })) } diff --git a/versions.tf b/versions.tf index 7b7dc5f4..3bc833ed 100644 --- a/versions.tf +++ b/versions.tf @@ -15,7 +15,7 @@ */ terraform { - required_version = ">= 0.13" + required_version = ">= 1.3" required_providers { google = {