grafana.User
Explore with Pulumi AI
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.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";
const staff = new grafana.User("staff", {
email: "staff.name@example.com",
isAdmin: false,
login: "staff",
password: "my-password",
});
import pulumi
import pulumiverse_grafana as grafana
staff = grafana.User("staff",
email="staff.name@example.com",
is_admin=False,
login="staff",
password="my-password")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := grafana.NewUser(ctx, "staff", &grafana.UserArgs{
Email: pulumi.String("staff.name@example.com"),
IsAdmin: pulumi.Bool(false),
Login: pulumi.String("staff"),
Password: pulumi.String("my-password"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumiverse.Grafana;
return await Deployment.RunAsync(() =>
{
var staff = new Grafana.User("staff", new()
{
Email = "staff.name@example.com",
IsAdmin = false,
Login = "staff",
Password = "my-password",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.User;
import com.pulumi.grafana.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")
.isAdmin(false)
.login("staff")
.password("my-password")
.build());
}
}
resources:
staff:
type: grafana:User
properties:
email: staff.name@example.com
isAdmin: false
login: staff
password: my-password
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,
password: Optional[str] = None,
is_admin: Optional[bool] = None,
login: Optional[str] = None,
name: Optional[str] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
type: grafana:User
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args UserArgs
- 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 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 string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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 Grafana.User("userResource", new()
{
Email = "string",
Password = "string",
IsAdmin = false,
Login = "string",
Name = "string",
});
example, err := grafana.NewUser(ctx, "userResource", &grafana.UserArgs{
Email: pulumi.String("string"),
Password: pulumi.String("string"),
IsAdmin: pulumi.Bool(false),
Login: pulumi.String("string"),
Name: pulumi.String("string"),
})
var userResource = new User("userResource", UserArgs.builder()
.email("string")
.password("string")
.isAdmin(false)
.login("string")
.name("string")
.build());
user_resource = grafana.User("userResource",
email="string",
password="string",
is_admin=False,
login="string",
name="string")
const userResource = new grafana.User("userResource", {
email: "string",
password: "string",
isAdmin: false,
login: "string",
name: "string",
});
type: grafana:User
properties:
email: string
isAdmin: false
login: string
name: string
password: string
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
The User resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:
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)
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.
- Email string
- The email address of the Grafana user.
- Is
Admin 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.
- User
Id int - The numerical ID of the Grafana user.
- Email string
- The email address of the Grafana user.
- Is
Admin 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.
- User
Id int - The numerical ID of the Grafana user.
- email String
- The email address of the Grafana user.
- is
Admin 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.
- user
Id Integer - The numerical ID of the Grafana user.
- email string
- The email address of the Grafana user.
- is
Admin 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.
- user
Id number - The numerical ID of the Grafana user.
- email String
- The email address of the Grafana user.
- is
Admin 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.
- user
Id Number - The numerical ID of the Grafana user.
Import
$ pulumi import grafana:index/user:User name "{{ id }}"
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.