Problem
Using the following Vault provider block to define an aliased provider for the namespace produces an error:
provider "vault" {
alias = "admin/dev"
namespace = "admin/dev"
}
│ Error: error reading from Vault: Error making API request.
│
│ Namespace: admin/
│ URL: GET https://x.x.x.x
│ Code: 400. Errors:
│
│ * "/" is not allowed in namespace names
Cause
The argument alias
does not allow the /
character in a valid alias name.
Solutions
The following Terraform code works successfully by replacing the /
character with a -
character:
provider "vault" {
alias = "admin-dev"
namespace = "admin/dev"
}