Dear HashiCorp community,
I am looking for a way to check if a secret exists before querying Vault for the secret at the given path.
For example, when a version of a secret is deleted or destroyed in Vault, that version remains as an empty dict.
When injecting the secret as follows:
vault.hashicorp.com/agent-inject-template-minio-credentials: |
{{- with secret "path/to/secret" }}
export MINIO_ACCESS_KEY="{{ .Data.data.accessKey }}"
export MINIO_SECRET_KEY="{{ .Data.data.secretKey }}"
{{- end -}}
I receive the following error:
vault-agent-init 2021-11-11T09:59:37.910Z [WARN] (view) vault.read(path/to/secret): no secret exists at path/to/secret (retry attempt 6 after "8s")
Is there any method to CHECK if a secret exists before querying Vault for the secret at the given path?