UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

126 lines (125 loc) 4.26 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * 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 * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: CockpitTokenState, opts?: pulumi.CustomResourceOptions): CockpitToken; /** * 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: any): obj is CockpitToken; /** * The name of the token */ readonly name: pulumi.Output<string>; /** * `projectId`) The ID of the project the cockpit is associated with. */ readonly projectId: pulumi.Output<string>; /** * Allowed scopes */ readonly scopes: pulumi.Output<outputs.CockpitTokenScopes>; /** * The secret key of the token */ readonly secretKey: pulumi.Output<string>; /** * Create a CockpitToken resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: CockpitTokenArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CockpitToken resources. */ export interface CockpitTokenState { /** * The name of the token */ name?: pulumi.Input<string>; /** * `projectId`) The ID of the project the cockpit is associated with. */ projectId?: pulumi.Input<string>; /** * Allowed scopes */ scopes?: pulumi.Input<inputs.CockpitTokenScopes>; /** * The secret key of the token */ secretKey?: pulumi.Input<string>; } /** * The set of arguments for constructing a CockpitToken resource. */ export interface CockpitTokenArgs { /** * The name of the token */ name?: pulumi.Input<string>; /** * `projectId`) The ID of the project the cockpit is associated with. */ projectId?: pulumi.Input<string>; /** * Allowed scopes */ scopes?: pulumi.Input<inputs.CockpitTokenScopes>; }