39 lines
904 B
HCL
39 lines
904 B
HCL
resource "random_password" "system" {
|
|
length = 32
|
|
special = false
|
|
}
|
|
|
|
resource "random_password" "rabbit" {
|
|
length = 32
|
|
special = false
|
|
}
|
|
|
|
resource "kubectl_manifest" "secret" {
|
|
yaml_body = <<-EOF
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: "${var.instance}-${var.component}"
|
|
labels: ${jsonencode(local.common_labels)}
|
|
namespace: ${var.namespace}
|
|
type: Opaque
|
|
stringData:
|
|
TAIGA_SECRET_KEY: "${random_password.system.result}"
|
|
EOF
|
|
}
|
|
|
|
resource "kubectl_manifest" "rabbit_user_secret" {
|
|
yaml_body = <<-EOF
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: "${var.instance}-${var.component}-rabbitmq-taiga"
|
|
labels: ${jsonencode(local.common_labels)}
|
|
namespace: ${var.namespace}
|
|
type: Opaque
|
|
stringData:
|
|
username: taiga
|
|
password: "${random_password.rabbit.result}"
|
|
EOF
|
|
}
|