refactor: rename hostnames to subdomains

This commit is contained in:
Yuris Cakranegara
2025-06-07 15:21:02 +10:00
parent d441e80fbd
commit 0f3d672a11
4 changed files with 8 additions and 8 deletions

View File

@@ -29,10 +29,10 @@ locals {
// Transform service definitions into ingress rules format, only for services with ingress_enabled
service_ingress_rules = flatten([
for service in var.service_definitions :
// Only process services with hostnames AND where ingress is enabled (or default to true for backward compatibility)
(length(service.hostnames) > 0) ? [
for hostname in service.hostnames : {
hostname = "${hostname}.${var.domain}"
// Only process services with subdomains AND where ingress is enabled (or default to true for backward compatibility)
(length(service.subdomains) > 0) ? [
for subdomain in service.subdomains : {
hostname = "${subdomain}.${var.domain}"
service = service.endpoint
}
] : []

View File

@@ -53,7 +53,7 @@ variable "service_definitions" {
name = string
primary_port = number
endpoint = string
hostnames = optional(list(string), [])
subdomains = optional(list(string), [])
}))
default = []
}