UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

92 lines 4.06 kB
"use strict"; // *** 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"); /** * Creates and manages Scaleway Cockpit Grafana Users. * * For more information consult the [documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#grafana-users). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * import * as scaleway from "@pulumi/scaleway"; * * const mainCockpit = scaleway.getCockpit({}); * // Create an editor grafana user for the cockpit * const mainCockpitGrafanaUser = new scaleway.CockpitGrafanaUser("mainCockpitGrafanaUser", { * projectId: mainCockpit.then(mainCockpit => mainCockpit.projectId), * login: "my-awesome-user", * role: "editor", * }); * ``` * * ## Import * * Cockpits Grafana Users can be imported using the project ID and the grafana user ID formatted `{project_id}/{grafana_user_id}`, e.g. bash * * ```sh * $ pulumi import scaleway:index/cockpitGrafanaUser:CockpitGrafanaUser main 11111111-1111-1111-1111-111111111111/2 * ``` */ 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) { 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; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; 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["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