Skip to content

Commit

Permalink
feat: implem config for new tls on core
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico-dl05 committed Jan 16, 2025
1 parent 25f2fd7 commit e369365
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion storage/onpremise/mongodb-sharded/certificates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ resource "tls_cert_request" "mongodb_cert_request" {
private_key_pem = tls_private_key.mongodb_private_key.private_key_pem
subject {
country = "France"
common_name = "127.0.0.1"
common_name = local.mongodb_dns
# organization = "127.0.0.1"
}
}
Expand Down Expand Up @@ -67,6 +67,7 @@ resource "kubernetes_secret" "mongodb_certificate" {
data = {
"mongodb.pem" = format("%s\n%s", tls_locally_signed_cert.mongodb_certificate.cert_pem, tls_private_key.mongodb_private_key.private_key_pem)
"chain.pem" = format("%s\n%s", tls_locally_signed_cert.mongodb_certificate.cert_pem, tls_self_signed_cert.root_mongodb.cert_pem)
"ca.pem" = tls_self_signed_cert.root_mongodb.cert_pem
}
}

Expand Down
2 changes: 1 addition & 1 deletion storage/onpremise/mongodb-sharded/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ output "env" {
"MongoDB__ReplicaSet" = "rs0"
"MongoDB__DatabaseName" = "database"
"MongoDB__DirectConnection" = "true"
"MongoDB__CAFile" = "/mongodb/certs/chain.pem"
"MongoDB__CAFile" = "/mongodb/certs/ca.pem"
"MongoDB__Sharding" = "true"
"MongoDB__AuthSource" = "admin"
})
Expand Down
2 changes: 2 additions & 0 deletions storage/onpremise/mongodb-sharded/secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ resource "kubernetes_secret" "mongodb" {
namespace = helm_release.mongodb.namespace
}
data = {
"ca.pem" = tls_self_signed_cert.root_mongodb.cert_pem
"mongodb.pem" = format("%s\n%s", tls_locally_signed_cert.mongodb_certificate.cert_pem, tls_private_key.mongodb_private_key.private_key_pem)
"chain.pem" = format("%s\n%s", tls_locally_signed_cert.mongodb_certificate.cert_pem, tls_self_signed_cert.root_mongodb.cert_pem)
username = random_string.mongodb_application_user.result
password = random_password.mongodb_application_password.result
Expand Down

0 comments on commit e369365

Please sign in to comment.