Skip to content

Commit

Permalink
Parameterize dataset_id in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shanecglass committed Oct 9, 2023
1 parent 781c1e4 commit 9e7aa8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions modules/data_warehouse/templates/workflow.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ copy_objects:
assign:
- source_bucket: "data-analytics-demos"
- dest_bucket: ${raw_bucket}
- dataset_id: ${dataset_id}
- copied_objects: []
- list_objects:
call: googleapis.storage.v1.objects.list
Expand Down Expand Up @@ -81,8 +82,8 @@ create_tables:
- results: {}
- project_id: $${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
- map:
1: $${"CALL `"+project_id+".thelook.sp_provision_lookup_tables`();"}
2: $${"CALL `"+project_id+".thelook.sp_lookerstudio_report`();"}
1: $${"CALL `"+project_id+".dataset_id.sp_provision_lookup_tables`();"}
2: $${"CALL `"+project_id+".dataset_id.sp_lookerstudio_report`();"}
- loopStepTables:
for:
value: key
Expand Down
3 changes: 2 additions & 1 deletion modules/data_warehouse/workflows.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ resource "google_workflows_workflow" "workflow" {
service_account = google_service_account.workflow_service_account.id

source_contents = templatefile("${path.module}/templates/workflow.tftpl", {
raw_bucket = google_storage_bucket.raw_bucket.name
raw_bucket = google_storage_bucket.raw_bucket.name,
dataset_id = google_bigquery_dataset.ds_edw.dataset_id
})

labels = var.labels
Expand Down

0 comments on commit 9e7aa8b

Please sign in to comment.