dotfiles/terraform/nomad-server/replication.tf
main a5a651dbb9
Large rework and cleanup
Signed-off-by: main <magic_rb@redalder.org>
2022-07-31 11:03:59 +02:00

20 lines
525 B
HCL

resource "nomad_acl_token" "replication" {
count = var.replication_token_path != "" ? 1 : 0
name = "${var.hostname} in ${var.datacenter} replication token"
type = "management"
}
resource "vault_kv_secret_v2" "consul-replication" {
count = var.replication_token_path != "" ? 1 : 0
mount = var.vault_mount.path
name = var.replication_token_path
delete_all_versions = true
data_json = jsonencode({
secret = nomad_acl_token.replication[0].secret_id
accessor = nomad_acl_token.replication[0].id
})
}