Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for sendFullResource field for configuring pub/sub notifications in FHIR Stores #12061

Comments

@jamesnicolas
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

In the v1beta1 API for Cloud Healthcare API, there is a feature that allows users to configure pub/sub notifications containing the full resource body instead of just the id/name of the resource. The documentation for that feature is here. This would be great to have since right now the only way for us to enable it is by using a local-exec provisioner that runs a shell script.

In our module, we have

  provisioner "local-exec" {
    command = "${path.module}/enable-pubsub-streaming.sh ${self.id} ${var.fhir_data_topic}"
  }

and the contents of the script

#!/bin/sh

FHIR_STORE=$1
PUBSUB_TOPIC=$2

sleep 10

curl -X PATCH \
    -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
    -H "Content-Type: application/fhir+json" \
    -d "{
          \"notificationConfigs\": [
            {
              \"pubsubTopic\": \"$PUBSUB_TOPIC\",
              \"sendFullResource\": true
            }
          ]
        }" \
    "https://healthcare.googleapis.com/v1beta1/$FHIR_STORE?updateMask=notificationConfigs"

The script works but it assumes gcloud is installed on the machine, doesn't allow us to make changes to the config through terraform itself, and only runs on resource creation so we can't really update this in the future, and all the other caveats that come with using a local-exec provisioner.

New or Affected Resource(s)

  • google_healthcare_fhir_store

Potential Terraform Configuration

resource "google_healthcare_fhir_store" "default" {
  provider = google-beta
  name    = "example-fhir-store"
  dataset = google_healthcare_dataset.default.id
  version = "R4"

  enable_update_create          = true
  disable_referential_integrity = false
  disable_resource_versioning   = false
  enable_history_import         = false

  notification_config {
    pubsub_topic = var.fhir_data_topic
    send_full_resource = true # default false
  }
}

References

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.