diff --git a/CHANGELOG b/CHANGELOG index 067463c679b5106442674272e06e2c58883c6462..c560e5afa31820c7c25c3c7a705ecc32266e59c5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,12 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [4.1.1] - 2022-01-17 +## [4.1.3] - 2022-01-24 ### Added - Add a monitoring dashboard, defined in ./dashboard.json, for the Cloud Run service. The dashboard contains charts for Request count and latency, CPU and memory utilisation, and container instance count and billable time. +## [4.1.2] - 2022-01-10 +### Fixed + - Correct logic used to decide if custom domains can be monitored. + +## [4.1.1] - 2022-01-06 +### Fixed + - Remove use of hard-coded resource name in data resource. + ## [4.1.0] - 2021-07-28 ### Added - Support load balancer ingress style alongside Cloud Run domain mapping. diff --git a/locals.tf b/locals.tf index 9604657c677e00f8469ca25814c72a6c03454e5b..6ba5555d9f487d674d99482a8b4e497bab83cc10 100644 --- a/locals.tf +++ b/locals.tf @@ -45,9 +45,9 @@ locals { var.enable_beta_launch_stage || length(var.secrets_volume) != 0 || length(var.secrets_envars) != 0 ) - # Whether we should monitor the custom domain - only possible if there is a dns_name - # set and unauthenticated invocation is enabled - can_monitor_custom_dns = var.dns_name != "" && var.allow_unauthenticated_invocations + # Whether we should monitor the custom domain - only possible if there are a dns names + # set and unauthenticated invocation is enabled. + can_monitor_custom_dns = length(local.dns_names) > 0 && var.allow_unauthenticated_invocations # Holds which VPC connector can be used for the auth proxy Cloud Function egress settings auth_proxy_egress_connector = var.enable_static_egress_ip ? google_vpc_access_connector.static-ip-connector[0].id : var.auth_proxy_egress_connector @@ -61,9 +61,12 @@ locals { "enable_egress_connector" = local.webapp_allowed_ingress != "all" }, }, - local.can_monitor_custom_dns ? { (var.dns_name) = { - "enable_auth_proxy" = local.webapp_allowed_ingress == "internal", - "enable_egress_connector" = local.webapp_allowed_ingress == "internal" - } } : {} + local.can_monitor_custom_dns ? { + for dns_name in local.dns_names : + (dns_name) => { + "enable_auth_proxy" = local.webapp_allowed_ingress == "internal", + "enable_egress_connector" = local.webapp_allowed_ingress == "internal" + } + } : {} ) } diff --git a/main.tf b/main.tf index 5925ece0e61f9c67b0dc2d812d79263a0b73f5f7..edd1277dd32f45c180eb652207051a478289a817 100644 --- a/main.tf +++ b/main.tf @@ -277,6 +277,6 @@ module "uptime_monitoring" { # starting the plan walk. This is current behaviour, but may change in future see # https://github.com/hashicorp/terraform/issues/17034. data "google_cloud_run_service" "webapp" { - name = "webapp" + name = var.name location = var.cloud_run_region }