2022-02-15 18:00:24 +00:00
|
|
|
resource "aws_elasticache_replication_group" "default" {
|
|
|
|
availability_zones = ["us-east-2a", "us-east-2b", "us-east-2c"]
|
|
|
|
engine = "redis"
|
2022-03-21 17:18:21 +00:00
|
|
|
parameter_group_name = aws_elasticache_parameter_group.default.id
|
2022-02-15 18:00:24 +00:00
|
|
|
subnet_group_name = module.vpc.elasticache_subnet_group_name
|
|
|
|
security_group_ids = [aws_security_group.redis.id, aws_security_group.backend.id]
|
|
|
|
replication_group_id = "fleetdm-redis"
|
2022-03-21 17:18:21 +00:00
|
|
|
number_cache_clusters = 3
|
|
|
|
node_type = "cache.m6g.large"
|
|
|
|
engine_version = "5.0.6"
|
2022-02-15 18:00:24 +00:00
|
|
|
port = "6379"
|
|
|
|
snapshot_retention_limit = 0
|
|
|
|
automatic_failover_enabled = true
|
|
|
|
at_rest_encryption_enabled = false
|
|
|
|
transit_encryption_enabled = false
|
|
|
|
apply_immediately = true
|
|
|
|
replication_group_description = "fleetdm-redis"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-03-21 17:18:21 +00:00
|
|
|
resource "aws_elasticache_parameter_group" "default" {
|
|
|
|
name = "fleetdm-redis-foobar"
|
|
|
|
family = "redis5.0"
|
|
|
|
|
|
|
|
parameter {
|
|
|
|
name = "client-output-buffer-limit-pubsub-hard-limit"
|
|
|
|
value = "0"
|
|
|
|
}
|
|
|
|
parameter {
|
|
|
|
name = "client-output-buffer-limit-pubsub-soft-limit"
|
|
|
|
value = "0"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-15 18:00:24 +00:00
|
|
|
resource "aws_security_group" "redis" {
|
|
|
|
name = local.security_group_name
|
|
|
|
vpc_id = module.vpc.vpc_id
|
|
|
|
}
|
|
|
|
|
|
|
|
locals {
|
|
|
|
security_group_name = "${local.prefix}-elasticache-redis"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "ingress" {
|
|
|
|
type = "ingress"
|
|
|
|
from_port = "6379"
|
|
|
|
to_port = "6379"
|
|
|
|
protocol = "tcp"
|
|
|
|
cidr_blocks = module.vpc.private_subnets_cidr_blocks
|
|
|
|
security_group_id = aws_security_group.redis.id
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "egress" {
|
|
|
|
type = "egress"
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
|
|
|
protocol = "-1"
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
security_group_id = aws_security_group.redis.id
|
|
|
|
}
|