feat(minio): switchable https console redirect and named tenant service accounts

Add an https toggle that selects the MINIO_BROWSER_REDIRECT_URL scheme,
and set an explicit name on minio_iam_service_account.overlay so tenant
accounts get stable, predictable identifiers.
This commit is contained in:
Thomas Rijpstra 2026-06-25 09:54:14 +02:00
parent 7067cb8c89
commit 4d85473223
Signed by: thomas
SSH Key Fingerprint: SHA256:NoPljIC4A210B8B3jJovKUIFRtnYxYA4ej6sgkR/yWA
2 changed files with 7 additions and 1 deletions

View File

@ -16,6 +16,11 @@ variable "server_domain" {
type = string
}
variable "https" {
type = bool
default = false
}
resource "random_password" "minio_access_key" {
length = 20
special = false
@ -45,7 +50,7 @@ module "minio" {
MINIO_ROOT_USER = random_password.minio_access_key.result
MINIO_ROOT_PASSWORD = random_password.minio_secret_key.result
MINIO_CONSOLE_ADDRESS = ":9001"
MINIO_BROWSER_REDIRECT_URL = "http://storage.${var.server_domain}"
MINIO_BROWSER_REDIRECT_URL = "${var.https ? "https" : "http" }://storage.${var.server_domain}"
}
command = ["server", "/data", "--console-address", ":9001"]

View File

@ -185,6 +185,7 @@ resource "minio_iam_user_policy_attachment" "overlay" {
resource "minio_iam_service_account" "overlay" {
depends_on = [minio_iam_user.overlay, minio_s3_bucket.overlay, minio_s3_bucket.uploads]
target_user = minio_iam_user.overlay.name
name = var.name
policy = jsonencode({
Version = "2012-10-17"
Statement = [