-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathvariables.tf
290 lines (244 loc) · 8.73 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
/*------------------------------------------------
Configuration variables to determine the topology of
the cluster
------------------------------------------------*/
variable "use_asg" {
description = "a variable set to true or false depending on whether the vault cluster will be inside an ASG or not"
type = "string"
default = false
}
variable "use_elb" {
description = "a variable set to true or false depending on whether the vault cluster will use an ELB or not"
type = "string"
default = false
}
variable "use_nlb" {
description = "a variable set to true or false depending on whether the vault cluster will use an NLB or not"
type = "string"
default = false
}
variable "use_userdata" {
description = "a variable set to true or false depending on whether the vault cluster will be configured using the userdata scripts or not"
type = "string"
default = false
}
variable "internal_elb" {
description = "a variable set to true or false depending on whether the elb should be internal or not"
type = "string"
default = false
}
variable "use_auto_unseal" {
description = "a variable set to true or false depending on whether the vault cluster will be configured to use aws kms key to auto-unseal"
type = "string"
default = false
}
/*------------------------------------------------
Vault Cluster Variables
Variables that define the cluster instances
------------------------------------------------*/
variable "cluster_name" {
description = "The name of the Vault cluster (e.g. vault-stage). This variable is used to namespace all resources created by this module."
type = "string"
}
variable "vault_ami_id" {
description = "The ID of the AMI to run in this cluster for the vault servers."
type = "string"
}
variable "consul_ami_id" {
description = "The ID of the AMI to run in this cluster for the consul servers."
type = "string"
}
variable "instance_type" {
description = "The type of EC2 Instances to run for each node in the cluster (e.g. t2.micro)."
type = "string"
}
variable "ssh_key_name" {
description = "The AWS ssh key to use to build instances in the vault cluster"
type = "string"
}
variable "private_subnets" {
description = "A list private subnets the vault cluster will be deployed into"
type = "list"
}
variable "public_subnets" {
description = "A list public subnets used if the nlb is deployed into a public network"
type = "list"
}
variable "availability_zones" {
description = "A list AZs the vault cluster will be deployed into"
type = "list"
}
variable "vpc_id" {
description = "The ID of the VPC this will be provisioned in"
type = "string"
}
variable "aws_region" {
description = "The region the vault cluster will be deployed in"
type = "string"
}
/*------------------------------------------------
Optional variables that have sensible defaults
------------------------------------------------
Cluster size variables
------------------------------------------------*/
variable "vault_cluster_size" {
description = "The size (number of instances) in the Vault cluster without an ASG"
type = "string"
default = 3
}
variable "consul_cluster_size" {
description = "The size (number of instances) in the consul cluster"
type = "string"
default = 5
}
/*------------------------------------------------
ASG Variables for health checking
------------------------------------------------*/
variable "health_check_grace_period" {
description = "Time, in seconds, after instance comes into service before checking health."
default = 300
}
variable "wait_for_capacity_timeout" {
description = "A maximum duration that Terraform should wait for ASG instances to be healthy before timing out. Setting this to '0' causes Terraform to skip all Capacity Waiting behavior."
type = "string"
default = "10m"
}
variable "enabled_metrics" {
description = "List of autoscaling group metrics to enable."
type = "list"
default = []
}
variable "termination_policies" {
description = "A list of policies to decide how the instances in the auto scale group should be terminated. The allowed values are OldestInstance, NewestInstance, OldestLaunchConfiguration, ClosestToNextInstanceHour, Default."
type = "string"
default = "Default"
}
/*------------------------------------------------
variables to manage ELB behaviour
------------------------------------------------*/
variable "cross_zone_load_balancing" {
description = "Set to true to enable cross-zone load balancing and you have your vault cluster set up across multiple AZs as per the RA"
type = "string"
default = true
}
variable "idle_timeout" {
description = "The time, in seconds, that the connection is allowed to be idle."
type = "string"
default = 60
}
variable "connection_draining" {
description = "Set to true to enable connection draining."
type = "string"
default = true
}
variable "connection_draining_timeout" {
description = "The time, in seconds, to allow for connections to drain."
type = "string"
default = 300
}
variable "lb_port" {
description = "The port the load balancer should listen on for API requests."
type = "string"
default = 8200
}
variable "vault_api_port" {
description = "The port to listen on for API requests."
type = "string"
default = 8200
}
/*------------------------------------------------
Variables for KMS key for auto unseal
------------------------------------------------*/
variable "kms_deletion_days" {
description = "Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days."
type = "string"
default = 7
}
variable "kms_key_rotate" {
description = "Specifies whether key rotation is enabled"
type = "string"
default = false
}
/*------------------------------------------------
Variables for ELB Health Checking.
This is used for traffic direction, not for ASG
healthy status as Vault has several states that
are more complex than healthy/unhealthy
------------------------------------------------*/
variable "health_check_protocol" {
description = "The protocol to use for health check. As we are using TLS this will be HTTPS."
type = "string"
default = "HTTPS"
}
variable "health_check_path" {
description = "The Vault API path to hit."
type = "string"
default = "/v1/sys/health"
}
variable "health_check_interval" {
description = "The interval between checks (seconds)."
type = "string"
default = 15
}
variable "health_check_healthy_threshold" {
description = "The number of health checks that must pass before the instance is declared healthy."
type = "string"
default = 2
}
variable "health_check_unhealthy_threshold" {
description = "The number of health checks that must fail before the instance is declared unhealthy."
type = "string"
default = 2
}
variable "health_check_timeout" {
description = "The amount of time, in seconds, before a health check times out."
type = "string"
default = 5
}
/* Userdata variables */
variable "install_bucket" {
description = "The name of the private bucket the install files are stored in."
type = "string"
default = "my_bucket"
}
variable "cert_pem" {
description = "The name of the TLS cert in the S3 bucket install_files."
type = "string"
default = "cert.pem"
}
variable "key_pem" {
description = "The name of the TLS key in the S3 bucket install_files."
type = "string"
default = "key.pem"
}
variable "consul_version" {
description = "The version of OSS consul to install. Must be in format of consul versioning. e.g. 1.3.1"
type = "string"
default = ""
}
variable "consul_bin" {
description = "The name of the consul binary in zip format in the S3 bucket install_files."
type = "string"
default = ""
}
variable "vault_bin" {
description = "The name of the vault binary in zip format in the S3 bucket install_files."
type = "string"
default = ""
}
variable "vault_version" {
description = "The version of OSS vault to install. Must be in format of vault versioning. e.g. 1.3.1"
type = "string"
default = ""
}
variable "cluster_tag" {
description = "The tag value for consul auto-join."
type = "string"
default = "My_consul_cluster"
}
/* Aditional security group ids to add to the vault and consul cluster */
variable "additional_sg_ids" {
description = "A list of security groups to attach to instances in the vault cluster beyond the standard vault ones"
type = "list"
default = []
}