UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

190 lines 7.35 kB
import * as pulumi from "@pulumi/pulumi"; /** * 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)](https://www.scaleway.com/en/docs/identity-and-access-management/iam/). * * Refer to Cockpit's [product documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/) and [API documentation](https://www.scaleway.com/en/developers/api/cockpit/regional-api) for more information. * * ## Example Usage * * ### Basic usage * * ```typescript * 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); * ``` * * ### Using with default project * * ```typescript * 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); * ``` * * ### Complete example with Cockpit setup * * ```typescript * 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), * }; * ``` * * ### 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. * * ```typescript * 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, * }); * ``` * * 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](https://www.scaleway.com/en/docs/identity-and-access-management/iam/). */ export declare function getGrafana(args?: GetGrafanaArgs, opts?: pulumi.InvokeOptions): Promise<GetGrafanaResult>; /** * A collection of arguments for invoking getGrafana. */ export interface GetGrafanaArgs { /** * 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; } /** * A collection of values returned by getGrafana. */ export interface GetGrafanaResult { /** * The URL to access the Grafana dashboard. Use your Scaleway IAM credentials to authenticate. */ readonly grafanaUrl: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly projectId: string; } /** * 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)](https://www.scaleway.com/en/docs/identity-and-access-management/iam/). * * Refer to Cockpit's [product documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/) and [API documentation](https://www.scaleway.com/en/developers/api/cockpit/regional-api) for more information. * * ## Example Usage * * ### Basic usage * * ```typescript * 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); * ``` * * ### Using with default project * * ```typescript * 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); * ``` * * ### Complete example with Cockpit setup * * ```typescript * 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), * }; * ``` * * ### 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. * * ```typescript * 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, * }); * ``` * * 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](https://www.scaleway.com/en/docs/identity-and-access-management/iam/). */ export declare function getGrafanaOutput(args?: GetGrafanaOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetGrafanaResult>; /** * A collection of arguments for invoking getGrafana. */ export interface GetGrafanaOutputArgs { /** * The ID of the project the Grafana instance is associated with. If not provided, the default project configured in the provider is used. */ projectId?: pulumi.Input<string | undefined>; } //# sourceMappingURL=getGrafana.d.ts.map