GCP Cloud Run manager terraform module
This module manages a Cloud Run-hosted container. It takes care of making sure the container is connected to a Cloud SQL instance and sets environment variables on the application.
Closes #1 (closed)
Merge request reports
Activity
changed milestone to %Sprint 92
- Resolved by Dr Abraham Martin
- Resolved by Dr Rich Wareham
- variables.tf 0 → 100644
37 description = "Maximum number of concurrent requests to an instance before it is auto-scaled. Defaults to 80 which is the maximum that Cloud Run allows" 38 default = "80" 39 } 40 41 variable "cpu_limit" { 42 description = "CPU limit for the deployed container. Defaults to 1 CPU." 43 default = "1000m" 44 } 45 46 variable "memory_limit" { 47 description = "Memory limit for the deployed container. Defaults to 512 MB." 48 default = "512M" 49 } 50 51 variable "webapp_open" { 52 description = "By default Cloud Run does not allow non-authenticated traffic to the web app. This settings changes that default to be open to all traffic (value of 1). Change it to 0 if you don't want to change default behaviour." Is there a pressing reason not to have this be something like:
variable "webapp_open" { description = <<EOI If true, the webapp will allow unauthenticated invocations. If false, the webapp requires authentication as a Google user with the Cloud Run invoker permission on the deployment. EOI type = bool default = true }
After all, we have booleans. Let's use them.
Edited by Dr Rich Warehamchanged this line in version 4 of the diff
Yes, but that doesn't mean we need to have an unfriendly interface. You could turn the boolean into a count and hide the implementation detail from the caller:
# Allow unauthenticated invocations for the webapp. resource "google_cloud_run_service_iam_member" "webapp_all_users_invoker" { count = var.webapp_open ? 1 : 0 location = google_cloud_run_service.webapp.location project = google_cloud_run_service.webapp.project service = google_cloud_run_service.webapp.name role = "roles/run.invoker" member = "allUsers" }
Aside from not being a friendly interface, having it be numeric guarantees someone will set it to "2" by mistake.
- Resolved by Dr Rich Wareham
- Resolved by Dr Rich Wareham
enabled an automatic merge when the pipeline for 58f62e4d succeeds
mentioned in commit 2ea2b9d7