简体   繁体   中英

How to add metadata to approle entity using vault provider for terraform

I need to add metadata to approle entity because policy path associated with approle is based on entity metadata. What i try to achieve is basically to do this command vault write identity/entity/id/<entity_id>/ metadata=stage=test using vault provider for terraform. Does anyone know how to do that?

According to the official documentation on updating entities , you should be able to do this:

curl --header "X-Vault-Token: $VAULT_TOKEN"  \
  --request POST  \
  --data "{\"name\": \"<entity name>\", \"metadata\": {\"organization\": \"hashicorp\", \"team\": \"nomad\"}}"  \
  http://127.0.0.1:8200/v1/identity/entity/id/:id

Make sure to substitute VAULT_TOKEN with your Vault token and replace :id with the entity id.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM