-approle) including all the roles declared in this variable.
The variable should look like:
tenant_additional_roles = {
devs = {
policy_file = "/some/path/to/policy.hcl"
}
admins = {...}
} | map(object({
policy_file = string
}))
| `{}` | no |
-| [tenant_admin_policy_file](#input_tenant_admin_policy_file) | The path to the admin policy file for this tenant | `string` | `"./policies/tenant-admins.policy.hcl"` | no |
+| [tenant_admin_policy_file](#input_tenant_admin_policy_file) | The path to the admin policy file for this tenant | `string` | `null` | no |
| [tenant_name](#input_tenant_name) | The name of the tenant you want to create | `string` | n/a | yes |
| [tenant_prefix](#input_tenant_prefix) | The prefix to use for the tenant in vault (this will prefix mount points, policies, etc..) | `string` | n/a | yes |
diff --git a/admin_approle.tf b/admin_approle.tf
index e3d187c..dd41eb7 100644
--- a/admin_approle.tf
+++ b/admin_approle.tf
@@ -22,5 +22,5 @@ resource "vault_identity_entity" "tenant_admin" {
resource "vault_policy" "tenant_admin" {
name = "${var.tenant_name}-admin"
- policy = file(var.tenant_admin_policy_file)
+ policy = var.tenant_admin_policy_file == null ? file("${path.module}/policies/tenant-admins.policy.hcl") : file(var.tenant_admin_policy_file)
}
diff --git a/variables.tf b/variables.tf
index 3d060c9..92a4ebc 100644
--- a/variables.tf
+++ b/variables.tf
@@ -20,7 +20,7 @@ variable "tenant_prefix" {
variable "tenant_admin_policy_file" {
type = string
- default = "./policies/tenant-admins.policy.hcl"
+ default = null
description = "The path to the admin policy file for this tenant"
}