Skip to content

Commit 7283eba

Browse files
author
Alejandro Colomina
committed
Adds support for replicating from another Redis instance
1 parent 5d3b937 commit 7283eba

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

security_groups.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,13 @@ resource "aws_security_group_rule" "redis_networks_ingress" {
2626
cidr_blocks = var.allowed_cidr
2727
security_group_id = aws_security_group.redis_security_group.id
2828
}
29+
30+
resource "aws_security_group_rule" "redis_replication_egress" {
31+
count = var.is_migration_cluster ? 1 : 0
32+
type = "egress"
33+
from_port = 0
34+
to_port = 0
35+
protocol = "-1"
36+
cidr_blocks = ["0.0.0.0/0"]
37+
security_group_id = aws_security_group.redis_security_group.id
38+
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ variable "redis_failover" {
5959
default = false
6060
}
6161

62+
variable "is_migration_cluster" {
63+
description = "Specifies whether this is a cluster for replicating other EC2 redis. Useful for migrations."
64+
type = bool
65+
default = false
66+
}
67+
6268
variable "redis_node_type" {
6369
description = "Instance type to use for creating the Redis cache clusters"
6470
type = string

0 commit comments

Comments
 (0)