24 lines
588 B
HCL
24 lines
588 B
HCL
resource "random_password" "system" {
|
|
length = 16
|
|
special = false
|
|
}
|
|
resource "random_password" "admin" {
|
|
length = 16
|
|
special = false
|
|
}
|
|
|
|
resource "kubectl_manifest" "secret" {
|
|
yaml_body = <<-EOF
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: "${var.instance}-${var.component}"
|
|
labels: ${jsonencode(local.sonar_all_labels)}
|
|
namespace: ${var.namespace}
|
|
type: Opaque
|
|
stringData:
|
|
SONAR_WEB_SYSTEMPASSCODE: "${random_password.system.result}"
|
|
ADMIN_PASSWORD: "${random_password.admin.result}"
|
|
EOF
|
|
}
|