ce7cb702218693d08ea6d83464d2457c9250027c
This commit is contained in:
commit
34c5f8963c
1 changed files with 145336 additions and 0 deletions
30
terraform/internal/vault/pg-image.tf
Normal file
30
terraform/internal/vault/pg-image.tf
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
resource "vault_kv_secret_v2" "pg_image" {
|
||||
mount = vault_mount.secret.path
|
||||
name = "zot/pg-image"
|
||||
|
||||
data_json_wo_version = 1
|
||||
data_json_wo = jsonencode({
|
||||
username = "PLACEHOLDER"
|
||||
password = "PLACEHOLDER"
|
||||
})
|
||||
}
|
||||
|
||||
resource "vault_policy" "pg_image" {
|
||||
name = "pg-image-writer"
|
||||
|
||||
policy = <<-EOT
|
||||
path "secret/data/zot/pg-image" {
|
||||
capabilities = ["read"]
|
||||
}
|
||||
EOT
|
||||
}
|
||||
|
||||
resource "vault_kubernetes_auth_backend_role" "pg_image" {
|
||||
backend = vault_auth_backend.kubernetes.path
|
||||
role_name = "pg-image-writer"
|
||||
bound_service_account_names = ["pg-image-zot-vso"]
|
||||
bound_service_account_namespaces = ["project-delivery"]
|
||||
token_policies = [vault_policy.pg_image.name]
|
||||
token_ttl = 3600
|
||||
token_max_ttl = 3600
|
||||
}
|
||||
Loading…
Reference in a new issue