-
-
Notifications
You must be signed in to change notification settings - Fork 249
/
variables.tf
330 lines (277 loc) · 10.2 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
variable "vpc_id" {
type = string
description = "VPC ID"
}
variable "subnets" {
type = list(string)
description = "Subnet IDs"
default = []
}
variable "elasticache_subnet_group_name" {
type = string
description = "Subnet group name for the ElastiCache instance"
default = ""
}
variable "network_type" {
type = string
default = "ipv4"
description = "The network type of the cluster. Valid values: ipv4, ipv6, dual_stack."
}
variable "maintenance_window" {
type = string
default = "wed:03:00-wed:04:00"
description = "Maintenance window"
}
variable "cluster_size" {
type = number
default = 1
description = "Number of nodes in cluster. *Ignored when `cluster_mode_enabled` == `true`*"
}
variable "port" {
type = number
default = 6379
description = "Port number on which the cache nodes will accept connections"
}
variable "instance_type" {
type = string
default = "cache.t2.micro"
description = "Elastic cache instance type"
}
variable "family" {
type = string
default = "redis4.0"
description = "The family of the ElastiCache parameter group"
}
variable "parameter" {
type = list(object({
name = string
value = string
}))
default = []
description = "A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another"
}
variable "engine" {
type = string
default = "redis"
description = "Name of the cache engine"
}
variable "engine_version" {
type = string
default = "4.0.10"
description = "Version number of the cache engine"
}
variable "at_rest_encryption_enabled" {
type = bool
default = false
description = "Enable encryption at rest"
}
variable "transit_encryption_enabled" {
type = bool
default = true
description = <<-EOT
Set `true` to enable encryption in transit. Forced `true` if `var.auth_token` is set.
If this is enabled, use the [following guide](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/in-transit-encryption.html#connect-tls) to access redis.
EOT
}
variable "transit_encryption_mode" {
type = string
default = null
description = <<-EOT
A setting that enables clients to migrate to in-transit encryption with no downtime. Valid values are `preferred` and `required`. When enabling encryption on an existing replication group, this must first be set to `preferred` before setting it to `required` in a subsequent apply. See the TransitEncryptionMode field in the [CreateReplicationGroup](https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateReplicationGroup.html) API documentation for additional details."
EOT
}
variable "notification_topic_arn" {
type = string
default = ""
description = "Notification topic arn"
}
variable "alarm_cpu_threshold_percent" {
type = number
default = 75
description = "CPU threshold alarm level"
}
variable "alarm_memory_threshold_bytes" {
# 10MB
type = number
default = 10000000
description = "Ram threshold alarm level"
}
variable "alarm_actions" {
type = list(string)
description = "Alarm action list"
default = []
}
variable "ok_actions" {
type = list(string)
description = "The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN)"
default = []
}
variable "apply_immediately" {
type = bool
default = true
description = "Apply changes immediately"
}
variable "data_tiering_enabled" {
type = bool
default = false
description = "Enables data tiering. Data tiering is only supported for replication groups using the r6gd node type."
}
variable "automatic_failover_enabled" {
type = bool
default = false
description = "Automatic failover (Not available for T1/T2 instances)"
}
variable "multi_az_enabled" {
type = bool
default = false
description = "Multi AZ (Automatic Failover must also be enabled. If Cluster Mode is enabled, Multi AZ is on by default, and this setting is ignored)"
}
variable "availability_zones" {
type = list(string)
description = "Availability zone IDs"
default = []
}
variable "zone_id" {
type = any
default = []
description = <<-EOT
Route53 DNS Zone ID as list of string (0 or 1 items). If empty, no custom DNS name will be published.
If the list contains a single Zone ID, a custom DNS name will be pulished in that zone.
Can also be a plain string, but that use is DEPRECATED because of Terraform issues.
EOT
}
variable "dns_subdomain" {
type = string
default = ""
description = "The subdomain to use for the CNAME record. If not provided then the CNAME record will use var.name."
}
variable "auth_token" {
type = string
description = "Auth token for password protecting redis, `transit_encryption_enabled` must be set to `true`. Password must be longer than 16 chars"
default = null
}
variable "auth_token_update_strategy" {
type = string
description = "Strategy to use when updating the auth_token. Valid values are `SET`, `ROTATE`, and `DELETE`. Defaults to `ROTATE`."
default = "ROTATE"
validation {
condition = contains(["set", "rotate", "delete"], lower(var.auth_token_update_strategy))
error_message = "Valid values for auth_token_update_strategy are `SET`, `ROTATE`, and `DELETE`."
}
}
variable "kms_key_id" {
type = string
description = "The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. `at_rest_encryption_enabled` must be set to `true`"
default = null
}
variable "replication_group_id" {
type = string
description = "Replication group ID with the following constraints: \nA name must contain from 1 to 20 alphanumeric characters or hyphens. \n The first character must be a letter. \n A name cannot end with a hyphen or contain two consecutive hyphens."
default = ""
}
variable "snapshot_arns" {
type = list(string)
description = "A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. Example: arn:aws:s3:::my_bucket/snapshot1.rdb"
default = []
}
variable "snapshot_name" {
type = string
description = "The name of a snapshot from which to restore data into the new node group. Changing the snapshot_name forces a new resource."
default = null
}
variable "snapshot_window" {
type = string
description = "The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster."
default = "06:30-07:30"
}
variable "snapshot_retention_limit" {
type = number
description = "The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them."
default = 0
}
variable "final_snapshot_identifier" {
type = string
description = "The name of your final node group (shard) snapshot. ElastiCache creates the snapshot from the primary node in the cluster. If omitted, no final snapshot will be made."
default = null
}
variable "cluster_mode_enabled" {
type = bool
description = "Flag to enable/disable creation of a native redis cluster. `automatic_failover_enabled` must be set to `true`. Only 1 `cluster_mode` block is allowed"
default = false
}
variable "cluster_mode_replicas_per_node_group" {
type = number
description = "Number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will force a new resource"
default = 0
}
variable "cluster_mode_num_node_groups" {
type = number
description = "Number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other settings modifications"
default = 0
}
variable "cloudwatch_metric_alarms_enabled" {
type = bool
description = "Boolean flag to enable/disable CloudWatch metrics alarms"
default = false
}
variable "create_parameter_group" {
type = bool
default = true
description = "Whether new parameter group should be created. Set to false if you want to use existing parameter group"
}
variable "parameter_group_description" {
type = string
default = null
description = "Managed by Terraform"
}
variable "parameter_group_name" {
type = string
default = null
description = "Override the default parameter group name"
}
variable "log_delivery_configuration" {
type = list(map(any))
default = []
description = "The log_delivery_configuration block allows the streaming of Redis SLOWLOG or Redis Engine Log to CloudWatch Logs or Kinesis Data Firehose. Max of 2 blocks."
}
variable "description" {
type = string
default = null
description = "Description of elasticache replication group"
}
variable "user_group_ids" {
type = list(string)
default = null
description = "User Group ID to associate with the replication group"
}
variable "auto_minor_version_upgrade" {
type = bool
default = null
description = "Specifies whether minor version engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Only supported if the engine version is 6 or higher."
}
# Add boolean to create a serverless cluster
variable "serverless_enabled" {
type = bool
default = false
description = "Flag to enable/disable creation of a serverless redis cluster"
}
variable "serverless_major_engine_version" {
type = string
default = "7"
description = "The major version of the engine to use for the serverless cluster"
}
variable "serverless_snapshot_time" {
type = string
default = "06:00"
description = "The daily time that snapshots will be created from the serverless cache."
}
variable "serverless_user_group_id" {
type = string
default = null
description = "User Group ID to associate with the replication group"
}
variable "serverless_cache_usage_limits" {
type = map(any)
default = {}
description = "The usage limits for the serverless cache"
}