Skip to content

frostmoln_messaging_permission (Resource) ​

Manages one application user's permission on one vhost of a managed messaging (LavinMQ) instance: three regular expressions saying which exchanges and queues the user may configure, write to and read from.

Create, update and destroy wait until the platform has applied the change on the broker. When a change fails the broker keeps the previous grant, the apply fails, and the regexes in state are the ones the broker holds — so the next plan shows the change again. Both the user and the vhost must be ready first: reference the frostmoln_messaging_user and frostmoln_messaging_vhost resources so Terraform orders it. Operations on one instance run one at a time, so the provider serialises every vhost, user and permission change per instance.

create_before_destroy is not supported: the replacement names the same user and vhost as the grant it replaces, which still exists, so its create is refused.

Import with <instance_id>/<user>/<vhost>.

Authoritative scope — who owns what on this resource, declared in internal/scopedecl and machine-checked against the schema.

Enacted and reconciled — every configurable attribute not listed below: the platform applies it, and a refresh reads the truth back.

Create-immutable — instance_id, user, vhost: a permission is identified by its instance, user and vhost; changing one is a different grant (the three regexes update in place).

Example Usage ​

terraform
# Grant the user access to the vhost. Referencing both resources makes
# Terraform create them (and wait for them to be ready) first, and destroy the
# permission before either of them.
resource "frostmoln_messaging_permission" "billing_orders" {
  instance_id = frostmoln_messaging_instance.broker.id
  user        = frostmoln_messaging_user.billing.name
  vhost       = frostmoln_messaging_vhost.orders.name

  configure = "^billing\\." # declare and delete its own exchanges and queues
  write     = ".*"          # publish anywhere on the vhost
  read      = "^billing\\." # consume only its own queues
}

# A read-only consumer: "^$" grants nothing.
resource "frostmoln_messaging_permission" "audit_orders" {
  instance_id = frostmoln_messaging_instance.broker.id
  user        = frostmoln_messaging_user.audit.name
  vhost       = frostmoln_messaging_vhost.orders.name

  configure = "^$"
  write     = "^$"
  read      = ".*"
}

Schema ​

Required ​

  • configure (String) The regular expression of resource names the user may create, delete and change on the vhost, as LavinMQ applies it: at most 255 bytes, never starting with -. .* matches everything; ^$ grants nothing. Changing it updates the grant in place.
  • instance_id (String) The id of the frostmoln_messaging_instance the user and the vhost live on. Changing it replaces the permission.
  • read (String) The regular expression of resource names the user may consume from on the vhost, as LavinMQ applies it: at most 255 bytes, never starting with -. .* matches everything; ^$ grants nothing. Changing it updates the grant in place.
  • user (String) The name of the frostmoln_messaging_user granted access. Changing it replaces the permission.
  • vhost (String) The name of the frostmoln_messaging_vhost the access is to. Changing it replaces the permission.
  • write (String) The regular expression of resource names the user may publish to on the vhost, as LavinMQ applies it: at most 255 bytes, never starting with -. .* matches everything; ^$ grants nothing. Changing it updates the grant in place.

Optional ​

Read-Only ​

  • created_at (String) When the permission was created.
  • failure_message (String) The last failed change's reason in words, or null.
  • failure_reason (String) The stable code of the permission's last failed change (for example IN_FLIGHT or BROKER_REFUSED), or null. Every code but OUTCOME_UNKNOWN means the broker was left unchanged.
  • id (String) The permission's Terraform id, <instance_id>/<user>/<vhost>.
  • status (String) The permission's status: pending while the platform applies a change, ready, deleting, or error when a create failed (the grant is absent or its state unknown; the next apply deletes and re-creates it).
  • updated_at (String) When the permission last changed.

Nested Schema for timeouts ​

Optional:

  • create (String) How long the provider waits for the create operation to converge before giving up (e.g. "45m", "2h").
  • delete (String) How long the provider waits for the delete to complete before giving up (e.g. "30m").
  • update (String) How long the provider waits for an update (resize, in-place change) to converge before giving up (e.g. "30m").

Import ​

Import is supported using the following syntax:

The terraform import command can be used, for example:

shell
# Import with the composite ID {instance_id}/{user}/{vhost}.
terraform import frostmoln_messaging_permission.billing_orders mq_B352H9idUJP6jTWtom31nW/billing-app/orders