hashicorp / terraform-provider-vault

Terraform Vault provider
https://www.terraform.io/docs/providers/vault/
Mozilla Public License 2.0
458 stars 540 forks source link

Vault provider does not support mount for plugins #623

Open rvadim opened 4 years ago

rvadim commented 4 years ago

Terraform Version

Terraform v0.12.12 provider.vault: version = "~> 2.6"

Affected Resource(s)

Terraform Configuration Files

resource "vault_mount" "mount" {
  path = "my-path/name"
  type = "plugin"
}

Expected Behavior

Path created

Actual Behavior

Error: error writing to Vault: Error making API request.

URL: POST https://localhost/v1/sys/mounts/my-path/name
Code: 400. Errors:

* plugin_name must be provided for plugin backend

  on modules/myplugin/main.tf line 5, in resource "vault_mount" "mount":
   5: resource "vault_mount" "mount" {

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply -auto-approve

Important Factoids

Apparently it has never worked due to code analysis.

References

https://github.com/terraform-providers/terraform-provider-vault/blob/087c53af88b45a927f676116b15bc28b001a4cae/vault/resource_mount.go#L12 vault_mount have not any parameters like plugin_name But vault actually have: https://github.com/hashicorp/vault/blob/0f5c835d1cf91c00d01cb29a0048732d91357afa/vault/logical_system.go#L757

cpick commented 4 years ago

Due to https://github.com/hashicorp/vault/pull/5536 in vault >= 1.0 you can use type = "my-vault-plugin-name". No plugin_name option is needed.

mbrancato commented 4 years ago

This is still needed with support for external plugins. External plugins should support: