Skip to content

Instantly share code, notes, and snippets.

@abuxton
Created February 27, 2023 11:00
Show Gist options
  • Save abuxton/adda5538ccd002eef692d8ef59e8a160 to your computer and use it in GitHub Desktop.
Save abuxton/adda5538ccd002eef692d8ef59e8a160 to your computer and use it in GitHub Desktop.
# Create kv-policy with variable for Identity Group ID
data "vault_policy_document" "group" {
rule {
path = "group-kv/data/training/{{identity.groups.ids.${vault_identity_group.group.id}.name}}/*"
capabilities = ["create", "read", "update", "delete", "list"]
description = "allow all on secrets"
}
rule {
path = "group-kv/metadata/*"
capabilities = ["list"]
description = "allow listing metadata"
}
}
resource "vault_policy" "group-policy" {
name = "group-policy"
policy = data.vault_policy_document.group.hcl
}
resource "vault_identity_group" "group" {
name = "itzbund"
#policies = [vault_policy.group-policy.name]
policies = ["group-policy"]
member_entity_ids = [
# vault_identity_entity.u1_entity.id,
# vault_identity_entity.u2_entity.id
]
metadata = {
region = "berlin"
}
}
@abuxton
Copy link
Author

abuxton commented Feb 27, 2023

delete me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment