forked from jenkins-infra/azure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrating.jenkins.io.tf
29 lines (26 loc) · 939 Bytes
/
rating.jenkins.io.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
resource "postgresql_database" "rating" {
name = "rating"
owner = postgresql_role.rating.name
}
resource "random_password" "pgsql_rating_user_password" {
length = 24
override_special = "!#%&*()-_=+[]{}:?"
special = true
}
resource "postgresql_role" "rating" {
name = "rating"
login = true
password = random_password.pgsql_rating_user_password.result
}
# This (sensitive) output is meant to be encrypted into the production secret system, to be provided as a secret to the ratings.jenkins.io application
output "rating_dbconfig" {
sensitive = true
description = "YAML (secret) values for the Helm chart jenkins-infra/rating"
value = <<-EOT
database:
username: "${postgresql_role.rating.name}"
password: "${random_password.pgsql_rating_user_password.result}"
server: "${azurerm_postgresql_flexible_server.public_db.fqdn}"
name: "${postgresql_database.rating.name}"
EOT
}