Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

don't pass redis password when auth disabled #1751

Merged
merged 3 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export FIREBASE_STORAGE_BUCKET="${data.google_firebase_web_app_config.default.st
export CACHE_TYPE="REDIS"
export CACHE_REDIS_HOST="${google_redis_instance.cache.host}"
export CACHE_REDIS_PORT="${google_redis_instance.cache.port}"
export CACHE_REDIS_PASSWORD="secret://${google_secret_manager_secret_version.redis-auth.id}"
export CACHE_REDIS_PASSWORD=var.redis_enable_auth ? "secret://${google_secret_manager_secret_version.redis-auth.id}" : ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also Rate Limit


export RATE_LIMIT_TYPE="REDIS"
export RATE_LIMIT_TOKENS="60"
Expand Down
2 changes: 1 addition & 1 deletion terraform/redis.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ resource "google_secret_manager_secret" "redis-auth" {

resource "google_secret_manager_secret_version" "redis-auth" {
secret = google_secret_manager_secret.redis-auth.id
secret_data = google_redis_instance.cache.auth_string
secret_data = coalesce(google_redis_instance.cache.auth_string, "unused")
}

# Create secret for the HMAC cache keys
Expand Down
2 changes: 1 addition & 1 deletion terraform/services.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ locals {
CACHE_HMAC_KEY = "secret://${google_secret_manager_secret_version.cache-hmac-key.id}"
CACHE_REDIS_HOST = google_redis_instance.cache.host
CACHE_REDIS_PORT = google_redis_instance.cache.port
CACHE_REDIS_PASSWORD = "secret://${google_secret_manager_secret_version.redis-auth.id}"
CACHE_REDIS_PASSWORD = var.redis_enable_auth ? "secret://${google_secret_manager_secret_version.redis-auth.id}" : ""
}

database_config = {
Expand Down