Skip to content

Commit

Permalink
Merge pull request #1350 from GiganticMinecraft/add_db_password_on_pr…
Browse files Browse the repository at this point in the history
…_review

add password
  • Loading branch information
outductor authored Oct 2, 2023
2 parents a8860b0 + 97a15f9 commit fe588e5
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions terraform/onp_cluster_secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,34 @@ resource "helm_release" "onp_minecraft_mariadb_monitoring_password" {
]
}
}

resource "random_password" "minecraft__pr_review_mariadb_password" {
length = 16
special = false // MariaDBのパスワードがぶっ壊れて困るので記号を含めない
}

resource "helm_release" "onp_minecraft__pr_review_mariadb_password" {
depends_on = [helm_release.onp_cluster_clustersecret]

repository = "https://giganticminecraft.github.io/seichi_infra/"
chart = "raw-resources"
name = "mariadb-pr-review-password-raw-resource"
namespace = "kube-system"
version = "0.3.0"

set_list {
name = "manifests"
value = [<<-EOS
kind: ClusterSecret
apiVersion: clustersecret.io/v1
metadata:
namespace: clustersecret
name: mariadb-pr-review-password
matchNamespace:
- seichi-debug-minecraft-on-seichiassist-pr-*
data:
mcserver-password: ${base64encode(random_password.minecraft__pr_review_mariadb_password.result)}
EOS
]
}
}

0 comments on commit fe588e5

Please sign in to comment.