-
Notifications
You must be signed in to change notification settings - Fork 19
/
main.tf
169 lines (143 loc) · 5.65 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/**
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
resource "google_healthcare_dataset" "dataset" {
name = var.name
project = var.project
location = var.location
time_zone = var.time_zone
}
resource "google_healthcare_dicom_store" "dicom_stores" {
provider = google-beta
for_each = {
for s in var.dicom_stores :
s.name => s
}
name = each.value.name
dataset = google_healthcare_dataset.dataset.id
labels = lookup(each.value, "labels", null)
dynamic "notification_config" {
for_each = lookup(each.value, "notification_config", null) != null ? [each.value.notification_config] : []
content {
pubsub_topic = notification_config.value.pubsub_topic
}
}
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" {
provider = google-beta
for_each = {
for s in var.fhir_stores :
s.name => s
}
name = each.value.name
dataset = google_healthcare_dataset.dataset.id
version = each.value.version
labels = lookup(each.value, "labels", null)
enable_update_create = lookup(each.value, "enable_update_create", null)
disable_referential_integrity = lookup(each.value, "disable_referential_integrity", null)
disable_resource_versioning = lookup(each.value, "disable_resource_versioning", null)
enable_history_import = lookup(each.value, "enable_history_import", null)
complex_data_type_reference_parsing = lookup(each.value, "complex_data_type_reference_parsing", null)
dynamic "notification_config" {
for_each = lookup(each.value, "notification_config", null) != null ? [each.value.notification_config] : []
content {
pubsub_topic = notification_config.value.pubsub_topic
}
}
dynamic "notification_configs" {
for_each = lookup(each.value, "notification_configs", [])
content {
pubsub_topic = lookup(notification_configs.value, "pubsub_topic", null)
send_full_resource = lookup(notification_configs.value, "send_full_resource", null)
send_previous_resource_on_delete = lookup(notification_configs.value, "send_previous_resource_on_delete", null)
}
}
dynamic "stream_configs" {
for_each = lookup(each.value, "stream_configs", [])
content {
resource_types = lookup(stream_configs.value, "resource_types", null)
bigquery_destination {
dataset_uri = stream_configs.value.bigquery_destination.dataset_uri
schema_config {
schema_type = lookup(stream_configs.value.bigquery_destination.schema_config, "schema_type", null)
recursive_structure_depth = stream_configs.value.bigquery_destination.schema_config.recursive_structure_depth
dynamic "last_updated_partition_config" {
for_each = lookup(stream_configs.value.bigquery_destination.schema_config, "last_updated_partition_config", null) != null ? [stream_configs.value.bigquery_destination.schema_config.last_updated_partition_config] : []
content {
type = last_updated_partition_config.value.type
expiration_ms = lookup(last_updated_partition_config.value, "expiration_ms", null)
}
}
}
}
}
}
}
resource "google_healthcare_hl7_v2_store" "hl7_v2_stores" {
provider = google-beta
for_each = {
for s in var.hl7_v2_stores :
s.name => s
}
name = each.value.name
dataset = google_healthcare_dataset.dataset.id
labels = lookup(each.value, "labels", null)
dynamic "notification_configs" {
for_each = lookup(each.value, "notification_configs", [])
content {
pubsub_topic = notification_configs.value.pubsub_topic
}
}
dynamic "parser_config" {
for_each = lookup(each.value, "parser_config", null) != null ? [each.value.parser_config] : []
content {
allow_null_header = lookup(parser_config.value, "allow_null_header", null)
segment_terminator = lookup(parser_config.value, "segment_terminator", null)
schema = lookup(parser_config.value, "schema", null)
version = lookup(parser_config.value, "version", null)
}
}
}
resource "google_healthcare_consent_store" "consent_stores" {
for_each = {
for s in var.consent_stores :
s.name => s
}
name = each.value.name
dataset = google_healthcare_dataset.dataset.id
labels = lookup(each.value, "labels", null)
enable_consent_create_on_update = lookup(each.value, "enable_consent_create_on_update", null)
default_consent_ttl = lookup(each.value, "default_consent_ttl", null)
}
resource "google_healthcare_workspace" "workspaces" {
for_each = {
for s in var.workspaces :
s.name => s
}
name = each.value.name
dataset = google_healthcare_dataset.dataset.id
labels = lookup(each.value, "labels", null)
settings {
data_project_ids = lookup(each.value.settings, "data_project_ids", [])
}
}