Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch subscription type for cloud-builds notifications #48

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@ resource "google_cloud_run_service" "http_notification" {
google_storage_bucket_object.http_notification,
]
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "name" {
value = google_cloud_run_service.http_notification.name
}

output "url" {
value = google_cloud_run_service.http_notification.status[0]["url"]
}
10 changes: 9 additions & 1 deletion experimental/terraform/data_parser/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
output "cloud_run_endpoint" {
value = google_cloud_run_service.parser.status[0]["url"]
}
}

output "trigger_name" {
value = module.cloudbuild_for_parser.name
}

output "notification_url" {
value = module.cloudbuild_notification.url
}
2 changes: 1 addition & 1 deletion experimental/terraform/resource_event_handler.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ module "event_handler_cloudbuild_notification" {
trigger_id = module.event_handler_cloudbuild_trigger.id
trigger_name = module.event_handler_cloudbuild_trigger.name
url = length(var.mapped_domain) > 0 ? try("https://${var.subdomain}.${var.mapped_domain}", null) : google_cloud_run_service.event_handler.status[0]["url"]
}
}
14 changes: 9 additions & 5 deletions experimental/terraform/resource_pubsub.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ module "pubsub" {

topic = "cloud-builds" # see https://cloud.google.com/build/docs/configuring-notifications/configure-https for set up and consumption
project_id = var.google_project_id
pull_subscriptions = [
{
name = "pull"

push_subscriptions = concat([for item in var.parsers : {
name = module.data_parser_service[item].trigger_name
push_endpoint = module.data_parser_service[item].notification_url
service_account = module.service_account_for_cloudrun.email
}
]
}],[{
name = module.event_handler_cloudbuild_trigger.name
push_endpoint = module.event_handler_cloudbuild_notification.url
service_account = module.service_account_for_cloudrun.email
}])
}