Skip to content

Commit

Permalink
OPS-0 Add variable to enable multi-az for elasticache replication group
Browse files Browse the repository at this point in the history
Deafult is false in dev and tesging env. Ture vaule in prod env
  • Loading branch information
Mao-hsiang Lien committed Sep 3, 2021
1 parent 0bbf410 commit d916e01
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ The following resources _CAN_ be created:
| redis\_group\_parameter\_group\_name | Redis parameter group name | string | `"default.redis5.0.cluster.on"` | no |
| redis\_instance\_type | Redis instance type | string | `"cache.m4.large"` | no |
| redis\_maintenance\_window | Redis snapshot window | string | `"mon:10:00-mon:12:00"` | no |
| redis\_multi\_az\_enabled | Specifies whether to enable Multi-AZ Support for the replication group. If true, automatic_failover_enabled must also be enabled. | bool | `"false"` | no |
| redis\_port | Redis port | string | `"6379"` | no |
| redis\_replicas\_count | Number of replica nodes in each node group | string | `"1"` | no |
| redis\_shards\_count | Number of shards | string | `"1"` | no |
Expand Down
1 change: 1 addition & 0 deletions redis.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ resource "aws_elasticache_replication_group" "this" {
parameter_group_name = var.redis_group_parameter_group_name

automatic_failover_enabled = true
multi_az_enabled = var.redis_multi_az_enabled

cluster_mode {
# Number of shards
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,12 @@ variable "redis_apply_immediately" {
default = false
}

variable "redis_multi_az_enabled" {
description = "Specifies whether to enable Multi-AZ Support for the replication group. If true, automatic_failover_enabled must also be enabled."
type = bool
default = false
}

# -------------------------------------------------------------------------------------------------
# RDS
# -------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit d916e01

Please sign in to comment.