Initial setup of a cloud function.
This commit is contained in:
@@ -185,6 +185,37 @@ output "redis_port" {
|
||||
value = module.redis.redis_port
|
||||
}
|
||||
|
||||
#################### Cloudfunction to PubSub ##############
|
||||
|
||||
resource "google_project_service" "cloudbuild" {
|
||||
project = var.project
|
||||
service = "cloudbuild.googleapis.com"
|
||||
disable_dependent_services = true
|
||||
}
|
||||
|
||||
resource "random_id" "cf_bucket_id" {
|
||||
byte_length = 4
|
||||
}
|
||||
|
||||
resource "google_storage_bucket" "bucket" {
|
||||
project = var.project
|
||||
name = "cloudfunc-${random_id.cf_bucket_id.hex}"
|
||||
force_destroy = true
|
||||
}
|
||||
|
||||
module "cf_to_pubsub" {
|
||||
source = "../modules/cf_to_pubsub"
|
||||
project = var.project
|
||||
region = var.region
|
||||
source_bucket = google_storage_bucket.bucket
|
||||
service_cloudbuild = google_project_service.cloudbuild
|
||||
}
|
||||
|
||||
output "log_to_bq_endpoint" {
|
||||
description = "https endpoint to log to BigQuery."
|
||||
value = module.cf_to_pubsub.https_trigger_url
|
||||
}
|
||||
|
||||
#################### PubSub to BigQuery ###################
|
||||
|
||||
module "bigquery" {
|
||||
|
||||
Reference in New Issue
Block a user