UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

123 lines 5.55 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"); /** * The `scaleway.observability.Token` resource allows you to create and manage your Cockpit [tokens](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#tokens). * * 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 * * ### Use a Cockpit token * * The following commands allow you to: * * - create a Scaleway Project named `my-project` * - create a Cockpit token named `my-awesome-token` inside the Project * - assign `read` permissions to the token for metrics and logs * - disable `write` permissions for metrics and logs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const project = new scaleway.account.Project("project", {name: "my-project"}); * const main = new scaleway.observability.Token("main", { * projectId: project.id, * name: "my-awesome-token", * }); * ``` * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const project = new scaleway.account.Project("project", {name: "my-project"}); * // Create a token that can read metrics and logs but not write * const main = new scaleway.observability.Token("main", { * projectId: project.id, * name: "my-awesome-token", * scopes: { * queryMetrics: true, * writeMetrics: false, * queryLogs: true, * writeLogs: false, * }, * }); * ``` * * ## Import * * This section explains how to import a Cockpit token using the `{region}/{id}` format. * * bash * * ```sh * $ pulumi import scaleway:index/cockpitToken:CockpitToken main fr-par/11111111-1111-1111-1111-111111111111 * ``` * * @deprecated scaleway.index/cockpittoken.CockpitToken has been deprecated in favor of scaleway.observability/token.Token */ 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) { pulumi.log.warn("CockpitToken is deprecated: scaleway.index/cockpittoken.CockpitToken has been deprecated in favor of scaleway.observability/token.Token"); 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; } /** @deprecated scaleway.index/cockpittoken.CockpitToken has been deprecated in favor of scaleway.observability/token.Token */ constructor(name, argsOrState, opts) { pulumi.log.warn("CockpitToken is deprecated: scaleway.index/cockpittoken.CockpitToken has been deprecated in favor of scaleway.observability/token.Token"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["scopes"] = state ? state.scopes : undefined; resourceInputs["secretKey"] = state ? state.secretKey : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; } else { const args = argsOrState; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["scopes"] = args ? args.scopes : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["secretKey"] = undefined /*out*/; resourceInputs["updatedAt"] = 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