UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

177 lines (176 loc) 6.74 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * * [Official documentation](https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/) * * [API documentation](https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#create-an-access-policy) * * Required access policy scopes: * * * accesspolicies:read * * accesspolicies:write * * accesspolicies:delete * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumi/grafana"; * import * as grafana from "@pulumiverse/grafana"; * * const current = grafana.cloud.getOrganization({ * slug: "<your org slug>", * }); * const test = new grafana.cloud.AccessPolicy("test", { * region: "prod-us-east-0", * name: "my-policy", * displayName: "My Policy", * scopes: [ * "metrics:read", * "logs:read", * ], * realms: [{ * type: "org", * identifier: current.then(current => current.id), * labelPolicies: [{ * selector: "{namespace=\"default\"}", * }], * }], * }); * const testAccessPolicyToken = new grafana.cloud.AccessPolicyToken("test", { * region: "prod-us-east-0", * accessPolicyId: test.policyId, * name: "my-policy-token", * displayName: "My Policy Token", * expiresAt: "2023-01-01T00:00:00Z", * }); * ``` * * ## Import * * ```sh * $ pulumi import grafana:cloud/accessPolicy:AccessPolicy name "{{ region }}:{{ policyId }}" * ``` */ export declare class AccessPolicy extends pulumi.CustomResource { /** * Get an existing AccessPolicy 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?: AccessPolicyState, opts?: pulumi.CustomResourceOptions): AccessPolicy; /** * Returns true if the given object is an instance of AccessPolicy. 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 AccessPolicy; /** * Conditions for the access policy. */ readonly conditions: pulumi.Output<outputs.cloud.AccessPolicyCondition[] | undefined>; /** * Creation date of the access policy. */ readonly createdAt: pulumi.Output<string>; /** * Display name of the access policy. Defaults to the name. */ readonly displayName: pulumi.Output<string | undefined>; /** * Name of the access policy. */ readonly name: pulumi.Output<string>; /** * ID of the access policy. */ readonly policyId: pulumi.Output<string>; readonly realms: pulumi.Output<outputs.cloud.AccessPolicyRealm[]>; /** * Region where the API is deployed. Generally where the stack is deployed. 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>; /** * Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values. */ readonly scopes: pulumi.Output<string[]>; /** * Last update date of the access policy. */ readonly updatedAt: pulumi.Output<string>; /** * Create a AccessPolicy 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: AccessPolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AccessPolicy resources. */ export interface AccessPolicyState { /** * Conditions for the access policy. */ conditions?: pulumi.Input<pulumi.Input<inputs.cloud.AccessPolicyCondition>[]>; /** * Creation date of the access policy. */ createdAt?: pulumi.Input<string>; /** * Display name of the access policy. Defaults to the name. */ displayName?: pulumi.Input<string>; /** * Name of the access policy. */ name?: pulumi.Input<string>; /** * ID of the access policy. */ policyId?: pulumi.Input<string>; realms?: pulumi.Input<pulumi.Input<inputs.cloud.AccessPolicyRealm>[]>; /** * Region where the API is deployed. Generally where the stack is deployed. 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>; /** * Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values. */ scopes?: pulumi.Input<pulumi.Input<string>[]>; /** * Last update date of the access policy. */ updatedAt?: pulumi.Input<string>; } /** * The set of arguments for constructing a AccessPolicy resource. */ export interface AccessPolicyArgs { /** * Conditions for the access policy. */ conditions?: pulumi.Input<pulumi.Input<inputs.cloud.AccessPolicyCondition>[]>; /** * Display name of the access policy. Defaults to the name. */ displayName?: pulumi.Input<string>; /** * Name of the access policy. */ name?: pulumi.Input<string>; realms: pulumi.Input<pulumi.Input<inputs.cloud.AccessPolicyRealm>[]>; /** * Region where the API is deployed. Generally where the stack is deployed. 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>; /** * Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values. */ scopes: pulumi.Input<pulumi.Input<string>[]>; }