1. Packages
  2. Packages
  3. Scaleway
  4. API Docs
  5. observability
  6. GrafanaUser
Viewing docs for Scaleway v1.48.1
published on Tuesday, May 12, 2026 by pulumiverse
scaleway logo
Viewing docs for Scaleway v1.48.1
published on Tuesday, May 12, 2026 by pulumiverse

    Deprecated: This resource is deprecated and will be removed on January 1st, 2026.

    Migration Guide: Grafana authentication is now managed through Scaleway IAM (Identity and Access Management). To access your Grafana instance, use the scaleway.observability.getGrafana data source to retrieve the Grafana URL and authenticate using your Scaleway IAM credentials.

    The scaleway.observability.GrafanaUser 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

    Migration to IAM Authentication

    Instead of managing Grafana users, retrieve your Grafana URL using the data source:

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    // Old approach (deprecated)
    // resource "scaleway_cockpit_grafana_user" "main" {
    //   project_id = scaleway_account_project.project.id
    //   login      = "my-awesome-user"
    //   role       = "editor"
    // }
    // New approach - Use IAM authentication
    const main = scaleway.observability.getGrafana({
        projectId: project.id,
    });
    export const grafanaUrl = main.then(main => main.grafanaUrl);
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    # Old approach (deprecated)
    # resource "scaleway_cockpit_grafana_user" "main" {
    #   project_id = scaleway_account_project.project.id
    #   login      = "my-awesome-user"
    #   role       = "editor"
    # }
    # New approach - Use IAM authentication
    main = scaleway.observability.get_grafana(project_id=project["id"])
    pulumi.export("grafanaUrl", main.grafana_url)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/observability"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Old approach (deprecated)
    		//
    		//	resource "scaleway_cockpit_grafana_user" "main" {
    		//	  project_id = scaleway_account_project.project.id
    		//	  login      = "my-awesome-user"
    		//	  role       = "editor"
    		//	}
    		//
    		// New approach - Use IAM authentication
    		main, err := observability.GetGrafana(ctx, &observability.GetGrafanaArgs{
    			ProjectId: pulumi.StringRef(project.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("grafanaUrl", main.GrafanaUrl)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        // Old approach (deprecated)
        // resource "scaleway_cockpit_grafana_user" "main" {
        //   project_id = scaleway_account_project.project.id
        //   login      = "my-awesome-user"
        //   role       = "editor"
        // }
        // New approach - Use IAM authentication
        var main = Scaleway.Observability.GetGrafana.Invoke(new()
        {
            ProjectId = project.Id,
        });
    
        return new Dictionary<string, object?>
        {
            ["grafanaUrl"] = main.Apply(getGrafanaResult => getGrafanaResult.GrafanaUrl),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.observability.ObservabilityFunctions;
    import com.pulumi.scaleway.observability.inputs.GetGrafanaArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            // Old approach (deprecated)
            // resource "scaleway_cockpit_grafana_user" "main" {
            //   project_id = scaleway_account_project.project.id
            //   login      = "my-awesome-user"
            //   role       = "editor"
            // }
            // New approach - Use IAM authentication
            final var main = ObservabilityFunctions.getGrafana(GetGrafanaArgs.builder()
                .projectId(project.id())
                .build());
    
            ctx.export("grafanaUrl", main.grafanaUrl());
        }
    }
    
    variables:
      # Old approach (deprecated)
      # resource "scaleway_cockpit_grafana_user" "main" {
      #   project_id = scaleway_account_project.project.id
      #   login      = "my-awesome-user"
      #   role       = "editor"
      # }
    
      # New approach - Use IAM authentication
      main:
        fn::invoke:
          function: scaleway:observability:getGrafana
          arguments:
            projectId: ${project.id}
    outputs:
      grafanaUrl: ${main.grafanaUrl}
    
    Example coming soon!
    

    Programmatic access with the Grafana provider

    To automate Grafana configuration (e.g., dashboards, alerting) with Terraform, reuse your Scaleway IAM secret as an X-Auth-Token header. The Grafana provider must run in anonymous mode because user/password authentication is deprecated.

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const config = new pulumi.Config();
    // Scaleway IAM secret key used for both the Scaleway and Grafana providers
    const scalewaySecretKey = config.require("scalewaySecretKey");
    const main = scaleway.observability.getGrafana({
        projectId: project.id,
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    config = pulumi.Config()
    # Scaleway IAM secret key used for both the Scaleway and Grafana providers
    scaleway_secret_key = config.require("scalewaySecretKey")
    main = scaleway.observability.get_grafana(project_id=project["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/observability"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		// Scaleway IAM secret key used for both the Scaleway and Grafana providers
    		scalewaySecretKey := cfg.Require("scalewaySecretKey")
    		_, err := observability.GetGrafana(ctx, &observability.GetGrafanaArgs{
    			ProjectId: pulumi.StringRef(project.Id),
    		}, nil)
    		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 config = new Config();
        // Scaleway IAM secret key used for both the Scaleway and Grafana providers
        var scalewaySecretKey = config.Require("scalewaySecretKey");
        var main = Scaleway.Observability.GetGrafana.Invoke(new()
        {
            ProjectId = project.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.observability.ObservabilityFunctions;
    import com.pulumi.scaleway.observability.inputs.GetGrafanaArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            final var config = ctx.config();
            final var scalewaySecretKey = config.require("scalewaySecretKey");
            final var main = ObservabilityFunctions.getGrafana(GetGrafanaArgs.builder()
                .projectId(project.id())
                .build());
    
        }
    }
    
    configuration:
      scalewaySecretKey:
        type: string
    variables:
      main:
        fn::invoke:
          function: scaleway:observability:getGrafana
          arguments:
            projectId: ${project.id}
    
    Example coming soon!
    

    The header X-Auth-Token is mandatory when Grafana users are disabled. Store the IAM secret key securely (environment variable, secrets manager, etc.) and avoid committing it to version control.

    Create a Grafana user (Deprecated)

    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.account.Project("project", {name: "test project grafana user"});
    const main = new scaleway.observability.GrafanaUser("main", {
        projectId: project.id,
        login: "my-awesome-user",
        role: "editor",
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    project = scaleway.account.Project("project", name="test project grafana user")
    main = scaleway.observability.GrafanaUser("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/account"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/observability"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		project, err := account.NewProject(ctx, "project", &account.ProjectArgs{
    			Name: pulumi.String("test project grafana user"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = observability.NewGrafanaUser(ctx, "main", &observability.GrafanaUserArgs{
    			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.Account.Project("project", new()
        {
            Name = "test project grafana user",
        });
    
        var main = new Scaleway.Observability.GrafanaUser("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.account.Project;
    import com.pulumi.scaleway.account.ProjectArgs;
    import com.pulumi.scaleway.observability.GrafanaUser;
    import com.pulumi.scaleway.observability.GrafanaUserArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 Project("project", ProjectArgs.builder()
                .name("test project grafana user")
                .build());
    
            var main = new GrafanaUser("main", GrafanaUserArgs.builder()
                .projectId(project.id())
                .login("my-awesome-user")
                .role("editor")
                .build());
    
        }
    }
    
    resources:
      project:
        type: scaleway:account:Project
        properties:
          name: test project grafana user
      main:
        type: scaleway:observability:GrafanaUser
        properties:
          projectId: ${project.id}
          login: my-awesome-user
          role: editor
    
    Example coming soon!
    

    Create GrafanaUser Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GrafanaUser(name: string, args: GrafanaUserArgs, opts?: CustomResourceOptions);
    @overload
    def GrafanaUser(resource_name: str,
                    args: GrafanaUserArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def GrafanaUser(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    login: Optional[str] = None,
                    role: Optional[str] = None,
                    project_id: Optional[str] = None)
    func NewGrafanaUser(ctx *Context, name string, args GrafanaUserArgs, opts ...ResourceOption) (*GrafanaUser, error)
    public GrafanaUser(string name, GrafanaUserArgs args, CustomResourceOptions? opts = null)
    public GrafanaUser(String name, GrafanaUserArgs args)
    public GrafanaUser(String name, GrafanaUserArgs args, CustomResourceOptions options)
    
    type: scaleway:observability:GrafanaUser
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "scaleway_observability_grafanauser" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args GrafanaUserArgs
    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 GrafanaUserArgs
    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 GrafanaUserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GrafanaUserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GrafanaUserArgs
    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 grafanaUserResource = new Scaleway.Observability.GrafanaUser("grafanaUserResource", new()
    {
        Login = "string",
        Role = "string",
        ProjectId = "string",
    });
    
    example, err := observability.NewGrafanaUser(ctx, "grafanaUserResource", &observability.GrafanaUserArgs{
    	Login:     pulumi.String("string"),
    	Role:      pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    })
    
    resource "scaleway_observability_grafanauser" "grafanaUserResource" {
      login      = "string"
      role       = "string"
      project_id = "string"
    }
    
    var grafanaUserResource = new GrafanaUser("grafanaUserResource", GrafanaUserArgs.builder()
        .login("string")
        .role("string")
        .projectId("string")
        .build());
    
    grafana_user_resource = scaleway.observability.GrafanaUser("grafanaUserResource",
        login="string",
        role="string",
        project_id="string")
    
    const grafanaUserResource = new scaleway.observability.GrafanaUser("grafanaUserResource", {
        login: "string",
        role: "string",
        projectId: "string",
    });
    
    type: scaleway:observability:GrafanaUser
    properties:
        login: string
        projectId: string
        role: string
    

    GrafanaUser 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 GrafanaUser 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 or viewer.
    ProjectId 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 or viewer.
    ProjectId 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 or viewer.
    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 or viewer.
    projectId 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 or viewer.
    projectId 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 or viewer.
    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 or viewer.
    projectId String
    ) The ID of the Project the Cockpit is associated with.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GrafanaUser resource produces the following output properties:

    GrafanaUrl string
    URL for Grafana.
    Id string
    The provider-assigned unique ID for this managed resource.
    Password string
    The password of the Grafana user.
    GrafanaUrl string
    URL for Grafana.
    Id string
    The provider-assigned unique ID for this managed resource.
    Password string
    The password of the Grafana user.
    grafana_url string
    URL for Grafana.
    id string
    The provider-assigned unique ID for this managed resource.
    password string
    The password of the Grafana user.
    grafanaUrl String
    URL for Grafana.
    id String
    The provider-assigned unique ID for this managed resource.
    password String
    The password of the Grafana user.
    grafanaUrl string
    URL for Grafana.
    id string
    The provider-assigned unique ID for this managed resource.
    password string
    The password of the Grafana user.
    grafana_url str
    URL for Grafana.
    id str
    The provider-assigned unique ID for this managed resource.
    password str
    The password of the Grafana user.
    grafanaUrl String
    URL for Grafana.
    id String
    The provider-assigned unique ID for this managed resource.
    password String
    The password of the Grafana user.

    Look up Existing GrafanaUser Resource

    Get an existing GrafanaUser 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?: GrafanaUserState, opts?: CustomResourceOptions): GrafanaUser
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            grafana_url: Optional[str] = None,
            login: Optional[str] = None,
            password: Optional[str] = None,
            project_id: Optional[str] = None,
            role: Optional[str] = None) -> GrafanaUser
    func GetGrafanaUser(ctx *Context, name string, id IDInput, state *GrafanaUserState, opts ...ResourceOption) (*GrafanaUser, error)
    public static GrafanaUser Get(string name, Input<string> id, GrafanaUserState? state, CustomResourceOptions? opts = null)
    public static GrafanaUser get(String name, Output<String> id, GrafanaUserState state, CustomResourceOptions options)
    resources:  _:    type: scaleway:observability:GrafanaUser    get:      id: ${id}
    import {
      to = scaleway_observability_grafanauser.example
      id = "${id}"
    }
    
    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:
    GrafanaUrl string
    URL for Grafana.
    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.
    ProjectId string
    ) The ID of the Project the Cockpit is associated with.
    Role string
    The role assigned to the Grafana user. Must be editor or viewer.
    GrafanaUrl string
    URL for Grafana.
    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.
    ProjectId string
    ) The ID of the Project the Cockpit is associated with.
    Role string
    The role assigned to the Grafana user. Must be editor or viewer.
    grafana_url string
    URL for Grafana.
    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 or viewer.
    grafanaUrl String
    URL for Grafana.
    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.
    projectId String
    ) The ID of the Project the Cockpit is associated with.
    role String
    The role assigned to the Grafana user. Must be editor or viewer.
    grafanaUrl string
    URL for Grafana.
    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.
    projectId string
    ) The ID of the Project the Cockpit is associated with.
    role string
    The role assigned to the Grafana user. Must be editor or viewer.
    grafana_url str
    URL for Grafana.
    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 or viewer.
    grafanaUrl String
    URL for Grafana.
    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.
    projectId String
    ) The ID of the Project the Cockpit is associated with.
    role String
    The role assigned to the Grafana user. Must be editor or viewer.

    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.

    $ pulumi import scaleway:observability/grafanaUser:GrafanaUser 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.
    scaleway logo
    Viewing docs for Scaleway v1.48.1
    published on Tuesday, May 12, 2026 by pulumiverse
      Try Pulumi Cloud free. Your team will thank you.