Skip to content

Commit

Permalink
adapt secret config
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0olo committed Apr 25, 2024
1 parent 8da201b commit f8fc306
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions civo-github/terraform/vault/secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ resource "random_password" "dev-postgres-soony" {
}

resource "vault_generic_secret" "dev-postgres-passwords" {
path = "secret/development/postgres"
path = "${vault_mount.secret.path}/development/postgres"

data_json = jsonencode(
{
Expand All @@ -181,8 +181,6 @@ resource "vault_generic_secret" "dev-postgres-passwords" {
PG_SOONY_PASSWORD = random_password.dev-postgres-soony.result,
}
)

depends_on = [vault_mount.secret]
}

resource "random_password" "pgadmin" {
Expand All @@ -192,15 +190,13 @@ resource "random_password" "pgadmin" {
}

resource "vault_generic_secret" "pgadmin-secrets" {
path = "secret/pgadmin"
path = "${vault_mount.secret.path}/pgadmin"

data_json = jsonencode(
{
pgadmin-password = random_password.pgadmin.result,
}
)

depends_on = [vault_mount.secret]
}

resource "random_password" "grafana-admin" {
Expand All @@ -211,14 +207,12 @@ resource "random_password" "grafana-admin" {


resource "vault_generic_secret" "grafana-secrets" {
path = "secret/monitoring/grafana"
path = "${vault_mount.secret.path}/monitoring/grafana"

data_json = jsonencode(
{
admin-user = "admin"
admin-password = random_password.grafana-admin.result,
}
)

depends_on = [vault_mount.secret]
}

0 comments on commit f8fc306

Please sign in to comment.