hashicorp / hashicorp/packer

Retrieve entire map of secrets with vault function

Open
#12,014 2 comments 0 reactions 0 assignees View on GitHub
enhancement integration/vault sync to jira
Dominant language
Go
Stars
15.8k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

#### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

#### Description

Currently, [`vault` function](https://www.packer.io/docs/templates/hcl_templates/functions/contextual/vault) allows to retrieve a single key from a key-value map at a given secret path. It would be great if it would allow to retrieve the entire map of key/value pairs (e.g. simply by omitting the second argument).

#### Potential configuration

Instead of pulling out a single value with
```
locals {
foo = vault("/secret/data/hello", "foo")
}
```
we could pull out the entire map with e.g.
```
locals {
hello_vars = vault("/secret/data/hello")
}
```
so `hello_vars` would be a map with all the key-value pairs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.