Terraform-provider-vault: vault_rabbitmq_secret_backend_role unexpected vhosts argument

Created on 26 May 2020  路  1Comment  路  Source: hashicorp/terraform-provider-vault

Hi there,

Terraform Version

Terraform v0.12.24

  • provider.vault v2.11.0

Affected Resource(s)

  • vault_rabbitmq_secret_backend_role

Terraform Configuration Files

resource "vault_rabbitmq_secret_backend" "rabbitmq" {
  connection_uri = "https://rabbitmq.endpoint"
  username       = var.rabbitmq_username
  password       = var.rabbitmq_password
}

resource "vault_rabbitmq_secret_backend_role" "role" {
  backend = vault_rabbitmq_secret_backend.rabbitmq.path
  name    = "app"

  tags   = "app"
  vhosts = "{\"/\": {\"write\":\".*\", \"read\": \".*\"}}"
}

Debug Output

An argument named "vhosts" is not expected here.

Expected Behavior

Need this argument to set permissions on the vhost, I've tried with vhost or vhosts but they're both not expected, in equivalent I did vault write rabbitmq/roles/app vhosts='{"/":{"write": ".*", "read": ".*"}}'

Followed the example referenced in the docs:
https://github.com/terraform-providers/terraform-provider-vault/blob/master/website/docs/r/rabbitmq_secret_backend_role.html.md

Most helpful comment

I just encountered this. The docs seems to have drifted from the schema.

I'm now passing vhosts in like this:

resource "vault_rabbitmq_secret_backend_role" "role" {
  backend = vault_rabbitmq_secret_backend.rabbitmq.path
  name    = "app"

  vhost {
    host      = "/"
    configure = ".*"
    write     = ".*"
    read      = ".*"
  }
}

Passing a vhost list would probably work as well.

>All comments

I just encountered this. The docs seems to have drifted from the schema.

I'm now passing vhosts in like this:

resource "vault_rabbitmq_secret_backend_role" "role" {
  backend = vault_rabbitmq_secret_backend.rabbitmq.path
  name    = "app"

  vhost {
    host      = "/"
    configure = ".*"
    write     = ".*"
    read      = ".*"
  }
}

Passing a vhost list would probably work as well.

Was this page helpful?
0 / 5 - 0 ratings