UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

201 lines 8.13 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getGrafanaOutput = exports.getGrafana = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * 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/). */ function getGrafana(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("scaleway:observability/getGrafana:getGrafana", { "projectId": args.projectId, }, opts); } exports.getGrafana = getGrafana; /** * 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/). */ function getGrafanaOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("scaleway:observability/getGrafana:getGrafana", { "projectId": args.projectId, }, opts); } exports.getGrafanaOutput = getGrafanaOutput; //# sourceMappingURL=getGrafana.js.map