Skip to content

Commit e3e98ff

Browse files
authored
Support Redis Parameters (#24)
* Paramatrise redis * Update label version * Update label version * Update example * Fix example Signed-off-by: Igor Rodionov <goruha@gmail.com> * Update variables.tf * Update terraform.md * Update README.md
1 parent 945d670 commit e3e98ff

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Available targets:
107107
| name | Name | string | `redis` | no |
108108
| namespace | Namespace | string | `global` | no |
109109
| notification_topic_arn | Notification topic arn | string | `` | no |
110+
| parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | list | `<list>` | no |
110111
| port | Redis port | string | `6379` | no |
111112
| security_groups | AWS security group ids | list | `<list>` | no |
112113
| stage | Stage | string | `default` | no |

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
| name | Name | string | `redis` | no |
2323
| namespace | Namespace | string | `global` | no |
2424
| notification_topic_arn | Notification topic arn | string | `` | no |
25+
| parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | list | `<list>` | no |
2526
| port | Redis port | string | `6379` | no |
2627
| security_groups | AWS security group ids | list | `<list>` | no |
2728
| stage | Stage | string | `default` | no |

examples/simple/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,11 @@ module "redis" {
6666
alarm_cpu_threshold_percent = "75"
6767
alarm_memory_threshold_bytes = "10000000"
6868
at_rest_encryption_enabled = "true"
69+
70+
parameter = [
71+
{
72+
name = "notify-keyspace-events"
73+
value = "lK"
74+
},
75+
]
6976
}

main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Define composite variables for resources
22
module "label" {
3-
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.3"
3+
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.5.3"
44
enabled = "${var.enabled}"
55
namespace = "${var.namespace}"
66
name = "${var.name}"
@@ -42,9 +42,10 @@ resource "aws_elasticache_subnet_group" "default" {
4242
}
4343

4444
resource "aws_elasticache_parameter_group" "default" {
45-
count = "${var.enabled == "true" ? 1 : 0}"
46-
name = "${module.label.id}"
47-
family = "${var.family}"
45+
count = "${var.enabled == "true" ? 1 : 0}"
46+
name = "${module.label.id}"
47+
family = "${var.family}"
48+
parameter = "${var.parameter}"
4849
}
4950

5051
resource "aws_elasticache_replication_group" "default" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ variable "family" {
6060
description = "Redis family "
6161
}
6262

63+
variable "parameter" {
64+
type = "list"
65+
default = []
66+
description = "A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another"
67+
}
68+
6369
variable "engine_version" {
6470
default = "4.0.10"
6571
description = "Redis engine version"

0 commit comments

Comments
 (0)