1. Packages
  2. Packages
  3. Scaleway
  4. API Docs
  5. observability
  6. getGrafana
Viewing docs for Scaleway v1.49.0
published on Thursday, May 14, 2026 by pulumiverse
scaleway logo
Viewing docs for Scaleway v1.49.0
published on Thursday, May 14, 2026 by pulumiverse

    Gets information about Scaleway Cockpit’s Grafana instance for a specific project.

    This data source provides the Grafana URL and project details. Authentication is managed through Scaleway IAM (Identity and Access Management).

    Refer to Cockpit’s product documentation and API documentation for more information.

    Example Usage

    Basic usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const main = scaleway.observability.getGrafana({
        projectId: project.id,
    });
    export const grafanaUrl = main.then(main => main.grafanaUrl);
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    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 {
    		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(() => 
    {
        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) {
            final var main = ObservabilityFunctions.getGrafana(GetGrafanaArgs.builder()
                .projectId(project.id())
                .build());
    
            ctx.export("grafanaUrl", main.grafanaUrl());
        }
    }
    
    variables:
      main:
        fn::invoke:
          function: scaleway:observability:getGrafana
          arguments:
            projectId: ${project.id}
    outputs:
      grafanaUrl: ${main.grafanaUrl}
    
    Example coming soon!
    

    Using with default project

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    // Uses the default project from provider configuration
    const main = scaleway.observability.getGrafana({});
    export const grafanaUrl = main.then(main => main.grafanaUrl);
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    # Uses the default project from provider configuration
    main = scaleway.observability.get_grafana()
    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 {
    		// Uses the default project from provider configuration
    		main, err := observability.GetGrafana(ctx, &observability.GetGrafanaArgs{}, 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(() => 
    {
        // Uses the default project from provider configuration
        var main = Scaleway.Observability.GetGrafana.Invoke();
    
        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) {
            // Uses the default project from provider configuration
            final var main = ObservabilityFunctions.getGrafana(GetGrafanaArgs.builder()
                .build());
    
            ctx.export("grafanaUrl", main.grafanaUrl());
        }
    }
    
    variables:
      # Uses the default project from provider configuration
      main:
        fn::invoke:
          function: scaleway:observability:getGrafana
          arguments: {}
    outputs:
      grafanaUrl: ${main.grafanaUrl}
    
    Example coming soon!
    

    Complete example with Cockpit setup

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const project = new scaleway.account.Project("project", {name: "my-observability-project"});
    const mainCockpit = new scaleway.observability.Cockpit("main", {projectId: project.id});
    const main = scaleway.observability.getGrafanaOutput({
        projectId: mainCockpit.projectId,
    });
    export const grafanaConnectionInfo = {
        url: main.apply(main => main.grafanaUrl),
        projectId: main.apply(main => main.projectId),
    };
    
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumiverse_scaleway as scaleway
    
    project = scaleway.account.Project("project", name="my-observability-project")
    main_cockpit = scaleway.observability.Cockpit("main", project_id=project.id)
    main = scaleway.observability.get_grafana_output(project_id=main_cockpit.project_id)
    pulumi.export("grafanaConnectionInfo", {
        "url": main.grafana_url,
        "projectId": main.project_id,
    })
    
    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("my-observability-project"),
    		})
    		if err != nil {
    			return err
    		}
    		mainCockpit, err := observability.NewCockpit(ctx, "main", &observability.CockpitArgs{
    			ProjectId: project.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		main := observability.GetGrafanaOutput(ctx, observability.GetGrafanaOutputArgs{
    			ProjectId: mainCockpit.ProjectId,
    		}, nil)
    		ctx.Export("grafanaConnectionInfo", pulumi.StringMap{
    			"url": main.ApplyT(func(main observability.GetGrafanaResult) (*string, error) {
    				return &main.GrafanaUrl, nil
    			}).(pulumi.StringPtrOutput),
    			"projectId": main.ApplyT(func(main observability.GetGrafanaResult) (*string, error) {
    				return &main.ProjectId, nil
    			}).(pulumi.StringPtrOutput),
    		})
    		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 = "my-observability-project",
        });
    
        var mainCockpit = new Scaleway.Observability.Cockpit("main", new()
        {
            ProjectId = project.Id,
        });
    
        var main = Scaleway.Observability.GetGrafana.Invoke(new()
        {
            ProjectId = mainCockpit.ProjectId,
        });
    
        return new Dictionary<string, object?>
        {
            ["grafanaConnectionInfo"] = 
            {
                { "url", main.Apply(getGrafanaResult => getGrafanaResult.GrafanaUrl) },
                { "projectId", main.Apply(getGrafanaResult => getGrafanaResult.ProjectId) },
            },
        };
    });
    
    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.Cockpit;
    import com.pulumi.scaleway.observability.CockpitArgs;
    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) {
            var project = new Project("project", ProjectArgs.builder()
                .name("my-observability-project")
                .build());
    
            var mainCockpit = new Cockpit("mainCockpit", CockpitArgs.builder()
                .projectId(project.id())
                .build());
    
            final var main = ObservabilityFunctions.getGrafana(GetGrafanaArgs.builder()
                .projectId(mainCockpit.projectId())
                .build());
    
            ctx.export("grafanaConnectionInfo", Map.ofEntries(
                Map.entry("url", main.applyValue(_main -> _main.grafanaUrl())),
                Map.entry("projectId", main.applyValue(_main -> _main.projectId()))
            ));
        }
    }
    
    resources:
      project:
        type: scaleway:account:Project
        properties:
          name: my-observability-project
      mainCockpit:
        type: scaleway:observability:Cockpit
        name: main
        properties:
          projectId: ${project.id}
    variables:
      main:
        fn::invoke:
          function: scaleway:observability:getGrafana
          arguments:
            projectId: ${mainCockpit.projectId}
    outputs:
      grafanaConnectionInfo:
        url: ${main.grafanaUrl}
        projectId: ${main.projectId}
    
    Example coming soon!
    

    Using the Grafana Terraform provider

    When you need to configure Grafana resources programmatically, supply the IAM secret key as an X-Auth-Token header. The Grafana provider itself stays in anonymous mode.

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const config = new pulumi.Config();
    // Scaleway IAM secret key reused by the Grafana provider
    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 reused by the Grafana provider
    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 reused by the Grafana provider
    		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 reused by the Grafana provider
        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!
    

    Keep the secret key in a secure backend (environment variables, Vault, etc.) and never commit it to source control.

    Authentication

    To access Grafana, use your Scaleway IAM credentials:

    1. Navigate to the grafanaUrl provided by this data source
    2. Sign in using your Scaleway account (IAM authentication)
    3. Your access level is determined by your IAM permissions on the project

    For more information about IAM authentication, see the Scaleway IAM documentation.

    Using getGrafana

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getGrafana(args: GetGrafanaArgs, opts?: InvokeOptions): Promise<GetGrafanaResult>
    function getGrafanaOutput(args: GetGrafanaOutputArgs, opts?: InvokeOptions): Output<GetGrafanaResult>
    def get_grafana(project_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetGrafanaResult
    def get_grafana_output(project_id: pulumi.Input[Optional[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetGrafanaResult]
    func GetGrafana(ctx *Context, args *GetGrafanaArgs, opts ...InvokeOption) (*GetGrafanaResult, error)
    func GetGrafanaOutput(ctx *Context, args *GetGrafanaOutputArgs, opts ...InvokeOption) GetGrafanaResultOutput

    > Note: This function is named GetGrafana in the Go SDK.

    public static class GetGrafana 
    {
        public static Task<GetGrafanaResult> InvokeAsync(GetGrafanaArgs args, InvokeOptions? opts = null)
        public static Output<GetGrafanaResult> Invoke(GetGrafanaInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGrafanaResult> getGrafana(GetGrafanaArgs args, InvokeOptions options)
    public static Output<GetGrafanaResult> getGrafana(GetGrafanaArgs args, InvokeOptions options)
    
    fn::invoke:
      function: scaleway:observability/getGrafana:getGrafana
      arguments:
        # arguments dictionary
    data "scaleway_observability_getgrafana" "name" {
        # arguments
    }

    The following arguments are supported:

    ProjectId string
    The ID of the project the Grafana instance is associated with. If not provided, the default project configured in the provider is used.
    ProjectId string
    The ID of the project the Grafana instance is associated with. If not provided, the default project configured in the provider is used.
    project_id string
    The ID of the project the Grafana instance is associated with. If not provided, the default project configured in the provider is used.
    projectId String
    The ID of the project the Grafana instance is associated with. If not provided, the default project configured in the provider is used.
    projectId string
    The ID of the project the Grafana instance is associated with. If not provided, the default project configured in the provider is used.
    project_id str
    The ID of the project the Grafana instance is associated with. If not provided, the default project configured in the provider is used.
    projectId String
    The ID of the project the Grafana instance is associated with. If not provided, the default project configured in the provider is used.

    getGrafana Result

    The following output properties are available:

    GrafanaUrl string
    The URL to access the Grafana dashboard. Use your Scaleway IAM credentials to authenticate.
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectId string
    GrafanaUrl string
    The URL to access the Grafana dashboard. Use your Scaleway IAM credentials to authenticate.
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectId string
    grafana_url string
    The URL to access the Grafana dashboard. Use your Scaleway IAM credentials to authenticate.
    id string
    The provider-assigned unique ID for this managed resource.
    project_id string
    grafanaUrl String
    The URL to access the Grafana dashboard. Use your Scaleway IAM credentials to authenticate.
    id String
    The provider-assigned unique ID for this managed resource.
    projectId String
    grafanaUrl string
    The URL to access the Grafana dashboard. Use your Scaleway IAM credentials to authenticate.
    id string
    The provider-assigned unique ID for this managed resource.
    projectId string
    grafana_url str
    The URL to access the Grafana dashboard. Use your Scaleway IAM credentials to authenticate.
    id str
    The provider-assigned unique ID for this managed resource.
    project_id str
    grafanaUrl String
    The URL to access the Grafana dashboard. Use your Scaleway IAM credentials to authenticate.
    id String
    The provider-assigned unique ID for this managed resource.
    projectId String

    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.49.0
    published on Thursday, May 14, 2026 by pulumiverse
      Try Pulumi Cloud free. Your team will thank you.