Created
February 27, 2023 11:00
-
-
Save abuxton/adda5538ccd002eef692d8ef59e8a160 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
delete me