@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
152 lines (151 loc) • 5.88 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* * [Official documentation](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/)
* * [API documentation](https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#create-a-token)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
* import * as grafana from "@pulumi/grafana";
*
* const current = grafana.getCloudOrganization({
* slug: "<your org slug>",
* });
* const testCloudAccessPolicy = new grafana.CloudAccessPolicy("testCloudAccessPolicy", {
* region: "us",
* displayName: "My Policy",
* scopes: [
* "metrics:read",
* "logs:read",
* ],
* realms: [{
* type: "org",
* identifier: current.then(current => current.id),
* labelPolicies: [{
* selector: "{namespace=\"default\"}",
* }],
* }],
* });
* const testCloudAccessPolicyToken = new grafana.CloudAccessPolicyToken("testCloudAccessPolicyToken", {
* region: "us",
* accessPolicyId: testCloudAccessPolicy.policyId,
* displayName: "My Policy Token",
* expiresAt: "2023-01-01T00:00:00Z",
* });
* ```
*/
export declare class CloudAccessPolicyToken extends pulumi.CustomResource {
/**
* Get an existing CloudAccessPolicyToken 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?: CloudAccessPolicyTokenState, opts?: pulumi.CustomResourceOptions): CloudAccessPolicyToken;
/**
* Returns true if the given object is an instance of CloudAccessPolicyToken. 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 CloudAccessPolicyToken;
/**
* ID of the access policy for which to create a token.
*/
readonly accessPolicyId: pulumi.Output<string>;
/**
* Creation date of the access policy token.
*/
readonly createdAt: pulumi.Output<string>;
/**
* Display name of the access policy token. Defaults to the name.
*/
readonly displayName: pulumi.Output<string | undefined>;
/**
* Expiration date of the access policy token. Does not expire by default.
*/
readonly expiresAt: pulumi.Output<string | undefined>;
/**
* Name of the access policy token.
*/
readonly name: pulumi.Output<string>;
/**
* Region of the access policy. Should be set to the same region as the access policy. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
*/
readonly region: pulumi.Output<string>;
readonly token: pulumi.Output<string>;
/**
* Last update date of the access policy token.
*/
readonly updatedAt: pulumi.Output<string>;
/**
* Create a CloudAccessPolicyToken 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: CloudAccessPolicyTokenArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering CloudAccessPolicyToken resources.
*/
export interface CloudAccessPolicyTokenState {
/**
* ID of the access policy for which to create a token.
*/
accessPolicyId?: pulumi.Input<string>;
/**
* Creation date of the access policy token.
*/
createdAt?: pulumi.Input<string>;
/**
* Display name of the access policy token. Defaults to the name.
*/
displayName?: pulumi.Input<string>;
/**
* Expiration date of the access policy token. Does not expire by default.
*/
expiresAt?: pulumi.Input<string>;
/**
* Name of the access policy token.
*/
name?: pulumi.Input<string>;
/**
* Region of the access policy. Should be set to the same region as the access policy. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
*/
region?: pulumi.Input<string>;
token?: pulumi.Input<string>;
/**
* Last update date of the access policy token.
*/
updatedAt?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a CloudAccessPolicyToken resource.
*/
export interface CloudAccessPolicyTokenArgs {
/**
* ID of the access policy for which to create a token.
*/
accessPolicyId: pulumi.Input<string>;
/**
* Display name of the access policy token. Defaults to the name.
*/
displayName?: pulumi.Input<string>;
/**
* Expiration date of the access policy token. Does not expire by default.
*/
expiresAt?: pulumi.Input<string>;
/**
* Name of the access policy token.
*/
name?: pulumi.Input<string>;
/**
* Region of the access policy. Should be set to the same region as the access policy. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
*/
region: pulumi.Input<string>;
}