1. Packages
  2. Grafana Cloud
  3. API Docs
  4. User
Grafana v0.16.1 published on Saturday, Mar 15, 2025 by pulumiverse

grafana.User

Explore with Pulumi AI

Deprecated: grafana.index/user.User has been deprecated in favor of grafana.oss/user.User

This resource represents an instance-scoped resource and uses Grafana’s admin APIs. It does not work with API tokens or service accounts which are org-scoped. You must use basic auth. This resource is also not compatible with Grafana Cloud, as it does not allow basic auth.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";

const staff = new grafana.oss.User("staff", {
    email: "staff.name@example.com",
    name: "Staff Name",
    login: "staff",
    password: "my-password",
    isAdmin: false,
});
Copy
import pulumi
import pulumiverse_grafana as grafana

staff = grafana.oss.User("staff",
    email="staff.name@example.com",
    name="Staff Name",
    login="staff",
    password="my-password",
    is_admin=False)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/oss"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := oss.NewUser(ctx, "staff", &oss.UserArgs{
			Email:    pulumi.String("staff.name@example.com"),
			Name:     pulumi.String("Staff Name"),
			Login:    pulumi.String("staff"),
			Password: pulumi.String("my-password"),
			IsAdmin:  pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumiverse.Grafana;

return await Deployment.RunAsync(() => 
{
    var staff = new Grafana.Oss.User("staff", new()
    {
        Email = "staff.name@example.com",
        Name = "Staff Name",
        Login = "staff",
        Password = "my-password",
        IsAdmin = false,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.oss.User;
import com.pulumi.grafana.oss.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 staff = new User("staff", UserArgs.builder()
            .email("staff.name@example.com")
            .name("Staff Name")
            .login("staff")
            .password("my-password")
            .isAdmin(false)
            .build());

    }
}
Copy
resources:
  staff:
    type: grafana:oss:User
    properties:
      email: staff.name@example.com
      name: Staff Name
      login: staff
      password: my-password
      isAdmin: false
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,
         email: Optional[str] = None,
         is_admin: Optional[bool] = None,
         login: Optional[str] = None,
         name: Optional[str] = None,
         password: Optional[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: grafana: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.

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:

Email This property is required. string
The email address of the Grafana user.
Password This property is required. string
The password for the Grafana user.
IsAdmin bool
Whether to make user an admin. Defaults to false.
Login string
The username for the Grafana user.
Name string
The display name for the Grafana user.
Email This property is required. string
The email address of the Grafana user.
Password This property is required. string
The password for the Grafana user.
IsAdmin bool
Whether to make user an admin. Defaults to false.
Login string
The username for the Grafana user.
Name string
The display name for the Grafana user.
email This property is required. String
The email address of the Grafana user.
password This property is required. String
The password for the Grafana user.
isAdmin Boolean
Whether to make user an admin. Defaults to false.
login String
The username for the Grafana user.
name String
The display name for the Grafana user.
email This property is required. string
The email address of the Grafana user.
password This property is required. string
The password for the Grafana user.
isAdmin boolean
Whether to make user an admin. Defaults to false.
login string
The username for the Grafana user.
name string
The display name for the Grafana user.
email This property is required. str
The email address of the Grafana user.
password This property is required. str
The password for the Grafana user.
is_admin bool
Whether to make user an admin. Defaults to false.
login str
The username for the Grafana user.
name str
The display name for the Grafana user.
email This property is required. String
The email address of the Grafana user.
password This property is required. String
The password for the Grafana user.
isAdmin Boolean
Whether to make user an admin. Defaults to false.
login String
The username for the Grafana user.
name String
The display name for the Grafana user.

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.
UserId int
The numerical ID of the Grafana user.
Id string
The provider-assigned unique ID for this managed resource.
UserId int
The numerical ID of the Grafana user.
id String
The provider-assigned unique ID for this managed resource.
userId Integer
The numerical ID of the Grafana user.
id string
The provider-assigned unique ID for this managed resource.
userId number
The numerical ID of the Grafana user.
id str
The provider-assigned unique ID for this managed resource.
user_id int
The numerical ID of the Grafana user.
id String
The provider-assigned unique ID for this managed resource.
userId Number
The numerical ID of the Grafana user.

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,
        email: Optional[str] = None,
        is_admin: Optional[bool] = None,
        login: Optional[str] = None,
        name: Optional[str] = None,
        password: Optional[str] = None,
        user_id: Optional[int] = 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: grafana: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:
Email string
The email address of the Grafana user.
IsAdmin bool
Whether to make user an admin. Defaults to false.
Login string
The username for the Grafana user.
Name string
The display name for the Grafana user.
Password string
The password for the Grafana user.
UserId int
The numerical ID of the Grafana user.
Email string
The email address of the Grafana user.
IsAdmin bool
Whether to make user an admin. Defaults to false.
Login string
The username for the Grafana user.
Name string
The display name for the Grafana user.
Password string
The password for the Grafana user.
UserId int
The numerical ID of the Grafana user.
email String
The email address of the Grafana user.
isAdmin Boolean
Whether to make user an admin. Defaults to false.
login String
The username for the Grafana user.
name String
The display name for the Grafana user.
password String
The password for the Grafana user.
userId Integer
The numerical ID of the Grafana user.
email string
The email address of the Grafana user.
isAdmin boolean
Whether to make user an admin. Defaults to false.
login string
The username for the Grafana user.
name string
The display name for the Grafana user.
password string
The password for the Grafana user.
userId number
The numerical ID of the Grafana user.
email str
The email address of the Grafana user.
is_admin bool
Whether to make user an admin. Defaults to false.
login str
The username for the Grafana user.
name str
The display name for the Grafana user.
password str
The password for the Grafana user.
user_id int
The numerical ID of the Grafana user.
email String
The email address of the Grafana user.
isAdmin Boolean
Whether to make user an admin. Defaults to false.
login String
The username for the Grafana user.
name String
The display name for the Grafana user.
password String
The password for the Grafana user.
userId Number
The numerical ID of the Grafana user.

Import

$ pulumi import grafana:index/user:User name "{{ id }}"
Copy

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

Package Details

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