Skip to content

Commit 81a576e

Browse files
committed
consolidate vault policies into hydration
Before there was a conflict between the policies set on the core machines at activation time, and the policies set by hydrate-cluster. Specifically, the routing policy would always be deleted by terraform. With this, we can ensure that terraform is aware of all of our defaut vault policies so rebuilding and/or hydrating doesn't unexpectedly change them.
1 parent a65b048 commit 81a576e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

modules/terraform/hydrate-cluster/policies.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ Related to roles that are impersonated by humans.
1616

1717
__fromTOML = builtins.fromTOML;
1818

19-
vaultPolicies = tfcfg.locals.policies.vault;
19+
# necessary or some of these policies get deleted by terraform; eg routing
20+
coreVaultPolicies =
21+
builtins.removeAttrs
22+
(import ../../../profiles/vault/policies.nix {inherit config lib;})
23+
.services
24+
.vault
25+
.policies ["vault-agent-client" "vault-agent-core"];
26+
27+
vaultPolicies = coreVaultPolicies // tfcfg.locals.policies.vault;
2028
nomadPolicies = tfcfg.locals.policies.nomad;
2129
consulPolicies = tfcfg.locals.policies.consul;
2230

0 commit comments

Comments
 (0)