Add support for a second function to log directly to bigquery.
This commit is contained in:
@@ -204,19 +204,46 @@ resource "google_storage_bucket" "bucket" {
|
||||
}
|
||||
|
||||
module "cf_to_pubsub" {
|
||||
source = "../modules/cf_to_pubsub"
|
||||
project = var.project
|
||||
region = var.region
|
||||
topic_name = "bigquery-etl"
|
||||
source_bucket = google_storage_bucket.bucket
|
||||
service_cloudbuild = google_project_service.cloudbuild
|
||||
source = "../modules/cf_to_pubsub"
|
||||
project = var.project
|
||||
region = var.region
|
||||
function_name = "cf-to-pubsub"
|
||||
function_description = "CloudFunction to PubSub"
|
||||
function_source_name = "cf_to_pubsub"
|
||||
source_bucket = google_storage_bucket.bucket
|
||||
service_cloudbuild = google_project_service.cloudbuild
|
||||
|
||||
environment_variables = {
|
||||
GCP_PROJECT = var.project
|
||||
GCP_TOPIC = "bigquery-etl"
|
||||
}
|
||||
}
|
||||
|
||||
output "log_to_bq_endpoint" {
|
||||
description = "https endpoint to log to BigQuery."
|
||||
output "cf_to_pubsub_endpoint" {
|
||||
description = "https endpoint to log to BigQuery through pubsub."
|
||||
value = module.cf_to_pubsub.https_trigger_url
|
||||
}
|
||||
|
||||
module "cf_to_bq" {
|
||||
source = "../modules/cf_to_pubsub"
|
||||
project = var.project
|
||||
region = var.region
|
||||
function_name = "cf-to-bq"
|
||||
function_description = "CloudFunction to BigQuery"
|
||||
function_source_name = "cf_to_bq"
|
||||
source_bucket = google_storage_bucket.bucket
|
||||
service_cloudbuild = google_project_service.cloudbuild
|
||||
|
||||
environment_variables = {
|
||||
BQ_TABLE = "${var.project}.pubsub_etl.pubsub_etl"
|
||||
}
|
||||
}
|
||||
|
||||
output "cf_to_bq_endpoint" {
|
||||
description = "https endpoint to log to BigQuery directly."
|
||||
value = module.cf_to_bq.https_trigger_url
|
||||
}
|
||||
|
||||
#################### PubSub to BigQuery ###################
|
||||
|
||||
module "bigquery" {
|
||||
|
||||
Reference in New Issue
Block a user