Skip to content

Commit

Permalink
add support for lastUpdatedPartitionConfig (#1191)
Browse files Browse the repository at this point in the history
* run ./scripts/regen.sh for unit test failure

* test for genrated file check

* test for genrated file check

* Revert "run ./scripts/regen.sh for unit test failure"

This reverts commit 6d64e0a.

* updated genertaed file (not using ./scripts/regen.sh)

* remove gen_check modification

* regenerate docs

* add support for lastUpdatedPartitionConfig

* add support for lastUpdatedPartitionConfig

* add support for lastUpdatedPartitionConfig

* run ./scripts/regen.sh

* will revert back later

* correct project_data/main.tf

* add support for lastUpdatedPartitionConfig

* correct team.hcl

* correct main.tf

* ./scripts/regen.sh

* update healthcare_datasets/main.tf and run ./scripts/regen.sh to correct project_data/main.tf
  • Loading branch information
JosieLi-Google authored Nov 10, 2023
1 parent 8103728 commit f7b5327
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docs/tfengine/schemas/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@
| healthcare_datasets.fhir_stores.stream_configs.bigquery_destination | - | object | true | - | - |
| healthcare_datasets.fhir_stores.stream_configs.bigquery_destination.dataset_uri | - | string | true | - | - |
| healthcare_datasets.fhir_stores.stream_configs.bigquery_destination.schema_config | - | object | true | - | - |
| healthcare_datasets.fhir_stores.stream_configs.bigquery_destination.schema_config.last_updated_partition_config | - | object | true | - | - |
| healthcare_datasets.fhir_stores.stream_configs.bigquery_destination.schema_config.last_updated_partition_config.expiration_ms | - | integer | true | - | - |
| healthcare_datasets.fhir_stores.stream_configs.bigquery_destination.schema_config.last_updated_partition_config.type | - | string | true | - | - |
| healthcare_datasets.fhir_stores.stream_configs.bigquery_destination.schema_config.recursive_structure_depth | - | integer | true | - | - |
| healthcare_datasets.fhir_stores.stream_configs.bigquery_destination.schema_config.schema_type | - | string | false | - | - |
| healthcare_datasets.fhir_stores.stream_configs.resource_types | - | array(string) | false | - | - |
Expand Down
8 changes: 6 additions & 2 deletions examples/tfengine/generated/team/project_data/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,13 @@ module "healthcare_dataset" {
bigquery_destination = {
dataset_uri = "bq://example-prod-data.${module.one_billion_ms_dataset.bigquery_dataset.dataset_id}"
schema_config = {
recursive_structure_depth = 3
recursive_structure_depth = "3"
schema_type = "ANALYTICS"
last_updated_partition_config = {
expiration_ms = 1e+06

schema_type = "ANALYTICS"
type = "HOUR"
}
}
}
resource_types = ["Patient"]
Expand Down
6 changes: 5 additions & 1 deletion examples/tfengine/modules/team.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,11 @@ template "project_data" {
schema_config = {
schema_type = "ANALYTICS"
recursive_structure_depth = 3
}
last_updated_partition_config = {
expiration_ms = 1e+06
type = "HOUR"
}
}
}
}]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ module "{{resourceName . "name"}}" {
bigquery_destination = {
dataset_uri = "{{$v.bigquery_destination.dataset_uri}}"
schema_config = {
{{hcl $v.bigquery_destination.schema_config}}
}
recursive_structure_depth = "{{$v.bigquery_destination.schema_config.recursive_structure_depth}}"
schema_type = "{{$v.bigquery_destination.schema_config.schema_type}}"
last_updated_partition_config = {
{{hcl $v.bigquery_destination.schema_config.last_updated_partition_config}}
}
}
}
{{hclField $v "resource_types" -}}
},
Expand Down
17 changes: 17 additions & 0 deletions templates/tfengine/recipes/resources.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@ schema = {
additionalProperties = false
required = [
"recursive_structure_depth",
"last_updated_partition_config",
]
properties = {
schema_type = {
Expand All @@ -1055,6 +1056,22 @@ schema = {
recursive_structure_depth = {
type = "integer"
}
last_updated_partition_config = {
type = "object"
additionalProperties = false
required = [
"type",
"expiration_ms",
]
properties = {
type = {
type = "string"
}
expiration_ms = {
type = "integer"
}
}
}
}
}
}
Expand Down

0 comments on commit f7b5327

Please sign in to comment.