From 1de2488c5175fd0b68db80b5c38fe82ef3ebe0bf Mon Sep 17 00:00:00 2001
From: Ryan Kowalewski <rk725@cam.ac.uk>
Date: Wed, 8 Jan 2025 16:07:10 +0000
Subject: [PATCH] fix: local_files_dir variable workaround

---
 README.md    |  1 +
 main.tf      |  1 +
 variables.tf | 11 +++++++++++
 3 files changed, 13 insertions(+)

diff --git a/README.md b/README.md
index 3f259be..c38ab07 100644
--- a/README.md
+++ b/README.md
@@ -74,6 +74,7 @@ For more information on how the pre-deploy Cloud Run job works see the
 | <a name="input_ingress"></a> [ingress](#input\_ingress) | The ingress setting for the Cloud Run service. Possible values are<br>INGRESS\_TRAFFIC\_ALL, INGRESS\_TRAFFIC\_INTERNAL\_ONLY, and<br>INGRESS\_TRAFFIC\_INTERNAL\_LOAD\_BALANCER. | `string` | `null` | no |
 | <a name="input_launch_stage"></a> [launch\_stage](#input\_launch\_stage) | The launch stage for the Cloud Run service. Possible values are UNIMPLEMENTED,<br>PRELAUNCH, EARLY\_ACCESS, ALPHA, BETA, GA, and DEPRECATED. | `string` | `"GA"` | no |
 | <a name="input_load_balancer_backend"></a> [load\_balancer\_backend](#input\_load\_balancer\_backend) | Optional. Custom options for the backend load balancer.<br>Defaults to {}. | <pre>object({<br>    port_name               = optional(string)<br>    description             = optional(string)<br>    enable_cdn              = optional(bool, false)<br>    compression_mode        = optional(string)<br>    security_policy         = optional(string, null)<br>    edge_security_policy    = optional(string, null)<br>    custom_request_headers  = optional(list(string))<br>    custom_response_headers = optional(list(string))<br><br>    connection_draining_timeout_sec = optional(number)<br>    session_affinity                = optional(string)<br>    affinity_cookie_ttl_sec         = optional(number)<br>    locality_lb_policy              = optional(string)<br><br>    log_config = optional(object({<br>      enable      = optional(bool)<br>      sample_rate = optional(number)<br>    }))<br><br>    cdn_policy = optional(object({<br>      cache_mode                   = optional(string)<br>      signed_url_cache_max_age_sec = optional(string)<br>      default_ttl                  = optional(number)<br>      max_ttl                      = optional(number)<br>      client_ttl                   = optional(number)<br>      negative_caching             = optional(bool)<br>      negative_caching_policy = optional(object({<br>        code = optional(number)<br>        ttl  = optional(number)<br>      }))<br>      serve_while_stale = optional(number)<br>      cache_key_policy = optional(object({<br>        include_host           = optional(bool)<br>        include_protocol       = optional(bool)<br>        include_query_string   = optional(bool)<br>        query_string_blacklist = optional(list(string))<br>        query_string_whitelist = optional(list(string))<br>        include_http_headers   = optional(list(string))<br>        include_named_cookies  = optional(list(string))<br>      }))<br>      bypass_cache_on_request_headers = optional(list(string))<br>    }))<br><br>    outlier_detection = optional(object({<br>      base_ejection_time = optional(object({<br>        seconds = number<br>        nanos   = optional(number)<br>      }))<br>      consecutive_errors                    = optional(number)<br>      consecutive_gateway_failure           = optional(number)<br>      enforcing_consecutive_errors          = optional(number)<br>      enforcing_consecutive_gateway_failure = optional(number)<br>      enforcing_success_rate                = optional(number)<br>      interval = optional(object({<br>        seconds = number<br>        nanos   = optional(number)<br>      }))<br>      max_ejection_percent        = optional(number)<br>      success_rate_minimum_hosts  = optional(number)<br>      success_rate_request_volume = optional(number)<br>      success_rate_stdev_factor   = optional(number)<br>    }))<br>  })</pre> | `{}` | no |
+| <a name="input_local_files_dir"></a> [local\_files\_dir](#input\_local\_files\_dir) | A local directory where files may be created which persist between CI<br>pipeline runs but which are not checked into source control.<br>This variable is only to be used to pass a directory to the<br>gcp-site-monitoring module call. | `string` | `null` | no |
 | <a name="input_max_instance_request_concurrency"></a> [max\_instance\_request\_concurrency](#input\_max\_instance\_request\_concurrency) | Sets the maximum number of requests that each serving instance can receive. | `number` | `null` | no |
 | <a name="input_min_ports_per_vm"></a> [min\_ports\_per\_vm](#input\_min\_ports\_per\_vm) | When using Cloud NAT to provide an egress route, Cloud NAT's minimum ports per<br>VM can be configured to determine how many concurrent connections can be<br>established to the same destination IP address and port. | `number` | `64` | no |
 | <a name="input_monitoring_path"></a> [monitoring\_path](#input\_monitoring\_path) | Path component of url to be monitored. | `string` | `"/"` | no |
diff --git a/main.tf b/main.tf
index fbbd4b3..49a2b61 100644
--- a/main.tf
+++ b/main.tf
@@ -271,6 +271,7 @@ module "uptime_monitoring" {
   project                     = var.project
   monitoring_scoping_project  = coalesce(var.monitoring_scoping_project, var.project)
   alert_notification_channels = var.alerting_notification_channels
+  local_files_dir             = var.local_files_dir
 
   uptime_check = {
     # Accept either e.g. "60s" or 60 for timeout and periods for compatibility
diff --git a/variables.tf b/variables.tf
index 5a7da74..296fe31 100644
--- a/variables.tf
+++ b/variables.tf
@@ -805,3 +805,14 @@ Optional. Whether Terraform will be prevented from destroying
 the Cloud Run resource. Defaults to true.
 EOI
 }
+
+variable "local_files_dir" {
+  description = <<-EOI
+    A local directory where files may be created which persist between CI
+    pipeline runs but which are not checked into source control.
+    This variable is only to be used to pass a directory to the
+    gcp-site-monitoring module call.
+  EOI
+  type        = string
+  default     = null
+}
-- 
GitLab