Skip to content

No ref add support for valkey #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ terraform-docs md ./ | cat -s | tail -r | tail -n +2 | tail -r > README.md
| cloudwatch_alarm_default_thresholds | Override default thresholds for CloudWatch alarms. See cloudwatch_alarm_thresholds in cloudwatch.tf for valid keys | map | `<map>` | no |
| cloudwatch_create_alarms | Whether to enable CloudWatch alarms | string | `false` | no |
| create_resources | Whether to create the Aurora cluster and related resources | string | `true` | no |
| engine | Engine type, either `redis` or `valkey` | string | `redis` | no |
| at_rest_encryption_enabled | To encrypt data on disk. For `redis`, default:false; for `valkey`, default:true. Its default:false here to maintain backward compatibility | bool | `false` | no |
| transit_encryption_enabled | To encrypt data between client-server communications | bool | `false` | no |
| transit_encryption_mode | Is transit encryption preferred or required | string | `preferred` | no |
| auto_minor_version_upgrade | Allow automatic minor version upgrade; default:true for engine version 6+ for both `redis` and `valkey` | bool | `true` | no |
| engine_version | Redis engine verions | string | `4.0.10` | no |
| maintenance_window | When to perform maintenance | string | `sun:02:30-sun:03:30` | no |
| multi_az_enabled | Specifies whether to enable Multi-AZ Support for the replication group. Applied only when `number_cache_clusters` is greater than 1. | bool | `true` | no |
Expand Down
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ locals {

resource "aws_elasticache_replication_group" "redis" {
count = var.create_resources ? 1 : 0
engine = var.engine
replication_group_id = var.name
description = var.name
automatic_failover_enabled = local.automatic_failover_enabled
Expand All @@ -19,6 +20,10 @@ resource "aws_elasticache_replication_group" "redis" {
apply_immediately = var.apply_immediately
tags = var.tags
multi_az_enabled = local.automatic_failover_enabled ? var.multi_az_enabled : false
at_rest_encryption_enabled = var.at_rest_encryption_enabled
transit_encryption_enabled = var.transit_encryption_enabled
transit_encryption_mode = var.transit_encryption_enabled ? var.transit_encryption_mode : null
auto_minor_version_upgrade = var.auto_minor_version_upgrade
}

resource "aws_elasticache_subnet_group" "redis" {
Expand Down
30 changes: 30 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
variable "engine" {
description = "Cache engine; redis or valkey"
type = string
default = "redis"
}

variable "at_rest_encryption_enabled" {
description = "To encrypt data on disk. For redis, default:false; for valkey, default:true. Its default:false here to maintain backward compatibility"
type = bool
default = false
}

variable "transit_encryption_enabled" {
description = "To encrypt data between client-server communications."
type = bool
default = false
}

variable "transit_encryption_mode" {
description = "Is transit encryption preferred or required"
type = string
default = "preferred"
}

variable "auto_minor_version_upgrade" {
description = "Allow automatic minor version upgrade; default:true for engine version 6+ for both redis and valkey"
type = bool
default = true
}

variable "name" {
description = "Name given resources"
type = string
Expand Down