forked from hashicorp/terraform-aws-terraform-enterprise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
332 lines (270 loc) · 8.02 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
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
locals {
assistant_port = 23010
distro_ami = var.distribution == "ubuntu" ? data.aws_ami.ubuntu.id : data.aws_ami.rhel.id
default_ssh_user = var.distribution == "ubuntu" ? "ubuntu" : "ec2-user"
rendered_secondary_instance_type = var.secondary_instance_type != "" ? var.secondary_instance_type : var.primary_instance_type
}
### =================================================================== REQUIRED
variable "domain" {
type = string
description = "Route53 Domain to manage DNS under"
}
variable "private_zone" {
type = string
description = "set to true if your route53 zone is private"
default = false
}
variable "license_file" {
type = string
description = "path to license file"
}
variable "vpc_id" {
type = string
description = "AWS VPC id to install into"
}
### =================================================================== OPTIONAL
variable "prefix" {
type = string
description = "Name prefix for resource names and tags"
default = "tfe"
}
variable "airgap_installer_url" {
type = string
description = "URL to airgap installer package"
default = "https://s3.amazonaws.com/replicated-airgap-work/replicated__docker__kubernetes.tar.gz"
}
variable "airgap_package_url" {
type = string
description = "signed URL to download the package"
default = ""
}
variable "ca_bundle_url" {
type = string
description = "URL to Custom CA bundle used for outgoing connections"
default = "none"
}
variable "ami" {
type = string
description = "AMI to launch instance with; defaults to latest Ubuntu Xenial"
default = ""
}
variable "cert_arn" {
type = string
description = "Amazon Resource Name (ARN) for Certificate in the ACM you'd like to use (default uses domain or cert_domain to look it up)"
default = ""
}
variable "cert_domain" {
type = string
description = "domain to search for ACM certificate with (default is *.domain)"
default = ""
}
variable "distribution" {
type = string
description = "Type of linux distribution to use. (ubuntu or rhel)"
default = "ubuntu"
}
variable "encryption_password" {
type = string
description = "encryption password to use as root secret (default is autogenerated)"
default = ""
}
variable "hostname" {
type = string
description = "hostname to assign to cluster under domain (default is autogenerated one)"
default = ""
}
variable "iact_subnet_list" {
type = string
description = "List of subnets to allow to access Initial Admin Creation Token (IACT) API. https://www.terraform.io/docs/enterprise/private/automating-initial-user.html"
default = ""
}
variable "iact_subnet_time_limit" {
type = string
description = "Amount of time to allow access to IACT API after initial boot"
default = ""
}
variable "import_key" {
type = string
description = "an ssh pub key to import to all machines"
default = ""
}
variable "installer_url" {
type = string
description = "URL to the cluster setup tool"
default = "https://install.terraform.io/installer/ptfe-0.1.zip"
}
variable "primary_count" {
type = string
description = "The number of primary cluster master nodes to run, only 3 support now."
default = 3
}
variable "primary_instance_type" {
type = string
description = "ec2 instance type"
default = "m4.xlarge"
}
variable "secondary_count" {
type = string
description = "The number of secondary cluster nodes to run"
default = 5
}
variable "secondary_instance_type" {
type = string
description = "ec2 instance type (Defaults to `primary_instance_type` if not set.)"
default = ""
}
variable "ssh_user" {
type = string
description = "the user to connect to the instance as"
default = ""
}
variable "startup_script" {
type = string
description = "shell script to run when primary instance boots the first time"
default = ""
}
variable "subnet_tags" {
type = map(string)
description = "tags to use to match subnets to use"
default = {}
}
variable "update_route53" {
type = string
description = "whether or not to automatically update route53 records for the cluster"
default = true
}
variable "volume_size" {
type = string
description = "size of the root volume in gb"
default = "100"
}
variable "weave_cidr" {
type = string
description = "Specify a non-standard CIDR range for weave. The default is 10.32.0.0/12"
default = ""
}
variable "release_sequence" {
type = string
description = "Replicated release sequence number to install - this locks the install to a specific release"
default = ""
}
variable "repl_cidr" {
type = string
description = "Specify a non-standard CIDR range for the replicated services. The default is 10.96.0.0/12"
default = ""
}
### ================================ External Services Support
variable "aws_instance_profile" {
type = bool
description = "When set, use credentials from the AWS instance profile"
default = false
}
variable "aws_access_key_id" {
type = string
description = "AWS access key id to connect to s3 with"
default = ""
}
variable "aws_secret_access_key" {
type = string
description = "AWS secret access key to connect to s3 with"
default = ""
}
variable "http_proxy_url" {
type = string
description = "HTTP(S) Proxy URL"
default = ""
}
variable "additional_no_proxy" {
type = string
description = "Comma delimitted list of addresses (no spaces) to not use the proxy for"
default = ""
}
variable "postgresql_address" {
type = string
description = "address to connect to external postgresql database at"
default = ""
}
variable "postgresql_database" {
type = string
description = "database name to use in exetrnal postgresql database"
default = ""
}
variable "postgresql_extra_params" {
type = string
description = "additional connection string parameters (must be url query params)"
default = ""
}
variable "postgresql_password" {
type = string
description = "password to connect to external postgresql database as"
default = ""
}
variable "postgresql_user" {
type = string
description = "user to connect to external postgresql database as"
default = ""
}
variable "s3_bucket" {
type = string
description = "S3 bucket to store objects into"
default = ""
}
variable "s3_region" {
type = string
description = "Region of the S3 bucket"
default = ""
}
variable "ingress_allow_list" {
type = set(string)
description = "List of CIDR blocks we allow to access the infrastructure"
default = []
}
variable "egress_allow_list" {
type = set(string)
description = "List of CIDR blocks we allow the infrastructyre to access"
default = ["0.0.0.0/0"]
}
### ======================================================================= MISC
data "aws_ami" "ubuntu" {
owners = ["099720109477", "513442679011"] # Canonical, Canonical (GovCloud)
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
}
data "aws_ami" "rhel" {
owners = ["309956199498", "219670896067"] # RedHat, RedHat (GovCloud)
most_recent = true
filter {
name = "name"
values = ["RHEL-7.?*GA*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
}
## random password for the installer dashboard
resource "random_pet" "console_password" {
length = 3
}
resource "random_string" "bootstrap_token_id" {
length = 6
upper = false
special = false
}
resource "random_string" "bootstrap_token_suffix" {
length = 16
upper = false
special = false
}
resource "random_string" "setup_token" {
length = 32
upper = false
special = false
}