role management for postgres synergy with vault dynamic credentials
This commit is contained in:
37
postgres/iac/providers.tf
Normal file
37
postgres/iac/providers.tf
Normal file
@@ -0,0 +1,37 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
postgresql = {
|
||||
source = "cyrilgdn/postgresql"
|
||||
version = "1.24.0"
|
||||
}
|
||||
vault = {
|
||||
source = "vault"
|
||||
version = "4.4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "POSTGRES_USERNAME" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
variable "POSTGRES_PASSWORD" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
provider "postgresql" {
|
||||
host = "192.168.1.202"
|
||||
username = var.POSTGRES_USERNAME
|
||||
password = var.POSTGRES_PASSWORD
|
||||
sslmode = "disable"
|
||||
superuser = true
|
||||
}
|
||||
|
||||
provider vault {
|
||||
address = "https://vault.arcodange.duckdns.org"
|
||||
auth_login_jwt { # TERRAFORM_VAULT_AUTH_JWT environment variable
|
||||
mount = "gitea_jwt"
|
||||
role = "gitea_cicd"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user