@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
184 lines • 8.7 kB
JavaScript
;
// *** 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.Cockpit = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
* > **Important:** The resource `scaleway.observability.Cockpit` has been deprecated and will no longer be supported after January 1st, 2025. Instead, use the new specialized resources:
*
* - `scaleway.observability.Source` for managing data sources (metrics, logs, traces)
* - `scaleway.observability.AlertManager` for managing alert manager
* - `scaleway.observability.getGrafana` data source for accessing Grafana (authentication via IAM)
*
* For detailed migration instructions, see the Cockpit Migration Guide.
*
* > **Note:**
* As of September 2024, Cockpit has introduced [regionalization](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#region) to offer more flexibility and resilience.
* If you have created customized dashboards with data for your Scaleway resources before April 2024, you will need to update your queries in Grafana, with the new regionalized data sources.
*
* > **Note:**
* From January 1st 2025, Cockpit plans have been deprecated. You can now edit the retention period for all your datasources (metrics, logs, and traces) separately. Refer to our product documentation for more information on [possible retention values](https://www.scaleway.com/en/docs/cockpit/concepts/#retention) and [pricing](https://www.scaleway.com/en/docs/cockpit/faq/#how-am-i-billed-for-increasing-data-retention-period).
*
* > **Note:** The `scaleway.observability.GrafanaUser` resource is deprecated. Use the `scaleway.observability.getGrafana` data source to retrieve the Grafana URL and authenticate using your Scaleway IAM credentials.
*
* The `scaleway.observability.Cockpit` resource allows you to create and manage Scaleway Cockpit instances.
*
* 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
*
* ### Manage Cockpit in the Scaleway default Project
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* // Activate Cockpit in the default Project
* const main = new scaleway.observability.Cockpit("main", {});
* ```
*
* ### Manage Cockpit in a specific Project
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* // Activate Cockpit in a specific Project
* const main = new scaleway.observability.Cockpit("main", {projectId: "11111111-1111-1111-1111-111111111111"});
* ```
*
* ### Choose a specific pricing plan for Cockpit
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const main = new scaleway.observability.Cockpit("main", {
* projectId: "11111111-1111-1111-1111-111111111111",
* plan: "premium",
* });
* ```
*
* ### Use the Grafana Terraform provider (Deprecated)
*
* > **Note:** This example is deprecated. Use the `scaleway.observability.getGrafana` data source with IAM authentication instead.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* // Old approach (deprecated) - Using scaleway_cockpit_grafana_user
* // resource "scaleway_cockpit_grafana_user" "main" {
* // project_id = scaleway_cockpit.main.project_id
* // login = "example"
* // role = "editor"
* // }
* //
* // provider "grafana" {
* // url = scaleway_cockpit.main.endpoints.0.grafana_url
* // auth = "${scaleway_cockpit_grafana_user.main.login}:${scaleway_cockpit_grafana_user.main.password}"
* // }
* // New approach - Use scaleway_cockpit_grafana data source with IAM auth
* const main = scaleway.observability.getGrafana({
* projectId: mainScalewayCockpit.projectId,
* });
* ```
*
* ## Migration
*
* This resource is deprecated and will be removed after January 1st, 2025. To migrate to the new infrastructure, please refer to the Cockpit Migration Guide which provides step-by-step instructions for transitioning to:
*
* - `scaleway.observability.Source` for managing data sources (metrics, logs, traces)
* - `scaleway.observability.AlertManager` for managing alert manager
* - `scaleway.observability.getGrafana` data source for accessing Grafana (with IAM authentication)
*
* ## Import
*
* This section explains how to import a Cockpit using its `{project_id}`.
*
* ```sh
* $ pulumi import scaleway:index/cockpit:Cockpit main 11111111-1111-1111-1111-111111111111
* ```
*
* > **Note:** Import functionality will be removed when this resource is deprecated.
*
* @deprecated scaleway.index/cockpit.Cockpit has been deprecated in favor of scaleway.observability/cockpit.Cockpit
*/
class Cockpit extends pulumi.CustomResource {
/**
* Get an existing Cockpit resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
pulumi.log.warn("Cockpit is deprecated: scaleway.index/cockpit.Cockpit has been deprecated in favor of scaleway.observability/cockpit.Cockpit");
return new Cockpit(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'scaleway:index/cockpit:Cockpit';
/**
* Returns true if the given object is an instance of Cockpit. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Cockpit.__pulumiType;
}
/** @deprecated scaleway.index/cockpit.Cockpit has been deprecated in favor of scaleway.observability/cockpit.Cockpit */
constructor(name, argsOrState, opts) {
pulumi.log.warn("Cockpit is deprecated: scaleway.index/cockpit.Cockpit has been deprecated in favor of scaleway.observability/cockpit.Cockpit");
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["endpoints"] = state?.endpoints;
resourceInputs["plan"] = state?.plan;
resourceInputs["planId"] = state?.planId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["pushUrls"] = state?.pushUrls;
}
else {
const args = argsOrState;
resourceInputs["plan"] = args?.plan;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["endpoints"] = undefined /*out*/;
resourceInputs["planId"] = undefined /*out*/;
resourceInputs["pushUrls"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Cockpit.__pulumiType, name, resourceInputs, opts);
}
}
exports.Cockpit = Cockpit;
//# sourceMappingURL=cockpit.js.map