diff --git a/README.md b/README.md index b6f1907e..70fc7abb 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,7 @@ This module provisions a dataset and a list of tables with associated JSON schem | bigquery\_external\_tables | Map of BigQuery external table resources being provisioned. | | bigquery\_tables | Map of bigquery table resources being provisioned. | | bigquery\_views | Map of bigquery view resources being provisioned. | +| env\_vars | Exported environment variables | | external\_table\_ids | Unique IDs for any external tables being provisioned | | external\_table\_names | Friendly names for any external tables being provisioned | | project | Project where the dataset and tables are created | diff --git a/metadata.yaml b/metadata.yaml index 15a5abbc..0c8d3574 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -329,6 +329,16 @@ spec: type: - object - {} + - name: env_vars + description: Exported environment variables + type: + - object + - BIGQUERY_DATASET: string + BIGQUERY_EXTERNAL_TABLES: string + BIGQUERY_MATERIALIZED_VIEWS: string + BIGQUERY_ROUTINES: string + BIGQUERY_TABLES: string + BIGQUERY_VIEWS: string - name: external_table_ids description: Unique IDs for any external tables being provisioned type: diff --git a/outputs.tf b/outputs.tf index 083a1563..025270a2 100644 --- a/outputs.tf +++ b/outputs.tf @@ -94,3 +94,15 @@ output "routine_ids" { ] description = "Unique IDs for any routine being provisioned" } + +output "env_vars" { + value = { + "BIGQUERY_DATASET" = google_bigquery_dataset.main.dataset_id + "BIGQUERY_TABLES" = jsonencode([for table in google_bigquery_table.main : table.table_id]) + "BIGQUERY_VIEWS" = jsonencode([for table in google_bigquery_table.view : table.table_id]) + "BIGQUERY_MATERIALIZED_VIEWS" = jsonencode([for table in google_bigquery_table.materialized_view : table.table_id]) + "BIGQUERY_EXTERNAL_TABLES" = jsonencode([for table in google_bigquery_table.external_table : table.table_id]) + "BIGQUERY_ROUTINES" = jsonencode([for routine in google_bigquery_routine.routine : routine.routine_id]) + } + description = "Exported environment variables" +}