Closed pdmthorsrud closed 3 years ago
Possible problems:
user;pass
not provided as input variables?)Example from presto module https://github.com/fredrikhgrelland/terraform-nomad-presto/blob/master/conf/nomad/presto.hcl#L327
I think we can close this issue due to PR #47. Or WDYT @zhenik @pdmthorsrud ?
EDIT: Clicked the wrong button ... 🤦
Yup, you're right!
Right now we are using terraform-resources to fetch data from vault (specifically username and password): https://github.com/fredrikhgrelland/terraform-nomad-postgres/blob/ae78b48fbd54e039f42194ae75e4364b33de21a9/example/main.tf#L1-L3 and https://github.com/fredrikhgrelland/terraform-nomad-postgres/blob/ae78b48fbd54e039f42194ae75e4364b33de21a9/example/main.tf#L16-L17
This should be done via templates inside the nomad-job instead. Nomad-job's templating uses consul-template which will dynamically update files if any of its references change.
Summary: the creation of data in vault should still be done via terraform resources, but the fetching of it should be done via nomad-templating, so that it'll dynamically update.