-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
59 lines (49 loc) · 1.63 KB
/
variables.tf
File metadata and controls
59 lines (49 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
variable "owner_tag" {
description = "Propietario de la VNet"
type = string
validation {
condition = length(trim(var.owner_tag, " ")) > 0
error_message = "El valor de owner_tag no puede estar vacío."
}
}
variable "environment_tag" {
description = "Entorno de la VNet (DEV, PRO, TES, PRE)"
type = string
validation {
condition = contains(
["DEV", "PRO", "TES", "PRE"],
upper(trim(var.environment_tag, " "))
)
error_message = "environment_tag debe ser uno de: DEV, PRO, TES o PRE (insensible a mayúsculas)."
}
}
variable "vnet_name" {
description = "Nombre de la VNet"
type = string
validation {
condition = can(regex("^vnet[a-z]{3,}tfexercise[0-9]{2}$", var.vnet_name))
error_message = "vnet_name debe empezar por 'vnet', seguido de al menos 3 letras minúsculas, y terminar en 'tfexercise' seguido de 2 dígitos (ej: vnetoscarztfexercise01)."
}
}
variable "vnet_address_space" {
description = "Rango de direcciones IP para la VNet"
type = list(string)
}
variable "location" {
description = "Ubicación de la VNet"
type = string
default = "West Europe"
}
variable "vnet_tags" {
description = "Mapa de tags adicionales para la VNet"
type = map(string)
default = {}
validation {
condition = var.vnet_tags != null && alltrue([for value in var.vnet_tags : length(trim(value, " ")) > 0])
error_message = "vnet_tags no puede ser null y todos los valores deben ser cadenas no vacías."
}
}
variable "existent_resource_group_name" {
description = "Nombre del resource group ya existente"
type = string
}