1. Packages
  2. RabbitMQ
  3. API Docs
  4. Permissions
RabbitMQ v3.3.2 published on Thursday, Mar 21, 2024 by Pulumi

rabbitmq.Permissions

Explore with Pulumi AI

rabbitmq logo
RabbitMQ v3.3.2 published on Thursday, Mar 21, 2024 by Pulumi

    The rabbitmq.Permissions resource creates and manages a user’s set of permissions.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as rabbitmq from "@pulumi/rabbitmq";
    
    const testVHost = new rabbitmq.VHost("testVHost", {});
    const testUser = new rabbitmq.User("testUser", {
        password: "foobar",
        tags: ["administrator"],
    });
    const testPermissions = new rabbitmq.Permissions("testPermissions", {
        permissions: {
            configure: ".*",
            read: ".*",
            write: ".*",
        },
        user: testUser.name,
        vhost: testVHost.name,
    });
    
    import pulumi
    import pulumi_rabbitmq as rabbitmq
    
    test_v_host = rabbitmq.VHost("testVHost")
    test_user = rabbitmq.User("testUser",
        password="foobar",
        tags=["administrator"])
    test_permissions = rabbitmq.Permissions("testPermissions",
        permissions=rabbitmq.PermissionsPermissionsArgs(
            configure=".*",
            read=".*",
            write=".*",
        ),
        user=test_user.name,
        vhost=test_v_host.name)
    
    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 {
    		testVHost, err := rabbitmq.NewVHost(ctx, "testVHost", nil)
    		if err != nil {
    			return err
    		}
    		testUser, err := rabbitmq.NewUser(ctx, "testUser", &rabbitmq.UserArgs{
    			Password: pulumi.String("foobar"),
    			Tags: pulumi.StringArray{
    				pulumi.String("administrator"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = rabbitmq.NewPermissions(ctx, "testPermissions", &rabbitmq.PermissionsArgs{
    			Permissions: &rabbitmq.PermissionsPermissionsArgs{
    				Configure: pulumi.String(".*"),
    				Read:      pulumi.String(".*"),
    				Write:     pulumi.String(".*"),
    			},
    			User:  testUser.Name,
    			Vhost: testVHost.Name,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using RabbitMQ = Pulumi.RabbitMQ;
    
    return await Deployment.RunAsync(() => 
    {
        var testVHost = new RabbitMQ.VHost("testVHost");
    
        var testUser = new RabbitMQ.User("testUser", new()
        {
            Password = "foobar",
            Tags = new[]
            {
                "administrator",
            },
        });
    
        var testPermissions = new RabbitMQ.Permissions("testPermissions", new()
        {
            PermissionDetails = new RabbitMQ.Inputs.PermissionsPermissionsArgs
            {
                Configure = ".*",
                Read = ".*",
                Write = ".*",
            },
            User = testUser.Name,
            Vhost = testVHost.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rabbitmq.VHost;
    import com.pulumi.rabbitmq.User;
    import com.pulumi.rabbitmq.UserArgs;
    import com.pulumi.rabbitmq.Permissions;
    import com.pulumi.rabbitmq.PermissionsArgs;
    import com.pulumi.rabbitmq.inputs.PermissionsPermissionsArgs;
    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 testVHost = new VHost("testVHost");
    
            var testUser = new User("testUser", UserArgs.builder()        
                .password("foobar")
                .tags("administrator")
                .build());
    
            var testPermissions = new Permissions("testPermissions", PermissionsArgs.builder()        
                .permissions(PermissionsPermissionsArgs.builder()
                    .configure(".*")
                    .read(".*")
                    .write(".*")
                    .build())
                .user(testUser.name())
                .vhost(testVHost.name())
                .build());
    
        }
    }
    
    resources:
      testVHost:
        type: rabbitmq:VHost
      testUser:
        type: rabbitmq:User
        properties:
          password: foobar
          tags:
            - administrator
      testPermissions:
        type: rabbitmq:Permissions
        properties:
          permissions:
            configure: .*
            read: .*
            write: .*
          user: ${testUser.name}
          vhost: ${testVHost.name}
    

    Create Permissions Resource

    new Permissions(name: string, args: PermissionsArgs, opts?: CustomResourceOptions);
    @overload
    def Permissions(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    permissions: Optional[PermissionsPermissionsArgs] = None,
                    user: Optional[str] = None,
                    vhost: Optional[str] = None)
    @overload
    def Permissions(resource_name: str,
                    args: PermissionsArgs,
                    opts: Optional[ResourceOptions] = None)
    func NewPermissions(ctx *Context, name string, args PermissionsArgs, opts ...ResourceOption) (*Permissions, error)
    public Permissions(string name, PermissionsArgs args, CustomResourceOptions? opts = null)
    public Permissions(String name, PermissionsArgs args)
    public Permissions(String name, PermissionsArgs args, CustomResourceOptions options)
    
    type: rabbitmq:Permissions
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args PermissionsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PermissionsArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PermissionsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PermissionsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PermissionsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Permissions Resource Properties

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

    Inputs

    The Permissions resource accepts the following input properties:

    PermissionDetails Pulumi.RabbitMQ.Inputs.PermissionsPermissions
    The settings of the permissions. The structure is described below.
    User string
    The user to apply the permissions to.
    Vhost string
    The vhost to create the resource in.
    Permissions PermissionsPermissionsArgs
    The settings of the permissions. The structure is described below.
    User string
    The user to apply the permissions to.
    Vhost string
    The vhost to create the resource in.
    permissions PermissionsPermissions
    The settings of the permissions. The structure is described below.
    user String
    The user to apply the permissions to.
    vhost String
    The vhost to create the resource in.
    permissions PermissionsPermissions
    The settings of the permissions. The structure is described below.
    user string
    The user to apply the permissions to.
    vhost string
    The vhost to create the resource in.
    permissions PermissionsPermissionsArgs
    The settings of the permissions. The structure is described below.
    user str
    The user to apply the permissions to.
    vhost str
    The vhost to create the resource in.
    permissions Property Map
    The settings of the permissions. The structure is described below.
    user String
    The user to apply the permissions to.
    vhost String
    The vhost to create the resource in.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Permissions 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 Permissions Resource

    Get an existing Permissions 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?: PermissionsState, opts?: CustomResourceOptions): Permissions
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            permissions: Optional[PermissionsPermissionsArgs] = None,
            user: Optional[str] = None,
            vhost: Optional[str] = None) -> Permissions
    func GetPermissions(ctx *Context, name string, id IDInput, state *PermissionsState, opts ...ResourceOption) (*Permissions, error)
    public static Permissions Get(string name, Input<string> id, PermissionsState? state, CustomResourceOptions? opts = null)
    public static Permissions get(String name, Output<String> id, PermissionsState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    PermissionDetails Pulumi.RabbitMQ.Inputs.PermissionsPermissions
    The settings of the permissions. The structure is described below.
    User string
    The user to apply the permissions to.
    Vhost string
    The vhost to create the resource in.
    Permissions PermissionsPermissionsArgs
    The settings of the permissions. The structure is described below.
    User string
    The user to apply the permissions to.
    Vhost string
    The vhost to create the resource in.
    permissions PermissionsPermissions
    The settings of the permissions. The structure is described below.
    user String
    The user to apply the permissions to.
    vhost String
    The vhost to create the resource in.
    permissions PermissionsPermissions
    The settings of the permissions. The structure is described below.
    user string
    The user to apply the permissions to.
    vhost string
    The vhost to create the resource in.
    permissions PermissionsPermissionsArgs
    The settings of the permissions. The structure is described below.
    user str
    The user to apply the permissions to.
    vhost str
    The vhost to create the resource in.
    permissions Property Map
    The settings of the permissions. The structure is described below.
    user String
    The user to apply the permissions to.
    vhost String
    The vhost to create the resource in.

    Supporting Types

    PermissionsPermissions, PermissionsPermissionsArgs

    Configure string
    The "configure" ACL.
    Read string
    The "read" ACL.
    Write string
    The "write" ACL.
    Configure string
    The "configure" ACL.
    Read string
    The "read" ACL.
    Write string
    The "write" ACL.
    configure String
    The "configure" ACL.
    read String
    The "read" ACL.
    write String
    The "write" ACL.
    configure string
    The "configure" ACL.
    read string
    The "read" ACL.
    write string
    The "write" ACL.
    configure str
    The "configure" ACL.
    read str
    The "read" ACL.
    write str
    The "write" ACL.
    configure String
    The "configure" ACL.
    read String
    The "read" ACL.
    write String
    The "write" ACL.

    Import

    Permissions can be imported using the id which is composed of user@vhost.

    E.g.

    $ pulumi import rabbitmq:index/permissions:Permissions test user@vhost
    

    Package Details

    Repository
    RabbitMQ pulumi/pulumi-rabbitmq
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rabbitmq Terraform Provider.
    rabbitmq logo
    RabbitMQ v3.3.2 published on Thursday, Mar 21, 2024 by Pulumi