From 801b65a93e8c5ea6f0e234bcf4ed2889b9be49ca Mon Sep 17 00:00:00 2001 From: Joyce Zhou Date: Mon, 16 Jan 2023 17:21:01 -0500 Subject: [PATCH] support fhir notiifcation configs field --- docs/tfengine/schemas/resources.md | 3 +++ .../generated/team/project_data/main.tf | 4 ++++ examples/tfengine/modules/team.hcl | 4 ++++ .../resources/healthcare_datasets/main.tf | 11 +++++++++++ templates/tfengine/recipes/resources.hcl | 18 ++++++++++++++++++ 5 files changed, 40 insertions(+) diff --git a/docs/tfengine/schemas/resources.md b/docs/tfengine/schemas/resources.md index eddf2d02f..9a994db04 100755 --- a/docs/tfengine/schemas/resources.md +++ b/docs/tfengine/schemas/resources.md @@ -160,6 +160,9 @@ | healthcare_datasets.fhir_stores.labels.*pattern* | - | string | false | - | .+ | | healthcare_datasets.fhir_stores.name | Name of FHIR store. | string | true | - | - | | healthcare_datasets.fhir_stores.notification_config | See . | object | false | - | - | +| healthcare_datasets.fhir_stores.notification_configs | See . | object | false | - | - | +| healthcare_datasets.fhir_stores.notification_configs.pubsub_topic | - | string | true | - | - | +| healthcare_datasets.fhir_stores.notification_configs.send_full_resource | - | boolean | false | - | - | | healthcare_datasets.fhir_stores.stream_configs | See . | array(object) | false | - | - | | healthcare_datasets.fhir_stores.stream_configs.bigquery_destination | - | object | true | - | - | | healthcare_datasets.fhir_stores.stream_configs.bigquery_destination.dataset_uri | - | string | true | - | - | diff --git a/examples/tfengine/generated/team/project_data/main.tf b/examples/tfengine/generated/team/project_data/main.tf index 1011b60f0..da267d1d1 100644 --- a/examples/tfengine/generated/team/project_data/main.tf +++ b/examples/tfengine/generated/team/project_data/main.tf @@ -158,6 +158,10 @@ module "healthcare_dataset" { notification_config = { pubsub_topic = "projects/example-prod-data/topics/${module.topic.topic}" } + notification_configs = [{ + pubsub_topic = "projects/example-prod-data/topics/${module.topic.topic}" + send_full_resource = true + }] stream_configs = [ { bigquery_destination = { diff --git a/examples/tfengine/modules/team.hcl b/examples/tfengine/modules/team.hcl index 6f798e003..3a9fa13cf 100644 --- a/examples/tfengine/modules/team.hcl +++ b/examples/tfengine/modules/team.hcl @@ -421,6 +421,10 @@ template "project_data" { notification_config = { pubsub_topic = "projects/{{.prefix}}-{{.env}}-data/topics/$${module.topic.topic}" } + notification_configs = [{ + pubsub_topic = "projects/{{.prefix}}-{{.env}}-data/topics/$${module.topic.topic}" + send_full_resource = true + }] stream_configs = [{ resource_types = [ "Patient", diff --git a/templates/tfengine/components/resources/healthcare_datasets/main.tf b/templates/tfengine/components/resources/healthcare_datasets/main.tf index 0a162b749..ee89bc26a 100644 --- a/templates/tfengine/components/resources/healthcare_datasets/main.tf +++ b/templates/tfengine/components/resources/healthcare_datasets/main.tf @@ -87,6 +87,17 @@ module "{{resourceName . "name"}}" { } {{end -}} + {{if has . "notification_configs" -}} + notification_configs = [ + {{range $k, $v := .notification_configs -}} + { + pubsub_topic = "{{$v.pubsub_topic}}" + {{hclField $v "send_full_resource" -}} + }, + {{end -}} + ] + {{end -}} + {{if has . "stream_configs" -}} stream_configs = [ {{range $k, $v := .stream_configs -}} diff --git a/templates/tfengine/recipes/resources.hcl b/templates/tfengine/recipes/resources.hcl index ce3768984..3a574c577 100644 --- a/templates/tfengine/recipes/resources.hcl +++ b/templates/tfengine/recipes/resources.hcl @@ -994,6 +994,24 @@ schema = { description = "See ." type = "object" } + notification_configs = { + description = "See ." + type = "array" + items = { + type = "object" + required = [ + "pubsub_topic", + ] + properties = { + pubsub_topic = { + type = "string" + } + send_full_resource = { + type = "boolean" + } + } + } + } stream_configs = { description = "See ." type = "array"