Initial setup of a cloud function.

This commit is contained in:
Tom Alexander
2021-07-20 22:24:32 -04:00
parent b0bc1c1520
commit e3b6049f60
6 changed files with 122 additions and 0 deletions

View File

@@ -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" {