-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
206 lines (171 loc) · 4.7 KB
/
variables.tf
File metadata and controls
206 lines (171 loc) · 4.7 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
variable "prefix" {
description = "Prefix for the name of the Azure resources."
type = string
default = "local"
validation {
condition = var.prefix == null || length(var.prefix) >= 2
error_message = "The prefix must be at least 2 characters long."
}
}
variable "suffix" {
description = "Suffix for the name of the Azure resources."
type = string
default = "test"
validation {
condition = var.suffix == null || length(var.suffix) >= 2
error_message = "The suffix must be at least 2 characters long."
}
}
variable "location" {
description = "Specifies the location for all resources."
type = string
default = "westeurope"
}
# -----------------------------------------------------------------------------
# PostgreSQL flexible server
# -----------------------------------------------------------------------------
variable "pg_admin_login" {
description = "Administrator login for the PostgreSQL flexible server."
type = string
default = "pgadmin"
}
variable "pg_admin_password" {
description = "Administrator password for the PostgreSQL flexible server. Pass via -var or the PG_ADMIN_PASSWORD env var; do NOT commit."
type = string
sensitive = true
default = "P@ssw0rd1234!"
}
variable "pg_version" {
description = "PostgreSQL major version."
type = string
default = "16"
validation {
condition = contains(["13", "14", "15", "16", "17"], var.pg_version)
error_message = "The pg_version must be one of: 13, 14, 15, 16, 17."
}
}
variable "pg_sku_name" {
description = "Compute SKU for the PostgreSQL flexible server (e.g. B_Standard_B1ms)."
type = string
default = "B_Standard_B1ms"
}
variable "pg_storage_mb" {
description = "Storage size in MB for the PostgreSQL flexible server."
type = number
default = 32768
}
variable "pg_backup_retention_days" {
description = "Backup retention period in days for the PostgreSQL flexible server."
type = number
default = 7
}
variable "pg_database_name" {
description = "Name of the application database to create on the PostgreSQL flexible server."
type = string
default = "PlannerDB"
}
# -----------------------------------------------------------------------------
# App Service / Web App
# -----------------------------------------------------------------------------
variable "os_type" {
description = "OS type for the App Service Plan."
type = string
default = "Linux"
}
variable "zone_balancing_enabled" {
type = bool
default = false
}
variable "sku_name" {
description = "App Service Plan SKU name."
type = string
default = "S1"
}
variable "python_version" {
description = "Python runtime version for the Web App."
type = string
default = "3.12"
validation {
condition = contains(["3.13", "3.12", "3.11", "3.10", "3.9", "3.8", "3.7"], var.python_version)
error_message = "Unsupported python_version."
}
}
variable "https_only" {
type = bool
default = false
}
variable "minimum_tls_version" {
type = string
default = "1.2"
}
variable "always_on" {
type = bool
default = true
}
variable "http2_enabled" {
type = bool
default = false
}
variable "public_network_access_enabled" {
type = bool
default = true
}
variable "repo_url" {
type = string
default = ""
validation {
condition = var.repo_url == "" || can(regex("^https?://", var.repo_url))
error_message = "The repo_url must be empty or a valid HTTP/HTTPS URL."
}
}
variable "login_name" {
description = "Login name for the application (scopes activity ownership)."
type = string
default = "paolo"
}
variable "websites_port" {
type = number
default = 8000
}
variable "tags" {
type = map(string)
default = {
environment = "test"
iac = "terraform"
}
}
# -----------------------------------------------------------------------------
# Networking
# -----------------------------------------------------------------------------
variable "vnet_address_space" {
type = list(string)
default = ["10.0.0.0/8"]
}
variable "webapp_subnet_name" {
type = string
default = "app-subnet"
}
variable "webapp_subnet_address_prefix" {
type = list(string)
default = ["10.0.0.0/24"]
}
variable "pe_subnet_name" {
type = string
default = "pe-subnet"
}
variable "pe_subnet_address_prefix" {
type = list(string)
default = ["10.0.1.0/24"]
}
variable "nat_gateway_sku_name" {
type = string
default = "Standard"
}
variable "nat_gateway_idle_timeout_in_minutes" {
type = number
default = 4
}
variable "nat_gateway_zones" {
type = list(string)
default = ["1"]
}