1. Packages
  2. Grafana Cloud
  3. API Docs
  4. User
Grafana v0.5.1 published on Wednesday, Jun 12, 2024 by pulumiverse

grafana.User

Explore with Pulumi AI

grafana logo
Grafana v0.5.1 published on Wednesday, Jun 12, 2024 by pulumiverse

    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)
    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 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:

    Email string
    The email address of the Grafana user.
    Password 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 string
    The email address of the Grafana user.
    Password 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 String
    The email address of the Grafana user.
    password 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 string
    The email address of the Grafana user.
    password 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 str
    The email address of the Grafana user.
    password 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 String
    The email address of the Grafana user.
    password 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)
    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:
    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 }}"
    

    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.
    grafana logo
    Grafana v0.5.1 published on Wednesday, Jun 12, 2024 by pulumiverse