UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

100 lines 4.12 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.CockpitToken = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Creates and manages Scaleway Cockpit Tokens. * * For more information consult the [documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#tokens). * * ## 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 a token for the cockpit that can write metrics and logs * const mainCockpitToken = new scaleway.CockpitToken("mainCockpitToken", {projectId: mainCockpit.then(mainCockpit => mainCockpit.projectId)}); * ``` * * ```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 a token for the cockpit that can read metrics and logs but not write * const mainCockpitToken = new scaleway.CockpitToken("mainCockpitToken", { * projectId: mainCockpit.then(mainCockpit => mainCockpit.projectId), * scopes: { * queryMetrics: true, * writeMetrics: false, * queryLogs: true, * writeLogs: false, * }, * }); * ``` * * ## Import * * Cockpits can be imported using the token ID, e.g. bash * * ```sh * $ pulumi import scaleway:index/cockpitToken:CockpitToken main 11111111-1111-1111-1111-111111111111 * ``` */ class CockpitToken extends pulumi.CustomResource { /** * Get an existing CockpitToken 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 CockpitToken(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CockpitToken. 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'] === CockpitToken.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["scopes"] = state ? state.scopes : undefined; resourceInputs["secretKey"] = state ? state.secretKey : undefined; } else { const args = argsOrState; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["scopes"] = args ? args.scopes : undefined; resourceInputs["secretKey"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["secretKey"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(CockpitToken.__pulumiType, name, resourceInputs, opts); } } exports.CockpitToken = CockpitToken; /** @internal */ CockpitToken.__pulumiType = 'scaleway:index/cockpitToken:CockpitToken'; //# sourceMappingURL=cockpitToken.js.map