@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
103 lines • 5.18 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.CockpitGrafanaUser = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* The `scaleway.observability.GrafanaUser` resource allows you to create and manage [Grafana users](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#grafana-users) in Scaleway Cockpit.
*
* 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
*
* ### Create a Grafana user
*
* The following command allows you to create a Grafana user within a specific Scaleway Project.
*
* ```typescript
* 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
*
* 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.
*
* bash
*
* ```sh
* $ pulumi import scaleway:index/cockpitGrafanaUser:CockpitGrafanaUser main 11111111-1111-1111-1111-111111111111/2
* ```
*
* @deprecated scaleway.index/cockpitgrafanauser.CockpitGrafanaUser has been deprecated in favor of scaleway.observability/grafanauser.GrafanaUser
*/
class CockpitGrafanaUser extends pulumi.CustomResource {
/**
* Get an existing CockpitGrafanaUser 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("CockpitGrafanaUser is deprecated: scaleway.index/cockpitgrafanauser.CockpitGrafanaUser has been deprecated in favor of scaleway.observability/grafanauser.GrafanaUser");
return new CockpitGrafanaUser(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CockpitGrafanaUser. 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'] === CockpitGrafanaUser.__pulumiType;
}
/** @deprecated scaleway.index/cockpitgrafanauser.CockpitGrafanaUser has been deprecated in favor of scaleway.observability/grafanauser.GrafanaUser */
constructor(name, argsOrState, opts) {
pulumi.log.warn("CockpitGrafanaUser is deprecated: scaleway.index/cockpitgrafanauser.CockpitGrafanaUser has been deprecated in favor of scaleway.observability/grafanauser.GrafanaUser");
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["grafanaUrl"] = state ? state.grafanaUrl : undefined;
resourceInputs["login"] = state ? state.login : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["role"] = state ? state.role : undefined;
}
else {
const args = argsOrState;
if ((!args || args.login === undefined) && !opts.urn) {
throw new Error("Missing required property 'login'");
}
if ((!args || args.role === undefined) && !opts.urn) {
throw new Error("Missing required property 'role'");
}
resourceInputs["login"] = args ? args.login : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["role"] = args ? args.role : undefined;
resourceInputs["grafanaUrl"] = undefined /*out*/;
resourceInputs["password"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["password"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(CockpitGrafanaUser.__pulumiType, name, resourceInputs, opts);
}
}
exports.CockpitGrafanaUser = CockpitGrafanaUser;
/** @internal */
CockpitGrafanaUser.__pulumiType = 'scaleway:index/cockpitGrafanaUser:CockpitGrafanaUser';
//# sourceMappingURL=cockpitGrafanaUser.js.map