@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
162 lines (161 loc) • 7.15 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* **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;
* ```
*/
export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: ServiceAccountRotatingTokenState, opts?: pulumi.CustomResourceOptions): ServiceAccountRotatingToken;
/**
* 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: any): obj is ServiceAccountRotatingToken;
/**
* Deletes the service account token in Grafana when the resource is destroyed in Terraform, instead of leaving it to expire at its `expiration` time. Use it with `lifecycle { createBeforeDestroy = true }` to make sure that the new token is created before the old one is deleted. Defaults to `false`.
*/
readonly deleteOnDestroy: pulumi.Output<boolean | undefined>;
/**
* Duration of the time window before expiring where the token can be rotated, in seconds.
*/
readonly earlyRotationWindowSeconds: pulumi.Output<number>;
/**
* The expiration date of the service account token.
*/
readonly expiration: pulumi.Output<string>;
/**
* The status of the service account token.
*/
readonly hasExpired: pulumi.Output<boolean>;
/**
* The key of the service account token.
*/
readonly key: pulumi.Output<string>;
/**
* The name of the service account token. It will start with `<name_prefix>-` and will have characters appended to it to make the name unique.
*/
readonly name: pulumi.Output<string>;
/**
* Prefix for the name of the service account tokens created by this resource. The actual name will be stored in the computed field `name`, which will be in the format `<name_prefix>-<additional_characters>`.
*/
readonly namePrefix: pulumi.Output<string>;
/**
* Signals that the service account token is expired or within the period to be early rotated.
*/
readonly readyForRotation: pulumi.Output<boolean>;
/**
* The token expiration in seconds.
*/
readonly secondsToLive: pulumi.Output<number>;
/**
* The ID of the service account to which the token belongs.
*/
readonly serviceAccountId: pulumi.Output<string>;
/**
* Create a ServiceAccountRotatingToken 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: ServiceAccountRotatingTokenArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ServiceAccountRotatingToken resources.
*/
export interface ServiceAccountRotatingTokenState {
/**
* Deletes the service account token in Grafana when the resource is destroyed in Terraform, instead of leaving it to expire at its `expiration` time. Use it with `lifecycle { createBeforeDestroy = true }` to make sure that the new token is created before the old one is deleted. Defaults to `false`.
*/
deleteOnDestroy?: pulumi.Input<boolean>;
/**
* Duration of the time window before expiring where the token can be rotated, in seconds.
*/
earlyRotationWindowSeconds?: pulumi.Input<number>;
/**
* The expiration date of the service account token.
*/
expiration?: pulumi.Input<string>;
/**
* The status of the service account token.
*/
hasExpired?: pulumi.Input<boolean>;
/**
* The key of the service account token.
*/
key?: pulumi.Input<string>;
/**
* The name of the service account token. It will start with `<name_prefix>-` and will have characters appended to it to make the name unique.
*/
name?: pulumi.Input<string>;
/**
* Prefix for the name of the service account tokens created by this resource. The actual name will be stored in the computed field `name`, which will be in the format `<name_prefix>-<additional_characters>`.
*/
namePrefix?: pulumi.Input<string>;
/**
* Signals that the service account token is expired or within the period to be early rotated.
*/
readyForRotation?: pulumi.Input<boolean>;
/**
* The token expiration in seconds.
*/
secondsToLive?: pulumi.Input<number>;
/**
* The ID of the service account to which the token belongs.
*/
serviceAccountId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a ServiceAccountRotatingToken resource.
*/
export interface ServiceAccountRotatingTokenArgs {
/**
* Deletes the service account token in Grafana when the resource is destroyed in Terraform, instead of leaving it to expire at its `expiration` time. Use it with `lifecycle { createBeforeDestroy = true }` to make sure that the new token is created before the old one is deleted. Defaults to `false`.
*/
deleteOnDestroy?: pulumi.Input<boolean>;
/**
* Duration of the time window before expiring where the token can be rotated, in seconds.
*/
earlyRotationWindowSeconds: pulumi.Input<number>;
/**
* Prefix for the name of the service account tokens created by this resource. The actual name will be stored in the computed field `name`, which will be in the format `<name_prefix>-<additional_characters>`.
*/
namePrefix: pulumi.Input<string>;
/**
* The token expiration in seconds.
*/
secondsToLive: pulumi.Input<number>;
/**
* The ID of the service account to which the token belongs.
*/
serviceAccountId: pulumi.Input<string>;
}