Deploy CR service in service project if use case is using ILB
This commit is contained in:
parent
117141cdb0
commit
29af0f3b31
|
@ -92,7 +92,8 @@ module "project_svc1" {
|
||||||
}
|
}
|
||||||
services = [
|
services = [
|
||||||
"compute.googleapis.com",
|
"compute.googleapis.com",
|
||||||
"dns.googleapis.com"
|
"dns.googleapis.com",
|
||||||
|
"run.googleapis.com"
|
||||||
]
|
]
|
||||||
skip_delete = true
|
skip_delete = true
|
||||||
}
|
}
|
||||||
|
@ -101,12 +102,14 @@ module "project_svc1" {
|
||||||
# Cloud Run #
|
# Cloud Run #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# Cloud Run service in main project
|
# Cloud Run service. Usually in the main project, but created in a service project
|
||||||
|
# if the use case is using an L7ILB and custom domain
|
||||||
module "cloud_run_main" {
|
module "cloud_run_main" {
|
||||||
source = "../../../modules/cloud-run"
|
source = "../../../modules/cloud-run"
|
||||||
project_id = module.project_main.project_id
|
project_id = (var.custom_domain == null ?
|
||||||
name = var.run_svc_name
|
module.project_main.project_id : module.project_svc1[0].project_id)
|
||||||
region = var.region
|
name = var.run_svc_name
|
||||||
|
region = var.region
|
||||||
containers = [{
|
containers = [{
|
||||||
image = var.image
|
image = var.image
|
||||||
options = null
|
options = null
|
||||||
|
|
|
@ -29,6 +29,12 @@ variable "access_policy_create" {
|
||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "custom_domain" {
|
||||||
|
description = "Custom domain for the Load Balancer."
|
||||||
|
type = string
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "image" {
|
variable "image" {
|
||||||
description = "Container image to deploy."
|
description = "Container image to deploy."
|
||||||
type = string
|
type = string
|
||||||
|
|
Loading…
Reference in New Issue