docs: примеры DNS-зон и записей (карта зон + N зон в цикле)

This commit is contained in:
Repinoid
2026-10-16 15:50:50 +03:00
parent 4ebfa414bd
commit 42048d058a
14 changed files with 334 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
# Переменные примера. api_token — СЕКРЕТ, держать в secrets.auto.tfvars (не коммитить).
variable "api_token" {
description = "Nubes API token (JWT). Секрет — в secrets.auto.tfvars."
type = string
sensitive = true
}
variable "api_endpoint" {
description = "API Gateway URL стенда"
type = string
default = "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc"
}
# Зоны: карта «короткое имя → { zone_name, records }».
# records — карта «имя записи → { type, values }».
variable "zones" {
description = "Зоны компании: имя + записи (type / values[])"
type = map(object({
zone_name = string
records = map(object({
type = optional(string, "A")
values = list(string)
}))
}))
default = {
a = {
zone_name = "tfzone-a.test"
records = {
www = { type = "A", values = ["10.0.0.77", "203.0.113.14"] }
api = { type = "A", values = ["192.168.3.14", "10.0.0.2"] }
cdn = { type = "CNAME", values = ["www.tfzone-a.test."] }
}
}
b = {
zone_name = "tfzone-b.test"
records = {
www = { type = "A", values = ["172.16.5.20", "10.0.0.9"] }
api = { type = "A", values = ["10.0.0.8", "198.51.100.7"] }
cdn = { type = "CNAME", values = ["www.tfzone-b.test."] }
}
}
}
}