FAQ | This is a LIVE service | Changelog

locals.tf 589 Bytes
Newer Older
1
2
3
4
5
# locals.tf defines common expressions used by the module.

locals {
  # Project containing existing Cloud SQL instance.
  sql_instance_project = coalesce(var.sql_instance_project, var.project)
Dr Rich Wareham's avatar
Dr Rich Wareham committed
6
7
8

  # Should a DNS domain mapping be created?
  domain_mapping_present = var.dns_name != ""
9
10
11
12
13
14
15

  # Hosts to monitor. We use the automatic host from Cloud Run and any custom
  # domain mapped host.
  monitor_hosts = var.disable_monitoring ? [] : concat(
    [trimsuffix(trimprefix(google_cloud_run_service.webapp.status[0].url, "https://"), "/")],
    var.dns_name != "" ? [var.dns_name] : []
  )
16
}