UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

106 lines 5.08 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ServiceAccountRotatingToken = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * **Note:** This resource is available only with Grafana 9.1+. * * * [Official documentation](https://grafana.com/docs/grafana/latest/administration/service-accounts/) * * [HTTP API](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/api-legacy/serviceaccount/#service-account-api) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const test = new grafana.oss.ServiceAccount("test", { * name: "test-service-account", * role: "Viewer", * }); * const foo = new grafana.oss.ServiceAccountRotatingToken("foo", { * namePrefix: "key_foo", * serviceAccountId: test.id, * secondsToLive: 7776000, * earlyRotationWindowSeconds: 604800, * }); * export const serviceAccountTokenFooKey = foo.key; * ``` */ class ServiceAccountRotatingToken extends pulumi.CustomResource { /** * Get an existing ServiceAccountRotatingToken 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 ServiceAccountRotatingToken(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ServiceAccountRotatingToken. 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'] === ServiceAccountRotatingToken.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["deleteOnDestroy"] = state?.deleteOnDestroy; resourceInputs["earlyRotationWindowSeconds"] = state?.earlyRotationWindowSeconds; resourceInputs["expiration"] = state?.expiration; resourceInputs["hasExpired"] = state?.hasExpired; resourceInputs["key"] = state?.key; resourceInputs["name"] = state?.name; resourceInputs["namePrefix"] = state?.namePrefix; resourceInputs["readyForRotation"] = state?.readyForRotation; resourceInputs["secondsToLive"] = state?.secondsToLive; resourceInputs["serviceAccountId"] = state?.serviceAccountId; } else { const args = argsOrState; if (args?.earlyRotationWindowSeconds === undefined && !opts.urn) { throw new Error("Missing required property 'earlyRotationWindowSeconds'"); } if (args?.namePrefix === undefined && !opts.urn) { throw new Error("Missing required property 'namePrefix'"); } if (args?.secondsToLive === undefined && !opts.urn) { throw new Error("Missing required property 'secondsToLive'"); } if (args?.serviceAccountId === undefined && !opts.urn) { throw new Error("Missing required property 'serviceAccountId'"); } resourceInputs["deleteOnDestroy"] = args?.deleteOnDestroy; resourceInputs["earlyRotationWindowSeconds"] = args?.earlyRotationWindowSeconds; resourceInputs["namePrefix"] = args?.namePrefix; resourceInputs["secondsToLive"] = args?.secondsToLive; resourceInputs["serviceAccountId"] = args?.serviceAccountId; resourceInputs["expiration"] = undefined /*out*/; resourceInputs["hasExpired"] = undefined /*out*/; resourceInputs["key"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["readyForRotation"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["key"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(ServiceAccountRotatingToken.__pulumiType, name, resourceInputs, opts); } } exports.ServiceAccountRotatingToken = ServiceAccountRotatingToken; /** @internal */ ServiceAccountRotatingToken.__pulumiType = 'grafana:oss/serviceAccountRotatingToken:ServiceAccountRotatingToken'; //# sourceMappingURL=serviceAccountRotatingToken.js.map