refactor: 구조 변경

This commit is contained in:
donghyeon-ka
2026-08-28 17:24:26 +09:00
parent a6f6c663e0
commit b8626946b1
192 changed files with 2251 additions and 206 deletions
@@ -0,0 +1,16 @@
# Vault Kubernetes roles
## 책임
Vault Kubernetes auth role을 입력 map에서 생성하는 backend 없는 재사용
Terraform component입니다.
## 입력과 출력
- 입력: auth backend 경로와 role별 audience, ServiceAccount, namespace,
policy, TTL
- 출력: 없음
- 민감 payload: 없음
호출하는 live root가 provider와 state를 소유합니다. 이 component는 환경
이름이나 credential을 내부에 저장하지 않습니다.
@@ -0,0 +1,11 @@
resource "vault_kubernetes_auth_backend_role" "this" {
for_each = var.roles
audience = one(each.value.audiences)
backend = var.backend
bound_service_account_names = each.value.service_account_names
bound_service_account_namespaces = each.value.service_account_namespaces
role_name = each.key
token_policies = each.value.token_policies
token_ttl = each.value.token_ttl
}
@@ -0,0 +1,15 @@
variable "backend" {
description = "Kubernetes auth backend path."
type = string
}
variable "roles" {
description = "Kubernetes auth roles keyed by Vault role name."
type = map(object({
audiences = set(string)
service_account_names = set(string)
service_account_namespaces = set(string)
token_policies = set(string)
token_ttl = number
}))
}
@@ -0,0 +1,10 @@
terraform {
required_version = ">= 1.11.0"
required_providers {
vault = {
source = "hashicorp/vault"
version = "~> 5.7.0"
}
}
}