Vault-credential-library-parameter-templating fails

Hey, I’m trying to use the vault-credential-library-parameter-templating feature to pass username to vault like described here:

resource "boundary_credential_library_vault" "test_aurora_ro" {
  name                = "test-aurora-ro"
  description         = "test-aurora-ro"
  credential_store_id =
  path                = "database/creds/test-aurora-ro"
  http_method         = "POST"
  http_request_body   = <<EOT
  "UserName": "{{.User.Name}}",
  "LoginName": "{{.Account.LoginName}}"

But gui client returns this error:
targets.(Service).AuthorizeSession: vault.(Repository).Issue: vault.(client).post: vault: external system issue: error #3014: Error making API request. URL: PUT Code: 405. Errors: * 1 error occurred: * unsupported operation

I don’t get it why it ties to do PUT, when configured http_method is POST
Please give me right direction so solve the issue

Vault treats PUT/POST equivalently which is why the Vault API client swaps in PUT for POST. I think the issue is that Vault uses GET for that endpoint and doesn’t support parameters.

@jeff so either boundary should learn to send this data in get params, or vault should learn to ingest POST for the endpoint

Hi @dmitryroshchin – you need to change the request type to GET (which is the only type Vault supports for that operation) and remove the parameters from the config as Vault does not make use of them.