diff --git a/elasticache.tf b/elasticache.tf index 983723e..a66054d 100644 --- a/elasticache.tf +++ b/elasticache.tf @@ -67,10 +67,10 @@ resource "kubernetes_secret" "redis_secrets" { namespace = var.inject_secret_into_ns[count.index] } - data = { + data = { REDIS_PRIMARY_ENDPOINT_ADDRESS = var.redis_cluster_mode["enabled"] ? aws_elasticache_replication_group.redis_cluster[0].primary_endpoint_address : aws_elasticache_replication_group.redis[0].primary_endpoint_address REDIS_CONFIGURATION_ENDPOINT_ADDRESS = var.redis_cluster_mode["enabled"] ? aws_elasticache_replication_group.redis_cluster[0].configuration_endpoint_address : aws_elasticache_replication_group.redis[0].configuration_endpoint_address - REDIS_MEMBER_CLUSTERS = join(",",var.redis_cluster_mode["enabled"] ? aws_elasticache_replication_group.redis_cluster[0].member_clusters : aws_elasticache_replication_group.redis[0].member_clusters) + REDIS_MEMBER_CLUSTERS = join(",", var.redis_cluster_mode["enabled"] ? aws_elasticache_replication_group.redis_cluster[0].member_clusters : aws_elasticache_replication_group.redis[0].member_clusters) REDIS_PORT = var.redis_port REDIS_AUTH = var.redis_token_enabled ? random_uuid.redis_token[0].result : null } diff --git a/redis-exporter.tf b/redis-exporter.tf index d04ddbd..3cc80fd 100644 --- a/redis-exporter.tf +++ b/redis-exporter.tf @@ -28,13 +28,13 @@ resource "helm_release" "redis_exporter" { } resource "kubernetes_config_map" "stunnel" { - count = var.redis_exporter["enabled"] ? 1 : 0 + count = var.redis_exporter["enabled"] ? 1 : 0 metadata { name = "${var.redis_id}-${var.env}-stunnel-config" namespace = "monitoring" } - data = { - "stunnel.conf" = "${templatefile("templates/stunnel.tpl", { redis_host = var.redis_cluster_mode["enabled"] ? aws_elasticache_replication_group.redis_cluster[0].configuration_endpoint_address : aws_elasticache_replication_group.redis[0].primary_endpoint_address, redis_port =var.redis_port})}" + data = { + "stunnel.conf" = "${templatefile("templates/stunnel.tpl", { redis_host = var.redis_cluster_mode["enabled"] ? aws_elasticache_replication_group.redis_cluster[0].configuration_endpoint_address : aws_elasticache_replication_group.redis[0].primary_endpoint_address, redis_port = var.redis_port })}" } } diff --git a/variables.tf b/variables.tf index 47f5fbe..a2e93f7 100644 --- a/variables.tf +++ b/variables.tf @@ -44,7 +44,7 @@ variable "redis_port" { } variable "redis_security_group_ids" { - type = list + type = list default = [] } @@ -78,9 +78,9 @@ variable "tags" { } variable "redis_cluster_mode" { - type = any - default = { - enabled = false + type = any + default = { + enabled = false } } @@ -95,7 +95,7 @@ variable "inject_secret_into_ns" { } variable "redis_exporter" { - type = any + type = any } variable "redis_token_enabled" { @@ -103,6 +103,6 @@ variable "redis_token_enabled" { } variable "redis_subnets" { - type = list + type = list default = [] }