-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
303 lines (288 loc) · 9.17 KB
/
Copy pathvariables.tf
File metadata and controls
303 lines (288 loc) · 9.17 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# ------ General ------ #
variable "region" {
description = "The region where the resources will be created"
type = string
}
variable "labels" {
type = map(string)
default = {}
description = "Common labels that will be applied to all resources."
}
variable "resource_prefix" {
type = string
description = "The prefix that is used for generating resource names."
}
variable "platform_domain" {
type = string
description = "The domain on which the deployed Nebuly platform is made accessible."
validation {
condition = can(regex("(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]", var.platform_domain))
error_message = "The domain name must be a valid domain (e.g., example.com)."
}
}
variable "openai_endpoint" {
description = "The endpoint of the OpenAI API."
type = string
}
variable "openai_gpt4o_deployment_name" {
description = "The name of the deployment to use for the GPT-4o model."
type = string
}
variable "openai_translation_deployment_name" {
description = <<EOT
The name of the deployment to use for enabling the translations feature. Recommended to use `gpt-4o-mini`.
Provide an empty string to disable the translations feature.
EOT
type = string
}
# ------ Networking ------ #
variable "network_cidr_blocks" {
description = <<EOT
The CIDR blocks of the VPC network used by Nebuly.
- primary: The primary CIDR block of the VPC network.
- secondary_gke_pods: The secondary CIDR block used by GKE for pods.
- secondary_gke_services: The secondary CIDR block used by GKE for services.
EOT
type = object({
primary : string
secondary_gke_pods : string
secondary_gke_services : string
})
default = {
primary = "10.0.0.0/16"
secondary_gke_pods = "10.4.0.0/16"
secondary_gke_services = "10.6.0.0/16"
}
}
variable "allowed_ip_addresses" {
description = <<EOT
Map of CIDR blocks allowed to connect to the PostgreSQL Cloud SQL instance via public IPv4.
Each entry key is a human-readable name (e.g. "office", "vpn") and the value is a CIDR block
(e.g. "1.2.3.4/32").
If this variable is provided (non-empty), the PostgreSQL instance will be exposed to the internet
(public IP enabled) and access will be restricted to the specified CIDR ranges.
EOT
type = map(string)
default = {}
}
# ------ PostgreSQL ------ #
variable "postgres_server_tier" {
description = "The tier of the PostgreSQL server. Default value: 4 vCPU, 16GB memory."
type = string
default = "db-custom-4-16384"
}
variable "postgres_server_delete_protection" {
description = "Whether the PostgreSQL server should have delete protection enabled."
type = bool
default = true
}
variable "postgres_server_maintenance_window" {
description = "Time window when the PostgreSQL server can automatically restart to apply updates. Specified in UTC time."
type = object({
day : string
hour : number
})
default = {
day = "6" # Saturday
hour = 23 # 23:00 UTC
}
}
variable "postgres_server_edition" {
description = "The edition of the PostgreSQL server. Possible values are ENTERPRISE, ENTERPRISE_PLUS."
type = string
default = "ENTERPRISE"
validation {
condition = can(regex("^(ENTERPRISE|ENTERPRISE_PLUS)$", var.postgres_server_edition))
error_message = "The edition must be either ENTERPRISE or ENTERPRISE_PLUS."
}
}
variable "postgres_server_disk_size" {
description = "The size of the disk in GB for the PostgreSQL server."
type = object({
initial = number
limit = number
})
default = {
initial = 16
limit = 1000
}
validation {
condition = var.postgres_server_disk_size.initial < var.postgres_server_disk_size.limit
error_message = "The initial disk size must be less than the limit."
}
}
variable "postgres_server_backup_configuration" {
description = "The backup settings of the PostgreSQL server."
type = object({
enabled = bool
point_in_time_recovery_enabled = bool
n_retained_backups = number
})
default = {
enabled = true
point_in_time_recovery_enabled = true
n_retained_backups = 14
}
}
variable "postgres_server_high_availability" {
description = "The high availability configuration for the PostgreSQL server."
type = object({
enabled : bool
})
default = {
enabled = true
}
}
# ------ GKE ------ #
variable "gke_service_account_name" {
description = "The name of the Kubernetes Service Account used by Nebuly installation."
default = "nebuly"
type = string
}
variable "gke_kubernetes_version" {
description = "The used Kubernetes version for the GKE cluster."
type = string
default = "1.32."
}
variable "gke_delete_protection" {
description = "Whether the GKE Cluster should have delete protection enabled."
type = bool
default = true
}
variable "gke_nebuly_namespaces" {
description = "The namespaces used by Nebuly installation. Update this if you use custom namespaces in the Helm chart installation."
type = set(string)
default = ["nebuly", "nebuly-bootstrap"]
}
variable "gke_node_pools" {
description = <<EOT
The node Pools used by the GKE cluster.
EOT
type = map(object({
machine_type = string
min_nodes = number
max_nodes = number
node_count = number
resource_labels = optional(map(string), {})
disk_type = optional(string, "pd-balanced")
disk_size_gb = optional(number, 128)
node_locations = optional(set(string), null)
preemptible = optional(bool, false)
labels = optional(map(string), {})
taints = optional(set(object({
key = string
value = string
effect = string
})), null)
guest_accelerator = optional(object({
type = string
count = number
}), null)
}))
default = {
"web-services" : {
machine_type = "n2-highmem-4"
min_nodes = 1
max_nodes = 1
node_count = 1
resource_labels = {
"goog-gke-node-pool-provisioning-model" = "on-demand"
}
}
"gpu-primary" : {
machine_type = "g2-standard-8"
min_nodes = 0
max_nodes = 1
node_count = null
guest_accelerator = {
type = "nvidia-l4"
count = 1
}
labels = {
"gke-no-default-nvidia-gpu-device-plugin" : true,
"nebuly.com/accelerator" : "nvidia-l4",
}
resource_labels = {
"goog-gke-accelerator-type" = "nvidia-l4"
"goog-gke-node-pool-provisioning-model" = "on-demand"
}
}
}
}
variable "gke_private_cluster_config" {
description = <<EOT
Configuration for the GKE private cluster.
- enable_private_nodes: Prevents nodes from having public IP addresses
- enable_private_endpoint: Prevents access to the GKE master via public endpoint.
- master_ipv4_cidr_block: Must be a /28 block not overlapping others.
- authorized_cidr_blocks: A set of CIDR blocks that are allowed to access the GKE master.
EOT
type = object({
enable_private_nodes : bool
enable_private_endpoint : bool
master_ipv4_cidr_block : string
authorized_cidr_blocks : optional(map(string), {})
})
default = null
}
variable "gke_cluster_admin_users" {
description = "The list of email addresses of the users who will have admin access to the GKE cluster."
type = set(string)
}
variable "gke_maintenance_window" {
description = "Time window when the GKE cluster can automatically restart to apply updates. Specified in UTC time."
type = object({
recurrence : string
start_time : string
end_time : string
})
default = {
# Sat/Sun 02:00–04:00Z
recurrence = "FREQ=WEEKLY;BYDAY=SA,SU"
start_time = "2025-09-06T02:00:00Z"
end_time = "2030-09-06T04:00:00Z"
}
}
# ------ External credentials ------ #
variable "openai_api_key" {
description = "The API Key used for authenticating with OpenAI."
type = string
validation {
condition = length(var.openai_api_key) > 0
error_message = "The OpenAI API Key must be provided."
}
}
variable "nebuly_credentials" {
type = object({
client_id : string
client_secret : string
})
description = <<EOT
The credentials provided by Nebuly are required for activating your platform installation.
If you haven't received your credentials or have lost them, please contact support@nebuly.ai.
EOT
validation {
condition = alltrue([
length(var.nebuly_credentials.client_id) > 0,
length(var.nebuly_credentials.client_secret) > 0
])
error_message = "The client_id and client_secret must be provided."
}
}
variable "k8s_image_pull_secret_name" {
description = <<EOT
The name of the Kubernetes Image Pull Secret to use.
This value will be used to auto-generate the values.yaml file for installing the Nebuly Platform Helm chart.
EOT
type = string
default = "nebuly-docker-pull"
}
variable "microsoft_sso" {
description = "Settings for configuring the Microsoft Entra SSO integration."
type = object({
tenant_id : string
client_id : string
client_secret : string
})
default = null
}