This commit is contained in:
Stanislav Kopp 2025-05-06 09:30:27 +02:00
commit c3bc6ab806
40 changed files with 1069 additions and 0 deletions

View file

@ -0,0 +1,9 @@
provider "vault" {
address = "https://prod.sm.eu01.stackit.cloud"
skip_child_token = true
auth_login_userpass {
username = var.secret_manager_username
password = var.secret_manager_password
}
}

7
create-secret/secret.tf Normal file
View file

@ -0,0 +1,7 @@
resource "vault_kv_secret_v2" "this" {
mount = var.secret_manager_instance_id
name = var.secrets_path
cas = 1
delete_all_versions = true
data_json = jsonencode(var.secret_data)
}

View file

@ -0,0 +1,29 @@
# Secret Manager
variable "secret_manager_instance_id" {
description = "instance id of the secret mangert to store credentials"
type = string
default = ""
}
variable "secret_manager_username" {
description = "username of the secret mangert to store credentials"
type = string
sensitive = true
}
variable "secret_manager_password" {
description = "password of the secret mangert to store credentials"
type = string
sensitive = true
}
variable "secrets_path" {
description = "path in secret manager to store the postgres credentials"
type = string
default = ""
}
variable "secret_data" {
description = "Secret data in JSON format"
type = map(string)
}