Skip to content

Commit

Permalink
Add support for availability_zones parameter (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcincuber authored Dec 8, 2020
1 parent c1ae001 commit 62e0d18
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
args: ['--allow-missing-credentials']
- id: trailing-whitespace
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.44.0
rev: v1.45.0
hooks:
- id: terraform_fmt
- id: terraform_docs
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Module managed by [Marcin Cuber](https://github.com/marcincuber) [linkedin](http
| auth\_token | The password used to access a password protected server. Can be specified only if `transit_encryption_enabled = true`. | `string` | `""` | no |
| auto\_minor\_version\_upgrade | n/a | `string` | `true` | no |
| 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 |
| 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 |
| cluster\_mode\_enabled | Enable creation of a native redis cluster. | `bool` | `false` | no |
| description | The description of the all resources. | `string` | `"Managed by Terraform"` | no |
| 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 |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "aws_elasticache_replication_group" "redis" {
subnet_group_name = aws_elasticache_subnet_group.redis.name
security_group_ids = concat(var.security_group_ids, [aws_security_group.redis.id])

availability_zones = var.availability_zones
replication_group_id = "${var.name_prefix}-redis"
number_cache_clusters = var.cluster_mode_enabled ? null : var.number_cache_clusters
node_type = var.node_type
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,9 @@ variable "num_node_groups" {
default = 0
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."
}

variable "availability_zones" {
type = list(string)
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."
default = null
}

0 comments on commit 62e0d18

Please sign in to comment.