-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvariables.tf
More file actions
226 lines (198 loc) · 7.45 KB
/
variables.tf
File metadata and controls
226 lines (198 loc) · 7.45 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
variable "project_id" {
description = "The ID of the project where resources will be created"
type = string
}
variable "region" {
description = "The region where resources will be created"
type = string
default = "us-central1"
}
variable "prefix" {
description = "Prefix to be used for resource names"
type = string
default = "materialize"
}
variable "network_config" {
description = "Network configuration for the GKE cluster"
type = object({
subnet_cidr = string
pods_cidr = string
services_cidr = string
})
}
variable "gke_config" {
description = "GKE cluster configuration. Make sure to use large enough machine types for your Materialize instances."
type = object({
node_count = number
machine_type = string
disk_size_gb = number
min_nodes = number
max_nodes = number
})
default = {
node_count = 1
machine_type = "n2-highmem-8"
disk_size_gb = 100
min_nodes = 1
max_nodes = 2
}
}
variable "database_config" {
description = "Cloud SQL configuration"
type = object({
tier = optional(string, "db-custom-2-4096")
version = optional(string, "POSTGRES_15")
password = string
username = optional(string, "materialize")
db_name = optional(string, "materialize")
})
validation {
condition = var.database_config.password != null
error_message = "database_config.password must be provided"
}
}
variable "namespace" {
description = "Kubernetes namespace for Materialize"
type = string
default = "materialize"
}
variable "labels" {
description = "Labels to apply to all resources"
type = map(string)
default = {}
}
# Materialize Helm Chart Variables
variable "install_materialize_operator" {
description = "Whether to install the Materialize operator"
type = bool
default = true
}
variable "helm_chart" {
description = "Chart name from repository or local path to chart. For local charts, set the path to the chart directory."
type = string
default = "materialize-operator"
}
variable "use_local_chart" {
description = "Whether to use a local chart instead of one from a repository"
type = bool
default = false
}
variable "helm_values" {
description = "Values to pass to the Helm chart"
type = any
default = {}
}
variable "orchestratord_version" {
description = "Version of the Materialize orchestrator to install"
type = string
default = null
}
variable "materialize_instances" {
description = "Configuration for Materialize instances"
type = list(object({
name = string
namespace = optional(string)
database_name = string
create_database = optional(bool, true)
create_load_balancer = optional(bool, true)
internal_load_balancer = optional(bool, true)
environmentd_version = optional(string)
cpu_request = optional(string, "1")
memory_request = optional(string, "1Gi")
memory_limit = optional(string, "1Gi")
in_place_rollout = optional(bool, false)
request_rollout = optional(string)
force_rollout = optional(string)
balancer_memory_request = optional(string, "256Mi")
balancer_memory_limit = optional(string, "256Mi")
balancer_cpu_request = optional(string, "100m")
license_key = optional(string)
}))
default = []
validation {
condition = alltrue([
for instance in var.materialize_instances :
instance.request_rollout == null ||
can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", instance.request_rollout))
])
error_message = "Request rollout must be a valid UUID in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
validation {
condition = alltrue([
for instance in var.materialize_instances :
instance.force_rollout == null ||
can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", instance.force_rollout))
])
error_message = "Force rollout must be a valid UUID in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
}
variable "operator_version" {
description = "Version of the Materialize operator to install"
type = string
default = null
}
variable "operator_namespace" {
description = "Namespace for the Materialize operator"
type = string
default = "materialize"
}
variable "install_metrics_server" {
description = "Whether to install the metrics-server for the Materialize Console. Defaults to false since GKE installs one by default in the kube-system namespace. Only set to true if the GKE cluster was deployed with [monitoring explicitly turned off](https://cloud.google.com/kubernetes-engine/docs/how-to/configure-metrics#:~:text=To%20disable%20system%20metric%20collection,for%20the%20%2D%2Dmonitoring%20flag). Refer to the [GKE docs](https://cloud.google.com/kubernetes-engine/docs/how-to/configure-metrics#:~:text=To%20disable%20system%20metric%20collection,for%20the%20%2D%2Dmonitoring%20flag) for more information, including impact to GKE customer support efforts."
type = bool
default = false
}
variable "storage_bucket_versioning" {
description = "Enable bucket versioning. This should be enabled for production deployments."
type = bool
default = false
}
variable "storage_bucket_version_ttl" {
description = "Sets the TTL (in days) on non current storage bucket objects. This must be set if storage_bucket_versioning is turned on."
type = number
default = 7
}
variable "install_cert_manager" {
description = "Whether to install cert-manager."
type = bool
default = true
}
variable "use_self_signed_cluster_issuer" {
description = "Whether to install and use a self-signed ClusterIssuer for TLS. To work around limitations in Terraform, this will be treated as `false` if no materialize instances are defined."
type = bool
default = true
}
variable "cert_manager_namespace" {
description = "The name of the namespace in which cert-manager is or will be installed."
type = string
default = "cert-manager"
}
variable "cert_manager_install_timeout" {
description = "Timeout for installing the cert-manager helm chart, in seconds."
type = number
default = 300
}
variable "cert_manager_chart_version" {
description = "Version of the cert-manager helm chart to install."
type = string
default = "v1.17.1"
}
# Disk support configuration
variable "enable_disk_support" {
description = "Enable disk support for Materialize using OpenEBS and local SSDs. When enabled, this configures OpenEBS, runs the disk setup script, and creates appropriate storage classes."
type = bool
default = true
}
variable "disk_support_config" {
description = "Advanced configuration for disk support (only used when enable_disk_support = true)"
type = object({
install_openebs = optional(bool, true)
run_disk_setup_script = optional(bool, true)
local_ssd_count = optional(number, 1)
create_storage_class = optional(bool, true)
openebs_version = optional(string, "4.2.0")
openebs_namespace = optional(string, "openebs")
storage_class_name = optional(string, "openebs-lvm-instance-store-ext4")
storage_class_provisioner = optional(string, "local.csi.openebs.io")
})
default = {}
}