scaleway.CockpitGrafanaUser
Explore with Pulumi AI
The scaleway.CockpitGrafanaUser
resource allows you to create and manage Grafana users in Scaleway Cockpit.
Refer to Cockpit’s product documentation and API documentation for more information.
Example Usage
Create a Grafana user
The following command allows you to create a Grafana user within a specific Scaleway Project.
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
const project = new scaleway.AccountProject("project", {name: "test project grafana user"});
const main = new scaleway.CockpitGrafanaUser("main", {
projectId: project.id,
login: "my-awesome-user",
role: "editor",
});
import pulumi
import pulumiverse_scaleway as scaleway
project = scaleway.AccountProject("project", name="test project grafana user")
main = scaleway.CockpitGrafanaUser("main",
project_id=project.id,
login="my-awesome-user",
role="editor")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
project, err := scaleway.NewAccountProject(ctx, "project", &scaleway.AccountProjectArgs{
Name: pulumi.String("test project grafana user"),
})
if err != nil {
return err
}
_, err = scaleway.NewCockpitGrafanaUser(ctx, "main", &scaleway.CockpitGrafanaUserArgs{
ProjectId: project.ID(),
Login: pulumi.String("my-awesome-user"),
Role: pulumi.String("editor"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() =>
{
var project = new Scaleway.AccountProject("project", new()
{
Name = "test project grafana user",
});
var main = new Scaleway.CockpitGrafanaUser("main", new()
{
ProjectId = project.Id,
Login = "my-awesome-user",
Role = "editor",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.AccountProject;
import com.pulumi.scaleway.AccountProjectArgs;
import com.pulumi.scaleway.CockpitGrafanaUser;
import com.pulumi.scaleway.CockpitGrafanaUserArgs;
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 project = new AccountProject("project", AccountProjectArgs.builder()
.name("test project grafana user")
.build());
var main = new CockpitGrafanaUser("main", CockpitGrafanaUserArgs.builder()
.projectId(project.id())
.login("my-awesome-user")
.role("editor")
.build());
}
}
resources:
project:
type: scaleway:AccountProject
properties:
name: test project grafana user
main:
type: scaleway:CockpitGrafanaUser
properties:
projectId: ${project.id}
login: my-awesome-user
role: editor
Create CockpitGrafanaUser Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CockpitGrafanaUser(name: string, args: CockpitGrafanaUserArgs, opts?: CustomResourceOptions);
@overload
def CockpitGrafanaUser(resource_name: str,
args: CockpitGrafanaUserArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CockpitGrafanaUser(resource_name: str,
opts: Optional[ResourceOptions] = None,
login: Optional[str] = None,
role: Optional[str] = None,
project_id: Optional[str] = None)
func NewCockpitGrafanaUser(ctx *Context, name string, args CockpitGrafanaUserArgs, opts ...ResourceOption) (*CockpitGrafanaUser, error)
public CockpitGrafanaUser(string name, CockpitGrafanaUserArgs args, CustomResourceOptions? opts = null)
public CockpitGrafanaUser(String name, CockpitGrafanaUserArgs args)
public CockpitGrafanaUser(String name, CockpitGrafanaUserArgs args, CustomResourceOptions options)
type: scaleway:CockpitGrafanaUser
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 CockpitGrafanaUserArgs
- 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 CockpitGrafanaUserArgs
- 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 CockpitGrafanaUserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CockpitGrafanaUserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CockpitGrafanaUserArgs
- 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 cockpitGrafanaUserResource = new Scaleway.CockpitGrafanaUser("cockpitGrafanaUserResource", new()
{
Login = "string",
Role = "string",
ProjectId = "string",
});
example, err := scaleway.NewCockpitGrafanaUser(ctx, "cockpitGrafanaUserResource", &scaleway.CockpitGrafanaUserArgs{
Login: pulumi.String("string"),
Role: pulumi.String("string"),
ProjectId: pulumi.String("string"),
})
var cockpitGrafanaUserResource = new CockpitGrafanaUser("cockpitGrafanaUserResource", CockpitGrafanaUserArgs.builder()
.login("string")
.role("string")
.projectId("string")
.build());
cockpit_grafana_user_resource = scaleway.CockpitGrafanaUser("cockpitGrafanaUserResource",
login="string",
role="string",
project_id="string")
const cockpitGrafanaUserResource = new scaleway.CockpitGrafanaUser("cockpitGrafanaUserResource", {
login: "string",
role: "string",
projectId: "string",
});
type: scaleway:CockpitGrafanaUser
properties:
login: string
projectId: string
role: string
CockpitGrafanaUser 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 CockpitGrafanaUser resource accepts the following input properties:
- Login string
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - Role string
- The role assigned to the Grafana user. Must be
editor
orviewer
. - Project
Id string - ) The ID of the Project the Cockpit is associated with.
- Login string
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - Role string
- The role assigned to the Grafana user. Must be
editor
orviewer
. - Project
Id string - ) The ID of the Project the Cockpit is associated with.
- login String
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - role String
- The role assigned to the Grafana user. Must be
editor
orviewer
. - project
Id String - ) The ID of the Project the Cockpit is associated with.
- login string
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - role string
- The role assigned to the Grafana user. Must be
editor
orviewer
. - project
Id string - ) The ID of the Project the Cockpit is associated with.
- login str
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - role str
- The role assigned to the Grafana user. Must be
editor
orviewer
. - project_
id str - ) The ID of the Project the Cockpit is associated with.
- login String
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - role String
- The role assigned to the Grafana user. Must be
editor
orviewer
. - project
Id String - ) The ID of the Project the Cockpit is associated with.
Outputs
All input properties are implicitly available as output properties. Additionally, the CockpitGrafanaUser resource produces the following output properties:
Look up Existing CockpitGrafanaUser Resource
Get an existing CockpitGrafanaUser 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?: CockpitGrafanaUserState, opts?: CustomResourceOptions): CockpitGrafanaUser
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
login: Optional[str] = None,
password: Optional[str] = None,
project_id: Optional[str] = None,
role: Optional[str] = None) -> CockpitGrafanaUser
func GetCockpitGrafanaUser(ctx *Context, name string, id IDInput, state *CockpitGrafanaUserState, opts ...ResourceOption) (*CockpitGrafanaUser, error)
public static CockpitGrafanaUser Get(string name, Input<string> id, CockpitGrafanaUserState? state, CustomResourceOptions? opts = null)
public static CockpitGrafanaUser get(String name, Output<String> id, CockpitGrafanaUserState 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.
- Login string
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - Password string
- The password of the Grafana user.
- Project
Id string - ) The ID of the Project the Cockpit is associated with.
- Role string
- The role assigned to the Grafana user. Must be
editor
orviewer
.
- Login string
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - Password string
- The password of the Grafana user.
- Project
Id string - ) The ID of the Project the Cockpit is associated with.
- Role string
- The role assigned to the Grafana user. Must be
editor
orviewer
.
- login String
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - password String
- The password of the Grafana user.
- project
Id String - ) The ID of the Project the Cockpit is associated with.
- role String
- The role assigned to the Grafana user. Must be
editor
orviewer
.
- login string
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - password string
- The password of the Grafana user.
- project
Id string - ) The ID of the Project the Cockpit is associated with.
- role string
- The role assigned to the Grafana user. Must be
editor
orviewer
.
- login str
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - password str
- The password of the Grafana user.
- project_
id str - ) The ID of the Project the Cockpit is associated with.
- role str
- The role assigned to the Grafana user. Must be
editor
orviewer
.
- login String
- The username of the Grafana user. The
admin
user is not yet available for creation. You need your Grafana username to log in to Grafana and access your dashboards. - password String
- The password of the Grafana user.
- project
Id String - ) The ID of the Project the Cockpit is associated with.
- role String
- The role assigned to the Grafana user. Must be
editor
orviewer
.
Import
This section explains how to import Grafana users using the ID of the Project associated with Cockpit, and the Grafana user ID in the {project_id}/{grafana_user_id}
format.
bash
$ pulumi import scaleway:index/cockpitGrafanaUser:CockpitGrafanaUser main 11111111-1111-1111-1111-111111111111/2
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scaleway
Terraform Provider.