File tree Expand file tree Collapse file tree 5 files changed +36
-0
lines changed Expand file tree Collapse file tree 5 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 11# Compiled files
22* .tfstate
33* .tfstate.backup
4+ .terraform
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ resource "aws_elasticache_replication_group" "redis" {
1515 number_cache_clusters = var. redis_clusters
1616 node_type = var. redis_node_type
1717 automatic_failover_enabled = var. redis_failover
18+ multi_az_enabled = var. multi_az_enabled
1819 engine_version = var. redis_version
1920 port = var. redis_port
2021 parameter_group_name = aws_elasticache_parameter_group. redis_parameter_group . id
Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff line change @@ -47,11 +47,24 @@ variable "redis_clusters" {
4747 type = string
4848}
4949
50+ variable "multi_az_enabled" {
51+ description = " Specifies whether to enable Multi-AZ Support for the replication group"
52+ type = bool
53+ default = false
54+ }
55+
5056variable "redis_failover" {
57+ description = " Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails"
5158 type = bool
5259 default = false
5360}
5461
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+
5568variable "redis_node_type" {
5669 description = " Instance type to use for creating the Redis cache clusters"
5770 type = string
Original file line number Diff line number Diff line change 1+ terraform {
2+ required_version = " >= 0.12"
3+ }
4+
5+ provider "aws" {
6+ version = " ~> 3.31"
7+ }
8+
9+ provider "random" {
10+ version = " ~> 3.1"
11+ }
You can’t perform that action at this time.
0 commit comments