Skip to content
Merged
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
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ locals {
"${module.label.id}-000${i + 1}-00${j + 1}"
]
]) : [module.label.id]

auth_token_update_strategy = var.auth_token_update_strategy != null ? var.auth_token_update_strategy : var.auth_token != null ? "ROTATE" : null
}

module "label" {
Expand Down Expand Up @@ -186,7 +188,7 @@ resource "aws_elasticache_replication_group" "default" {
apply_immediately = var.apply_immediately
data_tiering_enabled = var.data_tiering_enabled
auto_minor_version_upgrade = var.auto_minor_version_upgrade
auth_token_update_strategy = var.auth_token_update_strategy
auth_token_update_strategy = local.auth_token_update_strategy

dynamic "log_delivery_configuration" {
for_each = var.log_delivery_configuration
Expand Down
8 changes: 4 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ variable "insufficient_data_actions" {
}

variable "auth_token_update_strategy" {
description = "Strategy to use when updating the auth_token. Valid values: SET, ROTATE, DELETE."
description = "Strategy to use when updating the auth_token. Valid values: SET, ROTATE, DELETE, or null."
type = string
default = "ROTATE"
default = null

validation {
condition = contains(["SET", "ROTATE", "DELETE"], var.auth_token_update_strategy)
error_message = "auth_token_update_strategy must be one of SET, ROTATE, or DELETE if auth_token is set."
condition = var.auth_token_update_strategy == null ? true : contains(["SET", "ROTATE", "DELETE"], var.auth_token_update_strategy)
error_message = "auth_token_update_strategy must be one of SET, ROTATE, DELETE, or null"
}
}