Skip to content

Commit ab9ed8c

Browse files
authored
feat: Add output variable env_vars (#375)
1 parent 9c2bffc commit ab9ed8c

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ This module provisions a dataset and a list of tables with associated JSON schem
215215
| bigquery\_external\_tables | Map of BigQuery external table resources being provisioned. |
216216
| bigquery\_tables | Map of bigquery table resources being provisioned. |
217217
| bigquery\_views | Map of bigquery view resources being provisioned. |
218+
| env\_vars | Exported environment variables |
218219
| external\_table\_ids | Unique IDs for any external tables being provisioned |
219220
| external\_table\_names | Friendly names for any external tables being provisioned |
220221
| project | Project where the dataset and tables are created |

metadata.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,16 @@ spec:
329329
type:
330330
- object
331331
- {}
332+
- name: env_vars
333+
description: Exported environment variables
334+
type:
335+
- object
336+
- BIGQUERY_DATASET: string
337+
BIGQUERY_EXTERNAL_TABLES: string
338+
BIGQUERY_MATERIALIZED_VIEWS: string
339+
BIGQUERY_ROUTINES: string
340+
BIGQUERY_TABLES: string
341+
BIGQUERY_VIEWS: string
332342
- name: external_table_ids
333343
description: Unique IDs for any external tables being provisioned
334344
type:

outputs.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,15 @@ output "routine_ids" {
9494
]
9595
description = "Unique IDs for any routine being provisioned"
9696
}
97+
98+
output "env_vars" {
99+
value = {
100+
"BIGQUERY_DATASET" = google_bigquery_dataset.main.dataset_id
101+
"BIGQUERY_TABLES" = jsonencode([for table in google_bigquery_table.main : table.table_id])
102+
"BIGQUERY_VIEWS" = jsonencode([for table in google_bigquery_table.view : table.table_id])
103+
"BIGQUERY_MATERIALIZED_VIEWS" = jsonencode([for table in google_bigquery_table.materialized_view : table.table_id])
104+
"BIGQUERY_EXTERNAL_TABLES" = jsonencode([for table in google_bigquery_table.external_table : table.table_id])
105+
"BIGQUERY_ROUTINES" = jsonencode([for routine in google_bigquery_routine.routine : routine.routine_id])
106+
}
107+
description = "Exported environment variables"
108+
}

0 commit comments

Comments
 (0)