Opinionated.tf/products/dex/traefik-forward-auth.tf

21 lines
673 B
Terraform
Raw Normal View History

2025-01-06 09:48:33 +00:00
resource "random_password" "forward_auth_secret" {
2025-01-06 11:22:08 +00:00
length = 32
2025-01-06 09:48:33 +00:00
special = false
}
module "forward_auth" {
2025-01-06 11:22:08 +00:00
source = "../../docker/service"
stack_name = var.stack_name
2025-01-06 09:48:33 +00:00
service_name = "forward-auth"
2025-01-06 11:22:08 +00:00
image = "thomseddon/traefik-forward-auth"
2025-01-06 09:48:33 +00:00
traefik = {
port = 4181
}
labels = {
"traefik.http.middlewares.forward-auth.forwardauth.address" = "http://forward-auth:4181"
"traefik.http.middlewares.forward-auth.forwardauth.authResponseHeaders" = "X-Forwarded-User"
}
environment_variables = {
2025-01-06 11:22:08 +00:00
SECRET = random_password.forward_auth_secret.result
INSECURE_COOKIE = var.traefik.ssl ? "false" : "true"
2025-01-06 09:48:33 +00:00
}
}