1. Packages
  2. Rabbitmq Provider
  3. API Docs
  4. User
RabbitMQ v3.3.9 published on Wednesday, Feb 12, 2025 by Pulumi

rabbitmq.User

Explore with Pulumi AI

The rabbitmq.User resource creates and manages a user.

Note: All arguments including username and password will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as rabbitmq from "@pulumi/rabbitmq";

const test = new rabbitmq.User("test", {
    name: "mctest",
    password: "foobar",
    tags: [
        "administrator",
        "management",
    ],
});
Copy
import pulumi
import pulumi_rabbitmq as rabbitmq

test = rabbitmq.User("test",
    name="mctest",
    password="foobar",
    tags=[
        "administrator",
        "management",
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-rabbitmq/sdk/v3/go/rabbitmq"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := rabbitmq.NewUser(ctx, "test", &rabbitmq.UserArgs{
			Name:     pulumi.String("mctest"),
			Password: pulumi.String("foobar"),
			Tags: pulumi.StringArray{
				pulumi.String("administrator"),
				pulumi.String("management"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using RabbitMQ = Pulumi.RabbitMQ;

return await Deployment.RunAsync(() => 
{
    var test = new RabbitMQ.User("test", new()
    {
        Name = "mctest",
        Password = "foobar",
        Tags = new[]
        {
            "administrator",
            "management",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.rabbitmq.User;
import com.pulumi.rabbitmq.UserArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var test = new User("test", UserArgs.builder()
            .name("mctest")
            .password("foobar")
            .tags(            
                "administrator",
                "management")
            .build());

    }
}
Copy
resources:
  test:
    type: rabbitmq:User
    properties:
      name: mctest
      password: foobar
      tags:
        - administrator
        - management
Copy

Create User Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
@overload
def User(resource_name: str,
         args: UserArgs,
         opts: Optional[ResourceOptions] = None)

@overload
def User(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         password: Optional[str] = None,
         name: Optional[str] = None,
         tags: Optional[Sequence[str]] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
public User(String name, UserArgs args)
public User(String name, UserArgs args, CustomResourceOptions options)
type: rabbitmq:User
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var userResource = new RabbitMQ.User("userResource", new()
{
    Password = "string",
    Name = "string",
    Tags = new[]
    {
        "string",
    },
});
Copy
example, err := rabbitmq.NewUser(ctx, "userResource", &rabbitmq.UserArgs{
	Password: pulumi.String("string"),
	Name:     pulumi.String("string"),
	Tags: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var userResource = new User("userResource", UserArgs.builder()
    .password("string")
    .name("string")
    .tags("string")
    .build());
Copy
user_resource = rabbitmq.User("userResource",
    password="string",
    name="string",
    tags=["string"])
Copy
const userResource = new rabbitmq.User("userResource", {
    password: "string",
    name: "string",
    tags: ["string"],
});
Copy
type: rabbitmq:User
properties:
    name: string
    password: string
    tags:
        - string
Copy

User Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The User resource accepts the following input properties:

Password This property is required. string
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
Name Changes to this property will trigger replacement. string
The name of the user.
Tags List<string>
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.
Password This property is required. string
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
Name Changes to this property will trigger replacement. string
The name of the user.
Tags []string
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.
password This property is required. String
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
name Changes to this property will trigger replacement. String
The name of the user.
tags List<String>
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.
password This property is required. string
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
name Changes to this property will trigger replacement. string
The name of the user.
tags string[]
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.
password This property is required. str
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
name Changes to this property will trigger replacement. str
The name of the user.
tags Sequence[str]
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.
password This property is required. String
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
name Changes to this property will trigger replacement. String
The name of the user.
tags List<String>
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.

Outputs

All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing User Resource

Get an existing User resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: UserState, opts?: CustomResourceOptions): User
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        password: Optional[str] = None,
        tags: Optional[Sequence[str]] = None) -> User
func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
resources:  _:    type: rabbitmq:User    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Name Changes to this property will trigger replacement. string
The name of the user.
Password string
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
Tags List<string>
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.
Name Changes to this property will trigger replacement. string
The name of the user.
Password string
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
Tags []string
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.
name Changes to this property will trigger replacement. String
The name of the user.
password String
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
tags List<String>
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.
name Changes to this property will trigger replacement. string
The name of the user.
password string
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
tags string[]
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.
name Changes to this property will trigger replacement. str
The name of the user.
password str
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
tags Sequence[str]
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.
name Changes to this property will trigger replacement. String
The name of the user.
password String
The password of the user. The value of this argument is plain-text so make sure to secure where this is defined.
tags List<String>
Which permission model to apply to the user. Valid options are: management, policymaker, monitoring, and administrator.

Import

Users can be imported using the name, e.g.

$ pulumi import rabbitmq:index/user:User test mctest
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
RabbitMQ pulumi/pulumi-rabbitmq
License
Apache-2.0
Notes
This Pulumi package is based on the rabbitmq Terraform Provider.