UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

285 lines (284 loc) 9.45 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../../types/input"; import * as outputs from "../../types/output"; /** * Manages Grafana Git Sync repositories for provisioning dashboards and related resources. * * ## Example Usage * * ### GitHub Repository with Token Authentication * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const example = new grafana.apps.v0alpha1.ProvisioningRepository("example", { * metadata: { * uid: "my-github-folder-repo", * }, * spec: { * title: "My GitHub Folder Repository", * description: "Folder-scoped GitHub repository authenticated directly with a token", * type: "github", * workflows: [ * "write", * "branch", * ], * sync: { * enabled: true, * target: "folder", * intervalSeconds: 60, * }, * github: { * url: "https://github.com/example/grafana-dashboards", * branch: "main", * path: "grafanatftest", * }, * webhook: { * baseUrl: "https://grafana.example.com", * }, * }, * secure: { * token: { * create: "replace-me", * }, * }, * secureVersion: 1, * }); * ``` * * ### Bitbucket Repository with Token Authentication - Enterprise/Cloud only * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const bitbucketToken = new grafana.apps.v0alpha1.ProvisioningRepository("bitbucket_token", { * metadata: { * uid: "my-bitbucket-folder-repo", * }, * spec: { * title: "My Bitbucket Folder Repository", * description: "Folder-scoped Bitbucket repository authenticated directly with an Atlassian API token", * type: "bitbucket", * workflows: [ * "write", * "branch", * ], * sync: { * enabled: true, * target: "folder", * intervalSeconds: 60, * }, * bitbucket: { * url: "https://bitbucket.org/example/grafana-dashboards", * branch: "main", * path: "grafanatftest", * tokenUser: "x-bitbucket-api-token-auth", * }, * }, * secure: { * token: { * create: "replace-me", * }, * }, * secureVersion: 1, * }); * ``` * * ### GitLab Repository with Token Authentication - Enterprise/Cloud only * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const gitlabToken = new grafana.apps.v0alpha1.ProvisioningRepository("gitlab_token", { * metadata: { * uid: "my-gitlab-folder-repo", * }, * spec: { * title: "My GitLab Folder Repository", * description: "Folder-scoped GitLab repository authenticated directly with a token", * type: "gitlab", * workflows: [ * "write", * "branch", * ], * sync: { * enabled: true, * target: "folder", * intervalSeconds: 60, * }, * gitlab: { * url: "https://gitlab.com/example/grafana-dashboards", * branch: "main", * path: "grafanatftest", * }, * }, * secure: { * token: { * create: "replace-me", * }, * }, * secureVersion: 1, * }); * ``` * * ### Generic Git Repository * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const pureGit = new grafana.apps.v0alpha1.ProvisioningRepository("pure_git", { * metadata: { * uid: "my-pure-git-folder-repo", * }, * spec: { * title: "My Pure Git Folder Repository", * description: "Folder-scoped generic Git repository authenticated with a token", * type: "git", * workflows: ["write"], * sync: { * enabled: true, * target: "folder", * intervalSeconds: 60, * }, * git: { * url: "https://git.example.com/platform/dashboards.git", * branch: "main", * path: "grafanatftest", * tokenUser: "git", * }, * }, * secure: { * token: { * create: "replace-me", * }, * }, * secureVersion: 1, * }); * ``` * * ### Local Filesystem Repository * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const localRepo = new grafana.apps.v0alpha1.ProvisioningRepository("local_repo", { * metadata: { * uid: "my-local-folder-repo", * }, * spec: { * title: "My Local Folder Repository", * description: "Folder-scoped local filesystem repository", * type: "local", * workflows: ["write"], * sync: { * enabled: true, * target: "folder", * intervalSeconds: 60, * }, * local: { * path: "/usr/share/grafana/conf/provisioning/my-local-repo", * }, * }, * }); * ``` */ export declare class ProvisioningRepository extends pulumi.CustomResource { /** * Get an existing ProvisioningRepository 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?: ProvisioningRepositoryState, opts?: pulumi.CustomResourceOptions): ProvisioningRepository; /** * Returns true if the given object is an instance of ProvisioningRepository. 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 ProvisioningRepository; /** * The metadata of the resource. */ readonly metadata: pulumi.Output<outputs.apps.v0alpha1.ProvisioningRepositoryMetadata | undefined>; /** * Options for applying the resource. */ readonly options: pulumi.Output<outputs.apps.v0alpha1.ProvisioningRepositoryOptions | undefined>; /** * Sensitive credentials. Values are write-only and never stored in Terraform state. */ readonly secure: pulumi.Output<outputs.apps.v0alpha1.ProvisioningRepositorySecure | undefined>; /** * Set this to 1 when using `secure`, then increment it to trigger re-application of secure values. */ readonly secureVersion: pulumi.Output<number | undefined>; /** * The spec of the resource. */ readonly spec: pulumi.Output<outputs.apps.v0alpha1.ProvisioningRepositorySpec | undefined>; /** * Create a ProvisioningRepository 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?: ProvisioningRepositoryArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ProvisioningRepository resources. */ export interface ProvisioningRepositoryState { /** * The metadata of the resource. */ metadata?: pulumi.Input<inputs.apps.v0alpha1.ProvisioningRepositoryMetadata>; /** * Options for applying the resource. */ options?: pulumi.Input<inputs.apps.v0alpha1.ProvisioningRepositoryOptions>; /** * Sensitive credentials. Values are write-only and never stored in Terraform state. */ secure?: pulumi.Input<inputs.apps.v0alpha1.ProvisioningRepositorySecure>; /** * Set this to 1 when using `secure`, then increment it to trigger re-application of secure values. */ secureVersion?: pulumi.Input<number>; /** * The spec of the resource. */ spec?: pulumi.Input<inputs.apps.v0alpha1.ProvisioningRepositorySpec>; } /** * The set of arguments for constructing a ProvisioningRepository resource. */ export interface ProvisioningRepositoryArgs { /** * The metadata of the resource. */ metadata?: pulumi.Input<inputs.apps.v0alpha1.ProvisioningRepositoryMetadata>; /** * Options for applying the resource. */ options?: pulumi.Input<inputs.apps.v0alpha1.ProvisioningRepositoryOptions>; /** * Sensitive credentials. Values are write-only and never stored in Terraform state. */ secure?: pulumi.Input<inputs.apps.v0alpha1.ProvisioningRepositorySecure>; /** * Set this to 1 when using `secure`, then increment it to trigger re-application of secure values. */ secureVersion?: pulumi.Input<number>; /** * The spec of the resource. */ spec?: pulumi.Input<inputs.apps.v0alpha1.ProvisioningRepositorySpec>; }