Skip to content

Allow tags (and permissions) for stackit_rabbitmq_credential #1774

Description

@nilskuhn

Problem description

Currently, stackit_rabbitmq_credential resource creates a RabbitMQ user with a tag policymaker:

{
    "hashing_algorithm": "rabbit_password_hashing_sha256",
    "limits": {},
    "name": "<username>",
    "password_hash": "<password>",
    "tags": [
        "policymaker"
    ]
}

and with pretty broad permissions:

{
    "configure": ".*",
    "read": ".*",
    "user": "<username>",
    "vhost": "/",
    "write": ".*"
}

As it is not possible to create a user with adminstrator tag, I also cannot adjust tags and permissions afterwards via "official" rabbitmq provider.

Proposed solution

I would really like to configure at least the tags, to be added to the user to be created. A custom username would also be nice.

Something like this:

resource "stackit_rabbitmq_credential" "rabbitmq_admin_credential" {
  project_id  = var.stackit_project_id
  instance_id = stackit_rabbitmq_instance.rabbitmq.instance_id
  username    = "my-awesome-user"
  roles       = ["administrator"]
}

With that, I could use rabbitmq provider afterwards to edit tags and permissions of the already created users. It would be even better if I could configure the permissions directly with stackits provider.

Something like this:

resource "stackit_rabbitmq_credential" "rabbitmq_credential" {
  project_id  = var.stackit_project_id
  instance_id = stackit_rabbitmq_instance.rabbitmq.instance_id
  username    = "my-awesome-user"
  roles       = []
  permissions = {
    configure = "^some-prefix\\..*$"
    write     = "^some-prefix\\..*$"
    read      = "^some-prefix\\..*$"
  }
}

Thanks in advance, Nils

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions