-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathredis.tf
34 lines (28 loc) · 1.01 KB
/
redis.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
resource "aws_elasticache_replication_group" "kong" {
count = var.enable_redis ? 1 : 0
description = var.description
replication_group_id = format("%s-%s", var.service, var.environment)
engine = "redis"
engine_version = var.redis_engine_version
node_type = var.redis_instance_type
num_cache_clusters = var.redis_instance_count
parameter_group_name = format("%s-%s", var.service, var.environment)
port = 6379
subnet_group_name = var.redis_subnets
security_group_ids = [aws_security_group.redis.id]
tags = merge(
{
"Name" = format("%s-%s", var.service, var.environment),
"Environment" = var.environment,
"Description" = var.description,
"Service" = var.service,
},
var.tags
)
depends_on = [aws_elasticache_parameter_group.kong]
}
resource "aws_elasticache_parameter_group" "kong" {
name = format("%s-%s", var.service, var.environment)
family = var.redis_family
description = var.description
}