Skip to content

Commit 62e0d18

Browse files
authored
Add support for availability_zones parameter (#11)
1 parent c1ae001 commit 62e0d18

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
args: ['--allow-missing-credentials']
1919
- id: trailing-whitespace
2020
- repo: git://github.com/antonbabenko/pre-commit-terraform
21-
rev: v1.44.0
21+
rev: v1.45.0
2222
hooks:
2323
- id: terraform_fmt
2424
- id: terraform_docs

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Module managed by [Marcin Cuber](https://github.com/marcincuber) [linkedin](http
8989
| auth\_token | The password used to access a password protected server. Can be specified only if `transit_encryption_enabled = true`. | `string` | `""` | no |
9090
| auto\_minor\_version\_upgrade | n/a | `string` | `true` | no |
9191
| automatic\_failover\_enabled | Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. | `bool` | `true` | no |
92+
| availability\_zones | A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important. | `list(string)` | `null` | no |
9293
| cluster\_mode\_enabled | Enable creation of a native redis cluster. | `bool` | `false` | no |
9394
| description | The description of the all resources. | `string` | `"Managed by Terraform"` | no |
9495
| engine\_version | The version number of the cache engine to be used for the cache clusters in this replication group. | `string` | `"5.0.6"` | no |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ resource "aws_elasticache_replication_group" "redis" {
55
subnet_group_name = aws_elasticache_subnet_group.redis.name
66
security_group_ids = concat(var.security_group_ids, [aws_security_group.redis.id])
77

8+
availability_zones = var.availability_zones
89
replication_group_id = "${var.name_prefix}-redis"
910
number_cache_clusters = var.cluster_mode_enabled ? null : var.number_cache_clusters
1011
node_type = var.node_type

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,9 @@ variable "num_node_groups" {
162162
default = 0
163163
description = "Required when `cluster_mode_enabled` is set to true. Specify the number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other settings modifications."
164164
}
165+
166+
variable "availability_zones" {
167+
type = list(string)
168+
description = "A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important."
169+
default = null
170+
}

0 commit comments

Comments
 (0)