Merge pull request #1156 from GoogleCloudPlatform/lcaggio/bq-max_time_travel_hours
Add 'max_time_travel_hours ' support on BQ module
This commit is contained in:
commit
13f2859e2f
|
@ -67,6 +67,7 @@ module "bigquery-dataset" {
|
||||||
default_table_expiration_ms = 3600000
|
default_table_expiration_ms = 3600000
|
||||||
default_partition_expiration_ms = null
|
default_partition_expiration_ms = null
|
||||||
delete_contents_on_destroy = false
|
delete_contents_on_destroy = false
|
||||||
|
max_time_travel_hours = 168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=1
|
# tftest modules=1 resources=1
|
||||||
|
@ -178,7 +179,7 @@ module "bigquery-dataset" {
|
||||||
| name | description | type | required | default |
|
| name | description | type | required | default |
|
||||||
|---|---|:---:|:---:|:---:|
|
|---|---|:---:|:---:|:---:|
|
||||||
| [id](variables.tf#L69) | Dataset id. | <code>string</code> | ✓ | |
|
| [id](variables.tf#L69) | Dataset id. | <code>string</code> | ✓ | |
|
||||||
| [project_id](variables.tf#L100) | Id of the project where datasets will be created. | <code>string</code> | ✓ | |
|
| [project_id](variables.tf#L97) | Id of the project where datasets will be created. | <code>string</code> | ✓ | |
|
||||||
| [access](variables.tf#L17) | Map of access rules with role and identity type. Keys are arbitrary and must match those in the `access_identities` variable, types are `domain`, `group`, `special_group`, `user`, `view`. | <code title="map(object({ role = string type = string }))">map(object({…}))</code> | | <code>{}</code> |
|
| [access](variables.tf#L17) | Map of access rules with role and identity type. Keys are arbitrary and must match those in the `access_identities` variable, types are `domain`, `group`, `special_group`, `user`, `view`. | <code title="map(object({ role = string type = string }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
| [access_identities](variables.tf#L33) | Map of access identities used for basic access roles. View identities have the format 'project_id\|dataset_id\|table_id'. | <code>map(string)</code> | | <code>{}</code> |
|
| [access_identities](variables.tf#L33) | Map of access identities used for basic access roles. View identities have the format 'project_id\|dataset_id\|table_id'. | <code>map(string)</code> | | <code>{}</code> |
|
||||||
| [dataset_access](variables.tf#L39) | Set access in the dataset resource instead of using separate resources. | <code>bool</code> | | <code>false</code> |
|
| [dataset_access](variables.tf#L39) | Set access in the dataset resource instead of using separate resources. | <code>bool</code> | | <code>false</code> |
|
||||||
|
@ -188,9 +189,9 @@ module "bigquery-dataset" {
|
||||||
| [iam](variables.tf#L63) | IAM bindings in {ROLE => [MEMBERS]} format. Mutually exclusive with the access_* variables used for basic roles. | <code>map(list(string))</code> | | <code>{}</code> |
|
| [iam](variables.tf#L63) | IAM bindings in {ROLE => [MEMBERS]} format. Mutually exclusive with the access_* variables used for basic roles. | <code>map(list(string))</code> | | <code>{}</code> |
|
||||||
| [labels](variables.tf#L74) | Dataset labels. | <code>map(string)</code> | | <code>{}</code> |
|
| [labels](variables.tf#L74) | Dataset labels. | <code>map(string)</code> | | <code>{}</code> |
|
||||||
| [location](variables.tf#L80) | Dataset location. | <code>string</code> | | <code>"EU"</code> |
|
| [location](variables.tf#L80) | Dataset location. | <code>string</code> | | <code>"EU"</code> |
|
||||||
| [options](variables.tf#L86) | Dataset options. | <code title="object({ default_table_expiration_ms = number default_partition_expiration_ms = number delete_contents_on_destroy = bool })">object({…})</code> | | <code title="{ default_table_expiration_ms = null default_partition_expiration_ms = null delete_contents_on_destroy = false }">{…}</code> |
|
| [options](variables.tf#L86) | Dataset options. | <code title="object({ default_table_expiration_ms = optional(number, null) default_partition_expiration_ms = optional(number, null) delete_contents_on_destroy = optional(bool, false) max_time_travel_hours = optional(number, 168) })">object({…})</code> | | <code>{}</code> |
|
||||||
| [tables](variables.tf#L105) | Table definitions. Options and partitioning default to null. Partitioning can only use `range` or `time`, set the unused one to null. | <code title="map(object({ friendly_name = string labels = map(string) options = object({ clustering = list(string) encryption_key = string expiration_time = number }) partitioning = object({ field = string range = object({ end = number interval = number start = number }) time = object({ expiration_ms = number type = string }) }) schema = string deletion_protection = bool }))">map(object({…}))</code> | | <code>{}</code> |
|
| [tables](variables.tf#L102) | Table definitions. Options and partitioning default to null. Partitioning can only use `range` or `time`, set the unused one to null. | <code title="map(object({ friendly_name = string labels = map(string) options = object({ clustering = list(string) encryption_key = string expiration_time = number }) partitioning = object({ field = string range = object({ end = number interval = number start = number }) time = object({ expiration_ms = number type = string }) }) schema = string deletion_protection = bool }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
| [views](variables.tf#L133) | View definitions. | <code title="map(object({ friendly_name = string labels = map(string) query = string use_legacy_sql = bool deletion_protection = bool }))">map(object({…}))</code> | | <code>{}</code> |
|
| [views](variables.tf#L130) | View definitions. | <code title="map(object({ friendly_name = string labels = map(string) query = string use_legacy_sql = bool deletion_protection = bool }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ resource "google_bigquery_dataset" "default" {
|
||||||
delete_contents_on_destroy = var.options.delete_contents_on_destroy
|
delete_contents_on_destroy = var.options.delete_contents_on_destroy
|
||||||
default_table_expiration_ms = var.options.default_table_expiration_ms
|
default_table_expiration_ms = var.options.default_table_expiration_ms
|
||||||
default_partition_expiration_ms = var.options.default_partition_expiration_ms
|
default_partition_expiration_ms = var.options.default_partition_expiration_ms
|
||||||
|
max_time_travel_hours = var.options.max_time_travel_hours
|
||||||
dynamic "access" {
|
dynamic "access" {
|
||||||
for_each = var.dataset_access ? local.access_domain : {}
|
for_each = var.dataset_access ? local.access_domain : {}
|
||||||
content {
|
content {
|
||||||
|
|
|
@ -86,15 +86,12 @@ variable "location" {
|
||||||
variable "options" {
|
variable "options" {
|
||||||
description = "Dataset options."
|
description = "Dataset options."
|
||||||
type = object({
|
type = object({
|
||||||
default_table_expiration_ms = number
|
default_table_expiration_ms = optional(number, null)
|
||||||
default_partition_expiration_ms = number
|
default_partition_expiration_ms = optional(number, null)
|
||||||
delete_contents_on_destroy = bool
|
delete_contents_on_destroy = optional(bool, false)
|
||||||
|
max_time_travel_hours = optional(number, 168)
|
||||||
})
|
})
|
||||||
default = {
|
default = {}
|
||||||
default_table_expiration_ms = null
|
|
||||||
default_partition_expiration_ms = null
|
|
||||||
delete_contents_on_destroy = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "project_id" {
|
variable "project_id" {
|
||||||
|
|
Loading…
Reference in New Issue