Skip to content

Commit

Permalink
Change cache_url in redis_url
Browse files Browse the repository at this point in the history
  • Loading branch information
filippo-20tab committed Mar 9, 2023
1 parent 3746c7c commit a0cbf52
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ resource "kubernetes_secret_v1" "database_url" {
}
}

resource "kubernetes_secret_v1" "cache_url" {
resource "kubernetes_secret_v1" "redis_url" {
count = var.use_redis ? 1 : 0

metadata {
name = "cache-url"
name = "redis-url"
namespace = local.namespace
}
data = {
CACHE_URL = "${data.digitalocean_database_cluster.redis[0].private_uri}?key_prefix=${var.env_slug}"
REDIS_URL = data.digitalocean_database_cluster.redis[0].private_uri
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
output "cache_url" {
description = "The Redis cache url."
output "redis_url" {
description = "The Redis server URL."
value = "redis://:${random_password.main.result}@${kubernetes_service_v1.main.metadata[0].name}:6379"
sensitive = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ resource "kubernetes_secret_v1" "database_url" {
}
}

resource "kubernetes_secret_v1" "cache_url" {
resource "kubernetes_secret_v1" "redis_url" {
count = var.use_redis ? 1 : 0

metadata {
name = "cache-url"
name = "redis-url"
namespace = local.namespace
}
data = {
CACHE_URL = "${module.redis[0].cache_url}?key_prefix=${var.env_slug}"
REDIS_URL = module.redis[0].redis_url
}
}

Expand Down

0 comments on commit a0cbf52

Please sign in to comment.