Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stay consistent with variable names among modules #87

Closed
3 tasks done
zhenik opened this issue Nov 10, 2020 · 7 comments · Fixed by #93
Closed
3 tasks done

Stay consistent with variable names among modules #87

zhenik opened this issue Nov 10, 2020 · 7 comments · Fixed by #93
Assignees
Milestone

Comments

@zhenik
Copy link
Contributor

zhenik commented Nov 10, 2020

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
@pdmthorsrud
Copy link
Contributor

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.

@zhenik
Copy link
Contributor Author

zhenik commented Nov 10, 2020

I imagine that credentials stored in a vault kv path, might be way more complex. I would suggest, smth like
vault_kv_<entrity>_fieldname or vault_kv_<entrity>_fieldkey

Take a look at JSON representation here, where the access_key and secret_key are fields.

Screenshot 2020-11-10 at 13 44 21

@pdmthorsrud
Copy link
Contributor

I imagine that credentials stored in a vault kv path, might be way more complex. I would suggest, smth like
vault_kv_<entrity>_fieldname or vault_kv_<entrity>_fieldkey

Take a look at JSON representation here, where the access_key and secret_key are fields.

Screenshot 2020-11-10 at 13 44 21

Not quite sure I got that, but I'm down to call it fieldname and fieldkey!

@zhenik
Copy link
Contributor Author

zhenik commented Nov 10, 2020

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

@pdmthorsrud
Copy link
Contributor

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

@zhenik
Copy link
Contributor Author

zhenik commented Nov 16, 2020

Options

  • vault_kv_field_<entity>
  • vault_kv_<entity>_field
  • vault_kv_<entity>_name
  • vault_kv_<entity>_fieldname

@claesgill
Copy link
Contributor

Options

  • vault_kv_field_<entity>
  • vault_kv_<entity>_field
  • vault_kv_<entity>_name
  • vault_kv_<entity>_fieldname

Voting for vault_kv_field_<entity> 🙋

Team DataStack automation moved this from Priortized Backlog to QA Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants