Skip to content
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

fix: move the auth token generation out of the redis module for integration reasons #623

7 changes: 1 addition & 6 deletions aws-redis-replication-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ resource "aws_elasticache_parameter_group" "redis_parameter_group" {
}
}

resource "random_password" "redis_db" {
length = 32
special = false
}

resource "aws_elasticache_replication_group" "default" {
replication_group_id = var.resource_name != "" ? var.resource_name : local.name
description = var.description
Expand All @@ -62,6 +57,6 @@ resource "aws_elasticache_replication_group" "default" {
at_rest_encryption_enabled = var.at_rest_encryption_enabled
transit_encryption_enabled = var.transit_encryption_enabled
preferred_cache_cluster_azs = var.preferred_cache_cluster_azs
auth_token = random_password.redis_db.result
auth_token = var.auth_token
tags = var.tags
}
6 changes: 6 additions & 0 deletions aws-redis-replication-group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,9 @@ variable "parameters" {
default = []
description = "Redis database parameters in name-value pairs. Use the parameter group family to find parameters [here](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/ParameterGroups.Redis.html)"
}

variable "auth_token"{
type = string
description = "Token for accessing the elasticache cluster"
sensitive = true
}
Loading