Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

Support multiple custom domains #440

Merged
merged 1 commit into from
Sep 1, 2020
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
5 changes: 3 additions & 2 deletions terraform/service_admin_apiserver.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ resource "google_compute_backend_service" "adminapi" {
}

resource "google_cloud_run_domain_mapping" "adminapi" {
count = var.adminapi_custom_domain != "" ? 1 : 0
for_each = var.adminapi_custom_domains

location = var.cloudrun_location
name = var.adminapi_custom_domain
name = each.key

metadata {
namespace = var.project
Expand Down
5 changes: 3 additions & 2 deletions terraform/service_apiserver.tf
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ resource "google_compute_backend_service" "apiserver" {
}

resource "google_cloud_run_domain_mapping" "apiserver" {
count = var.apiserver_custom_domain != "" ? 1 : 0
for_each = var.apiserver_custom_domains

location = var.cloudrun_location
name = var.apiserver_custom_domain
name = each.key

metadata {
namespace = var.project
Expand Down
5 changes: 3 additions & 2 deletions terraform/service_server.tf
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,10 @@ resource "google_compute_backend_service" "server" {
}

resource "google_cloud_run_domain_mapping" "server" {
count = var.server_custom_domain != "" ? 1 : 0
for_each = var.server_custom_domains

location = var.cloudrun_location
name = var.server_custom_domain
name = each.key

metadata {
namespace = var.project
Expand Down
24 changes: 12 additions & 12 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,25 @@ variable "redis_cache_size" {
description = "Size of the Redis instance in GB."
}

variable "adminapi_custom_domain" {
type = string
default = ""
variable "adminapi_custom_domains" {
type = set(string)
default = []

description = "Custom domain to map for adminapi. This domain must already be verified by Google, and you must have a DNS CNAME record pointing to ghs.googlehosted.com in advance. If not provided, no domain mapping is created."
description = "Custom domains to map for adminapi. These domains must already be verified by Google, and you must have a DNS CNAME record pointing to ghs.googlehosted.com in advance."
}

variable "apiserver_custom_domain" {
type = string
default = ""
variable "apiserver_custom_domains" {
type = set(string)
default = []

description = "Custom domain to map for apiserver. This domain must already be verified by Google, and you must have a DNS CNAME record pointing to ghs.googlehosted.com in advance. If not provided, no domain mapping is created."
description = "Custom domains to map for apiserver. These domains must already be verified by Google, and you must have a DNS CNAME record pointing to ghs.googlehosted.com in advance."
}

variable "server_custom_domain" {
type = string
default = ""
variable "server_custom_domains" {
type = set(string)
default = []

description = "Custom domain to map for server. This domain must already be verified by Google, and you must have a DNS CNAME record pointing to ghs.googlehosted.com in advance. If not provided, no domain mapping is created."
description = "Custom domains to map for server. These domains must already be verified by Google, and you must have a DNS CNAME record pointing to ghs.googlehosted.com in advance."
}

variable "server-host" {
Expand Down