Stay consistent with variable names among modules
Closed this issue · 7 comments
What is the issue?
Variables of one context among modules named differently.
https://github.com/fredrikhgrelland/terraform-nomad-minio/blob/master/variables.tf#L95-L96
vault_kv_access_key = string,
vault_kv_secret_key = string
while in the Postgres module, has different suffix _name
https://github.com/fredrikhgrelland/terraform-nomad-postgres/blob/master/variables.tf#L85-L86
vault_kv_username_name = string,
vault_kv_password_name = string
Suggestion(s)/solution(s) [Optional]
Use one naming convention
vault_kv_field_<entity>
Checklist (after created issue)
- Added label(s)
- Added to project
- Added to milestone
I believe the vault_kv_<entity>_name
and vault_kv_<entity>_value
for the key and value, respectively, for a KV-pair is a good way to go.
I imagine that credentials stored in a vault kv path, might be way more complex. I would suggest, smth like
vault_kv_<entrity>_fieldname
orvault_kv_<entrity>_fieldkey
Take a look at JSON representation here, where the
access_key
andsecret_key
are fields.
Not quite sure I got that, but I'm down to call it fieldname and fieldkey!
We can use naming from Vault cli, where you can specify -field
Example:
vault kv get -field=access_key secret/data/random-string/minio
vault_kv_<entrity>_field
<- like this
We can use naming from Vault cli, where you can specify
-field
Example:
vault kv get -field=access_key secret/data/random-string/minio
vault_kv_<entrity>_field
<- like this
Good idea, I like that
Options
-
vault_kv_field_<entity>
-
vault_kv_<entity>_field
-
vault_kv_<entity>_name
-
vault_kv_<entity>_fieldname
Options
vault_kv_field_<entity>
vault_kv_<entity>_field
vault_kv_<entity>_name
vault_kv_<entity>_fieldname
Voting for vault_kv_field_<entity>
🙋