Skip to content

Commit

Permalink
Healthcare Fhir Store, promote notification_configs field to GA, de…
Browse files Browse the repository at this point in the history
…precation message for `notification_config` (GoogleCloudPlatform#10851)
averbuks authored Jun 3, 2024
1 parent 5449997 commit 710c06b
Showing 6 changed files with 13 additions and 20 deletions.
5 changes: 3 additions & 2 deletions mmv1/products/healthcare/FhirStore.yaml
Original file line number Diff line number Diff line change
@@ -55,9 +55,9 @@ examples:
dataset_name: 'example-dataset'
fhir_store_name: 'example-fhir-store'
pubsub_topic: 'fhir-notifications'
skip_docs: true
- !ruby/object:Provider::Terraform::Examples
name: 'healthcare_fhir_store_notification_configs'
min_version: beta
primary_resource_id: 'default'
vars:
dataset_name: 'example-dataset'
@@ -192,6 +192,8 @@ properties:
- !ruby/object:Api::Type::NestedObject
name: notificationConfig
deprecation_message: >-
`notification_config` is deprecated and will be removed in a future major release. Use `notification_configs` instead.
required: false
properties:
- !ruby/object:Api::Type::String
@@ -300,7 +302,6 @@ properties:
name: notificationConfigs
description: |-
A list of notifcation configs that configure the notification for every resource mutation in this FHIR store.
min_version: beta
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ resource "google_healthcare_fhir_store" "default" {
enable_history_import = false
default_search_handling_strict = false

notification_config {
notification_configs {
pubsub_topic = google_pubsub_topic.topic.id
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
resource "google_healthcare_fhir_store" "default" {
provider = google-beta
name = "{{index $.Vars "fhir_store_name"}}"
dataset = google_healthcare_dataset.dataset.id
version = "R4"
@@ -8,7 +7,6 @@ resource "google_healthcare_fhir_store" "default" {
disable_referential_integrity = false
disable_resource_versioning = false
enable_history_import = false
enable_history_modifications = false

labels = {
label1 = "labelvalue1"
@@ -22,12 +20,10 @@ resource "google_healthcare_fhir_store" "default" {
}

resource "google_pubsub_topic" "topic" {
provider = google-beta
name = "{{index $.Vars "pubsub_topic"}}"
}

resource "google_healthcare_dataset" "dataset" {
provider = google-beta
name = "{{index $.Vars "dataset_name"}}"
location = "us-central1"
}
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ resource "google_healthcare_fhir_store" "default" {
enable_history_import = false
default_search_handling_strict = false

notification_config {
notification_configs {
pubsub_topic = google_pubsub_topic.topic.id
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
resource "google_healthcare_fhir_store" "default" {
provider = google-beta
name = "<%= ctx[:vars]['fhir_store_name'] %>"
dataset = google_healthcare_dataset.dataset.id
version = "R4"
@@ -8,7 +7,6 @@ resource "google_healthcare_fhir_store" "default" {
disable_referential_integrity = false
disable_resource_versioning = false
enable_history_import = false
enable_history_modifications = false

labels = {
label1 = "labelvalue1"
@@ -22,12 +20,10 @@ resource "google_healthcare_fhir_store" "default" {
}

resource "google_pubsub_topic" "topic" {
provider = google-beta
name = "<%= ctx[:vars]['pubsub_topic']%>"
}

resource "google_healthcare_dataset" "dataset" {
provider = google-beta
name = "<%= ctx[:vars]['dataset_name'] %>"
location = "us-central1"
}
Original file line number Diff line number Diff line change
@@ -156,19 +156,16 @@ resource "google_healthcare_fhir_store" "default" {
version = "R4"


notification_config {
pubsub_topic = google_pubsub_topic.topic.id
}

<% unless version == "ga" -%>
notification_configs {
pubsub_topic = google_pubsub_topic.topic.id
send_full_resource = true
send_previous_resource_on_delete = true
}

<% unless version == "ga" -%>
enable_history_modifications = true
<% end -%>

labels = {
label1 = "labelvalue1"
}
@@ -221,9 +218,12 @@ func testAccCheckGoogleHealthcareFhirStoreUpdate(t *testing.T, pubsubTopic strin
return fmt.Errorf("fhirStore labels not updated: %s", gcpResourceUri)
}

topicName := path.Base(response.NotificationConfig.PubsubTopic)
if topicName != pubsubTopic {
return fmt.Errorf("fhirStore 'NotificationConfig' not updated ('%s' != '%s'): %s", topicName, pubsubTopic, gcpResourceUri)
notifications := response.NotificationConfigs
if len(notifications) > 0 {
topicName := path.Base(notifications[0].PubsubTopic)
if topicName != pubsubTopic {
return fmt.Errorf("fhirStore 'NotificationConfig' not updated ('%s' != '%s'): %s", topicName, pubsubTopic, gcpResourceUri)
}
}
}

0 comments on commit 710c06b

Please sign in to comment.