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
|
variable "cluster_id" {
description = "Replication group ID"
type = string
}
variable "engine" {
description = "Cache engine — redis or memcached"
type = string
default = "redis"
validation {
condition = contains(["redis", "memcached"], var.engine)
error_message = "engine must be redis or memcached."
}
}
variable "engine_version" {
description = "Cache engine version"
type = string
default = "7.1"
}
variable "node_type" {
description = "ElastiCache node type"
type = string
default = "cache.t3.medium"
}
variable "num_cache_nodes" {
description = "Number of cache nodes (Memcached) or number of node groups (Redis cluster mode disabled = 1)"
type = number
default = 1
}
variable "num_cache_clusters" {
description = "Number of Redis replica clusters"
type = number
default = 2
}
variable "subnet_group_name" {
description = "ElastiCache subnet group name (created when subnet_ids is non-empty)"
type = string
default = null
}
variable "subnet_ids" {
description = "Subnet IDs for the subnet group"
type = list(string)
default = []
}
variable "security_group_ids" {
description = "Security group IDs"
type = list(string)
}
variable "automatic_failover_enabled" {
description = "Enable Redis automatic failover (requires num_cache_clusters >= 2)"
type = bool
default = true
}
variable "multi_az_enabled" {
description = "Enable Multi-AZ for the replication group"
type = bool
default = true
}
variable "at_rest_encryption_enabled" {
description = "Enable at-rest encryption"
type = bool
default = true
}
variable "transit_encryption_enabled" {
description = "Enable in-transit TLS encryption"
type = bool
default = true
}
variable "kms_key_id" {
description = "KMS key ARN for at-rest encryption"
type = string
default = null
}
variable "auth_token" {
description = "Redis AUTH token (required when transit_encryption_enabled = true)"
type = string
default = null
sensitive = true
}
variable "snapshot_retention_limit" {
description = "Days to retain Redis snapshots (0 disables)"
type = number
default = 7
}
variable "snapshot_window" {
description = "Daily snapshot window (UTC)"
type = string
default = "03:00-04:00"
}
variable "maintenance_window" {
description = "Weekly maintenance window"
type = string
default = "sun:05:00-sun:06:00"
}
variable "parameters" {
description = "Map of cache parameter names to values"
type = map(string)
default = {}
}
variable "tags" {
description = "Resource tags to apply to all resources"
type = map(string)
default = {}
}
|