diff --git a/README.md b/README.md index 3c82982c..304e3807 100644 --- a/README.md +++ b/README.md @@ -196,16 +196,16 @@ This module provisions a dataset and a list of tables with associated JSON schem | deletion\_protection | Whether or not to allow deletion of tables and external tables defined by this module. Can be overriden by table-level deletion\_protection configuration. | `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,
max_staleness = optional(string),
deletion_protection = optional(bool),
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,
max_staleness = optional(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 = optional(string, null),
max_staleness = optional(string),
deletion_protection = optional(bool),
labels = optional(map(string), {}),
})) | `[]` | no |
+| location | The location of the dataset. For multi-region, US or EU can be provided. | `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 = optional(list(string), []),
time_partitioning = optional(object({
expiration_ms = string,
field = string,
type = string,
require_partition_filter = bool,
}), null),
range_partitioning = optional(object({
field = string,
range = object({
start = string,
end = string,
interval = string,
}),
}), null),
expiration_time = optional(string, null),
max_staleness = optional(string),
labels = optional(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 |
| resource\_tags | A map of resource tags to add to the dataset | `map(string)` | `{}` | no |
-| 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 |
+| 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 = optional(list(object({
name = string,
data_type = string,
argument_kind = string,
mode = string,
})), []),
})) | `[]` | no |
| storage\_billing\_model | Specifies the storage billing model for the dataset. Set this flag value to LOGICAL to use logical bytes for storage billing, or to PHYSICAL to use physical bytes instead. LOGICAL is the default if this flag isn't specified. | `string` | `null` | no |
-| tables | A list of objects which include table\_id, table\_name, schema, clustering, time\_partitioning, range\_partitioning, expiration\_time and labels. | list(object({
table_id = string,
description = optional(string),
table_name = optional(string),
schema = string,
clustering = list(string),
require_partition_filter = optional(bool),
time_partitioning = object({
expiration_ms = string,
field = string,
type = string,
}),
range_partitioning = object({
field = string,
range = object({
start = string,
end = string,
interval = string,
}),
}),
expiration_time = string,
deletion_protection = optional(bool),
labels = map(string),
})) | `[]` | no |
-| views | A list of objects which include view\_id and view query | list(object({
view_id = string,
description = optional(string),
query = string,
use_legacy_sql = bool,
labels = map(string),
})) | `[]` | no |
+| tables | A list of objects which include table\_id, table\_name, schema, clustering, time\_partitioning, range\_partitioning, expiration\_time and labels. | list(object({
table_id = string,
description = optional(string),
table_name = optional(string),
schema = string,
clustering = optional(list(string), []),
require_partition_filter = optional(bool),
time_partitioning = optional(object({
expiration_ms = string,
field = string,
type = string,
}), null),
range_partitioning = optional(object({
field = string,
range = object({
start = string,
end = string,
interval = string,
}),
}), null),
expiration_time = optional(string, null),
deletion_protection = optional(bool),
labels = optional(map(string), {}),
})) | `[]` | no |
+| views | A list of objects which include view\_id and view query | list(object({
view_id = string,
description = optional(string),
query = string,
use_legacy_sql = bool,
labels = optional(map(string), {}),
})) | `[]` | no |
## Outputs
diff --git a/metadata.yaml b/metadata.yaml
index 373a9c6d..708703e1 100644
--- a/metadata.yaml
+++ b/metadata.yaml
@@ -63,7 +63,7 @@ spec:
description: Dataset description.
varType: string
- name: location
- description: The regional location for the dataset only US and EU are allowed in module
+ description: The location of the dataset. For multi-region, US or EU can be provided.
varType: string
defaultValue: US
- name: delete_contents_on_destroy
@@ -114,24 +114,24 @@ spec:
description = optional(string),
table_name = optional(string),
schema = string,
- clustering = list(string),
+ clustering = optional(list(string), []),
require_partition_filter = optional(bool),
- time_partitioning = object({
+ time_partitioning = optional(object({
expiration_ms = string,
field = string,
type = string,
- }),
- range_partitioning = object({
+ }), null),
+ range_partitioning = optional(object({
field = string,
range = object({
start = string,
end = string,
interval = string,
}),
- }),
- expiration_time = string,
+ }), null),
+ expiration_time = optional(string, null),
deletion_protection = optional(bool),
- labels = map(string),
+ labels = optional(map(string), {}),
}))
defaultValue: []
- name: views
@@ -142,7 +142,7 @@ spec:
description = optional(string),
query = string,
use_legacy_sql = bool,
- labels = map(string),
+ labels = optional(map(string), {}),
}))
defaultValue: []
- name: materialized_views
@@ -154,24 +154,24 @@ spec:
query = string,
enable_refresh = bool,
refresh_interval_ms = string,
- clustering = list(string),
- time_partitioning = object({
+ clustering = optional(list(string), []),
+ time_partitioning = optional(object({
expiration_ms = string,
field = string,
type = string,
require_partition_filter = bool,
- }),
- range_partitioning = object({
+ }), null),
+ range_partitioning = optional(object({
field = string,
range = object({
start = string,
end = string,
interval = string,
}),
- }),
- expiration_time = string,
+ }), null),
+ expiration_time = optional(string, null),
max_staleness = optional(string),
- labels = map(string),
+ labels = optional(map(string), {}),
}))
defaultValue: []
- name: external_tables
@@ -203,10 +203,10 @@ spec:
mode = string,
source_uri_prefix = string,
}),
- expiration_time = string,
+ expiration_time = optional(string, null),
max_staleness = optional(string),
deletion_protection = optional(bool),
- labels = map(string),
+ labels = optional(map(string), {}),
}))
defaultValue: []
- name: routines
@@ -219,12 +219,12 @@ spec:
definition_body = string,
return_type = string,
description = string,
- arguments = list(object({
+ arguments = optional(list(object({
name = string,
data_type = string,
argument_kind = string,
mode = string,
- })),
+ })), []),
}))
defaultValue: []
outputs:
diff --git a/variables.tf b/variables.tf
index 74605051..28ca7a8b 100644
--- a/variables.tf
+++ b/variables.tf
@@ -32,7 +32,7 @@ variable "description" {
}
variable "location" {
- description = "The regional location for the dataset only US and EU are allowed in module"
+ description = "The location of the dataset. For multi-region, US or EU can be provided."
type = string
default = "US"
}
@@ -125,24 +125,24 @@ variable "tables" {
description = optional(string),
table_name = optional(string),
schema = string,
- clustering = list(string),
+ clustering = optional(list(string), []),
require_partition_filter = optional(bool),
- time_partitioning = object({
+ time_partitioning = optional(object({
expiration_ms = string,
field = string,
type = string,
- }),
- range_partitioning = object({
+ }), null),
+ range_partitioning = optional(object({
field = string,
range = object({
start = string,
end = string,
interval = string,
}),
- }),
- expiration_time = string,
+ }), null),
+ expiration_time = optional(string, null),
deletion_protection = optional(bool),
- labels = map(string),
+ labels = optional(map(string), {}),
}))
}
@@ -154,7 +154,7 @@ variable "views" {
description = optional(string),
query = string,
use_legacy_sql = bool,
- labels = map(string),
+ labels = optional(map(string), {}),
}))
}
@@ -167,24 +167,24 @@ variable "materialized_views" {
query = string,
enable_refresh = bool,
refresh_interval_ms = string,
- clustering = list(string),
- time_partitioning = object({
+ clustering = optional(list(string), []),
+ time_partitioning = optional(object({
expiration_ms = string,
field = string,
type = string,
require_partition_filter = bool,
- }),
- range_partitioning = object({
+ }), null),
+ range_partitioning = optional(object({
field = string,
range = object({
start = string,
end = string,
interval = string,
}),
- }),
- expiration_time = string,
+ }), null),
+ expiration_time = optional(string, null),
max_staleness = optional(string),
- labels = map(string),
+ labels = optional(map(string), {}),
}))
}
@@ -217,10 +217,10 @@ variable "external_tables" {
mode = string,
source_uri_prefix = string,
}),
- expiration_time = string,
+ expiration_time = optional(string, null),
max_staleness = optional(string),
deletion_protection = optional(bool),
- labels = map(string),
+ labels = optional(map(string), {}),
}))
}
@@ -235,11 +235,11 @@ variable "routines" {
definition_body = string,
return_type = string,
description = string,
- arguments = list(object({
+ arguments = optional(list(object({
name = string,
data_type = string,
argument_kind = string,
mode = string,
- })),
+ })), []),
}))
}