@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
180 lines (179 loc) • 7.09 kB
TypeScript
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:index/cloudAccessPolicy:CloudAccessPolicy name "{{ region }}:{{ policyId }}"
* ```
*
* @deprecated grafana.index/cloudaccesspolicy.CloudAccessPolicy has been deprecated in favor of grafana.cloud/accesspolicy.AccessPolicy
*/
export declare class CloudAccessPolicy extends pulumi.CustomResource {
/**
* Get an existing CloudAccessPolicy 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?: CloudAccessPolicyState, opts?: pulumi.CustomResourceOptions): CloudAccessPolicy;
/**
* Returns true if the given object is an instance of CloudAccessPolicy. 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 CloudAccessPolicy;
/**
* Conditions for the access policy.
*/
readonly conditions: pulumi.Output<outputs.CloudAccessPolicyCondition[] | 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.CloudAccessPolicyRealm[]>;
/**
* 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 CloudAccessPolicy 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.
*/
/** @deprecated grafana.index/cloudaccesspolicy.CloudAccessPolicy has been deprecated in favor of grafana.cloud/accesspolicy.AccessPolicy */
constructor(name: string, args: CloudAccessPolicyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering CloudAccessPolicy resources.
*/
export interface CloudAccessPolicyState {
/**
* Conditions for the access policy.
*/
conditions?: pulumi.Input<pulumi.Input<inputs.CloudAccessPolicyCondition>[]>;
/**
* 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.CloudAccessPolicyRealm>[]>;
/**
* 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 CloudAccessPolicy resource.
*/
export interface CloudAccessPolicyArgs {
/**
* Conditions for the access policy.
*/
conditions?: pulumi.Input<pulumi.Input<inputs.CloudAccessPolicyCondition>[]>;
/**
* 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.CloudAccessPolicyRealm>[]>;
/**
* 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>[]>;
}