-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
109 lines (94 loc) · 3.04 KB
/
variables.tf
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#################################################
#Variables associated with resource naming module
##################################################
variable "logical_product_name" {
type = string
description = "(Required) Name of the application for which the resource is created."
nullable = false
validation {
condition = length(trimspace(var.logical_product_name)) <= 15 && length(trimspace(var.logical_product_name)) > 0
error_message = "Length of the logical product name must be between 1 to 15 characters."
}
}
variable "class_env" {
type = string
description = "(Required) Environment where resource is going to be deployed. For ex. dev, qa, uat"
nullable = false
validation {
condition = length(trimspace(var.class_env)) <= 15 && length(trimspace(var.class_env)) > 0
error_message = "Length of the environment must be between 1 to 15 characters."
}
validation {
condition = length(regexall("\\b \\b", var.class_env)) == 0
error_message = "Spaces between the words are not allowed."
}
}
variable "instance_env" {
type = number
description = "Number that represents the instance of the environment."
default = 0
validation {
condition = var.instance_env >= 0 && var.instance_env <= 999
error_message = "Instance number should be between 1 to 999."
}
}
variable "instance_resource" {
type = number
description = "Number that represents the instance of the resource."
default = 0
validation {
condition = var.instance_resource >= 0 && var.instance_resource <= 100
error_message = "Instance number should be between 1 to 100."
}
}
variable "use_azure_region_abbr" {
description = "Whether to use region abbreviation e.g. eastus -> eus"
type = bool
default = false
}
variable "resource_types" {
description = "Map of cloud resource types to be used in this module"
type = map(object({
type = string
maximum_length = number
}))
default = {
"resource_group" = {
type = "rg"
maximum_length = 63
}
"container_registry" = {
type = "acr"
maximum_length = 30
}
}
}
#################################################
#Variables associated with resource group module
##################################################
variable "resource_group" {
description = "resource group primitive options"
type = object({
location = string
})
validation {
condition = length(regexall("\\b \\b", var.resource_group.location)) == 0
error_message = "Spaces between the words are not allowed."
}
}
#################################################
#Variables associated with container registry module
##################################################
variable "container_registry" {
description = "container registry primitive options"
type = object({
admin_enabled = bool
sku = string
custom_tags = map(string)
})
default = {
admin_enabled = true
sku = "Basic"
custom_tags = {}
}
}