More explicit naming in CR services to later refer to them

This commit is contained in:
Julio Diez 2023-02-23 20:45:00 +01:00
parent 5065a52382
commit d538e066a2
3 changed files with 9 additions and 15 deletions

View File

@ -104,10 +104,10 @@ module "project_svc1" {
###############################################################################
# Cloud Run service in main project
module "cloud_run" {
module "cloud_run_hello" {
source = "../../../modules/cloud-run"
project_id = module.project_main.project_id
name = var.run_svc_name
name = "hello"
region = var.region
containers = [{
image = var.image
@ -123,11 +123,11 @@ module "cloud_run" {
}
# Cloud Run service 1 in service project
module "cloud_run_cr1" {
module "cloud_run_cart" {
source = "../../../modules/cloud-run"
count = var.custom_domain == null ? 0 : 1
project_id = module.project_svc1[0].project_id
name = local.service_name_cr1
name = local.service_name_cr1 # "cart"
region = var.region
containers = [{
image = var.image
@ -143,11 +143,11 @@ module "cloud_run_cr1" {
}
# Cloud Run service 2 in service project
module "cloud_run_cr2" {
module "cloud_run_checkout" {
source = "../../../modules/cloud-run"
count = var.custom_domain == null ? 0 : 1
project_id = module.project_svc1[0].project_id
name = local.service_name_cr2
name = local.service_name_cr2 # "checkout"
region = var.region
containers = [{
image = var.image

View File

@ -14,9 +14,9 @@
* limitations under the License.
*/
output "default_URL" {
description = "Cloud Run service default URL."
value = module.cloud_run.service.status[0].url
output "default_URL_hello" {
description = "Cloud Run service 'hello' default URL."
value = module.cloud_run_hello.service.status[0].url
}
output "load_balancer_ip" {

View File

@ -131,12 +131,6 @@ variable "region" {
default = "europe-west1"
}
variable "run_svc_name" {
description = "Cloud Run service name."
type = string
default = "hello"
}
variable "tf_identity" {
description = "Terraform identity to include in VPC SC perimeter."
type = string