https://github.com/loafoe/hsdp-function-vault-read
Function to read keys from a HSDP Vault instance
https://github.com/loafoe/hsdp-function-vault-read
hsdp hsdp-function vault
Last synced: 3 months ago
JSON representation
Function to read keys from a HSDP Vault instance
- Host: GitHub
- URL: https://github.com/loafoe/hsdp-function-vault-read
- Owner: loafoe
- License: mit
- Created: 2021-06-17T18:41:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-19T05:06:57.000Z (about 2 years ago)
- Last Synced: 2025-01-20T15:17:48.232Z (5 months ago)
- Topics: hsdp, hsdp-function, vault
- Language: Go
- Homepage:
- Size: 313 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# hsdp-function-vault-read
Read Vault keys from a HSDP Vault instance
# usage
```terraform
resource "hsdp_function" "vault_read" {
name = "vault-read"
docker_image = "philipslabs/hsdp-function-vault-read:v0.0.4"environment = {
VREAD_ENDPOINT = "https://vproxy.us-east.philips-healthsuite.com/"
VREAD_ROLE_ID = "XXX"
VREAD_SECRET_ID = "YYY"
VREAD_SPACE_SECRET_PATH = "/v1/cf/8cb5a2ea-d20a-4ea0-815b-742075dc92ba/secret"
VREAD_SERVICE_SECRET_PATH = "/v1/cf/51536c9b-f91c-402a-87f5-406258c792df/secret"
}backend {
credentials = module.siderite_backend.credentials
}}
output "sync_endpoint" {
value = hsdp_function.vault_read.endpoint
}
```Append `/vault/read/service/:key` to the `sync_endpoint.value` with the right token in `Authorization` header (fixed or IAM) and the function will
read all the values from the cofngiured Vault under `:key`## curl example
Write something to the vault:
```shell
vault write cf/51536c9b-f91c-402a-87f5-406258c792df/secret/andy \
secret1="value stored in vault" \
config="or a config item"
```Then retrieve the data via the `hsdp_function`:
```shell
curl -H "Authorization: Token ZZZ" \
https://hsdp-func-gateway-www.eu-west.philips-healthsuite.com/function/aaa/vault/read/service/andy
```
output:
```json
{
"secret1": "value stored in vault",
"config": "or a config item"
}
```# license
License is MIT