Create more backend services and url map for them

This commit is contained in:
Julio Diez 2023-02-23 19:16:27 +01:00
parent aa385241db
commit ba0ec82144
1 changed files with 45 additions and 0 deletions

View File

@ -322,6 +322,20 @@ module "ilb-l7" {
}]
health_checks = []
}
cart = {
project_id = module.project_svc1[0].project_id
backends = [{
group = "cr1"
}]
health_checks = []
}
checkout = {
project_id = module.project_svc1[0].project_id
backends = [{
group = "cr2"
}]
health_checks = []
}
}
health_check_configs = {}
neg_configs = {
@ -334,6 +348,37 @@ module "ilb-l7" {
}
}
}
cr2 = {
project_id = module.project_svc1[0].project_id
cloudrun = {
region = var.region
target_service = {
name = local.service_name_cr2
}
}
}
}
urlmap_config = {
default_service = "default"
host_rules = [{
hosts = ["*"]
path_matcher = "pathmap"
}]
path_matchers = {
pathmap = {
default_service = "default"
path_rules = [
{
paths = ["/cart", "/cart/*"]
service = local.service_name_cr1
},
{
paths = ["/checkout", "/checkout/*"]
service = local.service_name_cr2
}
]
}
}
}
vpc_config = {
network = module.vpc_main.self_link