-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvariables.tf
181 lines (153 loc) · 5.03 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
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
variable "config" {
type = object({
environment = string
project_name = string
owner = string
team = string
})
default = {
project_name = "example-project"
environment = "test"
owner = "Crate.IO"
team = "Customer Engineering"
}
description = "Global configuration items"
}
variable "crate" {
type = object({
heap_size = string
cluster_name = string
cluster_size = number
ssl_enable = bool
})
default = {
heap_size = "2g"
cluster_name = "CrateDB-Cluster"
cluster_size = 3
ssl_enable = true
}
description = "CrateDB application configuration"
}
variable "cratedb_settings" {
type = map(string)
default = {}
description = "CrateDB settings applied to crate.yml"
}
variable "cratedb_password" {
type = string
default = null
sensitive = true
description = "The password to use for the CrateDB database user. If null, a random password will be assigned."
validation {
condition = var.cratedb_password == null || !can(regex("\"|\\$\\$", var.cratedb_password))
error_message = "The CrateDB password must not contain any of the following character sequences: $$, \""
}
}
variable "cratedb_tar_download_url" {
type = string
description = "If specified, a tar.gz archive will be retrieve from the specified download URL instead of using the RPM package to install CrateDB"
default = null
validation {
condition = var.cratedb_tar_download_url == null || can(regex("^https://cdn.crate.io/.*\\.tar\\.gz$", var.cratedb_tar_download_url))
error_message = "The CrateDB tar.gz download URL must point to a https://cdn.crate.io address."
}
}
variable "disk_size_gb" {
type = number
description = "The disk size in GB to use for CrateDB's data directory"
default = 500
}
variable "disk_type" {
type = string
description = "The disk type to use for CrateDB's data directory"
default = "gp3"
}
variable "disk_iops" {
type = number
description = "Number of provisioned IOPS of the disk to use for CrateDB's data directory"
default = null
}
variable "disk_throughput" {
type = number
description = "Amount of provisioned throughput of the disk to use for CrateDB's data directory (gp3 only)"
default = null
}
variable "region" {
type = string
description = "The AWS region to deploy to"
default = "eu-central-1"
}
variable "vpc_id" {
type = string
description = "The ID of an existing VPC to deploy to"
}
variable "instance_type" {
type = string
default = "t3.xlarge"
description = "The EC2 instance type to use for nodes"
}
variable "instance_architecture" {
type = string
default = "x86_64"
description = "The hardware architecture of the EC2 instance, e.g. x86_64 or arm64. Must match with the selected instance_type."
validation {
condition = contains(["x86_64", "arm64"], var.instance_architecture)
error_message = "Unsupported architecture. Must be x86_64 or arm64."
}
}
variable "instance_profile" {
type = string
default = null
description = "An optional EC2 instance profile to assign to CrateDB nodes"
}
variable "ssh_keypair" {
type = string
description = "The name of an existing EC2 key pair"
}
variable "availability_zones" {
type = list(string)
description = "A list of availability zones to deploy EC2 instances to. The corresponding subnet ID must be at the same index in the subnet_ids variable."
}
variable "subnet_ids" {
type = list(string)
description = "A list of subnet IDs deploy EC2 instances in. The corresponding availability zone must be at the same index in the availability_zones variable."
}
variable "ssh_access" {
type = bool
default = true
description = "Set to true, if inbound SSH access to EC2 instances should be allowed. Otherwise, set to false."
}
variable "enable_utility_vm" {
type = bool
default = false
description = "If true, an additional EC2 instance will be created for running utilities, such as benchmarks or other scripts"
}
variable "load_balancer_internal" {
type = bool
default = false
description = "If true, the load balancer's URL will resolve to a private IP address, only reachable from within the VPC"
}
variable "utility_vm" {
type = object({
instance_type = string
instance_architecture = string
disk_size_gb = number
})
default = {
instance_type = "t3.xlarge"
instance_architecture = "x86_64"
disk_size_gb = 50
}
description = "Configuration of the utility EC2 instance"
}
variable "prometheus_password" {
type = string
default = null
sensitive = true
description = "Optional password for the Prometheus admin user. If null, a random password will be assigned."
}
variable "prometheus_ssl" {
type = bool
default = true
description = "If true, a self-signed SSL certificate will be generated for accessing Prometheus."
}