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

feat: Add dicom bq support #48

Merged
merged 7 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ These sections describe requirements for using this module.
The following dependencies must be available:

- [Terraform][terraform] v0.13
- [Terraform Provider for GCP][terraform-provider-gcp] plugin v3.54.0
- [Terraform Provider for GCP][terraform-provider-gcp] plugin v3.67.0

### Service Account

Expand Down
15 changes: 15 additions & 0 deletions examples/simple_example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ resource "google_bigquery_dataset" "example_dataset" {
project = var.project
}

resource "google_bigquery_table" "example_table" {
dataset_id = google_bigquery_dataset.example_dataset.dataset_id
table_id = "example_table"
project = var.project
deletion_protection = false
}
xingao267 marked this conversation as resolved.
Show resolved Hide resolved

module "pubsub" {
source = "terraform-google-modules/pubsub/google"
version = "~> 1.8"
Expand Down Expand Up @@ -61,6 +68,14 @@ module "healthcare" {
role = "roles/healthcare.dicomEditor"
member = local.sa_member
}]
},
{
name = "example-dicom-c"
stream_configs = [{
bigquery_destination = {
table_uri = "bq://${var.project}.${google_bigquery_dataset.example_dataset.dataset_id}.${google_bigquery_table.example_table.table_id}"
}
}]
}
]
fhir_stores = [
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_example/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
terraform {
required_version = ">= 0.13"
required_providers {
google = ">= 3.54.0"
google-beta = ">= 3.54.0"
google = ">= 3.67.0"
google-beta = ">= 3.67.0"
}
}
11 changes: 11 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ resource "google_healthcare_dataset" "dataset" {
}

resource "google_healthcare_dicom_store" "dicom_stores" {
provider = google-beta

for_each = {
for s in var.dicom_stores :
s.name => s
Expand All @@ -38,6 +40,15 @@ resource "google_healthcare_dicom_store" "dicom_stores" {
}
}

dynamic "stream_configs" {
for_each = lookup(each.value, "stream_configs", [])

content {
bigquery_destination {
table_uri = stream_configs.value.bigquery_destination.table_uri
}
}
}
}

resource "google_healthcare_fhir_store" "fhir_stores" {
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/simple_example/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
terraform {
required_version = ">= 0.13"
required_providers {
google = ">= 3.54.0"
google-beta = ">= 3.54.0"
google = ">= 3.67.0"
google-beta = ">= 3.67.0"
}
}
1 change: 1 addition & 0 deletions test/integration/simple_example/controls/gcloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
its(:stderr) { should eq "" }
its(:stdout) { should include "example-dicom-a" }
its(:stdout) { should include "example-dicom-b" }
its(:stdout) { should include "example-dicom-c" }
chaopeng marked this conversation as resolved.
Show resolved Hide resolved
end

# FHIR stores
Expand Down
4 changes: 2 additions & 2 deletions test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
terraform {
required_version = ">= 0.13"
required_providers {
google = ">= 3.54.0"
google-beta = ">= 3.54.0"
google = ">= 3.67.0"
google-beta = ">= 3.67.0"
}
}